mirror of
https://github.com/dataease/dataease.git
synced 2025-02-24 11:32:57 +08:00
Merge pull request #10695 from dataease/pr@dev-v2@fix_template-import
fix(数据大屏): 修复数据大屏导入模版后,组合图层大小不一致问题 #10144
This commit is contained in:
commit
3cb4e31ddd
@ -1,10 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import { toRefs, computed, watch, nextTick } from 'vue'
|
||||
import { toRefs, computed, watch, nextTick, onMounted } from 'vue'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import CanvasGroup from '@/custom-component/common/CanvasGroup.vue'
|
||||
import { deepCopy } from '@/utils/utils'
|
||||
import { DEFAULT_CANVAS_STYLE_DATA_DARK } from '@/views/chart/components/editor/util/dataVisualiztion'
|
||||
import { groupSizeStyleAdaptor } from '@/utils/style'
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const { canvasStyleData, curComponent } = storeToRefs(dvMainStore)
|
||||
const sourceCanvasStyle = deepCopy(DEFAULT_CANVAS_STYLE_DATA_DARK)
|
||||
@ -16,6 +17,7 @@ const props = defineProps({
|
||||
},
|
||||
element: {
|
||||
type: Object,
|
||||
required: true,
|
||||
default() {
|
||||
return {
|
||||
propValue: null
|
||||
@ -86,6 +88,12 @@ watch(
|
||||
},
|
||||
{ deep: true }
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
groupSizeStyleAdaptor(element.value)
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -8,7 +8,6 @@ import eventBus from '@/utils/eventBus'
|
||||
import { adaptCurThemeCommonStyle } from '@/utils/canvasStyle'
|
||||
import { composeStoreWithOut } from '@/store/modules/data-visualization/compose'
|
||||
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
||||
import { groupSizeStyleAdaptor } from '@/utils/style'
|
||||
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const composeStore = composeStoreWithOut()
|
||||
@ -125,9 +124,6 @@ export const copyStore = defineStore('copy', {
|
||||
index: componentData.value.length - 1
|
||||
})
|
||||
}
|
||||
if (newComponent.component === 'Group') {
|
||||
groupSizeStyleAdaptor(newComponent)
|
||||
}
|
||||
i++
|
||||
}
|
||||
}, moveTime)
|
||||
|
Loading…
Reference in New Issue
Block a user