diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/assetTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/assetTab.vue index 276a35fb4..0e62cb17b 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/assetTab.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/assetTab.vue @@ -244,6 +244,9 @@ export default { if (this.needAlertDaysData) { response.data.list.forEach(item => { item.trendLoading = true + item.left= 0 + item.top= 0 + item.alertNumtooltipShow= false item.alertDaysData = [ { metric: { priority: 'P1' }, diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/cabinetTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/cabinetTab.vue index 4ad53a11a..bfe0a5a90 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/cabinetTab.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/cabinetTab.vue @@ -151,6 +151,9 @@ export default { if (this.needAlertDaysData) { response.data.list.forEach(item => { item.trendLoading = true + item.left= 0 + item.top= 0 + item.alertNumtooltipShow= false item.alertDaysData = [ { metric: { priority: 'P1' }, diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/endpointTabNew.vue b/nezha-fronted/src/components/common/bottomBox/tabs/endpointTabNew.vue index 16ed248b0..94127793a 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/endpointTabNew.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/endpointTabNew.vue @@ -141,6 +141,9 @@ export default { if (this.needAlertDaysData) { response.data.list.forEach(item => { item.trendLoading = true + item.left= 0 + item.top= 0 + item.alertNumtooltipShow= false item.alertDaysData = [ { metric: { priority: 'P1' }, diff --git a/nezha-fronted/src/components/common/detailView/nzDetailView.vue b/nezha-fronted/src/components/common/detailView/nzDetailView.vue index 2397a881c..41c30e8bd 100644 --- a/nezha-fronted/src/components/common/detailView/nzDetailView.vue +++ b/nezha-fronted/src/components/common/detailView/nzDetailView.vue @@ -33,13 +33,13 @@
-
+
-
+
diff --git a/nezha-fronted/src/components/common/mixin/dataList.js b/nezha-fronted/src/components/common/mixin/dataList.js index 942645b84..c35790bd0 100644 --- a/nezha-fronted/src/components/common/mixin/dataList.js +++ b/nezha-fronted/src/components/common/mixin/dataList.js @@ -105,6 +105,9 @@ export default { if (this.needAlertDaysData) { response.data.list.forEach(item => { item.trendLoading = true + item.left= 0 + item.top= 0 + item.alertNumtooltipShow= false item.alertDaysData = [ { metric: { priority: 'P1' }, @@ -132,7 +135,7 @@ export default { this.detailViewRightObj = detailViewRightObj this.pageObj.total = response.data.total this.pageObj.pages = response.data.pages - if (!this.scrollbarWrap && this.$refs.dataTable.$refs.dataTable) { + if (!this.scrollbarWrap && this.$refs.dataTable && this.$refs.dataTable.$refs.dataTable) { this.$nextTick(() => { this.scrollbarWrap = this.$refs.dataTable.$refs.dataTable.bodyWrapper this.toTopBtnHandler(this.scrollbarWrap) @@ -214,7 +217,9 @@ export default { }, dragend () { this.$nextTick(() => { - this.$refs.dataTable.$refs.dataTable && this.$refs.dataTable.$refs.dataTable.doLayout() + if (this.$refs.dataTable) { + this.$refs.dataTable.$refs.dataTable && this.$refs.dataTable.$refs.dataTable.doLayout() + } }) }, search (searchObj) { @@ -859,14 +864,16 @@ export default { if (pageSize && pageSize !== 'undefined') { this.pageObj.pageSize = pageSize } + console.log(this.$refs.dataTable, this.$refs.dataDetail) + const tableTitle = this.$refs.dataTable ? this.$refs.dataTable.tableTitle : this.$refs.dataDetail.tableTitle let localStorageTableTitle = localStorage.getItem('nz-tableTitle-' + localStorage.getItem('nz-username') + '-' + this.tableId) - localStorageTableTitle = localStorageTableTitle ? JSON.parse(localStorageTableTitle) : this.$refs.dataTable.tableTitle - this.tools.customTableTitle = this.$refs.dataTable.tableTitle.map((item, index) => { // 修复切换中英文的问题 + localStorageTableTitle = localStorageTableTitle ? JSON.parse(localStorageTableTitle) : tableTitle + this.tools.customTableTitle = tableTitle.map((item, index) => { // 修复切换中英文的问题 item.show = localStorageTableTitle[index].show return item }) - if (localStorageTableTitle && (localStorageTableTitle.length > this.$refs.dataTable.tableTitle.length)) { - const arr = localStorageTableTitle.splice(this.$refs.dataTable.tableTitle.length, localStorageTableTitle.length) + if (localStorageTableTitle && (localStorageTableTitle.length > tableTitle.length)) { + const arr = localStorageTableTitle.splice(tableTitle.length, localStorageTableTitle.length) arr.forEach(item => { item.minWidth = item.label.length * 16 + 20 }) @@ -875,7 +882,9 @@ export default { if (!this.fromBottom) { this.getTableData() this.$nextTick(() => { - this.$refs.dataTable.$refs.dataTable && this.$refs.dataTable.$refs.dataTable.doLayout() + if (this.$refs.dataTable) { + this.$refs.dataTable.$refs.dataTable && this.$refs.dataTable.$refs.dataTable.doLayout() + } }) } }, diff --git a/nezha-fronted/src/components/common/mixin/detailViewMixin.js b/nezha-fronted/src/components/common/mixin/detailViewMixin.js index 8862b68b5..2f039f6e9 100644 --- a/nezha-fronted/src/components/common/mixin/detailViewMixin.js +++ b/nezha-fronted/src/components/common/mixin/detailViewMixin.js @@ -2,7 +2,7 @@ export default { props: {}, data () { return { - detailType: 'list', + detailType: localStorage.getItem('detail-view-' + this.tableId) || 'list', detailViewRightObj: '', detailViewLoading: false, detailTimer: '' @@ -16,7 +16,7 @@ export default { if (this.detailType === flag) { return } - this.$refs.dataList.bottomBox.showSubList = false + // this.$refs.dataList.bottomBox.showSubList = false if (this.orderBy) { this.detailViewRightObj = '' } diff --git a/nezha-fronted/src/components/common/project/popData/assetTable.vue b/nezha-fronted/src/components/common/project/popData/assetTable.vue index 8ba22d364..9973e1cd8 100644 --- a/nezha-fronted/src/components/common/project/popData/assetTable.vue +++ b/nezha-fronted/src/components/common/project/popData/assetTable.vue @@ -170,6 +170,9 @@ export default { if (this.needAlertDaysData) { response.data.list.forEach(item => { item.trendLoading = true + item.left= 0 + item.top= 0 + item.alertNumtooltipShow= false item.alertDaysData = [ { metric: { priority: 'P1' }, diff --git a/nezha-fronted/src/components/common/project/popData/endpointTable.vue b/nezha-fronted/src/components/common/project/popData/endpointTable.vue index afc5bfc0a..8139df580 100644 --- a/nezha-fronted/src/components/common/project/popData/endpointTable.vue +++ b/nezha-fronted/src/components/common/project/popData/endpointTable.vue @@ -176,6 +176,9 @@ export default { if (this.needAlertDaysData) { response.data.list.forEach(item => { item.trendLoading = true + item.left= 0 + item.top= 0 + item.alertNumtooltipShow= false item.alertDaysData = [ { metric: { priority: 'P1' }, diff --git a/nezha-fronted/src/components/page/alert/alertRule.vue b/nezha-fronted/src/components/page/alert/alertRule.vue index 41c8da975..c6027a563 100644 --- a/nezha-fronted/src/components/page/alert/alertRule.vue +++ b/nezha-fronted/src/components/page/alert/alertRule.vue @@ -287,6 +287,9 @@ export default { if (this.needAlertDaysData) { response.data.list.forEach(item => { item.trendLoading = true + item.left= 0 + item.top= 0 + item.alertNumtooltipShow= false item.alertDaysData = [ { metric: { priority: 'P1' }, diff --git a/nezha-fronted/src/components/page/asset/asset.vue b/nezha-fronted/src/components/page/asset/asset.vue index c81d18d2d..85900e029 100644 --- a/nezha-fronted/src/components/page/asset/asset.vue +++ b/nezha-fronted/src/components/page/asset/asset.vue @@ -73,7 +73,7 @@ { const title = this.tools.customTableTitle - const originalTitle = title.slice(0, this.$refs.dataTable.tableTitle.length) // 原title - const oldLabelTitle = title.slice(this.$refs.dataTable.tableTitle.length, title.length) // 旧labelTitle + const tableTitle = this.$refs.dataTable ? this.$refs.dataTable.tableTitle : this.$refs.dataDetail.tableTitle + const originalTitle = title.slice(0, tableTitle.length) // 原title + const oldLabelTitle = title.slice(tableTitle.length, title.length) // 旧labelTitle const newLabel = showData.filter(item => { return !oldLabelTitle.find(t => { return item.label === t.label }) }) const keepLabel = oldLabelTitle.filter(item => showData.find(t => item.label === t.label)) @@ -718,6 +719,9 @@ export default { if (this.needAlertDaysData) { response.data.list.forEach(item => { item.trendLoading = true + item.left= 0 + item.top= 0 + item.alertNumtooltipShow= false item.alertDaysData = [ { metric: { priority: 'P1' }, @@ -745,7 +749,7 @@ export default { this.detailViewRightObj = detailViewRightObj this.pageObj.total = response.data.total this.pageObj.pages = response.data.pages - if (!this.scrollbarWrap && this.$refs.dataTable.$refs.dataTable) { + if (!this.scrollbarWrap && this.$refs.dataTable&& this.$refs.dataTable.$refs.dataTable) { this.$nextTick(() => { this.scrollbarWrap = this.$refs.dataTable.$refs.dataTable.bodyWrapper this.toTopBtnHandler(this.scrollbarWrap) diff --git a/nezha-fronted/src/components/page/config/dc.vue b/nezha-fronted/src/components/page/config/dc.vue index da51d20f0..b6692a894 100644 --- a/nezha-fronted/src/components/page/config/dc.vue +++ b/nezha-fronted/src/components/page/config/dc.vue @@ -73,7 +73,7 @@ { item.trendLoading = true + item.left= 0 + item.top= 0 + item.alertNumtooltipShow= false item.alertDaysData = [ { metric: { priority: 'P1' }, diff --git a/nezha-fronted/src/components/page/monitor/module/moduleList.vue b/nezha-fronted/src/components/page/monitor/module/moduleList.vue index 54e704184..0367dc179 100644 --- a/nezha-fronted/src/components/page/monitor/module/moduleList.vue +++ b/nezha-fronted/src/components/page/monitor/module/moduleList.vue @@ -71,7 +71,7 @@ ref="dataList" :api="url" :tableId="tableId" - v-show="detailType === 'list'" + v-if="detailType === 'list'" :custom-table-title.sync="tools.customTableTitle" :from="fromRoute.module" :layout="['searchInput', 'elementSet', 'pagination','detailViewSet']" @@ -409,6 +409,9 @@ export default { if (this.needAlertDaysData) { response.data.list.forEach(item => { item.trendLoading = true + item.left= 0 + item.top= 0 + item.alertNumtooltipShow= false item.alertDaysData = [ { metric: { priority: 'P1' }, diff --git a/nezha-fronted/src/components/page/monitor/project/projectList.vue b/nezha-fronted/src/components/page/monitor/project/projectList.vue index f66856bb8..0bb29ef11 100644 --- a/nezha-fronted/src/components/page/monitor/project/projectList.vue +++ b/nezha-fronted/src/components/page/monitor/project/projectList.vue @@ -147,6 +147,9 @@ export default { if (this.needAlertDaysData) { response.data.list.forEach(item => { item.trendLoading = true + item.left= 0 + item.top= 0 + item.alertNumtooltipShow= false item.alertDaysData = [ { metric: { priority: 'P1' },