fix: 解决折线图显示不全的问题
This commit is contained in:
@@ -392,9 +392,12 @@ export function replaceUrlPlaceholder (url, params) {
|
||||
_.forIn(params, (value, key) => {
|
||||
url = url.replace('{{' + key + '}}', value)
|
||||
})
|
||||
return url
|
||||
return doubleQuotationToSingle(url)
|
||||
}
|
||||
// 双引号替换为单引号
|
||||
export function doubleQuotationToSingle (content) {
|
||||
return content.replace(/\"/g, "'")
|
||||
}
|
||||
|
||||
// 下划线转换驼峰
|
||||
export function lineToHump (name) {
|
||||
return name.replace(/\_(\w)/g, function (all, letter) {
|
||||
|
||||
@@ -519,9 +519,9 @@ export default {
|
||||
if (data.resultType === 'matrix') {
|
||||
let allZero = true
|
||||
try {
|
||||
data.forEach(d => {
|
||||
data.result.forEach(d => {
|
||||
d.values.forEach(r => {
|
||||
if (r[1] && r[1] !== '0' && r[1] !== 0) {
|
||||
if (r[1] && r[1] !== '0') {
|
||||
allZero = false
|
||||
throw new Error('break')
|
||||
}
|
||||
@@ -627,7 +627,6 @@ export default {
|
||||
tableQueryParams[chartParams.nameColumn] = [] // 处理两个图表不一样的地方
|
||||
get(replaceUrlPlaceholder(chartParams.url, queryParams)).then(response => {
|
||||
if (response.code === 200) {
|
||||
console.info(response)
|
||||
if (this.$_.isEmpty(response.data.result)) {
|
||||
this.noData = true
|
||||
return
|
||||
|
||||
@@ -39,6 +39,7 @@ import LeftFilter from '@/components/entities/LeftFilter'
|
||||
import EntityList from '@/components/entities/EntityList'
|
||||
import { getEntityFilter, getEntityList, getEntityCount } from '@/utils/api'
|
||||
import Panel from '@/views/charts/Panel'
|
||||
import { doubleQuotationToSingle } from '@/utils/tools'
|
||||
export default {
|
||||
name: 'EntityExplorer',
|
||||
data () {
|
||||
@@ -102,7 +103,7 @@ export default {
|
||||
}
|
||||
default: break
|
||||
}
|
||||
const { topFilterData, bottomFilterData } = await this.queryFilterData({ column, q: this.doubleQuotationToSingle(this.searchContent), from: this.from })
|
||||
const { topFilterData, bottomFilterData } = await this.queryFilterData({ column, q: doubleQuotationToSingle(this.searchContent), from: this.from })
|
||||
if (index === 1) {
|
||||
this.bottomFilterData = {
|
||||
...this.bottomFilterData,
|
||||
@@ -118,7 +119,7 @@ export default {
|
||||
}
|
||||
},
|
||||
async search () {
|
||||
const params = { from: this.from, q: this.doubleQuotationToSingle(this.searchContent) }
|
||||
const params = { from: this.from, q: doubleQuotationToSingle(this.searchContent) }
|
||||
this.listData = await getEntityList({ ...this.pageObjRight, ...params })
|
||||
this.pageObjRight.total = await getEntityCount(params)
|
||||
const { topFilterData, bottomFilterData } = await this.queryFilterData(params)
|
||||
@@ -296,7 +297,7 @@ export default {
|
||||
default: break
|
||||
}
|
||||
const params = {
|
||||
q: this.doubleQuotationToSingle(this.searchContent),
|
||||
q: doubleQuotationToSingle(this.searchContent),
|
||||
from: this.from,
|
||||
pageNo: 1,
|
||||
where,
|
||||
@@ -312,10 +313,6 @@ export default {
|
||||
this.pageObjRight.pageNo = val
|
||||
this.search()
|
||||
},
|
||||
// 双引号转为单引号
|
||||
doubleQuotationToSingle (content) {
|
||||
return content.replace(/\"/g, "'")
|
||||
},
|
||||
entityDetail (entity, tabs) {
|
||||
const entityName = entity.domain || entity.clientIP || entity.serverIP || entity.appId
|
||||
this.$store.commit('setEntityName', entityName)
|
||||
|
||||
Reference in New Issue
Block a user