| | |
| | | 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) |
| | |
| | | 查看 |
| | | </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: '还没上传关于该材料的文件!' }); |
| | | } |
| | |
| | | } |
| | | |
| | | //删除 |
| | | 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: '删除成功!' }); |
| | |
| | | rowKey="ownerType" |
| | | bordered={true} |
| | | scroll={{ x: 1300 }} |
| | | tableHeight={137} |
| | | /> |
| | | <Modal |
| | | style={{ width: '512px' }} |