|
@@ -2,29 +2,20 @@
|
|
<div class="charTheme-setting-option">
|
|
<div class="charTheme-setting-option">
|
|
<ul class="options-wrapper">
|
|
<ul class="options-wrapper">
|
|
<li v-for="key in Object.keys(themeOptions)" :key="key">
|
|
<li v-for="key in Object.keys(themeOptions)" :key="key">
|
|
- <label class="option-title">{{ key ==='lineOptions'?typeLabelMap[chartType].label:labelMap.get(key)}}</label>
|
|
|
|
|
|
+ <label class="option-title">{{ key ==='lineOptionList'?typeLabelMap[chartType].label:labelMap.get(key)}}</label>
|
|
|
|
|
|
<ul class="option-list">
|
|
<ul class="option-list">
|
|
<!-- 线条设置 -->
|
|
<!-- 线条设置 -->
|
|
- <template v-if="key==='lineOptions'">
|
|
|
|
- <li class="option-item">
|
|
|
|
- <label class="el-form-item__label">{{$t('SystemManage.ChartSet.config_opt01')}}</label>
|
|
|
|
- <el-color-picker
|
|
|
|
- v-model="themeOptions[key].colors[themeOptions[key].colorIndex]"
|
|
|
|
- show-alpha
|
|
|
|
- :predefine="predefineColors"
|
|
|
|
- style="width: 90px"
|
|
|
|
- @change="changeLineColor"
|
|
|
|
- />
|
|
|
|
- </li>
|
|
|
|
|
|
+ <template v-if="key==='lineOptionList'">
|
|
|
|
+ <!-- 顺序 -->
|
|
<li class="option-item">
|
|
<li class="option-item">
|
|
<label class="el-form-item__label">{{$t('SystemManage.ChartSet.config_opt02')}}</label>
|
|
<label class="el-form-item__label">{{$t('SystemManage.ChartSet.config_opt02')}}</label>
|
|
<el-select
|
|
<el-select
|
|
- v-model="themeOptions[key].colorIndex"
|
|
|
|
|
|
+ v-model="lineIndex"
|
|
style="width: 90px"
|
|
style="width: 90px"
|
|
>
|
|
>
|
|
<el-option
|
|
<el-option
|
|
- v-for="(item,index) in themeOptions[key].colors"
|
|
|
|
|
|
+ v-for="(item,index) in themeOptions[key]"
|
|
:key="index"
|
|
:key="index"
|
|
:label="`${$i18n.locale == 'zh'?'第':''}${index+1}${typeLabelMap[chartType].lineLabel}`"
|
|
:label="`${$i18n.locale == 'zh'?'第':''}${index+1}${typeLabelMap[chartType].lineLabel}`"
|
|
:value="index"
|
|
:value="index"
|
|
@@ -32,12 +23,22 @@
|
|
</el-select>
|
|
</el-select>
|
|
</li>
|
|
</li>
|
|
|
|
|
|
|
|
+ <li class="option-item">
|
|
|
|
+ <label class="el-form-item__label">{{$t('SystemManage.ChartSet.config_opt01')}}</label>
|
|
|
|
+ <el-color-picker
|
|
|
|
+ v-model="themeOptions[key][lineIndex].color"
|
|
|
|
+ show-alpha
|
|
|
|
+ :predefine="predefineColors"
|
|
|
|
+ style="width: 90px"
|
|
|
|
+ />
|
|
|
|
+ </li>
|
|
|
|
+
|
|
<!-- 曲线额外配置 雷达 -->
|
|
<!-- 曲线额外配置 雷达 -->
|
|
<template v-if="[1,2,11].includes(chartType)">
|
|
<template v-if="[1,2,11].includes(chartType)">
|
|
<li class="option-item">
|
|
<li class="option-item">
|
|
<label class="el-form-item__label">{{$t('SystemManage.ChartSet.config_opt03')}}</label>
|
|
<label class="el-form-item__label">{{$t('SystemManage.ChartSet.config_opt03')}}</label>
|
|
<el-select
|
|
<el-select
|
|
- v-model="themeOptions[key].dashStyle"
|
|
|
|
|
|
+ v-model="themeOptions[key][lineIndex].dashStyle"
|
|
style="width: 90px"
|
|
style="width: 90px"
|
|
>
|
|
>
|
|
<el-option
|
|
<el-option
|
|
@@ -54,17 +55,17 @@
|
|
<li class="option-item">
|
|
<li class="option-item">
|
|
<label class="el-form-item__label">{{$t('SystemManage.ChartSet.config_opt04')}}</label>
|
|
<label class="el-form-item__label">{{$t('SystemManage.ChartSet.config_opt04')}}</label>
|
|
<el-input
|
|
<el-input
|
|
- v-model="themeOptions[key].lineWidth"
|
|
|
|
|
|
+ v-model="themeOptions[key][lineIndex].lineWidth"
|
|
style="width: 90px"
|
|
style="width: 90px"
|
|
type="number"
|
|
type="number"
|
|
:min="1"
|
|
:min="1"
|
|
- @change="val => { themeOptions[key].lineWidth=Number(val)}"
|
|
|
|
|
|
+ @change="val => { themeOptions[key][lineIndex].lineWidth=Number(val)}"
|
|
/>
|
|
/>
|
|
</li>
|
|
</li>
|
|
<li class="option-item">
|
|
<li class="option-item">
|
|
<label class="el-form-item__label">{{$t('SystemManage.ChartSet.config_opt05')}}</label>
|
|
<label class="el-form-item__label">{{$t('SystemManage.ChartSet.config_opt05')}}</label>
|
|
<el-select
|
|
<el-select
|
|
- v-model="themeOptions[key].lineType"
|
|
|
|
|
|
+ v-model="themeOptions[key][lineIndex].lineType"
|
|
style="width: 90px"
|
|
style="width: 90px"
|
|
>
|
|
>
|
|
<el-option :label="$t('SystemManage.ChartSet.config_opt05_yes')" value="spline"/>
|
|
<el-option :label="$t('SystemManage.ChartSet.config_opt05_yes')" value="spline"/>
|
|
@@ -72,17 +73,68 @@
|
|
</el-select>
|
|
</el-select>
|
|
</li>
|
|
</li>
|
|
</template>
|
|
</template>
|
|
-
|
|
|
|
|
|
+ <!-- 曲线、季节性图额外配置- 数据标志-->
|
|
|
|
+ <template v-if="[1,2].includes(chartType)">
|
|
|
|
+ <li class="option-item">
|
|
|
|
+ <label class="el-form-item__label">{{$t('SystemManage.ChartSet.config_opt11')}}</label>
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="themeOptions[key][lineIndex].dataMark"
|
|
|
|
+ style="width: 90px"
|
|
|
|
+ >
|
|
|
|
+ <el-option :label="$t('SystemManage.ChartSet.config_opt11_none')" value="none"/>
|
|
|
|
+ <el-option :label="$t('SystemManage.ChartSet.config_opt11_inside')" value="built-in"/>
|
|
|
|
+ </el-select>
|
|
|
|
+ </li>
|
|
|
|
+ <template v-if="themeOptions[key][lineIndex].dataMark =='built-in'">
|
|
|
|
+ <li class="option-item">
|
|
|
|
+ <label class="el-form-item__label">{{$t('SystemManage.ChartSet.config_opt12')}}</label>
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="themeOptions[key][lineIndex].markType"
|
|
|
|
+ style="width: 90px"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in markTypesOpts"
|
|
|
|
+ :key="item.value"
|
|
|
|
+ :value="item.value"
|
|
|
|
+ :label="$t('SystemManage.ChartSet.'+(item.value.replace('-','_')))"
|
|
|
|
+ >
|
|
|
|
+ <div style="display: flex;align-items: center;justify-content: center;height: 100%;" v-html="item.svg">
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </li>
|
|
|
|
+ <li class="option-item">
|
|
|
|
+ <label class="el-form-item__label">{{$t('SystemManage.ChartSet.config_opt13')}}</label>
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="themeOptions[key][lineIndex].markSize"
|
|
|
|
+ style="width: 90px"
|
|
|
|
+ type="number"
|
|
|
|
+ :min="1"
|
|
|
|
+ @change="val => { themeOptions[key][lineIndex].markSize=Number(val)}"
|
|
|
|
+ />
|
|
|
|
+ </li>
|
|
|
|
+ <li class="option-item">
|
|
|
|
+ <label class="el-form-item__label">{{$t('SystemManage.ChartSet.config_opt14')}}</label>
|
|
|
|
+ <el-color-picker
|
|
|
|
+ v-model="themeOptions[key][lineIndex].markColor"
|
|
|
|
+ show-alpha
|
|
|
|
+ :predefine="predefineColors"
|
|
|
|
+ style="width: 90px"
|
|
|
|
+ />
|
|
|
|
+ </li>
|
|
|
|
+ </template>
|
|
|
|
+ </template>
|
|
<!-- 散点额外配置 -->
|
|
<!-- 散点额外配置 -->
|
|
<template v-else-if="[5,10].includes(chartType)">
|
|
<template v-else-if="[5,10].includes(chartType)">
|
|
<li class="option-item">
|
|
<li class="option-item">
|
|
<label class="el-form-item__label">{{$t('SystemManage.ChartSet.config_opt06')}}</label>
|
|
<label class="el-form-item__label">{{$t('SystemManage.ChartSet.config_opt06')}}</label>
|
|
<el-input
|
|
<el-input
|
|
- v-model="themeOptions[key].radius"
|
|
|
|
|
|
+ v-model="themeOptions[key][lineIndex].radius"
|
|
style="width: 90px"
|
|
style="width: 90px"
|
|
type="number"
|
|
type="number"
|
|
:min="3"
|
|
:min="3"
|
|
- @change="val => { themeOptions[key].radius=Number(val)}"
|
|
|
|
|
|
+ @change="val => { themeOptions[key][lineIndex].radius=Number(val)}"
|
|
/>
|
|
/>
|
|
</li>
|
|
</li>
|
|
</template>
|
|
</template>
|
|
@@ -202,7 +254,9 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
-import { defaultETAOptions,verticalPositions,predefineColors,lineStylesOpts,alignPositions } from '../common/config'
|
|
|
|
|
|
+import { defaultETAOptions,verticalPositions,predefineColors,lineStylesOpts,alignPositions,
|
|
|
|
+ markTypesOpts
|
|
|
|
+ } from '../common/config'
|
|
import { seasonOptions } from '@/utils/defaultOptions';
|
|
import { seasonOptions } from '@/utils/defaultOptions';
|
|
export default {
|
|
export default {
|
|
props: {
|
|
props: {
|
|
@@ -217,7 +271,7 @@ export default {
|
|
computed:{
|
|
computed:{
|
|
labelMap(){
|
|
labelMap(){
|
|
return new Map([
|
|
return new Map([
|
|
- ['lineOptions',this.$t('SystemManage.ChartSet.opt_label01')],
|
|
|
|
|
|
+ ['lineOptionList',this.$t('SystemManage.ChartSet.opt_label01')],
|
|
['scatterOptions',this.$t('SystemManage.ChartSet.opt_label02')],
|
|
['scatterOptions',this.$t('SystemManage.ChartSet.opt_label02')],
|
|
['legendOptions',this.$t('SystemManage.ChartSet.opt_label03')],
|
|
['legendOptions',this.$t('SystemManage.ChartSet.opt_label03')],
|
|
['titleOptions',this.$t('SystemManage.ChartSet.opt_label04')],
|
|
['titleOptions',this.$t('SystemManage.ChartSet.opt_label04')],
|
|
@@ -245,17 +299,31 @@ export default {
|
|
predefineColors,
|
|
predefineColors,
|
|
lineStylesOpts,
|
|
lineStylesOpts,
|
|
alignPositions,
|
|
alignPositions,
|
|
|
|
+ markTypesOpts,
|
|
/* 可配置options*/
|
|
/* 可配置options*/
|
|
themeOptions: {
|
|
themeOptions: {
|
|
- lineOptions: {
|
|
|
|
- dashStyle: defaultETAOptions.lineOptions.dashStyle,
|
|
|
|
- colors: this.chartType===2?seasonOptions.colors:defaultETAOptions.colorsOptions,
|
|
|
|
- color: defaultETAOptions.colorsOptions[0],
|
|
|
|
- colorIndex:0,
|
|
|
|
- lineWidth: defaultETAOptions.lineOptions.lineWidth,
|
|
|
|
- lineType: defaultETAOptions.lineOptions.lineType,
|
|
|
|
- radius: defaultETAOptions.lineOptions.radius,
|
|
|
|
- },
|
|
|
|
|
|
+ // lineOptions: {
|
|
|
|
+ // dashStyle: defaultETAOptions.lineOptions.dashStyle,
|
|
|
|
+ // colors: this.chartType===2?seasonOptions.colors:defaultETAOptions.colorsOptions,
|
|
|
|
+ // color: defaultETAOptions.colorsOptions[0],
|
|
|
|
+ // colorIndex:0,
|
|
|
|
+ // lineWidth: defaultETAOptions.lineOptions.lineWidth,
|
|
|
|
+ // lineType: defaultETAOptions.lineOptions.lineType,
|
|
|
|
+ // radius: defaultETAOptions.lineOptions.radius,
|
|
|
|
+ // },
|
|
|
|
+ lineOptionList: new Array(10).fill(1).map((item,index)=>{
|
|
|
|
+ return {
|
|
|
|
+ dashStyle: defaultETAOptions.lineOptions.dashStyle,
|
|
|
|
+ color: this.chartType===2?seasonOptions.colors[index]:defaultETAOptions.colorsOptions[index],
|
|
|
|
+ lineWidth: defaultETAOptions.lineOptions.lineWidth,
|
|
|
|
+ lineType: defaultETAOptions.lineOptions.lineType,
|
|
|
|
+ radius: defaultETAOptions.lineOptions.radius,
|
|
|
|
+ dataMark: defaultETAOptions.lineOptions.dataMark,
|
|
|
|
+ markType: defaultETAOptions.lineOptions.markType,
|
|
|
|
+ markSize: defaultETAOptions.lineOptions.markSize,
|
|
|
|
+ markColor: this.chartType===2?seasonOptions.colors[index]:defaultETAOptions.colorsOptions[index],
|
|
|
|
+ }
|
|
|
|
+ }),
|
|
legendOptions: defaultETAOptions.legendOptions,
|
|
legendOptions: defaultETAOptions.legendOptions,
|
|
titleOptions: defaultETAOptions.titleOptions,
|
|
titleOptions: defaultETAOptions.titleOptions,
|
|
markerOptions: defaultETAOptions.markerOptions,
|
|
markerOptions: defaultETAOptions.markerOptions,
|
|
@@ -263,27 +331,9 @@ export default {
|
|
yAxisOptions: defaultETAOptions.yAxisOptions,
|
|
yAxisOptions: defaultETAOptions.yAxisOptions,
|
|
drawOption: defaultETAOptions.drawOption
|
|
drawOption: defaultETAOptions.drawOption
|
|
},
|
|
},
|
|
|
|
+ colorsOptions:this.chartType===2?seasonOptions.colors:defaultETAOptions.colorsOptions,
|
|
|
|
+ lineIndex:0,
|
|
lengendPositions: verticalPositions.filter(_ => _.value!=='middle'),
|
|
lengendPositions: verticalPositions.filter(_ => _.value!=='middle'),
|
|
- // typeLabelMap: {
|
|
|
|
- // 1: {label:'线条设置',lineLabel: '条'},
|
|
|
|
- // 2: {label:'线条设置',lineLabel: '条'},
|
|
|
|
- // 4: {label:'柱形设置',lineLabel: '根'},
|
|
|
|
- // 5: {label:'散点设置',lineLabel: '系列'},
|
|
|
|
- // 6: {label:'线条、柱形设置',lineLabel: '系列'},
|
|
|
|
- // 7: {label:'柱形设置',lineLabel: '根'},
|
|
|
|
- // 10: {label:'散点设置',lineLabel: '系列'},
|
|
|
|
- // 11: {label:'线条设置',lineLabel: '条'},
|
|
|
|
- // },
|
|
|
|
- // labelMap: new Map([
|
|
|
|
- // ['lineOptions','线条设置'],
|
|
|
|
- // ['scatterOptions','散点设置'],
|
|
|
|
- // ['legendOptions','图例设置'],
|
|
|
|
- // ['titleOptions','标题设置'],
|
|
|
|
- // ['markerOptions','标记文字设置(来源,标识)'],
|
|
|
|
- // ['xAxisOptions','横轴设置'],
|
|
|
|
- // ['yAxisOptions','纵轴设置'],
|
|
|
|
- // ['drawOption','绘图区设置'],
|
|
|
|
- // ]),
|
|
|
|
configOptions: []
|
|
configOptions: []
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -300,17 +350,17 @@ export default {
|
|
spinner: 'el-icon-loading',
|
|
spinner: 'el-icon-loading',
|
|
background: 'rgba(255, 255, 255, 0.8)'
|
|
background: 'rgba(255, 255, 255, 0.8)'
|
|
});
|
|
});
|
|
-
|
|
|
|
this.themeOptions = {
|
|
this.themeOptions = {
|
|
- lineOptions: {
|
|
|
|
- dashStyle: options.lineOptions.dashStyle,
|
|
|
|
- colors: options.colorsOptions,
|
|
|
|
- color: options.colorsOptions[0],
|
|
|
|
- colorIndex:0,
|
|
|
|
- lineWidth: options.lineOptions.lineWidth,
|
|
|
|
- lineType: options.lineOptions.lineType,
|
|
|
|
- radius: options.lineOptions.radius,
|
|
|
|
- },
|
|
|
|
|
|
+ // lineOptions: {
|
|
|
|
+ // dashStyle: options.lineOptions.dashStyle,
|
|
|
|
+ // colors: options.colorsOptions,
|
|
|
|
+ // color: options.colorsOptions[0],
|
|
|
|
+ // colorIndex:0,
|
|
|
|
+ // lineWidth: options.lineOptions.lineWidth,
|
|
|
|
+ // lineType: options.lineOptions.lineType,
|
|
|
|
+ // radius: options.lineOptions.radius,
|
|
|
|
+ // },
|
|
|
|
+ lineOptionList: options.lineOptionList,
|
|
legendOptions: options.legendOptions,
|
|
legendOptions: options.legendOptions,
|
|
titleOptions: options.titleOptions,
|
|
titleOptions: options.titleOptions,
|
|
markerOptions: options.markerOptions,
|
|
markerOptions: options.markerOptions,
|