lyh
2025-06-23 8b311e8310a5ff81068129f59e4e1c434a1e3a25
src/views/dnc/base/modules/DeviceStructure/DeviceStructureTreeContextMenu.vue
@@ -33,7 +33,7 @@
          ],
          //设备
          device: [
            { label: '导入NC文档', code: 'device_import', icon: 'import', isCommonMethod: true },
            { label: '导入NC文档', code: 'device_nc_import', icon: 'import', isCommonMethod: true },
            { label: '权限配置', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true }
          ]
        }
@@ -41,7 +41,7 @@
    },
    computed: {
      getCurrentMenuLevel() {
        if (!this.treeParams.equipmentId) return 'workshop'
        if (this.treeParams.type===1) return 'workshop'
        else return 'device'
      }
    },
@@ -51,8 +51,8 @@
        const { param } = this.treeParams
        const treeNodeInfo = Object.assign({}, this.treeParams, { param })
        console.log('treeNodeInfo++++++++++++++++++++++++++++', treeNodeInfo)
        if (treeNodeInfo.type === 2) treeNodeInfo.type = 4
        // 设备结构树节点中的设备层级为2,但在产品结构树中将设备层级的type设置为4,为保证两个结构树共用的方法能正常运行,因此在此处同样设置为4
        if (treeNodeInfo.type === 2) treeNodeInfo.type = 7
        // 设备结构树节点中的设备层级为2,但在产品结构树中将设备层级的type设置为7,因此在此处设置为7
        const menuKeyArray = menuKey.split('_')
        const isCommonMethod = this.defaultContextMenuList[level].find(item => item.code === menuKey).isCommonMethod
        // product_add => handleAdd 触发对应组件事件