mirror of
https://github.com/dataease/dataease.git
synced 2025-02-25 03:52:59 +08:00
Merge pull request #13490 from dataease/pr@dev-v2@refactor_font-inner
refactor: 组件内部字体适配
This commit is contained in:
commit
32b3cf6b0b
@ -298,7 +298,11 @@ const onRefreshChange = val => {
|
|||||||
themeChange()
|
themeChange()
|
||||||
}
|
}
|
||||||
const fontFamilyChange = () => {
|
const fontFamilyChange = () => {
|
||||||
appearanceStore.setCurrentFont(canvasStyleData.fontFamily)
|
appearanceStore.setCurrentFont(canvasStyleData.value.fontFamily)
|
||||||
|
document.documentElement.style.setProperty(
|
||||||
|
'--de-canvas_custom_font',
|
||||||
|
`${canvasStyleData.value.fontFamily}`
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const themeChange = (modifyName?) => {
|
const themeChange = (modifyName?) => {
|
||||||
|
@ -172,6 +172,11 @@ const props = defineProps({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: false,
|
required: false,
|
||||||
default: true
|
default: true
|
||||||
|
},
|
||||||
|
fontFamily: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: 'inherit'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -1628,6 +1633,7 @@ defineExpose({
|
|||||||
:dv-info="dvInfo"
|
:dv-info="dvInfo"
|
||||||
:canvas-active="canvasActive"
|
:canvas-active="canvasActive"
|
||||||
:show-position="'canvas'"
|
:show-position="'canvas'"
|
||||||
|
:font-family="fontFamily"
|
||||||
/>
|
/>
|
||||||
<component
|
<component
|
||||||
v-else-if="item.component.includes('Svg')"
|
v-else-if="item.component.includes('Svg')"
|
||||||
@ -1646,6 +1652,7 @@ defineExpose({
|
|||||||
:active="item.id === curComponentId"
|
:active="item.id === curComponentId"
|
||||||
:canvas-active="canvasActive"
|
:canvas-active="canvasActive"
|
||||||
:show-position="'edit'"
|
:show-position="'edit'"
|
||||||
|
:font-family="fontFamily"
|
||||||
/>
|
/>
|
||||||
<component
|
<component
|
||||||
v-else
|
v-else
|
||||||
@ -1664,6 +1671,7 @@ defineExpose({
|
|||||||
:active="item.id === curComponentId"
|
:active="item.id === curComponentId"
|
||||||
:canvas-active="canvasActive"
|
:canvas-active="canvasActive"
|
||||||
:show-position="'edit'"
|
:show-position="'edit'"
|
||||||
|
:font-family="fontFamily"
|
||||||
/>
|
/>
|
||||||
</Shape>
|
</Shape>
|
||||||
<!-- 右击菜单 -->
|
<!-- 右击菜单 -->
|
||||||
|
@ -107,6 +107,12 @@ const props = defineProps({
|
|||||||
type: String,
|
type: String,
|
||||||
required: false,
|
required: false,
|
||||||
default: 'common'
|
default: 'common'
|
||||||
|
},
|
||||||
|
// 字体
|
||||||
|
fontFamily: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: 'inherit'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const {
|
const {
|
||||||
@ -424,6 +430,7 @@ const showActive = computed(() => props.popActive || (dvMainStore.mobileInPc &&
|
|||||||
:disabled="true"
|
:disabled="true"
|
||||||
:is-edit="false"
|
:is-edit="false"
|
||||||
:suffix-id="suffixId"
|
:suffix-id="suffixId"
|
||||||
|
:font-family="fontFamily"
|
||||||
@onPointClick="onPointClick"
|
@onPointClick="onPointClick"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -96,7 +96,11 @@ const fontFamily = CHART_FONT_FAMILY.concat(
|
|||||||
}))
|
}))
|
||||||
)
|
)
|
||||||
const onFontFamilyChange = () => {
|
const onFontFamilyChange = () => {
|
||||||
appearanceStore.setCurrentFont(canvasStyleData.fontFamily)
|
appearanceStore.setCurrentFont(canvasStyleData.value.fontFamily)
|
||||||
|
document.documentElement.style.setProperty(
|
||||||
|
'--de-canvas_custom_font',
|
||||||
|
`${canvasStyleData.value.fontFamily}`
|
||||||
|
)
|
||||||
}
|
}
|
||||||
const onThemeChange = () => {
|
const onThemeChange = () => {
|
||||||
snapshotStore.recordSnapshotCache()
|
snapshotStore.recordSnapshotCache()
|
||||||
|
@ -3,7 +3,11 @@
|
|||||||
<el-dropdown :teleported="false" trigger="click">
|
<el-dropdown :teleported="false" trigger="click">
|
||||||
<input id="input" ref="trackButton" type="button" hidden />
|
<input id="input" ref="trackButton" type="button" hidden />
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu class="track-menu" :append-to-body="false">
|
<el-dropdown-menu
|
||||||
|
class="track-menu"
|
||||||
|
:style="{ 'font-family': fontFamily }"
|
||||||
|
:append-to-body="false"
|
||||||
|
>
|
||||||
<el-dropdown-item
|
<el-dropdown-item
|
||||||
v-for="(item, key) in trackMenu"
|
v-for="(item, key) in trackMenu"
|
||||||
:key="key"
|
:key="key"
|
||||||
@ -27,6 +31,11 @@ const props = defineProps({
|
|||||||
trackMenu: {
|
trackMenu: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true
|
required: true
|
||||||
|
},
|
||||||
|
fontFamily: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: 'inherit'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const { trackMenu } = toRefs(props)
|
const { trackMenu } = toRefs(props)
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
<el-icon v-if="isEdit"><ArrowDown /></el-icon>
|
<el-icon v-if="isEdit"><ArrowDown /></el-icon>
|
||||||
</span>
|
</span>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu :style="{ 'font-family': fontFamily }">
|
||||||
<el-dropdown-item :command="beforeHandleCommand('editTitle', tabItem)">
|
<el-dropdown-item :command="beforeHandleCommand('editTitle', tabItem)">
|
||||||
编辑标题
|
编辑标题
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
@ -77,6 +77,7 @@
|
|||||||
:canvas-id="element.id + '--' + tabItem.name"
|
:canvas-id="element.id + '--' + tabItem.name"
|
||||||
:class="moveActive ? 'canvas-move-in' : ''"
|
:class="moveActive ? 'canvas-move-in' : ''"
|
||||||
:canvas-active="editableTabsValue === tabItem.name"
|
:canvas-active="editableTabsValue === tabItem.name"
|
||||||
|
:font-family="fontFamily"
|
||||||
></de-canvas>
|
></de-canvas>
|
||||||
<de-preview
|
<de-preview
|
||||||
v-else
|
v-else
|
||||||
@ -90,6 +91,7 @@
|
|||||||
:preview-active="editableTabsValue === tabItem.name"
|
:preview-active="editableTabsValue === tabItem.name"
|
||||||
:show-position="showPosition"
|
:show-position="showPosition"
|
||||||
:outer-scale="scale"
|
:outer-scale="scale"
|
||||||
|
:font-family="fontFamily"
|
||||||
:outer-search-count="searchCount"
|
:outer-search-count="searchCount"
|
||||||
></de-preview>
|
></de-preview>
|
||||||
</div>
|
</div>
|
||||||
@ -190,6 +192,12 @@ const props = defineProps({
|
|||||||
type: Number,
|
type: Number,
|
||||||
required: false,
|
required: false,
|
||||||
default: 0
|
default: 0
|
||||||
|
},
|
||||||
|
// 仪表板字体
|
||||||
|
fontFamily: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: 'inherit'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const {
|
const {
|
||||||
@ -566,6 +574,9 @@ onBeforeMount(() => {
|
|||||||
:deep(.ed-tabs__content) {
|
:deep(.ed-tabs__content) {
|
||||||
height: calc(100% - 46px) !important;
|
height: calc(100% - 46px) !important;
|
||||||
}
|
}
|
||||||
|
:deep(.ed-tabs__item) {
|
||||||
|
font-family: inherit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.ed-tabs-dark {
|
.ed-tabs-dark {
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
/>
|
/>
|
||||||
<div v-else class="pic-upload">
|
<div v-else class="pic-upload">
|
||||||
<span
|
<span
|
||||||
><el-button @click="uploadImg" text style="color: #646a73" icon="Plus"
|
><el-button @click="uploadImg" text style="font-family: inherit; color: #646a73" icon="Plus"
|
||||||
>请上传图片...</el-button
|
>请上传图片...</el-button
|
||||||
></span
|
></span
|
||||||
>
|
>
|
||||||
|
@ -58,6 +58,11 @@ const props = defineProps({
|
|||||||
type: String,
|
type: String,
|
||||||
required: false,
|
required: false,
|
||||||
default: 'common'
|
default: 'common'
|
||||||
|
},
|
||||||
|
fontFamily: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: 'inherit'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -87,6 +92,7 @@ const onPointClick = param => {
|
|||||||
:search-count="searchCount"
|
:search-count="searchCount"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
:suffixId="suffixId"
|
:suffixId="suffixId"
|
||||||
|
:font-family="fontFamily"
|
||||||
@onPointClick="onPointClick"
|
@onPointClick="onPointClick"
|
||||||
></chart>
|
></chart>
|
||||||
</div>
|
</div>
|
||||||
|
@ -698,6 +698,7 @@ const autoStyle = computed(() => {
|
|||||||
<el-button
|
<el-button
|
||||||
:disabled="showPosition === 'preview' || mobileInPc"
|
:disabled="showPosition === 'preview' || mobileInPc"
|
||||||
@click="addCriteriaConfigOut"
|
@click="addCriteriaConfigOut"
|
||||||
|
style="font-family: inherit"
|
||||||
text
|
text
|
||||||
>
|
>
|
||||||
{{ t('v_query.add_query_condition') }}
|
{{ t('v_query.add_query_condition') }}
|
||||||
@ -825,7 +826,6 @@ const autoStyle = computed(() => {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
color: #646a73;
|
color: #646a73;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-family: var(--de-custom_font, 'PingFang');
|
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
@ -900,7 +900,6 @@ const autoStyle = computed(() => {
|
|||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
color: #1f2329;
|
color: #1f2329;
|
||||||
font-family: var(--de-custom_font, 'PingFang');
|
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
@ -167,6 +167,13 @@ onBeforeMount(() => {
|
|||||||
v-model="selectValue"
|
v-model="selectValue"
|
||||||
:type="config.timeGranularity"
|
:type="config.timeGranularity"
|
||||||
:prefix-icon="Calendar"
|
:prefix-icon="Calendar"
|
||||||
|
:popper-class="'custom-dynamic-time-popper_class'"
|
||||||
:placeholder="$t('commons.date.select_date_time')"
|
:placeholder="$t('commons.date.select_date_time')"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
.custom-dynamic-time-popper_class {
|
||||||
|
font-family: var(--de-canvas_custom_font);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@ -170,8 +170,14 @@ const formatDate = computed(() => {
|
|||||||
:type="config.timeGranularityMultiple"
|
:type="config.timeGranularityMultiple"
|
||||||
:prefix-icon="Calendar"
|
:prefix-icon="Calendar"
|
||||||
:format="formatDate"
|
:format="formatDate"
|
||||||
|
:popper-class="'custom-dynamic-time-range-popper_class'"
|
||||||
:range-separator="$t('cron.to')"
|
:range-separator="$t('cron.to')"
|
||||||
:start-placeholder="$t('datasource.start_time')"
|
:start-placeholder="$t('datasource.start_time')"
|
||||||
:end-placeholder="$t('datasource.end_time')"
|
:end-placeholder="$t('datasource.end_time')"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
<style lang="less">
|
||||||
|
.custom-dynamic-time-range-popper_class {
|
||||||
|
font-family: var(--de-canvas_custom_font);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@ -147,8 +147,15 @@ const formatDate = computed(() => {
|
|||||||
:type="timeInterval"
|
:type="timeInterval"
|
||||||
:prefix-icon="Calendar"
|
:prefix-icon="Calendar"
|
||||||
:format="formatDate"
|
:format="formatDate"
|
||||||
|
:popper-class="'custom-dynamic-time-range-filter-popper_class'"
|
||||||
:range-separator="$t('cron.to')"
|
:range-separator="$t('cron.to')"
|
||||||
:start-placeholder="$t('datasource.start_time')"
|
:start-placeholder="$t('datasource.start_time')"
|
||||||
:end-placeholder="$t('datasource.end_time')"
|
:end-placeholder="$t('datasource.end_time')"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
.custom-dynamic-time-range-filter-popper_class {
|
||||||
|
font-family: var(--de-canvas_custom_font);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@ -648,6 +648,7 @@ defineExpose({
|
|||||||
<style lang="less">
|
<style lang="less">
|
||||||
.filter-select-popper_class {
|
.filter-select-popper_class {
|
||||||
--ed-fill-color-light: #f5f7fa47;
|
--ed-fill-color-light: #f5f7fa47;
|
||||||
|
font-family: var(--de-canvas_custom_font);
|
||||||
.ed-vl__window.ed-select-dropdown__list {
|
.ed-vl__window.ed-select-dropdown__list {
|
||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
}
|
}
|
||||||
|
@ -348,7 +348,11 @@ export function initCanvasDataPrepare(dvId, busiFlag, callBack) {
|
|||||||
dvInfo.type === 'dashboard' && canvasStyleResult['dashboard'].gap === 'yes'
|
dvInfo.type === 'dashboard' && canvasStyleResult['dashboard'].gap === 'yes'
|
||||||
? canvasStyleResult['dashboard'].gapSize
|
? canvasStyleResult['dashboard'].gapSize
|
||||||
: 0
|
: 0
|
||||||
appearanceStore.setCurrentFont(canvasStyleData.fontFamily)
|
appearanceStore.setCurrentFont(canvasStyleResult.fontFamily)
|
||||||
|
document.documentElement.style.setProperty(
|
||||||
|
'--de-canvas_custom_font',
|
||||||
|
`${canvasStyleResult.fontFamily}`
|
||||||
|
)
|
||||||
callBack({ canvasDataResult, canvasStyleResult, dvInfo, canvasViewInfoPreview, curPreviewGap })
|
callBack({ canvasDataResult, canvasStyleResult, dvInfo, canvasViewInfoPreview, curPreviewGap })
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,12 @@ const props = defineProps({
|
|||||||
type: Number,
|
type: Number,
|
||||||
required: false,
|
required: false,
|
||||||
default: 1
|
default: 1
|
||||||
|
},
|
||||||
|
// 仪表板字体
|
||||||
|
fontFamily: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: 'inherit'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const { canvasStyleData, componentData, canvasViewInfo, canvasId, canvasActive, outerScale } =
|
const { canvasStyleData, componentData, canvasViewInfo, canvasId, canvasActive, outerScale } =
|
||||||
@ -321,6 +327,7 @@ defineExpose({
|
|||||||
:base-margin-top="baseMarginTop"
|
:base-margin-top="baseMarginTop"
|
||||||
:base-width="baseWidth"
|
:base-width="baseWidth"
|
||||||
:base-height="baseHeight"
|
:base-height="baseHeight"
|
||||||
|
:font-family="fontFamily"
|
||||||
@scrollCanvasToTop="scrollTo(1)"
|
@scrollCanvasToTop="scrollTo(1)"
|
||||||
></canvas-core>
|
></canvas-core>
|
||||||
</div>
|
</div>
|
||||||
|
@ -68,6 +68,11 @@ const props = defineProps({
|
|||||||
type: String,
|
type: String,
|
||||||
required: false,
|
required: false,
|
||||||
default: 'common'
|
default: 'common'
|
||||||
|
},
|
||||||
|
fontFamily: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: 'inherit'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -568,6 +573,7 @@ onBeforeUnmount(() => {
|
|||||||
<view-track-bar
|
<view-track-bar
|
||||||
ref="viewTrack"
|
ref="viewTrack"
|
||||||
:track-menu="trackMenu"
|
:track-menu="trackMenu"
|
||||||
|
:font-family="fontFamily"
|
||||||
class="track-bar"
|
class="track-bar"
|
||||||
:style="state.trackBarStyle"
|
:style="state.trackBarStyle"
|
||||||
@trackClick="trackClick"
|
@trackClick="trackClick"
|
||||||
|
@ -83,6 +83,11 @@ const props = defineProps({
|
|||||||
type: String,
|
type: String,
|
||||||
required: false,
|
required: false,
|
||||||
default: 'common'
|
default: 'common'
|
||||||
|
},
|
||||||
|
fontFamily: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: 'inherit'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -659,6 +664,7 @@ const tablePageClass = computed(() => {
|
|||||||
<view-track-bar
|
<view-track-bar
|
||||||
ref="viewTrack"
|
ref="viewTrack"
|
||||||
:track-menu="trackMenu"
|
:track-menu="trackMenu"
|
||||||
|
:font-family="fontFamily"
|
||||||
class="track-bar"
|
class="track-bar"
|
||||||
:style="state.trackBarStyle"
|
:style="state.trackBarStyle"
|
||||||
@trackClick="trackClick"
|
@trackClick="trackClick"
|
||||||
|
@ -130,6 +130,11 @@ const props = defineProps({
|
|||||||
type: String,
|
type: String,
|
||||||
required: false,
|
required: false,
|
||||||
default: 'common'
|
default: 'common'
|
||||||
|
},
|
||||||
|
fontFamily: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: 'inherit'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const dynamicAreaId = ref('')
|
const dynamicAreaId = ref('')
|
||||||
|
@ -273,6 +273,7 @@ onUnmounted(() => {
|
|||||||
:component-data="componentData"
|
:component-data="componentData"
|
||||||
:canvas-style-data="canvasStyleData"
|
:canvas-style-data="canvasStyleData"
|
||||||
:canvas-view-info="canvasViewInfo"
|
:canvas-view-info="canvasViewInfo"
|
||||||
|
:font-family="canvasStyleData.fontFamily"
|
||||||
></de-canvas>
|
></de-canvas>
|
||||||
</main>
|
</main>
|
||||||
<!-- 右侧侧组件列表 -->
|
<!-- 右侧侧组件列表 -->
|
||||||
|
@ -20,6 +20,7 @@ const state = reactive({
|
|||||||
:component-data="componentData"
|
:component-data="componentData"
|
||||||
:canvas-style-data="canvasStyleData"
|
:canvas-style-data="canvasStyleData"
|
||||||
:canvas-view-info="canvasViewInfo"
|
:canvas-view-info="canvasViewInfo"
|
||||||
|
:font-family="canvasStyleData.fontFamily"
|
||||||
></de-canvas>
|
></de-canvas>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
Reference in New Issue
Block a user