From 04d6189c7848cee67aaf8fd62b90eb9d9313a0d0 Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期四, 16 一月 2025 09:29:24 +0800
Subject: [PATCH] 流程配置管理页面

---
 src/views/dnc/common/TableContextMenu.vue |   64 ++++++++++++++++++++++----------
 1 files changed, 44 insertions(+), 20 deletions(-)

diff --git a/src/views/dnc/common/TableContextMenu.vue b/src/views/dnc/common/TableContextMenu.vue
index dd10da2..e7aa417 100644
--- a/src/views/dnc/common/TableContextMenu.vue
+++ b/src/views/dnc/common/TableContextMenu.vue
@@ -24,7 +24,7 @@
     name: 'TableContextMenu',
     components: {},
     props: {
-      currentTableRowInfo: {
+      tableRowInfo: {
         type: Object
       }
     },
@@ -43,37 +43,61 @@
         defaultContextMenuList: {
           //鏂囨。
           document: [
-            { show: true, label: '缂栬緫鏂囨。淇℃伅', code: 'document_edit', subMenu: [], icon: 'edit' },
-            { show: true, label: '鎸囨淳鍒拌澶�', code: 'document_assign', subMenu: [], icon: 'cluster' },
-            { show: false, label: '瀵煎嚭NC绋嬪簭', code: 'document_export', subMenu: [], icon: 'export' },
-            { show: true, label: '瀵煎叆NC绋嬪簭', code: 'document_import', subMenu: [], icon: 'import' },
-            { show: true, label: '涓嬭浇', code: 'document_download', subMenu: [], icon: 'download' },
-            { show: true, label: '鍒犻櫎', code: 'document_delete', subMenu: [], icon: 'delete' },
-            { show: true, label: '鎵归噺鍒犻櫎', code: 'document_batch_remove', subMenu: [], icon: 'delete' },
+            { label: '缂栬緫鏂囨。淇℃伅', code: 'document_edit', subMenu: [], icon: 'edit', isCommonMethod: false },
+            { label: '鎸囨淳鍒拌澶�', code: 'document_assign', subMenu: [], icon: 'cluster', isCommonMethod: false },
+            { label: '瀵煎嚭NC绋嬪簭', code: 'document_export', subMenu: [], icon: 'export', isCommonMethod: true },
+            { label: '瀵煎叆NC绋嬪簭', code: 'document_import', subMenu: [], icon: 'import', isCommonMethod: true },
+            { label: '涓嬭浇', code: 'document_download', subMenu: [], icon: 'download', isCommonMethod: true },
+            { label: '鍒犻櫎', code: 'document_delete', subMenu: [], icon: 'delete', isCommonMethod: true },
+            { label: '鎵归噺鍒犻櫎', code: 'document_batch_remove', subMenu: [], icon: 'delete', isCommonMethod: false },
             {
-              show: true,
               label: '鐢熷懡鍛ㄦ湡',
               subMenu: [
-                { show: true, label: '鍑哄簱', code: 'document_pull', icon: 'export' },
-                { show: true, label: '鍙栨秷鍑哄簱', code: 'document_cancel_pull', icon: 'stop' },
-                { show: true, label: '鍏ュ簱', code: 'document_push', icon: 'import' },
-                { show: true, label: '鍙戝竷', code: 'document_publish', icon: 'flag' },
-                { show: true, label: '閲嶆柊鍙戝竷', code: 'document_republish', icon: 'reload' },
-                { show: true, label: '褰掓。', code: 'document_pigeonhole', icon: 'database' }
+                { label: '鍑哄簱', code: 'document_pull', icon: 'export', isCommonMethod: false },
+                { label: '鍙栨秷鍑哄簱', code: 'document_cancel_pull', icon: 'stop', isCommonMethod: false },
+                { label: '鍏ュ簱', code: 'document_push', icon: 'import', isCommonMethod: true },
+                { label: '鍙戝竷', code: 'document_publish', icon: 'flag', isCommonMethod: false },
+                { label: '閲嶆柊鍙戝竷', code: 'document_republish', icon: 'reload', isCommonMethod: false },
+                { label: '褰掓。', code: 'document_pigeonhole', icon: 'database', isCommonMethod: false }
               ],
-              icon: 'delete'
+              icon: 'hourglass'
             }
+          ],
+          //鏂囦欢
+          file: [
+            { label: '鎸囧畾褰撳墠鐗堟湰', code: 'file_assign', isCommonMethod: false },//鏂囦欢-鎸囧畾褰撳墠鐗堟湰
+            { label: '姣斿', code: 'file_add_relative', isCommonMethod: false }//姣斿
           ]
         }
       }
     },
+    computed: {
+      getCurrentDocumentType() {
+        if (this.tableRowInfo.attributionType === 5 || this.tableRowInfo.attributionType === 6) return 'NC'
+        else return 'OTHER'
+      }
+    },
     methods: {
       menuItemClick({ item, key }) {
-        // process_add => handleProcessAdd 瑙﹀彂瀵瑰簲缁勪欢浜嬩欢
-        const methodName = 'handle' + key.split('_').map(item => item[0].toUpperCase() + item.slice(1)).join('')
+        const menuKeyArray = key.split('_')
+        const isCommonMethod = this.defaultContextMenuList[this.currentMenuLevel].find(item => item.code === key).isCommonMethod
+        let methodName
+        // 鍒ゆ柇鏄惁涓哄叕鍏辨柟娉曪紝濡傛灉涓哄叕鍏辨柟娉曞垯鎴彇涓撴湁灞炴�roduct/component/part/process绛夊瓧娈�
+        if (isCommonMethod) {
+          // product_add => handleAdd 瑙﹀彂鍏叡鐖剁骇缁勪欢浜嬩欢
+          methodName = 'handle' + menuKeyArray.map(item => item[0].toUpperCase() + item.slice(1)).slice(1).join('')
+        } else {
+          // product_add => handleProcessAdd 瑙﹀彂瀵瑰簲缁勪欢浜嬩欢
+          methodName = 'handle' + menuKeyArray.map(item => item[0].toUpperCase() + item.slice(1)).join('')
+        }
         const modalTitle = this.defaultContextMenuList[this.currentMenuLevel].find(item => item.code === key).label
-        console.log('key', key)
-        this.$bus.$emit('menuItemMethodTrigger', { level: this.currentMenuLevel, methodName, modalTitle })
+        console.log('methodName---------------------------------------', methodName)
+        console.log('tableRowInfo---------------------------------------', this.tableRowInfo)
+        this.$bus.$emit('tableMenuItemMethodTrigger', {
+          methodName,
+          modalTitle,
+          tableRowInfo: this.tableRowInfo
+        })
       }
     }
   }

--
Gitblit v1.9.3