From 5bbee94e001dd69d22911a2a2ffe1dc81f3b9a25 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Fri, 11 Jun 2021 17:26:12 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E6=B7=BB=E5=8A=A0=E6=88=90=E5=91=98?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organization/OrganizationMember.vue | 32 +++------- .../organization/OrganizationWorkspace.vue | 64 ++++++++++--------- .../settings/project/EditMember.vue | 56 +++++++--------- .../settings/workspace/MsProject.vue | 57 ++++++++--------- .../settings/workspace/WorkspaceMember.vue | 51 ++++++--------- 5 files changed, 113 insertions(+), 147 deletions(-) diff --git a/frontend/src/business/components/settings/organization/OrganizationMember.vue b/frontend/src/business/components/settings/organization/OrganizationMember.vue index ebd21fbb6a..7c324240a8 100644 --- a/frontend/src/business/components/settings/organization/OrganizationMember.vue +++ b/frontend/src/business/components/settings/organization/OrganizationMember.vue @@ -48,29 +48,25 @@ :total="total"/> - + :rules="{required: true, message: $t('member.please_choose_member'), trigger: 'blur'}"> + :placeholder="$t('member.please_choose_member')"> @@ -199,6 +195,7 @@ // name: this.$t('user.button.add_user_role_batch'), handleClick: this.addUserRoleBatch // } ], + userList: [] } }, methods: { @@ -313,6 +310,9 @@ } this.form = {}; this.createVisible = true; + this.result = this.$get('/user/list/', response => { + this.userList = response.data; + }); this.result = this.$post('/user/group/list', {type: GROUP_ORGANIZATION, resourceId: orgId}, response => { this.$set(this.form, "groups", response.data); }) @@ -337,20 +337,6 @@ } }); }, - remoteMethod(query) { - query = query.trim(); - if (query !== '') { - this.loading = true; - setTimeout(() => { - this.loading = false; - this.$get("/user/search/" + query, response => { - this.options = response.data; - }) - }, 200); - } else { - this.options = []; - } - }, initWorkspaceBatchProcessDataStruct(isShow){ let organizationId = getCurrentOrganizationId(); this.$get("/user/getWorkspaceDataStruct/"+organizationId, response => { diff --git a/frontend/src/business/components/settings/organization/OrganizationWorkspace.vue b/frontend/src/business/components/settings/organization/OrganizationWorkspace.vue index d642940476..1a7f20bfeb 100644 --- a/frontend/src/business/components/settings/organization/OrganizationWorkspace.vue +++ b/frontend/src/business/components/settings/organization/OrganizationWorkspace.vue @@ -103,29 +103,31 @@ - - - - + + + + + + { if (valid) { - let userIds = []; - let userId = this.memberForm.userId; - let email = this.memberForm.memberSign; - let member = this.userList.find(user => user.id === email || user.email === email); - if (!member) { - this.$warning(this.$t('member.no_such_user')); - return false; - } else { - userId = member.id; - } - userIds.push(userId); + // let userIds = []; + // let userId = this.memberForm.userId; + // let email = this.memberForm.memberSign; + // let member = this.userList.find(user => user.id === email || user.email === email); + // if (!member) { + // this.$warning(this.$t('member.no_such_user')); + // return false; + // } else { + // userId = member.id; + // } + // userIds.push(userId); let param = { - userIds: userIds, + userIds: this.memberForm.userIds, groupIds: this.memberForm.groupIds, workspaceId: this.currentWorkspaceRow.id }; diff --git a/frontend/src/business/components/settings/project/EditMember.vue b/frontend/src/business/components/settings/project/EditMember.vue index fa486e75e5..e596d17283 100644 --- a/frontend/src/business/components/settings/project/EditMember.vue +++ b/frontend/src/business/components/settings/project/EditMember.vue @@ -1,26 +1,29 @@