fix:修改$get二次转化的问题
This commit is contained in:
@@ -676,7 +676,7 @@ export default {
|
||||
this.$nextTick(() => {
|
||||
const axiosArr = chartItem.elements.map((ele) => {
|
||||
const filterItem = ele
|
||||
let query = encodeURIComponent(filterItem.expression)
|
||||
let query = 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
|
||||
|
||||
@@ -866,7 +866,7 @@ export default {
|
||||
this.$nextTick(() => {
|
||||
const axiosArr = chartItem.elements.map((ele) => {
|
||||
const filterItem = ele
|
||||
let query = encodeURIComponent(filterItem.expression)
|
||||
let query = 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
|
||||
|
||||
@@ -404,7 +404,7 @@ export default {
|
||||
this.$nextTick(() => {
|
||||
const axiosArr = chartItem.elements.map((ele) => {
|
||||
const filterItem = ele
|
||||
const query = encodeURIComponent(filterItem.expression)
|
||||
const query = filterItem.expression
|
||||
// if(chartItem.type === 'table'&&chartItem.param&&chartItem.param.last == 1){
|
||||
// return this.$get('/prom/api/v1/query_range?query=' + query + "&start=" + this.$stringTimeParseToUnix(endTime) + "&end=" + this.$stringTimeParseToUnix(endTime) + '&step=' + step);
|
||||
// }
|
||||
@@ -1630,7 +1630,7 @@ export default {
|
||||
const step = bus.getStep(startTime, endTime)
|
||||
axiosArr = this.chart.elements.map((ele) => {
|
||||
const filterItem = ele
|
||||
const query = encodeURIComponent(filterItem.expression)
|
||||
const query = filterItem.expression
|
||||
if (chartItem.type === 'table' && chartItem.param && chartItem.param.last == 1) {
|
||||
return this.$get('/prom/api/v1/query_range?query=' + query + '&start=' + this.$stringTimeParseToUnix(endTime) + '&end=' + this.$stringTimeParseToUnix(endTime) + '&step=' + step)
|
||||
}
|
||||
|
||||
@@ -1524,7 +1524,7 @@ export default {
|
||||
if (type === 'list') { // 普通模式,主控台使用
|
||||
axiosArr = this.data.elements.map((ele) => {
|
||||
const filterItem = ele
|
||||
let query = encodeURIComponent(filterItem.expression)
|
||||
let query = filterItem.expression
|
||||
if (this.chartInfo.type === 'line' || this.chartInfo.type === 'bar' || this.chartInfo.type === 'stackArea') { // 如果是这三个 默认给null
|
||||
!this.chartInfo.param && (this.chartInfo.param = {})
|
||||
this.chartInfo.param.nullType = this.chartInfo.param.nullType || 'null'
|
||||
@@ -1537,7 +1537,7 @@ export default {
|
||||
endTime = bus.timeFormate(this.$refs.pickTime.$refs.multipleTime.searchTime[1], 'yyyy-MM-dd hh:mm:ss')
|
||||
this.data.elements.forEach((ele) => {
|
||||
const filterItem = ele
|
||||
let query = encodeURIComponent(filterItem.expression)
|
||||
let query = filterItem.expression
|
||||
if (this.chartInfo.type === 'line' || this.chartInfo.type === 'bar' || this.chartInfo.type === 'stackArea') { // 如果是这三个 默认给null
|
||||
!this.chartInfo.param && (this.chartInfo.param = {})
|
||||
this.chartInfo.param.nullType = this.chartInfo.param.nullType || 'null'
|
||||
@@ -1549,14 +1549,14 @@ export default {
|
||||
} else if (type === 'dashboard') { // 概览模式,指标概览中使用
|
||||
// 概览模式,需要区分单独一个和多个
|
||||
if (this.stableFilter.chartCount === 'multiple') {
|
||||
let query = encodeURIComponent(this.data.name)
|
||||
let query = this.data.name
|
||||
if (this.chartInfo.type === 'line' || this.chartInfo.type === 'bar' || this.chartInfo.type === 'stackArea') { // 如果是这三个 默认给null
|
||||
this.chartInfo.param.nullType = this.chartInfo.param.nullType || 'null'
|
||||
query += '&nullType=' + this.chartInfo.param.nullType
|
||||
}
|
||||
axiosArr = [this.$get('/prom/api/v1/query_range?query=' + query + '&start=' + this.$stringTimeParseToUnix(startTime) + '&end=' + this.$stringTimeParseToUnix(endTime) + '&step=' + step)]
|
||||
} else {
|
||||
let query = encodeURIComponent(this.data.elements[0].expression)
|
||||
let query = this.data.elements[0].expression
|
||||
if (this.chartInfo.type === 'line' || this.chartInfo.type === 'bar' || this.chartInfo.type === 'stackArea') { // 如果是这三个 默认给null
|
||||
this.chartInfo.param.nullType = this.chartInfo.param.nullType || 'null'
|
||||
query += '&nullType=' + this.chartInfo.param.nullType
|
||||
|
||||
@@ -657,7 +657,7 @@ export default {
|
||||
data.pens && data.pens.forEach((item, index) => {
|
||||
this.chartGetData.push({ id: item.id, res: [] })
|
||||
const arr = item.data.expressArr.map((ele) => {
|
||||
let query = encodeURIComponent(ele)
|
||||
let query = ele
|
||||
if (!query) {
|
||||
return new Promise(resolve => {
|
||||
resolve({ data: '', status: 'no query' })
|
||||
|
||||
@@ -657,7 +657,7 @@ export default {
|
||||
data.pens && data.pens.forEach((item, index) => {
|
||||
this.chartGetData.push({ id: item.id, res: [] })
|
||||
const arr = item.data.expressArr.map((ele) => {
|
||||
let query = encodeURIComponent(ele)
|
||||
let query = ele
|
||||
if (!query) {
|
||||
return new Promise(resolve => {
|
||||
resolve({ data: '', status: 'no query' })
|
||||
|
||||
@@ -260,7 +260,7 @@ export default {
|
||||
this.filter.start_time = startTime
|
||||
this.filter.end_time = endTime
|
||||
const step = bus.getStep(startTime, endTime)
|
||||
const query = encodeURIComponent(params.elements[0].expression)
|
||||
const query = params.elements[0].expression
|
||||
this.$get('/prom/api/v1/query_range?query=' + query + '&start=' + this.$stringTimeParseToUnix(startTime) + '&end=' + this.$stringTimeParseToUnix(endTime) + '&step=' + step).then(response => {
|
||||
this.$refs.metricSet.loading = false
|
||||
if (response.status === 'success') {
|
||||
|
||||
Reference in New Issue
Block a user