  <template>
  <div class="eContainer">
    <el-form
      :model="model"
      :rules="rules"
      ref="modelForm"
      label-width="200px"
      size="small"
      :validate-on-rule-change="false"
    >
      <c-tabs v-model="tabVal" ref="elment" type="card" @tab-click="tabClick">
        <!--PD000010 -->
        <el-tab-pane label="Manager for Incoming Messages" name="tskmgr">
          <m-tskmgr :model="model" :codes="codes" />
        </el-tab-pane>

        <el-tab-pane label="Incoming SWIFT" name="srvswi">
          <m-srvswi :model="model" :codes="codes" />
        </el-tab-pane>

        <el-tab-pane label="TradeConnect" name="Srvtci">
          <m-srvtci :model="model" :codes="codes" />
        </el-tab-pane>

        <el-tab-pane label="Telex" name="Srvtli">
          <m-srvtli :model="model" :codes="codes" />
        </el-tab-pane>

        <el-tab-pane label="DTA Export L/C" name="Srvdte">
          <m-srvdte :model="model" :codes="codes" />
        </el-tab-pane>

        <el-tab-pane label="DTA Import L/C" name="Srvdta">
          <m-srvdta :model="model" :codes="codes" />
        </el-tab-pane>

        <el-tab-pane label="E-mail" name="Srvemi">
          <m-srvemi :model="model" :codes="codes" />
        </el-tab-pane>

        <el-tab-pane label="ECL Import L/C" name="Srveli">
          <m-srveli :model="model" :codes="codes" />
        </el-tab-pane>
      </c-tabs>
    </el-form>
  </div>
</template>
<script>
import Api from "~/service/Api";
import Utils from "~/utils/index";
import CodeTable from "~/config/CodeTable";
import Switsk from "~/model/Switsk";
import commonProcess from "~/mixin/commonProcess";
import Check from "~/model/Switsk/Check";
import Default from "~/model/Switsk/Default";
import Pattern from "~/model/Switsk/Pattern";
import Tskmgr from "./Tskmgr";
import Srvswi from "./Srvswi";
import Srvtci from "./Srvtci";
import Srvtli from "./Srvtli";
import Srvdte from "./Srvdte";
import Srvdta from "./Srvdta";
import Srvemi from "./Srvemi";
import Srveli from "./Srveli";

export default {
  name: "Switsk",
  components: {
    "m-tskmgr": Tskmgr,
    "m-srvswi": Srvswi,
    "m-srvtci": Srvtci,
    "m-srvtli": Srvtli,
    "m-srvdte": Srvdte,
    "m-srvdta": Srvdta,
    "m-srvemi": Srvemi,
    "m-srveli": Srveli,
  },
  provide() {
    return {
      root: this,
    };
  },
  mixins: [commonProcess], // 里面包含了Default、Check等的公共处理
  data() {
    return {
      tabVal: "tskmgr",
      trnName: "switsk",
      model: new Switsk().data,
      checkRules: Check,
      defaultRules: Default,
      pattern: Pattern,
      rules: null,
      codes: { ...CodeTable },
    };
  },
  methods: {
    tabClick() {},
  },
  created: async function () {
    console.log("进入switsk交易");
    let rtnmsg = await this.init({});
    if (rtnmsg.respCode == SUCCESS) {
      //TODO 处理数据逻辑
      Utils.copyValueFromVO(this.model, rtnmsg.data);
    } else {
      this.$notify.error({ title: "错误", message: "服务请求失败！" });
    }
  },
};
</script>
<style>
</style>
