NEZ-2177 feat : asset process 二级页面开发
This commit is contained in:
@@ -37,11 +37,12 @@
|
||||
<operation-log-tab v-if="from === fromRoute.user && targetTab === 'operationLogTab'" :from="from" :obj="obj" :tabs="tabs.user.operationLog" @changeTab="changeTab" :targetTab.sync="targetTab"></operation-log-tab>
|
||||
<terminal-log-tab v-if="from === fromRoute.user && targetTab === 'terminalLogTab'" :from="from" :obj="obj" :tabs="tabs.user.terminalLog" @changeTab="changeTab" :targetTab.sync="targetTab"></terminal-log-tab>
|
||||
<!-- asset列表的3个 -->
|
||||
<panel-tab-new @exit="closeSubList" @getTableData="getTableData" :paramsType="'asset'" v-if="from === fromRoute.asset && targetTab === 'panelTab'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.asset.panel" :targetTab.sync="targetTab" @changeTab="changeTab"></panel-tab-new>
|
||||
<alertMessageTabNew v-if="from === fromRoute.asset && targetTab === 'alertMessageTab'" v-show="subResizeShow" :sign="sign+'alert'" :from="from" :obj="obj" :tabs="tabs.asset.alertMessage" :targetTab.sync="targetTab" @changeTab="changeTab" ></alertMessageTabNew>
|
||||
<endpointTabNew v-if="from === fromRoute.asset && targetTab === 'endpointTab'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.asset.endpoint" :targetTab.sync="targetTab" @changeTab="changeTab"></endpointTabNew>
|
||||
<log-bottom-tab v-if="from === fromRoute.asset && targetTab === 'log'" v-show="subResizeShow" :sign="sign+'log'" :from="from" :obj="obj" :tabs="tabs.asset.log" :targetTab.sync="targetTab" @changeTab="changeTab"></log-bottom-tab>
|
||||
<assetSubTab v-if="from === fromRoute.asset && targetTab === 'assetSubTab' && obj.childrenNum" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.asset.alertMessageSub" @changeTab="changeTab" :targetTab.sync="targetTab"></assetSubTab>
|
||||
<panel-tab-new @exit="closeSubList" @getTableData="getTableData" :paramsType="'asset'" v-if="from === fromRoute.asset && targetTab === 'panelTab'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="assetTabs" :targetTab.sync="targetTab" @changeTab="changeTab"></panel-tab-new>
|
||||
<alertMessageTabNew v-if="from === fromRoute.asset && targetTab === 'alertMessageTab'" v-show="subResizeShow" :sign="sign+'alert'" :from="from" :obj="obj" :tabs="assetTabs" :targetTab.sync="targetTab" @changeTab="changeTab" ></alertMessageTabNew>
|
||||
<endpointTabNew v-if="from === fromRoute.asset && targetTab === 'endpointTab'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="assetTabs" :targetTab.sync="targetTab" @changeTab="changeTab"></endpointTabNew>
|
||||
<log-bottom-tab v-if="from === fromRoute.asset && targetTab === 'log'" v-show="subResizeShow" :sign="sign+'log'" :from="from" :obj="obj" :tabs="assetTabs" :targetTab.sync="targetTab" @changeTab="changeTab"></log-bottom-tab>
|
||||
<process-bottom-tab v-if="from === fromRoute.asset && targetTab === 'process' && obj.clientState == '1'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="assetTabs" :targetTab.sync="targetTab" @changeTab="changeTab"></process-bottom-tab>
|
||||
<assetSubTab v-if="from === fromRoute.asset && targetTab === 'assetSubTab' && obj.childrenNum" v-show="subResizeShow" :from="from" :obj="obj" :tabs="assetTabs" @changeTab="changeTab" :targetTab.sync="targetTab"></assetSubTab>
|
||||
<!--module列表的tab-->
|
||||
<endpointTabNew v-if="from === fromRoute.module && targetTab === 'endpoint'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.module.moduleTabTitle" :targetTab="targetTab" @changeTab="changeTab"></endpointTabNew>
|
||||
<alertMessageTabNew v-if="from === fromRoute.module && targetTab === 'moduleAlertMessage'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.module.moduleTabTitle" @changeTab="changeTab" :targetTab="targetTab"></alertMessageTabNew>
|
||||
@@ -92,6 +93,7 @@ import terminalLogTab from './tabs/terminalLogTab'
|
||||
import assetTab from '@/components/common/bottomBox/tabs/assetTab'
|
||||
import { fromRoute } from '@/components/common/js/constants'
|
||||
import LogBottomTab from '@/components/common/bottomBox/tabs/logBottomTab'
|
||||
import processBottomTab from '@/components/common/bottomBox/tabs/processBottomTab'
|
||||
import scrapeEndpoint from '@/components/common/bottomBox/tabs/scrapeEndpoint'
|
||||
import IpDetails from '@/components/common/bottomBox/tabs/IpDetails'
|
||||
import recordRuleEvalLog from '@/components/common/bottomBox/tabs/recordRuleEvalLog'
|
||||
@@ -103,6 +105,7 @@ export default {
|
||||
components: {
|
||||
scrapeEndpoint,
|
||||
LogBottomTab,
|
||||
processBottomTab,
|
||||
cabinetTab,
|
||||
alertMessageTab,
|
||||
endpointTab,
|
||||
@@ -135,22 +138,21 @@ export default {
|
||||
obj: {
|
||||
immediate: true,
|
||||
handler (n) {
|
||||
if ((this.from === fromRoute.asset) && n) {
|
||||
const assetSub = { prop: 'assetSubTab', name: this.$t('overall.assetSubTab'), active: false }
|
||||
if (n.childrenNum) {
|
||||
if (!this.tabs.asset.panel.find(item => item.prop === assetSub.prop)) {
|
||||
this.tabs.asset.panel.push(assetSub)
|
||||
this.tabs.asset.alertMessage.push(assetSub)
|
||||
this.tabs.asset.endpoint.push(assetSub)
|
||||
this.tabs.asset.log.push(assetSub)
|
||||
}
|
||||
} else if (this.tabs.asset.panel.find(item => item.prop === assetSub.prop)) {
|
||||
this.tabs.asset.panel = this.tabs.asset.panel.filter(item => item.prop !== assetSub.prop)
|
||||
this.tabs.asset.alertMessage = this.tabs.asset.alertMessage.filter(item => item.prop !== assetSub.prop)
|
||||
this.tabs.asset.endpoint = this.tabs.asset.endpoint.filter(item => item.prop !== assetSub.prop)
|
||||
this.tabs.asset.log = this.tabs.asset.log.filter(item => item.prop !== assetSub.prop)
|
||||
}
|
||||
}
|
||||
// if ((this.from === fromRoute.asset) && n) {
|
||||
// const assetSub = { prop: 'assetSubTab', name: this.$t('overall.assetSubTab'), active: false }
|
||||
// if (n.childrenNum) {
|
||||
// if (!this.tabs.asset.panel.find(item => item.prop === assetSub.prop)) {
|
||||
// this.tabs.asset.panel.push(assetSub)
|
||||
// this.tabs.asset.alertMessage.push(assetSub)
|
||||
// this.tabs.asset.endpoint.push(assetSub)
|
||||
// this.tabs.asset.log.push(assetSub)
|
||||
// }
|
||||
// } else if (this.tabs.asset.panel.find(item => item.prop === assetSub.prop)) {
|
||||
// this.tabs.asset.panel = this.tabs.asset.panel.filter(item => item.prop !== assetSub.prop)
|
||||
// this.tabs.asset.alertMessage = this.tabs.asset.alertMessage.filter(item => item.prop !== assetSub.prop)
|
||||
// this.tabs.asset.endpoint = this.tabs.asset.endpoint.filter(item => item.prop !== assetSub.prop)
|
||||
// this.tabs.asset.log = this.tabs.asset.log.filter(item => item.prop !== assetSub.prop)
|
||||
// }
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -183,37 +185,43 @@ export default {
|
||||
// module tab
|
||||
},
|
||||
asset: {
|
||||
panel: [
|
||||
{ prop: 'panelTab', name: this.$t('overall.dashboard'), active: true },
|
||||
{ prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false },
|
||||
{ prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false },
|
||||
{ prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: false }
|
||||
],
|
||||
alertMessage: [
|
||||
{ prop: 'panelTab', name: this.$t('overall.dashboard'), active: false },
|
||||
{ prop: 'alertMessageTab', name: this.$t('overall.alert'), active: true },
|
||||
{ prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false },
|
||||
{ prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: false }
|
||||
],
|
||||
endpoint: [
|
||||
{ prop: 'panelTab', name: this.$t('overall.dashboard'), active: false },
|
||||
{ prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false },
|
||||
{ prop: 'endpointTab', name: this.$t('asset.endpoint'), active: true },
|
||||
{ prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: false }
|
||||
],
|
||||
log: [
|
||||
{ prop: 'panelTab', name: this.$t('overall.dashboard'), active: false },
|
||||
{ prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false },
|
||||
{ prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false },
|
||||
{ prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: true }
|
||||
],
|
||||
alertMessageSub: [
|
||||
{ prop: 'panelTab', name: this.$t('overall.dashboard'), active: false },
|
||||
{ prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false },
|
||||
{ prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false },
|
||||
{ prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: false },
|
||||
{ prop: 'assetSubTab', name: this.$t('overall.assetSubTab'), active: true }
|
||||
assetTabTitle: [
|
||||
{ prop: 'panelTab', name: this.$t('overall.dashboard') },
|
||||
{ prop: 'alertMessageTab', name: this.$t('overall.alert') },
|
||||
{ prop: 'endpointTab', name: this.$t('asset.endpoint') },
|
||||
{ prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label') }
|
||||
]
|
||||
// panel: [
|
||||
// { prop: 'panelTab', name: this.$t('overall.dashboard'), active: true },
|
||||
// { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false },
|
||||
// { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false },
|
||||
// { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: false }
|
||||
// ],
|
||||
// alertMessage: [
|
||||
// { prop: 'panelTab', name: this.$t('overall.dashboard'), active: false },
|
||||
// { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: true },
|
||||
// { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false },
|
||||
// { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: false }
|
||||
// ],
|
||||
// endpoint: [
|
||||
// { prop: 'panelTab', name: this.$t('overall.dashboard'), active: false },
|
||||
// { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false },
|
||||
// { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: true },
|
||||
// { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: false }
|
||||
// ],
|
||||
// log: [
|
||||
// { prop: 'panelTab', name: this.$t('overall.dashboard'), active: false },
|
||||
// { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false },
|
||||
// { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false },
|
||||
// { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: true }
|
||||
// ],
|
||||
// alertMessageSub: [
|
||||
// { prop: 'panelTab', name: this.$t('overall.dashboard'), active: false },
|
||||
// { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false },
|
||||
// { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false },
|
||||
// { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label'), active: false },
|
||||
// { prop: 'assetSubTab', name: this.$t('overall.assetSubTab'), active: true },
|
||||
// ]
|
||||
},
|
||||
module: {
|
||||
moduleTabTitle: [
|
||||
@@ -284,6 +292,23 @@ export default {
|
||||
const config = this.obj.configs.find(c => c.type === 'logs')
|
||||
return config && config.enable === 1
|
||||
},
|
||||
assetTabs () {
|
||||
const hasSub = this.obj && this.obj.childrenNum
|
||||
const hasProcess = this.obj && this.obj.clientState == '1'
|
||||
const tabs = [
|
||||
{ prop: 'panelTab', name: this.$t('overall.dashboard') },
|
||||
{ prop: 'alertMessageTab', name: this.$t('overall.alert') },
|
||||
{ prop: 'endpointTab', name: this.$t('asset.endpoint') },
|
||||
{ prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label') }
|
||||
]
|
||||
if (hasSub) {
|
||||
tabs.push({ prop: 'assetSubTab', name: this.$t('overall.assetSubTab') })
|
||||
}
|
||||
if (hasProcess) {
|
||||
tabs.push({ prop: 'process', name: this.$t('overall.process') })
|
||||
}
|
||||
return tabs
|
||||
},
|
||||
endpointTabs () {
|
||||
const config = this.obj.configs.find(c => c.type === 'logs')
|
||||
const hasLog = config && config.enable === 1
|
||||
|
||||
Reference in New Issue
Block a user