diff --git a/core/core-frontend/src/components/dashboard/subject-setting/dashboard-style/OverallSetting.vue b/core/core-frontend/src/components/dashboard/subject-setting/dashboard-style/OverallSetting.vue index b800240ec2..f04209fb99 100644 --- a/core/core-frontend/src/components/dashboard/subject-setting/dashboard-style/OverallSetting.vue +++ b/core/core-frontend/src/components/dashboard/subject-setting/dashboard-style/OverallSetting.vue @@ -29,7 +29,7 @@ :class="'form-item-' + themes" label="仪表板字体选择" > - + { return props.themes === 'dark' ? 'ndark' : 'dark' }) @@ -296,8 +297,8 @@ const onRefreshChange = val => { } themeChange() } -const styleChange = () => { - snapshotStore.recordSnapshotCache('renderChart') +const fontFamilyChange = () => { + appearanceStore.setCurrentFont(canvasStyleData.fontFamily) } const themeChange = (modifyName?) => { diff --git a/core/core-frontend/src/components/visualization/CanvasBaseSetting.vue b/core/core-frontend/src/components/visualization/CanvasBaseSetting.vue index 3f44404944..2cf666b38f 100644 --- a/core/core-frontend/src/components/visualization/CanvasBaseSetting.vue +++ b/core/core-frontend/src/components/visualization/CanvasBaseSetting.vue @@ -6,7 +6,11 @@ :class="'form-item-' + themes" label="数据大屏字体选择" > - + { + appearanceStore.setCurrentFont(canvasStyleData.fontFamily) +} const onThemeChange = () => { snapshotStore.recordSnapshotCache() } diff --git a/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue b/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue index c354d0b3c7..7ad5df67f3 100644 --- a/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue +++ b/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue @@ -143,7 +143,7 @@ const curFontFamily = () => { value: ele.name })) ).forEach(font => { - result = result + font.name + '=' + font.name + ';' + result = result + font.name + '=' + font.value + ';' }) return result } diff --git a/core/core-frontend/src/utils/canvasUtils.ts b/core/core-frontend/src/utils/canvasUtils.ts index 2792e7622b..561688a741 100644 --- a/core/core-frontend/src/utils/canvasUtils.ts +++ b/core/core-frontend/src/utils/canvasUtils.ts @@ -35,7 +35,9 @@ const { inMobile, dvInfo, canvasStyleData, componentData, canvasViewInfo, appDat storeToRefs(dvMainStore) const snapshotStore = snapshotStoreWithOut() import { useI18n } from '@/hooks/web/useI18n' +import { useAppearanceStoreWithOut } from '@/store/modules/appearance' const { t } = useI18n() +const appearanceStore = useAppearanceStoreWithOut() export function chartTransStr2Object(targetIn, copy) { const target = copy === 'Y' ? cloneDeep(targetIn) : targetIn @@ -346,6 +348,7 @@ export function initCanvasDataPrepare(dvId, busiFlag, callBack) { dvInfo.type === 'dashboard' && canvasStyleResult['dashboard'].gap === 'yes' ? canvasStyleResult['dashboard'].gapSize : 0 + appearanceStore.setCurrentFont(canvasStyleData.fontFamily) callBack({ canvasDataResult, canvasStyleResult, dvInfo, canvasViewInfoPreview, curPreviewGap }) }) } diff --git a/core/core-frontend/src/utils/style.ts b/core/core-frontend/src/utils/style.ts index 41009e00cf..e5ac8589fa 100644 --- a/core/core-frontend/src/utils/style.ts +++ b/core/core-frontend/src/utils/style.ts @@ -226,7 +226,7 @@ export function getCanvasStyle(canvasStyleData, canvasId = 'canvas-main') { style['background'] = `url(${imgUrlTrans(background)}) no-repeat` } } - style['font-family'] = fontFamily + style['font-family'] = fontFamily + '!important' } return style