From f5bec709111dcf7a2d9900b19e8b8c5b1162c55c Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期一, 12 九月 2022 17:22:07 +0800 Subject: [PATCH] R add isError and isSuccess method --- ruoyi-ui/src/views/system/role/index.vue | 26 +++++++------------------- 1 files changed, 7 insertions(+), 19 deletions(-) diff --git a/ruoyi-ui/src/views/system/role/index.vue b/ruoyi-ui/src/views/system/role/index.vue index b2cfd6b..0681d3d 100644 --- a/ruoyi-ui/src/views/system/role/index.vue +++ b/ruoyi-ui/src/views/system/role/index.vue @@ -1,12 +1,11 @@ <template> <div class="app-container"> - <el-form :model="queryParams" ref="queryForm" v-show="showSearch" :inline="true"> + <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"> <el-form-item label="角色名称" prop="roleName"> <el-input v-model="queryParams.roleName" placeholder="请输入角色名称" clearable - size="small" style="width: 240px" @keyup.enter.native="handleQuery" /> @@ -16,7 +15,6 @@ v-model="queryParams.roleKey" placeholder="请输入权限字符" clearable - size="small" style="width: 240px" @keyup.enter.native="handleQuery" /> @@ -26,7 +24,6 @@ v-model="queryParams.status" placeholder="角色状态" clearable - size="small" style="width: 240px" > <el-option @@ -40,7 +37,6 @@ <el-form-item label="创建时间"> <el-date-picker v-model="dateRange" - size="small" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" @@ -258,9 +254,8 @@ </template> <script> -import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus } from "@/api/system/role"; +import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role"; import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu"; -import { treeselect as deptTreeselect, roleDeptTreeselect } from "@/api/system/dept"; export default { name: "Role", @@ -355,8 +350,7 @@ /** 查询角色列表 */ getList() { this.loading = true; - listRole(this.addDateRange(this.queryParams, this.dateRange)).then( - response => { + listRole(this.addDateRange(this.queryParams, this.dateRange)).then(response => { this.roleList = response.rows; this.total = response.total; this.loading = false; @@ -367,12 +361,6 @@ getMenuTreeselect() { menuTreeselect().then(response => { this.menuOptions = response.data; - }); - }, - /** 查询部门树结构 */ - getDeptTreeselect() { - deptTreeselect().then(response => { - this.deptOptions = response.data; }); }, // 所有菜单节点数据 @@ -401,8 +389,8 @@ }); }, /** 根据角色ID查询部门树结构 */ - getRoleDeptTreeselect(roleId) { - return roleDeptTreeselect(roleId).then(response => { + getDeptTree(roleId) { + return deptTreeSelect(roleId).then(response => { this.deptOptions = response.depts; return response; }); @@ -548,12 +536,12 @@ /** 分配数据权限操作 */ handleDataScope(row) { this.reset(); - const roleDeptTreeselect = this.getRoleDeptTreeselect(row.roleId); + const deptTreeSelect = this.getDeptTree(row.roleId); getRole(row.roleId).then(response => { this.form = response.data; this.openDataScope = true; this.$nextTick(() => { - roleDeptTreeselect.then(res => { + deptTreeSelect.then(res => { this.$refs.dept.setCheckedKeys(res.checkedKeys); }); }); -- Gitblit v1.9.2