<template>
  <BasicModal v-bind="$attrs" @register="registerModal" title="审核历史" @ok="handleSubmit" :showCancelBtn="false" width="80%">
    <a-table :dataSource="dataSource" :columns="columns" />
  </BasicModal>
</template>
<script lang="ts" setup>
  import { list } from '../api';
  import { ref, h } from 'vue';
  import { BasicModal, useModalInner } from '/@/components/Modal';
  //表单赋值
  const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
    //获取数据
    queryData({});
  });

  const columns = [
    {
      title: '名称',
      dataIndex: 'dkmc',
      width: '20%',
      align: 'center'
    },
    {
      title: '审核',
      dataIndex: 'dkmc',
      width: '20%',
      align: 'center'
    },
    {
      title: '时间',
      dataIndex: 'dksjzxgxsj',
      align: 'center'
    },
    {
      title: '说明',
      dataIndex: 'bz',
      align: 'center'
    },
    {
      title: '文件',
      dataIndex: 'email',
      align: 'center'
    },
  ];
  const loading = ref(false);
  const dataSource = ref([]);
  const queryData = async (params) => {
    const res = await list(params);
    if (res && res.total > 0) {
      console.log(res)
      dataSource.value = res.records;
    }
  };

  const handleSubmit = () => {
    closeModal();
  };
</script>
