2022-01-16 23:16:00 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="cn-chart">
|
2022-01-21 15:35:09 +08:00
|
|
|
|
<loading :loading="loading && !isTabs && !isBlock && !isGroup"></loading>
|
2022-01-17 17:06:14 +08:00
|
|
|
|
<chart-no-data v-if="isNoData"></chart-no-data>
|
2022-01-16 23:16:00 +08:00
|
|
|
|
<template v-else>
|
|
|
|
|
|
|
|
|
|
|
|
<chart-tabs
|
2022-01-20 15:50:09 +08:00
|
|
|
|
v-if="isTabs"
|
|
|
|
|
|
:chart-info="chartInfo"
|
|
|
|
|
|
:query-params="queryParams"
|
|
|
|
|
|
:entity="entity"
|
2022-01-16 23:16:00 +08:00
|
|
|
|
></chart-tabs>
|
|
|
|
|
|
|
|
|
|
|
|
<chart-map
|
2022-01-20 15:50:09 +08:00
|
|
|
|
v-else-if="isMap && !isIpBasicInfo"
|
|
|
|
|
|
:chart-info="chartInfo"
|
|
|
|
|
|
:chart-data="chartData"
|
|
|
|
|
|
:query-params="queryParams"
|
|
|
|
|
|
:entity="entity"
|
|
|
|
|
|
@showLoading="showLoading"
|
2022-01-16 23:16:00 +08:00
|
|
|
|
></chart-map>
|
|
|
|
|
|
|
2022-01-18 19:43:41 +08:00
|
|
|
|
<chart-single-value
|
2022-01-20 15:50:09 +08:00
|
|
|
|
v-else-if="isSingleValue"
|
|
|
|
|
|
:chart-info="chartInfo"
|
|
|
|
|
|
:chart-data="chartData"
|
|
|
|
|
|
:query-params="queryParams"
|
|
|
|
|
|
@showLoading="showLoading"
|
2022-01-18 19:43:41 +08:00
|
|
|
|
></chart-single-value>
|
|
|
|
|
|
|
2022-01-18 23:12:03 +08:00
|
|
|
|
<chart-block
|
2022-01-20 15:50:09 +08:00
|
|
|
|
v-else-if="isBlock"
|
|
|
|
|
|
:chart-info="chartInfo"
|
|
|
|
|
|
:chart-data="chartData"
|
|
|
|
|
|
:entity="entity"
|
2022-01-18 23:12:03 +08:00
|
|
|
|
></chart-block>
|
|
|
|
|
|
|
2022-01-21 16:07:23 +08:00
|
|
|
|
<chart-group
|
2022-01-21 15:35:09 +08:00
|
|
|
|
v-else-if="isGroup"
|
|
|
|
|
|
:chart-info="chartInfo"
|
|
|
|
|
|
:chart-data="chartData"
|
|
|
|
|
|
:entity="entity"
|
2022-01-21 16:07:23 +08:00
|
|
|
|
></chart-group>
|
2022-01-21 15:35:09 +08:00
|
|
|
|
|
2022-01-18 23:12:03 +08:00
|
|
|
|
<ip-basic-info
|
2022-01-20 15:50:09 +08:00
|
|
|
|
v-else-if="isIpBasicInfo"
|
|
|
|
|
|
:chart-info="chartInfo"
|
|
|
|
|
|
:chart-data="chartData"
|
|
|
|
|
|
:entity="entity"
|
2022-01-18 23:12:03 +08:00
|
|
|
|
></ip-basic-info>
|
2022-01-18 13:56:01 +08:00
|
|
|
|
|
2022-01-19 17:42:41 +08:00
|
|
|
|
<chart-time-bar
|
2022-01-20 15:50:09 +08:00
|
|
|
|
v-else-if="isEchartsTimeBar"
|
|
|
|
|
|
:chart-info="chartInfo"
|
|
|
|
|
|
:chart-data="chartData"
|
|
|
|
|
|
:result-type="resultType"
|
|
|
|
|
|
:query-params="queryParams"
|
|
|
|
|
|
@showLoading="showLoading"
|
2022-01-19 17:42:41 +08:00
|
|
|
|
></chart-time-bar>
|
|
|
|
|
|
|
|
|
|
|
|
<chart-category-bar
|
2022-01-20 15:50:09 +08:00
|
|
|
|
v-else-if="isEchartsCategoryBar"
|
|
|
|
|
|
:chart-info="chartInfo"
|
|
|
|
|
|
:chart-data="chartData"
|
|
|
|
|
|
:result-type="resultType"
|
|
|
|
|
|
:query-params="queryParams"
|
|
|
|
|
|
@showLoading="showLoading"
|
2022-01-19 17:42:41 +08:00
|
|
|
|
></chart-category-bar>
|
2022-01-19 17:43:47 +08:00
|
|
|
|
|
2022-01-20 15:39:52 +08:00
|
|
|
|
<chart-ip-open-port-bar
|
2022-01-21 13:07:11 +08:00
|
|
|
|
v-else-if="isIpOpenPortBar"
|
|
|
|
|
|
:chart-info="chartInfo"
|
|
|
|
|
|
:chart-data="chartData"
|
|
|
|
|
|
:result-type="resultType"
|
|
|
|
|
|
:query-params="queryParams"
|
|
|
|
|
|
@showLoading="showLoading"
|
2022-01-20 15:39:52 +08:00
|
|
|
|
></chart-ip-open-port-bar>
|
|
|
|
|
|
|
2022-01-19 15:54:27 +08:00
|
|
|
|
<chart-table
|
2022-01-20 18:08:01 +08:00
|
|
|
|
v-else-if="isTable && isCurrentTable"
|
2022-01-19 15:54:27 +08:00
|
|
|
|
:chart-info="chartInfo"
|
|
|
|
|
|
:chart-data="chartData"
|
|
|
|
|
|
:table="table"
|
|
|
|
|
|
:query-params="queryParams"
|
|
|
|
|
|
@showLoading="showLoading"
|
|
|
|
|
|
></chart-table>
|
|
|
|
|
|
|
2022-01-19 20:11:58 +08:00
|
|
|
|
<chart-active-ip-table
|
2022-01-21 13:07:11 +08:00
|
|
|
|
v-else-if="isActiveIpTable"
|
|
|
|
|
|
:chart-info="chartInfo"
|
|
|
|
|
|
:chart-data="chartData"
|
|
|
|
|
|
:table="table"
|
|
|
|
|
|
:query-params="queryParams"
|
2022-01-19 20:11:58 +08:00
|
|
|
|
></chart-active-ip-table>
|
|
|
|
|
|
|
|
|
|
|
|
<chart-app-basic-info
|
|
|
|
|
|
v-else-if="isAppBasicInfo"
|
|
|
|
|
|
:chart-info="chartInfo"
|
|
|
|
|
|
:chart-data="chartData"
|
|
|
|
|
|
:query-params="queryParams"
|
|
|
|
|
|
></chart-app-basic-info>
|
|
|
|
|
|
|
|
|
|
|
|
<chart-domain-whois
|
|
|
|
|
|
v-else-if="isDomainWhois"
|
|
|
|
|
|
:chart-info="chartInfo"
|
|
|
|
|
|
:chart-data="chartData"
|
|
|
|
|
|
:query-params="queryParams"
|
|
|
|
|
|
></chart-domain-whois>
|
|
|
|
|
|
|
|
|
|
|
|
<chart-domain-dns-record
|
2022-01-21 13:07:11 +08:00
|
|
|
|
v-else-if="isDomainDnsRecord"
|
|
|
|
|
|
:chart-info="chartInfo"
|
|
|
|
|
|
:chart-data="chartData"
|
|
|
|
|
|
:query-params="queryParams"
|
2022-01-19 20:11:58 +08:00
|
|
|
|
></chart-domain-dns-record>
|
|
|
|
|
|
|
|
|
|
|
|
<chart-cryptocurrency-event-list
|
2022-01-21 13:07:11 +08:00
|
|
|
|
v-else-if="isCryptocurrencyEventList"
|
|
|
|
|
|
:chart-info="chartInfo"
|
|
|
|
|
|
:chart-data="chartData"
|
|
|
|
|
|
:query-params="queryParams"
|
2022-01-19 20:11:58 +08:00
|
|
|
|
></chart-cryptocurrency-event-list>
|
|
|
|
|
|
|
2022-01-20 17:54:36 +08:00
|
|
|
|
<chart-relation-ship
|
2022-01-21 13:07:11 +08:00
|
|
|
|
v-else-if="isRelationShip"
|
|
|
|
|
|
:chart-info="chartInfo"
|
|
|
|
|
|
:chart-data="chartData"
|
|
|
|
|
|
:query-params="queryParams"
|
2022-01-20 17:54:36 +08:00
|
|
|
|
></chart-relation-ship>
|
|
|
|
|
|
|
|
|
|
|
|
<chart-san-key
|
2022-01-21 13:07:11 +08:00
|
|
|
|
v-else-if="isSankey"
|
|
|
|
|
|
:chart-info="chartInfo"
|
|
|
|
|
|
:chart-data="chartData"
|
|
|
|
|
|
:query-params="queryParams"
|
|
|
|
|
|
:entity="entity"
|
2022-01-20 17:54:36 +08:00
|
|
|
|
></chart-san-key>
|
|
|
|
|
|
|
2022-01-21 17:34:53 +08:00
|
|
|
|
<chart-echart-line
|
|
|
|
|
|
v-else-if="isEchartsLine"
|
|
|
|
|
|
:chart-info="chartInfo"
|
|
|
|
|
|
:chart-data="chartData"
|
|
|
|
|
|
:result-type="resultType"
|
|
|
|
|
|
@showLoading="showLoading"
|
|
|
|
|
|
></chart-echart-line>
|
|
|
|
|
|
|
|
|
|
|
|
<chart-echart-with-statistics
|
|
|
|
|
|
v-else-if="isEchartsWithStatistics"
|
|
|
|
|
|
:chart-info="chartInfo"
|
|
|
|
|
|
:chart-data="chartData"
|
|
|
|
|
|
:result-type="resultType"
|
|
|
|
|
|
@showLoading="showLoading"
|
|
|
|
|
|
></chart-echart-with-statistics>
|
|
|
|
|
|
|
2022-01-16 23:16:00 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import Loading from '@/components/common/Loading'
|
2022-01-19 20:11:58 +08:00
|
|
|
|
import ChartNoData from '@/views/charts/charts/ChartNoData'
|
|
|
|
|
|
import ChartTabs from '@/views/charts/charts/ChartTabs'
|
|
|
|
|
|
import ChartMap from '@/views/charts/charts/ChartMap'
|
|
|
|
|
|
import ChartSingleValue from '@/views/charts/charts/ChartSingleValue'
|
|
|
|
|
|
import ChartBlock from '@/views/charts/charts/ChartBlock'
|
2022-01-21 16:07:23 +08:00
|
|
|
|
import ChartGroup from '@/views/charts/charts/ChartGroup'
|
2022-01-18 23:12:03 +08:00
|
|
|
|
import IpBasicInfo from '@/views/charts/charts/IpBasicInfo'
|
2022-01-19 20:11:58 +08:00
|
|
|
|
import ChartEchartLine from '@/views/charts/charts/ChartEchartLine'
|
2022-01-21 17:34:53 +08:00
|
|
|
|
import ChartEchartWithStatistics from '@/views/charts/charts/ChartEchartWithStatistics'
|
2022-01-20 15:42:27 +08:00
|
|
|
|
import ChartActiveIpTable from '@/views/charts/charts/ChartActiveIpTable'
|
2022-01-19 17:42:41 +08:00
|
|
|
|
import ChartTimeBar from './charts/ChartTimeBar'
|
|
|
|
|
|
import ChartCategoryBar from './charts/ChartCategoryBar'
|
2022-01-20 15:39:52 +08:00
|
|
|
|
import ChartIpOpenPortBar from './charts/ChartIpOpenPortBar'
|
|
|
|
|
|
import ChartTable from './charts/ChartTable'
|
2022-01-20 15:42:27 +08:00
|
|
|
|
import ChartAppBasicInfo from '@/views/charts/charts/ChartAppBasicInfo'
|
|
|
|
|
|
import ChartDomainWhois from '@/views/charts/charts/ChartDomainWhois'
|
|
|
|
|
|
import ChartDomainDnsRecord from '@/views/charts/charts/ChartDomainDnsRecord'
|
|
|
|
|
|
import ChartCryptocurrencyEventList from '@/views/charts/charts/ChartCryptocurrencyEventList'
|
2022-01-20 17:54:36 +08:00
|
|
|
|
import ChartRelationShip from '@/views/charts/charts/ChartRelationShip'
|
|
|
|
|
|
import ChartSanKey from '@/views/charts/charts/ChartSanKey'
|
2022-01-16 23:16:00 +08:00
|
|
|
|
import {
|
|
|
|
|
|
isEcharts,
|
2022-01-18 19:42:55 +08:00
|
|
|
|
isEchartsLine,
|
2022-01-16 23:16:00 +08:00
|
|
|
|
isSingleValue,
|
|
|
|
|
|
isTable,
|
2022-01-20 18:08:01 +08:00
|
|
|
|
isCurrentTable,
|
2022-01-16 23:16:00 +08:00
|
|
|
|
isActiveIpTable,
|
|
|
|
|
|
isTitle,
|
|
|
|
|
|
isMap,
|
|
|
|
|
|
getOption,
|
|
|
|
|
|
isEchartsWithTable,
|
|
|
|
|
|
isEchartsWithStatistics,
|
|
|
|
|
|
isEchartsTimeBar,
|
|
|
|
|
|
isEchartsCategoryBar,
|
2022-01-20 15:39:52 +08:00
|
|
|
|
isIpOpenPortBar,
|
2022-01-16 23:16:00 +08:00
|
|
|
|
isMapLine,
|
|
|
|
|
|
isMapBlock,
|
|
|
|
|
|
isSingleValueWithEcharts,
|
|
|
|
|
|
isSingleValueWithEchartsTemp,
|
|
|
|
|
|
isRelationShip,
|
|
|
|
|
|
isTabs,
|
|
|
|
|
|
isGroup,
|
|
|
|
|
|
isSankey,
|
|
|
|
|
|
isIpBasicInfo,
|
|
|
|
|
|
isIpOpenPort,
|
|
|
|
|
|
isIpHostedDomain,
|
|
|
|
|
|
isDomainWhois,
|
|
|
|
|
|
isDomainDnsRecord,
|
|
|
|
|
|
isCryptocurrencyEventList,
|
|
|
|
|
|
isAppBasicInfo,
|
|
|
|
|
|
isAppRelatedDomain,
|
|
|
|
|
|
isBlock
|
|
|
|
|
|
} from './charts/tools'
|
|
|
|
|
|
import _ from 'lodash'
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
|
name: 'chart',
|
|
|
|
|
|
components: {
|
2022-01-20 17:54:36 +08:00
|
|
|
|
ChartSanKey,
|
2022-01-19 20:11:58 +08:00
|
|
|
|
ChartCryptocurrencyEventList,
|
|
|
|
|
|
ChartDomainDnsRecord,
|
|
|
|
|
|
ChartDomainWhois,
|
|
|
|
|
|
ChartAppBasicInfo,
|
|
|
|
|
|
ChartActiveIpTable,
|
2022-01-19 15:54:27 +08:00
|
|
|
|
ChartTable,
|
2022-01-18 23:12:03 +08:00
|
|
|
|
IpBasicInfo,
|
2022-01-18 19:43:41 +08:00
|
|
|
|
ChartSingleValue,
|
2022-01-16 23:16:00 +08:00
|
|
|
|
Loading,
|
|
|
|
|
|
ChartNoData,
|
|
|
|
|
|
ChartTabs,
|
2022-01-18 19:42:55 +08:00
|
|
|
|
ChartMap,
|
2022-01-18 23:12:03 +08:00
|
|
|
|
ChartEchartLine,
|
2022-01-19 17:42:41 +08:00
|
|
|
|
ChartBlock,
|
|
|
|
|
|
ChartTimeBar,
|
2022-01-20 15:39:52 +08:00
|
|
|
|
ChartCategoryBar,
|
2022-01-20 17:54:36 +08:00
|
|
|
|
ChartIpOpenPortBar,
|
|
|
|
|
|
ChartRelationShip,
|
2022-01-21 17:34:53 +08:00
|
|
|
|
ChartGroup,
|
|
|
|
|
|
ChartEchartWithStatistics
|
2022-01-16 23:16:00 +08:00
|
|
|
|
},
|
|
|
|
|
|
props: {
|
|
|
|
|
|
chartInfo: Object,
|
|
|
|
|
|
chartData: [Object, Array, String], // 数据在父组件查询后传入,本组件内不查询,只根据接传递的数据来渲染
|
2022-01-18 19:42:55 +08:00
|
|
|
|
resultType: Object, // 返回数据的类型
|
2022-01-16 23:16:00 +08:00
|
|
|
|
queryParams: Object, // 接口请求参数
|
|
|
|
|
|
customChartOption: Object, // 需要自定义echarts的option时传入,非必须;传入该值时仍需传对应格式的chartData
|
|
|
|
|
|
isFullscreen: Boolean,
|
|
|
|
|
|
loading: Boolean,
|
|
|
|
|
|
panelLock: Boolean,
|
2022-01-18 23:12:03 +08:00
|
|
|
|
entity: Object,
|
2022-01-19 15:54:27 +08:00
|
|
|
|
isError: Boolean,
|
|
|
|
|
|
table: Object
|
2022-01-16 23:16:00 +08:00
|
|
|
|
},
|
|
|
|
|
|
computed: {
|
|
|
|
|
|
isNoData () {
|
2022-01-20 18:08:01 +08:00
|
|
|
|
return !this.loading && (_.isEmpty(this.chartData) || this.isError) && !this.isSingleValue && !this.isTabs && !this.isDomainDnsRecord && !this.isCryptocurrencyEventList && !this.isActiveIpTable
|
2022-01-16 23:16:00 +08:00
|
|
|
|
},
|
|
|
|
|
|
chartOption () {
|
|
|
|
|
|
if (this.customChartOption) {
|
|
|
|
|
|
return _.cloneDeep(this.customChartOption)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return getOption(this.chartInfo.type)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
resize () {
|
|
|
|
|
|
this.$refs['chart' + this.chartInfo.id] && this.$refs['chart' + this.chartInfo.id].resize()
|
|
|
|
|
|
},
|
|
|
|
|
|
showLoading (show) {
|
|
|
|
|
|
this.$emit('showLoading', show)
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
setup (props) {
|
|
|
|
|
|
return {
|
|
|
|
|
|
isEcharts: isEcharts(props.chartInfo.type),
|
2022-01-18 19:42:55 +08:00
|
|
|
|
isEchartsLine: isEchartsLine(props.chartInfo.type),
|
2022-01-16 23:16:00 +08:00
|
|
|
|
isEchartsTimeBar: isEchartsTimeBar(props.chartInfo.type),
|
|
|
|
|
|
isEchartsCategoryBar: isEchartsCategoryBar(props.chartInfo.type),
|
2022-01-20 15:39:52 +08:00
|
|
|
|
isIpOpenPortBar: isIpOpenPortBar(props.chartInfo.type),
|
2022-01-16 23:16:00 +08:00
|
|
|
|
isEchartsWithTable: isEchartsWithTable(props.chartInfo.type),
|
|
|
|
|
|
isEchartsWithStatistics: isEchartsWithStatistics(props.chartInfo.type),
|
|
|
|
|
|
isSingleValue: isSingleValue(props.chartInfo.type),
|
|
|
|
|
|
isSingleValueWithEcharts: isSingleValueWithEcharts(props.chartInfo.type),
|
|
|
|
|
|
isSingleValueWithEchartsTemp: isSingleValueWithEchartsTemp(props.chartInfo.type),
|
|
|
|
|
|
isRelationShip: isRelationShip(props.chartInfo.type),
|
|
|
|
|
|
isTable: isTable(props.chartInfo.type),
|
2022-01-20 18:08:01 +08:00
|
|
|
|
isCurrentTable: isCurrentTable(props.chartInfo.type),
|
2022-01-16 23:16:00 +08:00
|
|
|
|
isActiveIpTable: isActiveIpTable(props.chartInfo.type),
|
|
|
|
|
|
isMap: isMap(props.chartInfo.type),
|
|
|
|
|
|
isTitle: isTitle(props.chartInfo.type),
|
|
|
|
|
|
isMapLine: isMapLine(props.chartInfo.type),
|
|
|
|
|
|
isMapBlock: isMapBlock(props.chartInfo.type),
|
|
|
|
|
|
isTabs: isTabs(props.chartInfo.type),
|
|
|
|
|
|
isGroup: isGroup(props.chartInfo.type),
|
|
|
|
|
|
isBlock: isBlock(props.chartInfo.type),
|
|
|
|
|
|
isSankey: isSankey(props.chartInfo.type),
|
|
|
|
|
|
isIpBasicInfo: isIpBasicInfo(props.chartInfo.type),
|
|
|
|
|
|
isIpHostedDomain: isIpHostedDomain(props.chartInfo.type),
|
|
|
|
|
|
isIpOpenPort: isIpOpenPort(props.chartInfo.type),
|
|
|
|
|
|
isDomainWhois: isDomainWhois(props.chartInfo.type),
|
|
|
|
|
|
isDomainDnsRecord: isDomainDnsRecord(props.chartInfo.type),
|
|
|
|
|
|
isCryptocurrencyEventList: isCryptocurrencyEventList(props.chartInfo.type),
|
|
|
|
|
|
isAppBasicInfo: isAppBasicInfo(props.chartInfo.type),
|
|
|
|
|
|
isAppRelatedDomain: isAppRelatedDomain(props.chartInfo.type)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|