| | |
| | | </el-dialog> |
| | | |
| | | <!-- 附件列表对话框 --> |
| | | <FileList ref="fileListRef" /> |
| | | <FileList ref="fileListRef" @refresh="handleFileListRefresh" /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | |
| | | // FileList组件引用 |
| | | const fileListRef = ref(null) |
| | | const currentAttachmentRow = ref(null) |
| | | |
| | | // 上传配置 |
| | | const upload = reactive({ |
| | |
| | | |
| | | // 查看附件 |
| | | function handleAttachment(row) { |
| | | fileListRef.value.open(row.businessCommonFiles) |
| | | currentAttachmentRow.value = row |
| | | fileListRef.value.open(row.businessCommonFiles, row.id) |
| | | } |
| | | |
| | | // 附件列表刷新 |
| | | function handleFileListRefresh(rowId) { |
| | | // 重新获取列表数据 |
| | | getList() |
| | | // 等待列表数据更新后,找到对应的行并更新附件列表 |
| | | setTimeout(() => { |
| | | if (currentAttachmentRow.value && tableData.value) { |
| | | const updatedRow = tableData.value.find(item => item.id === currentAttachmentRow.value.id) |
| | | if (updatedRow && updatedRow.businessCommonFiles) { |
| | | currentAttachmentRow.value = updatedRow |
| | | fileListRef.value.open(updatedRow.businessCommonFiles, updatedRow.id) |
| | | } |
| | | } |
| | | }, 300) |
| | | } |
| | | |
| | | onMounted(() => { |