fix:修复 char-bar 显示阈值的问题

This commit is contained in:
zhangyu
2022-04-02 17:30:49 +08:00
parent 029c1ef6d6
commit 16a1e9c8a6
3 changed files with 21 additions and 4 deletions

View File

@@ -410,7 +410,7 @@
</transition> </transition>
<!--thresholdConfig--> <!--thresholdConfig-->
<div class="form__sub-title"> <div class="form__sub-title" v-if="isThresholdConfig(chartConfig.type)">
<span>{{$t('dashboard.panel.chartForm.threshold')}}</span> <span>{{$t('dashboard.panel.chartForm.threshold')}}</span>
<el-switch <el-switch
v-model="chartConfig.param.enable.thresholds" v-model="chartConfig.param.enable.thresholds"
@@ -419,7 +419,7 @@
></el-switch> ></el-switch>
</div> </div>
<transition name="el-zoom-in-top"> <transition name="el-zoom-in-top">
<el-row v-if="chartConfig.param.enable.thresholds"> <el-row v-if="chartConfig.param.enable.thresholds && isThresholdConfig(chartConfig.type)">
<el-form-item <el-form-item
v-for="(item,index) in chartConfig.param.thresholds" v-for="(item,index) in chartConfig.param.thresholds"
:key="index" :key="index"

View File

@@ -93,6 +93,23 @@ export default {
default: return false default: return false
} }
}, },
isThresholdConfig(type) {
switch (type) {
case 'line':
case 'area':
case 'point':
return true
case 'table':
case 'stat':
case 'hexagon':
case 'gauge':
case 'treemap':
case 'pie':
case 'bar':
return false
default: return false
}
},
isShowLegendVlaues (type) { isShowLegendVlaues (type) {
switch (type) { switch (type) {
case 'line': case 'line':

View File

@@ -374,7 +374,7 @@
</transition> </transition>
<!--thresholdConfig--> <!--thresholdConfig-->
<div class="form__sub-title"> <div class="form__sub-title" v-if="isThresholdConfig(chartConfig.type)">
<span>{{$t('dashboard.panel.chartForm.threshold')}}</span> <span>{{$t('dashboard.panel.chartForm.threshold')}}</span>
<el-switch <el-switch
v-model="chartConfig.param.enable.thresholds" v-model="chartConfig.param.enable.thresholds"
@@ -383,7 +383,7 @@
></el-switch> ></el-switch>
</div> </div>
<transition name="el-zoom-in-top"> <transition name="el-zoom-in-top">
<el-row v-if="chartConfig.param.enable.thresholds"> <el-row v-if="chartConfig.param.enable.thresholds && isThresholdConfig(chartConfig.type)">
<el-form-item <el-form-item
v-for="(item,index) in chartConfig.param.thresholds" v-for="(item,index) in chartConfig.param.thresholds"
:key="index" :key="index"