forked from github/dataease
refactor: 优化PC移动端布局切换,防止出现错误仪表板布局
Co-authored-by: wangjiahao <1522128093@qq.com>
This commit is contained in:
parent
ffb4deb3a9
commit
787ef75b06
@ -376,6 +376,7 @@ export default {
|
||||
mobileDataObj[item.id] = item
|
||||
})
|
||||
const sourceComponentData = JSON.parse(this.componentDataCache)
|
||||
this.$store.commit('setComponentDataCache', null)
|
||||
sourceComponentData.forEach(item => {
|
||||
if (mobileDataObj[item.id]) {
|
||||
mobile2MainCanvas(item, mobileDataObj[item.id])
|
||||
|
@ -348,6 +348,7 @@ const data = {
|
||||
},
|
||||
// 启用移动端布局
|
||||
openMobileLayout(state) {
|
||||
state.componentDataCache = null
|
||||
state.componentDataCache = JSON.stringify(state.componentData)
|
||||
state.pcComponentData = state.componentData
|
||||
const mainComponentData = []
|
||||
|
@ -645,6 +645,8 @@ export default {
|
||||
this.lastActiveNodeData = data
|
||||
this.activeTree = data.panelType
|
||||
if (data.nodeType === 'panel') {
|
||||
// 清理pc布局缓存
|
||||
this.$store.commit('setComponentDataCache', null)
|
||||
// 加载视图数据
|
||||
findOne(data.id).then(response => {
|
||||
const componentDatas = JSON.parse(response.data.panelData)
|
||||
|
@ -130,13 +130,11 @@ import { starStatus, saveEnshrine, deleteEnshrine } from '@/api/panel/enshrine'
|
||||
import bus from '@/utils/bus'
|
||||
import { queryAll } from '@/api/panel/pdfTemplate'
|
||||
import ShareHead from '@/views/panel/GrantAuth/ShareHead'
|
||||
import JsPDF from 'jspdf'
|
||||
|
||||
export default {
|
||||
name: 'PanelViewShow',
|
||||
components: { Preview, SaveToTemplate, PDFPreExport, ShareHead },
|
||||
props: {
|
||||
// eslint-disable-next-line vue/require-default-prop
|
||||
activeTab: {
|
||||
type: String,
|
||||
required: false
|
||||
@ -208,7 +206,6 @@ export default {
|
||||
bus.$on('set-panel-show-type', type => {
|
||||
this.showType = type || 0
|
||||
})
|
||||
|
||||
this.initPdfTemplate()
|
||||
},
|
||||
methods: {
|
||||
|
Loading…
Reference in New Issue
Block a user