123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270 |
- import React, { useEffect, useRef, useState } from "react";
- import type { ProColumns, ActionType, ProFormInstance } from '@ant-design/pro-components';
- import type {FormInstance} from 'antd'
- import {Upload} from 'antd'
- import { SDPage,SDFormText,SDModalForm,SDTable,SDFormItem,SDButton,SDForm,SDSubmitButton,EditType, SDAreaTtile, SDLayout, SDOperate, baseFun, } from "@sundata/ui-frame";
- import {getDataList,selectDetailData,exportExcelModel, SysListModel,} from '@/services/rwa/dataquality/RepoRelatedTable';
- import { ProductProps } from "@/sundataImport";
- import { useModel } from '@umijs/max';
- type widowRush = {
- onCancel: () => void;
- onChangeVisible(visible: boolean, type: string): unknown;
- onChangeVisdible:(visible:boolean,type ?: 'none' | 'raload' )=>void;
- }& ProductProps;
- // 回购关联信息表
- const RepoRelatedTable : React.FC<widowRush> = (prop:widowRush) => {
- /** 编辑方式,查看、修改、新增按钮时设置,详细信息表单中使用 */
- const [editType, setEditType] = useState<EditType>(prop.editType || 'display');
- /** 是否显示详细信息窗口 */
- const [detailVisible, setDetailVisible] = useState<boolean>(false);
- const [currentRow, setCurrentRow] = useState<SysListModel>();
- /** 表格引用对象,刷新表格使用 */
- const actionRef = useRef<ActionType>();
- const formRef = useRef<FormInstance<any>>();
- const { fetchDict } = useModel('dict');
- // 页面数据
- var formDataList = new Array<SysListModel>;
- /**上传文件 */
- const [fileData, setFileData] = useState<File>();
- // 导入窗口显示
- const [importVisible, setImportVisible] = useState<boolean>(false);
- useEffect(() => {
- }, []);
-
- const selectData = async (formdata : SysListModel) => {
- const data = await selectDetailData(formdata);
- formRef.current?.setFieldsValue(data);
- }
- //关闭窗口刷新父页面
- const closeAndRefresh = ()=>{
- actionRef.current?.reloadAndRest?.();
- }
-
- // 页面展示元素
- const columns: ProColumns<SysListModel>[] = [
- {
- title: '计算实例号',
- dataIndex: 'calcindex',
- search: false,
- hideInTable: true,
- width:150,
- ellipsis:true
- },
- {
- title: '起始数据日期',
- dataIndex: 'startDate',
- search: false,
- hideInTable: true,
- width:150,
- ellipsis:true
- },
- {
- title: '截止数据日期',
- dataIndex: 'endDate',
- search: false,
- hideInTable: true,
- width:150,
- ellipsis:true
- },
- {
- title: '年月',
- dataIndex: 'yearMonth',
- search: false,
- hideInTable: true,
- width:150,
- ellipsis:true
- },
- {
- title: '数据日期',
- dataIndex: 'dataDate',
- hideInTable: false,
- order:-1,
- valueType:'date',
- width:150,
- ellipsis:true
- },
- {
- title: '缓释品编号',
- dataIndex: 'mitigationProdNo',
- hideInTable: false,
- order:-2,
- width:150,
- ellipsis:true
- },
- {
- title: '缓释品名称',
- dataIndex: 'mitigationProdName',
- hideInTable: false,
- order:-3,
- width:150,
- ellipsis:true
- },
- {
- title: '质押券证券代码',
- dataIndex: 'pledgeBondsSecurityCode',
- hideInTable: false,
- order:-4,
- width:150,
- ellipsis:true
- },
- {
- title: '证券名称',
- dataIndex: 'securityName',
- hideInTable: false,
- order:-5,
- width:150,
- ellipsis:true
- },
- {
- title: '证券种类代码',
- dataIndex: 'securityClass',
- search: false,
- hideInTable: false,
- width:150,
- ellipsis:true
- },
- {
- title: '证券种类',
- dataIndex: 'securityClass',
- search: false,
- hideInTable: false,
- width:150,
- ellipsis:true,
- valueType: 'treeSelect',
- request: () => fetchDict(''),
- fieldProps: {
- treeDefaultExpandAll: true,
- },
- },
- {
- title: '一般专项标签代码',
- dataIndex: 'generalSpecialLabel',
- search: false,
- hideInTable: false,
- width:150,
- ellipsis:true
- },
- {
- title: '一般专项标签',
- dataIndex: 'generalSpecialLabel',
- search: false,
- hideInTable: false,
- width:150,
- ellipsis:true,
- valueType: 'treeSelect',
- request: () => fetchDict('DEBT_TYPE'),
- fieldProps: {
- treeDefaultExpandAll: true,
- },
- },
- {
- title: '押品价值币种代码',
- dataIndex: 'collateralValueCcyCode',
- search: false,
- hideInTable: false,
- width:150,
- ellipsis:true
- },
- {
- title: '币种',
- dataIndex: 'collateralValueCcyCode',
- search: false,
- hideInTable: false,
- width:150,
- ellipsis:true,
- valueType: 'treeSelect',
- request: () => fetchDict(''),
- fieldProps: {
- treeDefaultExpandAll: true,
- },
- },
- {
- title: '质押券票面金额',
- dataIndex: 'pledgeBondsBillValueAmt',
- search: false,
- hideInTable: false,
- width:150,
- ellipsis:true
- },
- {
- title: '缓释起始日',
- dataIndex: 'mitigantOrginDate',
- search: false,
- hideInTable: false,
- width:150,
- ellipsis:true
- },
- {
- title: '缓释到期日',
- dataIndex: 'mitigantExpiryDate',
- search: false,
- hideInTable: false,
- width:150,
- ellipsis:true
- },
- {
- title: '债项编号',
- dataIndex: 'debtitemNo',
- hideInTable: false,
- order:-6,
- width:150,
- ellipsis:true
- },
- {
- title: '发行(承兑)人名称',
- dataIndex: 'issuerName',
- search: false,
- hideInTable: false,
- width:150,
- ellipsis:true
- },
- ];
-
- return (
- <SDPage>
- <SDTable
- title="查询表格"
- rowKey="customerName"
- request={async (formdata:SysListModel) =>{
- const formDatas = await getDataList(formdata);
- // 解构数组(导出用)
- formDataList=[...formDatas];
- return {data: formDatas}
- } }
- columns={columns}
- toolBarRender={(_, { selectedRows }) => [
- <SDButton
- key="export"
- successMessage=''
- onClick={() => {
- baseFun.confirm('确认导出数据?',async() => { exportExcelModel(formDataList,"RepoRelatedTable")});;
- //baseFun.info('处理完成');
- }}
- >
- 全部导出
- </SDButton>,
- ]}
- actionRef={actionRef}
- formRef={formRef}
- initLoad={false}
- setDetailVisible={() => {setDetailVisible(true)}}
- setEditType={setEditType}
- setCurrentRow={setCurrentRow}
- />
- </SDPage>
-
- );
- }
- export default RepoRelatedTable;
|