fix : 修复路由跳转

This commit is contained in:
2024-05-27 21:16:14 +08:00
parent 7ebd897d57
commit e71c142ea9
9 changed files with 55 additions and 14 deletions

View File

@@ -115,7 +115,7 @@ const tableConfig = reactive({
align: 'center', align: 'center',
showOverflowTooltip: false, showOverflowTooltip: false,
currentRender: ({row, index}) => { currentRender: ({row, index}) => {
if(row.targetState!==null){ if(row.targetState!==null||row.targetState!==undefined){
return (<Tag dictType={'todo_type'} value={row.targetState}/>) return (<Tag dictType={'todo_type'} value={row.targetState}/>)
}else { }else {
return '--' return '--'
@@ -153,7 +153,6 @@ const tableConfig = reactive({
params: {}, params: {},
}) })
const handleView = (row) => { const handleView = (row) => {
console.log('row', row)
if (row.targetState == '00' && row.targetId) { if (row.targetState == '00' && row.targetId) {
router.push({ router.push({
name: 'Requirement/detail', name: 'Requirement/detail',
@@ -162,6 +161,43 @@ const handleView = (row) => {
} }
}) })
} }
else if(row.targetState=='10'&&row.targetId){
router.push({
name: 'Summary/detail',
query: {
id: row.targetId,
projectId: row.projectId,
state: row.state
}
})
}else if(row.targetState=='20'&&row.targetId){
router.push({
name: 'Initiation/detail',
query: {
id: row.targetId,
projectId: row.projectId,
state: row.state
}
})
}else if(row.targetState=='40'&&row.targetId){
router.push({
name: 'Implementation/detail',
query: {
id: row.targetId,
projectId: row.projectId,
state: row.state
}
})
}else if(row.targetState=='50'&&row.targetId){
router.push({
name: 'Filing/detail',
query: {
id: row.targetId,
projectId: row.projectId,
state: row.state
}
})
}
} }
</script> </script>

View File

@@ -176,10 +176,11 @@ const handleDownload = (row) => {
}) })
} }
const compositeParam = (item) => { const compositeParam = (item) => {
console.log('router.currentRoute.value.path',router.currentRoute.value.path)
let tag = '' let tag = ''
if (!formData.value.collectType && router.currentRoute.value.name === 'Requirement/add') { // if (!formData.value.collectType && router.currentRoute.value.path === 'Requirement/add') {
tag = '需求征集' // tag = '需求征集'
} // }
return { return {
fileId: item.id, fileId: item.id,
size: item.size, size: item.size,

View File

@@ -175,7 +175,7 @@ const handleDelete = (row) => {
} }
const handleDetail = (row) => { const handleDetail = (row) => {
router.push({ router.push({
name: 'Detail', name:'Requirement/detail',
query: { query: {
id: row.requirementId id: row.requirementId
} }

View File

@@ -49,6 +49,7 @@ const getInfo = async (state) => {
message: msg, message: msg,
type: code === 1000 ? 'success' : 'error' type: code === 1000 ? 'success' : 'error'
}) })
if(data===undefined)return;
if(code===1000){ if(code===1000){
summaryData.value = data; summaryData.value = data;
loading.value = false loading.value = false

View File

@@ -71,6 +71,7 @@ const getAllInfo = async (state) => {
if(code===1000){ if(code===1000){
loading.value = false loading.value = false
} }
if(data===undefined)return;
commonForm.value = data commonForm.value = data
processStore.setDesign(data) processStore.setDesign(data)
processStore.runningList.value = data.runningList; processStore.runningList.value = data.runningList;

View File

@@ -76,6 +76,7 @@ const getAllInfo = async (state) => {
if(code===1000){ if(code===1000){
loading.value = false loading.value = false
} }
if(data===undefined)return;
commonForm.value = data commonForm.value = data
processStore.setDesign(data) processStore.setDesign(data)
processStore.runningList.value = data.runningList; processStore.runningList.value = data.runningList;

View File

@@ -117,6 +117,7 @@ const getAllInfo = async (state) => {
loading.value = false loading.value = false
} }
console.log(data, 'data--22'); console.log(data, 'data--22');
if(data===undefined)return;
commonForm.value = data commonForm.value = data
processStore.setDesign(data) processStore.setDesign(data)
processStore.runningList.value = data.runningList; processStore.runningList.value = data.runningList;