refactor: 优化多个组件的返回逻辑

- 在 Requirement、Summary、Fund 组件中,将 history.back() 替换为 router.push(),以指定具体的路由名称- 在 ProjectApply 组件中,根据 step 值选择不同的路由页面
- 这些修改提高了组件的可测试性和灵活性,避免了依赖浏览器历史记录
This commit is contained in:
dj
2025-08-27 09:45:15 +08:00
parent dc4b33cf89
commit cffe7d61e3
4 changed files with 22 additions and 4 deletions

View File

@@ -609,7 +609,19 @@ const getTitleName = (type) => {
}
}
const handleBack = () => {
history.back()
if (props.step === '20') {
router.push({
name: 'Initiation'
})
} else if (props.step === '40') {
router.push({
name: 'Implementation'
})
}else if(props.step === '50'){
router.push({
name: 'Filing'
})
}
}
const compositeParam = (item) => {
return {

View File

@@ -578,7 +578,9 @@ const getDetailInfo = async () => {
}
const handleBack = () => {
history.back()
router.push({
name: 'Requirement'
})
}
const handleDelete = (row) => {
// deleteFile(row.fileId).then(res => {

View File

@@ -586,7 +586,9 @@ const optionalChargeLeaderPickerOkOrCancel = (userList) => {
}
const handleBack = () => {
history.back()
router.push({
name: 'Summary'
})
}
const disabledDate = (time) => {
return time.getTime() < new Date(formData.value.startTime).getTime();

View File

@@ -234,7 +234,9 @@ const getFile = (val) => {
})
}
const handleBack = () => {
history.back()
router.push({
name: 'Fund'
})
}
const submitParam = (item) => {