diff --git a/frontend/src/views/dataset/add/AddUnion.vue b/frontend/src/views/dataset/add/AddUnion.vue
index 07c09f10df..0308b798c5 100644
--- a/frontend/src/views/dataset/add/AddUnion.vue
+++ b/frontend/src/views/dataset/add/AddUnion.vue
@@ -31,9 +31,11 @@
@@ -194,7 +198,11 @@ export default {
}
},
confirmEditUnion() {
+ // todo 校验关联关系与字段,必填
this.editUnion = false
+ },
+ cancelUnion(val) {
+ this.dataset = val
}
}
}
diff --git a/frontend/src/views/dataset/add/union/NodeItem.vue b/frontend/src/views/dataset/add/union/NodeItem.vue
index 5dc218cfc5..753aa4465e 100644
--- a/frontend/src/views/dataset/add/union/NodeItem.vue
+++ b/frontend/src/views/dataset/add/union/NodeItem.vue
@@ -61,6 +61,10 @@ export default {
nodeIndex: {
type: Number,
required: true
+ },
+ originData: {
+ type: Array,
+ required: true
}
},
data() {
@@ -81,11 +85,13 @@ export default {
tempDs: {},
// 父级数据集
tempParentDs: {},
- editField: false
+ editField: false,
+ tempData: []
}
},
methods: {
nodeClick() {
+ this.tempData = JSON.parse(JSON.stringify(this.originData))
this.editField = true
},
nodeMenuClick(param) {
@@ -153,6 +159,7 @@ export default {
},
closeEditField() {
this.editField = false
+ this.$emit('cancelUnionEdit', this.tempData)
},
confirmEditField() {
this.editField = false
diff --git a/frontend/src/views/dataset/add/union/UnionNode.vue b/frontend/src/views/dataset/add/union/UnionNode.vue
index 2eb950caf0..00b243f1c6 100644
--- a/frontend/src/views/dataset/add/union/UnionNode.vue
+++ b/frontend/src/views/dataset/add/union/UnionNode.vue
@@ -14,9 +14,11 @@
@@ -27,7 +29,9 @@
:children-node="item"
:children-list="childrenNode.childrenDs"
:parent-node="childrenNode"
+ :origin-data="originData"
@notifyParent="calc"
+ @cancelUnionEdit="cancelUnion"
/>
@@ -67,6 +71,10 @@ export default {
nodeIndex: {
type: Number,
required: true
+ },
+ originData: {
+ type: Array,
+ required: true
}
},
data() {
@@ -79,7 +87,8 @@ export default {
lineLength: '',
pathParam: '',
editUnion: false,
- unionParam: {}
+ unionParam: {},
+ tempData: []
}
},
watch: {
@@ -111,6 +120,7 @@ export default {
this.unionConfig(param)
},
unionConfig(param) {
+ this.tempData = JSON.parse(JSON.stringify(this.originData))
this.unionParam = param
this.editUnion = true
},
@@ -175,10 +185,17 @@ export default {
this.childrenNode.childrenDs.pop()
// 添加关联的时候,如果关闭关联关系设置的界面,则删除子节点,同时向父级传递消息
this.notifyFirstParent({ type: 'delete', grandParentAdd: true, grandParentSub: true, subCount: 0 })
+ } else {
+ // 向第一级传递
+ this.$emit('cancelUnionEdit', this.tempData)
}
},
confirmEditUnion() {
this.editUnion = false
+ },
+ // 向上级传递
+ cancelUnion(val) {
+ this.$emit('cancelUnionEdit', val)
}
}
}