提交 81dc5fb7 authored 作者: wangjiahao's avatar wangjiahao

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

上级 68ac2a0d
...@@ -50,7 +50,7 @@ export default { ...@@ -50,7 +50,7 @@ export default {
if (this.curComponent.type === 'view') { if (this.curComponent.type === 'view') {
this.$store.dispatch('chart/setViewId', null) this.$store.dispatch('chart/setViewId', null)
this.$store.dispatch('chart/setViewId', this.curComponent.propValue.viewId) 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') { if (this.curComponent.type === 'custom') {
bus.$emit('component-dialog-edit') bus.$emit('component-dialog-edit')
......
<template> <template>
<div class="bar-main"> <div class="bar-main">
<div v-if="!linkageSettingStatus"> <div>
<span v-if="isEdit" :title="$t('panel.edit')"> <span v-if="isEdit" :title="$t('panel.edit')">
<i class="icon iconfont icon-edit" @click.stop="edit" /> <i class="icon iconfont icon-edit" @click.stop="edit" />
</span> </span>
...@@ -51,12 +51,9 @@ export default { ...@@ -51,12 +51,9 @@ export default {
}, },
methods: { methods: {
edit() { 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', null)
this.$store.dispatch('chart/setViewId', this.viewId) 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() { linkageEdit() {
......
...@@ -46,9 +46,6 @@ export default { ...@@ -46,9 +46,6 @@ export default {
this.$refs.trackButton.$el.click() this.$refs.trackButton.$el.click()
}, },
edit() { edit() {
// 编辑时临时保存 当前修改的画布
this.$store.dispatch('panel/setComponentDataTemp', JSON.stringify(this.componentData))
this.$store.dispatch('panel/setCanvasStyleDataTemp', JSON.stringify(this.canvasStyleData))
if (this.curComponent.type === 'view') { if (this.curComponent.type === 'view') {
this.$store.dispatch('chart/setViewId', null) this.$store.dispatch('chart/setViewId', null)
this.$store.dispatch('chart/setViewId', this.curComponent.propValue.viewId) this.$store.dispatch('chart/setViewId', this.curComponent.propValue.viewId)
......
...@@ -372,7 +372,7 @@ export default { ...@@ -372,7 +372,7 @@ export default {
this.destroyTimeMachine() this.destroyTimeMachine()
this.changeIndex++ this.changeIndex++
this.chartResize(this.changeIndex) this.chartResize(this.changeIndex)
} else { } else if (this.$refs[this.element.propValue.id]) {
this.chart.isPlugin this.chart.isPlugin
? this.$refs[this.element.propValue.id].callPluginInner({ methodName: 'chartResize' }) ? this.$refs[this.element.propValue.id].callPluginInner({ methodName: 'chartResize' })
: this.$refs[this.element.propValue.id].chartResize() : this.$refs[this.element.propValue.id].chartResize()
......
...@@ -634,15 +634,7 @@ export default { ...@@ -634,15 +634,7 @@ export default {
init(panelId) { init(panelId) {
const _this = this const _this = this
_this.initHasStar() _this.initHasStar()
// 如果临时画布有数据 则使用临时画布数据(视图编辑的时候 会保存临时画布数据) if (panelId) {
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) {
initPanelData(panelId, function() { initPanelData(panelId, function() {
// 初始化视图缓存 // 初始化视图缓存
initViewCache(panelId) initViewCache(panelId)
...@@ -650,10 +642,6 @@ export default { ...@@ -650,10 +642,6 @@ export default {
setTimeout(() => { setTimeout(() => {
_this.$store.commit('refreshSaveStatus') _this.$store.commit('refreshSaveStatus')
}, 500) }, 500)
// initPanelComponentsData(panelId, function(rsp) {
// _this.$store.commit('initPanelComponents', rsp)// 初始化仪表板组件视图数据
// _this.$store.commit('recordSnapshot', 'init')// 记录快照
// })
}) })
} }
}, },
......
...@@ -690,9 +690,6 @@ export default { ...@@ -690,9 +690,6 @@ export default {
this.$store.commit('refreshSnapshot') this.$store.commit('refreshSnapshot')
this.$store.commit('setComponentData', []) this.$store.commit('setComponentData', [])
this.$store.commit('setCanvasStyle', DEFAULT_COMMON_CANVAS_STYLE_STRING) 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) this.$store.dispatch('panel/setPanelInfo', data)
bus.$emit('PanelSwitchComponent', { name: 'PanelEdit' }) bus.$emit('PanelSwitchComponent', { name: 'PanelEdit' })
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论