This commit is contained in:
pushuo 2022-08-01 20:41:57 +08:00
parent 05f41a39a2
commit d95889813e
2 changed files with 12 additions and 4 deletions

View File

@ -16,9 +16,9 @@
<el-form-item label="权限" prop="roles">
<div class="roles-wrap border">
<div class="header-wrap px-2">
<button class="btn btn-outline-dark btn-sm me-3" type="button">选中所有</button>
<button class="btn btn-outline-dark btn-sm" type="button">取消选中</button>
<div class="header-wrap bg-dark p-2 text-dark bg-opacity-10 px-2">
<el-button size="small" @click="updateAllState(true)">选中所有</el-button>
<el-button size="small" @click="updateAllState(false)">取消选中</el-button>
</div>
<div v-for="role, index in form.roles" :key="index">
<div class="bg-light px-2 d-flex">
@ -99,6 +99,14 @@
this.form.roles[index].methods.map(e => e.selected = !!type)
},
updateAllState(type) {
this.form.roles.forEach(e => {
e.methods.forEach(method => {
method.selected = !!type
});
});
},
addFormSubmit(form) {
const self = this;
const type = this.type == 'add' ? 'post' : 'put';

View File

@ -64,7 +64,7 @@
<el-input v-model="dialog.form.email" placeholder="邮箱"></el-input>
</el-form-item>
<el-form-item label="密码" prop="password">
<el-form-item label="密码" :prop="dialog.form.id === null || dialog.form.id == '' ? 'password' : ''">
<el-input v-model="dialog.form.password" placeholder="密码"></el-input>
</el-form-item>