fix: 纠正拼写错误、逻辑调整等

This commit is contained in:
chenjinsong
2022-12-21 11:40:49 +08:00
parent eca783fb71
commit 9c88eb5cbf
3 changed files with 17 additions and 21 deletions

View File

@@ -228,7 +228,7 @@ import {
getTabList,
overwriteUrl,
urlParamsHandler,
combinDrilldownTableWithUserConfig,
combineDrilldownTableWithUserConfig,
getDnsMapData,
handleSpecialValue
} from '@/utils/tools'
@@ -594,7 +594,7 @@ export default {
// const userId = localStorage.getItem(storageKey.userId)
const tableType = this.$route.params ? this.$route.params.typeName : 'networkOverview'
const metric = this.getUrlParam(this.curTabState.tableMetric, 'Bits/s')
const drillDownTableConfigs = await combinDrilldownTableWithUserConfig()
const drillDownTableConfigs = await combineDrilldownTableWithUserConfig()
const currentTableConfig = drillDownTableConfigs.find(config => config.route === tableType)
const tables = currentTableConfig ? currentTableConfig.tables : []
const commonTabList = currentTableConfig ? currentTableConfig.tabs : []

View File

@@ -415,7 +415,6 @@ export function extensionEchartY (chart) {
// 该div用来盛放文本显示内容的方便对其悬浮位置进行处理
const id = document.getElementById('extension')
if (!id) {
const div = "<div id = 'extension' style=\"display:block\"></div>"
const contentDiv = document.createElement('div')
contentDiv.setAttribute('id', 'extension')
contentDiv.setAttribute('style', 'display:block')
@@ -938,28 +937,25 @@ export async function getDefaultCurTab (tableType, metric, columnName) {
export async function readDrilldownTableConfigByUser () {
// 获取用户定制的自定义配置
const userId = localStorage.getItem(storageKey.userId)
const userLocalCongfig = await db[dbDrilldownTableConfig].get({ id: userId })
const userLocalConfig = await db[dbDrilldownTableConfig].get({ id: userId })
let defaultDrillDownTableConfigs = []
if (userLocalCongfig) {
defaultDrillDownTableConfigs = userLocalCongfig.config
if (userLocalConfig) {
defaultDrillDownTableConfigs = userLocalConfig.config
}
return defaultDrillDownTableConfigs
}
export async function getConfigVersion (id) {
let defaultCongfigInDb = await db[dbDrilldownTableConfig].get({ id: id })
let version
if (defaultCongfigInDb) {
version = defaultCongfigInDb ? defaultCongfigInDb.version : ''
} else {
defaultCongfigInDb = await db[dbDrilldownTableConfig].get({ id: 'default' })
let defaultConfigInDb = await db[dbDrilldownTableConfig].get({ id: id })
if (!defaultConfigInDb) {
defaultConfigInDb = await db[dbDrilldownTableConfig].get({ id: 'default' })
}
return version
return defaultConfigInDb.version || ''
}
export async function combinDrilldownTableWithUserConfig () {
const defaultCongfigInDb = await db[dbDrilldownTableConfig].get({ id: 'default' })
const defaultConfigGroup = defaultCongfigInDb ? defaultCongfigInDb.config : []
export async function combineDrilldownTableWithUserConfig () {
const defaultConfigInDb = await db[dbDrilldownTableConfig].get({ id: 'default' })
const defaultConfigGroup = defaultConfigInDb ? defaultConfigInDb.config : []
const currentUserConfigGroup = await readDrilldownTableConfigByUser()
if (defaultConfigGroup && currentUserConfigGroup && currentUserConfigGroup.length > 0) {
defaultConfigGroup.forEach(defaultConfig => {
@@ -1026,7 +1022,7 @@ export async function combinDrilldownTableWithUserConfig () {
export async function getUserDrilldownTableConfig (tableType, curMetric) {
let list = []
// 获取用户定制的自定义配置,如果没有,则使用默认的自定义配置
const drillDownTableConfigs = await combinDrilldownTableWithUserConfig()
const drillDownTableConfigs = await combineDrilldownTableWithUserConfig()
const currentTableConfig = drillDownTableConfigs.find(config => config.route === tableType)
const commonTabList = currentTableConfig ? currentTableConfig.tabs : []
const tables = currentTableConfig ? currentTableConfig.tables : []

View File

@@ -201,7 +201,7 @@ import { ref } from 'vue'
import { operationType, unitTypes, networkTable, tableColumnType, networkDefaultLimit, curTabState, storageKey, dbDrilldownTableConfig, fromRoute } from '@/utils/constants'
import { get } from '@/utils/http'
import unitConvert from '@/utils/unit-convert'
import { getChainRatio, computeScore, urlParamsHandler, overwriteUrl, readDrilldownTableConfigByUser, combinDrilldownTableWithUserConfig, getDnsMapData, handleSpecialValue, getConfigVersion } from '@/utils/tools'
import { getChainRatio, computeScore, urlParamsHandler, overwriteUrl, readDrilldownTableConfigByUser, combineDrilldownTableWithUserConfig, getDnsMapData, handleSpecialValue, getConfigVersion } from '@/utils/tools'
import { getSecond } from '@/utils/date-util'
import chartMixin from '@/views/charts2/chart-mixin'
import { db } from '@/indexedDB'
@@ -1866,7 +1866,7 @@ export default {
this.commonColumnList = null
this.userId = localStorage.getItem(storageKey.userId)
this.drillDownTableConfigs = await combinDrilldownTableWithUserConfig()
this.drillDownTableConfigs = await combineDrilldownTableWithUserConfig()
this.tableType = this.$route.params ? this.$route.params.typeName : 'networkOverview'
// 是否需要dns的qtype和rcode的数据字典
if (this.tableType === fromRoute.dnsServiceInsights) {