From 92d98d931ef4199c06fb220d2b85a5b5e5e7701c Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期四, 10 八月 2023 10:25:20 +0800
Subject: [PATCH] 1.角色权限优化
---
src/views/basicSettings/roleList.vue | 34 ++++++++++++++++++++++++----------
1 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/src/views/basicSettings/roleList.vue b/src/views/basicSettings/roleList.vue
index ed294ec..cd9cfe5 100644
--- a/src/views/basicSettings/roleList.vue
+++ b/src/views/basicSettings/roleList.vue
@@ -319,7 +319,7 @@
// 鑾峰彇鑿滃崟鏉冮檺瀵瑰簲鐨勬寜閽�
async getRolePermissionSearchRoleMenuButton(rolecode) {
const { data: res } = await RolePermissionSearchRoleMenuButton({ rolecode, type: this.activeName })
- this.allButtonData = JSON.parse(res[0].jsondate)
+ this.allButtonData = res.length > 0 ? JSON.parse(res[0].jsondate) : []
},
// 鑾峰彇鑿滃崟鏉冮檺
async getRolePermissionSearchRoleMenu(rolecode) {
@@ -589,21 +589,35 @@
// 瑙掕壊鍚嶇О鍒犻櫎
roleDeleteClick(self, node, data) {
// console.log(self, node, data)
- const D = {
- rolecode: data.code,
- rolename: data.name,
- type: this.activeName
- }
- RoleDeleteSava(D).then(res => {
- if (res.code === '200') {
- this.$notify.success('瑙掕壊鍒犻櫎鎴愬姛锛�')
+ this.$confirm('鏄惁纭鍒犻櫎?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ const D = {
+ rolecode: data.code,
+ rolename: data.name,
+ type: this.activeName
}
- this.getRolePermissionSearchRole()
+ RoleDeleteSava(D).then(res => {
+ if (res.code === '200') {
+ this.$notify.success('瑙掕壊鍒犻櫎鎴愬姛锛�')
+ }
+ this.getRolePermissionSearchRole()
+ })
+ }).catch(() => {
+ this.$notify.info('宸插彇娑堝垹闄�')
})
},
// 瑙掕壊鍚嶇О淇濆瓨 閲囩敤闃叉姈褰㈠紡
roleSave: throttle(function(val) {
val.isEdit = false
+
+ if (val.name.trim().length === 0) {
+ this.getRolePermissionSearchRole()
+ return this.$notify.info('鏃犳晥淇濆瓨锛�')
+ }
+
const data = {
rolecode: val.code,
rolename: val.name,
--
Gitblit v1.9.3