<template>
  <BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose title="银联商户" :width="800">
    <a-button type="primary" preIcon="ant-design:plus-outlined" @click="router.push({ path: '/AccountManagement/Merchant/UnionPay' })">
      新建</a-button
    >
    <!-- <BasicTable @register="registerTable" :rowSelection="rowSelection">
      <template #tableTitle>
        <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
      </template>
      <template #action="{ record }">
        <TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
      </template>
    </BasicTable> -->
  </BasicModal>
</template>

<script lang="ts" setup>
  import { InputNumber, FormItem } from 'ant-design-vue';
  import { ref, computed, unref } from 'vue';
  import { BasicModal, useModalInner } from '/@/components/Modal';
  import { BasicForm, useForm } from '/@/components/Form/index';
  import { formSchema, columns } from '../Merchant.data';
  import { saveOrUpdate } from '../Merchant.api.';
  import { useMessage } from '/@/hooks/web/useMessage';
  import { useListPage } from '/@/hooks/system/useListPage';
  import { useRouter } from 'vue-router';
  const router = useRouter();
  const { createMessage } = useMessage();
  // Emits声明
  const emit = defineEmits(['register', 'success']);

  //表单赋值
  const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
    //重置表单
    setModalProps({ confirmLoading: false, showCancelBtn: !!data?.showFooter, showOkBtn: !!data?.showFooter, maskClosable: false });

    // 隐藏底部时禁用整个表单
    // setProps({ disabled: !data?.showFooter });
  });
  //注册table数据
  // const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
  //   tableProps: {
  //     title: 'Merchant',
  //     // api: list,
  //     columns,
  //
  //     formConfig: {
  //       autoSubmitOnEnter: true,
  //       showAdvancedButton: true,
  //       fieldMapToNumber: [],
  //       fieldMapToTime: [],
  //     },
  //     actionColumn: {
  //       width: 250,
  //       fixed: 'right',
  //     },
  //   },
  // });
  // const [registerTable, { reload }, {}] = tableContext;
</script>

<style lang="less" scoped>
  /** 时间和数字输入框样式 */
  :deep(.ant-input-number) {
    width: 100%;
  }

  :deep(.ant-calendar-picker) {
    width: 100%;
  }
</style>
