From 50111114eb8254fe4d6fc15e9781f2c47e3db74a Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期三, 24 七月 2024 00:12:52 +0800
Subject: [PATCH] 删除工艺路线绑定

---
 src/views/components/GeneralTree.vue |   27 +++++++++++++++++++--------
 1 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/src/views/components/GeneralTree.vue b/src/views/components/GeneralTree.vue
index 5ab9d42..5cc2a74 100644
--- a/src/views/components/GeneralTree.vue
+++ b/src/views/components/GeneralTree.vue
@@ -4,7 +4,7 @@
  * @version: 
  * @Date: 2024-06-19 11:07:21
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-06-19 23:09:39
+ * @LastEditTime: 2024-07-23 21:29:52
 -->
 <template>
   <div class="m-4 mr-0 overflow-hidden bg-white">
@@ -20,38 +20,49 @@
       :fieldNames="fieldNames"
       @select="handleSelect"
       @handleAdd="handleAdd"
+      @unselect="UnSelect"
+      :beforeRightClick="props.beforeRightClick"
     />
   </div>
 </template>
 <script lang="ts" setup>
   import { onMounted, ref } from 'vue';
-  import { FieldNames, TigerTree, TreeItem } from '/@/components/TigerTree'
+  import { ContextMenuItem, ContextMenuOptions, FieldNames, TigerTree, TreeItem } from '/@/components/TigerTree';
+  import { EventDataNode } from 'ant-design-vue/lib/tree';
 
   defineOptions({ name: 'CustTree' });
 
-  const emit = defineEmits(['select', 'handleAdd']);
+  const emit = defineEmits(['select', 'handleAdd', 'UnSelect']);
   const props = defineProps({
     title: {
       // type: [Function, String] as PropType<string | ((data) => string)>,
       type: String,
     },
     treeData: {
-      type:  Array as PropType<TreeItem[]>,
+      type: Array as PropType<TreeItem[]>,
     },
     createIcon: {
       type: Function as PropType<(params: Recordable<any>) => string>,
     },
-    add: {type: Boolean,},
-    fieldNames: {type: Object as PropType<FieldNames>},
+    add: { type: Boolean },
+    fieldNames: { type: Object as PropType<FieldNames> },
+    beforeRightClick: {
+      type: Function as PropType<(...arg: any) => ContextMenuItem[] | ContextMenuOptions>,
+      default: undefined,
+    },
   });
 
-  function handleSelect(keys) {
-    emit('select', keys[0]);
+  function handleSelect(keys, e) {
+    emit('select', keys[0], e);
   }
 
   function handleAdd() {
     emit('handleAdd');
   }
 
+  function UnSelect(node) {
+    emit('UnSelect', node);
+  }
+
   onMounted(() => {});
 </script>

--
Gitblit v1.9.3