diff --git a/frontend/src/store/modules/permission.js b/frontend/src/store/modules/permission.js index e8636fadcc..a3acca2db6 100644 --- a/frontend/src/store/modules/permission.js +++ b/frontend/src/store/modules/permission.js @@ -72,7 +72,7 @@ export const fillMeta = (router) => { router.name.includes('system-user-form') && (router.meta.activeMenu = '/system/user') router.name.includes('system-role-form') && (router.meta.activeMenu = '/system/role') router.name.includes('system-dept-form') && (router.meta.activeMenu = '/system/dept') - router.name.includes('sys-task-dataset') && (router.meta.activeMenu = '/system/system-task') + // router.name.includes('sys-task-dataset') && (router.meta.activeMenu = '/system/dstask') // return router } diff --git a/frontend/src/views/system/task/dataset.vue b/frontend/src/views/system/task/dataset.vue index 66dcdeed6a..b958895733 100644 --- a/frontend/src/views/system/task/dataset.vue +++ b/frontend/src/views/system/task/dataset.vue @@ -25,6 +25,7 @@ import TaskRecord from '@/views/system/task/TaskRecord' import TabDataPreview from '@/views/dataset/data/TabDataPreview' import DatasetTableData from '@/views/dataset/common/DatasetTableData' import bus from '@/utils/bus' +import { mapGetters } from 'vuex' export default { components: { DatasetTableData, LayoutContent, ComplexTable, UnionView, UpdateInfo, TabDataPreview, DatasetTaskList, TaskRecord }, data() { @@ -32,6 +33,11 @@ export default { tabActive: 'DatasetTaskList' } }, + computed: { + ...mapGetters([ + 'permission_routes' + ]) + }, mounted() { bus.$on('to-msg-dataset', params => { this.toMsgShare(params) @@ -39,7 +45,9 @@ export default { }, created() { const routerParam = this.$router.currentRoute.params - this.toMsgShare(routerParam) + routerParam && this.$nextTick(() => { + this.toMsgShare(routerParam) + }) }, methods: { @@ -49,6 +57,7 @@ export default { // 说明是从消息通知跳转过来的 if (panelShareTypeIds.includes(routerParam.msgType)) { // 是数据集同步 if (routerParam.sourceParam) { + this.openSystem() try { const msgParam = JSON.parse(routerParam.sourceParam) // this.param = msgParam.tableId @@ -62,6 +71,18 @@ export default { } } } + }, + openSystem() { + const path = '/system' + let route = this.permission_routes.find( + item => item.path === '/' + path.split('/')[1] + ) + // 如果找不到这个路由,说明是首页 + if (!route) { + route = this.permission_routes.find(item => item.path === '/') + } + this.$store.commit('permission/SET_CURRENT_ROUTES', route) + // this.setSidebarHide(route) } }