修改变量命名

This commit is contained in:
shiziyuan9527 2020-04-27 15:14:43 +08:00
parent ca497f71b6
commit afbc7b5060
3 changed files with 90 additions and 103 deletions

View File

@ -27,7 +27,7 @@
:total="total"/> :total="total"/>
</el-card> </el-card>
<el-dialog :title="$t('workspace.create')" :visible.sync="createVisible" width="30%"> <el-dialog :title="$t('workspace.create')" :visible.sync="dialogWsAddVisible" width="30%">
<el-form :model="form" :rules="rules" ref="form" label-position="right" label-width="100px" size="small"> <el-form :model="form" :rules="rules" ref="form" label-position="right" label-width="100px" size="small">
<el-form-item :label="$t('commons.name')" prop="name"> <el-form-item :label="$t('commons.name')" prop="name">
<el-input v-model="form.name" autocomplete="off"/> <el-input v-model="form.name" autocomplete="off"/>
@ -45,7 +45,7 @@
</el-dialog> </el-dialog>
<!-- dialog of workspace member --> <!-- dialog of workspace member -->
<el-dialog :visible.sync="memberVisible" width="70%" :destroy-on-close="true" @close="closeMemberFunc"> <el-dialog :visible.sync="dialogWsMemberVisible" width="70%" :destroy-on-close="true" @close="closeMemberFunc">
<ms-table-header :condition.sync="dialogCondition" @create="addMember" @search="wsMemberList" <ms-table-header :condition.sync="dialogCondition" @create="addMember" @search="wsMemberList"
:create-tip="dialogBtnTips" :title="$t('commons.member')"/> :create-tip="dialogBtnTips" :title="$t('commons.member')"/>
<!-- organization member table --> <!-- organization member table -->
@ -69,12 +69,12 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<ms-table-pagination :change="wsMemberList" :current-page.sync="currentMemberPage" :page-size.sync="pageMemberSize" <ms-table-pagination :change="wsMemberList" :current-page.sync="dialogCurrentPage" :page-size.sync="dialogPageSize"
:total="memberTotal"/> :total="dialogTotal"/>
</el-dialog> </el-dialog>
<!-- add workspace member dialog --> <!-- add workspace member dialog -->
<el-dialog :title="$t('member.create')" :visible.sync="addMemberVisible" width="30%" :destroy-on-close="true" <el-dialog :title="$t('member.create')" :visible.sync="dialogWsMemberAddVisible" width="30%" :destroy-on-close="true"
@close="closeFunc"> @close="closeFunc">
<el-form :model="memberForm" ref="form" :rules="wsMemberRule" label-position="right" label-width="100px" <el-form :model="memberForm" ref="form" :rules="wsMemberRule" label-position="right" label-width="100px"
size="small"> size="small">
@ -112,7 +112,7 @@
</el-dialog> </el-dialog>
<!-- update workspace member dialog --> <!-- update workspace member dialog -->
<el-dialog :title="$t('member.modify')" :visible.sync="updateMemberVisible" width="30%" :destroy-on-close="true" <el-dialog :title="$t('member.modify')" :visible.sync="dialogWsMemberUpdateVisible" width="30%" :destroy-on-close="true"
@close="closeFunc"> @close="closeFunc">
<el-form :model="memberForm" label-position="right" label-width="100px" size="small" ref="updateUserForm"> <el-form :model="memberForm" label-position="right" label-width="100px" size="small" ref="updateUserForm">
<el-form-item label="ID" prop="id"> <el-form-item label="ID" prop="id">
@ -171,7 +171,7 @@
}, },
methods: { methods: {
create() { create() {
this.createVisible = true; this.dialogWsAddVisible = true;
this.form = {}; this.form = {};
}, },
submit(formName) { submit(formName) {
@ -182,7 +182,7 @@
saveType = 'update' saveType = 'update'
} }
this.$post("/workspace/" + saveType, this.form, () => { this.$post("/workspace/" + saveType, this.form, () => {
this.createVisible = false; this.dialogWsAddVisible = false;
this.list(); this.list();
Message.success(this.$t('commons.save_success')); Message.success(this.$t('commons.save_success'));
}); });
@ -192,16 +192,8 @@
}); });
}, },
edit(row) { edit(row) {
this.createVisible = true; this.dialogWsAddVisible = true;
this.form = row; this.form = row;
// let self = this;
// let getUser1 = this.$get("/test/user");
// let getUser2 = this.$get("/test/sleep");
// this.$all([getUser1, getUser2], function (r1, r2) {
// window.console.log(r1.data.data, r2.data.data);
// self.loading = false;
// });
}, },
del(row) { del(row) {
this.$confirm(this.$t('workspace.delete_confirm'), '', { this.$confirm(this.$t('workspace.delete_confirm'), '', {
@ -250,7 +242,7 @@
}, },
addMember() { addMember() {
this.addMemberVisible = true; this.dialogWsMemberAddVisible = true;
this.memberForm = {}; this.memberForm = {};
this.result = this.$get('/user/list/', response => { this.result = this.$get('/user/list/', response => {
this.$set(this.memberForm, "userList", response.data); this.$set(this.memberForm, "userList", response.data);
@ -262,7 +254,7 @@
cellClick(row) { cellClick(row) {
// currentRow // currentRow
this.currentWorkspaceRow = row; this.currentWorkspaceRow = row;
this.memberVisible = true; this.dialogWsMemberVisible = true;
let param = { let param = {
name: '', name: '',
workspaceId: row.id workspaceId: row.id
@ -279,12 +271,12 @@
this.$set(this.memberLineData[i], "roles", roles); this.$set(this.memberLineData[i], "roles", roles);
}) })
} }
this.memberTotal = data.itemCount; this.dialogTotal = data.itemCount;
}); });
}, },
wsMemberList() { wsMemberList() {
let row = this.currentWorkspaceRow; let row = this.currentWorkspaceRow;
this.memberVisible = true; this.dialogWsMemberVisible = true;
let param = this.dialogCondition; let param = this.dialogCondition;
this.$set(param, 'workspaceId', row.id); this.$set(param, 'workspaceId', row.id);
let path = "/user/ws/member/list"; let path = "/user/ws/member/list";
@ -299,7 +291,7 @@
this.$set(this.memberLineData[i], "roles", roles); this.$set(this.memberLineData[i], "roles", roles);
}) })
} }
this.memberTotal = data.itemCount; this.dialogTotal = data.itemCount;
}); });
}, },
closeFunc() { closeFunc() {
@ -319,7 +311,7 @@
}; };
this.result = this.$post("user/ws/member/add", param, () => { this.result = this.$post("user/ws/member/add", param, () => {
this.cellClick(this.currentWorkspaceRow); this.cellClick(this.currentWorkspaceRow);
this.addMemberVisible = false; this.dialogWsMemberAddVisible = false;
}) })
} else { } else {
return false; return false;
@ -327,7 +319,7 @@
}); });
}, },
editMember(row) { editMember(row) {
this.updateMemberVisible = true; this.dialogWsMemberUpdateVisible = true;
this.memberForm = row; this.memberForm = row;
let roleIds = this.memberForm.roles.map(r => r.id); let roleIds = this.memberForm.roles.map(r => r.id);
this.result = this.$get('/role/list/test', response => { this.result = this.$get('/role/list/test', response => {
@ -361,19 +353,21 @@
} }
this.result = this.$post("/workspace/member/update", param, () => { this.result = this.$post("/workspace/member/update", param, () => {
this.$success(this.$t('commons.modify_success')); this.$success(this.$t('commons.modify_success'));
this.updateMemberVisible = false; this.dialogWsMemberUpdateVisible = false;
this.cellClick(this.currentWorkspaceRow); this.cellClick(this.currentWorkspaceRow);
}); });
}, },
buildPagePath(path) { buildPagePath(path) {
return path + "/" + this.currentMemberPage + "/" + this.pageMemberSize; return path + "/" + this.dialogCurrentPage + "/" + this.dialogPageSize;
}, },
}, },
data() { data() {
return { return {
result: {}, result: {},
loading: false, dialogWsAddVisible: false,
createVisible: false, dialogWsMemberVisible: false,
dialogWsMemberAddVisible: false,
dialogWsMemberUpdateVisible: false,
btnTips: this.$t('workspace.create'), btnTips: this.$t('workspace.create'),
dialogBtnTips: this.$t('member.create'), dialogBtnTips: this.$t('member.create'),
addTips: this.$t('member.create'), addTips: this.$t('member.create'),
@ -383,13 +377,9 @@
currentPage: 1, currentPage: 1,
pageSize: 5, pageSize: 5,
total: 0, total: 0,
updateVisible: false, dialogCurrentPage: 1,
memberVisible: false, dialogPageSize: 5,
addMemberVisible: false, dialogTotal: 0,
updateMemberVisible: false,
currentMemberPage: 1,
pageMemberSize: 5,
memberTotal: 0,
memberLineData: [], memberLineData: [],
memberForm: {}, memberForm: {},
form: { form: {

View File

@ -3,7 +3,7 @@
<el-card> <el-card>
<template v-slot:header> <template v-slot:header>
<ms-table-header :condition.sync="condition" @search="search" @create="create" <ms-table-header :condition.sync="condition" @search="initTableData" @create="create"
:create-tip="btnTips" :title="$t('commons.organization')"/> :create-tip="btnTips" :title="$t('commons.organization')"/>
</template> </template>
<!-- system menu organization table--> <!-- system menu organization table-->
@ -29,8 +29,9 @@
<ms-table-pagination :change="initTableData" :current-page.sync="currentPage" :page-size.sync="pageSize" <ms-table-pagination :change="initTableData" :current-page.sync="currentPage" :page-size.sync="pageSize"
:total="total"/> :total="total"/>
</el-card> </el-card>
<!-- dialog of organization member --> <!-- dialog of organization member -->
<el-dialog :visible.sync="memberVisible" width="70%" :destroy-on-close="true" @close="closeMemberFunc"> <el-dialog :visible.sync="dialogOrgMemberVisible" width="70%" :destroy-on-close="true" @close="closeMemberFunc">
<ms-table-header :condition.sync="dialogCondition" @create="addMember" @search="orgMemberList" <ms-table-header :condition.sync="dialogCondition" @create="addMember" @search="orgMemberList"
:create-tip="dialogBtnTips" :title="$t('commons.member')"/> :create-tip="dialogBtnTips" :title="$t('commons.member')"/>
<!-- organization member table --> <!-- organization member table -->
@ -54,13 +55,13 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<ms-table-pagination :change="orgMemberList" :current-page.sync="currentMemberPage" <ms-table-pagination :change="orgMemberList" :current-page.sync="dialogCurrentPage"
:page-size.sync="pageMemberSize" :page-size.sync="dialogPageSize"
:total="memberTotal"/> :total="dialogTotal"/>
</el-dialog> </el-dialog>
<!-- add organization form --> <!-- add organization form -->
<el-dialog :title="$t('organization.create')" :visible.sync="createVisible" width="30%" @closed="closeFunc" <el-dialog :title="$t('organization.create')" :visible.sync="dialogOrgAddVisible" width="30%" @closed="closeFunc"
:destroy-on-close="true"> :destroy-on-close="true">
<el-form :model="form" label-position="right" label-width="100px" size="small" :rules="rule" <el-form :model="form" label-position="right" label-width="100px" size="small" :rules="rule"
ref="createOrganization"> ref="createOrganization">
@ -80,7 +81,8 @@
</el-dialog> </el-dialog>
<!-- update organization form --> <!-- update organization form -->
<el-dialog :title="$t('organization.modify')" :visible.sync="updateVisible" width="30%" :destroy-on-close="true" <el-dialog :title="$t('organization.modify')" :visible.sync="dialogOrgUpdateVisible" width="30%"
:destroy-on-close="true"
@close="closeFunc"> @close="closeFunc">
<el-form :model="form" label-position="right" label-width="100px" size="small" :rules="rule" <el-form :model="form" label-position="right" label-width="100px" size="small" :rules="rule"
ref="updateOrganizationForm"> ref="updateOrganizationForm">
@ -101,7 +103,8 @@
</el-dialog> </el-dialog>
<!-- add organization member form --> <!-- add organization member form -->
<el-dialog :title="$t('member.create')" :visible.sync="addMemberVisible" width="30%" :destroy-on-close="true" <el-dialog :title="$t('member.create')" :visible.sync="dialogOrgMemberAddVisible" width="30%"
:destroy-on-close="true"
@close="closeFunc"> @close="closeFunc">
<el-form :model="memberForm" ref="form" :rules="orgMemberRule" label-position="right" label-width="100px" <el-form :model="memberForm" ref="form" :rules="orgMemberRule" label-position="right" label-width="100px"
size="small"> size="small">
@ -139,7 +142,8 @@
</el-dialog> </el-dialog>
<!-- update organization member form --> <!-- update organization member form -->
<el-dialog :title="$t('member.modify')" :visible.sync="updateMemberVisible" width="30%" :destroy-on-close="true" <el-dialog :title="$t('member.modify')" :visible.sync="dialogOrgMemberUpdateVisible" width="30%"
:destroy-on-close="true"
@close="closeFunc"> @close="closeFunc">
<el-form :model="memberForm" label-position="right" label-width="100px" size="small" ref="updateUserForm"> <el-form :model="memberForm" label-position="right" label-width="100px" size="small" ref="updateUserForm">
<el-form-item label="ID" prop="id"> <el-form-item label="ID" prop="id">
@ -192,18 +196,18 @@
createPath: '/organization/add', createPath: '/organization/add',
updatePath: '/organization/update', updatePath: '/organization/update',
result: {}, result: {},
createVisible: false, dialogOrgAddVisible: false,
updateVisible: false, dialogOrgUpdateVisible: false,
memberVisible: false, dialogOrgMemberVisible: false,
addMemberVisible: false, dialogOrgMemberAddVisible: false,
updateMemberVisible: false, dialogOrgMemberUpdateVisible: false,
multipleSelection: [], multipleSelection: [],
currentPage: 1, currentPage: 1,
pageSize: 5, pageSize: 5,
total: 0, total: 0,
currentMemberPage: 1, dialogCurrentPage: 1,
pageMemberSize: 5, dialogPageSize: 5,
memberTotal: 0, dialogTotal: 0,
currentRow: {}, currentRow: {},
btnTips: this.$t('organization.create'), btnTips: this.$t('organization.create'),
dialogBtnTips: this.$t('member.create'), dialogBtnTips: this.$t('member.create'),
@ -243,10 +247,10 @@
}, },
methods: { methods: {
create() { create() {
this.createVisible = true; this.dialogOrgAddVisible = true;
}, },
addMember() { addMember() {
this.addMemberVisible = true; this.dialogOrgMemberAddVisible = true;
this.memberForm = {}; this.memberForm = {};
this.result = this.$get('/user/list/', response => { this.result = this.$get('/user/list/', response => {
this.$set(this.memberForm, "userList", response.data); this.$set(this.memberForm, "userList", response.data);
@ -256,11 +260,11 @@
}) })
}, },
edit(row) { edit(row) {
this.updateVisible = true; this.dialogOrgUpdateVisible = true;
this.form = row; this.form = row;
}, },
editMember(row) { editMember(row) {
this.updateMemberVisible = true; this.dialogOrgMemberUpdateVisible = true;
this.memberForm = row; this.memberForm = row;
let roleIds = this.memberForm.roles.map(r => r.id); let roleIds = this.memberForm.roles.map(r => r.id);
this.result = this.$get('/role/list/org', response => { this.result = this.$get('/role/list/org', response => {
@ -272,13 +276,13 @@
cellClick(row) { cellClick(row) {
// currentRow // currentRow
this.currentRow = row; this.currentRow = row;
this.memberVisible = true; this.dialogOrgMemberVisible = true;
let param = { let param = {
name: '', name: '',
organizationId: row.id organizationId: row.id
}; };
let path = "/user/special/org/member/list"; let path = "/user/special/org/member/list";
this.result = this.$post(path + "/" + this.currentMemberPage + "/" + this.pageMemberSize, param, res => { this.result = this.$post(path + "/" + this.dialogCurrentPage + "/" + this.dialogPageSize, param, res => {
let data = res.data; let data = res.data;
this.memberLineData = data.listObject; this.memberLineData = data.listObject;
let url = "/userrole/list/org/" + row.id; let url = "/userrole/list/org/" + row.id;
@ -288,17 +292,16 @@
this.$set(this.memberLineData[i], "roles", roles); this.$set(this.memberLineData[i], "roles", roles);
}) })
} }
this.memberTotal = data.itemCount; this.dialogTotal = data.itemCount;
}); });
}, },
orgMemberList() { orgMemberList() {
let row = this.currentRow; let row = this.currentRow;
this.memberVisible = true; this.dialogOrgMemberVisible = true;
let param = this.dialogCondition; let param = this.dialogCondition;
this.$set(param, 'organizationId', row.id); this.$set(param, 'organizationId', row.id);
window.console.log(this.dialogCondition)
let path = "/user/special/org/member/list"; let path = "/user/special/org/member/list";
this.result = this.$post(path + "/" + this.currentMemberPage + "/" + this.pageMemberSize, param, res => { this.result = this.$post(path + "/" + this.dialogCurrentPage + "/" + this.dialogPageSize, param, res => {
let data = res.data; let data = res.data;
this.memberLineData = data.listObject; this.memberLineData = data.listObject;
let url = "/userrole/list/org/" + row.id; let url = "/userrole/list/org/" + row.id;
@ -308,7 +311,7 @@
this.$set(this.memberLineData[i], "roles", roles); this.$set(this.memberLineData[i], "roles", roles);
}) })
} }
this.memberTotal = data.itemCount; this.dialogTotal = data.itemCount;
}); });
}, },
del(row) { del(row) {
@ -345,7 +348,7 @@
this.result = this.$post(this.createPath, this.form, () => { this.result = this.$post(this.createPath, this.form, () => {
this.$success(this.$t('commons.save_success')); this.$success(this.$t('commons.save_success'));
this.initTableData(); this.initTableData();
this.createVisible = false; this.dialogOrgAddVisible = false;
}); });
} else { } else {
return false; return false;
@ -357,7 +360,7 @@
if (valide) { if (valide) {
this.result = this.$post(this.updatePath, this.form, () => { this.result = this.$post(this.updatePath, this.form, () => {
this.$success(this.$t('commons.modify_success')) this.$success(this.$t('commons.modify_success'))
this.updateVisible = false; this.dialogOrgUpdateVisible = false;
this.initTableData(); this.initTableData();
}); });
} else { } else {
@ -365,9 +368,6 @@
} }
}) })
}, },
search() {
this.initTableData();
},
initTableData() { initTableData() {
this.result = this.$post(this.queryPath + "/" + this.currentPage + "/" + this.pageSize, this.condition, response => { this.result = this.$post(this.queryPath + "/" + this.currentPage + "/" + this.pageSize, this.condition, response => {
let data = response.data; let data = response.data;
@ -406,7 +406,7 @@
}; };
this.result = this.$post("user/special/org/member/add", param, () => { this.result = this.$post("user/special/org/member/add", param, () => {
this.cellClick(this.currentRow); this.cellClick(this.currentRow);
this.addMemberVisible = false; this.dialogOrgMemberAddVisible = false;
}) })
} else { } else {
return false; return false;
@ -424,7 +424,7 @@
} }
this.result = this.$post("/organization/member/update", param, () => { this.result = this.$post("/organization/member/update", param, () => {
this.$success(this.$t('commons.modify_success')) this.$success(this.$t('commons.modify_success'))
this.updateMemberVisible = false; this.dialogOrgMemberUpdateVisible = false;
this.cellClick(this.currentRow); this.cellClick(this.currentRow);
}); });
}, },

View File

@ -28,7 +28,7 @@
</el-card> </el-card>
<!-- add workspace dialog --> <!-- add workspace dialog -->
<el-dialog :title="$t('workspace.create')" :visible.sync="createVisible" width="30%"> <el-dialog :title="$t('workspace.create')" :visible.sync="dialogWsAddVisible" width="30%">
<el-form :model="form" :rules="rules" ref="form" label-position="right" label-width="100px" size="small"> <el-form :model="form" :rules="rules" ref="form" label-position="right" label-width="100px" size="small">
<el-form-item :label="$t('commons.name')" prop="name"> <el-form-item :label="$t('commons.name')" prop="name">
<el-input v-model="form.name" autocomplete="off"/> <el-input v-model="form.name" autocomplete="off"/>
@ -56,7 +56,7 @@
</el-dialog> </el-dialog>
<!-- update workspace dialog --> <!-- update workspace dialog -->
<el-dialog :title="$t('workspace.update')" :visible.sync="updateVisible" width="30%"> <el-dialog :title="$t('workspace.update')" :visible.sync="dialogWsUpdateVisible" width="30%">
<el-form :model="form" :rules="rules" ref="updateForm" label-position="right" label-width="100px" size="small"> <el-form :model="form" :rules="rules" ref="updateForm" label-position="right" label-width="100px" size="small">
<el-form-item :label="$t('commons.name')" prop="name"> <el-form-item :label="$t('commons.name')" prop="name">
<el-input v-model="form.name" autocomplete="off"/> <el-input v-model="form.name" autocomplete="off"/>
@ -86,7 +86,7 @@
</el-dialog> </el-dialog>
<!-- dialog of workspace member --> <!-- dialog of workspace member -->
<el-dialog :visible.sync="memberVisible" width="70%" :destroy-on-close="true" @close="closeMemberFunc"> <el-dialog :visible.sync="dialogWsMemberVisible" width="70%" :destroy-on-close="true" @close="closeMemberFunc">
<ms-table-header :condition.sync="dialogCondition" @create="addMember" @search="wsMemberList" <ms-table-header :condition.sync="dialogCondition" @create="addMember" @search="wsMemberList"
:create-tip="dialogBtnTips" :title="$t('commons.member')"/> :create-tip="dialogBtnTips" :title="$t('commons.member')"/>
<!-- organization member table --> <!-- organization member table -->
@ -110,13 +110,13 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<ms-table-pagination :change="wsMemberList" :current-page.sync="currentMemberPage" <ms-table-pagination :change="wsMemberList" :current-page.sync="dialogCurrentPage"
:page-size.sync="pageMemberSize" :page-size.sync="dialogPageSize"
:total="memberTotal"/> :total="dialogTotal"/>
</el-dialog> </el-dialog>
<!-- add workspace member dialog --> <!-- add workspace member dialog -->
<el-dialog :title="$t('member.create')" :visible.sync="addMemberVisible" width="30%" :destroy-on-close="true" <el-dialog :title="$t('member.create')" :visible.sync="dialogWsMemberAddVisible" width="30%" :destroy-on-close="true"
@close="closeFunc"> @close="closeFunc">
<el-form :model="memberForm" ref="form" :rules="wsMemberRule" label-position="right" label-width="100px" <el-form :model="memberForm" ref="form" :rules="wsMemberRule" label-position="right" label-width="100px"
size="small"> size="small">
@ -153,7 +153,7 @@
</el-dialog> </el-dialog>
<!-- update workspace member dialog --> <!-- update workspace member dialog -->
<el-dialog :title="$t('member.modify')" :visible.sync="updateMemberVisible" width="30%" :destroy-on-close="true" <el-dialog :title="$t('member.modify')" :visible.sync="dialogWsMemberUpdateVisible" width="30%" :destroy-on-close="true"
@close="closeFunc"> @close="closeFunc">
<el-form :model="memberForm" label-position="right" label-width="100px" size="small" ref="updateUserForm"> <el-form :model="memberForm" label-position="right" label-width="100px" size="small" ref="updateUserForm">
<el-form-item label="ID" prop="id"> <el-form-item label="ID" prop="id">
@ -206,7 +206,7 @@
}, },
methods: { methods: {
create() { create() {
this.createVisible = true; this.dialogWsAddVisible = true;
this.form = {}; this.form = {};
this.$get("/organization/list", response => { this.$get("/organization/list", response => {
this.$set(this.form, "orgList", response.data); this.$set(this.form, "orgList", response.data);
@ -220,7 +220,7 @@
saveType = 'update' saveType = 'update'
} }
this.result = this.$post("/workspace/" + saveType, this.form, () => { this.result = this.$post("/workspace/" + saveType, this.form, () => {
this.createVisible = false; this.dialogWsAddVisible = false;
this.list(); this.list();
Message.success(this.$t('commons.save_success')); Message.success(this.$t('commons.save_success'));
}); });
@ -230,7 +230,7 @@
}); });
}, },
addMember() { addMember() {
this.addMemberVisible = true; this.dialogWsMemberAddVisible = true;
this.memberForm = {}; this.memberForm = {};
this.result = this.$get('/user/list/', response => { this.result = this.$get('/user/list/', response => {
this.$set(this.memberForm, "userList", response.data); this.$set(this.memberForm, "userList", response.data);
@ -242,13 +242,13 @@
cellClick(row) { cellClick(row) {
// currentRow // currentRow
this.currentWorkspaceRow = row; this.currentWorkspaceRow = row;
this.memberVisible = true; this.dialogWsMemberVisible = true;
let param = { let param = {
name: '', name: '',
workspaceId: row.id workspaceId: row.id
}; };
let path = "/user/special/ws/member/list"; let path = "/user/special/ws/member/list";
this.result = this.$post(this.buildPagePath(path), param, res => { this.result = this.$post(path + "/" + this.dialogCurrentPage + "/" + this.dialogPageSize, param, res => {
let data = res.data; let data = res.data;
this.memberLineData = data.listObject; this.memberLineData = data.listObject;
let url = "/userrole/list/ws/" + row.id; let url = "/userrole/list/ws/" + row.id;
@ -259,16 +259,16 @@
this.$set(this.memberLineData[i], "roles", roles); this.$set(this.memberLineData[i], "roles", roles);
}) })
} }
this.memberTotal = data.itemCount; this.dialogTotal = data.itemCount;
}); });
}, },
wsMemberList() { wsMemberList() {
let row = this.currentWorkspaceRow; let row = this.currentWorkspaceRow;
this.memberVisible = true; this.dialogWsMemberVisible = true;
let param = this.dialogCondition; let param = this.dialogCondition;
this.$set(param, 'workspaceId', row.id); this.$set(param, 'workspaceId', row.id);
let path = "/user/special/ws/member/list"; let path = "/user/special/ws/member/list";
this.result = this.$post(this.buildPagePath(path), param, res => { this.result = this.$post(path + "/" + this.dialogCurrentPage + "/" + this.dialogPageSize, param, res => {
let data = res.data; let data = res.data;
this.memberLineData = data.listObject; this.memberLineData = data.listObject;
let url = "/userrole/list/ws/" + row.id; let url = "/userrole/list/ws/" + row.id;
@ -279,11 +279,11 @@
this.$set(this.memberLineData[i], "roles", roles); this.$set(this.memberLineData[i], "roles", roles);
}) })
} }
this.memberTotal = data.itemCount; this.dialogTotal = data.itemCount;
}); });
}, },
edit(row) { edit(row) {
this.updateVisible = true; this.dialogWsUpdateVisible = true;
// copy user // copy user
this.form = Object.assign({}, row); this.form = Object.assign({}, row);
this.$get("/organization/list", response => { this.$get("/organization/list", response => {
@ -295,7 +295,7 @@
if (valide) { if (valide) {
this.result = this.$post("/workspace/special/update", this.form, () => { this.result = this.$post("/workspace/special/update", this.form, () => {
this.$success(this.$t('commons.modify_success')); this.$success(this.$t('commons.modify_success'));
this.updateVisible = false; this.dialogWsUpdateVisible = false;
this.list(); this.list();
}); });
} else { } else {
@ -346,9 +346,6 @@
this.total = data.itemCount; this.total = data.itemCount;
}); });
}, },
buildPagePath(path) {
return path + "/" + this.currentMemberPage + "/" + this.pageMemberSize;
},
submitForm(formName) { submitForm(formName) {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
@ -359,7 +356,7 @@
}; };
this.result = this.$post("user/special/ws/member/add", param, () => { this.result = this.$post("user/special/ws/member/add", param, () => {
this.cellClick(this.currentWorkspaceRow); this.cellClick(this.currentWorkspaceRow);
this.addMemberVisible = false; this.dialogWsMemberAddVisible = false;
}) })
} else { } else {
return false; return false;
@ -367,7 +364,7 @@
}); });
}, },
editMember(row) { editMember(row) {
this.updateMemberVisible = true; this.dialogWsMemberUpdateVisible = true;
this.memberForm = row; this.memberForm = row;
let roleIds = this.memberForm.roles.map(r => r.id); let roleIds = this.memberForm.roles.map(r => r.id);
this.result = this.$get('/role/list/test', response => { this.result = this.$get('/role/list/test', response => {
@ -401,7 +398,7 @@
} }
this.result = this.$post("/workspace/member/update", param, () => { this.result = this.$post("/workspace/member/update", param, () => {
this.$success(this.$t('commons.modify_success')); this.$success(this.$t('commons.modify_success'));
this.updateMemberVisible = false; this.dialogWsMemberUpdateVisible = false;
this.cellClick(this.currentWorkspaceRow); this.cellClick(this.currentWorkspaceRow);
}); });
}, },
@ -409,11 +406,11 @@
data() { data() {
return { return {
result: {}, result: {},
createVisible: false, dialogWsAddVisible: false,
updateVisible: false, dialogWsUpdateVisible: false,
memberVisible: false, dialogWsMemberVisible: false,
addMemberVisible: false, dialogWsMemberAddVisible: false,
updateMemberVisible: false, dialogWsMemberUpdateVisible: false,
btnTips: this.$t('workspace.create'), btnTips: this.$t('workspace.create'),
dialogBtnTips: this.$t('member.create'), dialogBtnTips: this.$t('member.create'),
addTips: this.$t('member.create'), addTips: this.$t('member.create'),
@ -423,9 +420,9 @@
currentPage: 1, currentPage: 1,
pageSize: 5, pageSize: 5,
total: 0, total: 0,
currentMemberPage: 1, dialogCurrentPage: 1,
pageMemberSize: 5, dialogPageSize: 5,
memberTotal: 0, dialogTotal: 0,
memberLineData: [], memberLineData: [],
memberForm: {}, memberForm: {},
form: { form: {