From 82e4ef8222b07c299cc521e34d14f1b377352603 Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Fri, 5 Jul 2024 14:03:14 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=20=E5=A4=84=E7=90=86=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E5=B7=A5=E4=BD=9C=E5=8F=B0=E4=B8=8B=E4=B8=8D=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E9=87=8D=E5=AE=9A=E5=90=91=E6=88=91=E7=9A=84=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=9A=84=E8=B7=AF=E7=94=B1=E4=B8=9A=E5=8A=A1=20fix:?= =?UTF-8?q?=20=20=E6=B7=BB=E5=8A=A0=E7=B3=BB=E7=BB=9F=E5=92=8C=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E9=A1=B5=E9=9D=A2=E7=82=B9=E5=87=BB=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E4=B8=8D=E6=98=BE=E7=A4=BA=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E7=9A=84=E6=93=8D=E4=BD=9C=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/router/index.js | 47 ++++++++++--------- .../components/add-action-sideslider.vue | 9 ++-- .../components/add-action-sideslider.vue | 8 ++-- .../components/add-action-side-slider.vue | 9 ++-- .../components/add-action-sideslider.vue | 12 +++-- 5 files changed, 46 insertions(+), 39 deletions(-) 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(); } } From 30b0322817a740554cfc53cad218a017a9b91d7d Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Fri, 5 Jul 2024 16:26:17 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E3=80=90=E6=9D=83=E9=99=90=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E6=B5=8B=E8=AF=95=E3=80=91=E7=94=B3=E8=AF=B7=E6=9D=83?= =?UTF-8?q?=E9=99=90=E6=97=B6=E6=89=B9=E9=87=8F=E7=BC=96=E8=BE=91=E5=90=8E?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E5=85=B3=E8=81=94=E7=9A=84=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=AE=9E=E4=BE=8B=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/perm-apply/apply-custom-perm/index.vue | 12 ++++++------ .../tempora-perm-apply/apply-custom-perm/index.vue | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) 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) {