import {selectDialogMixins} from "@base/mixins/selectDialog";

let modules = {};
modules = {
  name: 'ftHistoryDialog',
  props: ['visiable', 'multi', 'rows', 'param', 'formCode'],
  mixins: [selectDialogMixins],
  components: {},
  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_ft_history_dialog-m1',
        path: USER_PREFIX + '/formTemplate/listPage',
        param: () => {
          return {
            history: true,
            formCode: this.formCode,
            ...this.formData,
            ...this.param
          };
        },
        columns: [
          {type: 'checkbox', width: 48, resizable: false, fixed: 'left'},
          {
            title: this.$t1('模板名称'),
            field: 'formName',
            width: 150,
            fixed: 'left'
          },
          {
            title: this.$t1('模板编码'),
            field: 'formCode',
            width: 150
          },
          {
            title: this.$t1('模板版本'),
            field: 'formVersion',
            width: 150
          },
          {
            title: this.$t1('表单分类'),
            field: 'menuKindName',
            width: 150,
          },
          {
            title: this.$t1('备注'),
            field: 'remark',
            width: 150
          },
          {
            title: this.$t1('创建时间'),
            field: 'createDate',
            width: 150
          },
          {
            width: 47,
            fixed: 'right',
            title: '',
            sortable: false
          }
        ],
        config: {
          checkboxConfig: {
            checkStrictly: true,
            showHeader: this.selectMulti,
            trigger: 'row'
          }
        }
      };
      this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
        that.vxeOption = opts;
      });
    },
  }
};
export default modules
