From 4610953b11aaab9719d195329932fbb195289b19 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期一, 10 四月 2023 18:33:56 +0800
Subject: [PATCH] 优化已选择下拉图标高亮回显
---
src/views/system/role/index.vue | 41 ++++++++++-------------------------------
1 files changed, 10 insertions(+), 31 deletions(-)
diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue
index cf71f5c..e446ded 100644
--- a/src/views/system/role/index.vue
+++ b/src/views/system/role/index.vue
@@ -1,6 +1,6 @@
<template>
<div class="app-container">
- <el-form :model="queryParams" ref="queryRef" v-show="showSearch" :inline="true">
+ <el-form :model="queryParams" ref="queryRef" v-show="showSearch" :inline="true" label-width="68px">
<el-form-item label="瑙掕壊鍚嶇О" prop="roleName">
<el-input
v-model="queryParams.roleName"
@@ -116,36 +116,16 @@
<el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="淇敼" placement="top" v-if="scope.row.roleId !== 1">
- <el-button
- type="text"
- icon="Edit"
- @click="handleUpdate(scope.row)"
- v-hasPermi="['system:role:edit']"
- ></el-button>
+ <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:role:edit']"></el-button>
</el-tooltip>
<el-tooltip content="鍒犻櫎" placement="top" v-if="scope.row.roleId !== 1">
- <el-button
- type="text"
- icon="Delete"
- @click="handleDelete(scope.row)"
- v-hasPermi="['system:role:remove']"
- ></el-button>
+ <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:role:remove']"></el-button>
</el-tooltip>
<el-tooltip content="鏁版嵁鏉冮檺" placement="top" v-if="scope.row.roleId !== 1">
- <el-button
- type="text"
- icon="CircleCheck"
- @click="handleDataScope(scope.row)"
- v-hasPermi="['system:role:edit']"
- ></el-button>
+ <el-button link type="primary" icon="CircleCheck" @click="handleDataScope(scope.row)" v-hasPermi="['system:role:edit']"></el-button>
</el-tooltip>
<el-tooltip content="鍒嗛厤鐢ㄦ埛" placement="top" v-if="scope.row.roleId !== 1">
- <el-button
- type="text"
- icon="User"
- @click="handleAuthUser(scope.row)"
- v-hasPermi="['system:role:edit']"
- ></el-button>
+ <el-button link type="primary" icon="User" @click="handleAuthUser(scope.row)" v-hasPermi="['system:role:edit']"></el-button>
</el-tooltip>
</template>
</el-table-column>
@@ -262,9 +242,8 @@
</template>
<script setup name="Role">
-import { addRole, changeRoleStatus, dataScope, delRole, getRole, listRole, updateRole } from "@/api/system/role";
+import { addRole, changeRoleStatus, dataScope, delRole, getRole, listRole, updateRole, deptTreeSelect } from "@/api/system/role";
import { roleMenuTreeselect, treeselect as menuTreeselect } from "@/api/system/menu";
-import { treeselect as deptTreeselect, roleDeptTreeselect } from "@/api/system/dept";
const router = useRouter();
const { proxy } = getCurrentInstance();
@@ -462,8 +441,8 @@
});
}
/** 鏍规嵁瑙掕壊ID鏌ヨ閮ㄩ棬鏍戠粨鏋� */
-function getRoleDeptTreeselect(roleId) {
- return roleDeptTreeselect(roleId).then(response => {
+function getDeptTree(roleId) {
+ return deptTreeSelect(roleId).then(response => {
deptOptions.value = response.depts;
return response;
});
@@ -543,12 +522,12 @@
/** 鍒嗛厤鏁版嵁鏉冮檺鎿嶄綔 */
function handleDataScope(row) {
reset();
- const roleDeptTreeselect = getRoleDeptTreeselect(row.roleId);
+ const deptTreeSelect = getDeptTree(row.roleId);
getRole(row.roleId).then(response => {
form.value = response.data;
openDataScope.value = true;
nextTick(() => {
- roleDeptTreeselect.then(res => {
+ deptTreeSelect.then(res => {
nextTick(() => {
if (deptRef.value) {
deptRef.value.setCheckedKeys(res.checkedKeys);
--
Gitblit v1.9.3