2022-02-14 22:22:31 +08:00
|
|
|
|
<template>
|
2022-02-18 17:54:22 +08:00
|
|
|
|
<div class="detection-list" id="detectionList">
|
2022-05-27 12:14:24 +08:00
|
|
|
|
<loading :loading="loading"></loading>
|
2022-02-18 17:54:22 +08:00
|
|
|
|
<div class="detection-list__content">
|
|
|
|
|
|
<div class="detection-list--list">
|
2023-10-20 15:45:11 +08:00
|
|
|
|
<div class="no-data" v-if="myListData.length===0">{{ $t('npm.noData') }}</div>
|
2022-11-09 15:42:36 +08:00
|
|
|
|
<div v-if="!isCollapse" @click="collapse" class="cn-detection__shadow new-cn-detection__shadow"></div>
|
2022-02-14 22:22:31 +08:00
|
|
|
|
<detection-row
|
2022-11-07 15:25:00 +08:00
|
|
|
|
style="margin-bottom: 10px"
|
|
|
|
|
|
class="detection-border"
|
2023-10-20 15:45:11 +08:00
|
|
|
|
v-for="(data, index) in myListData"
|
2022-02-14 22:22:31 +08:00
|
|
|
|
:detection="data"
|
2022-02-25 13:33:54 +08:00
|
|
|
|
:page-type="pageType"
|
2022-02-14 22:22:31 +08:00
|
|
|
|
:timeFilter="timeFilter"
|
|
|
|
|
|
:key="index"
|
2023-05-16 15:59:59 +08:00
|
|
|
|
:pageObj="pageObj"
|
2022-02-14 22:22:31 +08:00
|
|
|
|
:ref="`detectionRow${index}`"
|
|
|
|
|
|
:index="index"
|
|
|
|
|
|
@switchCollapse="switchCollapse"
|
|
|
|
|
|
></detection-row>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import DetectionRow from '@/views/detections/DetectionRow'
|
2022-05-27 12:14:24 +08:00
|
|
|
|
import Loading from '@/components/common/Loading'
|
2023-10-20 15:45:11 +08:00
|
|
|
|
import axios from 'axios'
|
|
|
|
|
|
import { api } from '@/utils/api'
|
2022-02-14 22:22:31 +08:00
|
|
|
|
export default {
|
|
|
|
|
|
name: 'DetectionList',
|
|
|
|
|
|
components: {
|
2022-05-27 12:14:24 +08:00
|
|
|
|
Loading,
|
2022-02-14 22:22:31 +08:00
|
|
|
|
DetectionRow
|
|
|
|
|
|
},
|
|
|
|
|
|
props: {
|
|
|
|
|
|
listData: Array,
|
|
|
|
|
|
from: String,
|
|
|
|
|
|
pageObj: Object,
|
|
|
|
|
|
loading: Boolean,
|
2022-02-25 13:33:54 +08:00
|
|
|
|
timeFilter: Object,
|
|
|
|
|
|
pageType: String // 安全事件、服务质量
|
2022-02-14 22:22:31 +08:00
|
|
|
|
},
|
|
|
|
|
|
data () {
|
|
|
|
|
|
return {
|
|
|
|
|
|
showDetail: false,
|
|
|
|
|
|
typeName: '',
|
|
|
|
|
|
detectionList: [],
|
|
|
|
|
|
isCollapse: true,
|
|
|
|
|
|
collapseIndex: 0,
|
|
|
|
|
|
tableId: 'detectionList',
|
|
|
|
|
|
listDataCopy: [],
|
2023-10-20 15:45:11 +08:00
|
|
|
|
noData: true,
|
|
|
|
|
|
myListData: [] // listData的克隆,避免因为修改listData里的malWareName而触发watch监听
|
2022-02-14 22:22:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2022-06-09 21:55:28 +08:00
|
|
|
|
mounted () {
|
|
|
|
|
|
// 监听⿏标滚动事件
|
|
|
|
|
|
window.addEventListener('mousewheel', this.handleScroll)
|
|
|
|
|
|
},
|
|
|
|
|
|
unmounted () {
|
|
|
|
|
|
window.removeEventListener('mousewheel', this.handleScroll)
|
|
|
|
|
|
},
|
2022-02-14 22:22:31 +08:00
|
|
|
|
methods: {
|
2023-10-20 15:45:11 +08:00
|
|
|
|
initData () {
|
|
|
|
|
|
this.myListData = []
|
|
|
|
|
|
this.listData.forEach((item, i) => {
|
|
|
|
|
|
this.myListData.push(this.$_.cloneDeep(item))
|
2023-10-24 18:01:59 +08:00
|
|
|
|
if (item.eventInfoObj && item.isBuiltin === 1) {
|
|
|
|
|
|
axios.get(`${api.detection.securityEvent.detail}/${item.eventInfoObj.ioc_type.toLowerCase()}?resource=${item.eventInfoObj.ioc_value}`).then(res => {
|
|
|
|
|
|
if (res.status === 200) {
|
|
|
|
|
|
if (item.eventType === 'Anonymity') {
|
|
|
|
|
|
item.darkweb = this.$_.get(res, 'data.data.darkweb', {}) || {}
|
|
|
|
|
|
} else if (item.eventType === 'Command and Control') {
|
|
|
|
|
|
item.malware = this.$_.get(res, 'data.data.malware', {}) || {}
|
|
|
|
|
|
}
|
2023-10-20 15:45:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
}).catch(e => {
|
2023-10-22 18:29:34 +08:00
|
|
|
|
console.error(e)
|
2023-10-20 15:45:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2022-02-14 22:22:31 +08:00
|
|
|
|
switchCollapse (isCollapse, index) {
|
|
|
|
|
|
this.isCollapse = isCollapse
|
|
|
|
|
|
this.collapseIndex = index
|
2022-05-24 15:23:55 +08:00
|
|
|
|
if (isCollapse) {
|
|
|
|
|
|
this.emitter.emit('switch-collapse')
|
|
|
|
|
|
}
|
2022-02-14 22:22:31 +08:00
|
|
|
|
},
|
|
|
|
|
|
collapse () {
|
|
|
|
|
|
this.isCollapse = true
|
2022-09-01 11:05:29 +08:00
|
|
|
|
if (this.$refs[`detectionRow${this.collapseIndex}`] && this.$refs[`detectionRow${this.collapseIndex}`].collapse) {
|
|
|
|
|
|
this.$refs[`detectionRow${this.collapseIndex}`].collapse()
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.$refs[`detectionRow${this.collapseIndex}`][0].collapse()
|
|
|
|
|
|
}
|
2022-06-09 21:55:28 +08:00
|
|
|
|
},
|
|
|
|
|
|
handleScroll (e) {
|
2022-06-10 10:35:51 +08:00
|
|
|
|
if (e.target.className === 'cn-detection__shadow') {
|
|
|
|
|
|
const container = document.getElementById('cnContainer')
|
|
|
|
|
|
container.scrollTop += e.deltaY / 2
|
2022-06-09 21:55:28 +08:00
|
|
|
|
}
|
2022-02-14 22:22:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
watch: {
|
|
|
|
|
|
listData: {
|
2023-10-20 15:45:11 +08:00
|
|
|
|
immediate: true,
|
2022-02-14 22:22:31 +08:00
|
|
|
|
deep: true,
|
|
|
|
|
|
handler (n) {
|
|
|
|
|
|
if (!n || n.length === 0) {
|
|
|
|
|
|
this.timeout = setTimeout(() => {
|
|
|
|
|
|
this.noData = true
|
2023-10-22 18:29:34 +08:00
|
|
|
|
this.myListData = []
|
2022-02-14 22:22:31 +08:00
|
|
|
|
}, 500)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
clearTimeout(this.timeout)
|
|
|
|
|
|
this.noData = false
|
2023-10-24 18:01:59 +08:00
|
|
|
|
this.initData()
|
2022-02-14 22:22:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|