From 660b451f0d8cfb5550a10f281984be402c81750d Mon Sep 17 00:00:00 2001
From: zhangxiao <898441624@qq.com>
Date: 星期三, 18 九月 2024 16:59:28 +0800
Subject: [PATCH] 为机构管理添加拖拽功能锁定按钮与权限限制

---
 src/views/authority/organization/index.vue |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/src/views/authority/organization/index.vue b/src/views/authority/organization/index.vue
index 72e93f8..3f5d129 100644
--- a/src/views/authority/organization/index.vue
+++ b/src/views/authority/organization/index.vue
@@ -7,11 +7,21 @@
         <a-card
           :title="$t('menu.organization.title')"
           :bordered="false"
+          :header-style="{ textAlign: 'left' }"
           style=" 'width': '100%';   height: calc(100vh - 250px); overflow-y:auto "
         >
+          <template #title>
+            <span>{{ $t('menu.organization.title') }}</span>
+            <a-tooltip content="鐐瑰嚮鍚庡彲閫氳繃鎷栨嫿鏇存敼鏈烘瀯缁撴瀯,鍐嶆鐐瑰嚮鏉ュ叧闂�" background-color="#165DFF">
+              <a-button type="outline" style="float: right;" @click="toggleDraggable" :style="{color: buttonColor}"
+               v-has-permi="'/base/syorganization!update'">
+                <component :is="lockIcon" />
+              </a-button>
+            </a-tooltip>
+          </template>
           <a-tree
             class="tree-demo"
-            draggable
+            :draggable="draggable"
             blockNode
             :data="treeData"
             :show-line="showLine"
@@ -158,7 +168,9 @@
     address: '',
     deptId: '',
   });
-
+let draggable = ref(false);
+let buttonColor = ref("");
+let lockIcon = ref("IconLock");
   const onIconClick = (nodeData) => {
     deptform.value.deptName = "";
     deptform.value.email = "";
@@ -276,6 +288,11 @@
   };
 
   OrganizationData('');
+  const toggleDraggable = () =>{
+    draggable.value = !draggable.value;
+    buttonColor.value= draggable.value ? '#575757' : '';
+    lockIcon.value = draggable.value ? 'IconUnlock' : 'IconLock';
+  };
 </script>
 
 <style scoped>

--
Gitblit v1.8.0