diff --git a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue index b4a36e320..176bc528d 100644 --- a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue +++ b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue @@ -108,11 +108,17 @@ export default { immediate: true, handler (n) { if ((this.from === fromRoute.asset) && n) { + const assetSub = { prop: 'assetSubTab', name: this.$t('overall.assetSubTab'), active: false } if (n.childrenNum) { - const assetSub = { prop: 'assetSubTab', name: this.$t('overall.assetSubTab'), active: false } - this.tabs.asset.panel.push(assetSub) - this.tabs.asset.alertMessage.push(assetSub) - this.tabs.asset.endpoint.push(assetSub) + 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) + } + } 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) } } } @@ -155,12 +161,12 @@ export default { alertMessage: [ { prop: 'panelTab', name: this.$t('overall.detail'), active: false }, { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: true }, - { prop: 'endpointTab', name: 'Endpoint', active: false }, + { prop: 'endpointTab', name: 'Endpoint', active: false } ], endpoint: [ { prop: 'panelTab', name: this.$t('overall.detail'), active: false }, { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false }, - { prop: 'endpointTab', name: 'Endpoint', active: true }, + { prop: 'endpointTab', name: 'Endpoint', active: true } ], alertMessageSub: [ { prop: 'panelTab', name: this.$t('overall.detail'), active: false }, diff --git a/nezha-fronted/src/components/common/table/asset/assetTable.vue b/nezha-fronted/src/components/common/table/asset/assetTable.vue index b3de85db5..b7a905a45 100644 --- a/nezha-fronted/src/components/common/table/asset/assetTable.vue +++ b/nezha-fronted/src/components/common/table/asset/assetTable.vue @@ -57,12 +57,26 @@ - + @@ -107,9 +121,13 @@ import table from '@/components/common/mixin/table' import { showTableTooltip, hideTableTooltip } from '@/components/common/js/tools' import bus from '@/libs/bus' +import alertLabel from '@/components/common/alert/alertLabel' export default { name: 'assetTable', mixins: [table], + components: { + alertLabel: alertLabel + }, props: { showOption: { type: Boolean, @@ -258,6 +276,16 @@ export default { this.bottomBox.targetTab = 'endpoint' this.bottomBox.showSubList = true }, + // label 鼠标划入 + labelHover (item, type, loading, e) { + if (e) { + const dom = e.currentTarget + const position = dom.getBoundingClientRect() + this.$set(item, 'position', position) + } + this.$set(item, 'loading', loading) + // this.$set(this.tableData,index,item);// 调用父组件 + }, returnCabinet (start, end) { // 返回机柜u位信息 if (!start || !end) { return '' diff --git a/nezha-fronted/src/components/page/asset/asset.vue b/nezha-fronted/src/components/page/asset/asset.vue index 73e559dee..07f697a6d 100644 --- a/nezha-fronted/src/components/page/asset/asset.vue +++ b/nezha-fronted/src/components/page/asset/asset.vue @@ -20,6 +20,7 @@ ref="export" id="model" :params="searchLabel" + :params2="searchCheckBox" :permissions="{ import: 'asset_add', export: 'asset_view'