fix(项目设置): 用户组添加成员时显示了所有项目

This commit is contained in:
shiziyuan9527 2022-05-12 13:44:49 +08:00 committed by shiziyuan9527
parent bd12a50d43
commit 5d2daedb90
1 changed files with 17 additions and 1 deletions

View File

@ -100,6 +100,7 @@ import MsTablePagination from "@/business/components/common/pagination/TablePagi
import {GROUP_PROJECT, GROUP_SYSTEM, GROUP_WORKSPACE} from "@/common/js/constants"; import {GROUP_PROJECT, GROUP_SYSTEM, GROUP_WORKSPACE} from "@/common/js/constants";
import MsTableOperator from "@/business/components/common/components/MsTableOperator"; import MsTableOperator from "@/business/components/common/components/MsTableOperator";
import UserOptionItem from "@/business/components/settings/common/UserOptionItem"; import UserOptionItem from "@/business/components/settings/common/UserOptionItem";
import {getCurrentProjectID} from "@/common/js/utils";
export default { export default {
name: "GroupMember", name: "GroupMember",
@ -125,6 +126,10 @@ export default {
groupSource: [], groupSource: [],
sourceData: [], sourceData: [],
users: [], users: [],
currentProject: {
id: "",
name: ""
},
form: {}, form: {},
title: '', title: '',
submitType: '', submitType: '',
@ -163,6 +168,9 @@ export default {
this.memberData = listObject; this.memberData = listObject;
} }
}) })
this.$get("/project/get/" + getCurrentProjectID(), res => {
this.currentProject = res.data;
});
}, },
open(group, initUserGroupUrl, initUserUrl) { open(group, initUserGroupUrl, initUserUrl) {
this.initUserGroupUrl = initUserGroupUrl ? initUserGroupUrl : "/user/group/user/"; this.initUserGroupUrl = initUserGroupUrl ? initUserGroupUrl : "/user/group/user/";
@ -274,7 +282,15 @@ export default {
this.sourceData = data.workspaces; this.sourceData = data.workspaces;
break; break;
case GROUP_PROJECT: case GROUP_PROJECT:
if (this.initUserUrl === 'user/ws/current/member/list') {
if (!this.currentProject.id) {
this.currentProject.id = sessionStorage.getItem("project_id");
this.currentProject.name = sessionStorage.getItem("project_name");
}
this.sourceData = [this.currentProject];
} else {
this.sourceData = data.projects; this.sourceData = data.projects;
}
break; break;
default: default:
} }