diff --git a/core/core-frontend/src/api/staticResource.ts b/core/core-frontend/src/api/staticResource.ts index 94d5bd56a8..6075c32ac4 100644 --- a/core/core-frontend/src/api/staticResource.ts +++ b/core/core-frontend/src/api/staticResource.ts @@ -32,7 +32,7 @@ export function uploadFileResult(file, callback) { const fileUrl = staticResourcePath + newFileName const param = new FormData() param.append('file', file) - uploadFile(fileId, param).then(() => { + return uploadFile(fileId, param).then(() => { callback(fileUrl) }) } diff --git a/core/core-frontend/src/utils/style.ts b/core/core-frontend/src/utils/style.ts index e63c0355ac..b4450554a8 100644 --- a/core/core-frontend/src/utils/style.ts +++ b/core/core-frontend/src/utils/style.ts @@ -182,8 +182,14 @@ export function getComponentRotatedStyle(style) { } export function getCanvasStyle(canvasStyleData) { - const { backgroundColorSelect, background, backgroundColor, backgroundImageEnable, fontSize } = - canvasStyleData + const { + backgroundColorSelect, + background, + backgroundColor, + backgroundImageEnable, + fontSize, + mobileSetting + } = canvasStyleData const style = { fontSize: fontSize + 'px', color: canvasStyleData.color } // 仪表板默认色#f5f6f7 大屏默认配色 #1a1a1a let colorRGBA = dvMainStore.dvInfo.type === 'dashboard' ? '#f5f6f7' : '#1a1a1a' @@ -195,6 +201,17 @@ export function getCanvasStyle(canvasStyleData) { } else { style['background-color'] = colorRGBA } + + if (dvMainStore.mobileInPc && mobileSetting?.customSetting) { + const { backgroundType, color, alpha, imageUrl } = mobileSetting + if (backgroundType === 'image' && typeof imageUrl === 'string') { + style['background'] = `url(${imgUrlTrans(imageUrl)}) no-repeat` + } else if (backgroundType === 'color') { + const colorRGBA = hexColorToRGBA(color, alpha === undefined ? 100 : alpha) + style['background'] = colorRGBA + } + } + console.log('style', style) return style } diff --git a/core/core-frontend/src/views/dashboard/MobileBackgroundSelector.vue b/core/core-frontend/src/views/dashboard/MobileBackgroundSelector.vue new file mode 100644 index 0000000000..055e458799 --- /dev/null +++ b/core/core-frontend/src/views/dashboard/MobileBackgroundSelector.vue @@ -0,0 +1,208 @@ + + + + + diff --git a/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue b/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue index 0fe1f304e6..1234f9f952 100644 --- a/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue +++ b/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue @@ -1,6 +1,7 @@ -