Commit b15ada0e4bbdb9cb953a7c914c22e16985cb5af7

Authored by 福福
Committed by xp.Huang
1 parent 48be4e64

Merge branch 'ww' into 'main_dev'

fix(background): 修复背景图片在预览模式下引用路径不正确

See merge request yunteng/thingskit-view!38

(cherry picked from commit e45d77c3)

4b2f2e04 fix(background): 修复背景图片在预览模式下引用路径不正确
... ... @@ -177,6 +177,7 @@ const rangeStyle = computed(() => {
177 177 // : { background: `url(${backgroundImage}) no-repeat center center / cover !important` }
178 178 // THINGS_KIT 路径转换,同步生产环境与开发环境的保存的静态资源文件路径不一致
179 179 : { background: `url(${getBackgroundImagePath(backgroundImage!)}) no-repeat center center / cover !important` }
  180 + console.log(getBackgroundImagePath(backgroundImage!))
180 181 return {
181 182 ...computedBackground,
182 183 width: 'inherit',
... ...
1 1 import { PickCreateComponentType } from '@/packages/index.d'
2 2 import { EditCanvasConfigType } from '@/store/modules/chartEditStore/chartEditStore.d'
  3 +/// THINGS_KIT 修改背景图片
  4 +import { useBackgroundSelect } from '@/utils/external/useBackgroundImageSelect'
3 5
4 6 type AttrType = PickCreateComponentType<'attr'>
5 7 type StatusType = PickCreateComponentType<'status'>
... ... @@ -41,13 +43,15 @@ export const getPreviewConfigStyle = (previewConfig: PreviewConfig) => {
41 43 return previewStyle
42 44 }
43 45
  46 +// THINGS_KIT 修改背景图片
  47 +const { getBackgroundImagePath } = useBackgroundSelect()
44 48 // 全局样式
45 49 export const getEditCanvasConfigStyle = (canvas: EditCanvasConfigType) => {
46 50 // 背景
47 51 const computedBackground = canvas.selectColor
48 52 ? { background: canvas.background }
49 53 : {
50   - background: `url(${canvas.backgroundImage}) center center / cover no-repeat !important`
  54 + background: `url(${getBackgroundImagePath(canvas.backgroundImage as unknown as string)}) center center / cover no-repeat !important`
51 55 }
52 56 return {
53 57 position: 'relative' as const,
... ...