import {selectDialogMixins} from '@base/mixins/selectDialog/index.js';
import tableForm from "@base/components/table/tableForm.vue";

let modules = {};
modules = {
  props: ['visiable', 'multi', 'rows', 'param'],
  mixins: [selectDialogMixins],
  components: {tableForm},
  created() {
    this.initSetting();
  },
  mounted() {
    this.initTableM1();
  },
  data() {
    return {
      showDialog: true,
      falseValue: false,
      selectMulti: true,
      formData: {},
      vxeOption: {},
      showSaleOrgDialog: false
    };
  },
  methods: {
    initTableM1() {
      let that = this;
      let tableOption = {
        vue: that,
        tableRef: 'table-m1',
        tableName: 'bd_attach_setting_dialog-m1',
        path: USER_PREFIX + '/bd_attach_setting/listPage',
        param: () => {
          return {
            ...this.formData,
            type: "importTemplate"
          }
        },
        columns: [
          {type: 'checkbox', width: 48, resizable: false, fixed: 'left'},
          {
            title: this.$t1('模板文件名称'),
            field: 'name',
            width: 180,
            fixed: 'left'
          },
          {
            title: this.$t1('模板文件编码'),
            field: 'code',
            width: 180
          },
          {title: this.$t1('表单分类'), field: 'menuKindName', width: 150},
          {
            title: this.$t1('备注'),
            field: 'remark',
            width: 250
          },
          {
            field: 'createDate',
            title: this.$t1('创建时间'),
            width: 150
          },
          {
            width: 47,
            fixed: 'right',
            title: '',
            sortable: false
          }
        ],
        searchColumns: [
          {title: this.$t1('模板文件名称'), field: "name", type: "input", common: true},
          {title: this.$t1('模板文件编码'), field: "code", type: "input", common: true},
          {title: this.$t1('备注'), field: "remark", type: "input", common: true},
        ],
        config: {
          checkboxConfig: {
            checkStrictly: true,
            showHeader: this.selectMulti,
            trigger: 'row'
          }
        }
      };
      this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
        that.vxeOption = opts;
      });
    },
  }
};
export default modules
