[Fix-15698][UI] close the definition when opened in the new tab (#15736)

Co-authored-by: xiangzihao <460888207@qq.com>
This commit is contained in:
arlendp 2024-03-19 14:03:26 +08:00 committed by GitHub
parent 1440045fb8
commit a16a15c84e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 3 deletions

View File

@ -148,17 +148,18 @@ export default defineComponent({
* Back to the entrance
*/
const onClose = () => {
if (history.state.back !== '/login') {
const { back, current } = history.state
if (back && back !== '/login') {
router.go(-1)
return
}
if (history.state.current.includes('workflow/definitions')) {
if (!back || current.includes('workflow/definitions')) {
router.push({
path: `/projects/${route.params.projectCode}/workflow-definition`
})
return
}
if (history.state.current.includes('workflow/instances')) {
if (current.includes('workflow/instances')) {
router.push({
path: `/projects/${route.params.projectCode}/workflow/instances`
})