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