<template>
  <div>
    <cms-query-table
      ref="userTable"
      :tools-bar="toolsBarConfig"
      :query-params="queryForm"
      :show-search-form="false"
      :show-loading="true"
      :fixed-height="true"
      :height="300"
      :columns="columns"
      :form-item-config="configItem"
      :request-call="this.$http.tables.dynamicTableUrl"
      :search-method="searchClick">
      <cms-query-table-column field="a"></cms-query-table-column>
    </cms-query-table>
  </div>
</template>

<script>
import { dictionaryMix, formConfigMix, mixTableConfig, mixTableConstants, pageInitMix, } from "../../package";

export default {
  name: "dynamic-table-demo",
  mixins: [ dictionaryMix, pageInitMix, mixTableConstants, mixTableConfig, formConfigMix ],
  data() {
    return {
      queryForm: {},
      dialogForm: {
        aa: undefined
      },
      modalVisible: false,
      modalVisible1: false,
      expandRowKeys: [],
    }
  },
  created() {
  },
  methods: {
    searchClick() {
      console.log('点击了搜索')
    }
  },
  computed: {
    configItem() {
      return [
        {
          label: '登录账户',
          prop: "account",
        },
      ]
    },
    toolsBarConfig() {
      return []
    },
    columns() {
      return [ {
        title: '真实姓名',
        field: 'realName',
        width: 200
      }, {
        ...mixTableConfig.default,
        title: '测试标题',
        field: 'b',
        width: 200
      }, {
        ...mixTableConfig.default,
        title: '身份证类型',
        field: 'cardType',
        width: 200
      }, {
        title: '身份证好号码',
        field: 'idCard',
        width: 200
      }, {
        title: '是否启用',
        field: 'enable',
        width: 200
      }, {
        title: '创建时间',
        field: 'createTime',
        width: 300
      }, {
        ...mixTableConfig.default,
        title: '备注',
        field: 'remark',
        width: 500,
      } ]
    },
    staticDataSource() {
      return [ {
        a: 1,
        b: 2,
        c: 3,
        d: 4,
        e: 5
      } ]
    }
  }
}
</script>

<style scoped>

</style>