[update 标准解读流程] 快照回显、导入覆盖

This commit is contained in:
danshihao
2024-07-12 20:07:07 +08:00
parent aa2dd84e7c
commit 9ad65220ea
2 changed files with 18 additions and 9 deletions
@@ -148,7 +148,8 @@ import {
interpretFlowApproval, interpretFlowApproval,
interpretFlowSave, interpretFlowSave,
interpretFlowReject, interpretFlowReject,
interpretFlowTransfer interpretFlowTransfer,
getLookData
} from '@api/workCenter' } from '@api/workCenter'
import InterpretationInitiate from '@views/workCenter/standardInterpretationProcess/modules/InterpretationInitiate' import InterpretationInitiate from '@views/workCenter/standardInterpretationProcess/modules/InterpretationInitiate'
import UserSelectModal from '@comp/selection/UserSelectModal' import UserSelectModal from '@comp/selection/UserSelectModal'
@@ -245,7 +246,8 @@ export default {
} }
}, },
created () { created () {
const { projectId, nodeId, taskName } = this.$route.query const { projectId, nodeId, taskName, snapshotId, isLook } = this.$route.query
this.isLook = isLook
// 发起、草稿进来没有nodeId,就默认发起节点 // 发起、草稿进来没有nodeId,就默认发起节点
this.currentNodeId = nodeId || StandardInterpretationNodes.initiated.value this.currentNodeId = nodeId || StandardInterpretationNodes.initiated.value
this.currentNodeName = taskName || StandardInterpretationNodes.initiated.text this.currentNodeName = taskName || StandardInterpretationNodes.initiated.text
@@ -255,8 +257,8 @@ export default {
this.getPersonInfoStructure(this.processKey, () => { this.getPersonInfoStructure(this.processKey, () => {
this.initPersonInfoData(this.isInitiate) this.initPersonInfoData(this.isInitiate)
}) })
// 如果是待办或草稿进来,就获取详情数据 // 如果是待办或草稿或快照进来,就获取详情数据
if (this.$route.query.projectId) { if (projectId || snapshotId) {
this.loadPage() this.loadPage()
return return
} }
@@ -278,13 +280,18 @@ export default {
* 获取页面详情 * 获取页面详情
*/ */
loadPage () { loadPage () {
const { projectId, taskId, draftId } = this.$route.query const { projectId, taskId, draftId, snapshotId } = this.$route.query
this.loading = true this.loading = true
interpretGetDetail({ let requestPromise = interpretGetDetail({ projectId, taskId, snapshotId })
projectId, // 快照单独请求
taskId if (snapshotId) {
}).then(res => { requestPromise = getLookData({ snapshotId })
}
requestPromise.then(res => {
if (res.success) { if (res.success) {
if (snapshotId) {
res.result = JSON.parse(res.result.infoJsonStr).pageData
}
const data = res.result || {} const data = res.result || {}
const processAll = data.processAll || {} const processAll = data.processAll || {}
const processApprovalRecord = data.processApprovalRecord || {} const processApprovalRecord = data.processApprovalRecord || {}
@@ -581,6 +581,8 @@ export default {
} }
// 前端存储,没有id的数据,前端加上uuid // 前端存储,没有id的数据,前端加上uuid
const data = info.file.response.result || [] const data = info.file.response.result || []
// 删除之前的数据,覆盖重新导入的
this.processAllDelIds.push(...this.dataSource.map(item => item[this.rowKey]))
this.dataSource = data.map(item => { this.dataSource = data.map(item => {
// 导入的时候生成前端id,不用索引防止禁用出错 // 导入的时候生成前端id,不用索引防止禁用出错
item.id = randomUUID() item.id = randomUUID()