From 8b311e8310a5ff81068129f59e4e1c434a1e3a25 Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期一, 23 六月 2025 14:25:10 +0800
Subject: [PATCH] 新增流程处理,新增程序确认表处理

---
 src/views/dnc/common/TableContextMenu.vue |  118 +++++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 94 insertions(+), 24 deletions(-)

diff --git a/src/views/dnc/common/TableContextMenu.vue b/src/views/dnc/common/TableContextMenu.vue
index e7aa417..b6bda8c 100644
--- a/src/views/dnc/common/TableContextMenu.vue
+++ b/src/views/dnc/common/TableContextMenu.vue
@@ -1,7 +1,7 @@
 <template>
   <a-menu :style="menuStyle" @click="menuItemClick" v-if="menuVisible" mode="vertical">
-    <template v-for="menuItem in defaultContextMenuList[currentMenuLevel]">
-      <a-menu-item :key="menuItem.code" v-if="menuItem.show&&menuItem.subMenu.length===0">
+    <template v-for="menuItem in defaultContextMenuList[tableRowInfo.param]">
+      <a-menu-item :key="menuItem.code" v-has="menuItem.code" v-if="menuItem.subMenu.length===0">
         <a-icon :type="menuItem.icon"/>
         {{menuItem.label}}
       </a-menu-item>
@@ -9,7 +9,7 @@
       <a-sub-menu v-if="menuItem.subMenu.length>0">
         <span slot="title"><a-icon :type="menuItem.icon"/><span>{{menuItem.label}}</span></span>
 
-        <a-menu-item v-for="subMenuItem in menuItem.subMenu" :key="subMenuItem.code" v-if="subMenuItem.show"
+        <a-menu-item v-for="subMenuItem in menuItem.subMenu" :key="subMenuItem.code" v-has="subMenuItem.code"
                      style="height: 32px;line-height: 32px">
           <a-icon :type="subMenuItem.icon"/>
           {{subMenuItem.label}}
@@ -41,46 +41,117 @@
         },
         currentMenuLevel: '',
         defaultContextMenuList: {
-          //鏂囨。
-          document: [
+          //璁惧绫�
+          deviceCustomType: [
+            { label: '缂栬緫璁惧绫讳俊鎭�', code: 'type_edit', subMenu: [], icon: 'edit', isCommonMethod: false },
+            { label: '鍒犻櫎', code: 'type_delete', subMenu: [], icon: 'delete', isCommonMethod: false },
+            { label: '瀵煎叆NC绋嬪簭', code: 'type_nc_import', subMenu: [], icon: 'import', isCommonMethod: true }
+          ],
+          //NC鏂囨。
+          NC: [
             { 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_extract', subMenu: [], icon: 'tool', isCommonMethod: false },
+            { label: '瀵煎叆NC绋嬪簭', code: 'document_nc_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 },
+            { label: '鎵归噺鍒犻櫎', code: 'document_batch_remove', subMenu: [], icon: 'delete', isCommonMethod: true },
+            { label: '瀹氬瀷', code: 'document_appoint', subMenu: [], icon: 'swap-right', isCommonMethod: true },
             {
               label: '鐢熷懡鍛ㄦ湡',
               subMenu: [
-                { label: '鍑哄簱', code: 'document_pull', icon: 'export', isCommonMethod: false },
-                { label: '鍙栨秷鍑哄簱', code: 'document_cancel_pull', icon: 'stop', isCommonMethod: false },
+                { label: '鍑哄簱', code: 'document_pull', icon: 'export', isCommonMethod: true },
+                { label: '鍙栨秷鍑哄簱', code: 'document_cancel_pull', icon: 'stop', isCommonMethod: true },
                 { 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 }
+                { label: '鍙戝竷', code: 'document_publish', icon: 'flag', isCommonMethod: true },
+                { label: '閲嶆柊鍙戝竷', code: 'document_republish', icon: 'reload', isCommonMethod: true },
+                { label: '褰掓。', code: 'document_pigeonhole', icon: 'database', isCommonMethod: true }
+              ],
+              icon: 'hourglass'
+            }
+          ],
+          //鍏跺畠鏂囨。
+          OTHER: [
+            { label: '缂栬緫鏂囨。淇℃伅', code: 'document_edit', subMenu: [], icon: 'edit', isCommonMethod: false },
+            { label: '瀵煎叆鏂囨。', code: 'document_other_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: true },
+            {
+              label: '鐢熷懡鍛ㄦ湡',
+              subMenu: [
+                { label: '鍑哄簱', code: 'document_pull', icon: 'export', isCommonMethod: true },
+                { label: '鍙栨秷鍑哄簱', code: 'document_cancel_pull', icon: 'stop', isCommonMethod: true },
+                { label: '鍏ュ簱', code: 'document_push', icon: 'import', isCommonMethod: true },
+                { label: '鍙戝竷', code: 'document_publish', icon: 'flag', isCommonMethod: true },
+                { label: '閲嶆柊鍙戝竷', code: 'document_republish', icon: 'reload', isCommonMethod: true },
+                { label: '褰掓。', code: 'document_pigeonhole', icon: 'database', isCommonMethod: true }
+              ],
+              icon: 'hourglass'
+            }
+          ],
+          //宸插彂閫佹枃妗�
+          SEND: [
+            { label: '缂栬緫鏂囨。淇℃伅', code: 'document_edit', subMenu: [], icon: 'edit', isCommonMethod: false },
+            { label: '瀵煎叆NC绋嬪簭', code: 'document_nc_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: true },
+            {
+              label: '鐢熷懡鍛ㄦ湡',
+              subMenu: [
+                { label: '鍑哄簱', code: 'document_pull', icon: 'export', isCommonMethod: true },
+                { label: '鍙栨秷鍑哄簱', code: 'document_cancel_pull', icon: 'stop', isCommonMethod: true },
+                { label: '鍏ュ簱', code: 'document_push', icon: 'import', isCommonMethod: true },
+                { label: '鍙戝竷', code: 'document_publish', icon: 'flag', isCommonMethod: true },
+                { label: '閲嶆柊鍙戝竷', code: 'document_republish', icon: 'reload', isCommonMethod: true },
+                { label: '褰掓。', code: 'document_pigeonhole', icon: 'database', isCommonMethod: true }
+              ],
+              icon: 'hourglass'
+            }
+          ],
+          //宸叉帴鏀舵枃妗�
+          REC: [
+            { label: '缂栬緫鏂囨。淇℃伅', code: 'document_edit', subMenu: [], icon: 'edit', isCommonMethod: false },
+            { label: '瀵煎叆NC绋嬪簭', code: 'document_nc_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: true },
+            { label: '鎸囨淳鍒颁骇鍝�', code: 'document_rec_assign', subMenu: [], icon: 'cluster', isCommonMethod: false },
+            {
+              label: '鐢熷懡鍛ㄦ湡',
+              subMenu: [
+                { label: '鍑哄簱', code: 'document_pull', icon: 'export', isCommonMethod: true },
+                { label: '鍙栨秷鍑哄簱', code: 'document_cancel_pull', icon: 'stop', isCommonMethod: true },
+                { label: '鍏ュ簱', code: 'document_push', icon: 'import', isCommonMethod: true },
+                { label: '鍙戝竷', code: 'document_publish', icon: 'flag', isCommonMethod: true },
+                { label: '閲嶆柊鍙戝竷', code: 'document_republish', icon: 'reload', isCommonMethod: true },
+                { label: '褰掓。', code: 'document_pigeonhole', icon: 'database', isCommonMethod: true }
               ],
               icon: 'hourglass'
             }
           ],
           //鏂囦欢
           file: [
-            { label: '鎸囧畾褰撳墠鐗堟湰', code: 'file_assign', isCommonMethod: false },//鏂囦欢-鎸囧畾褰撳墠鐗堟湰
-            { label: '姣斿', code: 'file_add_relative', isCommonMethod: false }//姣斿
+            { label: '鎸囧畾褰撳墠鐗堟湰', code: 'file_assign', subMenu: [], icon: 'highlight', isCommonMethod: false },//鏂囦欢-鎸囧畾褰撳墠鐗堟湰
+            { label: '姣斿', code: 'file_add_relative', subMenu: [], icon: 'interaction', isCommonMethod: false }//姣斿
           ]
         }
-      }
-    },
-    computed: {
-      getCurrentDocumentType() {
-        if (this.tableRowInfo.attributionType === 5 || this.tableRowInfo.attributionType === 6) return 'NC'
-        else return 'OTHER'
       }
     },
     methods: {
       menuItemClick({ item, key }) {
         const menuKeyArray = key.split('_')
-        const isCommonMethod = this.defaultContextMenuList[this.currentMenuLevel].find(item => item.code === key).isCommonMethod
+        const menuArrayItem = this.defaultContextMenuList[this.tableRowInfo.param].find(item => item.code === key)
+        let isCommonMethod, modalTitle
+        if (menuArrayItem) {
+          isCommonMethod = menuArrayItem.isCommonMethod
+          modalTitle = menuArrayItem.label
+        } else {
+          const subMenuArrayItem = this.defaultContextMenuList[this.tableRowInfo.param].find(item => item.subMenu.length > 0).subMenu.find(item => item.code === key)
+          isCommonMethod = subMenuArrayItem.isCommonMethod
+          modalTitle = subMenuArrayItem.label
+        }
         let methodName
         // 鍒ゆ柇鏄惁涓哄叕鍏辨柟娉曪紝濡傛灉涓哄叕鍏辨柟娉曞垯鎴彇涓撴湁灞炴�roduct/component/part/process绛夊瓧娈�
         if (isCommonMethod) {
@@ -90,9 +161,8 @@
           // 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('methodName---------------------------------------', methodName)
         console.log('tableRowInfo---------------------------------------', this.tableRowInfo)
+        console.log('methodName---------------------------------------', methodName)
         this.$bus.$emit('tableMenuItemMethodTrigger', {
           methodName,
           modalTitle,

--
Gitblit v1.9.3