diff --git a/nezha-fronted/src/components/charts/chart-list-group.vue b/nezha-fronted/src/components/charts/chart-list-group.vue index 023dc4dc2..ee0082122 100644 --- a/nezha-fronted/src/components/charts/chart-list-group.vue +++ b/nezha-fronted/src/components/charts/chart-list-group.vue @@ -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 diff --git a/nezha-fronted/src/components/charts/chart-list.vue b/nezha-fronted/src/components/charts/chart-list.vue index f48954b54..db9a91123 100644 --- a/nezha-fronted/src/components/charts/chart-list.vue +++ b/nezha-fronted/src/components/charts/chart-list.vue @@ -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 diff --git a/nezha-fronted/src/components/charts/chartPreview.vue b/nezha-fronted/src/components/charts/chartPreview.vue index 21ea99a46..8a0abe8c5 100644 --- a/nezha-fronted/src/components/charts/chartPreview.vue +++ b/nezha-fronted/src/components/charts/chartPreview.vue @@ -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) } diff --git a/nezha-fronted/src/components/charts/line-chart-block.vue b/nezha-fronted/src/components/charts/line-chart-block.vue index 7c8ae32c3..e668b01b2 100644 --- a/nezha-fronted/src/components/charts/line-chart-block.vue +++ b/nezha-fronted/src/components/charts/line-chart-block.vue @@ -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 diff --git a/nezha-fronted/src/components/common/project/topologyL5.vue b/nezha-fronted/src/components/common/project/topologyL5.vue index 2b6e2bd61..dd1bdf9bb 100644 --- a/nezha-fronted/src/components/common/project/topologyL5.vue +++ b/nezha-fronted/src/components/common/project/topologyL5.vue @@ -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' }) diff --git a/nezha-fronted/src/components/common/project/topologyPrev.vue b/nezha-fronted/src/components/common/project/topologyPrev.vue index 9f5262151..524133452 100644 --- a/nezha-fronted/src/components/common/project/topologyPrev.vue +++ b/nezha-fronted/src/components/common/project/topologyPrev.vue @@ -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' }) diff --git a/nezha-fronted/src/components/page/dashboard/metricPreview.vue b/nezha-fronted/src/components/page/dashboard/metricPreview.vue index 4f4b8e175..3190a997c 100644 --- a/nezha-fronted/src/components/page/dashboard/metricPreview.vue +++ b/nezha-fronted/src/components/page/dashboard/metricPreview.vue @@ -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') {