forked from github/dataease
fix(仪表板): 仪表板移动端配置每次保存后退出在此进行保存提示都会+1
This commit is contained in:
parent
34c23ba315
commit
813c02a045
@ -141,13 +141,6 @@ const saveCanvasWithCheck = () => {
|
||||
saveResource()
|
||||
}
|
||||
|
||||
const saveCanvasWithCheckFromMobile = () => {
|
||||
snapshotStore.resetStyleChangeTimes()
|
||||
canvasSave(() => {
|
||||
ElMessage.success('保存成功')
|
||||
})
|
||||
}
|
||||
|
||||
const saveResource = () => {
|
||||
if (styleChangeTimes.value > 0) {
|
||||
snapshotStore.resetStyleChangeTimes()
|
||||
@ -199,7 +192,6 @@ const mobileConfig = () => {
|
||||
|
||||
eventBus.on('preview', previewInner)
|
||||
eventBus.on('save', saveCanvasWithCheck)
|
||||
eventBus.on('saveFromMobile', saveCanvasWithCheckFromMobile)
|
||||
eventBus.on('clearCanvas', clearCanvas)
|
||||
|
||||
const openDataBoardSetting = () => {
|
||||
|
@ -1,8 +1,9 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, unref, onBeforeUnmount, computed } from 'vue'
|
||||
import eventBus from '@/utils/eventBus'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus-secondary'
|
||||
import MobileBackgroundSelector from './MobileBackgroundSelector.vue'
|
||||
import { ElMessageBox } from 'element-plus-secondary'
|
||||
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
||||
import { canvasSave } from '@/utils/canvasUtils'
|
||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { getStyle } from '@/utils/style'
|
||||
@ -12,6 +13,7 @@ const dvMainStore = dvMainStoreWithOut()
|
||||
const { componentData, canvasStyleData, canvasViewInfo, dvInfo } = storeToRefs(dvMainStore)
|
||||
const mobileLoading = ref(true)
|
||||
const emits = defineEmits(['pcMode'])
|
||||
const snapshotStore = snapshotStoreWithOut()
|
||||
|
||||
const getComponentStyleDefault = style => {
|
||||
return getStyle(style, ['top', 'left', 'width', 'height', 'rotate'])
|
||||
@ -78,9 +80,16 @@ const hanedleMessage = event => {
|
||||
}
|
||||
})
|
||||
|
||||
eventBus.emit('saveFromMobile')
|
||||
saveCanvasWithCheckFromMobile()
|
||||
}
|
||||
}
|
||||
|
||||
const saveCanvasWithCheckFromMobile = () => {
|
||||
snapshotStore.resetStyleChangeTimes()
|
||||
canvasSave(() => {
|
||||
ElMessage.success('保存成功')
|
||||
})
|
||||
}
|
||||
onMounted(() => {
|
||||
window.addEventListener('message', hanedleMessage)
|
||||
dvMainStore.setMobileInPc(true)
|
||||
|
Loading…
Reference in New Issue
Block a user