Merge pull request #3506 from dataease/pr@dev@fix_panel-backgroup

fix(仪表板): 修复新画布编辑状态仪表板背景未生效问题
This commit is contained in:
fit2cloud-chenyw 2022-10-27 21:10:10 +08:00 committed by GitHub
commit b52bbbe493
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -27,7 +27,7 @@
v-else-if="componentDataShow && componentDataShow.length===0"
class="custom-position"
>
{{ $t('panel.panelNull') }}
<span v-show="isMainCanvas()">{{ $t('panel.panelNull') }}</span>
</el-row>
<div
v-else
@ -214,7 +214,7 @@ export default {
let style = {
width: '100%'
}
if (this.canvasStyleData.openCommonStyle) {
if (this.canvasStyleData.openCommonStyle && this.isMainCanvas()) {
if (this.canvasStyleData.panel.backgroundType === 'image' && this.canvasStyleData.panel.imageUrl) {
style = {
background: `url(${imgUrlTrans(this.canvasStyleData.panel.imageUrl)}) no-repeat`,
@ -308,6 +308,9 @@ export default {
bus.$off('trigger-reset-button', this.triggerResetButton)
},
methods: {
isMainCanvas() {
return this.canvasId === 'canvas-main'
},
triggerResetButton() {
this.triggerSearchButton(true)
},
@ -439,7 +442,7 @@ export default {
} else {
this.scaleHeight = canvasHeight * 100 / this.canvasStyleData.height//
}
if (this.canvasId === 'canvas-main') {
if (this.isMainCanvas()) {
this.$store.commit('setPreviewCanvasScale', { scaleWidth: (this.scaleWidth / 100), scaleHeight: (this.scaleHeight / 100) })
}
this.handleScaleChange()

View File

@ -174,6 +174,7 @@
v-if="!previewVisible&&!mobileLayoutStatus"
ref="canvasMainRef"
class="canvas_main_content"
:style="customCanvasStyle"
:canvas-style-data="canvasStyleData"
:component-data="mainCanvasComponentData"
:canvas-id="canvasId"