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

This commit is contained in:
taojinlong 2021-11-29 18:53:12 +08:00
commit 8177d67a2a
3 changed files with 34 additions and 2 deletions

View File

@ -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 @@
: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 {
} }
}, },
confirmEditUnion() { confirmEditUnion() {
// todo
this.editUnion = false this.editUnion = false
},
cancelUnion(val) {
this.dataset = val
} }
} }
} }

View File

@ -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 {
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 {
}, },
closeEditField() { closeEditField() {
this.editField = false this.editField = false
this.$emit('cancelUnionEdit', this.tempData)
}, },
confirmEditField() { confirmEditField() {
this.editField = false this.editField = false

View File

@ -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 @@
: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 {
nodeIndex: { nodeIndex: {
type: Number, type: Number,
required: true required: true
},
originData: {
type: Array,
required: true
} }
}, },
data() { data() {
@ -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 {
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 {
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)
} }
} }
} }