feat:合并bug修复

This commit is contained in:
wangjiahao 2021-04-09 18:19:45 +08:00
parent 53c1d36c4f
commit 91a7696615
4 changed files with 15 additions and 20 deletions

View File

@ -67,13 +67,10 @@ export default {
// div
erd.listenTo(document.getElementById('canvasInfo'), element => {
_this.$nextTick(() => {
debugger
_this.restore()
})
})
//
eventBus.$on('componentDataChange', () => {
_this.restore()
})
},
methods: {
changeStyleWithScale,

View File

@ -174,6 +174,7 @@ export default {
}
},
panelInfo(newVal, oldVal) {
debugger
this.init(newVal.id)
}
},
@ -195,6 +196,7 @@ export default {
},
methods: {
init(panelId) {
debugger
// 使
const componentDataTemp = this.$store.state.panel.componentDataTemp
const canvasStyleDataTemp = this.$store.state.panel.canvasStyleDataTemp
@ -203,8 +205,8 @@ export default {
this.$store.commit('setCanvasStyle', JSON.parse(canvasStyleDataTemp))
} else if (panelId) {
get('panel/group/findOne/' + panelId).then(response => {
this.$store.commit('setComponentData', this.resetID(response.data.panelData))
this.$store.commit('setCanvasStyle', response.data.panelStyle)
this.$store.commit('setComponentData', this.resetID(JSON.parse(response.data.panelData)))
this.$store.commit('setCanvasStyle', JSON.parse(response.data.panelStyle))
})
}
},

View File

@ -424,7 +424,6 @@ export default {
this.$store.commit('setCanvasStyle', JSON.parse(response.data.panelStyle))
this.$store.dispatch('panel/setPanelInfo', data)
this.currGroup = data
eventBus.$emit('componentDataChange', '')
})
}
if (node.expanded) {
@ -517,7 +516,6 @@ export default {
this.authVisible = false
},
edit(data) {
//
this.$store.dispatch('panel/setPanelInfo', data)
bus.$emit('PanelSwitchComponent', { name: 'PanelEdit' })
},

View File

@ -1,5 +1,5 @@
<template>
<el-row v-if="showMain" style="height: 100%;width: 100%;">
<el-row style="height: 100%;width: 100%;">
<el-col v-if="panelInfo.name.length>0" class="panel-design">
<el-row class="panel-design-head">
<!--TODO 仪表盘头部区域-->
@ -12,7 +12,7 @@
</el-row>
<!--TODO 仪表盘预览区域-->
<el-row class="panel-design-preview">
<Preview />
<Preview v-if="showMain" />
</el-row>
</el-col>
<el-col v-if="panelInfo.name.length===0" style="height: 100%;">
@ -25,14 +25,13 @@
<script>
import Preview from '@/components/canvas/components/Editor/Preview'
import { mapState } from 'vuex'
import eventBus from '@/components/canvas/utils/eventBus'
export default {
name: 'PanelViewShow',
components: { Preview },
data() {
return {
showMain: false
showMain: true
}
},
@ -45,15 +44,14 @@ export default {
'canvasStyleData'
])
},
mounted() {
//
eventBus.$on('componentDataChange', () => {
//
watch: {
panelInfo(newVal, oldVla) {
//
this.showMain = false
this.$nextTick(() => {
this.showMain = true
})
})
this.$nextTick(() => { this.showMain = true })
}
},
mounted() {
},
methods: {
clickPreview() {