fix: tab组件视图编辑框弹出错误问题

This commit is contained in:
wangjiahao 2022-03-29 13:24:50 +08:00
parent 68ac2a0d1e
commit 81dc5fb793
6 changed files with 5 additions and 26 deletions

View File

@ -50,7 +50,7 @@ export default {
if (this.curComponent.type === 'view') {
this.$store.dispatch('chart/setViewId', null)
this.$store.dispatch('chart/setViewId', this.curComponent.propValue.viewId)
bus.$emit('PanelSwitchComponent', { name: 'ChartEdit', param: { 'id': this.curComponent.propValue.viewId, 'optType': 'edit' }})
bus.$emit('change_panel_right_draw', true)
}
if (this.curComponent.type === 'custom') {
bus.$emit('component-dialog-edit')

View File

@ -1,6 +1,6 @@
<template>
<div class="bar-main">
<div v-if="!linkageSettingStatus">
<div>
<span v-if="isEdit" :title="$t('panel.edit')">
<i class="icon iconfont icon-edit" @click.stop="edit" />
</span>
@ -51,12 +51,9 @@ export default {
},
methods: {
edit() {
//
this.$store.dispatch('panel/setComponentDataTemp', JSON.stringify(this.componentData))
this.$store.dispatch('panel/setCanvasStyleDataTemp', JSON.stringify(this.canvasStyleData))
this.$store.dispatch('chart/setViewId', null)
this.$store.dispatch('chart/setViewId', this.viewId)
bus.$emit('PanelSwitchComponent', { name: 'ChartEdit', param: { 'id': this.viewId, 'optType': 'edit' }})
bus.$emit('change_panel_right_draw', true)
},
linkageEdit() {

View File

@ -46,9 +46,6 @@ export default {
this.$refs.trackButton.$el.click()
},
edit() {
//
this.$store.dispatch('panel/setComponentDataTemp', JSON.stringify(this.componentData))
this.$store.dispatch('panel/setCanvasStyleDataTemp', JSON.stringify(this.canvasStyleData))
if (this.curComponent.type === 'view') {
this.$store.dispatch('chart/setViewId', null)
this.$store.dispatch('chart/setViewId', this.curComponent.propValue.viewId)

View File

@ -372,7 +372,7 @@ export default {
this.destroyTimeMachine()
this.changeIndex++
this.chartResize(this.changeIndex)
} else {
} else if (this.$refs[this.element.propValue.id]) {
this.chart.isPlugin
? this.$refs[this.element.propValue.id].callPluginInner({ methodName: 'chartResize' })
: this.$refs[this.element.propValue.id].chartResize()

View File

@ -634,15 +634,7 @@ export default {
init(panelId) {
const _this = this
_this.initHasStar()
// 使
const componentDataTemp = this.$store.state.panel.componentDataTemp
const canvasStyleDataTemp = this.$store.state.panel.canvasStyleDataTemp
if (componentDataTemp && canvasStyleDataTemp) {
panelInit(JSON.parse(componentDataTemp), JSON.parse(canvasStyleDataTemp))
//
_this.$store.dispatch('panel/setComponentDataTemp', null)
_this.$store.dispatch('panel/setCanvasStyleDataTemp', null)
} else if (panelId) {
if (panelId) {
initPanelData(panelId, function() {
//
initViewCache(panelId)
@ -650,10 +642,6 @@ export default {
setTimeout(() => {
_this.$store.commit('refreshSaveStatus')
}, 500)
// initPanelComponentsData(panelId, function(rsp) {
// _this.$store.commit('initPanelComponents', rsp)//
// _this.$store.commit('recordSnapshot', 'init')//
// })
})
}
},

View File

@ -690,9 +690,6 @@ export default {
this.$store.commit('refreshSnapshot')
this.$store.commit('setComponentData', [])
this.$store.commit('setCanvasStyle', DEFAULT_COMMON_CANVAS_STYLE_STRING)
//
this.$store.dispatch('panel/setComponentDataTemp', null)
this.$store.dispatch('panel/setCanvasStyleDataTemp', null)
this.$store.dispatch('panel/setPanelInfo', data)
bus.$emit('PanelSwitchComponent', { name: 'PanelEdit' })
},