Merge pull request #6045 from dataease/pr@dev@fix_font_family

Merge branch 'dev' into pr@dev@fix_font_family
This commit is contained in:
wisonic-s 2023-09-06 21:47:11 +08:00 committed by GitHub
commit cde0419330
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 236 additions and 214 deletions

View File

@ -1466,6 +1466,7 @@ export default {
dimension_text_style: 'Name Style', dimension_text_style: 'Name Style',
dimension_letter_space: 'Name Letter Space', dimension_letter_space: 'Name Letter Space',
font_family: 'Font Family', font_family: 'Font Family',
font_family_tip: 'The font will only take effect if it is installed on the operating system',
letter_space: 'Letter Space', letter_space: 'Letter Space',
font_shadow: 'Font Shadow', font_shadow: 'Font Shadow',
chart_area: 'Area', chart_area: 'Area',

View File

@ -1465,6 +1465,7 @@ export default {
dimension_text_style: '名稱樣式', dimension_text_style: '名稱樣式',
dimension_letter_space: '名稱字間距', dimension_letter_space: '名稱字間距',
font_family: '字體', font_family: '字體',
font_family_tip: '只有操作系統上已安裝該字體才能生效',
letter_space: '字間距', letter_space: '字間距',
font_shadow: '字體陰影', font_shadow: '字體陰影',
chart_area: '面積圖', chart_area: '面積圖',

View File

@ -1464,6 +1464,7 @@ export default {
dimension_text_style: '名称样式', dimension_text_style: '名称样式',
dimension_letter_space: '名称字间距', dimension_letter_space: '名称字间距',
font_family: '字体', font_family: '字体',
font_family_tip: '只有操作系统上已安装该字体才能生效',
letter_space: '字间距', letter_space: '字间距',
font_shadow: '字体阴影', font_shadow: '字体阴影',
chart_area: '面积图', chart_area: '面积图',

View File

@ -1146,6 +1146,13 @@ export const CHART_FONT_FAMILY = [
{ name: '楷体', value: 'KaiTi' } { name: '楷体', value: 'KaiTi' }
] ]
export const CHART_CONT_FAMILY_MAP = {
'Microsoft YaHei': 'Microsoft YaHei',
'SimSun': 'SimSun, "Songti SC", STSong',
'SimHei': 'SimHei, Helvetica',
'KaiTi': 'KaiTi, "Kaiti SC", STKaiti'
}
export const CHART_FONT_LETTER_SPACE = [ export const CHART_FONT_LETTER_SPACE = [
{ name: '0px', value: '0' }, { name: '0px', value: '0' },
{ name: '1px', value: '1' }, { name: '1px', value: '1' },

View File

@ -55,7 +55,7 @@ import { baseRadarOptionAntV } from '@/views/chart/chart/radar/radar_antv'
import { baseWaterfallOptionAntV } from '@/views/chart/chart/waterfall/waterfall' import { baseWaterfallOptionAntV } from '@/views/chart/chart/waterfall/waterfall'
import { baseWordCloudOptionAntV } from '@/views/chart/chart/wordCloud/word_cloud' import { baseWordCloudOptionAntV } from '@/views/chart/chart/wordCloud/word_cloud'
import TitleRemark from '@/views/chart/view/TitleRemark' import TitleRemark from '@/views/chart/view/TitleRemark'
import { DEFAULT_TITLE_STYLE } from '@/views/chart/chart/chart' import { CHART_CONT_FAMILY_MAP, DEFAULT_TITLE_STYLE } from '@/views/chart/chart/chart'
import { baseMixOptionAntV } from '@/views/chart/chart/mix/mix_antv' import { baseMixOptionAntV } from '@/views/chart/chart/mix/mix_antv'
import ChartTitleUpdate from './ChartTitleUpdate.vue' import ChartTitleUpdate from './ChartTitleUpdate.vue'
import { equalsAny } from '@/utils/StringUtils' import { equalsAny } from '@/utils/StringUtils'
@ -429,7 +429,7 @@ export default {
this.title_class.fontStyle = customStyle.text.isItalic ? 'italic' : 'normal' this.title_class.fontStyle = customStyle.text.isItalic ? 'italic' : 'normal'
this.title_class.fontWeight = customStyle.text.isBolder ? 'bold' : 'normal' this.title_class.fontWeight = customStyle.text.isBolder ? 'bold' : 'normal'
this.title_class.fontFamily = customStyle.text.fontFamily ? customStyle.text.fontFamily : DEFAULT_TITLE_STYLE.fontFamily this.title_class.fontFamily = customStyle.text.fontFamily ? CHART_CONT_FAMILY_MAP[customStyle.text.fontFamily] : DEFAULT_TITLE_STYLE.fontFamily
this.title_class.letterSpacing = (customStyle.text.letterSpace ? customStyle.text.letterSpace : DEFAULT_TITLE_STYLE.letterSpace) + 'px' this.title_class.letterSpacing = (customStyle.text.letterSpace ? customStyle.text.letterSpace : DEFAULT_TITLE_STYLE.letterSpace) + 'px'
this.title_class.textShadow = customStyle.text.fontShadow ? '2px 2px 4px' : 'none' this.title_class.textShadow = customStyle.text.fontShadow ? '2px 2px 4px' : 'none'
} }

View File

@ -97,7 +97,7 @@ import ViewTrackBar from '@/components/canvas/components/editor/ViewTrackBar'
import { getRemark, hexColorToRGBA } from '@/views/chart/chart/util' import { getRemark, hexColorToRGBA } from '@/views/chart/chart/util'
import { baseTableInfo, baseTableNormal, baseTablePivot } from '@/views/chart/chart/table/table-info' import { baseTableInfo, baseTableNormal, baseTablePivot } from '@/views/chart/chart/table/table-info'
import TitleRemark from '@/views/chart/view/TitleRemark' import TitleRemark from '@/views/chart/view/TitleRemark'
import { DEFAULT_TITLE_STYLE, NOT_SUPPORT_PAGE_DATASET } from '@/views/chart/chart/chart' import { CHART_CONT_FAMILY_MAP, DEFAULT_TITLE_STYLE, NOT_SUPPORT_PAGE_DATASET } from '@/views/chart/chart/chart'
import ChartTitleUpdate from './ChartTitleUpdate.vue' import ChartTitleUpdate from './ChartTitleUpdate.vue'
import { mapState } from 'vuex' import { mapState } from 'vuex'
import DePagination from '@/components/deCustomCm/pagination.js' import DePagination from '@/components/deCustomCm/pagination.js'
@ -459,7 +459,7 @@ export default {
this.$refs.title.style.fontSize = customStyle.text.fontSize + 'px' this.$refs.title.style.fontSize = customStyle.text.fontSize + 'px'
} }
this.title_class.fontFamily = customStyle.text.fontFamily ? customStyle.text.fontFamily : DEFAULT_TITLE_STYLE.fontFamily this.title_class.fontFamily = customStyle.text.fontFamily ? CHART_CONT_FAMILY_MAP[customStyle.text.fontFamily] : DEFAULT_TITLE_STYLE.fontFamily
this.title_class.letterSpacing = (customStyle.text.letterSpace ? customStyle.text.letterSpace : DEFAULT_TITLE_STYLE.letterSpace) + 'px' this.title_class.letterSpacing = (customStyle.text.letterSpace ? customStyle.text.letterSpace : DEFAULT_TITLE_STYLE.letterSpace) + 'px'
this.title_class.textShadow = customStyle.text.fontShadow ? '2px 2px 4px' : 'none' this.title_class.textShadow = customStyle.text.fontShadow ? '2px 2px 4px' : 'none'
// //

View File

@ -50,6 +50,20 @@
:value="option.value" :value="option.value"
/> />
</el-select> </el-select>
<el-tooltip
class="item"
effect="dark"
placement="bottom"
>
<div
slot="content"
v-html="$t('chart.font_family_tip')"
/>
<i
class="el-icon-info"
style="cursor: pointer;color: #606266;margin-left: 4px;"
/>
</el-tooltip>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
v-show="showProperty('fontSize')" v-show="showProperty('fontSize')"

View File

@ -51,6 +51,20 @@
:value="option.value" :value="option.value"
/> />
</el-select> </el-select>
<el-tooltip
class="item"
effect="dark"
placement="bottom"
>
<div
slot="content"
v-html="$t('chart.font_family_tip')"
/>
<i
class="el-icon-info"
style="cursor: pointer;color: #606266;margin-left: 4px;"
/>
</el-tooltip>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
v-show="showProperty('fontSize')" v-show="showProperty('fontSize')"

View File

@ -49,7 +49,7 @@ import { getRemark, hexColorToRGBA } from '../../chart/util'
import eventBus from '@/components/canvas/utils/eventBus' import eventBus from '@/components/canvas/utils/eventBus'
import { formatterItem, valueFormatter } from '@/views/chart/chart/formatter' import { formatterItem, valueFormatter } from '@/views/chart/chart/formatter'
import TitleRemark from '@/views/chart/view/TitleRemark' import TitleRemark from '@/views/chart/view/TitleRemark'
import { DEFAULT_SIZE, DEFAULT_TITLE_STYLE } from '@/views/chart/chart/chart' import { CHART_CONT_FAMILY_MAP, DEFAULT_SIZE, DEFAULT_TITLE_STYLE } from '@/views/chart/chart/chart'
import ChartTitleUpdate from '../ChartTitleUpdate.vue' import ChartTitleUpdate from '../ChartTitleUpdate.vue'
export default { export default {
@ -209,7 +209,7 @@ export default {
this.title_class.fontStyle = customStyle.text.isItalic ? 'italic' : 'normal' this.title_class.fontStyle = customStyle.text.isItalic ? 'italic' : 'normal'
this.title_class.fontWeight = customStyle.text.isBolder ? 'bold' : 'normal' this.title_class.fontWeight = customStyle.text.isBolder ? 'bold' : 'normal'
this.title_class.fontFamily = customStyle.text.fontFamily ? customStyle.text.fontFamily : DEFAULT_TITLE_STYLE.fontFamily this.title_class.fontFamily = customStyle.text.fontFamily ? CHART_CONT_FAMILY_MAP[customStyle.text.fontFamily] : DEFAULT_TITLE_STYLE.fontFamily
this.title_class.letterSpacing = (customStyle.text.letterSpace ? customStyle.text.letterSpace : DEFAULT_TITLE_STYLE.letterSpace) + 'px' this.title_class.letterSpacing = (customStyle.text.letterSpace ? customStyle.text.letterSpace : DEFAULT_TITLE_STYLE.letterSpace) + 'px'
this.title_class.textShadow = customStyle.text.fontShadow ? '2px 2px 4px' : 'none' this.title_class.textShadow = customStyle.text.fontShadow ? '2px 2px 4px' : 'none'
} }

View File

@ -61,7 +61,7 @@ import { getRemark, hexColorToRGBA } from '../../chart/util'
import eventBus from '@/components/canvas/utils/eventBus' import eventBus from '@/components/canvas/utils/eventBus'
import ViewTrackBar from '@/components/canvas/components/editor/ViewTrackBar' import ViewTrackBar from '@/components/canvas/components/editor/ViewTrackBar'
import TitleRemark from '@/views/chart/view/TitleRemark' import TitleRemark from '@/views/chart/view/TitleRemark'
import { DEFAULT_SIZE, DEFAULT_TITLE_STYLE } from '@/views/chart/chart/chart' import { CHART_CONT_FAMILY_MAP, DEFAULT_SIZE, DEFAULT_TITLE_STYLE } from '@/views/chart/chart/chart'
import ChartTitleUpdate from '../ChartTitleUpdate.vue' import ChartTitleUpdate from '../ChartTitleUpdate.vue'
export default { export default {
@ -236,7 +236,7 @@ export default {
this.title_class.fontStyle = customStyle.text.isItalic ? 'italic' : 'normal' this.title_class.fontStyle = customStyle.text.isItalic ? 'italic' : 'normal'
this.title_class.fontWeight = customStyle.text.isBolder ? 'bold' : 'normal' this.title_class.fontWeight = customStyle.text.isBolder ? 'bold' : 'normal'
this.title_class.fontFamily = customStyle.text.fontFamily ? customStyle.text.fontFamily : DEFAULT_TITLE_STYLE.fontFamily this.title_class.fontFamily = customStyle.text.fontFamily ? CHART_CONT_FAMILY_MAP[customStyle.text.fontFamily] : DEFAULT_TITLE_STYLE.fontFamily
this.title_class.letterSpacing = (customStyle.text.letterSpace ? customStyle.text.letterSpace : DEFAULT_TITLE_STYLE.letterSpace) + 'px' this.title_class.letterSpacing = (customStyle.text.letterSpace ? customStyle.text.letterSpace : DEFAULT_TITLE_STYLE.letterSpace) + 'px'
this.title_class.textShadow = customStyle.text.fontShadow ? '2px 2px 4px' : 'none' this.title_class.textShadow = customStyle.text.fontShadow ? '2px 2px 4px' : 'none'
} }

View File

@ -524,242 +524,242 @@
> >
<div v-show="!batchOptStatus"> <div v-show="!batchOptStatus">
<el-form-item <el-form-item
v-show="showProperty('gaugeMin')" v-show="showProperty('gaugeMin')"
:label="$t('chart.min')" :label="$t('chart.min')"
class="form-item" class="form-item"
> >
<el-radio-group <el-radio-group
v-model="sizeForm.gaugeMinType" v-model="sizeForm.gaugeMinType"
size="mini" size="mini"
@change="changeQuotaField('min')" @change="changeQuotaField('min')"
> >
<el-radio-button label="fix">{{ $t('chart.fix') }}</el-radio-button> <el-radio-button label="fix">{{ $t('chart.fix') }}</el-radio-button>
<el-radio-button label="dynamic">{{ $t('chart.dynamic') }}</el-radio-button> <el-radio-button label="dynamic">{{ $t('chart.dynamic') }}</el-radio-button>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
v-if="showProperty('gaugeMin') && sizeForm.gaugeMinType === 'fix'" v-if="showProperty('gaugeMin') && sizeForm.gaugeMinType === 'fix'"
class="form-item form-item-slider" class="form-item form-item-slider"
> >
<el-input-number <el-input-number
v-model="sizeForm.gaugeMin" v-model="sizeForm.gaugeMin"
size="mini" size="mini"
@change="changeBarSizeCase('gaugeMin')" @change="changeBarSizeCase('gaugeMin')"
/> />
</el-form-item> </el-form-item>
<el-form-item <el-form-item
v-if="showProperty('gaugeMin') && sizeForm.gaugeMinType === 'dynamic'" v-if="showProperty('gaugeMin') && sizeForm.gaugeMinType === 'dynamic'"
class="form-item form-flex" class="form-item form-flex"
> >
<el-select <el-select
v-model="sizeForm.gaugeMinField.id" v-model="sizeForm.gaugeMinField.id"
:placeholder="$t('chart.field')" :placeholder="$t('chart.field')"
@change="changeQuotaField('min',true)" @change="changeQuotaField('min',true)"
> >
<el-option <el-option
v-for="item in quotaData" v-for="item in quotaData"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id" :value="item.id"
> >
<span style="float: left"> <span style="float: left">
<svg-icon <svg-icon
v-if="item.deType === 0" v-if="item.deType === 0"
icon-class="field_text" icon-class="field_text"
class="field-icon-text" class="field-icon-text"
/> />
<svg-icon <svg-icon
v-if="item.deType === 1" v-if="item.deType === 1"
icon-class="field_time" icon-class="field_time"
class="field-icon-time" class="field-icon-time"
/> />
<svg-icon <svg-icon
v-if="item.deType === 2 || item.deType === 3" v-if="item.deType === 2 || item.deType === 3"
icon-class="field_value" icon-class="field_value"
class="field-icon-value" class="field-icon-value"
/> />
<svg-icon <svg-icon
v-if="item.deType === 5" v-if="item.deType === 5"
icon-class="field_location" icon-class="field_location"
class="field-icon-location" class="field-icon-location"
/> />
</span> </span>
<span style="float: left; color: #8492a6; font-size: 12px">{{ item.name }}</span> <span style="float: left; color: #8492a6; font-size: 12px">{{ item.name }}</span>
</el-option> </el-option>
</el-select> </el-select>
<el-select <el-select
v-model="sizeForm.gaugeMinField.summary" v-model="sizeForm.gaugeMinField.summary"
:placeholder="$t('chart.summary')" :placeholder="$t('chart.summary')"
@change="changeQuotaField('min')" @change="changeQuotaField('min')"
> >
<el-option <el-option
v-if="validMinField" v-if="validMinField"
key="sum" key="sum"
value="sum" value="sum"
:label="$t('chart.sum')" :label="$t('chart.sum')"
/> />
<el-option <el-option
v-if="validMinField" v-if="validMinField"
key="avg" key="avg"
value="avg" value="avg"
:label="$t('chart.avg')" :label="$t('chart.avg')"
/> />
<el-option <el-option
v-if="validMinField" v-if="validMinField"
key="max" key="max"
value="max" value="max"
:label="$t('chart.max')" :label="$t('chart.max')"
/> />
<el-option <el-option
v-if="validMinField" v-if="validMinField"
key="min" key="min"
value="min" value="min"
:label="$t('chart.min')" :label="$t('chart.min')"
/> />
<el-option <el-option
v-if="validMinField" v-if="validMinField"
key="stddev_pop" key="stddev_pop"
value="stddev_pop" value="stddev_pop"
:label="$t('chart.stddev_pop')" :label="$t('chart.stddev_pop')"
/> />
<el-option <el-option
v-if="validMinField" v-if="validMinField"
key="var_pop" key="var_pop"
value="var_pop" value="var_pop"
:label="$t('chart.var_pop')" :label="$t('chart.var_pop')"
/> />
<el-option <el-option
key="count" key="count"
value="count" value="count"
:label="$t('chart.count')" :label="$t('chart.count')"
/> />
<el-option <el-option
v-if="minField.id !== 'count'" v-if="minField.id !== 'count'"
key="count_distinct" key="count_distinct"
value="count_distinct" value="count_distinct"
:label="$t('chart.count_distinct')" :label="$t('chart.count_distinct')"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
v-show="showProperty('gaugeMax')" v-show="showProperty('gaugeMax')"
:label="$t('chart.max')" :label="$t('chart.max')"
class="form-item" class="form-item"
> >
<el-radio-group <el-radio-group
v-model="sizeForm.gaugeMaxType" v-model="sizeForm.gaugeMaxType"
size="mini" size="mini"
@change="changeQuotaField('max')" @change="changeQuotaField('max')"
> >
<el-radio-button label="fix">{{ $t('chart.fix') }}</el-radio-button> <el-radio-button label="fix">{{ $t('chart.fix') }}</el-radio-button>
<el-radio-button label="dynamic">{{ $t('chart.dynamic') }}</el-radio-button> <el-radio-button label="dynamic">{{ $t('chart.dynamic') }}</el-radio-button>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
v-if="showProperty('gaugeMax') && sizeForm.gaugeMaxType === 'fix'" v-if="showProperty('gaugeMax') && sizeForm.gaugeMaxType === 'fix'"
class="form-item form-item-slider" class="form-item form-item-slider"
> >
<el-input-number <el-input-number
v-model="sizeForm.gaugeMax" v-model="sizeForm.gaugeMax"
size="mini" size="mini"
@change="changeBarSizeCase('gaugeMax')" @change="changeBarSizeCase('gaugeMax')"
/> />
</el-form-item> </el-form-item>
<el-form-item <el-form-item
v-if="showProperty('gaugeMax') && sizeForm.gaugeMaxType === 'dynamic'" v-if="showProperty('gaugeMax') && sizeForm.gaugeMaxType === 'dynamic'"
class="form-item form-flex" class="form-item form-flex"
>
<el-select
v-model="sizeForm.gaugeMaxField.id"
:placeholder="$t('chart.field')"
@change="changeQuotaField('max',true)"
> >
<el-option <el-select
v-for="item in quotaData" v-model="sizeForm.gaugeMaxField.id"
:key="item.id" :placeholder="$t('chart.field')"
:label="item.name" @change="changeQuotaField('max',true)"
:value="item.id"
> >
<span style="float: left"> <el-option
<svg-icon v-for="item in quotaData"
v-if="item.deType === 0" :key="item.id"
icon-class="field_text" :label="item.name"
class="field-icon-text" :value="item.id"
/> >
<svg-icon <span style="float: left">
v-if="item.deType === 1" <svg-icon
icon-class="field_time" v-if="item.deType === 0"
class="field-icon-time" icon-class="field_text"
/> class="field-icon-text"
<svg-icon />
v-if="item.deType === 2 || item.deType === 3" <svg-icon
icon-class="field_value" v-if="item.deType === 1"
class="field-icon-value" icon-class="field_time"
/> class="field-icon-time"
<svg-icon />
v-if="item.deType === 5" <svg-icon
icon-class="field_location" v-if="item.deType === 2 || item.deType === 3"
class="field-icon-location" icon-class="field_value"
/> class="field-icon-value"
</span> />
<span style="float: left; color: #8492a6; font-size: 12px">{{ item.name }}</span> <svg-icon
</el-option> v-if="item.deType === 5"
</el-select> icon-class="field_location"
<el-select class="field-icon-location"
v-model="sizeForm.gaugeMaxField.summary" />
:placeholder="$t('chart.summary')" </span>
@change="changeQuotaField('max')" <span style="float: left; color: #8492a6; font-size: 12px">{{ item.name }}</span>
> </el-option>
<el-option </el-select>
v-if="validMaxField" <el-select
key="sum" v-model="sizeForm.gaugeMaxField.summary"
value="sum" :placeholder="$t('chart.summary')"
:label="$t('chart.sum')" @change="changeQuotaField('max')"
/> >
<el-option <el-option
v-if="validMaxField" v-if="validMaxField"
key="avg" key="sum"
value="avg" value="sum"
:label="$t('chart.avg')" :label="$t('chart.sum')"
/> />
<el-option <el-option
v-if="validMaxField" v-if="validMaxField"
key="max" key="avg"
value="max" value="avg"
:label="$t('chart.max')" :label="$t('chart.avg')"
/> />
<el-option <el-option
v-if="validMaxField" v-if="validMaxField"
key="min" key="max"
value="min" value="max"
:label="$t('chart.min')" :label="$t('chart.max')"
/> />
<el-option <el-option
v-if="validMaxField" v-if="validMaxField"
key="stddev_pop" key="min"
value="stddev_pop" value="min"
:label="$t('chart.stddev_pop')" :label="$t('chart.min')"
/> />
<el-option <el-option
v-if="validMaxField" v-if="validMaxField"
key="var_pop" key="stddev_pop"
value="var_pop" value="stddev_pop"
:label="$t('chart.var_pop')" :label="$t('chart.stddev_pop')"
/> />
<el-option <el-option
key="count" v-if="validMaxField"
value="count" key="var_pop"
:label="$t('chart.count')" value="var_pop"
/> :label="$t('chart.var_pop')"
<el-option />
v-if="maxField.id !== 'count'" <el-option
key="count_distinct" key="count"
value="count_distinct" value="count"
:label="$t('chart.count_distinct')" :label="$t('chart.count')"
/> />
</el-select> <el-option
</el-form-item> v-if="maxField.id !== 'count'"
key="count_distinct"
value="count_distinct"
:label="$t('chart.count_distinct')"
/>
</el-select>
</el-form-item>
</div> </div>
<el-form-item <el-form-item

View File

@ -140,6 +140,12 @@ export default {
}, },
linkageActiveParam: null, linkageActiveParam: null,
linkageActiveHistory: false, linkageActiveHistory: false,
CHART_CONT_FAMILY_MAP: {
'Microsoft YaHei': 'Microsoft YaHei',
'SimSun': 'SimSun, "Songti SC", STSong',
'SimHei': 'SimHei, Helvetica',
'KaiTi': 'KaiTi, "Kaiti SC", STKaiti'
}
} }
}, },
@ -248,7 +254,7 @@ export default {
this.titleClass.fontWeight = customStyle.text.isBolder ? 'bold' : 'normal' this.titleClass.fontWeight = customStyle.text.isBolder ? 'bold' : 'normal'
this.titleClass.fontSize = customStyle.text.isBolder ? 'bold' : 'normal' this.titleClass.fontSize = customStyle.text.isBolder ? 'bold' : 'normal'
this.titleClass.fontFamily = customStyle.text.fontFamily ? customStyle.text.fontFamily : 'Microsoft YaHei' this.titleClass.fontFamily = customStyle.text.fontFamily ? this.CHART_CONT_FAMILY_MAP[customStyle.text.fontFamily] : 'Microsoft YaHei'
this.titleClass.letterSpacing = (customStyle.text.letterSpace ? customStyle.text.letterSpace : '0') + 'px' this.titleClass.letterSpacing = (customStyle.text.letterSpace ? customStyle.text.letterSpace : '0') + 'px'
this.titleClass.textShadow = customStyle.text.fontShadow ? '2px 2px 4px' : 'none' this.titleClass.textShadow = customStyle.text.fontShadow ? '2px 2px 4px' : 'none'
} }
@ -257,23 +263,6 @@ export default {
this.borderRadius = (customStyle.background.borderRadius || 0) + 'px' this.borderRadius = (customStyle.background.borderRadius || 0) + 'px'
} }
if (customStyle.text) {
this.title_show = customStyle.text.show
this.title_class.fontSize = customStyle.text.fontSize + 'px'
this.title_class.color = customStyle.text.color
this.title_class.textAlign = customStyle.text.hPosition
this.title_class.fontStyle = customStyle.text.isItalic ? 'italic' : 'normal'
this.title_class.fontWeight = customStyle.text.isBolder ? 'bold' : 'normal'
this.title_class.fontFamily = customStyle.text.fontFamily ? customStyle.text.fontFamily : DEFAULT_TITLE_STYLE.fontFamily
this.title_class.letterSpacing = (customStyle.text.letterSpace ? customStyle.text.letterSpace : DEFAULT_TITLE_STYLE.letterSpace) + 'px'
this.title_class.textShadow = customStyle.text.fontShadow ? '2px 2px 4px' : 'none'
}
if (customStyle.background) {
this.title_class.background = hexColorToRGBA(customStyle.background.color, customStyle.background.alpha)
this.borderRadius = (customStyle.background.borderRadius || 0) + 'px'
}
} }
this.initRemark() this.initRemark()
}, },

View File

@ -133,6 +133,12 @@ export default {
}, },
linkageActiveParam: null, linkageActiveParam: null,
linkageActiveHistory: false, linkageActiveHistory: false,
CHART_CONT_FAMILY_MAP: {
'Microsoft YaHei': 'Microsoft YaHei',
'SimSun': 'SimSun, "Songti SC", STSong',
'SimHei': 'SimHei, Helvetica',
'KaiTi': 'KaiTi, "Kaiti SC", STKaiti'
}
} }
}, },
@ -240,7 +246,7 @@ export default {
this.titleClass.fontWeight = customStyle.text.isBolder ? 'bold' : 'normal' this.titleClass.fontWeight = customStyle.text.isBolder ? 'bold' : 'normal'
this.titleClass.fontSize = customStyle.text.isBolder ? 'bold' : 'normal' this.titleClass.fontSize = customStyle.text.isBolder ? 'bold' : 'normal'
this.titleClass.fontFamily = customStyle.text.fontFamily ? customStyle.text.fontFamily : 'Microsoft YaHei' this.titleClass.fontFamily = customStyle.text.fontFamily ? this.CHART_CONT_FAMILY_MAP[customStyle.text.fontFamily] : 'Microsoft YaHei'
this.titleClass.letterSpacing = (customStyle.text.letterSpace ? customStyle.text.letterSpace : '0') + 'px' this.titleClass.letterSpacing = (customStyle.text.letterSpace ? customStyle.text.letterSpace : '0') + 'px'
this.titleClass.textShadow = customStyle.text.fontShadow ? '2px 2px 4px' : 'none' this.titleClass.textShadow = customStyle.text.fontShadow ? '2px 2px 4px' : 'none'
} }
@ -249,23 +255,6 @@ export default {
this.borderRadius = (customStyle.background.borderRadius || 0) + 'px' this.borderRadius = (customStyle.background.borderRadius || 0) + 'px'
} }
if (customStyle.text) {
this.title_show = customStyle.text.show
this.title_class.fontSize = customStyle.text.fontSize + 'px'
this.title_class.color = customStyle.text.color
this.title_class.textAlign = customStyle.text.hPosition
this.title_class.fontStyle = customStyle.text.isItalic ? 'italic' : 'normal'
this.title_class.fontWeight = customStyle.text.isBolder ? 'bold' : 'normal'
this.title_class.fontFamily = customStyle.text.fontFamily ? customStyle.text.fontFamily : DEFAULT_TITLE_STYLE.fontFamily
this.title_class.letterSpacing = (customStyle.text.letterSpace ? customStyle.text.letterSpace : DEFAULT_TITLE_STYLE.letterSpace) + 'px'
this.title_class.textShadow = customStyle.text.fontShadow ? '2px 2px 4px' : 'none'
}
if (customStyle.background) {
this.title_class.background = hexColorToRGBA(customStyle.background.color, customStyle.background.alpha)
this.borderRadius = (customStyle.background.borderRadius || 0) + 'px'
}
} }
this.initRemark() this.initRemark()
}, },

View File

@ -107,7 +107,13 @@
content: '' content: ''
}, },
buttonTextColor: null, buttonTextColor: null,
loading: true loading: true,
CHART_CONT_FAMILY_MAP: {
'Microsoft YaHei': 'Microsoft YaHei',
'SimSun': 'SimSun, "Songti SC", STSong',
'SimHei': 'SimHei, Helvetica',
'KaiTi': 'KaiTi, "Kaiti SC", STKaiti'
}
} }
}, },
@ -175,7 +181,7 @@
} }
} }
this.myChart.destroy() this.myChart.destroy()
this.pointLayer.layerPickService.layer.textureService.destroy() this.pointLayer.layerPickService.layer.textureService.destroy()
this.pointLayer.layerPickService.layer.textureService.rendererService.destroy() this.pointLayer.layerPickService.layer.textureService.rendererService.destroy()
@ -200,7 +206,7 @@
if (this.textLayer) { if (this.textLayer) {
this.textLayer.configService.clean() // GlobalConfigService this.textLayer.configService.clean() // GlobalConfigService
} }
if (this.pointLayer) { if (this.pointLayer) {
for (const key in this.pointLayer) { for (const key in this.pointLayer) {
this.pointLayer[key] = null this.pointLayer[key] = null
@ -574,7 +580,7 @@
this.titleClass.fontStyle = customStyle.text.isItalic ? 'italic' : 'normal' this.titleClass.fontStyle = customStyle.text.isItalic ? 'italic' : 'normal'
this.titleClass.fontWeight = customStyle.text.isBolder ? 'bold' : 'normal' this.titleClass.fontWeight = customStyle.text.isBolder ? 'bold' : 'normal'
this.titleClass.fontFamily = customStyle.text.fontFamily ? customStyle.text.fontFamily : 'Microsoft YaHei' this.titleClass.fontFamily = customStyle.text.fontFamily ? this.CHART_CONT_FAMILY_MAP[customStyle.text.fontFamily] : 'Microsoft YaHei'
this.titleClass.letterSpacing = (customStyle.text.letterSpace ? customStyle.text.letterSpace : '0') + 'px' this.titleClass.letterSpacing = (customStyle.text.letterSpace ? customStyle.text.letterSpace : '0') + 'px'
this.titleClass.textShadow = customStyle.text.fontShadow ? '2px 2px 4px' : 'none' this.titleClass.textShadow = customStyle.text.fontShadow ? '2px 2px 4px' : 'none'
} }