diff --git a/core/core-frontend/src/components/data-visualization/CanvasAttr.vue b/core/core-frontend/src/components/data-visualization/CanvasAttr.vue index b313920963..a664d55c08 100644 --- a/core/core-frontend/src/components/data-visualization/CanvasAttr.vue +++ b/core/core-frontend/src/components/data-visualization/CanvasAttr.vue @@ -24,7 +24,8 @@ const canvasAttrActiveNames = ref(['size', 'baseSetting', 'background', 'color'] const screenAdaptorList = [ { label: '宽度优先', value: 'widthFirst' }, { label: '高度优先', value: 'heightFirst' }, - { label: '铺满全屏', value: 'full' } + { label: '铺满全屏', value: 'full' }, + { label: '不缩放', value: 'keep' } ] const init = () => { nextTick(() => { 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 67ebec8c8c..77b5318254 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue @@ -141,9 +141,12 @@ const canvasStyle = computed(() => { style['overflowY'] = 'hidden !important' } if (canvasStyleData.value && canvasStyleData.value.width && isMainCanvas(canvasId.value)) { - style = { - ...getCanvasStyle(canvasStyleData.value), - height: dashboardActive.value + style = getCanvasStyle(canvasStyleData.value) + if (canvasStyleData.value?.screenAdaptor === 'keep') { + style['height'] = canvasStyleData.value?.height + 'px' + style['width'] = canvasStyleData.value?.width + 'px' + } else { + style['height'] = dashboardActive.value ? downloadStatus.value ? getDownloadStatusMainHeight() : '100%' @@ -151,11 +154,11 @@ const canvasStyle = computed(() => { canvasStyleData.value?.screenAdaptor === 'widthFirst' ? changeStyleWithScale(canvasStyleData.value?.height, scaleMin.value) + 'px' : '100%' + style['width'] = + !dashboardActive.value && canvasStyleData.value?.screenAdaptor === 'heightFirst' + ? changeStyleWithScale(canvasStyleData.value?.width, scaleHeightPoint.value) + 'px' + : '100%' } - style['width'] = - !dashboardActive.value && canvasStyleData.value?.screenAdaptor === 'heightFirst' - ? changeStyleWithScale(canvasStyleData.value?.width, scaleHeightPoint.value) + 'px' - : '100%' } return style }) diff --git a/core/core-frontend/src/style/index.less b/core/core-frontend/src/style/index.less index 3289a8bc9c..a3083a5a6f 100644 --- a/core/core-frontend/src/style/index.less +++ b/core/core-frontend/src/style/index.less @@ -590,6 +590,13 @@ strong { overflow-y: auto; } +.preview-content-inner-size-keep { + width: 100%; + height: auto; + overflow-x: auto; + overflow-y: auto; +} + .preview-content-inner-height-first { width: auto; height: 100%; @@ -607,3 +614,7 @@ strong { .ed-message .ed-message__closeBtn:hover { background: #ebebebe6 !important; } + +.canvas_keep-size { + overflow-x: auto!important; +} diff --git a/core/core-frontend/src/views/data-visualization/DvPreview.vue b/core/core-frontend/src/views/data-visualization/DvPreview.vue index b5b787f3af..b0c4edabd3 100644 --- a/core/core-frontend/src/views/data-visualization/DvPreview.vue +++ b/core/core-frontend/src/views/data-visualization/DvPreview.vue @@ -52,6 +52,8 @@ const contentInnerClass = computed(() => { return 'preview-content-inner-height-first' } else if (props.canvasStylePreview.screenAdaptor === 'full') { return 'preview-content-inner-full' + } else if (props.canvasStylePreview.screenAdaptor === 'keep') { + return 'preview-content-inner-size-keep' } else { return 'preview-content-inner-width-first' } diff --git a/core/core-frontend/src/views/data-visualization/PreviewCanvas.vue b/core/core-frontend/src/views/data-visualization/PreviewCanvas.vue index 2e4152142b..c3af3f48ce 100644 --- a/core/core-frontend/src/views/data-visualization/PreviewCanvas.vue +++ b/core/core-frontend/src/views/data-visualization/PreviewCanvas.vue @@ -1,6 +1,6 @@