fix: user rights module clicks the add button without loading the tenant data (#1451)

pull/1454/head
Dmego 1 year ago committed by GitHub
parent cf3c26c012
commit 4320aac82f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -25,7 +25,7 @@
<span>{{ temp.role }}</span> <span>{{ temp.role }}</span>
</el-form-item> </el-form-item>
<el-form-item :label="$t('report.tenants')" label-width="120px"> <el-form-item :label="$t('report.tenants')" label-width="120px">
<span></span> <span>{{ temp.tempResources }}</span>
</el-form-item> </el-form-item>
<el-form-item :label="$t('common.createTime')" label-width="120px"> <el-form-item :label="$t('common.createTime')" label-width="120px">
<span> {{ temp.gmtCreate }}</span> <span> {{ temp.gmtCreate }}</span>

@ -174,6 +174,7 @@ export default {
password: '', password: '',
permission: '', permission: '',
resources: [], resources: [],
tempResources: [],
}, },
resetTemp() { resetTemp() {
this.temp = { this.temp = {
@ -183,6 +184,7 @@ export default {
password: '', password: '',
permission: '', permission: '',
resources: [], resources: [],
tempResources: [],
} }
}, },
}; };
@ -229,6 +231,14 @@ export default {
createData() { createData() {
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
if (valid) { if (valid) {
let resources = [];
for (let i = 0; i < this.temp.tempResources.length; i++) {
resources.push({
resource: this.temp.tempResources[i],
action: 'rw',
});
}
this.temp.resources = resources;
user.createUser(this.temp).then(() => { user.createUser(this.temp).then(() => {
this.fetchData(); this.fetchData();
this.dialogFormVisible = false; this.dialogFormVisible = false;

Loading…
Cancel
Save