提交 8177d67a authored 作者: taojinlong's avatar taojinlong

Merge branch 'dev' of github.com:dataease/dataease into dev

...@@ -31,9 +31,11 @@ ...@@ -31,9 +31,11 @@
<node-item <node-item
:current-node="dataset[0]" :current-node="dataset[0]"
:node-index="0" :node-index="0"
:origin-data="dataset"
@deleteNode="deleteNode" @deleteNode="deleteNode"
@notifyParent="calc" @notifyParent="calc"
@editUnion="unionConfig" @editUnion="unionConfig"
@cancelUnionEdit="cancelUnion"
/> />
<div v-if="dataset.length > 0"> <div v-if="dataset.length > 0">
<union-node <union-node
...@@ -43,7 +45,9 @@ ...@@ -43,7 +45,9 @@
:children-node="item" :children-node="item"
:children-list="dataset[0].childrenDs" :children-list="dataset[0].childrenDs"
:parent-node="dataset[0]" :parent-node="dataset[0]"
:origin-data="dataset"
@notifyParent="calc" @notifyParent="calc"
@cancelUnionEdit="cancelUnion"
/> />
</div> </div>
</div> </div>
...@@ -194,7 +198,11 @@ export default { ...@@ -194,7 +198,11 @@ export default {
} }
}, },
confirmEditUnion() { confirmEditUnion() {
// todo 校验关联关系与字段,必填
this.editUnion = false this.editUnion = false
},
cancelUnion(val) {
this.dataset = val
} }
} }
} }
......
...@@ -61,6 +61,10 @@ export default { ...@@ -61,6 +61,10 @@ export default {
nodeIndex: { nodeIndex: {
type: Number, type: Number,
required: true required: true
},
originData: {
type: Array,
required: true
} }
}, },
data() { data() {
...@@ -81,11 +85,13 @@ export default { ...@@ -81,11 +85,13 @@ export default {
tempDs: {}, tempDs: {},
// 父级数据集 // 父级数据集
tempParentDs: {}, tempParentDs: {},
editField: false editField: false,
tempData: []
} }
}, },
methods: { methods: {
nodeClick() { nodeClick() {
this.tempData = JSON.parse(JSON.stringify(this.originData))
this.editField = true this.editField = true
}, },
nodeMenuClick(param) { nodeMenuClick(param) {
...@@ -153,6 +159,7 @@ export default { ...@@ -153,6 +159,7 @@ export default {
}, },
closeEditField() { closeEditField() {
this.editField = false this.editField = false
this.$emit('cancelUnionEdit', this.tempData)
}, },
confirmEditField() { confirmEditField() {
this.editField = false this.editField = false
......
...@@ -14,9 +14,11 @@ ...@@ -14,9 +14,11 @@
<node-item <node-item
:current-node="childrenNode" :current-node="childrenNode"
:node-index="nodeIndex" :node-index="nodeIndex"
:origin-data="originData"
@deleteNode="deleteNode" @deleteNode="deleteNode"
@notifyParent="calc" @notifyParent="calc"
@editUnion="unionConfig" @editUnion="unionConfig"
@cancelUnionEdit="cancelUnion"
/> />
<!--递归调用自身,完成树状结构--> <!--递归调用自身,完成树状结构-->
<div> <div>
...@@ -27,7 +29,9 @@ ...@@ -27,7 +29,9 @@
:children-node="item" :children-node="item"
:children-list="childrenNode.childrenDs" :children-list="childrenNode.childrenDs"
:parent-node="childrenNode" :parent-node="childrenNode"
:origin-data="originData"
@notifyParent="calc" @notifyParent="calc"
@cancelUnionEdit="cancelUnion"
/> />
</div> </div>
...@@ -67,6 +71,10 @@ export default { ...@@ -67,6 +71,10 @@ export default {
nodeIndex: { nodeIndex: {
type: Number, type: Number,
required: true required: true
},
originData: {
type: Array,
required: true
} }
}, },
data() { data() {
...@@ -79,7 +87,8 @@ export default { ...@@ -79,7 +87,8 @@ export default {
lineLength: '', lineLength: '',
pathParam: '', pathParam: '',
editUnion: false, editUnion: false,
unionParam: {} unionParam: {},
tempData: []
} }
}, },
watch: { watch: {
...@@ -111,6 +120,7 @@ export default { ...@@ -111,6 +120,7 @@ export default {
this.unionConfig(param) this.unionConfig(param)
}, },
unionConfig(param) { unionConfig(param) {
this.tempData = JSON.parse(JSON.stringify(this.originData))
this.unionParam = param this.unionParam = param
this.editUnion = true this.editUnion = true
}, },
...@@ -175,10 +185,17 @@ export default { ...@@ -175,10 +185,17 @@ export default {
this.childrenNode.childrenDs.pop() this.childrenNode.childrenDs.pop()
// 添加关联的时候,如果关闭关联关系设置的界面,则删除子节点,同时向父级传递消息 // 添加关联的时候,如果关闭关联关系设置的界面,则删除子节点,同时向父级传递消息
this.notifyFirstParent({ type: 'delete', grandParentAdd: true, grandParentSub: true, subCount: 0 }) this.notifyFirstParent({ type: 'delete', grandParentAdd: true, grandParentSub: true, subCount: 0 })
} else {
// 向第一级传递
this.$emit('cancelUnionEdit', this.tempData)
} }
}, },
confirmEditUnion() { confirmEditUnion() {
this.editUnion = false this.editUnion = false
},
// 向上级传递
cancelUnion(val) {
this.$emit('cancelUnionEdit', val)
} }
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论