diff --git a/nezha-fronted/src/components/charts/chart-alert-list.vue b/nezha-fronted/src/components/charts/chart-alert-list.vue index 3de1fed2f..5705a7e40 100644 --- a/nezha-fronted/src/components/charts/chart-alert-list.vue +++ b/nezha-fronted/src/components/charts/chart-alert-list.vue @@ -935,7 +935,9 @@ export default { // this.$refs.alertListTable.$refs.alertListTable.clearSelection() // this.$refs.alertListScreenTable.$refs.dataTable.clearSelection() this.screenPageObj = { ...this.pageObj } - this.$refs.screenPagination.pageSize = this.screenPageObj.pageSize + if (this.$refs.screenPagination && this.$refs.screenPagination.pageSize) { + this.$refs.screenPagination.pageSize = this.screenPageObj.pageSize + } }, // 设置数据, filter区分 setData (chartItem, seriesItem, panelId, filter, area, errorMsg) { diff --git a/nezha-fronted/src/components/charts/chartPreview.vue b/nezha-fronted/src/components/charts/chartPreview.vue index 2a0d68bed..efa8ab19b 100644 --- a/nezha-fronted/src/components/charts/chartPreview.vue +++ b/nezha-fronted/src/components/charts/chartPreview.vue @@ -358,7 +358,9 @@ export default { }, initDialog () { // 此时初始化,才能获得screenShowArea对象,否则此对象为undefined,无法初始化图表 - this.$refs.pickTime.$refs.timePicker.setCustomTime() + if (this.$refs.pickTime) { + this.$refs.pickTime.$refs.timePicker.setCustomTime() + } const chartType = this.chart.type if (chartType === 'table') { // diff --git a/nezha-fronted/src/components/layout/header.vue b/nezha-fronted/src/components/layout/header.vue index 2fab36317..726ec485e 100644 --- a/nezha-fronted/src/components/layout/header.vue +++ b/nezha-fronted/src/components/layout/header.vue @@ -74,7 +74,7 @@ export default { }, data () { return { - username: sessionStorage.getItem('nz-username'), + username: localStorage.getItem('nz-username'), name: localStorage.getItem('nz-user-name'), language: localStorage.getItem('nz-language') ? localStorage.getItem('nz-language') : 'en', // 顶部菜单相关