<!--
@name: 操作日志表格
@author: 张泽贤
@time: 2022-08-29
@doc:
-->
<template>
  <t-table
    ref="auditNodeTable"
    dragle
    bordered
    row-key="id"
    :scroll="{ x: true }"
    :vScrollX="{enabled:false}"
    :vScrollY="{enabled:true,rows:4}"
    :columns="auditNode_columns"
    :data-source.sync="auditNode_dataSource"
    :remote-url="auditNode_listRemoteUrl"
    :remoteData="auditNode_listParams"
    :rowSelectType="false"
    :autoLoad="false"
    :pagination="false"
  >
  </t-table>
</template>

<script>
import { auditNode_listRemoteUrl } from '../js/api.js';
import { setOperationLogColumns } from '../js/tableConfig.js';

export default {
  props: {
    contractNo: {
      type: String,
      default: '',
    },
    isShow: {
      type: Boolean,
      default: false,
    },
  },
  watch: {
    contractNo(val) {
      if (val && this.isShow) {
        this.auditNode_listParams = {
          contractNo: val,
        };
      } else {
        this.dataSource = [];
      }
    },
  },
  data() {
    return {
      auditNode_columns: setOperationLogColumns(this),
      auditNode_dataSource: [],
      auditNode_listRemoteUrl,
      auditNode_listParams: {},
    };
  },
  methods: {
    reload(args) {
      this.dataSource = [];
      this.$refs.auditNodeTable.reload({
        data: {
          contractNo: this.contractNo,
        },
      });
    },
  },
};
</script>