fix: 部分接口请求 noData 判断调整

This commit is contained in:
@changcode
2023-01-17 14:00:41 +08:00
parent 05677d5fb6
commit 38006bd964
6 changed files with 5 additions and 23 deletions

View File

@@ -123,11 +123,8 @@ export default {
this.toggleLoading(true)
get(api.dnsInsight.activeMaliciousDomain, params).then(res => {
if (res.code === 200) {
const data = res.data.result
if (!data || data.length === 0) {
this.isNoData = true
}
this.tableData = data
this.isNoData = res.data.result.length === 0
this.tableData = res.data.result
} else {
this.isNoData = true
}

View File

@@ -208,9 +208,7 @@ export default {
this.toggleLoading(true)
get(api.dnsInsight.recentEvents, params).then(res => {
if (res.code === 200) {
if (!res.data.result || res.data.result.length === 0) {
this.isNoData = true
}
this.isNoData = res.data.result.length === 0
this.tableData = res.data.result
this.tableData.forEach((t, index) => {
if (index > 5) {

View File

@@ -675,13 +675,6 @@ export default {
})
}
},
// moreChange (app) {
// this.appData.forEach(t => {
// if (t.name === app.name && t.type === app.type) {
// t.moreOptions = !t.moreOptions
// }
// })
// },
resize () {
this.myChart.forEach(t => {
t.resize()

View File

@@ -66,12 +66,8 @@ export default {
get(api.netWorkOverview.ddosEventAnalysis, params).then(res => {
if (res.code === 200) {
this.showError = false
if (res.data.result.length === 0) {
this.isNoData = true
} else {
this.isNoData = res.data.result.length === 0
this.ddosData = res.data.result[0]
this.isNoData = false
}
} else {
this.isNoData = false
this.showError = true

View File

@@ -22,7 +22,6 @@ import { get } from '@/utils/http'
import { api } from '@/utils/api'
import { drillDownPanelTypeMapping } from '@/utils/constants'
import { overwriteUrl, urlParamsHandler } from '@/utils/tools'
import { useRoute } from 'vue-router'
import { ref } from 'vue'
export default {
name: 'NpmTabs',

View File

@@ -144,7 +144,6 @@ export default {
if (!val) {
val = this.metricFilter
}
// const conditionStr = this.$route.query.queryCondition ? this.$route.query.queryCondition : ''
let condition = ''
let type = this.dimensionType
if (this.queryCondition.indexOf(' OR ') > -1) {