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 |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/gz-customerSystem/src/views/register/matterDetail/FileTable.jsx b/gz-customerSystem/src/views/register/matterDetail/FileTable.jsx
index d1c6c39..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: '还没上传关于该材料的文件!' });
             }
@@ -323,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: '删除成功!' });
@@ -351,7 +356,7 @@
         rowKey="ownerType"
         bordered={true}
         scroll={{ x: 1300 }}
-        tableHeight={126}
+        tableHeight={137}
       />
       <Modal
         style={{ width: '512px' }}

--
Gitblit v1.8.0