fix: 1.下钻表格在下拉列表中滚动进度条,会发现发送很多查询请求;2.修改下钻后的查询的接口;

This commit is contained in:
hyx
2023-09-12 15:13:08 +08:00
parent 9e43a224bb
commit 2944d92792
2 changed files with 27 additions and 11 deletions

View File

@@ -53,6 +53,7 @@ export const fromRoute = {
trafficSummary: 'trafficSummary',
networkAppPerformance: 'networkAppPerformance',
dnsServiceInsights: 'dnsServiceInsights',
linkMonitor: 'linkMonitor',
user: 'user',
galaxyProxy: 'galaxyProxy',
chart: 'chart',
@@ -278,7 +279,8 @@ export const networkOverviewSearchUrl = {
cycleUrl: '/interface/overview/dimensionCycleTrafficAnalysis',
drilldownCurUrl: '/interface/overview/drilldown/dimensionTrafficAnalysis',
drilldownCycleUrl: '/interface/overview/drilldown/dimensionCycleTrafficAnalysis',
drilldownList: '/interface/overview/drilldown/list'
drilldownList: '/interface/overview/drilldown/list',
relationTabDrilldownList: '/interface/overview/tab/relation/tab/list'
}
// npm:接口url主URL
export const npmSearchUrl = {
@@ -286,14 +288,16 @@ export const npmSearchUrl = {
cycleUrl: '/interface/application/performance/overview/dimensionCycleTrafficAnalysis',
drilldownCurUrl: '/interface/application/performance/overview/drilldown/dimensionTrafficAnalysis',
drilldownCycleUrl: '/interface/application/performance/overview/drilldown/dimensionCycleTrafficAnalysis',
drilldownList: '/interface/overview/drilldown/list'
drilldownList: '/interface/application/performance/overview/drilldown/list',
relationTabDrilldownList: '/interface/application/performance/overview/tab/relation/tab/list'
}
export const linkMonitorUrl = {
curUrl: '/interface/link/overview/drilldown/dimension/analysis',
cycleUrl: '/interface/link/overview/drilldown/dimension/cycleAnalysis',
drilldownCurUrl: '/interface/link/overview/drilldown/dimension/analysis',
drilldownCycleUrl: '/interface/link/overview/drilldown/dimension/cycleAnalysis',
drilldownList: ''
drilldownList: '/interface/link/overview/tab/relation/tab/list',
relationTabDrilldownList: '/interface/link/overview/tab/relation/tab/list'
}
// dns:接口url主URL
export const dnsSearchUrl = {
@@ -301,7 +305,8 @@ export const dnsSearchUrl = {
cycleUrl: '/interface/dns/overview/dimensionCycleAnalysis',
drilldownCurUrl: '/interface/dns/overview/drilldown/dimensionAnalysis',
drilldownCycleUrl: '/interface/dns/overview/drilldown/dimensionCycleAnalysis',
drilldownList: '/interface/dns/overview/drilldown/list'
drilldownList: '/interface/dns/overview/drilldown/list',
relationTabDrilldownList: '/interface/dns/overview/tab/relation/tab/list'
}
export const cycle = {

View File

@@ -94,7 +94,7 @@
v-model="dropDownValue"
@input="dropDownSearch(item.prop)"></el-input>
</div>
<ul class="select-dropdown" id="tabSearchSelectDropdown" @scroll="scrollList(item.prop)">
<ul class="select-dropdown" :id="`tabSearchSelectDropdown${tab.prop}`" @scroll="scrollList(item.prop,tab.prop)">
<li v-for="item in tabSearchColumnValueListShow" title='' :key="item" :id="`${item}${tab.prop}`"
class="select-dropdown__item" @click="changeValue(item)">
<template v-if="curTabProp === 'qtype'">
@@ -487,18 +487,29 @@ export default {
type = curTab.prop
}
}
const params = {
let params = {
startTime: getSecond(this.timeFilter.startTime),
endTime: getSecond(this.timeFilter.endTime),
limit: 10 * this.curPageNum++,
type: type,
name: this.dropDownValue ? this.dropDownValue : ''
}
let url = curTableInCode.url.drilldownList
if(this.isDrilldown() || this.tableType === fromRoute.linkMonitor){
url = curTableInCode.url.relationTabDrilldownList
const condition = this.getQueryCondition()
if (condition) {
params = {
...params,
q: condition
}
}
}
// 有的界面刷新时没有drilldownList接口地址会报404
if (!curTableInCode.url.drilldownList) {
if (!url) {
return true
}
axios.get(curTableInCode.url.drilldownList, { params }).then(async response => {
axios.get(url, { params }).then(async response => {
if (response.status === 200) {
this.tabSearchColumnValueListShow = response.data.data.result
if (this.$route.params.typeName === fromRoute.dnsServiceInsights) {
@@ -584,9 +595,9 @@ export default {
this.curPageNum = 1
this.initDropdownList(prop)
},
scrollList (prop) {
const obj = document.getElementById('tabSearchSelectDropdown')
if (obj.scrollTop + obj.clientHeight === obj.scrollHeight) {
scrollList (prop,tabProp) {
const obj = document.getElementById('tabSearchSelectDropdown'+tabProp)
if ((obj.scrollTop + obj.clientHeight === obj.scrollHeight) && obj.scrollHeight !== 0) {
this.initDropdownList(prop)
}
},