diff --git a/frontend/src/router/index.js b/frontend/src/router/index.js index ff96f9e80..6862ad5f3 100644 --- a/frontend/src/router/index.js +++ b/frontend/src/router/index.js @@ -170,22 +170,20 @@ export const beforeEach = async (to, from, next) => { } } - if (['applyJoinUserGroup', 'applyCustomPerm', 'myManageSpace', 'myPerm', 'permTransfer', 'permRenewal'].includes(to.name) - || (['permRenewal'].includes(to.name) && ['email', 'notification'].includes(to.query.source))) { + if (!getRouterDiff('staff').includes(to.name) || (['permRenewal'].includes(to.name) && ['email', 'notification'].includes(to.query.source))) { await store.dispatch('role/updateCurrentRole', { id: 0 }); await store.dispatch('userInfo'); curRole = 'staff'; navDiffMenuIndex(0); } - if (['userGroup', 'permTemplate'].includes(to.name)) { + if (!getRouterDiff(curRole).includes(to.name) && !['', 'staff'].includes(curRole) && curRoleId > 0) { await store.dispatch('role/updateCurrentRole', { id: curRoleId }); navDiffMenuIndex(1); } if (to.name === 'userGroupDetail') { navDiffMenuIndex(1); - store.dispatch('versionLogInfo'); if (existValue('externalApp') && to.query.hasOwnProperty('role_id')) { getExternalRole(); } else { @@ -210,7 +208,6 @@ export const beforeEach = async (to, from, next) => { } } } else if (to.name === 'userGroup') { - store.dispatch('versionLogInfo'); if (currentRoleId) { await getManagerInfo(); } else { @@ -220,11 +217,17 @@ export const beforeEach = async (to, from, next) => { if (curRole === 'staff') { // 单独处理返回个人staff不需要重定向我的权限的路由 const routeNavMap = [ - [(name) => ['myManageSpace'].includes(name), () => next()], + [(name) => !getNavRouterDiff(0).includes(name), () => next()], [(name) => ['ratingManager'].includes(name), () => next({ path: `${SITE_URL}${to.fullPath}` })] ]; - const getRouteNav = routeNavMap.find((item) => item[0](to.name)); - getRouteNav ? getRouteNav[1]() : next({ path: `${SITE_URL}my-perm` }); + if (navIndex > 0) { + await getManagerInfo(); + navDiffMenuIndex(navIndex); + next(); + } else { + const getRouteNav = routeNavMap.find((item) => item[0](to.name)); + getRouteNav ? getRouteNav[1]() : next({ path: `${SITE_URL}my-perm` }); + } // next({ path: `${SITE_URL}my-perm` }); } else { next(); @@ -256,22 +259,27 @@ export const beforeEach = async (to, from, next) => { difference = getNavRouterDiff(navIndex, hasManagerPerm); } if (difference.length) { - store.dispatch('versionLogInfo'); if (difference.includes(to.name)) { store.commit('setHeaderTitle', ''); window.localStorage.removeItem('iam-header-title-cache'); window.localStorage.removeItem('iam-header-name-cache'); - if (curRole === 'staff' || curRole === '') { + if (['', 'staff'].includes(curRole)) { if (existValue('externalApp')) { // 外部嵌入页面 next(); } else { // 单独处理返回个人staff不需要重定向我的权限的路由 const routeNavMap = [ - [(name) => ['myManageSpace'].includes(name), () => next()], + [(name) => !getNavRouterDiff(0).includes(name), () => next()], [(name) => ['ratingManager'].includes(name), () => next({ path: `${SITE_URL}${to.fullPath}` })] ]; - const getRouteNav = routeNavMap.find((item) => item[0](to.name)); - getRouteNav ? getRouteNav[1]() : next({ path: `${SITE_URL}my-perm` }); + if (navIndex > 0) { + await getManagerInfo(); + navDiffMenuIndex(navIndex); + next(); + } else { + const getRouteNav = routeNavMap.find((item) => item[0](to.name)); + getRouteNav ? getRouteNav[1]() : next({ path: `${SITE_URL}my-perm` }); + } } } else { if (['groupPermRenewal', 'userGroup', 'userGroupDetail', 'createUserGroup', 'userGroupPermDetail'].includes(to.name)) { @@ -279,19 +287,12 @@ export const beforeEach = async (to, from, next) => { window.localStorage.setItem('index', 1); next(); } - - if (to.name === 'apply') { - store.commit('updateIndex', 0); - window.localStorage.setItem('index', 0); + if (existValue('externalApp')) { next(); } else { - if (existValue('externalApp')) { - next(); - } else { - next({ path: `${SITE_URL}${defaultRoute[navIndex]}` }); - } - // next({ path: `${SITE_URL}user-group` }); + next({ path: `${SITE_URL}${defaultRoute[navIndex]}` }); } + // next({ path: `${SITE_URL}user-group` }); } // next(); } else { diff --git a/frontend/src/views/grading-admin/components/add-action-sideslider.vue b/frontend/src/views/grading-admin/components/add-action-sideslider.vue index 64e1c3763..f226e91d4 100644 --- a/frontend/src/views/grading-admin/components/add-action-sideslider.vue +++ b/frontend/src/views/grading-admin/components/add-action-sideslider.vue @@ -22,7 +22,7 @@ @enter="handleSearch" @right-icon-click="handleSearch" /> -
+
@@ -880,6 +880,7 @@ this.isFilter = false; this.curSystem = ''; this.curSelectValue = []; + this.linearAction = []; }, fetchErrorMsg (payload) { @@ -921,8 +922,7 @@ handleEmptyClear () { this.keyword = ''; this.emptyData.tipType = ''; - this.fetchSystems(); - // this.requestQueue = []; + this.handleRefreshList(); }, handleEmptyRefresh () { @@ -930,8 +930,9 @@ this.fetchSystems(); }, - refreshList () { + handleRefreshList () { this.keyword = ''; + this.linearAction = []; this.fetchSystems(); } } diff --git a/frontend/src/views/group/components/add-action-sideslider.vue b/frontend/src/views/group/components/add-action-sideslider.vue index 5743681f6..9e5199e3e 100644 --- a/frontend/src/views/group/components/add-action-sideslider.vue +++ b/frontend/src/views/group/components/add-action-sideslider.vue @@ -23,7 +23,7 @@ @enter="handleSearch" @right-icon-click="handleSearch" /> -
+
@@ -973,6 +973,7 @@ this.isFilter = false; this.curSystem = ''; this.curSelectValue = []; + this.linearAction = []; }, fetchErrorMsg (payload) { @@ -1017,14 +1018,15 @@ this.resetData(); }, - refreshList () { + handleRefreshList () { this.keyword = ''; + this.linearAction = []; this.fetchSystems(); }, handleEmptyClear () { this.emptyData.tipType = ''; - this.refreshList(); + this.handleRefreshList(); }, handleEmptyRefresh () { diff --git a/frontend/src/views/manage-spaces/components/add-action-side-slider.vue b/frontend/src/views/manage-spaces/components/add-action-side-slider.vue index ca3577b4d..b67306d2f 100644 --- a/frontend/src/views/manage-spaces/components/add-action-side-slider.vue +++ b/frontend/src/views/manage-spaces/components/add-action-side-slider.vue @@ -22,7 +22,7 @@ @enter="handleSearch" @right-icon-click="handleSearch" /> -
+
@@ -885,6 +885,7 @@ this.isFilter = false; this.curSystem = ''; this.curSelectValue = []; + this.linearAction = []; }, fetchErrorMsg (payload) { @@ -926,8 +927,7 @@ handleEmptyClear () { this.keyword = ''; this.emptyData.tipType = ''; - this.fetchSystems(); - // this.requestQueue = []; + this.handleRefreshList(); }, handleEmptyRefresh () { @@ -935,8 +935,9 @@ this.fetchSystems(); }, - refreshList () { + handleRefreshList () { this.keyword = ''; + this.linearAction = []; this.fetchSystems(); } } diff --git a/frontend/src/views/manage-spaces/secondary-manage-space/components/add-action-sideslider.vue b/frontend/src/views/manage-spaces/secondary-manage-space/components/add-action-sideslider.vue index 982834c80..3f6f267bc 100644 --- a/frontend/src/views/manage-spaces/secondary-manage-space/components/add-action-sideslider.vue +++ b/frontend/src/views/manage-spaces/secondary-manage-space/components/add-action-sideslider.vue @@ -23,7 +23,7 @@ @enter="handleSearch" @right-icon-click="handleSearch" /> -
+
@@ -62,8 +62,8 @@ :empty-text="emptyData.text" :tip-text="emptyData.tip" :tip-type="emptyData.tipType" - @on-clear="refreshList" - @on-refresh="refreshList" + @on-clear="handleRefreshList" + @on-refresh="handleRefreshList" /> @@ -166,7 +166,7 @@ :empty-text="emptyData.text" :tip-text="emptyData.tip" :tip-type="emptyData.tipType" - @on-clear="refreshList" + @on-clear="handleRefreshList" /> @@ -953,6 +953,7 @@ this.isFilter = false; this.curSystem = ''; this.curSelectValue = []; + this.linearAction = []; }, fetchErrorMsg (payload) { @@ -993,8 +994,9 @@ } }, - refreshList () { + handleRefreshList () { this.keyword = ''; + this.linearAction = []; this.fetchSystems(); } } diff --git a/frontend/src/views/perm-apply/apply-custom-perm/index.vue b/frontend/src/views/perm-apply/apply-custom-perm/index.vue index f73fe45f5..846c33de4 100644 --- a/frontend/src/views/perm-apply/apply-custom-perm/index.vue +++ b/frontend/src/views/perm-apply/apply-custom-perm/index.vue @@ -825,12 +825,6 @@ }); } }); - // 监听新增或移除的操作,重新组装数据 - this.getFilterAggregateAction(); - // 这里是为了处理无限制和无资源实例后台都是空数据的情况,所以为了兼容编辑回显状态下为空的数据,首次加载不需要调用批量无限制 - if (this.isAllUnlimited) { - this.handleUnlimitedActionChange(this.isAllUnlimited); - } return allActionIds; } }, @@ -864,6 +858,12 @@ }, curSelectActions (value) { this.aggregationsTableData = this.aggregationsTableData.filter(item => value.includes(item.id)); + // 监听新增或移除的操作,重新组装数据 + this.getFilterAggregateAction(); + // 这里是为了处理无限制和无资源实例后台都是空数据的情况,所以为了兼容编辑回显状态下为空的数据,首次加载不需要调用批量无限制 + if (this.isAllUnlimited) { + this.handleUnlimitedActionChange(this.isAllUnlimited); + } }, tableData: { handler (value) { diff --git a/frontend/src/views/tempora-perm-apply/apply-custom-perm/index.vue b/frontend/src/views/tempora-perm-apply/apply-custom-perm/index.vue index 146364b8f..68b68dd28 100644 --- a/frontend/src/views/tempora-perm-apply/apply-custom-perm/index.vue +++ b/frontend/src/views/tempora-perm-apply/apply-custom-perm/index.vue @@ -402,7 +402,6 @@ }); } }); - this.getFilterAggregateAction(); return allActionIds; } }, @@ -445,6 +444,7 @@ }, curSelectActions (value) { this.aggregationsTableData = this.aggregationsTableData.filter(item => value.includes(item.id)); + this.getFilterAggregateAction(); }, tableData: { handler (value) {