NEZ-2702 feat:stat图表增加对比功能(Comparison)

This commit is contained in:
zyh
2023-03-21 16:53:15 +08:00
parent f49284dc50
commit bc49fc6ff8
17 changed files with 258 additions and 40 deletions

View File

@@ -410,7 +410,7 @@
show-word-limit v-model="chartConfig.param.decimals"/>
</el-form-item>
<!-- Sparkline mode -->
<el-form-item :label="$t('dashboard.panel.chartForm.sparklineMode')" class="form-item--half-width" v-if="isShowSparkline(chartConfig.type)">
<el-form-item :label="$t('dashboard.chartForm.sparklineMode')" class="form-item--half-width" v-if="isStat(chartConfig.type)">
<el-select
v-model="chartConfig.param.sparklineMode"
placeholder=""
@@ -428,6 +428,26 @@
</el-form-item>
</div>
<div class="form-items--half-width-group">
<!-- comparison -->
<el-form-item :label="$t('dashboard.chartForm.comparison')" class="form-item--half-width" v-if="isStat(chartConfig.type)">
<el-select
v-model="chartConfig.param.comparison"
placeholder=""
popper-class="right-box-select-top prevent-clickoutside"
size="small"
@change="change"
>
<el-option
v-for="item in comparisonTypeList"
:key="item.value"
:label="$t(item.name)"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</div>
<!-- Right Y Axis -->
<div v-if="isShowRightYAxis(chartConfig.type)">
<div class="form__sub-title">
@@ -1216,8 +1236,9 @@ export default {
case 'bubble':
case 'rank':
case 'funnel':
if (this.oldType === 'stat') {
this.chartConfig.param.sparklineMode = 'line'
if (type === 'stat') {
if (!this.chartConfig.param.sparklineMode) { this.chartConfig.param.sparklineMode = 'line' }
if (!this.chartConfig.param.comparison) { this.chartConfig.param.comparison = 'none' }
}
if (this.oldType === 'stat' || this.oldType === 'gauge' || this.oldType === 'sankey' || this.oldType === 'hexagon' || this.oldType === 'bubble' || this.oldType === 'rank' || this.oldType === 'funnel') {
break
@@ -1243,7 +1264,8 @@ export default {
varValue: '',
result: 'show'
},
sparklineMode: 'line'
sparklineMode: 'line',
comparison: 'none'
}
break
case 'bar':