| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div :style="styleObject" class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"> |
| | | <el-form-item label="角色名称" prop="roleName"> |
| | | <el-input |
| | |
| | | /> |
| | | |
| | | <!-- 添加或修改角色配置对话框 --> |
| | | <!-- :wrapperClosable="false" 点击遮罩层是否可以关闭 Drawer--> |
| | | <el-drawer |
| | | title="信息修改" |
| | | :visible.sync="open" |
| | | direction="rtl" |
| | | custom-class="demo-drawer" |
| | | size="500px" |
| | | ref="drawer" |
| | | append-to-body |
| | | :modal="false" |
| | | :before-close="cancel" |
| | | > |
| | | <div class="demo-drawer__content"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="100px"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="120px"> |
| | | <el-form-item label="角色名称" prop="roleName"> |
| | | <el-input v-model="form.roleName" placeholder="请输入角色名称" /> |
| | | </el-form-item> |
| | |
| | | </el-form-item> |
| | | </el-form> |
| | | <div class="demo-drawer__footer"> |
| | | <!-- <el-button >取 消</el-button> |
| | | <el-button @click="cancel">取 消</el-button> |
| | | <el-button |
| | | type="primary" |
| | | @click="$refs.drawer.closeDrawer()" |
| | | @click="submitForm" |
| | | :loading="loading" |
| | | >{{ loading ? '提交中 ...' : '确 定' }}</el-button>--> |
| | | >{{ loading ? '提交中 ...' : '确 定' }}</el-button> |
| | | </div> |
| | | </div> |
| | | </el-drawer> |
| | |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | .demo-drawer__footer { |
| | | width: 100%; |
| | | position: absolute; |
| | | bottom: 0; |
| | | left: 0; |
| | | border-top: 1px solid #e8e8e8; |
| | | padding: 10px 16px; |
| | | text-align: right; |
| | | background-color: bfa; |
| | | } |
| | | </style> |
| | | <script> |
| | | import { |
| | | listRole, |
| | |
| | | roleKey: undefined, |
| | | status: undefined |
| | | }, |
| | | styleObject: {}, |
| | | // 表单参数 |
| | | form: {}, |
| | | defaultProps: { |
| | |
| | | // 取消按钮 |
| | | cancel() { |
| | | this.open = false; |
| | | this.styleObject = { width: "100%" }; |
| | | this.reset(); |
| | | }, |
| | | // 取消按钮(数据权限) |
| | |
| | | this.reset(); |
| | | this.getMenuTreeselect(); |
| | | this.open = true; |
| | | |
| | | this.title = "添加角色"; |
| | | }, |
| | | /** 修改按钮操作 */ |
| | |
| | | getRole(roleId).then(response => { |
| | | this.form = response.data; |
| | | this.open = true; |
| | | this.styleObject = { width: "70%" }; |
| | | this.$nextTick(() => { |
| | | roleMenu.then(res => { |
| | | let checkedKeys = res.checkedKeys; |
| | |
| | | updateRole(this.form).then(response => { |
| | | this.$modal.msgSuccess("修改成功"); |
| | | this.open = false; |
| | | this.styleObject = { width: "100%" }; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | |
| | | addRole(this.form).then(response => { |
| | | this.$modal.msgSuccess("新增成功"); |
| | | this.open = false; |
| | | this.styleObject = { width: "100%" }; |
| | | this.getList(); |
| | | }); |
| | | } |