diff --git a/src/store/modules/chartEditStore/chartEditStore.ts b/src/store/modules/chartEditStore/chartEditStore.ts index 39333971..55c49771 100644 --- a/src/store/modules/chartEditStore/chartEditStore.ts +++ b/src/store/modules/chartEditStore/chartEditStore.ts @@ -483,9 +483,9 @@ export const useChartEditStore = defineStore({ } }, // * 设置页面大小 - setPageSize(): void { - this.setPageStyle('height', `${this.editCanvasConfig.height}px`) - this.setPageStyle('width', `${this.editCanvasConfig.width}px`) + setPageSize(scale: number): void { + this.setPageStyle('height', `${this.editCanvasConfig.height * scale}px`) + this.setPageStyle('width', `${this.editCanvasConfig.width * scale}px`) }, // * 计算缩放 computedScale() { @@ -540,6 +540,7 @@ export const useChartEditStore = defineStore({ setScale(scale: number, sys = true): void { if (!this.getEditCanvas.lockScale) { this.setPageSizeClass() + this.setPageSize(scale) this.setPageStyle('transform', `scale(${scale})`) this.getEditCanvas.userScale = scale if (sys) { diff --git a/src/views/chart/ContentConfigurations/components/CanvasPage/index.vue b/src/views/chart/ContentConfigurations/components/CanvasPage/index.vue index 3be9f875..3d96c446 100644 --- a/src/views/chart/ContentConfigurations/components/CanvasPage/index.vue +++ b/src/views/chart/ContentConfigurations/components/CanvasPage/index.vue @@ -7,7 +7,7 @@ size="small" v-model:value="canvasConfig.width" :validator="validator" - @update:value="chartEditStore.computedScale" + @update:value="changeSizeHandle" /> @@ -15,7 +15,7 @@ size="small" v-model:value="canvasConfig.height" :validator="validator" - @update:value="chartEditStore.computedScale" + @update:value="changeSizeHandle" /> @@ -182,6 +182,12 @@ const beforeUploadHandle = async ({ file }) => { return true } +// 修改尺寸 +const changeSizeHandle = () => { + chartEditStore.computedScale + chartEditStore.setPageSize +} + // 清除背景 const clearImage = () => { chartEditStore.setEditCanvasConfig( diff --git a/src/views/chart/ContentConfigurations/components/ChartSetting/index.vue b/src/views/chart/ContentConfigurations/components/ChartSetting/index.vue index 1011763f..ac529af0 100644 --- a/src/views/chart/ContentConfigurations/components/ChartSetting/index.vue +++ b/src/views/chart/ContentConfigurations/components/ChartSetting/index.vue @@ -38,6 +38,7 @@ const targetData: Ref = computed(() => { const targetIndex = chartEditStore.fetchTargetIndex() return list[targetIndex] }) +