| | |
| | | //零件 |
| | | part: [ |
| | | { label: '添加零件', code: 'parts_add', icon: 'plus', isCommonMethod: false }, |
| | | { label: '创建工序', code: 'parts_add_relative', icon: 'plus', isCommonMethod: false }, |
| | | { label: '创建工艺规程版本', code: 'parts_add_relative', icon: 'plus', isCommonMethod: false }, |
| | | // { label: '创建工序', code: 'parts_add_relative', icon: 'plus', isCommonMethod: false }, |
| | | { label: '编辑零件信息', code: 'parts_edit', icon: 'edit', isCommonMethod: false }, |
| | | // { label: '导出文档', code: 'parts_export', icon: 'export', isCommonMethod: true }, |
| | | { label: '导入其他文档', code: 'parts_import', icon: 'import', isCommonMethod: true }, |
| | | { label: '删除', code: 'parts_delete', icon: 'delete', isCommonMethod: true }, |
| | | { label: '权限配置', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ], |
| | | //工艺规程版本 |
| | | processSpecVersion: [ |
| | | { label: '创建工艺规程版本', code: 'version_add', icon: 'plus', isCommonMethod: false }, |
| | | { label: '创建工序', code: 'version_add_child', icon: 'plus', isCommonMethod: false }, |
| | | { label: '编辑工艺规程版本信息', code: 'version_edit', icon: 'edit', isCommonMethod: false }, |
| | | { label: '删除', code: 'version_delete', icon: 'delete', isCommonMethod: true }, |
| | | { label: '权限配置', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ], |
| | | //工序 |
| | |
| | | { label: '创建工步', code: 'process_add_child', icon: 'plus', isCommonMethod: false }, |
| | | { label: '编辑工序信息', code: 'process_edit', icon: 'edit', isCommonMethod: false }, |
| | | { label: '删除', code: 'process_delete', icon: 'delete', isCommonMethod: true }, |
| | | // { label: '导出NC程序', code: 'process_export', icon: 'import', isCommonMethod: true }, |
| | | { label: '导入NC程序', code: 'process_import', icon: 'export', isCommonMethod: true } |
| | | // { label: '导出NC程序', code: 'process_export', icon: 'export', isCommonMethod: true }, |
| | | { label: '导入NC程序', code: 'process_import', icon: 'import', isCommonMethod: true }, |
| | | { label: '权限配置', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ], |
| | | //工步 |
| | | processStep: [ |
| | |
| | | { label: '编辑工步信息', code: 'processStep_edit', icon: 'edit', isCommonMethod: false }, |
| | | { label: '删除', code: 'processStep_delete', icon: 'delete', isCommonMethod: true }, |
| | | // { label: '导出NC程序', code: 'processStep_export', icon: 'import', isCommonMethod: true }, |
| | | { label: '导入NC程序', code: 'processStep_import', icon: 'export', isCommonMethod: true } |
| | | { label: '导入NC程序', code: 'processStep_import', icon: 'import', isCommonMethod: true }, |
| | | { label: '权限配置', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ] |
| | | } |
| | | } |
| | |
| | | return 'component' |
| | | case 3: |
| | | return 'part' |
| | | case 4: |
| | | return 'processSpecVersion' |
| | | case 5: |
| | | return 'process' |
| | | case 6: |
| | | return 'processStep' |
| | | } |
| | | }, |
| | | getCurrentDocClassCode() { |
| | | switch (this.treeParams.type) { |
| | | case 1: |
| | | return 'OTHER' |
| | | case 2: |
| | | return 'OTHER' |
| | | case 3: |
| | | return 'OTHER' |
| | | case 5: |
| | | return 'NC' |
| | | case 6: |
| | | return 'NC' |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | onContextMenuClick(treeKey, menuKey) { |
| | | const level = this.getCurrentMenuLevel |
| | | const param = this.getCurrentDocClassCode |
| | | console.log('level---------------------', level) |
| | | console.log('param---------------------', param) |
| | | const treeNodeInfo = Object.assign({}, this.treeParams, { param }) |
| | | console.log('treeNodeInfo******************', treeNodeInfo) |
| | | const menuKeyArray = menuKey.split('_') |
| | | const isCommonMethod = this.defaultContextMenuList[level].find(item => item.code === menuKey).isCommonMethod |
| | | // product_add => handleAdd 触发对应组件事件 |
| | |
| | | } else { |
| | | methodName = 'handle' + menuKeyArray.map(item => item[0].toUpperCase() + item.slice(1)).join('') |
| | | } |
| | | console.log('methodName------------------------------------', methodName) |
| | | console.log('treeParams------------------------------------', this.treeParams) |
| | | const modalTitle = this.defaultContextMenuList[level].find(item => item.code === menuKey).label |
| | | this.$bus.$emit('treeMenuItemMethodTrigger', { methodName, modalTitle, treeNodeInfo: this.treeParams }) |
| | | this.$bus.$emit('treeMenuItemMethodTrigger', { methodName, modalTitle, treeNodeInfo }) |
| | | } |
| | | } |
| | | } |