Merge pull request 'feat(project-demand): 编辑概览页面数据持久化' (#1009) from master into prod
Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/1009
This commit is contained in:
@@ -518,6 +518,7 @@ watch(() => singleList.value, (newVal) => {
|
||||
}, {deep: true})
|
||||
localStorage.removeItem('originallySelectedList')
|
||||
if (name.value === 'Summary/edit') {
|
||||
|
||||
} else {
|
||||
if (localStorage.getItem('collectData')) {
|
||||
let collectData = JSON.parse(localStorage.getItem('collectData'))
|
||||
@@ -549,6 +550,14 @@ const changeRequirement=async ()=>{
|
||||
const changeCollectData = () => {
|
||||
if (name.value === 'Summary/edit') {
|
||||
// params.fileList= attachment.value.allFileList
|
||||
let params = {
|
||||
...formData.value,
|
||||
deploymentId: deploymentId.value,
|
||||
fileList: [],
|
||||
requirementId: route.query.id ? route.query.id : formData.value.requirementId ? formData.value.requirementId : null
|
||||
}
|
||||
params.fileList = otherFileList.value
|
||||
localStorage.setItem(`collectResubmitData-${route.query.projectId}`, JSON.stringify(params))
|
||||
} else {
|
||||
let params = {
|
||||
...formData.value,
|
||||
@@ -824,8 +833,8 @@ const handleResubmit = debounce((instance) => {
|
||||
router.push({
|
||||
name: 'Summary'
|
||||
})
|
||||
// localStorage.removeItem('collectData')
|
||||
}
|
||||
localStorage.removeItem(`collectResubmitData-${route.query.projectId}`)
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -842,6 +851,22 @@ const getDetailInfo = async () => {
|
||||
opentionData.value = res.data
|
||||
optionalChargeLeadershipList.value = formData.value.optionalChargeLeadership
|
||||
loading.value = false
|
||||
|
||||
if (name.value === 'Summary/edit') {
|
||||
if (localStorage.getItem(`collectResubmitData-${route.query.projectId}`)) {
|
||||
let collectResubmitData = JSON.parse(localStorage.getItem(`collectResubmitData-${route.query.projectId}`))
|
||||
|
||||
if(formData.value.projectId==collectResubmitData.projectId){
|
||||
if (collectResubmitData.fileList) {
|
||||
otherFileList.value = collectResubmitData.fileList
|
||||
}
|
||||
if (collectResubmitData.optionalChargeLeadership) {
|
||||
optionalChargeLeadershipList.value = collectResubmitData.optionalChargeLeadership
|
||||
}
|
||||
formData.value = collectResubmitData
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
|
||||
Reference in New Issue
Block a user