<template>
  <a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
    <h1 style="margin:20px auto; text-align: center"> 初始化导入 </h1>
    <a-card title="导入列表">
      <a-card-grid v-for="(name, index) in names" :key="name" style="width:25%;text-align:center" @click="doImport(index)">
        {{ name }}
      </a-card-grid>
    </a-card>
    <import-form-add ref="importModal"/>
  </a-card>
</template>

<script>
import ImportFormAdd from './modules/ImportFormAdd'
export default {
  name: 'ImportExcel',
  components: {
    ImportFormAdd
  },
  data () {
    return {
      confirmLoading: false,
      modalTitle: null,
      configMap: {},
      names: ['部位类型', '设备类型', '设备位置', '生产商', '设备台账'],
      factoryStr: null,
      form: this.$form.createForm(this),
      visible: true,
      user: this.$store.getters.userInfo
    }
  },
  props: {
  },
  created () {
  },
  methods: {
    base (record) {
      this.visible = true
      // 如果是空标识添加
      if (this.BaseTool.Object.isBlank(record)) {
        this.modalTitle = '导入'
        this.data = []
      }
    },
    doImport (index) {
      console.log(index)
      this.$refs.importModal.base(index)
    }
  }
}
</script>
