Merge branch 'dev' of https://git.mesalab.cn/cyber-narrator/cn-ui into dev
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
justify-content:space-between;
|
||||
align-items:center;
|
||||
padding: 10px 20px 10px 18px;
|
||||
height: 47px;
|
||||
flex: 0 0 40px;
|
||||
|
||||
font-size: 16px;
|
||||
color: $--color-text-primary;
|
||||
@@ -214,7 +214,7 @@
|
||||
position: relative;
|
||||
border-radius: 2px;
|
||||
flex-grow: 1;
|
||||
overflow: auto;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
.chart-drawing {
|
||||
height: 100%;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
justify-content:space-between;
|
||||
align-items:center;
|
||||
padding: 10px 20px 10px 0px;
|
||||
height: 40px;
|
||||
flex: 0 0 40px;
|
||||
|
||||
font-size: 14px;
|
||||
color: $--color-text-primary;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
@font-face {
|
||||
font-family: "cn-icon"; /* Project id 2614877 */
|
||||
src: url('iconfont.woff2?t=1645687921203') format('woff2'),
|
||||
url('iconfont.woff?t=1645687921203') format('woff'),
|
||||
url('iconfont.ttf?t=1645687921203') format('truetype');
|
||||
src: url('iconfont.woff2?t=1647073084945') format('woff2'),
|
||||
url('iconfont.woff?t=1647073084945') format('woff'),
|
||||
url('iconfont.ttf?t=1647073084945') format('truetype');
|
||||
}
|
||||
|
||||
.cn-icon {
|
||||
@@ -13,6 +13,26 @@
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.cn-icon-intercept:before {
|
||||
content: "\e600";
|
||||
}
|
||||
|
||||
.cn-icon-fraudulent-app:before {
|
||||
content: "\e601";
|
||||
}
|
||||
|
||||
.cn-icon-fraudulent-ip:before {
|
||||
content: "\e602";
|
||||
}
|
||||
|
||||
.cn-icon-fraudulent-domain:before {
|
||||
content: "\e603";
|
||||
}
|
||||
|
||||
.cn-icon-partly-cloudy:before {
|
||||
content: "\e604";
|
||||
}
|
||||
|
||||
.cn-icon-detection:before {
|
||||
content: "\e766";
|
||||
}
|
||||
@@ -21,7 +41,7 @@
|
||||
content: "\e764";
|
||||
}
|
||||
|
||||
.cn-icon-qingchu:before {
|
||||
.cn-icon-clear:before {
|
||||
content: "\e765";
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -20,7 +20,6 @@
|
||||
@changeMode="changeMode"
|
||||
@search="search"
|
||||
></tag-mode>
|
||||
<!-- <div class="search-tip--error">something error...</div>-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -102,8 +101,20 @@ export default {
|
||||
ElMessage.error(this.$t('tip.invalidExpression'))
|
||||
}
|
||||
}
|
||||
},
|
||||
enterListener (event) {
|
||||
if (event.keyCode === 13) {
|
||||
this.$refs.tagMode && this.$refs.tagMode.search()
|
||||
this.$refs.textMode && this.$refs.textMode.search()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
document.addEventListener('keydown', this.enterListener)
|
||||
},
|
||||
unmounted () {
|
||||
document.removeEventListener('keydown', this.enterListener)
|
||||
},
|
||||
setup (props) {
|
||||
// 默认为文本模式
|
||||
let searchMode = ref('text')
|
||||
|
||||
@@ -308,6 +308,12 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
const vm = this
|
||||
this.emitter.on('advanced-search', function () {
|
||||
vm.search()
|
||||
})
|
||||
},
|
||||
watch: {
|
||||
convertMetaList: {
|
||||
immediate: true,
|
||||
|
||||
@@ -23,6 +23,7 @@ import CodeMirror from 'codemirror'
|
||||
import { toRaw } from 'vue'
|
||||
import { columnType } from '@/components/advancedSearch/meta/meta'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { reg } from '@/utils/constants'
|
||||
|
||||
export default {
|
||||
name: 'TextMode',
|
||||
@@ -53,7 +54,20 @@ export default {
|
||||
search () {
|
||||
let originalSql = this.codeMirror.getValue()
|
||||
if (originalSql) {
|
||||
originalSql = originalSql.replace(/"/g, '')
|
||||
originalSql = originalSql.replaceAll(/"/g, '')
|
||||
// 为解决ip无法校验通过的问题,先将带引号的ip转为不带引号的,再把不带引号的转为带引号的
|
||||
originalSql = originalSql.replaceAll(reg.notStrictWithQuotIpv4, function (word) {
|
||||
return word.replaceAll(/'/g, '')
|
||||
})
|
||||
originalSql = originalSql.replaceAll(reg.notStrictIpv4, function (word) {
|
||||
return `'${word}'`
|
||||
})
|
||||
originalSql = originalSql.replaceAll(reg.notStrictWithQuotIpv6, function (word) {
|
||||
return word.replaceAll(/'/g, '')
|
||||
})
|
||||
originalSql = originalSql.replaceAll(reg.notStrictIpv6, function (word) {
|
||||
return `'${word}'`
|
||||
})
|
||||
const parser = new SqlParser(originalSql, this.columnList)
|
||||
const errorList = parser.validate()
|
||||
if (this.$_.isEmpty(errorList)) {
|
||||
@@ -144,6 +158,10 @@ export default {
|
||||
},
|
||||
mounted () {
|
||||
this.initCodeMirror()
|
||||
const vm = this
|
||||
this.emitter.on('advanced-search', function () {
|
||||
vm.search()
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -130,13 +130,21 @@ export async function getEntityFilter (params) {
|
||||
export async function getDictList (params) {
|
||||
return await getData(api.dict, params, true)
|
||||
}
|
||||
|
||||
function handleResult (response) {
|
||||
if (response.data.list || response.data.result) {
|
||||
return response.data.list || response.data.result
|
||||
} else if (response.data.result === 0) {
|
||||
return response.data.result
|
||||
} else {
|
||||
return response.data
|
||||
}
|
||||
}
|
||||
export async function getData (url, params = {}, isQueryList) {
|
||||
const request = new Promise((resolve, reject) => {
|
||||
try {
|
||||
get(url, params).then(response => {
|
||||
if (response.code === 200) {
|
||||
resolve(isQueryList ? response.data.list || response.data.result : response.data.result || response.data)
|
||||
resolve(handleResult(response))
|
||||
} else {
|
||||
reject(response)
|
||||
}
|
||||
|
||||
@@ -410,3 +410,14 @@ export const iso36112 = {
|
||||
SZ: 'eswatiniLow',
|
||||
MN: 'mongoliaLow'
|
||||
}
|
||||
|
||||
export const reg = {
|
||||
// 不严格ipv4
|
||||
notStrictIpv4: /(?:[0-9]{1,}\.){0,}[0-9]{1,}(\.)?/g,
|
||||
// 不严格Ipv4带单引号
|
||||
notStrictWithQuotIpv4: /'(?:[0-9]{1,}\.){0,}[0-9]{1,}(\.)?'/g,
|
||||
// 不严格ipv6
|
||||
notStrictIpv6: /(:{0,}[a-fA-F\d]{0,}){0,}:+([a-fA-F\d]{0,}:{0,}){0,}/g,
|
||||
// 不严格Ipv6带单引号
|
||||
notStrictWithQuotIpv6: /'(:{0,}[a-fA-F\d]{0,}){0,}:+([a-fA-F\d]{0,}:{0,}){0,}'/g
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
20
src/views/charts/charts/ChartDomainRecursiveResolve.vue
Normal file
20
src/views/charts/charts/ChartDomainRecursiveResolve.vue
Normal 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>
|
||||
@@ -47,7 +47,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
handleQueryParams (queryParams) {
|
||||
this.timeFilter = {
|
||||
return this.timeFilter = {
|
||||
startTime: Number(queryParams.startTime) * 1000,
|
||||
endTime: Number(queryParams.endTime) * 1000
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -3,6 +3,7 @@ export default {
|
||||
chartInfo: Object,
|
||||
chartData: [Object, Array, String], // 数据在父组件查询后传入,本组件内不查询,只根据接传递的数据来渲染
|
||||
entity: Object,
|
||||
timeFilter: Object,
|
||||
queryParams: Object // 接口请求参数
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
},
|
||||
// 点击上一页箭头
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user