From 6613c11627b5e0be1629f3784acf0245a8040ea1 Mon Sep 17 00:00:00 2001 From: liuwh <964324856@qq.com> Date: Fri, 13 Sep 2024 09:35:46 +0800 Subject: [PATCH] 提交 --- gz-customerSystem/src/views/register/matterDetail/FileTable.jsx | 22 ++++++++++++++++------ 1 files changed, 16 insertions(+), 6 deletions(-) diff --git a/gz-customerSystem/src/views/register/matterDetail/FileTable.jsx b/gz-customerSystem/src/views/register/matterDetail/FileTable.jsx index db2c5b9..83dacd2 100644 --- a/gz-customerSystem/src/views/register/matterDetail/FileTable.jsx +++ b/gz-customerSystem/src/views/register/matterDetail/FileTable.jsx @@ -100,9 +100,9 @@ title: '操作', dataIndex: 'perClassName', key: 'perClassName', - width: props.isReview ? 60 : 125, + width: props.isReview ? 80 : 140, fixed: 'right', - render: (text, record) => ( + render: (text, record, index) => ( <Space size="middle"> <Link onClick={() => { setSourceType(record.ownerType) @@ -111,9 +111,9 @@ 查看 </Link> {!props.isReview && <Link onClick={() => { - if (record.fileList && record.fileList.length != 0) { - let ids = record.fileList?.map(item => item.id).join(',') - handleDelete(ids) + if (record.fileInfoList && record.fileInfoList.length != 0) { + let ids = record.fileInfoList?.map(item => item.id).join(',') + handleDelete(ids, record, index) } else { $$.info({ type: 'warning', content: '还没上传关于该材料的文件!' }); } @@ -131,6 +131,7 @@ 下载 </Link> {!props.isReview && <Link onClick={() => { + console.log(record); setSourceType(record.ownerType) setUpLoadVisible(true) setFileInfoList(record.fileList) @@ -151,6 +152,7 @@ ] useEffect(() => { + console.log(props.fileInfoList); if (props.fileInfoList && props.fileInfoList.length != 0) { //证明材料 const applyFile = props.fileInfoList.find(item => item.ownerType == "22_00018-101") @@ -234,6 +236,8 @@ } }), } + } else { + return item } }) //回传文件数据的时候使用 @@ -319,11 +323,16 @@ } //删除 - const handleDelete = (ids) => { + const handleDelete = (ids, record, index) => { Modal.confirm({ title: '删除确认', content: '确认全部删除该材料?', onOk: async () => { + let newData = tableData; + newData[index] = { ...record, fileInfoList: record.fileInfoList.filter(i => (i.id !== ids)) } + console.log('newData', newData); + + // setTableData(newData) const res = await deleteFileByIdApi({ ids }) if (res.type) { $$.infoSuccess({ content: '删除成功!' }); @@ -347,6 +356,7 @@ rowKey="ownerType" bordered={true} scroll={{ x: 1300 }} + tableHeight={137} /> <Modal style={{ width: '512px' }} -- Gitblit v1.8.0