forked from gzzfw/frontEnd/gzDyh

liuwh
2024-09-10 f576c94f647c3c735cacb56960d4ac9988c40fd6
gz-customerSystem/src/views/register/matterDetail/FileTable.jsx
@@ -218,10 +218,13 @@
  //上传弹窗完成后的事件
  const handleUpload = () => {
    console.log('tableData', tableData);
    console.log('fileMap', fileMap);
    const newList = tableData.map(item => {
      if (item.ownerType == sourceType) {
        const data = fileMap[sourceType]
        console.log(data);
      if (item.ownerType == '22_00018-101') {
        const data = fileMap['22_00018-101'];
        console.log('data', data);
        return {
          ...item,
          size: data.length,
@@ -235,16 +238,35 @@
            }
          }),
        }
      } else {
        return item
      }
      if (item.ownerType == '22_00018-102') {
        const data = fileMap['22_00018-102'];
        console.log('data', data);
        return {
          ...item,
          size: data.length,
          fileNames: data.map(item => item.trueName).join(','),
          updateTime: $$.timeFormat(data[data.length - 1].updateTime),
          fileInfoList: data.map(item => {
            return {
              ...item,
              name: item.trueName,
              uid: item.id,
            }
          }),
        }
      }
    })
    console.log('newList', newList);
    setTableData(newList)
    setUpLoadVisible(false);
  };
  //根据sourceType生成组件
  const formType = (type) => {
    console.log('typetypetype', type);
    if (type === '22_00018-101') {
      //申请材料
      return (
@@ -268,9 +290,11 @@
                    return item
                  }
                })
                console.log('newList', newList);
                setFileMap({
                  ...fileMap,
                  '22_00018-101': newList
                  '22_00018-101': newList.filter(i => i.ownerType === '22_00018-101')
                })
              }}
            />
@@ -302,9 +326,10 @@
                    return item
                  }
                })
                console.log('newList', newList);
                setFileMap({
                  ...fileMap,
                  '22_00018-102': newList
                  '22_00018-102': newList.filter(i => i.ownerType === '22_00018-102')
                })
              }}
            />
@@ -408,6 +433,6 @@
          <NewFileCheck menuList={tableData} sourceType={sourceType} />
        </div>
      </Modal>
    </Fragment>
    </Fragment >
  )
}