refactor: 优化多个组件的返回逻辑
- 在 Requirement、Summary、Fund 组件中,将 history.back() 替换为 router.push(),以指定具体的路由名称- 在 ProjectApply 组件中,根据 step 值选择不同的路由页面 - 这些修改提高了组件的可测试性和灵活性,避免了依赖浏览器历史记录
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -578,7 +578,9 @@ const getDetailInfo = async () => {
|
||||
}
|
||||
|
||||
const handleBack = () => {
|
||||
history.back()
|
||||
router.push({
|
||||
name: 'Requirement'
|
||||
})
|
||||
}
|
||||
const handleDelete = (row) => {
|
||||
// deleteFile(row.fileId).then(res => {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -234,7 +234,9 @@ const getFile = (val) => {
|
||||
})
|
||||
}
|
||||
const handleBack = () => {
|
||||
history.back()
|
||||
router.push({
|
||||
name: 'Fund'
|
||||
})
|
||||
}
|
||||
|
||||
const submitParam = (item) => {
|
||||
|
||||
Reference in New Issue
Block a user