<template>
  <div class="eContainer-search">
    <el-form :model="model" :rules="rules" ref="modelForm" label-width="120px" label-position="right" size="small" :validate-on-rule-change="false">
       <c-content>
        <m-infsea
          v-show="!showPanel"
          @updateShowPanel="updateShowPanel($event)"
          :model="model"
          :codes="codes"
          ref="infsea"/>
      </c-content>
       <c-button
               v-show="showPanel"
               style="margin-left: 75%; bottom: 10%; position: sticky"
               size="small"
               @click="goBack()">
               <!-- @click="getDitSelInfo(scope.$index, scope.row)" -->
               返回
          </c-button>
    </el-form>
  </div>
</template>
<script>
import Api from "~/service/Api"
import CodeTable from "~/config/CodeTable"
import Inftrd from "~/model/Inftrd"
import commonProcess from "~/mixin/commonProcess"
import Check from "~/model/Inftrd/Check"
import Default from "~/model/Inftrd/Default"
import Pattern from "~/model/Inftrd/Pattern"
import Infsea from "./Infsea"


export default {
    name: "Inftrd",
    components:{
        "m-infsea" : Infsea,
    },
    provide() {
        return {
            root: this
        }
    },
    mixins: [commonProcess],    // 里面包含了Default、Check等的公共处理
    data(){
        return {
            tabVal: "infsea",
            trnName: "inftrd",
            trnType: "",
            model: new Inftrd().data,
            checkRules: Check,
            defaultRules: Default,
            pattern: Pattern,
            rules: null,
            showPanel:false,
            codes: {...CodeTable},
        }
    },
    methods:{
        myTabClick(tab){
            this.tabClick(tab)
            /**
            *  do it yourself
            **/
        }
    },
    initPanel(val) {
      if (val) {
        this.tabVal = "infsea";
        //
      } else {
        this.tabVal = "";
      }
    },
      async updateShowPanel(value) {
      this.showPanel = value;
      this.initPanel(value);
    },
    goBack() {
      this.showPanel = false;
    },
    created:async function(){
        console.log("进入inftrd交易");
        let rtnmsg = await this.init({})
        if(rtnmsg.respCode == SUCCESS)
        {
           this.updateModel(rtnmsg.data)
           //TODO 处理数据逻辑

        }
        else
        {
            this.$notify.error({title: '错误',message: '服务请求失败!'});
        }
    }
}
</script>
<style>

</style>