<template>
  <BasicTable @register="registerTable">
    <!-- <template #form-userLevle="{ model, field }">
      <a-select
        v-model:value="model[field]"
        placeholder="请选择"
        @change="change(model)"
        :fieldNames="{ label: 'text', value: 'value' }"
        :options="Options"
      ></a-select>
    </template>
    <template #form-category="{ model, field }">
      <a-tree-select
        v-model:value="model[field]"
        show-search
        placeholder="请选择"
        allow-clear
        tree-default-expand-all
        :field-names="{ label: 'name', value: 'id', children: 'children' }"
        :tree-data="treeData"
        tree-node-filter-prop="label"
      >
        <template #suffixIcon>
          <SmileOutlined />
        </template>
      </a-tree-select>
    </template> -->
    <template #tableTitle>
      <a-button type="primary" preIcon="ant-design:export-outlined" v-auth="'ywkz-zjpsxx-dc'" @click="onExportXls"> 导出</a-button>
    </template>
  </BasicTable>
</template>
<script setup lang="ts">
  import { BasicTable } from '@/components/Table';
  import { useListPage } from '/@/hooks/system/useListPage';
  import { ZjpsColumns, ZjpsFormSchema } from './data';
  import { zjpsxxtj, zjpsxxtjExcel } from './api';

  const { tableContext, onExportXls } = useListPage({
    tableProps: {
      title: '',
      api: zjpsxxtj,
      columns: ZjpsColumns,
      canResize: false,

      // rowSelection: { type: 'checkbox' },
      rowKey: 'wrdkid',
      clickToRowSelect: false,
      showActionColumn: false,

      formConfig: {
        labelWidth: 120,
        schemas: ZjpsFormSchema,
        autoSubmitOnEnter: true,
        showAdvancedButton: false,
      },
      actionColumn: {
        width: 120,
        fixed: 'right',
      },
    },
    exportConfig: {
      name: '专家评审信息统计',
      url: zjpsxxtjExcel,
    },
  });
  const [registerTable, { reload }] = tableContext;
  
  
</script>
