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
:current-node="dataset[0]"
:node-index="0"
:origin-data="dataset"
@deleteNode="deleteNode"
@notifyParent="calc"
@editUnion="unionConfig"
@cancelUnionEdit="cancelUnion"
/>
<div v-if="dataset.length > 0">
<union-node
@ -43,7 +45,9 @@
:children-node="item"
:children-list="dataset[0].childrenDs"
:parent-node="dataset[0]"
:origin-data="dataset"
@notifyParent="calc"
@cancelUnionEdit="cancelUnion"
/>
</div>
</div>
@ -194,7 +198,11 @@ export default {
}
},
confirmEditUnion() {
// todo
this.editUnion = false
},
cancelUnion(val) {
this.dataset = val
}
}
}

View File

@ -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

View File

@ -14,9 +14,11 @@
<node-item
:current-node="childrenNode"
:node-index="nodeIndex"
:origin-data="originData"
@deleteNode="deleteNode"
@notifyParent="calc"
@editUnion="unionConfig"
@cancelUnionEdit="cancelUnion"
/>
<!--递归调用自身完成树状结构-->
<div>
@ -27,7 +29,9 @@
:children-node="item"
:children-list="childrenNode.childrenDs"
:parent-node="childrenNode"
:origin-data="originData"
@notifyParent="calc"
@cancelUnionEdit="cancelUnion"
/>
</div>
@ -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)
}
}
}