|
|
@@ -17,6 +17,16 @@ import recover from '@/assets/icons/recover.png'
|
|
|
import register from '@/assets/icons/register.png'
|
|
|
import shaping from '@/assets/icons/shaping.png'
|
|
|
import uninstallKiln from '@/assets/icons/uninstallKiln.png'
|
|
|
+import barcode from '@/assets/icons/barcode.png'
|
|
|
+import change from '@/assets/icons/change.png'
|
|
|
+import down from '@/assets/icons/down.png'
|
|
|
+import up from '@/assets/icons/up.png'
|
|
|
+import check from '@/assets/icons/check.png'
|
|
|
+import toilet from '@/assets/icons/toilet.png'
|
|
|
+import print from '@/assets/icons/print.png'
|
|
|
+import start from '@/assets/icons/start.png'
|
|
|
+import end from '@/assets/icons/end.png'
|
|
|
+
|
|
|
import dklogo from '@/assets/images/dklogo.png'
|
|
|
import router from '@/router'
|
|
|
import config from '@/config'
|
|
|
@@ -506,7 +516,7 @@ export default class Process {
|
|
|
|
|
|
|
|
|
// region 右键工序进入编辑模式
|
|
|
- this.graph.on('node:contextmenu', ({ node, e }) => {
|
|
|
+ this.graph.on('node:contextmenu', ({ node, e ,view}) => {
|
|
|
//如果双击的不是工序组,显示弹窗
|
|
|
if (!node.data?.parent) {
|
|
|
//设置值
|
|
|
@@ -894,6 +904,7 @@ export default class Process {
|
|
|
shape: 'custom-image',
|
|
|
width: 130,
|
|
|
height: 60,
|
|
|
+ effect: ['data'],
|
|
|
html(cell) {
|
|
|
let div = document.createElement('div')
|
|
|
let left = document.createElement('div')
|
|
|
@@ -903,8 +914,8 @@ export default class Process {
|
|
|
right.className = 'custom-html-right'
|
|
|
let img = document.createElement('img')
|
|
|
img.src = self.getCellImg(cell)
|
|
|
- img.width = 32
|
|
|
- img.height = 32
|
|
|
+ img.width = 24
|
|
|
+ img.height = 24
|
|
|
let title = document.createElement('div')
|
|
|
let text = document.createElement('div')
|
|
|
title.className = 'custom-html-right-title'
|
|
|
@@ -912,11 +923,51 @@ export default class Process {
|
|
|
title.innerHTML = cell.getData().nodeName
|
|
|
text.innerHTML = nodeKindList.find(it => it.kindCode == cell.getData().nodeKind)?.kindName
|
|
|
left.appendChild(img)
|
|
|
+
|
|
|
+ if(cell.getData().isValid!==undefined){
|
|
|
+ //操作模式icon
|
|
|
+ let iconsOpnKind=document.createElement('img')
|
|
|
+ iconsOpnKind.src = self.getOpnKindIcon(cell)
|
|
|
+ iconsOpnKind.width = 8
|
|
|
+ iconsOpnKind.height = 8
|
|
|
+ iconsOpnKind.className='node-icon-opn-kind'
|
|
|
+ left.appendChild(iconsOpnKind)
|
|
|
+
|
|
|
+ //工序标签icon
|
|
|
+ let iconsNodeTags=document.createElement('div')
|
|
|
+ iconsNodeTags = self.getNodeTagsDiv(cell,iconsNodeTags)
|
|
|
+ left.appendChild(iconsNodeTags)
|
|
|
+
|
|
|
+ //开始结束icon
|
|
|
+ let flowKind=document.createElement('img')
|
|
|
+ if(cell.getData().flowKind===config.flowKind.start){
|
|
|
+ flowKind.src = start
|
|
|
+ flowKind.width = 8
|
|
|
+ flowKind.height = 8
|
|
|
+ flowKind.className='node-icon-flow-kind'
|
|
|
+ left.appendChild(flowKind)
|
|
|
+ }
|
|
|
+ if(cell.getData().flowKind===config.flowKind.end){
|
|
|
+ flowKind.src = end
|
|
|
+ flowKind.width = 8
|
|
|
+ flowKind.height = 8
|
|
|
+ flowKind.className='node-icon-flow-kind'
|
|
|
+ left.appendChild(flowKind)
|
|
|
+ }
|
|
|
+
|
|
|
+ //显示顺序
|
|
|
+ let displayNo=document.createElement('div')
|
|
|
+ displayNo.innerHTML=cell.getData().displayNo
|
|
|
+ displayNo.className='node-icon-display-no'
|
|
|
+ left.appendChild(displayNo)
|
|
|
+ }
|
|
|
+
|
|
|
right.appendChild(title)
|
|
|
right.appendChild(text)
|
|
|
div.appendChild(left)
|
|
|
div.appendChild(right)
|
|
|
|
|
|
+ // console.log('cell.getData()',cell.getData())
|
|
|
if (cell.getData().isValid === false) {
|
|
|
left.style.borderColor = '#ed4014'
|
|
|
right.style.borderColor = '#ed4014'
|
|
|
@@ -981,7 +1032,7 @@ export default class Process {
|
|
|
flgJobDefect: true,
|
|
|
flowKind: config.flowKind.middle,
|
|
|
userKind: config.userKind.product,
|
|
|
- opnKind: config.processType.carCode,
|
|
|
+ opnKind: config.processType.kilnCode,
|
|
|
pieceKind: config.registerType.special,
|
|
|
flgScrap: false,
|
|
|
flgUndo: false,
|
|
|
@@ -993,7 +1044,7 @@ export default class Process {
|
|
|
flgJobDefect: true,
|
|
|
flowKind: config.flowKind.middle,
|
|
|
userKind: config.userKind.product,
|
|
|
- opnKind: config.processType.carCode,
|
|
|
+ opnKind: config.processType.kilnCode,
|
|
|
pieceKind: config.registerType.special,
|
|
|
flgScrap: false,
|
|
|
flgUndo: false,
|
|
|
@@ -1198,4 +1249,44 @@ export default class Process {
|
|
|
// console.log('1',self.imgList[nodeKindKey])
|
|
|
return this.imgList[nodeKindKey]
|
|
|
}
|
|
|
+
|
|
|
+ static iconOpnKindList= {
|
|
|
+ productCode: barcode,
|
|
|
+ dressKilnCar: up,
|
|
|
+ unloadKilnCar: down,
|
|
|
+ exchangeKilnCar: change,
|
|
|
+ kilnCode: uninstallKiln,
|
|
|
+ }
|
|
|
+
|
|
|
+ static getOpnKindIcon(cell) {
|
|
|
+ let opnKindValue=cell.getData().opnKind
|
|
|
+ let opnKindKey=Object.keys(config.processType).find(key => config.processType[key] === opnKindValue);
|
|
|
+ return this.iconOpnKindList[opnKindKey]
|
|
|
+ }
|
|
|
+
|
|
|
+ static getNodeTagsDiv(cell, iconsNodeTags) {
|
|
|
+ let nodeTags=cell.getData().nodeSysTags
|
|
|
+ console.log('nodeTags',nodeTags)
|
|
|
+ nodeTags.forEach(it=>{
|
|
|
+ let icon=document.createElement('img')
|
|
|
+ icon.src = this.getNodeTagsIcon(it)
|
|
|
+ icon.width = 8
|
|
|
+ icon.height = 8
|
|
|
+ icon.style='margin-bottom:4px'
|
|
|
+ iconsNodeTags.append(icon)
|
|
|
+ })
|
|
|
+ iconsNodeTags.className='node-icon-node-tags'
|
|
|
+ return iconsNodeTags
|
|
|
+ }
|
|
|
+
|
|
|
+ static getNodeTagsIcon(tag){
|
|
|
+ let nodeTagKey=Object.keys(config.nodeSysTags).find(key => config.nodeSysTags[key] === tag);
|
|
|
+ return this.iconNodeTagsList[nodeTagKey]
|
|
|
+ }
|
|
|
+
|
|
|
+ static iconNodeTagsList= {
|
|
|
+ mold: toilet,
|
|
|
+ check: check,
|
|
|
+ print: print,
|
|
|
+ }
|
|
|
}
|