Merge pull request #12923 from dataease/pr@dev-v2@refactor_mobile2

refactor(仪表板): 移动端样式设计优化
This commit is contained in:
王嘉豪 2024-10-25 18:33:08 +08:00 committed by GitHub
commit 67fb1cf4c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 16 additions and 3 deletions

View File

@ -311,7 +311,7 @@ export const dvMainStore = defineStore('dataVisualization', {
if (this.mobileInPc) {
useEmitt().emitter.emit('curComponentChange', {
type: 'curComponentChange',
value: JSON.parse(JSON.stringify(this.curComponent))
value: this.curComponent ? JSON.parse(JSON.stringify(this.curComponent)) : null
})
}
},

View File

@ -787,5 +787,7 @@ export function mobileViewStyleSwitch(component) {
const viewInfo = canvasViewInfo.value[component.id]
viewInfo.customStyle = component.customStyle
viewInfo.customAttr = component.customAttr
viewInfo.title = component.title
viewInfo.name = component.name
}
}

View File

@ -1061,8 +1061,16 @@ const onChangeMiscStyleForm = val => {
const onTextChange = val => {
view.value.customStyle.text = val
useEmitt().emitter.emit('updateTitle-' + view.value.id)
snapshotStore.recordSnapshotCache('renderChart', view.value.id)
if (mobileInPc.value) {
//
useEmitt().emitter.emit('onMobileStatusChange', {
type: 'componentStyleChange',
value: { type: 'updateTitle', component: JSON.parse(JSON.stringify(view.value)) }
})
} else {
useEmitt().emitter.emit('updateTitle-' + view.value.id)
snapshotStore.recordSnapshotCache('renderChart', view.value.id)
}
}
const onLegendChange = val => {

View File

@ -77,6 +77,9 @@ const hanedleMessage = event => {
} else if (type === 'calcData') {
mobileViewStyleSwitch(component)
useEmitt().emitter.emit('calcData-' + component.id, component)
} else if (type === 'updateTitle') {
mobileViewStyleSwitch(component)
useEmitt().emitter.emit('updateTitle-' + component.id)
} else if (['style', 'commonBackground'].includes(type)) {
const mobileComponent = findComponentById(component.id)
mobileComponent[type] = component[type]