fix: 执行lint

This commit is contained in:
chenjinsong
2022-12-08 16:09:46 +08:00
parent 136d98649d
commit 4bba03d41d
26 changed files with 362 additions and 371 deletions

View File

@@ -12,8 +12,9 @@ module.exports = {
], ],
plugins: [ plugins: [
'@vue/babel-plugin-jsx', '@vue/babel-plugin-jsx',
['@babel/proposal-class-properties', { loose: true }], ['@babel/plugin-proposal-class-properties', { loose: true }],
['@babel/plugin-proposal-private-methods', { loose: true }], ['@babel/plugin-proposal-private-methods', { loose: true }],
['@babel/plugin-proposal-private-property-in-object', { loose: true }],
'@babel/transform-runtime', '@babel/transform-runtime',
'lodash' 'lodash'
], ],

File diff suppressed because one or more lines are too long

View File

@@ -23,7 +23,7 @@ import CodeMirror from 'codemirror'
import { toRaw } from 'vue' import { toRaw } from 'vue'
import _ from 'lodash' import _ from 'lodash'
import { columnType } from '@/components/advancedSearch/meta/meta' import { columnType } from '@/components/advancedSearch/meta/meta'
import {handleErrorTip} from "@/components/advancedSearch/meta/error"; import { handleErrorTip } from '@/components/advancedSearch/meta/error'
export default { export default {
name: 'TextMode', name: 'TextMode',

View File

@@ -233,6 +233,7 @@ export default class Parser {
break break
} }
} else if (s === ' ') { } else if (s === ' ') {
// 预留
} else if (s === '(') { } else if (s === '(') {
token = new Token(types.leftBracket, s) token = new Token(types.leftBracket, s)
token.setStart(i) token.setStart(i)

View File

@@ -23,8 +23,8 @@
</template> </template>
<script> <script>
import { defaultPageSize } from '@/utils/constants' import { defaultPageSize, storageKey } from '@/utils/constants'
import { storageKey } from '@/utils/constants'
import { urlParamsHandler, overwriteUrl } from '@/utils/tools' import { urlParamsHandler, overwriteUrl } from '@/utils/tools'
import { ref } from 'vue' import { ref } from 'vue'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'

View File

@@ -4,27 +4,27 @@ const openMock = false
if (openMock) { if (openMock) {
Mock.mock(new RegExp(BASE_CONFIG.baseUrl + 'visual/panel.*'), 'get', function (requestObj) { Mock.mock(new RegExp(BASE_CONFIG.baseUrl + 'visual/panel.*'), 'get', function (requestObj) {
return { return {
"msg": "success", msg: 'success',
"code": 200, code: 200,
"data": { data: {
"total": 1, total: 1,
"pageSize": 10, pageSize: 10,
"pages": 1, pages: 1,
"pageNo": 1, pageNo: 1,
"list": [ list: [
{ {
"id": 2, id: 2,
"name": "Network & App", name: 'Network & App',
"i18n": "npm.npm", i18n: 'npm.npm',
"type": 2, type: 2,
"params": "", params: '',
"cby": 1, cby: 1,
"ctime": "2021-06-03 08:27:32", ctime: '2021-06-03 08:27:32',
"uby": 1, uby: 1,
"utime": "2021-06-03 08:28:10", utime: '2021-06-03 08:28:10',
"remark": "", remark: '',
"state": 1, state: 1,
"buildIn": 1 buildIn: 1
} }
] ]
} }

View File

@@ -64,9 +64,9 @@ const user = {
if (tempArr[1]) { if (tempArr[1]) {
tempArr = tempArr[1].split('&') tempArr = tempArr[1].split('&')
tempArr.forEach(t => { tempArr.forEach(t => {
let firstEqualIndex = t.indexOf('=') const firstEqualIndex = t.indexOf('=')
let key = t.substring(0, firstEqualIndex) const key = t.substring(0, firstEqualIndex)
let value = t.substring(firstEqualIndex + 1) const value = t.substring(firstEqualIndex + 1)
query[key] = value query[key] = value
}) })
} }
@@ -97,8 +97,8 @@ const user = {
version: defaultConfigs.version, version: defaultConfigs.version,
config: defaultConfigs.config config: defaultConfigs.config
}) })
let userId = localStorage.getItem(storageKey.userId) const userId = localStorage.getItem(storageKey.userId)
let oldVersion = await getConfigVersion(userId) const oldVersion = await getConfigVersion(userId)
if (oldVersion !== defaultConfigs.version) { if (oldVersion !== defaultConfigs.version) {
db[dbDrilldownTableConfig].delete(userId) db[dbDrilldownTableConfig].delete(userId)
} }

View File

@@ -42,6 +42,7 @@
</template> </template>
<script> <script>
import _ from 'lodash'
export default { export default {
name: 'ChartDomainRecursiveResolve', name: 'ChartDomainRecursiveResolve',
props: { props: {

View File

@@ -47,7 +47,7 @@ export default {
}, },
methods: { methods: {
handleQueryParams (queryParams) { handleQueryParams (queryParams) {
return this.timeFilter = { this.timeFilter = {
startTime: Number(queryParams.startTime) * 1000, startTime: Number(queryParams.startTime) * 1000,
endTime: Number(queryParams.endTime) * 1000 endTime: Number(queryParams.endTime) * 1000
} }

View File

@@ -17,7 +17,6 @@
</template> </template>
<script> <script>
import _ from 'lodash'
export default { export default {
name: 'ChartOneSituationStatistics', name: 'ChartOneSituationStatistics',
props: { props: {

View File

@@ -100,7 +100,7 @@
<div class="ship-body-list-title">{{$t('relationShip.alert')}}</div> <div class="ship-body-list-title">{{$t('relationShip.alert')}}</div>
<div class="ship-body-list-value security"> <div class="ship-body-list-value security">
<template v-if="shipSeverity.length > 0"> <template v-if="shipSeverity.length > 0">
<span v-for="ship in shipSeverity" class="ship-severity"> <span v-for="ship in shipSeverity" class="ship-severity" :key="ship">
<span class="ship-body-list-security-alert" :class="iconClass(ship)">{{ ship.eventSeverity }}</span> <span class="ship-body-list-security-alert" :class="iconClass(ship)">{{ ship.eventSeverity }}</span>
<span class="ship-body-list-security-length">{{ ship.totalNumberOfEvents }}</span> <span class="ship-body-list-security-length">{{ ship.totalNumberOfEvents }}</span>
</span> </span>

View File

@@ -1,12 +1,12 @@
export const appTestData = [ export const appTestData = [
{ {
"type": "bytes", type: 'bytes',
"l11": { l11: {
"analysis": { analysis: {
"rate": 2, rate: 2,
"total":2245435 total: 2245435
}, },
"values": [ values: [
[ [
1435781430781, 1435781430781,
3 3
@@ -17,12 +17,12 @@ export const appTestData = [
] ]
] ]
}, },
"a0": { a0: {
"analysis": { analysis: {
"rate": 2, rate: 2,
"total":3245435 total: 3245435
}, },
"values": [ values: [
[ [
1435781430781, 1435781430781,
1 1
@@ -35,13 +35,13 @@ export const appTestData = [
} }
}, },
{ {
"type": "packets", type: 'packets',
"l11": { l11: {
"analysis": { analysis: {
"rate": 3, rate: 3,
"total":4245435 total: 4245435
}, },
"values": [ values: [
[ [
1435781430781, 1435781430781,
4 4
@@ -52,12 +52,12 @@ export const appTestData = [
] ]
] ]
}, },
"a0": { a0: {
"analysis": { analysis: {
"rate": 3, rate: 3,
"total":2245435 total: 2245435
}, },
"values": [ values: [
[ [
1435781430781, 1435781430781,
2 2
@@ -70,13 +70,13 @@ export const appTestData = [
} }
}, },
{ {
"type": "sessions", type: 'sessions',
"l11": { l11: {
"analysis": { analysis: {
"rate": 2, rate: 2,
"total": 2245435 total: 2245435
}, },
"values": [ values: [
[ [
1435781430781, 1435781430781,
3 3
@@ -87,12 +87,12 @@ export const appTestData = [
] ]
] ]
}, },
"a0": { a0: {
"analysis": { analysis: {
"rate": 3, rate: 3,
"total": 3245435 total: 3245435
}, },
"values": [ values: [
[ [
1435781430781, 1435781430781,
1 1
@@ -107,64 +107,64 @@ export const appTestData = [
] ]
export const appPrevTestData = [ export const appPrevTestData = [
{ {
"type": "bytes", type: 'bytes',
"l11": { l11: {
"rate": 2, rate: 2,
"total":3245435 total: 3245435
}, },
"a0": { a0: {
"rate": 3, rate: 3,
"total":4245435 total: 4245435
} }
}, },
{ {
"type": "packets", type: 'packets',
"l11": { l11: {
"rate": 2, rate: 2,
"total":3245435 total: 3245435
}, },
"a0": { a0: {
"rate": 4, rate: 4,
"total":4245435 total: 4245435
} }
}, },
{ {
"type": "sessions", type: 'sessions',
"l11": { l11: {
"rate": 3, rate: 3,
"total":233451 total: 233451
}, },
"a0": { a0: {
"rate": 3, rate: 3,
"total":4245435 total: 4245435
} }
} }
] ]
export const providerTestData = [ export const providerTestData = [
{ {
"type": "bytes", type: 'bytes',
"d3": { d3: {
"analysis": { analysis: {
"rate": 4, rate: 4,
"total":4245435 total: 4245435
}, },
"values": [ values: [
[ [
1435781430781, 1435781430781,
"1" '1'
], ],
[ [
1435781431781, 1435781431781,
"1" '1'
] ]
] ]
}, },
"a0": { a0: {
"analysis": { analysis: {
"rate": 2, rate: 2,
"total":3245435 total: 3245435
}, },
"values": [ values: [
[ [
1435781430781, 1435781430781,
1 1
@@ -177,13 +177,13 @@ export const providerTestData = [
} }
}, },
{ {
"type": "packets", type: 'packets',
"d3": { d3: {
"analysis": { analysis: {
"rate": 3, rate: 3,
"total": 1245435 total: 1245435
}, },
"values": [ values: [
[ [
1435781430781, 1435781430781,
2 2
@@ -194,12 +194,12 @@ export const providerTestData = [
] ]
] ]
}, },
"a0": { a0: {
"analysis": { analysis: {
"rate": 3, rate: 3,
"total": 3245435 total: 3245435
}, },
"values": [ values: [
[ [
1435781430781, 1435781430781,
5 5
@@ -212,29 +212,29 @@ export const providerTestData = [
} }
}, },
{ {
"type": "sessions", type: 'sessions',
"d3": { d3: {
"analysis": { analysis: {
"rate": 2, rate: 2,
"total":2245435 total: 2245435
}, },
"values": [ values: [
[ [
1435781430781, 1435781430781,
"1" '1'
], ],
[ [
1435781431781, 1435781431781,
"1" '1'
] ]
] ]
}, },
"a0": { a0: {
"analysis": { analysis: {
"rate": 3, rate: 3,
"total": 3245435 total: 3245435
}, },
"values": [ values: [
[ [
1435781430781, 1435781430781,
1 1
@@ -249,36 +249,36 @@ export const providerTestData = [
] ]
export const providerPrevTestData = [ export const providerPrevTestData = [
{ {
"type": "bytes", type: 'bytes',
"d3": { d3: {
"rate": 2, rate: 2,
"total":2245435 total: 2245435
}, },
"a0": { a0: {
"rate": 3, rate: 3,
"total":4245435 total: 4245435
} }
}, },
{ {
"type": "packets", type: 'packets',
"d3": { d3: {
"rate": 2, rate: 2,
"total":3245435 total: 3245435
}, },
"a0": { a0: {
"rate": 4, rate: 4,
"total":4245435 total: 4245435
} }
}, },
{ {
"type": "sessions", type: 'sessions',
"d3": { d3: {
"rate": 3, rate: 3,
"total":233451 total: 233451
}, },
"a0": { a0: {
"rate": 3, rate: 3,
"total":4245435 total: 4245435
} }
} }
] ]

View File

@@ -60,7 +60,7 @@
<script> <script>
import { api } from '@/utils/api' import { api } from '@/utils/api'
import { dateFormatByAppearance, getSecond } from '@/utils/date-util' import { getSecond } from '@/utils/date-util'
import { get } from '@/utils/http' import { get } from '@/utils/http'
import chartMixin from '@/views/charts2/chart-mixin' import chartMixin from '@/views/charts2/chart-mixin'

View File

@@ -1,233 +1,233 @@
export const mapData = [ export const mapData = [
{ {
"score": 5, score: 5,
"locationId": "AU", locationId: 'AU',
"direction": "server", direction: 'server',
"locationCountry": "australia" locationCountry: 'australia'
}, },
{ {
"score": 3, score: 3,
"locationId": "AT", locationId: 'AT',
"direction": "server", direction: 'server',
"locationCountry": "austria" locationCountry: 'austria'
}, },
{ {
"score": 1, score: 1,
"locationId": "", locationId: '',
"direction": "server", direction: 'server',
"locationCountry": "bolivia" locationCountry: 'bolivia'
}, },
{ {
"score": 5, score: 5,
"locationId": "BR", locationId: 'BR',
"direction": "server", direction: 'server',
"locationCountry": "brazil" locationCountry: 'brazil'
}, },
{ {
"score": 1, score: 1,
"locationId": "CM", locationId: 'CM',
"direction": "server", direction: 'server',
"locationCountry": "cameroon" locationCountry: 'cameroon'
}, },
{ {
"score": 5, score: 5,
"locationId": "CL", locationId: 'CL',
"direction": "server", direction: 'server',
"locationCountry": "chile" locationCountry: 'chile'
}, },
{ {
"score": 4, score: 4,
"locationId": "CN", locationId: 'CN',
"direction": "server", direction: 'server',
"locationCountry": "china" locationCountry: 'china'
}, },
{ {
"score": 1, score: 1,
"locationId": "CY", locationId: 'CY',
"direction": "server", direction: 'server',
"locationCountry": "cyprus" locationCountry: 'cyprus'
}, },
{ {
"score": 1, score: 1,
"locationId": "CZ", locationId: 'CZ',
"direction": "server", direction: 'server',
"locationCountry": "czech republic" locationCountry: 'czech republic'
}, },
{ {
"score": 5, score: 5,
"locationId": "FR", locationId: 'FR',
"direction": "server", direction: 'server',
"locationCountry": "france" locationCountry: 'france'
}, },
{ {
"score": 2, score: 2,
"locationId": "ID", locationId: 'ID',
"direction": "server", direction: 'server',
"locationCountry": "indonesia" locationCountry: 'indonesia'
}, },
{ {
"score": 2, score: 2,
"locationId": "IE", locationId: 'IE',
"direction": "server", direction: 'server',
"locationCountry": "ireland" locationCountry: 'ireland'
}, },
{ {
"score": 5, score: 5,
"locationId": "JP", locationId: 'JP',
"direction": "server", direction: 'server',
"locationCountry": "japan" locationCountry: 'japan'
}, },
{ {
"score": 1, score: 1,
"locationId": "KW", locationId: 'KW',
"direction": "server", direction: 'server',
"locationCountry": "kuwait" locationCountry: 'kuwait'
}, },
{ {
"score": 1, score: 1,
"locationId": "KG", locationId: 'KG',
"direction": "server", direction: 'server',
"locationCountry": "kyrgyzstan" locationCountry: 'kyrgyzstan'
}, },
{ {
"score": 2, score: 2,
"locationId": "MX", locationId: 'MX',
"direction": "server", direction: 'server',
"locationCountry": "mexico" locationCountry: 'mexico'
}, },
{ {
"score": 1, score: 1,
"locationId": "CN-AH", locationId: 'CN-AH',
"direction": "server", direction: 'server',
"locationCountry": "moldova" locationCountry: 'moldova'
}, },
{ {
"score": 4, score: 4,
"locationId": "MN", locationId: 'MN',
"direction": "server", direction: 'server',
"locationCountry": "mongolia" locationCountry: 'mongolia'
}, },
{ {
"score": 1, score: 1,
"locationId": "MZ", locationId: 'MZ',
"direction": "server", direction: 'server',
"locationCountry": "mozambique" locationCountry: 'mozambique'
}, },
{ {
"score": 1, score: 1,
"locationId": "NZ", locationId: 'NZ',
"direction": "server", direction: 'server',
"locationCountry": "new zealand" locationCountry: 'new zealand'
}, },
{ {
"score": 4, score: 4,
"locationId": "NE", locationId: 'NE',
"direction": "server", direction: 'server',
"locationCountry": "niger" locationCountry: 'niger'
}, },
{ {
"score": 1, score: 1,
"locationId": "PT", locationId: 'PT',
"direction": "server", direction: 'server',
"locationCountry": "portugal" locationCountry: 'portugal'
}, },
{ {
"score": 3, score: 3,
"locationId": "RO", locationId: 'RO',
"direction": "server", direction: 'server',
"locationCountry": "romania" locationCountry: 'romania'
}, },
{ {
"score": 1, score: 1,
"locationId": "SR", locationId: 'SR',
"direction": "server", direction: 'server',
"locationCountry": "suriname" locationCountry: 'suriname'
}, },
{ {
"score": 4, score: 4,
"locationId": "SE", locationId: 'SE',
"direction": "server", direction: 'server',
"locationCountry": "sweden" locationCountry: 'sweden'
}, },
{ {
"score": 3, score: 3,
"locationId": "CH", locationId: 'CH',
"direction": "server", direction: 'server',
"locationCountry": "switzerland" locationCountry: 'switzerland'
}, },
{ {
"score": 1, score: 1,
"locationId": "TH", locationId: 'TH',
"direction": "server", direction: 'server',
"locationCountry": "thailand" locationCountry: 'thailand'
}, },
{ {
"score": 5, score: 5,
"locationId": "", locationId: '',
"direction": "server", direction: 'server',
"locationCountry": "the netherlands" locationCountry: 'the netherlands'
}, },
{ {
"score": 1, score: 1,
"locationId": "TK", locationId: 'TK',
"direction": "server", direction: 'server',
"locationCountry": "tokelau" locationCountry: 'tokelau'
}, },
{ {
"score": 2, score: 2,
"locationId": "AE", locationId: 'AE',
"direction": "server", direction: 'server',
"locationCountry": "united arab emirates" locationCountry: 'united arab emirates'
}, },
{ {
"score": 6, score: 6,
"locationId": "RU", locationId: 'RU',
"direction": "server", direction: 'server',
"locationCountry": "russia" locationCountry: 'russia'
}, },
{ {
"score": 6, score: 6,
"locationId": "US", locationId: 'US',
"direction": "server", direction: 'server',
"locationCountry": "united states" locationCountry: 'united states'
}, },
{ {
"score": 3, score: 3,
"locationId": "UZ", locationId: 'UZ',
"direction": "server", direction: 'server',
"locationCountry": "uzbekistan" locationCountry: 'uzbekistan'
}, },
{ {
"score": 1, score: 1,
"locationId": "", locationId: '',
"direction": "server", direction: 'server',
"locationCountry": "venezuela" locationCountry: 'venezuela'
} }
] ]
export const drillDownData = [ export const drillDownData = [
{ {
"score": 1, score: 1,
"locationId": "CN-AH", locationId: 'CN-AH',
"direction": "server", direction: 'server',
"locationCountry": "moldova" locationCountry: 'moldova'
}, },
{ {
"score": 3, score: 3,
"locationId": "CN-SH", locationId: 'CN-SH',
"direction": "server", direction: 'server',
"locationCountry": "moldova" locationCountry: 'moldova'
}, },
{ {
"score": 6, score: 6,
"locationId": "CN-CQ", locationId: 'CN-CQ',
"direction": "server", direction: 'server',
"locationCountry": "moldova" locationCountry: 'moldova'
}, },
{ {
"score": 2, score: 2,
"locationId": "CN-FJ", locationId: 'CN-FJ',
"direction": "server", direction: 'server',
"locationCountry": "moldova" locationCountry: 'moldova'
} }
] ]

View File

@@ -201,12 +201,11 @@ import { ref } from 'vue'
import { operationType, unitTypes, networkTable, tableColumnType, networkDefaultLimit, curTabState, storageKey, dbDrilldownTableConfig, fromRoute } from '@/utils/constants' import { operationType, unitTypes, networkTable, tableColumnType, networkDefaultLimit, curTabState, storageKey, dbDrilldownTableConfig, fromRoute } from '@/utils/constants'
import { get } from '@/utils/http' import { get } from '@/utils/http'
import unitConvert from '@/utils/unit-convert' import unitConvert from '@/utils/unit-convert'
import { getChainRatio, computeScore, urlParamsHandler, overwriteUrl, getUserDrilldownTableGeo, readDrilldownTableConfigByUser, combinDrilldownTableWithUserConfig, getDnsMapData,handleSpecialValue,getConfigVersion } from '@/utils/tools' import { getChainRatio, computeScore, urlParamsHandler, overwriteUrl, readDrilldownTableConfigByUser, combinDrilldownTableWithUserConfig, getDnsMapData, handleSpecialValue, getConfigVersion } from '@/utils/tools'
import { getSecond } from '@/utils/date-util' import { getSecond } from '@/utils/date-util'
import chartMixin from '@/views/charts2/chart-mixin' import chartMixin from '@/views/charts2/chart-mixin'
import ChartNoData from '@/views/charts/charts/ChartNoData'
import { db } from '@/indexedDB' import { db } from '@/indexedDB'
import { api, getDictList } from '@/utils/api' import _ from 'lodash'
export default { export default {
name: 'NetworkOverviewTabs', name: 'NetworkOverviewTabs',
@@ -274,9 +273,6 @@ export default {
default: 'Bits/s' default: 'Bits/s'
} }
}, },
components: {
ChartNoData
},
watch: { watch: {
timeFilter: { timeFilter: {
handler (n) { handler (n) {
@@ -623,14 +619,14 @@ export default {
endTime: getSecond(this.timeFilter.endTime) endTime: getSecond(this.timeFilter.endTime)
} }
if (tabList.length > 0) { if (tabList.length > 0) {
let conditionGroup = tabList.filter(item => item != '') const conditionGroup = tabList.filter(item => item != '')
let conditionHandleRlt = [] const conditionHandleRlt = []
conditionGroup.forEach(condition => { conditionGroup.forEach(condition => {
condition = handleSpecialValue(condition)// condition.replaceAll("'", "\\\\'") condition = handleSpecialValue(condition)// condition.replaceAll("'", "\\\\'")
condition = "'" + condition + "'" condition = "'" + condition + "'"
conditionHandleRlt.push(condition) conditionHandleRlt.push(condition)
}) })
queryParams.params = conditionHandleRlt.join(",") queryParams.params = conditionHandleRlt.join(',')
queryParams.type = curTab.prop queryParams.type = curTab.prop
} }
@@ -871,7 +867,7 @@ export default {
this.tableData.forEach(val => { this.tableData.forEach(val => {
arr.push(val) arr.push(val)
}) })
if (column.order == 'descending') { if (column.order === 'descending') {
arr.sort((a, b) => { arr.sort((a, b) => {
const str1 = Array.isArray(a[column.prop]) ? a[column.prop][0] : a[column.prop] const str1 = Array.isArray(a[column.prop]) ? a[column.prop][0] : a[column.prop]
const str2 = Array.isArray(b[column.prop]) ? b[column.prop][0] : b[column.prop] const str2 = Array.isArray(b[column.prop]) ? b[column.prop][0] : b[column.prop]
@@ -892,7 +888,7 @@ export default {
const char1 = aObj[i] const char1 = aObj[i]
const char2 = bObj[i] const char2 = bObj[i]
const char1Type = this.getChartType(char1) const char1Type = this.getChartType(char1)
const char2Type = this.getChartType(char2) // const char2Type = this.getChartType(char2)
if (char1 === char2) { if (char1 === char2) {
continue continue
} else { } else {
@@ -911,7 +907,7 @@ export default {
} }
}) })
this.tableData = arr this.tableData = arr
} else if (column.order == 'ascending') { } else if (column.order === 'ascending') {
arr.sort((a, b) => { arr.sort((a, b) => {
const str1 = Array.isArray(a[column.prop]) ? a[column.prop][0] : a[column.prop] const str1 = Array.isArray(a[column.prop]) ? a[column.prop][0] : a[column.prop]
const str2 = Array.isArray(b[column.prop]) ? b[column.prop][0] : b[column.prop] const str2 = Array.isArray(b[column.prop]) ? b[column.prop][0] : b[column.prop]
@@ -932,7 +928,7 @@ export default {
const char1 = aObj[i] const char1 = aObj[i]
const char2 = bObj[i] const char2 = bObj[i]
const char1Type = this.getChartType(char1) const char1Type = this.getChartType(char1)
const char2Type = this.getChartType(char2) // const char2Type = this.getChartType(char2)
if (char1 === char2) { if (char1 === char2) {
continue continue
} else { } else {
@@ -966,7 +962,6 @@ export default {
} }
this.urlChangeParams[this.curTabState.tabOperationType] = operationType.changeMetric this.urlChangeParams[this.curTabState.tabOperationType] = operationType.changeMetric
const curTab = this.getCurTab() const curTab = this.getCurTab()
const label = curTab.label
this.urlChangeParams[this.curTabState.tableMetric] = this.metric this.urlChangeParams[this.curTabState.tableMetric] = this.metric
let queryParams = { let queryParams = {
@@ -1180,11 +1175,11 @@ export default {
} }
}) })
} else { } else {
const changeTab = tabList.find(item => item.name == tabName)// 下钻的tab const changeTab = tabList.find(item => item.name === tabName)// 下钻的tab
this.list = changeTab.drilldownTabs this.list = changeTab.drilldownTabs
this.list.forEach(tab => { /* this.list.forEach(tab => {
const hiddenTab = tabList.find(item => item.name == tab.name) const hiddenTab = tabList.find(item => item.name == tab.name)
}) }) */
const curTab = this.getCurTab(clickTab) const curTab = this.getCurTab(clickTab)
tabList.forEach(tab => { tabList.forEach(tab => {
if (tab.name === curTab.name) { if (tab.name === curTab.name) {
@@ -1194,14 +1189,14 @@ export default {
} }
await this.saveUserLocalConfig() await this.saveUserLocalConfig()
let forthMenuName = '' /* let forthMenuName = ''
if (clickTab.prop === 'qtype') { if (clickTab.prop === 'qtype') {
forthMenuName = this.dnsQtypeMapData.get(columnValue) forthMenuName = this.dnsQtypeMapData.get(columnValue)
} else if (clickTab.prop === 'rcode') { } else if (clickTab.prop === 'rcode') {
forthMenuName = this.dnsRcodeMapData.get(columnValue) forthMenuName = this.dnsRcodeMapData.get(columnValue)
} else { } else {
forthMenuName = columnValue forthMenuName = columnValue
} } */
this.$store.getters.menuList.forEach(menu => { this.$store.getters.menuList.forEach(menu => {
if (this.$_.isEmpty(menu.children) && menu.route) { if (this.$_.isEmpty(menu.children) && menu.route) {
if (this.$route.path === menu.route) { if (this.$route.path === menu.route) {
@@ -1226,7 +1221,7 @@ export default {
} }
}) })
if (!this.getUrlParam(this.curTabState.tabIndex)) { if (!this.getUrlParam(this.curTabState.tabIndex)) {
let thirdMenu = this.urlChangeParams[this.curTabState.thirdMenu] const thirdMenu = this.urlChangeParams[this.curTabState.thirdMenu]
if (thirdMenu === 'network.serverIps') { if (thirdMenu === 'network.serverIps') {
this.urlChangeParams[this.curTabState.tabIndex] = 1 this.urlChangeParams[this.curTabState.tabIndex] = 1
} else if (thirdMenu === 'network.clientIps' || thirdMenu === 'network.ips') { } else if (thirdMenu === 'network.clientIps' || thirdMenu === 'network.ips') {
@@ -1618,8 +1613,6 @@ export default {
if (tab && tab.hasMetricSearch === true) { if (tab && tab.hasMetricSearch === true) {
const columnsForMetric = tab.metrics.find(metric => metric.name === this.metric) const columnsForMetric = tab.metrics.find(metric => metric.name === this.metric)
columnsForMetric.columns = columns columnsForMetric.columns = columns
} else {
tab.columns = tab.columns
} }
}, },
combineColumnList (tabName) { combineColumnList (tabName) {

View File

@@ -177,7 +177,7 @@ export default {
} else { } else {
this.npmNetworkLastCycleData = [res] this.npmNetworkLastCycleData = [res]
} }
let timer = null const timer = null
if (timer) { if (timer) {
clearTimeout(timer) clearTimeout(timer)
} }
@@ -185,7 +185,7 @@ export default {
this.npmNetworkQuantity(this.npmNetworkCycleData, this.npmNetworkLastCycleData, 0) this.npmNetworkQuantity(this.npmNetworkCycleData, this.npmNetworkLastCycleData, 0)
}, 300) }, 300)
}).catch((e) => { }).catch((e) => {
let timer = null const timer = null
if (timer) { if (timer) {
clearTimeout(timer) clearTimeout(timer)
} }

View File

@@ -89,7 +89,7 @@ export default {
mounted () { mounted () {
const { query } = useRoute() const { query } = useRoute()
const tabIndexParam = query.tabIndex const tabIndexParam = query.tabIndex
let curTabIndexInUrl = tabIndexParam ? parseInt(tabIndexParam) : null const curTabIndexInUrl = tabIndexParam ? parseInt(tabIndexParam) : null
if (this.chart.panelId === drillDownPanelTypeMapping.npmOverviewIp) { if (this.chart.panelId === drillDownPanelTypeMapping.npmOverviewIp) {
const self = this const self = this
// 当client或server的session数为0时对应tab置灰不可选默认高亮另一个不为0的tab // 当client或server的session数为0时对应tab置灰不可选默认高亮另一个不为0的tab
@@ -107,7 +107,7 @@ export default {
self.serverSessions = self.sessionData.serverSessions / (self.sessionData.clientSessions * 1 + self.sessionData.serverSessions * 1) self.serverSessions = self.sessionData.serverSessions / (self.sessionData.clientSessions * 1 + self.sessionData.serverSessions * 1)
} }
}).finally(() => { }).finally(() => {
let thirdMenu = this.$route.query['thirdMenu'] const thirdMenu = this.$route.query.thirdMenu
self.tabs[0].disable = false self.tabs[0].disable = false
self.tabs[1].disable = false self.tabs[1].disable = false
let curTabIndex = 0 let curTabIndex = 0
@@ -152,7 +152,7 @@ export default {
}) })
}) })
} else { } else {
this.currentTab = curTabIndexInUrl ? curTabIndexInUrl : 0 this.currentTab = curTabIndexInUrl || 0
this.isCurTabReady = true this.isCurTabReady = true
setTimeout(() => { setTimeout(() => {
this.handleActiveBar(this.currentTab) this.handleActiveBar(this.currentTab)

View File

@@ -1,5 +1,4 @@
import { import {
chartColor,
chartColor1, chartColor1,
chartColor2, chartColor2,
chartColor3, chartColor3,

View File

@@ -1,7 +1,5 @@
import { import {
chartColor, tooLongFormatter
tooLongFormatter,
axisFormatter
} from '@/views/charts/charts/tools' } from '@/views/charts/charts/tools'
import unitConvert from '@/utils/unit-convert' import unitConvert from '@/utils/unit-convert'
import _ from 'lodash' import _ from 'lodash'

View File

@@ -2,14 +2,13 @@ import _ from 'lodash'
import { get } from '@/utils/http' import { get } from '@/utils/http'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import { entityListLineOption } from '@/views/charts/charts/chart-options' import { entityListLineOption } from '@/views/charts/charts/chart-options'
import { riskLevelMapping, unitTypes, storageKey } from '@/utils/constants' import { riskLevelMapping, unitTypes } from '@/utils/constants'
import unitConvert from '@/utils/unit-convert' import unitConvert from '@/utils/unit-convert'
import { shallowRef, markRaw } from 'vue' import { shallowRef, markRaw } from 'vue'
import { metricOption } from '@/views/detections/options/detectionOptions' import { metricOption } from '@/views/detections/options/detectionOptions'
import { sortBy, reverseSortBy } from '@/utils/tools' import { sortBy, reverseSortBy } from '@/utils/tools'
import { getSecond } from '@/utils/date-util' import { getSecond } from '@/utils/date-util'
import { api } from '@/utils/api' import { api } from '@/utils/api'
import axios from 'axios'
export default { export default {
props: { props: {