优化代码

This commit is contained in:
shiziyuan9527 2020-05-08 15:34:45 +08:00
parent 3ec68ed0c1
commit 7d586af28b
7 changed files with 12 additions and 15 deletions

View File

@ -167,7 +167,7 @@
},
edit(row) {
this.updateVisible = true;
this.form = row;
this.form = Object.assign({}, row);
let roleIds = this.form.roles.map(r => r.id);
this.result = this.$get('/role/list/org', response => {
this.$set(this.form, "allroles", response.data);

View File

@ -193,7 +193,7 @@
},
edit(row) {
this.dialogWsAddVisible = true;
this.form = row;
this.form = Object.assign({}, row);
},
del(row) {
this.$confirm(this.$t('workspace.delete_confirm'), '', {
@ -317,7 +317,7 @@
},
editMember(row) {
this.dialogWsMemberUpdateVisible = true;
this.memberForm = row;
this.memberForm = Object.assign({}, row);
let roleIds = this.memberForm.roles.map(r => r.id);
this.result = this.$get('/role/list/test', response => {
this.$set(this.memberForm, "allroles", response.data);

View File

@ -110,7 +110,7 @@
},
edit(row) {
this.updateVisible = true;
this.form = row;
this.form = Object.assign({}, row);
},
updateUser(updateUserForm) {
this.$refs[updateUserForm].validate(valide => {

View File

@ -258,11 +258,11 @@
},
edit(row) {
this.dialogOrgUpdateVisible = true;
this.form = row;
this.form = Object.assign({}, row);
},
editMember(row) {
this.dialogOrgMemberUpdateVisible = true;
this.memberForm = row;
this.memberForm = Object.assign({}, row);
let roleIds = this.memberForm.roles.map(r => r.id);
this.result = this.$get('/role/list/org', response => {
this.$set(this.memberForm, "allroles", response.data);

View File

@ -113,7 +113,7 @@
<!-- add workspace member dialog -->
<el-dialog :title="$t('member.create')" :visible.sync="dialogWsMemberAddVisible" width="30%"
:destroy-on-close="true"
@close="closeWsMemberAddDialog">
@close="handleClose">
<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">
@ -153,7 +153,7 @@
<!-- update workspace member dialog -->
<el-dialog :title="$t('member.modify')" :visible.sync="dialogWsMemberUpdateVisible" width="30%"
:destroy-on-close="true"
@close="closeWsMemberUpdateDialog">
@close="handleClose">
<el-form :model="memberForm" label-position="right" label-width="100px" size="small" ref="updateUserForm">
<el-form-item label="ID" prop="id">
<el-input v-model="memberForm.id" autocomplete="off" :disabled="true"/>
@ -318,16 +318,13 @@
});
},
closeWsMemberAddDialog() {
handleClose() {
this.memberForm = {};
},
closeWsMemberDialog() {
this.memberLineData = [];
this.list();
},
closeWsMemberUpdateDialog() {
this.dialogSearch();
},
list() {
let url = '/workspace/list/all/' + this.currentPage + '/' + this.pageSize;
this.result = this.$post(url, this.condition, response => {
@ -366,7 +363,7 @@
},
editMember(row) {
this.dialogWsMemberUpdateVisible = true;
this.memberForm = row;
this.memberForm = Object.assign({}, row);
let roleIds = this.memberForm.roles.map(r => r.id);
this.result = this.$get('/role/list/test', response => {
this.$set(this.memberForm, "allroles", response.data);

View File

@ -162,7 +162,7 @@
},
edit(row) {
this.updateVisible = true;
this.form = row;
this.form = Object.assign({}, row);
},
del(row) {
this.$confirm(this.$t('user.delete_confirm'), '', {

View File

@ -191,7 +191,7 @@
},
edit(row) {
this.updateVisible = true;
this.form = row;
this.form = Object.assign({}, row);
let roleIds = this.form.roles.map(r => r.id);
this.result = this.$get('/role/list/test', response => {
this.$set(this.form, "allroles", response.data);