From 1d14ade6b5b75b7f7e37958d95f8bb6a6dcc036d Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期一, 10 四月 2023 18:33:40 +0800
Subject: [PATCH] 优化避免鼠标移出时无法隐藏滚动条的问题
---
src/views/system/role/index.vue | 55 +++++++++++++++----------------------------------------
1 files changed, 15 insertions(+), 40 deletions(-)
diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue
index bdc3810..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"
@@ -115,41 +115,17 @@
</el-table-column>
<el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
<template #default="scope">
- <el-tooltip content="淇敼" placement="top">
- <el-button
- v-if="scope.row.roleId !== 1"
- type="text"
- icon="Edit"
- @click="handleUpdate(scope.row)"
- v-hasPermi="['system:role:edit']"
- ></el-button>
+ <el-tooltip content="淇敼" placement="top" v-if="scope.row.roleId !== 1">
+ <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">
- <el-button
- v-if="scope.row.roleId !== 1"
- type="text"
- icon="Delete"
- @click="handleDelete(scope.row)"
- v-hasPermi="['system:role:remove']"
- ></el-button>
+ <el-tooltip content="鍒犻櫎" placement="top" v-if="scope.row.roleId !== 1">
+ <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">
- <el-button
- v-if="scope.row.roleId !== 1"
- type="text"
- icon="CircleCheck"
- @click="handleDataScope(scope.row)"
- v-hasPermi="['system:role:edit']"
- ></el-button>
+ <el-tooltip content="鏁版嵁鏉冮檺" placement="top" v-if="scope.row.roleId !== 1">
+ <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">
- <el-button
- v-if="scope.row.roleId !== 1"
- type="text"
- icon="User"
- @click="handleAuthUser(scope.row)"
- v-hasPermi="['system:role:edit']"
- ></el-button>
+ <el-tooltip content="鍒嗛厤鐢ㄦ埛" placement="top" v-if="scope.row.roleId !== 1">
+ <el-button link type="primary" icon="User" @click="handleAuthUser(scope.row)" v-hasPermi="['system:role:edit']"></el-button>
</el-tooltip>
</template>
</el-table-column>
@@ -173,7 +149,7 @@
<template #label>
<span>
<el-tooltip content="鎺у埗鍣ㄤ腑瀹氫箟鐨勬潈闄愬瓧绗︼紝濡傦細@PreAuthorize(`@ss.hasRole('admin')`)" placement="top">
- <i class="el-icon-question"></i>
+ <el-icon><question-filled /></el-icon>
</el-tooltip>
鏉冮檺瀛楃
</span>
@@ -266,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();
@@ -466,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;
});
@@ -547,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