From 20f4ae02d30b2341e6d0d0c65577d595a9fd39b7 Mon Sep 17 00:00:00 2001 From: chenjinsong <523037378@qq.com> Date: Wed, 30 Mar 2022 15:37:55 +0800 Subject: [PATCH] =?UTF-8?q?CN-431=20feat:=20detection=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=89=A7=E8=A1=8C=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/css/font/iconfont.js | 2 +- src/components/advancedSearch/TextMode.vue | 8 +- src/utils/api.js | 2 +- src/views/Temp.vue | 8 +- src/views/charts/charts/options/pie.js | 18 +- src/views/detections/DetectionFilter.vue | 3 - src/views/detections/DetectionSearch.vue | 3 + src/views/detections/Index.vue | 633 ++---------------- .../detections/options/detectionOptions.js | 84 +-- ...etectionPerformanceEventDomainOverview.vue | 340 +++++----- .../DetectionPerformanceEventIpOverview.vue | 57 +- src/views/testData.js | 576 ++++++++-------- 12 files changed, 598 insertions(+), 1136 deletions(-) diff --git a/src/assets/css/font/iconfont.js b/src/assets/css/font/iconfont.js index 7edf9492..0fd610eb 100644 --- a/src/assets/css/font/iconfont.js +++ b/src/assets/css/font/iconfont.js @@ -1 +1 @@ -!function(c){var a,l,h,o,i,m='',v=(v=document.getElementsByTagName("script"))[v.length-1].getAttribute("data-injectcss"),z=function(c,a){a.parentNode.insertBefore(c,a)};if(v&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(c){console&&console.log(c)}}function t(){i||(i=!0,h())}function n(){try{o.documentElement.doScroll("left")}catch(c){return void setTimeout(n,50)}t()}a=function(){var c,a=document.createElement("div");a.innerHTML=m,m=null,(a=a.getElementsByTagName("svg")[0])&&(a.setAttribute("aria-hidden","true"),a.style.position="absolute",a.style.width=0,a.style.height=0,a.style.overflow="hidden",a=a,(c=document.body).firstChild?z(a,c.firstChild):c.appendChild(a))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(a,0):(l=function(){document.removeEventListener("DOMContentLoaded",l,!1),a()},document.addEventListener("DOMContentLoaded",l,!1)):document.attachEvent&&(h=a,o=c.document,i=!1,n(),o.onreadystatechange=function(){"complete"==o.readyState&&(o.onreadystatechange=null,t())})}(window); \ No newline at end of file +!(function (c) { let a; let l; let h; let o; let i; let m = ''; var v = (v = document.getElementsByTagName('script'))[v.length - 1].getAttribute('data-injectcss'); const z = function (c, a) { a.parentNode.insertBefore(c, a) }; if (v && !c.__iconfont__svg__cssinject__) { c.__iconfont__svg__cssinject__ = !0; try { document.write('') } catch (c) { console && console.log(c) } } function t () { i || (i = !0, h()) } function n () { try { o.documentElement.doScroll('left') } catch (c) { return void setTimeout(n, 50) }t() }a = function () { let c; let a = document.createElement('div'); a.innerHTML = m, m = null, (a = a.getElementsByTagName('svg')[0]) && (a.setAttribute('aria-hidden', 'true'), a.style.position = 'absolute', a.style.width = 0, a.style.height = 0, a.style.overflow = 'hidden', a = a, (c = document.body).firstChild ? z(a, c.firstChild) : c.appendChild(a)) }, document.addEventListener ? ~['complete', 'loaded', 'interactive'].indexOf(document.readyState) ? setTimeout(a, 0) : (l = function () { document.removeEventListener('DOMContentLoaded', l, !1), a() }, document.addEventListener('DOMContentLoaded', l, !1)) : document.attachEvent && (h = a, o = c.document, i = !1, n(), o.onreadystatechange = function () { o.readyState == 'complete' && (o.onreadystatechange = null, t()) }) }(window)) diff --git a/src/components/advancedSearch/TextMode.vue b/src/components/advancedSearch/TextMode.vue index c057e56b..0f3dbecf 100644 --- a/src/components/advancedSearch/TextMode.vue +++ b/src/components/advancedSearch/TextMode.vue @@ -52,7 +52,7 @@ export default { }) }, search () { - let originalSql = this.codeMirror.getValue() + let originalSql = this.codeMirror.getValue().trim() if (originalSql) { originalSql = originalSql.replaceAll(/"/g, '') // 为解决ip无法校验通过的问题,先将带引号的ip转为不带引号的,再把不带引号的转为带引号的 @@ -116,7 +116,7 @@ export default { const column = this.columnList.find(c => c.name === param.column) current = `${current ? current + ' AND ' : ''}${param.column}${handleOperatorSpace(param.operator)}${this.handleValue(param.value, column, param.operator)}` }) - toRaw(this.codeMirror).setValue(current) + toRaw(this.codeMirror).setValue(current.trim()) }, removeParams (params) { let current = this.codeMirror.getValue() @@ -129,7 +129,7 @@ export default { current = current.replace(piece, '') }) }) - toRaw(this.codeMirror).setValue(current) + toRaw(this.codeMirror).setValue(current.trim()) }, changeParams (params) { let current = this.codeMirror.getValue() @@ -141,7 +141,7 @@ export default { const newSqlPiece = `${param.newParam.column}${handleOperatorSpace(param.newParam.operator)}${this.handleValue(param.newParam.value, newColumn, param.newParam.operator)}`.trim() current = current.replace(oldSqlPiece, newSqlPiece) }) - toRaw(this.codeMirror).setValue(current) + toRaw(this.codeMirror).setValue(current.trim()) } }, watch: { diff --git a/src/utils/api.js b/src/utils/api.js index d365a70b..c18a38d2 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -94,7 +94,7 @@ export const api = { listBasic: '/interface/detection/performance/list/basic', listCount: '/interface/detection/performance/list/count', overviewBasic: '/interface/detection/performance/detail/overview/basic', - metric:'/interface/detection/performance/detail/overview/metric' + metric: '/interface/detection/performance/detail/overview/metric' } } } diff --git a/src/views/Temp.vue b/src/views/Temp.vue index 7485c448..35a78a80 100644 --- a/src/views/Temp.vue +++ b/src/views/Temp.vue @@ -40,7 +40,7 @@ import { unitTypes } from '@/utils/constants' export default { name: 'Temp', methods: { - /*initLine (lineData, index) { + /* initLine (lineData, index) { const data = lineData.map(d => { return [getMillisecond(new Date(d[0]).getTime()), d[index]] }) @@ -70,7 +70,7 @@ export default { this.$nextTick(() => { lineChart.setOption(option) }) - },*/ + }, */ initLineChart () { // 数据转为需要的格式:[[timestamp, value]] const data = lineData.map(d => { @@ -111,10 +111,10 @@ export default { } */ }, mounted () { - /*this.initLine(lineData2, 1) + /* this.initLine(lineData2, 1) this.initLine(lineData2, 2) this.initLine(lineData2, 3) - this.initLine(lineData3, 6)*/ + this.initLine(lineData3, 6) */ this.initLineChart() this.initSunChart(1) this.initSunChart(2) diff --git a/src/views/charts/charts/options/pie.js b/src/views/charts/charts/options/pie.js index 177eeccd..3194bb0d 100644 --- a/src/views/charts/charts/options/pie.js +++ b/src/views/charts/charts/options/pie.js @@ -67,7 +67,7 @@ export const ipHostedDomain = { }, formatter: function (name) { return name.length > 9 ? name.substr(0, 9) + '...' : name - }, + } }, series: [ { @@ -79,18 +79,18 @@ export const ipHostedDomain = { label: { formatter: '{d}%' }, - //right:'20%', - labelLine:{ - length:6, - length2:6 - } , + // right:'20%', + labelLine: { + length: 6, + length2: 6 + }, tooltip: { formatter: function (param, index, callback) { - if(param.data.unitType){ + if (param.data.unitType) { let tip = unitConvert(param.value, param.data.unitType) - tip = tip?tip.join(' '):'' + tip = tip ? tip.join(' ') : '' return `${param.name}: ${tip}` - }else { + } else { return `${param.name}: ${param.value}` } } diff --git a/src/views/detections/DetectionFilter.vue b/src/views/detections/DetectionFilter.vue index a3f362c9..ccc5aa38 100644 --- a/src/views/detections/DetectionFilter.vue +++ b/src/views/detections/DetectionFilter.vue @@ -45,9 +45,6 @@ export default { } }, methods: { - /* filterChange (value, filter) { - this.$emit('filter', filter.column) - }, */ showMore (filter) { filter.showIndex && (filter.showIndex += 10) filter.showIndex >= (filter.data.length - 1) && (filter.showMore = false) diff --git a/src/views/detections/DetectionSearch.vue b/src/views/detections/DetectionSearch.vue index 993f629c..8ef18365 100644 --- a/src/views/detections/DetectionSearch.vue +++ b/src/views/detections/DetectionSearch.vue @@ -141,6 +141,9 @@ export default { } this.$refs.search.changeParams([{ newParam, oldParam }]) } + this.$nextTick(() => { + this.emitter.emit('advanced-search') + }) } } } diff --git a/src/views/detections/Index.vue b/src/views/detections/Index.vue index 365837fd..737fe891 100644 --- a/src/views/detections/Index.vue +++ b/src/views/detections/Index.vue @@ -29,7 +29,6 @@ :filter-data="filterData[pageType]" :q="q" :time-filter="timeFilter" - @filter="filter" >
@@ -41,7 +40,7 @@ -