<!--
 * @Author: zwq
 * @Date: 2023-01-04 10:29:40
 * @LastEditors: zwq
 * @LastEditTime: 2023-06-30 16:24:04
 * @Description: 
-->
<template>
  <el-tabs v-model="activeName"  type="border-card" @tab-click="handleClick">
    <el-tab-pane label="(D0)启动CAR" name="D0">
      <tabD0
        v-show="D0Visible"
        ref="D0Ref"
        />
    </el-tab-pane>
    <el-tab-pane label="(D1)初步分析" name="D1">
      <tabD1
        v-show="D1Visible"
        ref="D1Ref"
        />
    </el-tab-pane>
    <el-tab-pane label="(D2)创建团队" name="D2">
      <tabD2
        v-show="D2Visible"
        ref="D2Ref"
        />
    </el-tab-pane>
    <el-tab-pane label="(D3)临时处理措施" name="D3">
      <tabD3
        v-show="D3Visible"
        ref="D3Ref"
        />
    </el-tab-pane>
    <el-tab-pane label="(D4)根本原因分析" name="D4">
      <tabD4
        v-show="D4Visible"
        ref="D4Ref"
        />
    </el-tab-pane>
    <el-tab-pane label="(D5)纠正措施描述" name="D5">
      <tabD5
        v-show="D5Visible"
        ref="D5Ref"
        />
    </el-tab-pane>
    <el-tab-pane label="(D6)有效性验证" name="D6">
      <tabD6
        v-show="D6Visible"
        ref="D6Ref"
        />
    </el-tab-pane>
    <el-tab-pane label="(D7)预防再发生" name="D7">
      <tabD7
        v-show="D7Visible"
        ref="D7Ref"
        />
    </el-tab-pane>
    <el-tab-pane label="(D8)总结与经验分享" name="D8">
      <tabD8
        v-show="D8Visible"
        ref="D8Ref"
        />
    </el-tab-pane>
  </el-tabs>
</template>

<script>
import tabD0 from "./eightDisciplineList-D0"
import tabD1 from "./eightDisciplineList-D1"
import tabD2 from "./eightDisciplineList-D2"
import tabD3 from "./eightDisciplineList-D3"
import tabD4 from "./eightDisciplineList-D4"
import tabD5 from "./eightDisciplineList-D5"
import tabD6 from "./eightDisciplineList-D6"
import tabD7 from "./eightDisciplineList-D7"
import tabD8 from "./eightDisciplineList-D8"
export default {
  components: {
    tabD0,tabD1,tabD2,
    tabD3,tabD4,tabD5,
    tabD6,tabD7,tabD8,
  },
  data() {
    return {
      visible: false,
      activeName: "D0",
      D0Visible: false,
      D1Visible: false,
      D2Visible: false,
      D3Visible: false,
      D4Visible: false,
      D5Visible: false,
      D6Visible: false,
      D7Visible: false,
      D8Visible: false,
    };
  },
  computed: {
    dataRule() {
      return {
        id: ''
      };
    },
  },
  methods: {
    init(id) {
      this.id = id
      this.visible = true;
      this.D0Visible = true
      this.oldTab = 'D0Visible'
      this.$nextTick(() => {
          this.$refs.D0Ref.init(this.id);
      });
    },
    handleClick(val) {
        this[this.oldTab] = false;
        this[val.name+'Visible'] = true;
        this.oldTab = val.name+'Visible'
        this.$nextTick(() => {
          this.$refs[val.name+'Ref'].init(this.id);
        });
    },
    dataFormSubmit() {
      this.$emit("refreshDataList");
    },
    formClear() {},
  },
};
</script>
