fix【能源场景】:修复碳排放使用全局主题导致BUG

This commit is contained in:
Free-sss 2025-09-04 22:17:56 +08:00
parent e407f06c66
commit 3b2cd10bf1
2 changed files with 53 additions and 71 deletions

View File

@ -5,35 +5,48 @@ import { graphic } from 'echarts/core'
import { defaultTheme, chartColorsSearch } from '@/settings/chartThemes/index' import { defaultTheme, chartColorsSearch } from '@/settings/chartThemes/index'
import cloneDeep from 'lodash/cloneDeep' import cloneDeep from 'lodash/cloneDeep'
import dataJson from './data.json' import dataJson from './data.json'
import { fontStyle } from 'html2canvas/dist/types/css/property-descriptors/font-style'
export const includes = [ 'xAxis', 'yAxis', 'grid'] export const includes = ['xAxis', 'yAxis']
const option = { const option = {
grid: {
left: '3%',
right: '4%',
bottom: '3%',
top: '15%',
containLabel: true
},
legend: { legend: {
show: true, show: true,
top:'20', top: '20',
right:'50', right: '50',
itemStyle:{ itemStyle: {
borderType: 'dotted' borderType: 'dotted'
}, },
lineStyle: { lineStyle: {
type:'dashed', type: 'dashed',
cap:'round', cap: 'round',
opacity:0.9, opacity: 0.9,
}, },
// icon: 'rect', // icon: 'rect',
data:[{ data: [{
name: '电', name: '电',
// 强制设置图形为圆。 // 强制设置图形为圆。
icon: 'rect', icon: 'rect',
itemStyle:{ itemStyle: {
color: 'rgba(12, 109, 196,1)' color: 'rgba(12, 109, 196,1)'
}, textStyle: {
color: '#eee'
}, },
},{ }, {
name: '燃气', name: '燃气',
textStyle: {
color: '#eee'
},
// 强制设置图形为圆。 // 强制设置图形为圆。
icon: 'rect', icon: 'rect',
itemStyle:{ itemStyle: {
color: 'rgba(48, 189, 104,1)' color: 'rgba(48, 189, 104,1)'
}, },
}], }],
@ -53,21 +66,22 @@ const option = {
show: true, show: true,
type: 'value', type: 'value',
name: '单位:万/kwh', name: '单位:万/kwh',
nameGap:30, nameGap: 30,
axisLine:{ axisLine: {
show: false show: false
}, },
splitLine:{ splitLine: {
show: true, show: true,
lineStyle:{ lineStyle: {
type: 'dashed', type: 'dashed',
opacity:0.5 opacity: 0.5
} }
} }
}, },
dataset: { ...dataJson }, dataset: { ...dataJson },
series: [ series: [
{ {
type: 'line', type: 'line',
smooth: true, smooth: true,
symbolSize: 0, //设定实心点的大小 symbolSize: 0, //设定实心点的大小

View File

@ -1,73 +1,41 @@
<template> <template>
<!-- Echarts 全局设置 --> <CollapseItem v-for="(item, index) in seriesList" :key="index" name="单折线面积图" :expanded="true">
<global-setting :optionData="optionData"></global-setting>
<CollapseItem
v-for="(item, index) in seriesList"
:key="index"
name="单折线面积图"
:expanded="true"
>
<SettingItemBox name="线条"> <SettingItemBox name="线条">
<SettingItem name="宽度"> <SettingItem name="宽度">
<n-input-number <n-input-number v-model:value="item.lineStyle.width" :min="1" size="small" placeholder="自动计算"></n-input-number>
v-model:value="item.lineStyle.width"
:min="1"
size="small"
placeholder="自动计算"
></n-input-number>
</SettingItem> </SettingItem>
<SettingItem name="类型"> <SettingItem name="类型">
<n-select <n-select v-model:value="item.lineStyle.type" size="small" :options="lineConf.lineStyle.type"></n-select>
v-model:value="item.lineStyle.type"
size="small"
:options="lineConf.lineStyle.type"
></n-select>
</SettingItem> </SettingItem>
</SettingItemBox> </SettingItemBox>
<SettingItemBox name="实心点"> <SettingItemBox name="实心点">
<SettingItem name="大小"> <SettingItem name="大小">
<n-input-number <n-input-number v-model:value="item.symbolSize" :min="1" :max="100" size="small"
v-model:value="item.symbolSize" placeholder="自动计算"></n-input-number>
:min="1"
:max="100"
size="small"
placeholder="自动计算"
></n-input-number>
</SettingItem> </SettingItem>
</SettingItemBox> </SettingItemBox>
<setting-item-box name="标签"> <Setting-item-box name="标签">
<setting-item> <Setting-item>
<n-space> <n-space>
<n-switch v-model:value="item.label.show" size="small" /> <n-switch v-model:value="item.label.show" size="small" />
<n-text>展示标签</n-text> <n-text>展示标签</n-text>
</n-space> </n-space>
</setting-item> </Setting-item>
<setting-item name="大小"> <Setting-item name="大小">
<n-input-number <n-input-number v-model:value="item.label.fontSize" size="small" :min="1"></n-input-number>
v-model:value="item.label.fontSize" </Setting-item>
size="small" <Setting-item name="颜色">
:min="1" <n-color-picker size="small" :modes="['hex']" v-model:value="item.label.color"></n-color-picker>
></n-input-number> </Setting-item>
</setting-item> <Setting-item name="位置">
<setting-item name="颜色"> <n-select v-model:value="item.label.position" :options="[
<n-color-picker
size="small"
:modes="['hex']"
v-model:value="item.label.color"
></n-color-picker>
</setting-item>
<setting-item name="位置">
<n-select
v-model:value="item.label.position"
:options="[
{ label: 'top', value: 'top' }, { label: 'top', value: 'top' },
{ label: 'left', value: 'left' }, { label: 'left', value: 'left' },
{ label: 'right', value: 'right' }, { label: 'right', value: 'right' },
{ label: 'bottom', value: 'bottom' }, { label: 'bottom', value: 'bottom' },
]" ]" />
/> </Setting-item>
</setting-item> </Setting-item-box>
</setting-item-box>
</CollapseItem> </CollapseItem>
</template> </template>