fix(系统设置): 工作空间页面批量添加至项目展示的角色有误

--bug=1044952 --user=宋昌昌 【系统设置】批量添加到项目可以看到所有项目角色 https://www.tapd.cn/55049933/s/1566661
This commit is contained in:
song-cc-rock 2024-08-21 15:06:02 +08:00 committed by 刘瑞斌
parent 655bc5c7da
commit 18f47640c3
2 changed files with 23 additions and 4 deletions

View File

@ -83,7 +83,7 @@ export default {
label: 'name',
lazyLoad(node, resolve) {
const {level, value} = node;
if (self.cascaderLevel === 1) {
if (self.cascaderLevel === 1 || self.cascaderLevel === 3) {
if (level === 0) {
self.getProject(getCurrentWorkspaceId(), resolve);
} else {
@ -186,6 +186,14 @@ export default {
}).then(res => {
this.projectUserGroups = res.data ? res.data : [];
})
} else if (this.cascaderLevel === 3) {
// ||
this.loading = getAllUserGroupByType({
type: GROUP_PROJECT,
resourceId: getCurrentWorkspaceId()
}).then(res => {
this.projectUserGroups = res.data ? res.data.filter(group => group.scopeId === 'global' || group.scopeId === getCurrentWorkspaceId()) : [];
})
}
}
}

View File

@ -82,7 +82,7 @@
<user-cascader :lable="batchAddLable" :title="batchAddTitle" @confirm="cascaderConfirm"
ref="cascaderDialog"></user-cascader>
<batch-to-project-group-cascader :title="$t('user.add_project_batch')" @confirm="cascaderConfirm"
:cascader-level="1" ref="cascaderDialog"/>
:cascader-level="3" ref="cascaderDialog"/>
</div>
</template>
@ -96,14 +96,25 @@ import {listenGoBack, removeGoBackListener} from "metersphere-frontend/src/utils
import {getCurrentProjectID, getCurrentUser, getCurrentWorkspaceId} from "metersphere-frontend/src/utils/token";
import {hasPermission} from "metersphere-frontend/src/utils/permission";
import MsTableHeaderSelectPopover from "metersphere-frontend/src/components/table/MsTableHeaderSelectPopover";
import {_handleSelect, _handleSelectAll, getSelectDataCounts, setUnSelectIds, toggleAllSelection} from "metersphere-frontend/src/utils/tableUtils";
import {
_handleSelect,
_handleSelectAll,
getSelectDataCounts,
setUnSelectIds,
toggleAllSelection
} from "metersphere-frontend/src/utils/tableUtils";
import UserCascader from "../../system/components/UserCascader";
import ShowMoreBtn from "metersphere-frontend/src/components/table/ShowMoreBtn";
import {GROUP_WORKSPACE} from "metersphere-frontend/src/utils/constants";
import AddMember from "../../common/AddMember";
import BatchToProjectGroupCascader from "../../system/components/BatchToProjectGroupCascader";
import GroupCascader from "../../system/components/GroupCascader";
import {addWorkspaceMember, specialBatchProcessUser, delWorkspaceMemberById, getWorkspaceMemberPages} from "../../../api/user";
import {
addWorkspaceMember,
delWorkspaceMemberById,
getWorkspaceMemberPages,
specialBatchProcessUser
} from "../../../api/user";
import {getUserGroupList, getWorkspaceMemberGroup} from "../../../api/user-group";
import {updateWorkspaceMember as _updateWorkspaceMember} from "@/api/workspace";