[update 流程返回] 如果没有上一个页面就跳转到首页
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { getProcessNodeList, queryTaskNameByTaskId } from '../api/workCenter'
|
import { getProcessNodeList, queryTaskNameByTaskId } from '../api/workCenter'
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import { USER_INFO } from '../store/mutation-types'
|
import { USER_INFO } from '../store/mutation-types'
|
||||||
|
import { findFirstRoute } from '@/utils/util'
|
||||||
|
|
||||||
export const WorkCenterMixin = {
|
export const WorkCenterMixin = {
|
||||||
data () {
|
data () {
|
||||||
@@ -89,7 +90,12 @@ export const WorkCenterMixin = {
|
|||||||
let timer = setTimeout(() => {
|
let timer = setTimeout(() => {
|
||||||
clearTimeout(timer)
|
clearTimeout(timer)
|
||||||
timer = null
|
timer = null
|
||||||
this.$router.go(-1)
|
// 有上个页面就返回,否则就返回第一个页面
|
||||||
|
if (history.length > 1) {
|
||||||
|
this.$router.go(-1)
|
||||||
|
} else {
|
||||||
|
this.$router.replace({ path: findFirstRoute(this.$store.state.user.permissionList) })
|
||||||
|
}
|
||||||
}, 700)
|
}, 700)
|
||||||
},
|
},
|
||||||
switchChange (value) {
|
switchChange (value) {
|
||||||
@@ -104,7 +110,7 @@ export const WorkCenterMixin = {
|
|||||||
*/
|
*/
|
||||||
beforeRouteEnter (to, from, next) {
|
beforeRouteEnter (to, from, next) {
|
||||||
if (to.query.taskId) {
|
if (to.query.taskId) {
|
||||||
queryTaskNameByTaskId({taskId: to.query.taskId}).then(res => {
|
queryTaskNameByTaskId({ taskId: to.query.taskId }).then(res => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
to.query.taskName = res.result.taskName
|
to.query.taskName = res.result.taskName
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user