Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -373,6 +373,7 @@ export default {
|
||||
params.type = 'overviewProvide'
|
||||
get(api.dict, params).then(res => {
|
||||
if (res.code === 200) {
|
||||
res.data.list = res.data.list.filter(l => !this.appData.some(pd => pd.type === 'provider' && pd.name === l.value))
|
||||
this.pageObj.pages = res.data.pages
|
||||
res.data.list.forEach(t => {
|
||||
this.toSaveApp.forEach(e => {
|
||||
@@ -396,6 +397,7 @@ export default {
|
||||
} else if (this.appTypeTab == 1) {
|
||||
params.type = 'overviewApp'
|
||||
get(api.dict, params).then(res => {
|
||||
res.data.list = res.data.list.filter(l => !this.appData.some(pd => pd.type === 'app' && pd.name === l.value))
|
||||
if (res.code === 200) {
|
||||
this.pageObj.pages = res.data.pages
|
||||
res.data.list.forEach(t => {
|
||||
@@ -505,20 +507,29 @@ export default {
|
||||
this.appData.splice(index, 1)
|
||||
})
|
||||
},
|
||||
deleteDuplicate (arr) {
|
||||
const arr1 = []
|
||||
arr.forEach(a => {
|
||||
if (!arr1.find(a1 => a.name === a1.name && a.type === a1.type)) {
|
||||
arr1.push(a)
|
||||
}
|
||||
})
|
||||
return arr1
|
||||
},
|
||||
save () {
|
||||
if (this.toSaveApp.length > 0) {
|
||||
const toSaveParams = this.chart.params.app ? this.chart.params : { app: [] }
|
||||
if (toSaveParams.app.some(p => p.user === parseInt(localStorage.getItem(storageKey.userId)))) {
|
||||
toSaveParams.app.forEach(p => {
|
||||
if (p.user === parseInt(localStorage.getItem(storageKey.userId))) {
|
||||
p.list = [...p.list, ...this.toSaveApp]
|
||||
p.list = this.deleteDuplicate([...p.list, ...this.toSaveApp])
|
||||
}
|
||||
})
|
||||
} else {
|
||||
const defaultApp = toSaveParams.app.find(p => p.user === 'default')
|
||||
toSaveParams.app.push({
|
||||
user: parseInt(localStorage.getItem(storageKey.userId)),
|
||||
list: [...defaultApp.list, ...this.toSaveApp]
|
||||
list: this.deleteDuplicate([...defaultApp.list, ...this.toSaveApp])
|
||||
})
|
||||
}
|
||||
const toSaveChart = {
|
||||
|
||||
@@ -67,12 +67,16 @@ export default {
|
||||
typeVal: this.$store.getters.getBreadcrumbColumnValue
|
||||
}
|
||||
getData(api.npm.overview.map, params).then(res => {
|
||||
const subParams = {
|
||||
...params,
|
||||
params: res.map(r => r.country).join(',')
|
||||
}
|
||||
// 计算分数
|
||||
const tcpRequest = get(api.npm.overview.mapTcp, params)
|
||||
const httpRequest = get(api.npm.overview.mapHttp, params)
|
||||
const sslRequest = get(api.npm.overview.mapSsl, params)
|
||||
const tcpLostRequest = get(api.npm.overview.mapPacketLoss, params)
|
||||
const packetRetransRequest = get(api.npm.overview.mapPacketRetrans, params)
|
||||
const tcpRequest = get(api.npm.overview.mapTcp, subParams)
|
||||
const httpRequest = get(api.npm.overview.mapHttp, subParams)
|
||||
const sslRequest = get(api.npm.overview.mapSsl, subParams)
|
||||
const tcpLostRequest = get(api.npm.overview.mapPacketLoss, subParams)
|
||||
const packetRetransRequest = get(api.npm.overview.mapPacketRetrans, subParams)
|
||||
Promise.all([tcpRequest, httpRequest, sslRequest, tcpLostRequest, packetRetransRequest]).then(res2 => {
|
||||
const keyPre = ['tcp', 'http', 'ssl', 'tcpLost', 'packetRetrans']
|
||||
const mapData = res
|
||||
|
||||
@@ -49,7 +49,7 @@ export default {
|
||||
} else {
|
||||
this.side = 'server'
|
||||
}
|
||||
if (condition && type) {
|
||||
if (condition.length > 1 && type) {
|
||||
params.q = `${type}='${condition[1]}' and side='${this.side}'`
|
||||
params.type = type
|
||||
}
|
||||
@@ -82,7 +82,7 @@ export default {
|
||||
} else {
|
||||
this.side = 'server'
|
||||
}
|
||||
if (condition && type) {
|
||||
if (condition.length > 1 && type) {
|
||||
params.q = `${type}='${condition[1]}' and side='${this.side}'`
|
||||
params.type = type
|
||||
}
|
||||
@@ -123,7 +123,9 @@ export default {
|
||||
if (scoreInfo.score > 6) {
|
||||
scoreInfo.score = 6
|
||||
}
|
||||
this.$store.commit('setNpmThirdLevelMenuScore', scoreInfo.score)
|
||||
if (!params.q && this.chart.id === 44) {
|
||||
this.$store.commit('setNpmThirdLevelMenuScore', scoreInfo.score)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.toggleLoading(false)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user