<template>
   <a-tabs :activeKey='tabKey' @change="callback">
     <!-- DVP计划 -->
     <a-tab-pane :key="'1'" :tab="$t('header.dvp-plan')">
       <dvpPlan ref="dvpPlan" />
     </a-tab-pane>
     <!-- DVP频次 -->
     <a-tab-pane :key="'2'" :tab="$t('dvp.full.vehicle.dvp.dvp-frequency')">
       <edit-dvp-frequency ref="dvpFrequency" />
     </a-tab-pane>
   </a-tabs>
</template>

<script>

import editDvpFrequency from "./components/dvpFrequency";
import dvpPlan from "./components/dvpPlan";

export default {
  name: "EditTabs",
  components: {
    editDvpFrequency,
    dvpPlan
  },
  data() {
    return {
      tabKey: '1',
      isEdit: false,
      testId: undefined,
      editDvpTittle: undefined
    };
  },

  mounted() {

  },
  methods: {
    /**
     * 编辑整车DVP弹框 tab回调函数
     * @param key
     */
    callback(key) {
      this.tabKey = key;
      switch (this.tabKey) {
        case '1':
          this.editDvpTittle = this.$t('header.dvp-plan');
          break;
        case '2':
          this.editDvpTittle = this.$t('dvp.full.vehicle.dvp.dvp-frequency');
          // 标记当前tab为DVP频次
          break;
        default:
          this.editDvpTittle = this.$t('header.dvp-plan');
          break;
      }
    },
  }
};
</script>
<style lang='less' scoped>
.text-right {
  text-align: right;
}
</style>
