This commit is contained in:
zhangxiaolong
2022-03-14 11:38:56 +08:00
25 changed files with 220 additions and 70 deletions

View File

@@ -6,6 +6,7 @@
<chart-tabs
v-if="isTabs"
:chart-info="chartInfo"
:time-filter="timeFilter"
:query-params="queryParams"
:entity="entity"
></chart-tabs>
@@ -14,6 +15,7 @@
v-else-if="isMap && !isIpBasicInfo"
:chart-info="chartInfo"
:chart-data="chartData"
:time-filter="timeFilter"
:query-params="queryParams"
:entity="entity"
@getChartData="getChartData"
@@ -24,14 +26,16 @@
v-else-if="isSingleValue"
:chart-info="chartInfo"
:chart-data="chartData"
:time-filter="timeFilter"
:query-params="queryParams"
@showLoading="showLoading"
></chart-single-value>
<chart-block
v-else-if="isBlock"
ref="chart"
:timeFilter="queryParams"
v-else-if="isBlock"
:time-filter="timeFilter"
:query-params="queryParams"
:chart-info="chartInfo"
:chart-data="chartData"
:entity="entity"
@@ -39,7 +43,8 @@
<chart-group
v-else-if="isGroup"
:timeFilter="queryParams"
:query-params="queryParams"
:time-filter="timeFilter"
:chart-info="chartInfo"
:chart-data="chartData"
:entity="entity"
@@ -47,6 +52,8 @@
<ip-basic-info
v-else-if="isIpBasicInfo"
:time-filter="timeFilter"
:query-params="queryParams"
:chart-info="chartInfo"
:chart-data="chartData"
:entity="entity"
@@ -57,6 +64,7 @@
:chart-info="chartInfo"
:chart-data="chartData"
:result-type="resultType"
:time-filter="timeFilter"
:query-params="queryParams"
@showLoading="showLoading"
></chart-time-bar>
@@ -66,6 +74,7 @@
:chart-info="chartInfo"
:chart-data="chartData"
:result-type="resultType"
:time-filter="timeFilter"
:query-params="queryParams"
@showLoading="showLoading"
></chart-category-bar>
@@ -75,6 +84,7 @@
:chart-info="chartInfo"
:chart-data="chartData"
:result-type="resultType"
:time-filter="timeFilter"
:query-params="queryParams"
@showLoading="showLoading"
></chart-ip-open-port-bar>
@@ -84,6 +94,7 @@
:chart-info="chartInfo"
:chart-data="chartData"
:table="table"
:time-filter="timeFilter"
:query-params="queryParams"
@showLoading="showLoading"
></chart-table>
@@ -93,6 +104,7 @@
:chart-info="chartInfo"
:chart-data="chartData"
:table="table"
:time-filter="timeFilter"
:query-params="queryParams"
></chart-active-ip-table>
@@ -100,6 +112,7 @@
v-else-if="isAppBasicInfo"
:chart-info="chartInfo"
:chart-data="chartData"
:time-filter="timeFilter"
:query-params="queryParams"
></chart-app-basic-info>
@@ -107,6 +120,7 @@
v-else-if="isDomainWhois"
:chart-info="chartInfo"
:chart-data="chartData"
:time-filter="timeFilter"
:query-params="queryParams"
></chart-domain-whois>
@@ -114,6 +128,7 @@
v-else-if="isDomainDnsRecord"
:chart-info="chartInfo"
:chart-data="chartData"
:time-filter="timeFilter"
:query-params="queryParams"
></chart-domain-dns-record>
@@ -121,6 +136,7 @@
v-else-if="isCryptocurrencyEventList"
:chart-info="chartInfo"
:chart-data="chartData"
:time-filter="timeFilter"
:query-params="queryParams"
></chart-cryptocurrency-event-list>
@@ -128,6 +144,7 @@
v-else-if="isRelationShip"
:chart-info="chartInfo"
:chart-data="chartData"
:time-filter="timeFilter"
:query-params="queryParams"
></chart-relation-ship>
@@ -135,6 +152,7 @@
v-else-if="isSankey"
:chart-info="chartInfo"
:chart-data="chartData"
:time-filter="timeFilter"
:query-params="queryParams"
:entity="entity"
></chart-san-key>
@@ -144,6 +162,8 @@
:chart-info="chartInfo"
:chart-data="chartData"
:result-type="resultType"
:time-filter="timeFilter"
:query-params="queryParams"
@showLoading="showLoading"
></chart-echart>
@@ -152,6 +172,8 @@
:chart-info="chartInfo"
:chart-data="chartData"
:result-type="resultType"
:time-filter="timeFilter"
:query-params="queryParams"
@showLoading="showLoading"
></chart-echart-with-statistics>
@@ -160,6 +182,7 @@
:chart-info="chartInfo"
:chart-data="chartData"
:query-params="queryParams"
:time-filter="timeFilter"
:result-type="resultType"
:order-pie-table="orderPieTable"
@showLoading="showLoading"
@@ -167,8 +190,10 @@
<chart-echart-ip-hosted-domain
v-else-if="isIpHostedDomain"
:chart-info="chartInfo"
:chart-data="chartData"
:chart-info="chartInfo"
:time-filter="timeFilter"
:query-params="queryParams"
@showLoading="showLoading"
:entity="entity"
></chart-echart-ip-hosted-domain>
@@ -179,6 +204,8 @@
:chart-data="chartData"
@showLoading="showLoading"
:entity="entity"
:time-filter="timeFilter"
:query-params="queryParams"
></chart-echart-app-relate-domain>
<chart-one-Situation-Statistics
@@ -186,14 +213,16 @@
:chart-info="chartInfo"
:chart-data="chartData"
:query-params="queryParams"
@showLoading="showLoading"
:time-filter="timeFilter"
:entity="entity"
@showLoading="showLoading"
></chart-one-Situation-Statistics>
<chart-two-Situation-Statistics
v-else-if="isTwoSupportStatistics"
:chart-info="chartInfo"
:chart-data="chartData"
:time-filter="timeFilter"
:query-params="queryParams"
@showLoading="showLoading"
:entity="entity"
@@ -203,6 +232,7 @@
v-else-if="isAlarmInfo"
:chart-info="chartInfo"
:chart-data="chartData"
:time-filter="timeFilter"
:query-params="queryParams"
@showLoading="showLoading"
:tabHandleClickType="tabHandleClickType"
@@ -210,6 +240,13 @@
:entity="entity"
>
</chart-alarm-info>
<chart-domain-recursive-resolve
:chart-data="chartData"
:time-filter="timeFilter"
:query-params="queryParams"
v-else-if="isDomainRecursiveResolve"
></chart-domain-recursive-resolve>
</template>
</div>
</template>
@@ -242,6 +279,7 @@ import ChartSanKey from '@/views/charts/charts/ChartSanKey'
import ChartOneSituationStatistics from '@/views/charts/charts/ChartOneSituationStatistics'
import ChartTwoSituationStatistics from '@/views/charts/charts/ChartTwoSituationStatistics'
import ChartAlarmInfo from '@/views/charts/charts/ChartAlarmInfo'
import ChartDomainRecursiveResolve from '@/views/charts/charts/ChartDomainRecursiveResolve'
import {
isEcharts,
isEchartsLine,
@@ -278,6 +316,7 @@ import {
isSingleSupportStatistics,
isTwoSupportStatistics,
isAlarmInfo,
isDomainRecursiveResolve
} from './charts/tools'
import _ from 'lodash'
@@ -311,6 +350,7 @@ export default {
ChartOneSituationStatistics,
ChartTwoSituationStatistics,
ChartAlarmInfo,
ChartDomainRecursiveResolve
},
data() {
return {
@@ -329,8 +369,9 @@ export default {
entity: Object,
isError: Boolean,
table: Object,
timeFilter: Object,
orderPieTable: Object,
tabHandleClickType: String,
tabHandleClickType: String
},
computed: {
isNoData() {
@@ -381,19 +422,12 @@ export default {
},
},
watch: {
chartData: {
deep: true,
handler(n) {},
},
tabHandleClickType: {
deep: true,
handler(n) {
this.tabHandleClickType = n
},
},
queryParams: {
deep: true,
},
}
},
setup(props) {
return {
@@ -428,17 +462,17 @@ export default {
isDomainWhois: isDomainWhois(props.chartInfo.type),
isDomainDnsRecord: isDomainDnsRecord(props.chartInfo.type),
isCryptocurrencyEventList: isCryptocurrencyEventList(
props.chartInfo.type,
props.chartInfo.type
),
isAppBasicInfo: isAppBasicInfo(props.chartInfo.type),
isAppRelatedDomain: isAppRelatedDomain(props.chartInfo.type),
isSingleSupportStatistics: isSingleSupportStatistics(
props.chartInfo.type,
props.chartInfo.type
),
isTwoSupportStatistics: isTwoSupportStatistics(props.chartInfo.type),
isAlarmInfo: isAlarmInfo(props.chartInfo.type),
isDomainRecursiveResolve: isDomainRecursiveResolve(props.chartInfo.type)
}
},
}
}
</script>

View File

@@ -311,11 +311,12 @@ export default {
this.$emit('refresh')
},
timeRefreshChange() {
// 不是自选时间
if (!this.$refs.dateTimeRange.isCustom) {
const value = this.chartTimeFilter.dateRangeValue
this.$refs.dateTimeRange.quickChange(value)
} else {
this.$emit('refresh')
this.$emit('refresh', this.chartTimeFilter)
}
},
reload(s, e, v) {
@@ -326,7 +327,6 @@ export default {
},
dateTimeRangeChange(s, e, v) {
this.chartTimeFilter = { startTime: s, endTime: e, dateRangeValue: v }
console.log(this.chartTimeFilter)
this.$emit('refresh', this.chartTimeFilter)
},
tableLimitChange() {

View File

@@ -146,6 +146,7 @@ export default {
callback({ startTime: myStartTime, endTime: myEndTime })
},
timeRefreshChange () {
// 不是自选时间
if (!this.$refs.dateTimeRange.isCustom) {
const value = this.timeFilter.dateRangeValue
this.$refs.dateTimeRange.quickChange(value)

View File

@@ -38,6 +38,7 @@
:table="table"
:is-fullscreen="isFullscreen"
:order-pie-table="orderPieTable"
:time-filter="timeFilter"
@getChartData="getChartData"
@showLoading="showLoading"
:tabHandleClickType="tabHandleClickType"
@@ -191,7 +192,7 @@ export default {
...this.handleQueryParams(),
...this.queryTimeRange,
...this.entity,
...extraParams
}
const requestUrl = url || (chartParams && chartParams.url)
@@ -288,13 +289,20 @@ export default {
this.$refs.chart.resize()
},
refresh (chartTimeFilter) {
const myEndTime = window.$dayJs.tz().valueOf()
const myStartTime = myEndTime - this.chartTimeFilter.dateRangeValue * 60 * 1000
this.standaloneTimeRange.use = true
this.standaloneTimeRange.startTime = myStartTime
this.standaloneTimeRange.endTime = myEndTime
this.emitter.emit('chart-pageNo')
this.getChartData(null, {}, true, chartTimeFilter)
if (chartTimeFilter) {
this.timeFilter.startTime = chartTimeFilter.startTime
this.timeFilter.endTime = chartTimeFilter.endTime
this.timeFilter.dateRangeValue = chartTimeFilter.dateRangeValue
this.getChartData(null, {}, true, chartTimeFilter)
} else {
const myEndTime = window.$dayJs.tz().valueOf()
const myStartTime = myEndTime - this.timeFilter.dateRangeValue * 60 * 1000
this.standaloneTimeRange.use = true
this.standaloneTimeRange.startTime = myStartTime
this.standaloneTimeRange.endTime = myEndTime
this.emitter.emit('chart-pageNo')
this.getChartData(null, {}, true)
}
},
tabHandleClick (value) {
this.tabHandleClickType = value
@@ -371,9 +379,6 @@ export default {
mounted () {
this.showLoading(true)
this.getChartData()
// setTimeout(() => {
// this.getChartData()
// }, 200)
},
setup (props) {
const dateRangeValue = 60

View File

@@ -66,7 +66,7 @@
<script>
import PanelChart from '@/views/charts/PanelChart'
import VueGridLayout from 'vue-grid-layout'
import { getGroupHeight, getTypeCategory } from './charts/tools'
import { getGroupHeight, getTypeCategory, isGroup } from './charts/tools'
import _ from 'lodash'
export default {
@@ -126,7 +126,7 @@ export default {
if (item.params.collapse) {
item.h = 1
} else {
item.h = getGroupHeight(item.children) + 1.5
item.h = getGroupHeight(item.children) + 0.4 + 1
}
}
})
@@ -139,13 +139,8 @@ export default {
const children = parent.children.find(item => item.id === chart.id)
children.h = chart.h
children.params = chart.params
let sumGroup = 0
childrenList.forEach(item => {
if (item.type === 94) {
sumGroup++
}
})
parent.h = getGroupHeight(childrenList) + sumGroup * 0.5
// 第二个是空隙,第三个是标题的高度
parent.h = getGroupHeight(childrenList) + 0.4 + 1
this.copyDataList = [...this.copyDataList]
}, 100)
}

View File

@@ -14,9 +14,6 @@ import chartMixin from '@/views/charts/charts/chart-mixin'
export default {
name: 'ChartBlock',
mixins: [chartMixin],
props: {
timeFilter: Object
},
data () {
return {
dataList: [],
@@ -26,14 +23,11 @@ export default {
},
mounted () {
this.dataList = JSON.parse(JSON.stringify(this.chartInfo.children))
// this.time = JSON.parse(JSON.stringify(this.timeFilter))
this.firstShow = true
},
methods: {
reload () {
console.log(123132)
this.dataList = JSON.parse(JSON.stringify(this.chartInfo.children))
// this.time = JSON.parse(JSON.stringify(this.timeFilter))
}
}
}

View File

@@ -0,0 +1,20 @@
<template>
<div style="overflow-y: auto; height: 100%; color: #555;">{{linuxLineSymbolConvert}}</div>
</template>
<script>
export default {
name: 'ChartDomainRecursiveResolve',
props: {
chartInfo: Object,
chartData: String,
resultType: Object,
queryParams: Object
},
computed: {
linuxLineSymbolConvert () {
return this.chartData ? this.chartData.replaceAll(/\n/g, '\r\n') : ''
}
}
}
</script>

View File

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

View File

@@ -1,6 +1,7 @@
<template>
<panel-chart-list
:time-filter="timeFilter"
:query-params="queryParams"
:data-list="chartInfo.children"
:panel-lock="true"
:entity="entity"
@@ -15,10 +16,8 @@ export default {
name: 'ChartGroup',
mixins: [chartMixin],
props: {
timeFilter: Object
},
mounted () {
console.info(this.chartInfo)
timeFilter: Object,
queryParams: Object
}
}
</script>

View File

@@ -3,6 +3,7 @@ export default {
chartInfo: Object,
chartData: [Object, Array, String], // 数据在父组件查询后传入,本组件内不查询,只根据接传递的数据来渲染
entity: Object,
timeFilter: Object,
queryParams: Object // 接口请求参数
}
}

View File

@@ -167,6 +167,10 @@ export function isSingleSupportStatistics (type) {
export function isTwoSupportStatistics (type) {
return type === 87
}
/* 域名递归解析 */
export function isDomainRecursiveResolve (type) {
return type === 88
}
/* 组 */
export function isGroup (type) {
return type === 94
@@ -219,7 +223,16 @@ export function getLayout (type) {
export function getGroupHeight (arr) {
if (arr.length) {
let lastItem = []
let minYArr = [...arr]
minYArr.sort((a, b) => {
return a.y - b.y
})
let maxYArr = [...arr]
maxYArr.sort((a, b) => {
return (b.y + b.h) - (a.y + a.h)
})
return maxYArr[0].y + maxYArr[0].h - minYArr[0].y
/*let lastItem = []
let maxY = arr[0].y
arr.forEach((children, index) => {
if (maxY === children.y) {
@@ -238,7 +251,7 @@ export function getGroupHeight (arr) {
if (maxY < 0) {
maxY = 0
}
return maxHeight + maxY
return maxHeight + maxY*/
} else {
return 1
}

View File

@@ -132,7 +132,8 @@ export default {
pageObj: {
pageNo: 1,
pageSize: defaultPageSize,
total: 0
total: 0,
resetPageNo: true
},
q: '',
detectionPageType,
@@ -1065,9 +1066,13 @@ export default {
this.q = ''
this.metaList = []
}
if (this.pageObj.resetPageNo) {
this.pageObj.pageNo = 1
} else {
this.pageObj.resetPageNo = true
}
this.queryFilter()
this.queryList()
this.queryListTotal()
},
resetFilterData () {
this.filterData.securityEvent.forEach(d => {
@@ -1096,9 +1101,6 @@ export default {
this.initActiveEntity(params)
this.initEventTypeData(params)
}
},
queryListTotal () {
},
filter (filterColumn) {
const params = {}
@@ -1113,6 +1115,7 @@ export default {
},
pageNo (val) {
this.pageObj.pageNo = val || 1
this.pageObj.resetPageNo = false
this.search(this.metaList, this.q)
},
// 点击上一页箭头

View File

@@ -157,6 +157,8 @@ export default {
pageObj: {
pageNo: 1,
// 是否重置pageNo在执行新搜索时是true
resetPageNo: true,
pageSize: defaultPageSize,
total: 0
},
@@ -482,6 +484,11 @@ export default {
if (!this.showList) {
this.showList = true
}
if (this.pageObj.resetPageNo) {
this.pageObj.pageNo = 1
} else {
this.pageObj.resetPageNo = true
}
// 带参数时只查询对应类型的entity不带参数时3种entity都查
if (formatSql) {
// entity_type处理不查其他两种entity_type对应的左侧筛选
@@ -529,6 +536,7 @@ export default {
},
pageNo (val) {
this.pageObj.pageNo = val
this.pageObj.resetPageNo = false
this.search(this.metaList, this.q)
},
// 点击上一页箭头
@@ -558,6 +566,9 @@ export default {
value: name
}
this.$refs.search.addParams([params])
this.$nextTick(() => {
this.emitter.emit('advanced-search')
})
},
/* 查询filter数据 */
queryFilter (params) {