From 621bd1e65350d17756863f35783dbab5619a54d4 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 15 八月 2023 17:27:54 +0800
Subject: [PATCH] 1.组织架构、岗位管理初稿

---
 src/views/basicSettings/roleList.vue |   36 +++++++++++++++++++++++++-----------
 1 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/src/views/basicSettings/roleList.vue b/src/views/basicSettings/roleList.vue
index ed294ec..f1b91b1 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
@@ -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