|
|
@@ -262,13 +262,21 @@ export default {
|
|
|
watch: {
|
|
|
//当前节点发生变化
|
|
|
id(n, o) {
|
|
|
- this.graph = Process.graph
|
|
|
- let cell = this.graph.getCellById(this.process.currentNodeId)
|
|
|
- this.nodeData = cell.data
|
|
|
+ if(n){
|
|
|
+ if(this.graph==null){
|
|
|
+ this.graph = Process.graph
|
|
|
+ }
|
|
|
+ let cell = this.graph.getCellById(this.process.currentNodeId)
|
|
|
+ this.nodeData = cell.data
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
- //监听model显示,达到类似onShow的效果
|
|
|
+ //监听model显示,达到类似onShow的效果,节点每次显示,都要根据当前节点id重新渲染节点数据
|
|
|
onShow(n, o) {
|
|
|
if (n) {
|
|
|
+ if(this.graph==null){
|
|
|
+ this.graph = Process.graph
|
|
|
+ }
|
|
|
//过滤调节点组并将json解构成新结构数组
|
|
|
this.allNodes = this.graph.getNodes().filter(it => it.shape == 'custom-image').map((it) => {
|
|
|
return { id: it.id, name: it.data.nodeName }
|
|
|
@@ -407,7 +415,7 @@ export default {
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
- ...mapMutations(['setProcessNodeModalDisplay', 'setProcessEdgeModalDisplay']),
|
|
|
+ ...mapMutations(['setProcessNodeModalDisplay', 'setCurrentNodeId']),
|
|
|
chooseData(row, rowIndex){
|
|
|
console.log('row',row,rowIndex)
|
|
|
this.$set(this.nodeData.jobDefectList[rowIndex],'jobId',row.jobId)
|
|
|
@@ -420,7 +428,6 @@ export default {
|
|
|
*/
|
|
|
modalOk() {
|
|
|
//关闭modal
|
|
|
- this.setProcessNodeModalDisplay(false)
|
|
|
this.handleParams()
|
|
|
//根据节点id获取节点数据
|
|
|
let cell = this.graph.getCellById(this.process.currentNodeId)
|
|
|
@@ -431,6 +438,8 @@ export default {
|
|
|
label: { text: this.nodeData.nodeName },
|
|
|
text: { text: this.nodeData.nodeName },
|
|
|
})
|
|
|
+ this.setProcessNodeModalDisplay(false)
|
|
|
+ this.setCurrentNodeId(undefined)
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
@@ -440,6 +449,7 @@ export default {
|
|
|
*/
|
|
|
modalCancel() {
|
|
|
this.setProcessNodeModalDisplay(false)
|
|
|
+ this.setCurrentNodeId(undefined)
|
|
|
},
|
|
|
/**
|
|
|
* @desc : 设置提交数据格式
|