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) {
|
yAxisLabelFormatter (minValue, maxValue, copies, unit, dot) {
|
||||||
const self = this
|
const self = this
|
||||||
return function (val, index) {
|
return function (val, index) {
|
||||||
const value = formatScientificNotation(val, 2)
|
const value = formatScientificNotation(val, 6)
|
||||||
// let chartUnit = self.chartInfo.unit
|
// let chartUnit = self.chartInfo.unit
|
||||||
// chartUnit = chartUnit || 2
|
// chartUnit = chartUnit || 2
|
||||||
// const unit = chartDataFormat.getUnit(chartUnit)
|
// const unit = chartDataFormat.getUnit(chartUnit)
|
||||||
|
|||||||
@@ -449,6 +449,19 @@ export default {
|
|||||||
// }
|
// }
|
||||||
height = (item.type === 'group' && item.param.collapse) ? this.headerH : item.height
|
height = (item.type === 'group' && item.param.collapse) ? this.headerH : item.height
|
||||||
param.showHeader = true
|
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 {
|
return {
|
||||||
...item,
|
...item,
|
||||||
|
|||||||
@@ -99,23 +99,23 @@
|
|||||||
|
|
||||||
</span>
|
</span>
|
||||||
<span class="float-right">
|
<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"
|
style="margin-right: 20px"
|
||||||
>
|
>
|
||||||
{{$t('project.topology.preview')}}
|
{{$t('project.topology.preview')}}
|
||||||
</button>
|
</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"
|
style="margin-right: 20px"
|
||||||
>
|
>
|
||||||
{{$t('project.topology.previewExit')}}
|
{{$t('project.topology.previewExit')}}
|
||||||
</button>
|
</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"
|
:disabled="prevent_opt.save"
|
||||||
:class="{'nz-btn-disabled':prevent_opt.save}"
|
:class="{'nz-btn-disabled':prevent_opt.save}"
|
||||||
style="margin-right: 20px">
|
style="margin-right: 20px">
|
||||||
{{$t('project.topology.save')}}
|
{{$t('project.topology.save')}}
|
||||||
</button>
|
</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')}}
|
{{$t('project.topology.exit')}}
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
@@ -294,11 +294,11 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<div class="upload-pic-row" style="text-align: center">
|
<div class="upload-pic-row" style="text-align: center">
|
||||||
<span>
|
<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')}}
|
{{$t('project.topology.exit')}}
|
||||||
</button>
|
</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"
|
v-has="'topo_icon_save'" :disabled="prevent_opt.save"
|
||||||
:class="{'nz-btn-disabled':prevent_opt.save}"
|
:class="{'nz-btn-disabled':prevent_opt.save}"
|
||||||
style="margin-right: 20px">
|
style="margin-right: 20px">
|
||||||
|
|||||||
@@ -422,7 +422,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"
|
||||||
@@ -431,7 +431,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"
|
||||||
|
|||||||
@@ -494,6 +494,9 @@ export default {
|
|||||||
if (!obj.param.max) {
|
if (!obj.param.max) {
|
||||||
obj.param.max = 100
|
obj.param.max = 100
|
||||||
}
|
}
|
||||||
|
if (!obj.param.text && obj.param.display) {
|
||||||
|
obj.param.text = obj.param.display
|
||||||
|
}
|
||||||
if (!obj.param.link) {
|
if (!obj.param.link) {
|
||||||
this.$set(obj.param, 'link', '')
|
this.$set(obj.param, 'link', '')
|
||||||
}
|
}
|
||||||
@@ -516,6 +519,14 @@ export default {
|
|||||||
if (!item.show) {
|
if (!item.show) {
|
||||||
item.show = false
|
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
|
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':
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ export default {
|
|||||||
label: this.$t('dashboard.panel.chartForm.legend'),
|
label: this.$t('dashboard.panel.chartForm.legend'),
|
||||||
value: 'legend'
|
value: 'legend'
|
||||||
}, {
|
}, {
|
||||||
label: this.$t('config.assetLabel.all'),
|
label: this.$t('project.topology.none'),
|
||||||
value: 'none'
|
value: 'none'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -384,7 +384,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"
|
||||||
@@ -393,7 +393,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"
|
||||||
|
|||||||
@@ -319,11 +319,11 @@ export default {
|
|||||||
nowTimeType: JSON.stringify(this.nowTimeType),
|
nowTimeType: JSON.stringify(this.nowTimeType),
|
||||||
searchTime: JSON.stringify(this.searchTime)
|
searchTime: JSON.stringify(this.searchTime)
|
||||||
}
|
}
|
||||||
// this.dateChange()
|
|
||||||
// this.getTableData()
|
// this.getTableData()
|
||||||
const path = this.fromRoute.panel
|
const path = this.fromRoute.panel
|
||||||
this.updatePath(param, path)
|
this.updatePath(param, path)
|
||||||
this.getData(this.filter)
|
this.dateChange()
|
||||||
|
// this.getData(this.filter)
|
||||||
this.$refs.chartList.cleanData()
|
this.$refs.chartList.cleanData()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user