Skip to content

Commit

Permalink
Merge pull request #2748 from lhzzforever/dev/develop_ci
Browse files Browse the repository at this point in the history
Dev/develop ci
  • Loading branch information
ielgnaw authored Jul 5, 2024
2 parents 8d67d92 + 30b0322 commit d619ac4
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 46 deletions.
47 changes: 24 additions & 23 deletions frontend/src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -210,7 +208,6 @@ export const beforeEach = async (to, from, next) => {
}
}
} else if (to.name === 'userGroup') {
store.dispatch('versionLogInfo');
if (currentRoleId) {
await getManagerInfo();
} else {
Expand All @@ -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();
Expand Down Expand Up @@ -256,42 +259,40 @@ 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)) {
store.commit('updateIndex', 1);
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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
@enter="handleSearch"
@right-icon-click="handleSearch"
/>
<div class="icon-iamcenter-wrapper" @click.stop="refreshList">
<div class="icon-iamcenter-wrapper" @click.stop="handleRefreshList">
<i class="iam-icon iamcenter-refresh" />
</div>
</div>
Expand Down Expand Up @@ -880,6 +880,7 @@
this.isFilter = false;
this.curSystem = '';
this.curSelectValue = [];
this.linearAction = [];
},
fetchErrorMsg (payload) {
Expand Down Expand Up @@ -921,17 +922,17 @@
handleEmptyClear () {
this.keyword = '';
this.emptyData.tipType = '';
this.fetchSystems();
// this.requestQueue = [];
this.handleRefreshList();
},
handleEmptyRefresh () {
this.resetData();
this.fetchSystems();
},
refreshList () {
handleRefreshList () {
this.keyword = '';
this.linearAction = [];
this.fetchSystems();
}
}
Expand Down
8 changes: 5 additions & 3 deletions frontend/src/views/group/components/add-action-sideslider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
@enter="handleSearch"
@right-icon-click="handleSearch"
/>
<div class="icon-iamcenter-wrapper" @click.stop="refreshList">
<div class="icon-iamcenter-wrapper" @click.stop="handleRefreshList">
<i class="iam-icon iamcenter-refresh" />
</div>
</div>
Expand Down Expand Up @@ -973,6 +973,7 @@
this.isFilter = false;
this.curSystem = '';
this.curSelectValue = [];
this.linearAction = [];
},
fetchErrorMsg (payload) {
Expand Down Expand Up @@ -1017,14 +1018,15 @@
this.resetData();
},
refreshList () {
handleRefreshList () {
this.keyword = '';
this.linearAction = [];
this.fetchSystems();
},
handleEmptyClear () {
this.emptyData.tipType = '';
this.refreshList();
this.handleRefreshList();
},
handleEmptyRefresh () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
@enter="handleSearch"
@right-icon-click="handleSearch"
/>
<div class="icon-iamcenter-wrapper" @click.stop="refreshList">
<div class="icon-iamcenter-wrapper" @click.stop="handleRefreshList">
<i class="iam-icon iamcenter-refresh" />
</div>
</div>
Expand Down Expand Up @@ -885,6 +885,7 @@
this.isFilter = false;
this.curSystem = '';
this.curSelectValue = [];
this.linearAction = [];
},
fetchErrorMsg (payload) {
Expand Down Expand Up @@ -926,17 +927,17 @@
handleEmptyClear () {
this.keyword = '';
this.emptyData.tipType = '';
this.fetchSystems();
// this.requestQueue = [];
this.handleRefreshList();
},
handleEmptyRefresh () {
this.resetData();
this.fetchSystems();
},
refreshList () {
handleRefreshList () {
this.keyword = '';
this.linearAction = [];
this.fetchSystems();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
@enter="handleSearch"
@right-icon-click="handleSearch"
/>
<div class="icon-iamcenter-wrapper" @click.stop="refreshList">
<div class="icon-iamcenter-wrapper" @click.stop="handleRefreshList">
<i class="iam-icon iamcenter-refresh" />
</div>
</div>
Expand Down Expand Up @@ -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"
/>
</template>
</div>
Expand Down Expand Up @@ -166,7 +166,7 @@
:empty-text="emptyData.text"
:tip-text="emptyData.tip"
:tip-type="emptyData.tipType"
@on-clear="refreshList"
@on-clear="handleRefreshList"
/>
</div>
</template>
Expand Down Expand Up @@ -953,6 +953,7 @@
this.isFilter = false;
this.curSystem = '';
this.curSelectValue = [];
this.linearAction = [];
},
fetchErrorMsg (payload) {
Expand Down Expand Up @@ -993,8 +994,9 @@
}
},
refreshList () {
handleRefreshList () {
this.keyword = '';
this.linearAction = [];
this.fetchSystems();
}
}
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/views/perm-apply/apply-custom-perm/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -825,12 +825,6 @@
});
}
});
// 监听新增或移除的操作,重新组装数据
this.getFilterAggregateAction();
// 这里是为了处理无限制和无资源实例后台都是空数据的情况,所以为了兼容编辑回显状态下为空的数据,首次加载不需要调用批量无限制
if (this.isAllUnlimited) {
this.handleUnlimitedActionChange(this.isAllUnlimited);
}
return allActionIds;
}
},
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,6 @@
});
}
});
this.getFilterAggregateAction();
return allActionIds;
}
},
Expand Down Expand Up @@ -445,6 +444,7 @@
},
curSelectActions (value) {
this.aggregationsTableData = this.aggregationsTableData.filter(item => value.includes(item.id));
this.getFilterAggregateAction();
},
tableData: {
handler (value) {
Expand Down

0 comments on commit d619ac4

Please sign in to comment.