feat: entity详情(未完成)、修复一些问题
This commit is contained in:
60
src/components/entities/EntityDetail.vue
Normal file
60
src/components/entities/EntityDetail.vue
Normal file
@@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="show"
|
||||
:top="top"
|
||||
:modal="modal"
|
||||
:custom-class="customClass"
|
||||
:show-close="showClose"
|
||||
:width="width"
|
||||
destroy-on-close
|
||||
>
|
||||
<cn-panel :entity="entity" :is-entity-detail="true"></cn-panel>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Panel from '@/views/charts/Panel'
|
||||
export default {
|
||||
name: 'EntityDetail',
|
||||
components: {
|
||||
'cn-panel': Panel
|
||||
},
|
||||
props: {
|
||||
showDetail: Boolean,
|
||||
top: {
|
||||
type: String,
|
||||
default: '5vh'
|
||||
},
|
||||
modal: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
customClass: {
|
||||
type: String,
|
||||
default: 'entity-detail__dialog'
|
||||
},
|
||||
showClose: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
width: { // 高度需要通过customClass自行定义
|
||||
type: [String, Number],
|
||||
default: '90vw'
|
||||
},
|
||||
entity: Object // 实体,{ type: 'ip|domain|app', name: name, icon: icon-class }
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
showDetail (n, o) {
|
||||
this.show = n
|
||||
},
|
||||
show (n, o) {
|
||||
this.$emit('update:show-detail', n)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -35,7 +35,7 @@
|
||||
<div class="body__row-value" :title="d.asn">{{d.asn || '-'}}</div>
|
||||
</div>
|
||||
<div class="body__detail"
|
||||
@click="entityDetail({ip: d.ip}, [{key: 'clientIP', label: $t('overall.clientIp')}, {key: 'serverIP', label: $t('overall.serverIp')}])">{{$t('overall.detail')}}></div>
|
||||
@click="entityDetail({name: d.ip, type: 4})">{{$t('overall.detail')}}></div>
|
||||
</template>
|
||||
<template v-else-if="from === 'domain'">
|
||||
<div class="body__row">
|
||||
@@ -50,7 +50,7 @@
|
||||
<span class="body__row-label"><i class="cn-icon cn-icon-risk"></i> {{$t('entities.credit')}}:</span>
|
||||
<div class="body__row-value" :title="d.reputationScore">{{d.reputationScore || '-'}}</div>
|
||||
</div>
|
||||
<div class="body__detail" @click="entityDetail({domain: d.domainName})">{{$t('overall.detail')}}></div>
|
||||
<div class="body__detail" @click="entityDetail({name: d.domainName, type: 5})">{{$t('overall.detail')}}></div>
|
||||
</template>
|
||||
<template v-else-if="from === 'app'">
|
||||
<div class="body__row">
|
||||
@@ -65,7 +65,7 @@
|
||||
<span class="body__row-label"><i class="cn-icon cn-icon-risk"></i> {{$t('entities.subcategory')}}:</span>
|
||||
<div class="body__row-value" :title="d.appSubategory">{{d.appSubategory || '-'}}</div>
|
||||
</div>
|
||||
<div class="body__detail" @click="entityDetail({appId: d.appId})">{{$t('overall.detail')}}></div>
|
||||
<div class="body__detail" @click="entityDetail({name: d.appId, type: 6})">{{$t('overall.detail')}}></div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
@@ -162,8 +162,8 @@ export default {
|
||||
wraps.scrollTop = 0
|
||||
})
|
||||
},
|
||||
entityDetail (params, tabs = []) {
|
||||
this.$emit('showDetail', params, tabs)
|
||||
entityDetail (params) {
|
||||
this.$emit('showDetail', { ...params, icon: this.iconClass })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user