/*
 *@description:
 *@author: hudw
 *@date: 2022-03-14 15:14:53
*/
<template>
  <t-table
    :activeKey="activeID"
    :id="$route.meta.menuId + '_childrenTable_fee'"
    :selectedRowKeys="selectedRowKeys"
    :scroll="{ x: true }"
    :vScrollX="{enabled:false}"
    :vScrollY="{enabled:true,rows:4}"
    :dataSource="dataSource"
    ref="childrenTable"
    bordered
    :autoLoad="false"
    :columns="mx_columns"
    :remoteUrl="mx_remoteUrl"
    :remoteBefore="remoteBefore||s_remoteBefore"
    dragle
    :pagination="20"
    :rowSelectType="0"
  >
  </t-table>
</template>
<script>
import setMainColumns from '@/views/BMS/$common/tableConfig/feeColumns.js'
export default {
  props: {
    options: {
      type: Object,
      default: () => {},
    },
    isShow: {
      type: Boolean,
      default: false,
    },
    currentRow: {
      type: Object,
      default: () => null,
    },
    selectedRowKeys: {
      type: Array,
      default: () => [],
    },
    tableExtendedField: {
      type: Array,
    },
    getFieldsValue: {
      type: Function,
    },
    remoteBefore: {
      type: Function,
    },
    mainRowKey: { type: null },
    activeID: {
      type: null,
    },
    url: {
      type: null,
    },
    columns: {
      type: null,
    },

  },
  data() {
   const mx_remoteUrl={
        method: 'post',
        url: this.url,
      }
    return {
      confirmLoading: false,
      dataSource: [],
      mx_remoteUrl,
      mx_remoteParams: {},
      mx_columns: !this.columns ? setMainColumns(this, this.tableExtendedField) : this.columns,

    }
  },
  mounted() {},
  watch: {


    tableExtendedField(value) {
      if (value.length > 0) {
        this.mx_columns = setMainColumns(this, value)
      }
    },
  },
  methods: {
    s_remoteBefore(vnode, res) {
      res.params =res.data

    },
    reload(args) {

      this.dataSource = []
      this.$refs.childrenTable.reload(args)
    },
  },
}
</script>
