From 746e355df3ce7b588f40e96e4f20ba35266e7190 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 22 八月 2023 11:28:42 +0800
Subject: [PATCH] 1.人员管理开发完成

---
 src/views/basicSettings/roleList.vue |   39 +++++++++++++++++++++++++++------------
 1 files changed, 27 insertions(+), 12 deletions(-)

diff --git a/src/views/basicSettings/roleList.vue b/src/views/basicSettings/roleList.vue
index ed294ec..3fe1ff7 100644
--- a/src/views/basicSettings/roleList.vue
+++ b/src/views/basicSettings/roleList.vue
@@ -68,7 +68,7 @@
         </div>
 
         <div
-          style="margin-left: 15px;width:100%;position: relative"
+          style="margin-left: 10px;width:100%;position: relative"
         >
 
           <el-button
@@ -222,7 +222,7 @@
 <script>
 import waves from '@/directive/waves'
 import {
-  DataPermissions, RoleAddUpdateSava, RoleDeleteSava,
+  RoleAddUpdateSava, RoleDeleteSava,
   RolePermissionSava,
   RolePermissionSearchRole,
   RolePermissionSearchRoleMenu,
@@ -230,6 +230,7 @@
 } from '@/api/basicSettings'
 import arrayToTree from 'array-to-tree'
 import { throttle } from '@/utils/debounceAndThrottle'
+import { DataPermissions } from '@/api/GeneralBasicData'
 
 export default {
   name: 'RoleList',
@@ -319,7 +320,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 +590,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