<template>
  <a-modal
    :open="dialogFormVisible"
    :title="currentObjectName + '复核'"
    :footer="null"
    width="100%"
    @cancel="closeDialog">
    <a-layout>
      <a-layout-content id="dxdcListMain">
        <a-tabs v-model="currentViewId" type="card" @tabClick="tabIndexChange">
          <a-tab-pane v-for="option in options" :key="option.label" :tab="option.label">
            <component
              :is="option.value"
              :objType="objType"
              :openType="openType"
              :currentObjectRgstrId="currentObjectRgstrId"
              :currentObjectName="currentObjectName"
              :currentBaseId="currentBaseId"
              :currentObjectId="currentObjectId"
              :activeLabel="activeLabel"
              @cancelHandler="cancelHandler"
              @addQiTaSuccess="addQiTaSuccess"></component>
          </a-tab-pane>
        </a-tabs>
      </a-layout-content>
    </a-layout>
  </a-modal>
</template>

<script>
import jichuxinxi from './baseInfo.vue';
import problemList from './problemList.vue';

export default {
  components: {
    jichuxinxi,
    problemList,
  },
  props: [
    'rowData',
    'currentObjectRgstrId',
    'currentBaseId',
    'currentObjectId',
    'currentObjectName',
    'objType',
    'openType',
  ],
  data() {
    return {
      options: [
        {
          value: 'jichuxinxi',
          label: '问题复核',
        },
        {
          value: 'problemList',
          label: '问题清单',
        },
      ],
      value: '',
      currentViewId: '问题复核',
      dialogFormVisible: true,
      activeLabel: '',
    };
  },
  computed: {
    persId() {
      return localStorage.getItem('persId')
        ? localStorage.getItem('persId')
        : '1098101939614724096';
    },
  },
  mounted() {},
  created() {},
  methods: {
    cancelHandler() {
      this.$emit('cancelHandler');
    },
    addQiTaSuccess() {
      this.$emit('addQiTaSuccess');
    },
    closeDialog() {
      this.$confirm({
        title: '提示',
        content: '确认退出吗？',
        okType: 'warning',
        onOk: () => {
          this.$emit('cancelHandler');
        },
      });
    },
    tabIndexChange(item) {
      if (item == '问题清单') {
        this.activeLabel = item;
      } else {
        this.activeLabel = '';
      }
    },
  },
};
</script>

<style lang='less' scoped>
:deep(.ant-modal) {
  top: 0;
}
</style>
