审核角色配置
This commit is contained in:
parent
87712228b5
commit
d45d5c9676
|
|
@ -81,7 +81,7 @@ export default {
|
|||
tableData: [],
|
||||
isflag: false /**用于设置弹窗 */,
|
||||
isflag2: false /**用于绑定用户设置弹窗 */,
|
||||
num: 3
|
||||
num: 3,
|
||||
};
|
||||
},
|
||||
components: {
|
||||
|
|
|
|||
|
|
@ -3,13 +3,15 @@
|
|||
<el-dialog class="l-dialog" :class="lDialog" :title="title" :visible.sync="dialogVisible" :showClose="false"
|
||||
:closeOnClickModal="false">
|
||||
<div>
|
||||
<el-form :model="dataForm" ref="ruleForm" label-width="110px">
|
||||
<el-form :model="dataForm" :rules="rules" ref="ruleForm" label-width="110px">
|
||||
<el-form-item label="角色名称">
|
||||
<el-input style="width:100%" v-model="dataForm.roleName" :disabled="true" maxlength="20"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="绑定用户">
|
||||
<el-select style="width:100%" v-model="dataForm.userId" multiple filterable default-first-option placeholder="请选择用户">
|
||||
<el-option v-for="item in usersList" :key="item.userId" :label="`${item.roleName} - ${item.userName}`" :value="item.userId">
|
||||
<el-form-item label="绑定用户" prop="userId">
|
||||
<el-select style="width:100%" v-model="dataForm.userId" multiple filterable default-first-option
|
||||
placeholder="请选择用户">
|
||||
<el-option v-for="item in usersList" :key="item.userId" :label="`${item.roleName} - ${item.userName}`"
|
||||
:value="item.userId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
|
@ -17,7 +19,7 @@
|
|||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button class="clear-btn" @click="handleClose" :disabled="disabled">取消</el-button>
|
||||
<el-button type="primary" class="search-btn" :disabled="disabled" @click="submitForm()">确认</el-button>
|
||||
<el-button type="primary" class="search-btn" :disabled="disabled" @click="submitForm('ruleForm')">确认</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
|
@ -38,7 +40,11 @@ export default {
|
|||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
roleTypes: ['WEB角色', 'APP角色'],
|
||||
rules: {
|
||||
userId: [
|
||||
{ required: true, message: '至少选择一个用户', trigger: 'change'}
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -61,11 +67,18 @@ export default {
|
|||
});
|
||||
},
|
||||
/**验证 */
|
||||
submitForm() {
|
||||
submitForm(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
let data = JSON.parse(JSON.stringify(this.dataForm));
|
||||
data.userId = data.userId.join(',');
|
||||
data.roleId = data.id;
|
||||
this.$emit('submit2', data);
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue