fix: 1、实体列表左侧filter对应接口字段修改;2、精简实体首页实体展示代码
This commit is contained in:
@@ -73,12 +73,12 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="explorer-foot" v-if="!showList">
|
<div class="explorer-foot" v-if="!showList">
|
||||||
<div>
|
<div v-for="item in homeEntityList" :key="item.name">
|
||||||
<el-divider direction="vertical"></el-divider>
|
<el-divider direction="vertical"></el-divider>
|
||||||
<div class="entity-overview">
|
<div class="entity-overview">
|
||||||
<div class="overview-left">
|
<div class="overview-left">
|
||||||
<span class="overview-left-loading">
|
<span class="overview-left-loading">
|
||||||
<span class="overview-left-loading-span">APP</span>
|
<span class="overview-left-loading-span">{{ item.name }}</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="overview-right">
|
<div class="overview-right">
|
||||||
@@ -86,8 +86,8 @@
|
|||||||
<i class="cn-icon cn-icon-proportion entity-explorer-total__icon"></i>
|
<i class="cn-icon cn-icon-proportion entity-explorer-total__icon"></i>
|
||||||
<div class="right-label">{{ $t('network.total') }}</div>
|
<div class="right-label">{{ $t('network.total') }}</div>
|
||||||
<div class="right-label-loading">
|
<div class="right-label-loading">
|
||||||
<loading :loading="loadingApp" size="small"></loading>
|
<loading :loading="item.loadingTotal" size="small"></loading>
|
||||||
<div class="right-value">{{ numberWithCommas(entityAppTotal) }}</div>
|
<div class="right-value">{{ numberWithCommas(item.total) }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -95,107 +95,17 @@
|
|||||||
<i class="cn-icon cn-icon-active"></i>
|
<i class="cn-icon cn-icon-active"></i>
|
||||||
<div class="right-label">{{ $t('entity.active') }}</div>
|
<div class="right-label">{{ $t('entity.active') }}</div>
|
||||||
<div class="right-label-loading">
|
<div class="right-label-loading">
|
||||||
<loading :loading="loadingAppActive" size="small"></loading>
|
<loading :loading="item.loadingActive" size="small"></loading>
|
||||||
<div class="right-value-block">
|
<div class="right-value-block">
|
||||||
<span class="margin-r-6">{{ numberWithCommas(entityAppActive) }}</span>
|
<span class="margin-r-6">{{ numberWithCommas(item.active) }}</span>
|
||||||
<span class="last-hour">{{ $t('entity.inLastHour') }}</span>
|
<span class="last-hour">{{ $t('entity.inLastHour') }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-divider direction="vertical"></el-divider>
|
|
||||||
<div class="entity-overview">
|
|
||||||
<div class="overview-left">
|
|
||||||
<span class="overview-left-loading">
|
|
||||||
<span class="overview-left-loading-span">{{$t('overall.domain')}}</span>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="overview-right">
|
|
||||||
<div class="right-row margin-b-6">
|
|
||||||
<i class="cn-icon cn-icon-proportion entity-explorer-total__icon"></i>
|
|
||||||
<div class="right-label">{{ $t('network.total') }}</div>
|
|
||||||
<div class="right-label-loading">
|
|
||||||
<loading :loading="loadingDomain" size="small"></loading>
|
|
||||||
<div class="right-value">{{ numberWithCommas(entityDomainTotal) }}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="right-row">
|
|
||||||
<i class="cn-icon cn-icon-active"></i>
|
|
||||||
<div class="right-label">{{ $t('entity.active') }}</div>
|
|
||||||
<div class="right-label-loading">
|
|
||||||
<loading :loading="loadingDomainActive" size="small"></loading>
|
|
||||||
<div class="right-value-block">
|
|
||||||
<span class="margin-r-6">{{ numberWithCommas(entityDomainActive) }}</span>
|
|
||||||
<span class="last-hour">{{ $t('entity.inLastHour') }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<el-divider direction="vertical"></el-divider>
|
<el-divider direction="vertical"></el-divider>
|
||||||
<div class="entity-overview">
|
|
||||||
<div class="overview-left">
|
|
||||||
<span class="overview-left-loading">
|
|
||||||
<span class="overview-left-loading-span">IP</span>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="overview-right">
|
|
||||||
<div class="right-row margin-b-6">
|
|
||||||
<i class="cn-icon cn-icon-proportion entity-explorer-total__icon"></i>
|
|
||||||
<div class="right-label">{{ $t('network.total') }}</div>
|
|
||||||
<div class="right-label-loading">
|
|
||||||
<loading :loading="loadingIp" size="small"></loading>
|
|
||||||
<div class="right-value">{{ numberWithCommas(entityIpTotal) }}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="right-row">
|
|
||||||
<i class="cn-icon cn-icon-active"></i>
|
|
||||||
<div class="right-label">{{ $t('entity.active') }}</div>
|
|
||||||
<div class="right-label-loading">
|
|
||||||
<loading :loading="loadingIpActive" size="small"></loading>
|
|
||||||
<div class="right-value-block">
|
|
||||||
<span class="margin-r-6">{{ numberWithCommas(entityIpActive) }}</span>
|
|
||||||
<span class="last-hour">{{ $t('entity.inLastHour') }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<el-divider direction="vertical"></el-divider>
|
|
||||||
<div class="entity-overview">
|
|
||||||
<div class="overview-left">
|
|
||||||
<span class="overview-left-loading">
|
|
||||||
<span class="overview-left-loading-span">{{ $t('overall.subscriber') }}</span>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="overview-right">
|
|
||||||
<div class="right-row margin-b-6">
|
|
||||||
<i class="cn-icon cn-icon-proportion entity-explorer-total__icon"></i>
|
|
||||||
<div class="right-label">{{ $t('network.total') }}</div>
|
|
||||||
<div class="right-label-loading">
|
|
||||||
<loading :loading="loadingIp" size="small"></loading>
|
|
||||||
<div class="right-value">{{ numberWithCommas(entitySubscriberTotal) }}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="right-row">
|
|
||||||
<i class="cn-icon cn-icon-active"></i>
|
|
||||||
<div class="right-label">{{ $t('entity.active') }}</div>
|
|
||||||
<div class="right-label-loading">
|
|
||||||
<loading :loading="loadingSubscriberActive" size="small"></loading>
|
|
||||||
<div class="right-value-block">
|
|
||||||
<span class="margin-r-6">{{ numberWithCommas(entitySubscriberActive) }}</span>
|
|
||||||
<span class="last-hour">{{ $t('entity.inLastHour') }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<el-divider direction="vertical"></el-divider>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -211,11 +121,7 @@ import { getNowDate, getNowTime, getSecond } from '@/utils/date-util'
|
|||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
import Loading from '@/components/common/Loading'
|
import Loading from '@/components/common/Loading'
|
||||||
import {
|
import { overwriteUrl, urlParamsHandler, numberWithCommas } from '@/utils/tools'
|
||||||
overwriteUrl,
|
|
||||||
urlParamsHandler,
|
|
||||||
numberWithCommas
|
|
||||||
} from '@/utils/tools'
|
|
||||||
import Parser from '@/components/advancedSearch/meta/parser'
|
import Parser from '@/components/advancedSearch/meta/parser'
|
||||||
import { handleErrorTip, invalidErrorTip } from '@/components/advancedSearch/meta/error'
|
import { handleErrorTip, invalidErrorTip } from '@/components/advancedSearch/meta/error'
|
||||||
import { columnList } from '@/utils/static-data'
|
import { columnList } from '@/utils/static-data'
|
||||||
@@ -236,23 +142,6 @@ export default {
|
|||||||
return {
|
return {
|
||||||
showList: false,
|
showList: false,
|
||||||
listMode: 'list', // entity列表的模式,list|block
|
listMode: 'list', // entity列表的模式,list|block
|
||||||
|
|
||||||
entityAppTotal: '-',
|
|
||||||
entityAppNew: '-',
|
|
||||||
entityAppActive: '-',
|
|
||||||
|
|
||||||
entityDomainTotal: '-',
|
|
||||||
entityDomainNew: '-',
|
|
||||||
entityDomainActive: '-',
|
|
||||||
|
|
||||||
entityIpTotal: '-',
|
|
||||||
entityIpNew: '-',
|
|
||||||
entityIpActive: '-',
|
|
||||||
|
|
||||||
entitySubscriberTotal: '-',
|
|
||||||
entitySubscriberNew: '-',
|
|
||||||
entitySubscriberActive: '-',
|
|
||||||
|
|
||||||
newFilterData: [
|
newFilterData: [
|
||||||
{
|
{
|
||||||
icon: 'cn-icon cn-icon-registration-country',
|
icon: 'cn-icon cn-icon-registration-country',
|
||||||
@@ -333,17 +222,6 @@ export default {
|
|||||||
str: '',
|
str: '',
|
||||||
metaList: [],
|
metaList: [],
|
||||||
listLoading: false,
|
listLoading: false,
|
||||||
// 实体详情搜索页面 底部列表
|
|
||||||
loadingApp: false,
|
|
||||||
loadingDomain: false,
|
|
||||||
loadingIp: false,
|
|
||||||
loadingSubscriber: false,
|
|
||||||
// Active
|
|
||||||
loadingAppActive: false,
|
|
||||||
loadingDomainActive: false,
|
|
||||||
loadingIpActive: false,
|
|
||||||
loadingSubscriberActive: false,
|
|
||||||
|
|
||||||
initFlag: true, // 初始化标志,避免初始化时pageSize和pageNo会调用搜索
|
initFlag: true, // 初始化标志,避免初始化时pageSize和pageNo会调用搜索
|
||||||
timer: null, // 初始化标志的延时器,需要销毁
|
timer: null, // 初始化标志的延时器,需要销毁
|
||||||
summaryCount: {
|
summaryCount: {
|
||||||
@@ -354,7 +232,14 @@ export default {
|
|||||||
subscriberCount: 0
|
subscriberCount: 0
|
||||||
},
|
},
|
||||||
loadingCount: false, // 实体基数统计的loading
|
loadingCount: false, // 实体基数统计的loading
|
||||||
keywordList: []
|
keywordList: [],
|
||||||
|
// 首页实体计数
|
||||||
|
homeEntityList: [
|
||||||
|
{ name: 'APP', total: '-', loadingTotal: false, active: '-', loadingActive: false },
|
||||||
|
{ name: this.$t('overall.domain'), total: '-', loadingTotal: false, active: '-', loadingActive: false },
|
||||||
|
{ name: 'IP', total: '-', loadingTotal: false, active: '-', loadingActive: false },
|
||||||
|
{ name: this.$t('overall.subscriber'), total: '-', loadingTotal: false, active: '-', loadingActive: false }
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -610,22 +495,27 @@ export default {
|
|||||||
this.newFilterData[index].loading = true
|
this.newFilterData[index].loading = true
|
||||||
if (req) {
|
if (req) {
|
||||||
req.then(response => {
|
req.then(response => {
|
||||||
if (response.status === 200 && response.data.data.list) {
|
if (response.status === 200 && response.data.data.data) {
|
||||||
if (response.data.data.list.length >= 5) {
|
if (response.data.data.data.length >= 5) {
|
||||||
this.newFilterData[index].showNum = 5
|
this.newFilterData[index].showNum = 5
|
||||||
} else {
|
} else {
|
||||||
this.newFilterData[index].showNum = response.data.data.list.length
|
this.newFilterData[index].showNum = response.data.data.data.length
|
||||||
}
|
}
|
||||||
this.newFilterData[index].data = []
|
this.newFilterData[index].data = []
|
||||||
response.data.data.list.forEach(item => {
|
response.data.data.data.forEach(item => {
|
||||||
let obj = {
|
let obj = {
|
||||||
label: item.value,
|
label: item.value,
|
||||||
topColumn: this.newFilterData[index].topColumn,
|
topColumn: this.newFilterData[index].topColumn,
|
||||||
value: item.uniqueEntities,
|
value: item.count,
|
||||||
showNum: 5
|
showNum: 5
|
||||||
}
|
}
|
||||||
|
for (const ite in item) {
|
||||||
|
if (ite !== 'count') {
|
||||||
|
obj.label = item[ite]
|
||||||
|
}
|
||||||
|
}
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
obj.flag = item.value // 接口字段名称为'China',svg名称为'CN',通过countryNameIdMapping进行转换
|
obj.flag = item.label // 接口字段名称为'China',svg名称为'CN',通过countryNameIdMapping进行转换
|
||||||
}
|
}
|
||||||
if (index === 4) {
|
if (index === 4) {
|
||||||
obj = {
|
obj = {
|
||||||
@@ -633,7 +523,7 @@ export default {
|
|||||||
topColumn1: this.newFilterData[index].topColumn1,
|
topColumn1: this.newFilterData[index].topColumn1,
|
||||||
port: item.port,
|
port: item.port,
|
||||||
l7Protocol: item.l7Protocol,
|
l7Protocol: item.l7Protocol,
|
||||||
value: item.uniqueEntities,
|
value: item.count,
|
||||||
showNum: 5
|
showNum: 5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -705,80 +595,45 @@ export default {
|
|||||||
this.loadingCount = false
|
this.loadingCount = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
queryListTotal (params) {
|
|
||||||
const queryParams = {
|
|
||||||
...params,
|
|
||||||
startTime: getSecond(params.startTime),
|
|
||||||
endTime: getSecond(params.endTime)
|
|
||||||
}
|
|
||||||
axios.get(api.entityListTotal, { params: queryParams }).then(response => {
|
|
||||||
if (response.status === 200) {
|
|
||||||
this.pageObj.total = response.data.data.result
|
|
||||||
}
|
|
||||||
}).catch(e => {
|
|
||||||
this.$message.error(this.errorMsgHandler(e))
|
|
||||||
console.error(e)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleQ (params) {
|
|
||||||
return Object.keys(params).map(param => {
|
|
||||||
return `${param}='${params[param]}'`
|
|
||||||
}).join(' AND ')
|
|
||||||
},
|
|
||||||
|
|
||||||
getEntityIndexData () {
|
getEntityIndexData () {
|
||||||
// Total
|
this.homeEntityList.forEach(item => {
|
||||||
this.loadingApp = true
|
item.loadingTotal = true
|
||||||
this.loadingDomain = true
|
item.loadingActive = true
|
||||||
this.loadingIp = true
|
})
|
||||||
this.loadingSubscriber = true
|
|
||||||
// Active
|
|
||||||
this.loadingAppActive = true
|
|
||||||
this.loadingDomainActive = true
|
|
||||||
this.loadingIpActive = true
|
|
||||||
this.loadingSubscriberActive = true
|
|
||||||
|
|
||||||
axios.get(api.entity.entityList.entityTotal).then(response => {
|
axios.get(api.entity.entityList.entityTotal).then(response => {
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
this.entityDomainTotal = response.data.data.domainCount
|
this.homeEntityList[0].total = response.data.data.appCount || '-'
|
||||||
this.entityIpTotal = response.data.data.ipCount
|
this.homeEntityList[1].total = response.data.data.domainCount || '-'
|
||||||
this.entityAppTotal = response.data.data.appCount
|
this.homeEntityList[2].total = response.data.data.ipCount || '-'
|
||||||
this.entitySubscriberTotal = response.data.data.subscriberCount
|
this.homeEntityList[3].total = response.data.data.subscriberCount || '-'
|
||||||
|
this.homeEntityList[4].total = response.data.data.cellCount || '-'
|
||||||
}
|
}
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
this.$message.error(this.errorMsgHandler(e))
|
this.$message.error(this.errorMsgHandler(e))
|
||||||
console.error(e)
|
console.error(e)
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.loadingDomain = false
|
this.homeEntityList.forEach(item => {
|
||||||
this.loadingIp = false
|
item.loadingTotal = false
|
||||||
this.loadingApp = false
|
})
|
||||||
this.loadingSubscriber = false
|
|
||||||
})
|
})
|
||||||
// Active
|
// Active
|
||||||
axios.get(api.entity.entityList.entityActive).then(response => {
|
axios.get(api.entity.entityList.entityActive).then(response => {
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
this.entityDomainActive = response.data.data.domainCount
|
this.homeEntityList[0].active = response.data.data.appCount || '-'
|
||||||
this.entityIpActive = response.data.data.ipCount
|
this.homeEntityList[1].active = response.data.data.domainCount || '-'
|
||||||
this.entityAppActive = response.data.data.appCount
|
this.homeEntityList[2].active = response.data.data.ipCount || '-'
|
||||||
this.entitySubscriberActive = response.data.data.subscriberCount
|
this.homeEntityList[3].active = response.data.data.subscriberCount || '-'
|
||||||
|
this.homeEntityList[4].active = response.data.data.cellCount || '-'
|
||||||
}
|
}
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
this.$message.error(this.errorMsgHandler(e))
|
this.$message.error(this.errorMsgHandler(e))
|
||||||
console.error(e)
|
console.error(e)
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.loadingDomainActive = false
|
this.homeEntityList.forEach(item => {
|
||||||
this.loadingIpActive = false
|
item.loadingActive = false
|
||||||
this.loadingAppActive = false
|
})
|
||||||
this.loadingSubscriberActive = false
|
|
||||||
})
|
})
|
||||||
},
|
|
||||||
setListMode (mode) {
|
|
||||||
this.listMode = mode
|
|
||||||
const newParam = {
|
|
||||||
listMode: mode
|
|
||||||
}
|
|
||||||
this.reloadUrl(newParam)
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 向地址栏添加/删除参数
|
* 向地址栏添加/删除参数
|
||||||
|
|||||||
Reference in New Issue
Block a user