fix(仪表板): 仪表板背景不透明度0的时候失效

This commit is contained in:
wangjiahao 2023-09-06 23:39:03 +08:00
parent d6de13e48c
commit c7a2de5f0d
3 changed files with 22 additions and 22 deletions

View File

@ -145,32 +145,32 @@
</template>
<script>
import { getStyle } from '@/components/canvas/utils/style'
import { mapState } from 'vuex'
import {getStyle} from '@/components/canvas/utils/style'
import {mapState} from 'vuex'
import ComponentWrapper from './ComponentWrapper'
import { changeStyleWithScale } from '@/components/canvas/utils/translate'
import { uuid } from 'vue-uuid'
import { deepCopy, imgUrlTrans } from '@/components/canvas/utils/utils'
import {changeStyleWithScale} from '@/components/canvas/utils/translate'
import {uuid} from 'vue-uuid'
import {deepCopy, imgUrlTrans} from '@/components/canvas/utils/utils'
import eventBus from '@/components/canvas/utils/eventBus'
import elementResizeDetectorMaker from 'element-resize-detector'
import CanvasOptBar from '@/components/canvas/components/editor/CanvasOptBar'
import bus from '@/utils/bus'
import { buildFilterMap, buildViewKeyMap, formatCondition, valueValid, viewIdMatch } from '@/utils/conditionUtil'
import { hasDataPermission } from '@/utils/permission'
import { activeWatermark } from '@/components/canvas/tools/watermark'
import { proxyUserLoginInfo, userLoginInfo } from '@/api/systemInfo/userLogin'
import {buildFilterMap, buildViewKeyMap, formatCondition, valueValid, viewIdMatch} from '@/utils/conditionUtil'
import {hasDataPermission} from '@/utils/permission'
import {activeWatermark} from '@/components/canvas/tools/watermark'
import {proxyUserLoginInfo, userLoginInfo} from '@/api/systemInfo/userLogin'
import html2canvas from 'html2canvasde'
import { queryAll } from '@/api/panel/pdfTemplate'
import {queryAll} from '@/api/panel/pdfTemplate'
import PDFPreExport from '@/views/panel/export/PDFPreExport'
import { listenGlobalKeyDownPreview } from '@/components/canvas/utils/shortcutKey'
import {listenGlobalKeyDownPreview} from '@/components/canvas/utils/shortcutKey'
import UserViewDialog from '@/components/canvas/customComponent/UserViewDialog'
import {hexColorToRGBA} from "@/views/chart/chart/util";
import { isMobile } from '@/utils/index'
import {isMobile} from '@/utils/index'
const erd = elementResizeDetectorMaker()
export default {
components: { UserViewDialog, ComponentWrapper, CanvasOptBar, PDFPreExport },
components: {UserViewDialog, ComponentWrapper, CanvasOptBar, PDFPreExport},
model: {
prop: 'show',
event: 'change'
@ -207,14 +207,14 @@ export default {
componentData: {
type: Array,
required: false,
default: function() {
default: function () {
return []
}
},
canvasStyleData: {
type: Object,
required: false,
default: function() {
default: function () {
return {}
}
},
@ -346,7 +346,7 @@ export default {
background: `url(${imgUrlTrans(styleInfo.imageUrl)}) no-repeat`
}
} else if (styleInfo.backgroundType === 'color') {
const colorRGBA = hexColorToRGBA(styleInfo.color, styleInfo.alpha||100)
const colorRGBA = hexColorToRGBA(styleInfo.color, styleInfo.alpha === undefined ? 100 : styleInfo.alpha)
style = {
background: colorRGBA
}
@ -649,7 +649,7 @@ export default {
},
clearAllLinkage() {
this.$store.commit('clearPanelLinkageInfo')
bus.$emit('clear_panel_linkage', { viewId: 'all' })
bus.$emit('clear_panel_linkage', {viewId: 'all'})
},
changeStyleWithScale,
getStyle,
@ -708,13 +708,13 @@ export default {
},
exportViewImg() {
this.imageDownloading = true
this.$refs['userViewDialog-canvas-main'].exportViewImg(()=>{
this.$refs['userViewDialog-canvas-main'].exportViewImg(() => {
this.imageDownloading = false
})
},
deselectCurComponent(e) {
if (!this.isClickComponent) {
this.$store.commit('setCurComponent', { component: null, index: null })
this.$store.commit('setCurComponent', {component: null, index: null})
if (this.$refs?.['canvas-opt-bar']) {
this.$refs['canvas-opt-bar'].setWidgetStatus()
}

View File

@ -82,7 +82,7 @@ export default {
background: `url(${imgUrlTrans(styleInfo.imageUrl)}) no-repeat`
}
} else if (styleInfo.backgroundType === 'color') {
const colorRGBA = hexColorToRGBA(styleInfo.color, styleInfo.alpha||100)
const colorRGBA = hexColorToRGBA(styleInfo.color, styleInfo.alpha === undefined ? 100 : styleInfo.alpha)
style = {
background: colorRGBA
}

View File

@ -723,7 +723,7 @@ export default {
background: `url(${imgUrlTrans(styleInfo.imageUrl)}) no-repeat`
}
} else if (styleInfo.backgroundType === 'color') {
const colorRGBA = hexColorToRGBA(styleInfo.color, styleInfo.alpha||100)
const colorRGBA = hexColorToRGBA(styleInfo.color, styleInfo.alpha === undefined ? 100 : styleInfo.alpha)
style = {
background: colorRGBA
}