From 7e07d6e781f195995b27b82b4df66c3ffa391501 Mon Sep 17 00:00:00 2001
From: zhaowei <zhaowei>
Date: 星期五, 17 一月 2025 09:49:25 +0800
Subject: [PATCH] 1、产品结构树页面完成文档生命周期相关功能,待后续开发至文档版本列表时继续完善与生命周期功能的关联 2、删除导出文档或NC程序功能

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

diff --git a/src/views/dnc/common/TableContextMenu.vue b/src/views/dnc/common/TableContextMenu.vue
index e7aa417..7890110 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,11 +41,10 @@
         },
         currentMenuLevel: '',
         defaultContextMenuList: {
-          //鏂囨。
-          document: [
+          //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_download', subMenu: [], icon: 'download', isCommonMethod: true },
             { label: '鍒犻櫎', code: 'document_delete', subMenu: [], icon: 'delete', isCommonMethod: true },
@@ -53,12 +52,31 @@
             {
               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_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: '鐢熷懡鍛ㄦ湡',
+              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'
             }
@@ -71,16 +89,19 @@
         }
       }
     },
-    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)
+        const subMenuArrayItem = this.defaultContextMenuList[this.tableRowInfo.param].find(item => item.subMenu.length > 0).subMenu.find(item => item.code === key)
+        let isCommonMethod, modalTitle
+        if (menuArrayItem) {
+          isCommonMethod = menuArrayItem.isCommonMethod
+          modalTitle = menuArrayItem.label
+        } else {
+          isCommonMethod = subMenuArrayItem.isCommonMethod
+          modalTitle = subMenuArrayItem.label
+        }
         let methodName
         // 鍒ゆ柇鏄惁涓哄叕鍏辨柟娉曪紝濡傛灉涓哄叕鍏辨柟娉曞垯鎴彇涓撴湁灞炴�roduct/component/part/process绛夊瓧娈�
         if (isCommonMethod) {
@@ -90,8 +111,6 @@
           // 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)
         this.$bus.$emit('tableMenuItemMethodTrigger', {
           methodName,

--
Gitblit v1.9.3