diff --git a/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue b/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue index e6cb00c61d..7b0dfbff02 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue @@ -207,11 +207,19 @@ const curComponentId = computed(() => { const { emitter } = useEmitt() const curScale = computed(() => { - return canvasStyleData.value.scale / 100 + if (dashboardActive.value) { + return (canvasStyleData.value.scale * 1.5) / 100 + } else { + return canvasStyleData.value.scale / 100 + } }) const curBaseScale = computed(() => { - return dvMainStore.canvasStyleData.scale / 100 + if (dashboardActive.value) { + return (dvMainStore.canvasStyleData.scale * 1.5) / 100 + } else { + return dvMainStore.canvasStyleData.scale / 100 + } }) const pointShadowShow = computed(() => { @@ -1340,6 +1348,7 @@ defineExpose({ v-else :is="findComponent(item.component)" :id="'component' + item.id" + :scale="curBaseScale" class="component" :is-edit="true" :style="getComponentStyle(item.style)" diff --git a/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue b/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue index d7bdb80ca0..684da1ad21 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue @@ -126,6 +126,7 @@ const restore = () => { if (dashboardActive.value) { cellWidth.value = canvasWidth / pcMatrixCount.value.x cellHeight.value = canvasHeight / pcMatrixCount.value.y + scaleWidth.value = scaleWidth.value * 1.5 } else { changeRefComponentsSizeWithScale( componentData.value, diff --git a/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue b/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue index ffbedeff26..9cf388cb59 100644 --- a/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue +++ b/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue @@ -2,7 +2,6 @@
{{ customStyle.title }}
diff --git a/core/core-frontend/src/utils/canvasUtils.ts b/core/core-frontend/src/utils/canvasUtils.ts index 0f31d450ed..8e805f9bcc 100644 --- a/core/core-frontend/src/utils/canvasUtils.ts +++ b/core/core-frontend/src/utils/canvasUtils.ts @@ -11,6 +11,7 @@ import { getPanelAllLinkageInfo } from '@/api/visualization/linkage' import { queryVisualizationJumpInfo } from '@/api/visualization/linkJump' import { getViewConfig } from '@/views/chart/components/editor/util/chart' import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot' +import { toPercent } from '@/utils/translate' const dvMainStore = dvMainStoreWithOut() const { curBatchOptComponents, dvInfo, canvasStyleData, componentData, canvasViewInfo } = storeToRefs(dvMainStore) @@ -145,10 +146,10 @@ export function canvasSave(callBack) { item.propValue.forEach(groupItem => { groupItem.linkageFilters = [] // 计算groupStyle - groupItem.groupStyle.left = groupItem.style.left / groupStyle.width - groupItem.groupStyle.top = groupItem.style.top / groupStyle.height - groupItem.groupStyle.width = groupItem.style.width / groupStyle.width - groupItem.groupStyle.height = groupItem.style.height / groupStyle.height + groupItem.groupStyle.left = toPercent(groupItem.style.left / groupStyle.width) + groupItem.groupStyle.top = toPercent(groupItem.style.top / groupStyle.height) + groupItem.groupStyle.width = toPercent(groupItem.style.width / groupStyle.width) + groupItem.groupStyle.height = toPercent(groupItem.style.height / groupStyle.height) }) } else if (item.component === 'DeTabs') { item.propValue.forEach(tabItem => { diff --git a/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue b/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue index 6925449d80..afea752c4d 100644 --- a/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue +++ b/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue @@ -341,6 +341,22 @@ onBeforeUnmount(() => { resizeObserver?.disconnect() clearInterval(scrollTimer) }) + +const autoStyle = computed(() => { + return { + height: 100 / scale.value + '%!important', + width: 100 / scale.value + '%!important', + left: 50 * (1 - 1 / scale.value) + '%', // 放大余量 除以 2 + top: 50 * (1 - 1 / scale.value) + '%', // 放大余量 除以 2 + transform: 'scale(' + scale.value + ')' + } +}) + +const autoHeightStyle = computed(() => { + return { + height: 20 * scale.value + 8 + 'px' + } +}) @@ -355,18 +371,20 @@ onBeforeUnmount(() => {