Merge branch 'dev-3.2' of https://git.mesalab.cn/nezha/nezha-fronted into dev-3.3
# Conflicts: # nezha-fronted/src/components/chart/chart/chartTimeSeries.vue
This commit is contained in:
@@ -300,7 +300,7 @@ export default {
|
||||
yAxisLabelFormatter (minValue, maxValue, copies, unit, dot) {
|
||||
const self = this
|
||||
return function (val, index) {
|
||||
const value = formatScientificNotation(val, 2)
|
||||
const value = formatScientificNotation(val, 6)
|
||||
// let chartUnit = self.chartInfo.unit
|
||||
// chartUnit = chartUnit || 2
|
||||
// const unit = chartDataFormat.getUnit(chartUnit)
|
||||
|
||||
@@ -449,6 +449,19 @@ export default {
|
||||
// }
|
||||
height = (item.type === 'group' && item.param.collapse) ? this.headerH : item.height
|
||||
param.showHeader = true
|
||||
if (param.valueMapping) {
|
||||
param.valueMapping.forEach(valueMapping => {
|
||||
if (!valueMapping.show) {
|
||||
valueMapping.show = false
|
||||
}
|
||||
if (valueMapping.text && !valueMapping.display) {
|
||||
valueMapping.display = valueMapping.text
|
||||
}
|
||||
if (valueMapping.columns && !valueMapping.column) {
|
||||
valueMapping.column = valueMapping.columns
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
return {
|
||||
...item,
|
||||
|
||||
@@ -99,23 +99,23 @@
|
||||
|
||||
</span>
|
||||
<span class="float-right">
|
||||
<button @click="previewTopology" v-if="!isPreview" class="nz-btn nz-btn-size-normal nz-btn-style-light"
|
||||
<button type="button" @click="previewTopology" v-if="!isPreview" class="nz-btn nz-btn-size-normal nz-btn-style-light"
|
||||
style="margin-right: 20px"
|
||||
>
|
||||
{{$t('project.topology.preview')}}
|
||||
</button>
|
||||
<button v-if="isPreview" class="nz-btn nz-btn-size-normal nz-btn-style-light" @click="previewExit"
|
||||
<button type="button" v-if="isPreview" class="nz-btn nz-btn-size-normal nz-btn-style-light" @click="previewExit"
|
||||
style="margin-right: 20px"
|
||||
>
|
||||
{{$t('project.topology.previewExit')}}
|
||||
</button>
|
||||
<button class="nz-btn nz-btn-size-normal nz-btn-style-normal" @click="saveTopology"
|
||||
<button type="button" class="nz-btn nz-btn-size-normal nz-btn-style-normal" @click="saveTopology"
|
||||
:disabled="prevent_opt.save"
|
||||
:class="{'nz-btn-disabled':prevent_opt.save}"
|
||||
style="margin-right: 20px">
|
||||
{{$t('project.topology.save')}}
|
||||
</button>
|
||||
<button class="nz-btn nz-btn-size-normal nz-btn-style-normal" style="margin-right: 20px" @click="cancelTopology">
|
||||
<button type="button" class="nz-btn nz-btn-size-normal nz-btn-style-normal" style="margin-right: 20px" @click="cancelTopology">
|
||||
{{$t('project.topology.exit')}}
|
||||
</button>
|
||||
</span>
|
||||
@@ -294,11 +294,11 @@
|
||||
</el-row>
|
||||
<div class="upload-pic-row" style="text-align: center">
|
||||
<span>
|
||||
<button class="nz-btn nz-btn-size-normal nz-btn-style-light" style="margin-right: 20px" @click="uploadPicShow=false">
|
||||
<button type="button" class="nz-btn nz-btn-size-normal nz-btn-style-light" style="margin-right: 20px" @click="uploadPicShow=false">
|
||||
{{$t('project.topology.exit')}}
|
||||
</button>
|
||||
|
||||
<button class="nz-btn nz-btn-size-normal nz-btn-style-normal" @click="imgUpload"
|
||||
<button type="button" class="nz-btn nz-btn-size-normal nz-btn-style-normal" @click="imgUpload"
|
||||
v-has="'topo_icon_save'" :disabled="prevent_opt.save"
|
||||
:class="{'nz-btn-disabled':prevent_opt.save}"
|
||||
style="margin-right: 20px">
|
||||
|
||||
@@ -422,7 +422,7 @@
|
||||
</transition>
|
||||
|
||||
<!--thresholdConfig-->
|
||||
<div class="form__sub-title">
|
||||
<div class="form__sub-title" v-if="isThresholdConfig(chartConfig.type)">
|
||||
<span>{{$t('dashboard.panel.chartForm.threshold')}}</span>
|
||||
<el-switch
|
||||
v-model="chartConfig.param.enable.thresholds"
|
||||
@@ -431,7 +431,7 @@
|
||||
></el-switch>
|
||||
</div>
|
||||
<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
|
||||
v-for="(item,index) in chartConfig.param.thresholds"
|
||||
:key="index"
|
||||
|
||||
@@ -494,6 +494,9 @@ export default {
|
||||
if (!obj.param.max) {
|
||||
obj.param.max = 100
|
||||
}
|
||||
if (!obj.param.text && obj.param.display) {
|
||||
obj.param.text = obj.param.display
|
||||
}
|
||||
if (!obj.param.link) {
|
||||
this.$set(obj.param, 'link', '')
|
||||
}
|
||||
@@ -516,6 +519,14 @@ export default {
|
||||
if (!item.show) {
|
||||
item.show = false
|
||||
}
|
||||
if (item.text && !item.display) {
|
||||
item.display = item.text
|
||||
} else if (!item.display) {
|
||||
item.display = '{{A.$value}}'
|
||||
}
|
||||
if (item.columns && !item.column) {
|
||||
item.column = item.columns
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,6 +93,23 @@ export default {
|
||||
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) {
|
||||
switch (type) {
|
||||
case 'line':
|
||||
|
||||
@@ -165,7 +165,7 @@ export default {
|
||||
label: this.$t('dashboard.panel.chartForm.legend'),
|
||||
value: 'legend'
|
||||
}, {
|
||||
label: this.$t('config.assetLabel.all'),
|
||||
label: this.$t('project.topology.none'),
|
||||
value: 'none'
|
||||
}
|
||||
],
|
||||
|
||||
@@ -384,7 +384,7 @@
|
||||
</transition>
|
||||
|
||||
<!--thresholdConfig-->
|
||||
<div class="form__sub-title">
|
||||
<div class="form__sub-title" v-if="isThresholdConfig(chartConfig.type)">
|
||||
<span>{{$t('dashboard.panel.chartForm.threshold')}}</span>
|
||||
<el-switch
|
||||
v-model="chartConfig.param.enable.thresholds"
|
||||
@@ -393,7 +393,7 @@
|
||||
></el-switch>
|
||||
</div>
|
||||
<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
|
||||
v-for="(item,index) in chartConfig.param.thresholds"
|
||||
:key="index"
|
||||
|
||||
@@ -319,11 +319,11 @@ export default {
|
||||
nowTimeType: JSON.stringify(this.nowTimeType),
|
||||
searchTime: JSON.stringify(this.searchTime)
|
||||
}
|
||||
// this.dateChange()
|
||||
// this.getTableData()
|
||||
const path = this.fromRoute.panel
|
||||
this.updatePath(param, path)
|
||||
this.getData(this.filter)
|
||||
this.dateChange()
|
||||
// this.getData(this.filter)
|
||||
this.$refs.chartList.cleanData()
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user