mirror of
https://github.com/dataease/dataease.git
synced 2026-05-20 11:38:11 +08:00
fix: 修复画布中组件加载多次
This commit is contained in:
@@ -89,6 +89,7 @@ export default {
|
||||
|
||||
deleteCurCondition() {
|
||||
if (this.curComponent.type === 'custom') {
|
||||
this.$store.dispatch('conditions/delete', { componentId: this.curComponent.id })
|
||||
bus.$emit('delete-condition', { componentId: this.curComponent.id })
|
||||
}
|
||||
},
|
||||
|
||||
@@ -92,6 +92,10 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
created() {
|
||||
// 先清除查询条件
|
||||
this.$store.dispatch('conditions/clear')
|
||||
},
|
||||
methods: {
|
||||
changeStyleWithScale,
|
||||
getStyle,
|
||||
@@ -105,7 +109,7 @@ export default {
|
||||
resetID(data) {
|
||||
if (data) {
|
||||
data.forEach(item => {
|
||||
item.id = uuid.v1()
|
||||
item.type !== 'custom' && (item.id = uuid.v1())
|
||||
})
|
||||
}
|
||||
return data
|
||||
|
||||
@@ -118,7 +118,7 @@ export default {
|
||||
resetID(data) {
|
||||
if (data) {
|
||||
data.forEach(item => {
|
||||
item.id = uuid.v1()
|
||||
item.type !== 'custom' && (item.id = uuid.v1())
|
||||
})
|
||||
}
|
||||
return data
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
class="component"
|
||||
:style="item.style"
|
||||
:element="item"
|
||||
@set-condition-value="setConditionValue"
|
||||
/>
|
||||
|
||||
<component
|
||||
@@ -109,7 +108,7 @@ export default {
|
||||
height: this.changeStyleWithScale(this.canvasStyleData.height) + 'px'
|
||||
}
|
||||
if (this.canvasStyleData.openCommonStyle) {
|
||||
if (this.canvasStyleData.panel.backgroundType === 'image'&&this.canvasStyleData.panel.imageUrl) {
|
||||
if (this.canvasStyleData.panel.backgroundType === 'image' && this.canvasStyleData.panel.imageUrl) {
|
||||
style = {
|
||||
width: this.changeStyleWithScale(this.canvasStyleData.width) + 'px',
|
||||
height: this.changeStyleWithScale(this.canvasStyleData.height) + 'px',
|
||||
@@ -148,6 +147,9 @@ export default {
|
||||
this.deleteCondition(condition)
|
||||
})
|
||||
},
|
||||
created() {
|
||||
this.$store.dispatch('conditions/clear')
|
||||
},
|
||||
methods: {
|
||||
changeStyleWithScale,
|
||||
|
||||
|
||||
@@ -69,9 +69,9 @@ export default {
|
||||
},
|
||||
|
||||
resetID(data) {
|
||||
if( data ) {
|
||||
if (data) {
|
||||
data.forEach(item => {
|
||||
item.id = uuid.v1()
|
||||
item.type !== 'custom' && (item.id = uuid.v1())
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ export default {
|
||||
|
||||
created() {
|
||||
this.options = this.element.options
|
||||
this.setCondition()
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
@@ -52,8 +53,12 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
changeValue(value) {
|
||||
this.inDraw && this.$store.dispatch('conditions/add', { component: this.element, value: [this.options.value], operator: this.operator })
|
||||
this.setCondition()
|
||||
this.inDraw && this.$emit('set-condition-value', { component: this.element, value: [value], operator: this.operator })
|
||||
},
|
||||
|
||||
setCondition() {
|
||||
this.inDraw && this.$store.dispatch('conditions/add', { component: this.element, value: [this.options.value], operator: this.operator })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user