/**version-1.0*/
let tmixins = {};
tmixins = {
  props: ["dataId", "type", "parentTarget", 'option'],
  data() {
    return {
      oplogDTOs: [],
      m1Option: {}
    };
  },
  computed: {
    target: function () {
      return this.parentTarget || this;
    }
  },
  mounted() {
    this.initOplogDTOs();
  },
  methods: {
    initOplogDTOs() {
      const tableOption = {
        vue: this,
        tableRef: 'table-m1',
        tableName: 'component-form_oplog-m1Grid',
        columns: [{
          type: 'checkbox',
          fixed: 'left',
          width: 48,
          resizable: false
        },
          {
            title: this.$t1('操作时间'),
            field: 'createDate',
            width: 150
          },
          {
            title: this.$t1('操作人员'),
            field: 'createBy',
            width: 150
          },
          {
            title: this.$t1('操作日志'),
            field: 'logContent',
            width: 150
          },
          {
            title: this.$t1('版本号'),
            field: 'version',
            width: 150
          },
          {
            width: 47,
            fixed: 'right',
            title: '',
            sortable: false
          }
        ]
      };
      this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
        this.m1Option = opts;
      });

    },
    initData(option) {
      let data = option.param ? option.param() : {};
      let url = option.url || (USER_PREFIX + '/form_oplog/listPage');
      this.target.$commonHttp({
        aes: true,
        url: url,
        method: `post`,
        data: {
          ...data,
          searchCount: false
        },
        isLoading: true,
        modalStrictly: true,
        success: res => {
          let rows = res.objx ? (res.objx.records || res.objx || []) : [];
          this.oplogDTOs = rows;
        }
      });
    },
  }
};
export const mixins = tmixins
