/* * @Author: zhoujianlong * @Date: 2021-06-22 14:46:22 * @Last Modified by: zhoujianlong * @Last Modified time: 2021-08-03 14:09:26 */ import React, { useState } from 'react'; import { Modal, Button, message, Spin } from 'antd'; import ProTable, { ProColumns } from '@ant-design/pro-table'; import { ApprovalProcess } from './service'; interface SeleApprovalProcessProps { modalVisible: boolean; //弹窗visible onCancel: () => void; //关闭弹窗方法回调 data: Array[]; //传入列表展示的数组 annoId: any; //传入id } /** * 公告、变更公告、失败公告、邀请函、公示 选择审批流程 */ const SeleApprovalProcess: React.FC = (props) => { const { modalVisible, onCancel, data, annoId } = props; const modalHeight = (window.innerHeight * 96) / 100; //loading const [loading, setLoading] = useState(false); //发起审批操作 const toApprove = async (record: any) => { setLoading(true); await ApprovalProcess(annoId, { ...record }) .then((res) => { if (res?.code == 200 && res?.success == true) { message.success('操作成功'); onCancel(); } }) .finally(() => { setLoading(false); }); }; const columns: ProColumns[] = [ { title: '序号', key: 'key', render: (_, record: any, index: any) => index + 1, }, { title: '流程名称', dataIndex: 'workflowName', key: 'workflowName', }, { title: '操作', dataIndex: 'options', key: 'options', render: (_: any, record: any) => ( ), }, ]; return ( onCancel()} footer={null} > ); }; export default SeleApprovalProcess;