<template>
  <div>
    <cms-query-table
      ref="userTable"
      :tools-bar="toolsBarConfig"
      :query-params="queryForm"
      :columns="columnsConfig"
      :fixed-height="true"
      :height="300"
      :form-item-config="configItem"
      :request-call="staticDataSource"
      :search-method="searchClick"
    >
      <template slot="account">
        <cms-form-input></cms-form-input>
      </template>
    </cms-query-table>
  </div>
</template>

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

export default {
  name: "form-table-demo",
  mixins: [ dictionaryMix, pageInitMix, mixTableConstants, mixTableConfig, formConfigMix ],
  data() {
    return {
      queryForm: {},
    }
  },
  created() {
  },
  methods: {
    searchClick() {
      console.log('点击了搜索')
    }
  },
  computed: {
    configItem() {
      return [
        {
          label: '登录账户',
          prop: "account",
        },
      ]
    },
    toolsBarConfig() {
      return []
    },
    columnsConfig() {
      return [ {
        title: 'a',
        field: 'a'
      }, {
        title: 'b',
        field: 'b'
      }, {
        title: 'c',
        field: 'c'
      }, {
        title: 'd',
        field: 'd'
      }, {
        title: 'e',
        field: 'e'
      } ]
    },
    staticDataSource() {
      return [ {
        a: 1,
        b: 2,
        c: 3,
        d: 4,
        e: 5
      } ]
    }
  }
}
</script>

<style scoped>

</style>