fix: 修改 nullType 二次转码的问题

This commit is contained in:
zhangyu
2021-11-25 10:48:24 +08:00
parent 7cf4a696e9
commit cb9cc7ed9b
7 changed files with 25 additions and 23 deletions

View File

@@ -1004,7 +1004,7 @@ export default {
this.$nextTick(() => {
const axiosArr = chartItem.elements.map((ele) => {
const filterItem = ele
let query = filterItem.expression
let query = escape(filterItem.expression)
if ((chartInfo.type === 'line' || chartInfo.type === 'bar' || chartInfo.type === 'stackArea' || chartInfo.type === 'table') && chartInfo.param) { // 如果是这三个 默认给null
chartInfo.param.nullType = chartInfo.param.nullType || 'null'
query += '&nullType=' + chartInfo.param.nullType
@@ -1018,7 +1018,7 @@ export default {
if (chartInfo.type == 'logs') {
return chartTempData
}
return this.$get('/prom/api/v1/query_range?query=' + escape(query) + '&start=' + this.$stringTimeParseToUnix(startTime) + '&end=' + this.$stringTimeParseToUnix(endTime) + '&step=' + step)
return this.$get('/prom/api/v1/query_range?query=' + query + '&start=' + this.$stringTimeParseToUnix(startTime) + '&end=' + this.$stringTimeParseToUnix(endTime) + '&step=' + step)
})
// 一个图表的所有element单独获取数据
axios.all(axiosArr).then((res) => {