fix: 去除未被使用的文件引用,以及调整部分代码格式

This commit is contained in:
刘洪洪
2023-12-27 16:08:43 +08:00
parent 37238377d2
commit d7bd49a9ac
7 changed files with 18 additions and 30 deletions

View File

@@ -61,9 +61,7 @@ export class Dataset {
if (!(list && list.length > 0)) { if (!(list && list.length > 0)) {
return return
} }
let tempTitle const tempTitle = {
let results
tempTitle = {
type: 'abstract', type: 'abstract',
text: '', text: '',
// displayText: "Filter", // displayText: "Filter",
@@ -73,7 +71,7 @@ export class Dataset {
} }
} }
results = list.map((item) => { const results = list.map((item) => {
return { return {
// text: item.name, // text: item.name,
// displayText: `${item.label}(${item.name})`, // displayText: `${item.label}(${item.name})`,
@@ -91,9 +89,7 @@ export class Dataset {
if (!(list && list.length > 0)) { if (!(list && list.length > 0)) {
return return
} }
let tempTitle = {} const tempTitle = {
let results = []
tempTitle = {
type: 'abstract', type: 'abstract',
text: '', text: '',
// displayText: "Operator", // displayText: "Operator",
@@ -102,7 +98,7 @@ export class Dataset {
// hint(cm, callback, options) {} // hint(cm, callback, options) {}
} }
results = list.map((item) => { const results = list.map((item) => {
return { return {
text: item.name, text: item.name,
displayText: item.name, displayText: item.name,
@@ -168,25 +164,24 @@ export class Dataset {
getOperates (type, item) { getOperates (type, item) {
// 获取 当前类型支持的操作符 // 获取 当前类型支持的操作符
let operator_functions = '' let operatorFunctions = ''
if (item && item.doc && item.doc.constraints && item.doc.constraints.operator_functions) { if (item && item.doc && item.doc.constraints && item.doc.constraints.operator_functions) {
operator_functions = item.doc.constraints.operator_functions operatorFunctions = item.doc.constraints.operator_functions
} else { } else {
const functions = this.sourceData.operatesDic.find(item => { const functions = this.sourceData.operatesDic.find(item => {
return item.type === type return item.type === type
}) })
operator_functions = functions && functions.functions || '' // eslint-disable-next-line no-mixed-operators
operatorFunctions = functions && functions.functions || ''
} }
const funList = operator_functions.split(',') const funList = operatorFunctions.split(',')
let result = [] return funList.map((item) => {
result = funList.map((item) => {
return { return {
text: item, text: item,
displayText: item, displayText: item,
className: 'filter-item el-dropdown-menu__item relative-item' className: 'filter-item el-dropdown-menu__item relative-item'
} }
}) })
return result
} }
getFunctions (type, item) { getFunctions (type, item) {
@@ -199,7 +194,7 @@ export class Dataset {
const functions = this.sourceData.funcDic.find(item => { const functions = this.sourceData.funcDic.find(item => {
return item.type === type return item.type === type
}) })
functionsInfo = functions && functions.functions || '' functionsInfo = (functions && functions.functions) || ''
} }
const funList = functionsInfo.split(',') const funList = functionsInfo.split(',')

View File

@@ -247,9 +247,8 @@ import {
chartActiveIpTableOrderOptions, chartActiveIpTableOrderOptions,
chartPieTableTopOptions, chartPieTableTopOptions,
eventSeverity, eventSeverity,
chartTableColumnMapping, panelTypeAndRouteMapping chartTableColumnMapping
} from '@/utils/constants' } from '@/utils/constants'
import { useRouter } from 'vue-router'
export default { export default {
name: 'ChartHeader', name: 'ChartHeader',

View File

@@ -3,7 +3,7 @@ import { tooLongFormatter } from '../tools'
import { chartColor, storageKey } from '@/utils/constants' import { chartColor, storageKey } from '@/utils/constants'
const legendFontSize = localStorage.getItem(storageKey.echartLegendFontSize) const legendFontSize = localStorage.getItem(storageKey.echartLegendFontSize)
const labelFontSize = localStorage.getItem(storageKey.echartLabelFontSize) // const labelFontSize = localStorage.getItem(storageKey.echartLabelFontSize)
export const pieWithTable = { export const pieWithTable = {
tooltip: { tooltip: {
appendToBody: true appendToBody: true

View File

@@ -17,7 +17,6 @@ import PopoverContent from './LinkDirectionGrid/PopoverContent'
import { computeScore } from '@/utils/tools' import { computeScore } from '@/utils/tools'
import axios from 'axios' import axios from 'axios'
import _ from 'lodash' import _ from 'lodash'
import { bigramAnalysis, bigramAnalysisOneWay, bigramNextHopAnalysis, bigramNextHopAnalysisOneWay } from './test-data'
export default { export default {
name: 'LinkDirectionGrid', name: 'LinkDirectionGrid',

View File

@@ -138,7 +138,6 @@ import { useRoute } from 'vue-router'
import Loading from '@/components/common/Loading' import Loading from '@/components/common/Loading'
import ChartTabs from '@/components/common/ChartTabs' import ChartTabs from '@/components/common/ChartTabs'
import { useStore } from 'vuex' import { useStore } from 'vuex'
import { tooLongFormatter } from '@/views/charts/charts/tools'
import { format } from 'echarts' import { format } from 'echarts'
import Parser from '@/components/advancedSearch/meta/parser' import Parser from '@/components/advancedSearch/meta/parser'
import { schemaDetectionSecurity } from '@/utils/static-data' import { schemaDetectionSecurity } from '@/utils/static-data'
@@ -849,7 +848,7 @@ export default {
const chartDom = document.getElementById(`detectionCategoryPer${this.pageType}`) const chartDom = document.getElementById(`detectionCategoryPer${this.pageType}`)
this.detectionChart = echarts.getInstanceByDom(chartDom) this.detectionChart = echarts.getInstanceByDom(chartDom)
if (this.detectionChart) { if (this.detectionChart) {
let securityTypeOption = this.$_.cloneDeep(this.detectionChart.getOption()) const securityTypeOption = this.$_.cloneDeep(this.detectionChart.getOption())
echarts.dispose(this.detectionChart) echarts.dispose(this.detectionChart)
if (chartDom) { if (chartDom) {
this.detectionChart = echarts.init(chartDom) this.detectionChart = echarts.init(chartDom)

View File

@@ -1,7 +1,4 @@
import { import { tooLongFormatter } from '@/views/charts/charts/tools'
detectionTooltipFormatter,
tooLongFormatter
} from '@/views/charts/charts/tools'
import unitConvert from '@/utils/unit-convert' import unitConvert from '@/utils/unit-convert'
import _ from 'lodash' import _ from 'lodash'
import { dateFormatByAppearance, xAxisTimeFormatter, xAxisTimeRich } from '@/utils/date-util' import { dateFormatByAppearance, xAxisTimeFormatter, xAxisTimeRich } from '@/utils/date-util'

View File

@@ -72,7 +72,6 @@
import dataListMixin from '@/mixins/data-list' import dataListMixin from '@/mixins/data-list'
import KnowledgeBaseTableForCard from '@/components/table/setting/knowledgeBaseTableForCard' import KnowledgeBaseTableForCard from '@/components/table/setting/knowledgeBaseTableForCard'
import { api } from '@/utils/api' import { api } from '@/utils/api'
import { urlParamsHandler, overwriteUrl } from '@/utils/tools'
import { knowledgeBaseCategory, knowledgeBaseSource, knowledgeCategoryValue } from '@/utils/constants' import { knowledgeBaseCategory, knowledgeBaseSource, knowledgeCategoryValue } from '@/utils/constants'
import axios from 'axios' import axios from 'axios'