refactor(系统设置): 优化添加成员

This commit is contained in:
shiziyuan9527 2021-06-11 18:47:19 +08:00 committed by 刘瑞斌
parent efd5d62b84
commit 0ddb35e5bd
6 changed files with 216 additions and 369 deletions

View File

@ -0,0 +1,127 @@
<template>
<el-dialog :close-on-click-modal="false" :title="$t('member.create')" :visible.sync="dialogVisible" width="40%"
:destroy-on-close="true"
@close="close" v-loading="result.loading">
<el-form :model="form" ref="form" :rules="rules" label-position="right" label-width="100px" size="small">
<el-form-item :label="$t('commons.member')" prop="userIds"
:rules="{required: true, message: $t('member.please_choose_member'), trigger: 'blur'}">
<el-select
v-model="form.userIds"
multiple
filterable
:popper-append-to-body="false"
class="select-width"
:placeholder="$t('member.please_choose_member')">
<el-option
v-for="item in userList"
:key="item.id"
:label="item.id"
:value="item.id">
<template>
<span class="user-select-left">{{ item.name }} ({{ item.id }})</span>
<span class="user-select-right">{{ item.email }}</span>
</template>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('commons.group')" prop="groupIds">
<el-select v-model="form.groupIds" multiple :placeholder="$t('group.please_select_group')" class="select-width">
<el-option
v-for="item in form.groups"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-form>
<template v-slot:footer>
<div class="dialog-footer">
<el-button @click="dialogVisible = false" size="medium">{{ $t('commons.cancel') }}</el-button>
<el-button type="primary" @click="submitForm('form')" @keydown.enter.native.prevent size="medium">
{{ $t('commons.confirm') }}
</el-button>
</div>
</template>
</el-dialog>
</template>
<script>
export default {
name: "AddMember",
data() {
return {
dialogVisible: false,
form: {},
rules: {
userIds: [
{required: true, message: this.$t('member.please_choose_member'), trigger: ['blur']}
],
groupIds: [
{required: true, message: this.$t('group.please_select_group'), trigger: ['blur']}
]
},
userList: [],
result: {}
}
},
props: {
groupType: {
type: String,
default() {
return '';
}
},
groupScopeId: {
type: String,
default() {
return '';
}
}
},
methods: {
submitForm() {
this.$refs['form'].validate((valid) => {
if (valid) {
let param = {
userIds: this.form.userIds,
groupIds: this.form.groupIds,
};
this.$emit("submit", param);
}
});
},
open() {
this.dialogVisible = true;
this.result = this.$get('/user/list/', response => {
this.userList = response.data;
})
this.result = this.$post('/user/group/list', {type: this.groupType, resourceId: this.groupScopeId}, response => {
this.$set(this.form, "groups", response.data);
})
},
close() {
this.dialogVisible = false;
this.form = {};
}
}
}
</script>
<style scoped>
.user-select-left {
float: left;
}
.user-select-right {
float: right;
margin-right: 18px;
color: #8492a6;
font-size: 13px;
}
.select-width {
width: 100%;
}
</style>

View File

@ -48,49 +48,7 @@
:total="total"/> :total="total"/>
</el-card> </el-card>
<el-dialog :close-on-click-modal="false" :title="$t('member.create')" :visible.sync="createVisible" width="40%" :destroy-on-close="true" <add-member :group-type="'ORGANIZATION'" :group-scope-id="orgId" ref="addMember" @submit="submitForm"/>
@close="handleClose">
<el-form :model="form" ref="form" :rules="rules" label-position="right" label-width="100px" size="small">
<el-form-item :label="$t('commons.member')" prop="ids"
:rules="{required: true, message: $t('member.please_choose_member'), trigger: 'blur'}">
<el-select
v-model="form.ids"
multiple
filterable
:popper-append-to-body="false"
class="select-width"
:placeholder="$t('member.please_choose_member')">
<el-option
v-for="item in userList"
:key="item.id"
:label="item.id"
:value="item.id">
<template>
<span class="org-member-name">{{item.name}} ({{item.id}})</span>
<span class="org-member-email">{{item.email}}</span>
</template>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('commons.group')" prop="groupIds">
<el-select v-model="form.groupIds" multiple :placeholder="$t('group.please_select_group')" class="select-width">
<el-option
v-for="item in form.groups"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-form>
<template v-slot:footer>
<ms-dialog-footer
@cancel="createVisible = false"
@confirm="submitForm('form')"/>
</template>
</el-dialog>
<el-dialog :close-on-click-modal="false" :title="$t('member.modify')" :visible.sync="updateVisible" width="30%" :destroy-on-close="true" <el-dialog :close-on-click-modal="false" :title="$t('member.modify')" :visible.sync="updateVisible" width="30%" :destroy-on-close="true"
@close="handleClose"> @close="handleClose">
@ -148,10 +106,12 @@
import UserCascader from "@/business/components/settings/system/components/UserCascader"; import UserCascader from "@/business/components/settings/system/components/UserCascader";
import ShowMoreBtn from "@/business/components/track/case/components/ShowMoreBtn"; import ShowMoreBtn from "@/business/components/track/case/components/ShowMoreBtn";
import {GROUP_ORGANIZATION} from "@/common/js/constants"; import {GROUP_ORGANIZATION} from "@/common/js/constants";
import AddMember from "@/business/components/settings/common/AddMember";
export default { export default {
name: "MsOrganizationMember", name: "MsOrganizationMember",
components: {MsCreateBox, MsTablePagination, MsTableHeader, MsRolesTag, MsTableOperator, MsDialogFooter, components: {
AddMember, MsCreateBox, MsTablePagination, MsTableHeader, MsRolesTag, MsTableOperator, MsDialogFooter,
MsTableHeaderSelectPopover,UserCascader,ShowMoreBtn}, MsTableHeaderSelectPopover,UserCascader,ShowMoreBtn},
activated() { activated() {
this.initTableData(); this.initTableData();
@ -198,6 +158,11 @@
userList: [] userList: []
} }
}, },
computed: {
orgId() {
return getCurrentOrganizationId();
}
},
methods: { methods: {
currentUser: () => { currentUser: () => {
return getCurrentUser(); return getCurrentUser();
@ -303,39 +268,16 @@
}); });
}, },
create() { create() {
let orgId = this.currentUser().lastOrganizationId; this.$refs.addMember.open();
if (!orgId) {
this.$warning(this.$t('organization.select_organization'));
return false;
}
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);
})
listenGoBack(this.handleClose); listenGoBack(this.handleClose);
}, },
submitForm(formName) { submitForm(param) {
this.$refs[formName].validate((valid) => { param['organizationId'] = this.orgId;
let orgId = this.currentUser().lastOrganizationId; this.result = this.$post("user/org/member/add", param, () => {
if (valid) { this.$success(this.$t('commons.save_success'));
let param = { this.initTableData();
userIds: this.form.ids, this.$refs.addMember.close();
groupIds: this.form.groupIds, })
organizationId: orgId
};
this.result = this.$post("user/org/member/add", param, () => {
this.$success(this.$t('commons.save_success'));
this.initTableData();
this.createVisible = false;
})
} else {
return false;
}
});
}, },
initWorkspaceBatchProcessDataStruct(isShow){ initWorkspaceBatchProcessDataStruct(isShow){
let organizationId = getCurrentOrganizationId(); let organizationId = getCurrentOrganizationId();

View File

@ -102,51 +102,7 @@
</el-dialog> </el-dialog>
<!-- add workspace member dialog --> <!-- add workspace member dialog -->
<el-dialog :close-on-click-modal="false" :title="$t('member.create')" :visible.sync="dialogWsMemberAddVisible" <add-member :group-type="'WORKSPACE'" :group-scope-id="orgId" ref="addMember" @submit="submitForm"/>
width="40%"
:destroy-on-close="true"
@close="closeFunc">
<el-form :model="memberForm" ref="form" :rules="wsMemberRule" label-position="right" label-width="100px"
size="small">
<el-form-item :label="$t('commons.member')" prop="userIds"
:rules="{required: true, message: $t('member.please_choose_member'), trigger: 'blur'}">
<el-select
v-model="memberForm.userIds"
multiple
filterable
:popper-append-to-body="false"
class="select-width"
:placeholder="$t('member.please_choose_member')">
<el-option
v-for="item in userList"
:key="item.id"
:label="item.id"
:value="item.id">
<template>
<span class="ws-member-name">{{item.name}} ({{item.id}})</span>
<span class="ws-member-email">{{item.email}}</span>
</template>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('commons.group')" prop="groupIds">
<el-select v-model="memberForm.groupIds" multiple :placeholder="$t('group.please_select_group')"
class="select-width">
<el-option
v-for="item in memberForm.groups"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-form>
<template v-slot:footer>
<ms-dialog-footer
@cancel="dialogWsMemberAddVisible = false"
@confirm="submitForm('form')"/>
</template>
</el-dialog>
<!-- update workspace member dialog --> <!-- update workspace member dialog -->
<el-dialog :close-on-click-modal="false" :title="$t('member.modify')" :visible.sync="dialogWsMemberUpdateVisible" <el-dialog :close-on-click-modal="false" :title="$t('member.modify')" :visible.sync="dialogWsMemberUpdateVisible"
@ -210,6 +166,7 @@ import {
removeGoBackListener removeGoBackListener
} from "../../../../common/js/utils"; } from "../../../../common/js/utils";
import MsDeleteConfirm from "../../common/components/MsDeleteConfirm"; import MsDeleteConfirm from "../../common/components/MsDeleteConfirm";
import AddMember from "@/business/components/settings/common/AddMember";
export default { export default {
name: "MsOrganizationWorkspace", name: "MsOrganizationWorkspace",
@ -221,7 +178,8 @@ export default {
MsRolesTag, MsRolesTag,
MsTableOperator, MsTableOperator,
MsDialogFooter, MsDialogFooter,
MsTableOperatorButton MsTableOperatorButton,
AddMember
}, },
activated() { activated() {
this.list(); this.list();
@ -232,6 +190,9 @@ export default {
}, },
workspaceId() { workspaceId() {
return getCurrentWorkspaceId(); return getCurrentWorkspaceId();
},
orgId() {
return getCurrentOrganizationId();
} }
}, },
inject: [ inject: [
@ -351,14 +312,7 @@ export default {
}, },
addMember() { addMember() {
this.dialogWsMemberAddVisible = true; this.$refs.addMember.open();
this.memberForm = {};
this.result = this.$get('/user/list/', response => {
this.userList = response.data;
});
this.result = this.$post('/user/group/list', {type: GROUP_WORKSPACE, resourceId: getCurrentOrganizationId()}, response => {
this.$set(this.memberForm, "groups", response.data);
});
listenGoBack(this.close); listenGoBack(this.close);
}, },
cellClick(row) { cellClick(row) {
@ -408,33 +362,12 @@ export default {
closeFunc() { closeFunc() {
this.form = {}; this.form = {};
}, },
submitForm(formName) { submitForm(param) {
this.$refs[formName].validate((valid) => { param['workspaceId'] = this.currentWorkspaceRow.id;
if (valid) { this.result = this.$post("user/ws/member/add", param, () => {
// let userIds = []; this.$success(this.$t('commons.save_success'));
// let userId = this.memberForm.userId; this.cellClick(this.currentWorkspaceRow);
// let email = this.memberForm.memberSign; this.$refs.addMember.close();
// 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: this.memberForm.userIds,
groupIds: this.memberForm.groupIds,
workspaceId: this.currentWorkspaceRow.id
};
this.result = this.$post("user/ws/member/add", param, () => {
this.$success(this.$t('commons.save_success'));
this.cellClick(this.currentWorkspaceRow);
this.dialogWsMemberAddVisible = false;
});
} else {
return false;
}
}); });
}, },
editMember(row) { editMember(row) {

View File

@ -1,55 +1,15 @@
<template> <template>
<el-dialog :close-on-click-modal="false" :title="$t('member.create')" :visible.sync="dialogVisible" width="40%" :destroy-on-close="true" <add-member :group-type="GROUP_PROJECT" :group-scope-id="organizationId" ref="addMember" @submit="submit"/>
@close="handleClose">
<el-form :model="form" ref="form" :rules="rules" label-position="right" label-width="100px" size="small">
<el-form-item :label="$t('commons.member')" prop="userIds" :rules="{required: true, message: $t('member.please_choose_member'), trigger: 'blur'}">
<el-select
v-model="form.userIds"
multiple
filterable
:popper-append-to-body="false"
class="select-width"
:placeholder="$t('member.please_choose_member')">
<el-option
v-for="item in userList"
:key="item.id"
:label="item.id"
:value="item.id">
<template>
<span class="workspace-member-name">{{item.name}} ({{item.id}})</span>
<span class="workspace-member-email">{{item.email}}</span>
</template>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('commons.group')" prop="groupIds">
<el-select v-model="form.groupIds" multiple :placeholder="$t('group.please_select_group')" class="select-width">
<el-option
v-for="item in form.groups"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-form>
<template v-slot:footer>
<div class="dialog-footer">
<el-button @click="dialogVisible = false" size="medium">{{ $t('commons.cancel') }}</el-button>
<el-button type="primary" @click="submitForm('form')" @keydown.enter.native.prevent size="medium">
{{ $t('commons.confirm') }}
</el-button>
</div>
</template>
</el-dialog>
</template> </template>
<script> <script>
import {GROUP_PROJECT} from "@/common/js/constants"; import {GROUP_PROJECT} from "@/common/js/constants";
import {getCurrentOrganizationId, getCurrentProjectID} from "@/common/js/utils"; import {getCurrentOrganizationId, getCurrentProjectID} from "@/common/js/utils";
import AddMember from "@/business/components/settings/common/AddMember";
export default { export default {
name: "EditMember", name: "EditMember",
components: {AddMember},
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
@ -68,49 +28,30 @@ export default {
computed: { computed: {
projectId() { projectId() {
return getCurrentProjectID(); return getCurrentProjectID();
},
organizationId() {
return getCurrentOrganizationId();
},
GROUP_PROJECT() {
return GROUP_PROJECT;
} }
}, },
methods: { methods: {
submitForm() { submit(param) {
this.$refs['form'].validate((valid) => { param['projectId'] = this.projectId
if (valid) { this.result = this.$post("user/project/member/add", param, () => {
let param = { this.$success(this.$t('commons.save_success'));
userIds: this.form.userIds, this.$emit("refresh");
groupIds: this.form.groupIds, this.$refs.addMember.close();
projectId: this.projectId })
};
this.result = this.$post("user/project/member/add", param, () => {
this.$success(this.$t('commons.save_success'));
this.$emit("refresh");
this.dialogVisible = false;
})
}
});
}, },
open() { open() {
this.$get('/user/list/', response => { this.$refs.addMember.open();
this.dialogVisible = true;
this.userList = response.data;
})
this.result = this.$post('/user/group/list', {type: GROUP_PROJECT, resourceId: getCurrentOrganizationId()}, response => {
this.$set(this.form, "groups", response.data);
})
}, },
handleClose() { handleClose() {
this.dialogVisible = false; this.dialogVisible = false;
this.form = {}; this.form = {};
}, }
querySearch(queryString, cb) {
var userList = this.userList;
var results = queryString ? userList.filter(this.createFilter(queryString)) : userList;
// callback
cb(results);
},
createFilter(queryString) {
return (user) => {
return (user.email.indexOf(queryString.toLowerCase()) === 0 || user.id.indexOf(queryString.toLowerCase()) === 0);
};
},
} }
} }
</script> </script>

View File

@ -199,52 +199,7 @@
</template> </template>
</el-dialog> </el-dialog>
<add-member :group-type="'PROJECT'" :group-scope-id="orgId" ref="addMember" @submit="submitForm"/>
<el-dialog :close-on-click-modal="false" :title="$t('member.create')" :visible.sync="dialogMemberVisible" width="40%"
:destroy-on-close="true"
@close="handleMemberClose">
<el-form :model="memberForm" ref="form" :rules="rules" label-position="right" label-width="100px" size="small">
<el-form-item :label="$t('commons.member')" prop="userIds"
:rules="{required: true, message:$t('member.please_choose_member'), trigger: 'blur'}">
<el-select
v-model="memberForm.userIds"
multiple
filterable
:popper-append-to-body="false"
class="select-width"
:placeholder="$t('member.please_choose_member')">
<el-option
v-for="item in userList"
:key="item.id"
:label="item.id"
:value="item.id">
<template>
<span class="workspace-member-name">{{item.name}} ({{item.id}})</span>
<span class="workspace-member-email">{{item.email}}</span>
</template>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('commons.group')" prop="groupIds" :rules="{required: true, message: $t('group.please_select_group'), trigger: 'blur'}">
<el-select v-model="memberForm.groupIds" multiple :placeholder="$t('group.please_select_group')" style="width: 100%">
<el-option
v-for="item in memberForm.groups"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-form>
<template v-slot:footer>
<div class="dialog-footer">
<el-button @click="dialogMemberVisible = false" size="medium">{{ $t('commons.cancel') }}</el-button>
<el-button type="primary" @click="submitForm('form')" @keydown.enter.native.prevent size="medium">
{{ $t('commons.confirm') }}
</el-button>
</div>
</template>
</el-dialog>
<ms-delete-confirm :title="$t('project.delete')" @delete="_handleDelete" ref="deleteConfirm"/> <ms-delete-confirm :title="$t('project.delete')" @delete="_handleDelete" ref="deleteConfirm"/>
@ -285,6 +240,7 @@ import MsResourceFiles from "@/business/components/performance/test/components/R
import TemplateSelect from "@/business/components/settings/workspace/template/TemplateSelect"; import TemplateSelect from "@/business/components/settings/workspace/template/TemplateSelect";
import {PROJECT_CONFIGS} from "@/business/components/common/components/search/search-components"; import {PROJECT_CONFIGS} from "@/business/components/common/components/search/search-components";
import MsRolesTag from "@/business/components/common/components/MsRolesTag"; import MsRolesTag from "@/business/components/common/components/MsRolesTag";
import AddMember from "@/business/components/settings/common/AddMember";
export default { export default {
name: "MsProject", name: "MsProject",
@ -298,7 +254,8 @@ export default {
MsTableOperatorButton, MsTableOperatorButton,
MsDeleteConfirm, MsDeleteConfirm,
MsMainContainer, MsRolesTag, MsMainContainer, MsRolesTag,
MsContainer, MsTableOperator, MsCreateBox, MsTablePagination, MsTableHeader, MsDialogFooter MsContainer, MsTableOperator, MsCreateBox, MsTablePagination, MsTableHeader, MsDialogFooter,
AddMember
}, },
inject: [ inject: [
'reloadTopMenus' 'reloadTopMenus'
@ -367,6 +324,9 @@ export default {
}, },
projectId() { projectId() {
return getCurrentProjectID(); return getCurrentProjectID();
},
orgId() {
return getCurrentOrganizationId();
} }
}, },
destroyed() { destroyed() {
@ -616,33 +576,16 @@ export default {
} }
}); });
}, },
submitForm() { submitForm(param) {
this.$refs['form'].validate((valid) => { param['projectId'] = this.currentProjectId;
if (valid) { this.result = this.$post("user/project/member/add", param, () => {
let param = { this.$success(this.$t('commons.save_success'));
userIds: this.memberForm.userIds, this.dialogSearch();
groupIds: this.memberForm.groupIds, this.$refs.addMember.close();
projectId: this.currentProjectId
};
this.result = this.$post("user/project/member/add", param, () => {
this.$success(this.$t('commons.save_success'));
this.dialogSearch();
this.dialogMemberVisible = false;
});
}
}); });
}, },
open() { open() {
this.$get('/user/list/', response => { this.$refs.addMember.open();
this.dialogMemberVisible = true;
this.userList = response.data;
});
this.result = this.$post('/user/group/list', {
type: GROUP_PROJECT,
resourceId: getCurrentOrganizationId()
}, response => {
this.$set(this.memberForm, "groups", response.data);
});
}, },
handleMemberClose() { handleMemberClose() {
this.dialogMemberVisible = false; this.dialogMemberVisible = false;

View File

@ -49,46 +49,7 @@
:total="total"/> :total="total"/>
</el-card> </el-card>
<el-dialog :close-on-click-modal="false" :title="$t('member.create')" :visible.sync="createVisible" width="40%" :destroy-on-close="true" <add-member :group-type="'WORKSPACE'" :group-scope-id="orgId" ref="addMember" @submit="submitForm"/>
@close="handleClose">
<el-form :model="form" ref="form" :rules="rules" label-position="right" label-width="100px" size="small">
<el-form-item :label="$t('commons.member')" prop="userIds" :rules="{required: true, message: $t('member.please_choose_member'), trigger: 'blur'}">
<el-select
v-model="form.userIds"
multiple
filterable
:popper-append-to-body="false"
class="select-width"
:placeholder="$t('member.please_choose_member')">
<el-option
v-for="item in userList"
:key="item.id"
:label="item.id"
:value="item.id">
<template>
<span class="workspace-member-name">{{item.name}} ({{item.id}})</span>
<span class="workspace-member-email">{{item.email}}</span>
</template>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('commons.group')" prop="groupIds">
<el-select v-model="form.groupIds" multiple :placeholder="$t('group.please_select_group')" class="select-width">
<el-option
v-for="item in form.groups"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-form>
<template v-slot:footer>
<ms-dialog-footer
@cancel="createVisible = false"
@confirm="submitForm('form')"/>
</template>
</el-dialog>
<el-dialog :close-on-click-modal="false" :title="$t('member.modify')" :visible.sync="updateVisible" width="30%" :destroy-on-close="true" <el-dialog :close-on-click-modal="false" :title="$t('member.modify')" :visible.sync="updateVisible" width="30%" :destroy-on-close="true"
@close="handleClose"> @close="handleClose">
@ -150,10 +111,12 @@
import UserCascader from "@/business/components/settings/system/components/UserCascader"; import UserCascader from "@/business/components/settings/system/components/UserCascader";
import ShowMoreBtn from "@/business/components/track/case/components/ShowMoreBtn"; import ShowMoreBtn from "@/business/components/track/case/components/ShowMoreBtn";
import {GROUP_WORKSPACE} from "@/common/js/constants"; import {GROUP_WORKSPACE} from "@/common/js/constants";
import AddMember from "@/business/components/settings/common/AddMember";
export default { export default {
name: "MsMember", name: "MsMember",
components: {MsCreateBox, MsTablePagination, MsTableHeader, MsRolesTag, MsTableOperator, MsDialogFooter, components: {
AddMember, MsCreateBox, MsTablePagination, MsTableHeader, MsRolesTag, MsTableOperator, MsDialogFooter,
MsTableHeaderSelectPopover,UserCascader,ShowMoreBtn}, MsTableHeaderSelectPopover,UserCascader,ShowMoreBtn},
data() { data() {
return { return {
@ -191,6 +154,11 @@
], ],
} }
}, },
computed: {
orgId() {
return getCurrentOrganizationId();
}
},
activated: function () { activated: function () {
this.initTableData(); this.initTableData();
}, },
@ -301,7 +269,7 @@
}); });
}, },
create() { create() {
this.form = {}; // this.form = {};
// let param = { // let param = {
// name: this.condition.name, // name: this.condition.name,
// organizationId: this.currentUser().lastOrganizationId // organizationId: this.currentUser().lastOrganizationId
@ -315,31 +283,24 @@
// this.createVisible = true; // this.createVisible = true;
// this.userList = response.data; // this.userList = response.data;
// }) // })
this.$get('/user/list/', response => { // this.$get('/user/list/', response => {
this.createVisible = true; // this.createVisible = true;
this.userList = response.data; // this.userList = response.data;
}) // })
this.result = this.$post('/user/group/list', {type: GROUP_WORKSPACE, resourceId: getCurrentOrganizationId()}, response => { // this.result = this.$post('/user/group/list', {type: GROUP_WORKSPACE, resourceId: getCurrentOrganizationId()}, response => {
this.$set(this.form, "groups", response.data); // this.$set(this.form, "groups", response.data);
}) // })
this.$refs.addMember.open();
listenGoBack(this.handleClose); listenGoBack(this.handleClose);
}, },
submitForm(formName) { submitForm(param) {
this.$refs[formName].validate((valid) => { param['workspaceId'] = getCurrentWorkspaceId();
if (valid) { this.result = this.$post("user/ws/member/add", param, () => {
let param = { this.$success(this.$t('commons.save_success'));
userIds: this.form.userIds, this.initTableData();
groupIds: this.form.groupIds, this.selectRows.clear();
workspaceId: getCurrentWorkspaceId() this.$refs.addMember.close();
}; })
this.result = this.$post("user/ws/member/add", param, () => {
this.$success(this.$t('commons.save_success'));
this.initTableData();
this.selectRows.clear();
this.createVisible = false;
})
}
});
}, },
querySearch(queryString, cb) { querySearch(queryString, cb) {
var userList = this.userList; var userList = this.userList;