feat(图表): 同环比增加具体数值选项

This commit is contained in:
junjun 2024-09-10 11:07:36 +08:00
parent 0f52f58b57
commit c0eb3dbd26
3 changed files with 5 additions and 0 deletions

View File

@ -328,6 +328,8 @@ public class DefaultChartHandler extends AbstractChartPlugin {
.setScale(8, RoundingMode.HALF_UP) .setScale(8, RoundingMode.HALF_UP)
.toString(); .toString();
} }
} else if (StringUtils.equalsIgnoreCase(resultData, "pre")) {
item[dataIndex] = new BigDecimal(lastValue).toString();
} }
} }
} }

View File

@ -1098,6 +1098,7 @@ export default {
quarter_mom: '季环比', quarter_mom: '季环比',
week_mom: '周环比', week_mom: '周环比',
day_mom: '日环比', day_mom: '日环比',
data_pre: '具体数值',
data_sub: '对比差值', data_sub: '对比差值',
data_percent: '差值百分比', data_percent: '差值百分比',
compare_calc_expression: '计算公式', compare_calc_expression: '计算公式',

View File

@ -201,12 +201,14 @@ initDateFormatter()
<el-form-item :label="t('chart.compare_data')"> <el-form-item :label="t('chart.compare_data')">
<el-radio-group v-model="compareItem.compareCalc.resultData"> <el-radio-group v-model="compareItem.compareCalc.resultData">
<el-radio label="pre">{{ t('chart.data_pre') }}</el-radio>
<el-radio label="sub">{{ t('chart.data_sub') }}</el-radio> <el-radio label="sub">{{ t('chart.data_sub') }}</el-radio>
<el-radio label="percent">{{ t('chart.data_percent') }}</el-radio> <el-radio label="percent">{{ t('chart.data_percent') }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item :label="t('chart.compare_calc_expression')"> <el-form-item :label="t('chart.compare_calc_expression')">
<span v-if="compareItem.compareCalc.resultData === 'pre'" class="exp-style">上期数据</span>
<span v-if="compareItem.compareCalc.resultData === 'sub'" class="exp-style" <span v-if="compareItem.compareCalc.resultData === 'sub'" class="exp-style"
>本期数据 - 上期数据</span >本期数据 - 上期数据</span
> >