diff --git a/src/components/advancedSearch/showhint/packages/getDataset.js b/src/components/advancedSearch/showhint/packages/getDataset.js index f9f992aa..1217e189 100644 --- a/src/components/advancedSearch/showhint/packages/getDataset.js +++ b/src/components/advancedSearch/showhint/packages/getDataset.js @@ -61,9 +61,7 @@ export class Dataset { if (!(list && list.length > 0)) { return } - let tempTitle - let results - tempTitle = { + const tempTitle = { type: 'abstract', text: '', // displayText: "Filter", @@ -73,7 +71,7 @@ export class Dataset { } } - results = list.map((item) => { + const results = list.map((item) => { return { // text: item.name, // displayText: `${item.label}(${item.name})`, @@ -91,9 +89,7 @@ export class Dataset { if (!(list && list.length > 0)) { return } - let tempTitle = {} - let results = [] - tempTitle = { + const tempTitle = { type: 'abstract', text: '', // displayText: "Operator", @@ -102,7 +98,7 @@ export class Dataset { // hint(cm, callback, options) {} } - results = list.map((item) => { + const results = list.map((item) => { return { text: item.name, displayText: item.name, @@ -168,25 +164,24 @@ export class Dataset { getOperates (type, item) { // 获取 当前类型支持的操作符 - let operator_functions = '' + let operatorFunctions = '' 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 { const functions = this.sourceData.operatesDic.find(item => { 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(',') - let result = [] - result = funList.map((item) => { + const funList = operatorFunctions.split(',') + return funList.map((item) => { return { text: item, displayText: item, className: 'filter-item el-dropdown-menu__item relative-item' } }) - return result } getFunctions (type, item) { @@ -199,7 +194,7 @@ export class Dataset { const functions = this.sourceData.funcDic.find(item => { return item.type === type }) - functionsInfo = functions && functions.functions || '' + functionsInfo = (functions && functions.functions) || '' } const funList = functionsInfo.split(',') diff --git a/src/views/charts/ChartHeader.vue b/src/views/charts/ChartHeader.vue index b6d18fba..73d03364 100644 --- a/src/views/charts/ChartHeader.vue +++ b/src/views/charts/ChartHeader.vue @@ -247,9 +247,8 @@ import { chartActiveIpTableOrderOptions, chartPieTableTopOptions, eventSeverity, - chartTableColumnMapping, panelTypeAndRouteMapping + chartTableColumnMapping } from '@/utils/constants' -import { useRouter } from 'vue-router' export default { name: 'ChartHeader', diff --git a/src/views/charts/charts/options/pie.js b/src/views/charts/charts/options/pie.js index 2053a916..abba8902 100644 --- a/src/views/charts/charts/options/pie.js +++ b/src/views/charts/charts/options/pie.js @@ -3,7 +3,7 @@ import { tooLongFormatter } from '../tools' import { chartColor, storageKey } from '@/utils/constants' const legendFontSize = localStorage.getItem(storageKey.echartLegendFontSize) -const labelFontSize = localStorage.getItem(storageKey.echartLabelFontSize) +// const labelFontSize = localStorage.getItem(storageKey.echartLabelFontSize) export const pieWithTable = { tooltip: { appendToBody: true diff --git a/src/views/charts2/charts/linkMonitor/LinkDirectionGrid.vue b/src/views/charts2/charts/linkMonitor/LinkDirectionGrid.vue index 27ba6b7e..67e77abb 100644 --- a/src/views/charts2/charts/linkMonitor/LinkDirectionGrid.vue +++ b/src/views/charts2/charts/linkMonitor/LinkDirectionGrid.vue @@ -17,7 +17,6 @@ import PopoverContent from './LinkDirectionGrid/PopoverContent' import { computeScore } from '@/utils/tools' import axios from 'axios' import _ from 'lodash' -import { bigramAnalysis, bigramAnalysisOneWay, bigramNextHopAnalysis, bigramNextHopAnalysisOneWay } from './test-data' export default { name: 'LinkDirectionGrid', diff --git a/src/views/detections/Index.vue b/src/views/detections/Index.vue index f157b8fc..cf3c8ba2 100644 --- a/src/views/detections/Index.vue +++ b/src/views/detections/Index.vue @@ -138,7 +138,6 @@ import { useRoute } from 'vue-router' import Loading from '@/components/common/Loading' import ChartTabs from '@/components/common/ChartTabs' import { useStore } from 'vuex' -import { tooLongFormatter } from '@/views/charts/charts/tools' import { format } from 'echarts' import Parser from '@/components/advancedSearch/meta/parser' import { schemaDetectionSecurity } from '@/utils/static-data' @@ -274,7 +273,7 @@ export default { loading: false, oldActiveEntitySearchValue: '', initFlag: true, // 初始化标识,初始化时保证mounted执行 - detectionChart:shallowRef(null) + detectionChart: shallowRef(null) } }, methods: { @@ -494,7 +493,7 @@ export default { echarts.dispose(this.detectionChart) } this.detectionChart = echarts.init(chartDom) - //this.chartInit.push(shallowRef(detectionChart)) + // this.chartInit.push(shallowRef(detectionChart)) const securityTypeOption = this.$_.cloneDeep(pieForSeverity) securityTypeOption.series[0].data = data.map(d => { return { value: d.count, name: d.eventType, itemStyle: { color: getAttackColor(d.eventType) } } @@ -848,8 +847,8 @@ export default { const chartDom = document.getElementById(`detectionCategoryPer${this.pageType}`) this.detectionChart = echarts.getInstanceByDom(chartDom) - if(this.detectionChart){ - let securityTypeOption = this.$_.cloneDeep(this.detectionChart.getOption()) + if (this.detectionChart) { + const securityTypeOption = this.$_.cloneDeep(this.detectionChart.getOption()) echarts.dispose(this.detectionChart) if (chartDom) { this.detectionChart = echarts.init(chartDom) diff --git a/src/views/detections/options/detectionOptions.js b/src/views/detections/options/detectionOptions.js index 4368a83e..0d016fad 100644 --- a/src/views/detections/options/detectionOptions.js +++ b/src/views/detections/options/detectionOptions.js @@ -1,7 +1,4 @@ -import { - detectionTooltipFormatter, - tooLongFormatter -} from '@/views/charts/charts/tools' +import { tooLongFormatter } from '@/views/charts/charts/tools' import unitConvert from '@/utils/unit-convert' import _ from 'lodash' import { dateFormatByAppearance, xAxisTimeFormatter, xAxisTimeRich } from '@/utils/date-util' diff --git a/src/views/setting/KnowledgeBase.vue b/src/views/setting/KnowledgeBase.vue index 7ed6f391..384f2f74 100644 --- a/src/views/setting/KnowledgeBase.vue +++ b/src/views/setting/KnowledgeBase.vue @@ -72,7 +72,6 @@ import dataListMixin from '@/mixins/data-list' import KnowledgeBaseTableForCard from '@/components/table/setting/knowledgeBaseTableForCard' import { api } from '@/utils/api' -import { urlParamsHandler, overwriteUrl } from '@/utils/tools' import { knowledgeBaseCategory, knowledgeBaseSource, knowledgeCategoryValue } from '@/utils/constants' import axios from 'axios'