This commit is contained in:
chenjianxing 2020-04-28 16:42:06 +08:00
commit 1bd0a16ae4
8 changed files with 36 additions and 61 deletions

View File

@ -2,7 +2,7 @@
<div v-loading="result.loading"> <div v-loading="result.loading">
<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.member')"/> :create-tip="btnTips" :title="$t('commons.member')"/>
</template> </template>
<el-table :data="tableData" style="width: 100%"> <el-table :data="tableData" style="width: 100%">
@ -162,9 +162,6 @@
buildPagePath(path) { buildPagePath(path) {
return path + "/" + this.currentPage + "/" + this.pageSize; return path + "/" + this.currentPage + "/" + this.pageSize;
}, },
search() {
this.initTableData();
},
closeFunc() { closeFunc() {
this.form = {}; this.form = {};
this.initTableData(); this.initTableData();

View File

@ -2,7 +2,7 @@
<div> <div>
<el-card v-loading="result.loading"> <el-card v-loading="result.loading">
<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="list" @create="create"
:create-tip="btnTips" :title="$t('commons.workspace')"/> :create-tip="btnTips" :title="$t('commons.workspace')"/>
</template> </template>
<el-table :data="items" style="width: 100%"> <el-table :data="items" style="width: 100%">
@ -46,7 +46,7 @@
<!-- dialog of workspace member --> <!-- dialog of workspace member -->
<el-dialog :visible.sync="dialogWsMemberVisible" 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="dialogSearch"
:create-tip="dialogBtnTips" :title="$t('commons.member')"/> :create-tip="dialogBtnTips" :title="$t('commons.member')"/>
<!-- organization member table --> <!-- organization member table -->
<el-table :data="memberLineData" style="width: 100%;margin-top: 5px;"> <el-table :data="memberLineData" style="width: 100%;margin-top: 5px;">
@ -69,7 +69,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<ms-table-pagination :change="wsMemberList" :current-page.sync="dialogCurrentPage" :page-size.sync="dialogPageSize" <ms-table-pagination :change="dialogSearch" :current-page.sync="dialogCurrentPage" :page-size.sync="dialogPageSize"
:total="dialogTotal"/> :total="dialogTotal"/>
</el-dialog> </el-dialog>
@ -202,16 +202,13 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$get('/workspace/delete/' + row.id, () => { this.$get('/workspace/delete/' + row.id, () => {
Message.success(this.$t('commons.delete_success')); this.$success(this.$t('commons.delete_success'));
this.list(); this.list();
}); });
}).catch(() => { }).catch(() => {
}); });
}, },
search() {
this.list();
},
list() { list() {
let url = '/workspace/list/' + this.currentPage + '/' + this.pageSize; let url = '/workspace/list/' + this.currentPage + '/' + this.pageSize;
let lastOrganizationId = this.currentUser.lastOrganizationId; let lastOrganizationId = this.currentUser.lastOrganizationId;
@ -274,7 +271,7 @@
this.dialogTotal = data.itemCount; this.dialogTotal = data.itemCount;
}); });
}, },
wsMemberList() { dialogSearch() {
let row = this.currentWorkspaceRow; let row = this.currentWorkspaceRow;
this.dialogWsMemberVisible = true; this.dialogWsMemberVisible = true;
let param = this.dialogCondition; let param = this.dialogCondition;

View File

@ -32,7 +32,7 @@
<!-- dialog of organization member --> <!-- dialog of organization member -->
<el-dialog :visible.sync="dialogOrgMemberVisible" 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="dialogSearch"
:create-tip="dialogBtnTips" :title="$t('commons.member')"/> :create-tip="dialogBtnTips" :title="$t('commons.member')"/>
<!-- organization member table --> <!-- organization member table -->
<el-table :data="memberLineData" style="width: 100%;margin-top:5px;"> <el-table :data="memberLineData" style="width: 100%;margin-top:5px;">
@ -55,7 +55,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<ms-table-pagination :change="orgMemberList" :current-page.sync="dialogCurrentPage" <ms-table-pagination :change="dialogSearch" :current-page.sync="dialogCurrentPage"
:page-size.sync="dialogPageSize" :page-size.sync="dialogPageSize"
:total="dialogTotal"/> :total="dialogTotal"/>
</el-dialog> </el-dialog>
@ -220,7 +220,7 @@
rule: { rule: {
name: [ name: [
{required: true, message: this.$t('organization.input_name'), trigger: 'blur'}, {required: true, message: this.$t('organization.input_name'), trigger: 'blur'},
{min: 2, max: 10, message: this.$t('commons.input_limit', [2, 50]), trigger: 'blur'}, {min: 2, max: 50, message: this.$t('commons.input_limit', [2, 50]), trigger: 'blur'},
{ {
required: true, required: true,
pattern: /^[\u4e00-\u9fa5_a-zA-Z0-9.·-]+$/, pattern: /^[\u4e00-\u9fa5_a-zA-Z0-9.·-]+$/,
@ -295,7 +295,7 @@
this.dialogTotal = data.itemCount; this.dialogTotal = data.itemCount;
}); });
}, },
orgMemberList() { dialogSearch() {
let row = this.currentRow; let row = this.currentRow;
this.dialogOrgMemberVisible = true; this.dialogOrgMemberVisible = true;
let param = this.dialogCondition; let param = this.dialogCondition;
@ -322,7 +322,7 @@
}).then(() => { }).then(() => {
this.result = this.$get(this.deletePath + row.id, () => { this.result = this.$get(this.deletePath + row.id, () => {
this.$success(this.$t('commons.delete_success')); this.$success(this.$t('commons.delete_success'));
this.initTableData() this.initTableData();
}); });
}).catch(() => { }).catch(() => {
this.$info(this.$t('commons.delete_cancel')); this.$info(this.$t('commons.delete_cancel'));
@ -343,8 +343,8 @@
}); });
}, },
createOrganization(createOrganizationForm) { createOrganization(createOrganizationForm) {
this.$refs[createOrganizationForm].validate(valide => { this.$refs[createOrganizationForm].validate(valid => {
if (valide) { if (valid) {
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();
@ -355,11 +355,11 @@
} }
}) })
}, },
updateOrganization(udpateOrganizationForm) { updateOrganization(updateOrganizationForm) {
this.$refs[udpateOrganizationForm].validate(valide => { this.$refs[updateOrganizationForm].validate(valid => {
if (valide) { if (valid) {
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.dialogOrgUpdateVisible = false; this.dialogOrgUpdateVisible = false;
this.initTableData(); this.initTableData();
}); });
@ -423,7 +423,7 @@
organizationId: this.currentRow.id organizationId: this.currentRow.id
} }
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.dialogOrgMemberUpdateVisible = false; this.dialogOrgMemberUpdateVisible = false;
this.cellClick(this.currentRow); this.cellClick(this.currentRow);
}); });

View File

@ -2,7 +2,7 @@
<div> <div>
<el-card v-loading="result.loading"> <el-card v-loading="result.loading">
<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="list" @create="create"
:create-tip="btnTips" :title="$t('commons.workspace')"/> :create-tip="btnTips" :title="$t('commons.workspace')"/>
</template> </template>
<!-- workspace table --> <!-- workspace table -->
@ -87,7 +87,7 @@
<!-- dialog of workspace member --> <!-- dialog of workspace member -->
<el-dialog :visible.sync="dialogWsMemberVisible" 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="dialogSearch"
:create-tip="dialogBtnTips" :title="$t('commons.member')"/> :create-tip="dialogBtnTips" :title="$t('commons.member')"/>
<!-- organization member table --> <!-- organization member table -->
<el-table :data="memberLineData" style="width: 100%;margin-top: 5px;"> <el-table :data="memberLineData" style="width: 100%;margin-top: 5px;">
@ -110,7 +110,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<ms-table-pagination :change="wsMemberList" :current-page.sync="dialogCurrentPage" <ms-table-pagination :change="dialogSearch" :current-page.sync="dialogCurrentPage"
:page-size.sync="dialogPageSize" :page-size.sync="dialogPageSize"
:total="dialogTotal"/> :total="dialogTotal"/>
</el-dialog> </el-dialog>
@ -262,7 +262,7 @@
this.dialogTotal = data.itemCount; this.dialogTotal = data.itemCount;
}); });
}, },
wsMemberList() { dialogSearch() {
let row = this.currentWorkspaceRow; let row = this.currentWorkspaceRow;
this.dialogWsMemberVisible = true; this.dialogWsMemberVisible = true;
let param = this.dialogCondition; let param = this.dialogCondition;
@ -324,9 +324,6 @@
this.memberLineData = []; this.memberLineData = [];
this.list(); this.list();
}, },
search() {
this.list();
},
list() { list() {
let url = '/workspace/list/all/' + this.currentPage + '/' + this.pageSize; let url = '/workspace/list/all/' + this.currentPage + '/' + this.pageSize;
this.result = this.$post(url, this.condition, response => { this.result = this.$post(url, this.condition, response => {

View File

@ -170,27 +170,18 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.result = this.$get(this.deletePath + row.id, () => { this.result = this.$get(this.deletePath + row.id, () => {
this.$message({ this.$success(this.$t('commons.delete_success'));
type: 'success',
message: this.$t('commons.delete_success')
});
this.search(); this.search();
}); });
}).catch(() => { }).catch(() => {
this.$message({ this.$info(this.$t('commons.delete_cancel'));
type: 'info',
message: this.$t('commons.delete_cancel')
});
}); });
}, },
createUser(createUserForm) { createUser(createUserForm) {
this.$refs[createUserForm].validate(valide => { this.$refs[createUserForm].validate(valid => {
if (valide) { if (valid) {
this.result = this.$post(this.createPath, this.form, () => { this.result = this.$post(this.createPath, this.form, () => {
this.$message({ this.$success(this.$t('commons.save_success'));
type: 'success',
message: this.$t('commons.save_success')
});
this.search(); this.search();
this.createVisible = false; this.createVisible = false;
}); });
@ -200,13 +191,10 @@
}) })
}, },
updateUser(updateUserForm) { updateUser(updateUserForm) {
this.$refs[updateUserForm].validate(valide => { this.$refs[updateUserForm].validate(valid => {
if (valide) { if (valid) {
this.result = this.$post(this.updatePath, this.form, () => { this.result = this.$post(this.updatePath, this.form, () => {
this.$message({ this.$success(this.$t('commons.modify_success'));
type: 'success',
message: this.$t('commons.modify_success')
});
this.updateVisible = false; this.updateVisible = false;
this.search(); this.search();
}); });
@ -227,10 +215,7 @@
}, },
changeSwitch(row) { changeSwitch(row) {
this.$post(this.updatePath, row, () => { this.$post(this.updatePath, row, () => {
this.$message({ this.$success(this.$t('commons.modify_success'));
type: 'success',
message: this.$t('commons.modify_success')
});
}) })
}, },
buildPagePath(path) { buildPagePath(path) {

View File

@ -2,7 +2,7 @@
<div v-loading="result.loading"> <div v-loading="result.loading">
<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.member')"/> :create-tip="btnTips" :title="$t('commons.member')"/>
</template> </template>
<el-table :data="tableData" style="width: 100%"> <el-table :data="tableData" style="width: 100%">
@ -167,15 +167,12 @@
buildPagePath(path) { buildPagePath(path) {
return path + "/" + this.currentPage + "/" + this.pageSize; return path + "/" + this.currentPage + "/" + this.pageSize;
}, },
search() {
this.initTableData();
},
closeFunc() { closeFunc() {
this.form = {}; this.form = {};
this.initTableData(); this.initTableData();
}, },
del(row) { del(row) {
this.$confirm('移除该成员, 是否继续?', '提示', { this.$confirm(this.$t('member.delete_confirm'), '', {
confirmButtonText: this.$t('commons.confirm'), confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'), cancelButtonText: this.$t('commons.cancel'),
type: 'warning' type: 'warning'
@ -224,7 +221,7 @@
}; };
let wsId = this.currentUser().lastWorkspaceId; let wsId = this.currentUser().lastWorkspaceId;
if (typeof wsId == "undefined" || wsId == null || wsId == "") { if (typeof wsId == "undefined" || wsId == null || wsId == "") {
this.$warning("请先选择工作空间!"); this.$warning(this.$t('workspace.please_select_a_workspace_first'));
return false; return false;
} }
this.$post('/user/org/member/list/all', param, response => { this.$post('/user/org/member/list/all', param, response => {

View File

@ -60,6 +60,7 @@ export default {
'search_by_name': 'Search by name', 'search_by_name': 'Search by name',
'organization_name': 'Organization Name', 'organization_name': 'Organization Name',
'please_choose_organization': 'Please Choose Organization', 'please_choose_organization': 'Please Choose Organization',
'please_select_a_workspace_first': 'Please select a workspace first!',
}, },
organization: { organization: {
'create': 'Create', 'create': 'Create',

View File

@ -62,6 +62,7 @@ export default {
'search_by_name': '根据名称搜索', 'search_by_name': '根据名称搜索',
'organization_name': '所属组织', 'organization_name': '所属组织',
'please_choose_organization': '请选择组织', 'please_choose_organization': '请选择组织',
'please_select_a_workspace_first': '请先选择工作空间!',
}, },
organization: { organization: {
'create': '创建组织', 'create': '创建组织',