From 34ddcc0b82f5f8fec345f40762219685cb64421c Mon Sep 17 00:00:00 2001 From: zhangyu Date: Mon, 20 Jun 2022 16:31:52 +0800 Subject: [PATCH 1/4] =?UTF-8?q?NEZ-1946=20fix=EF=BC=9A=20=E6=89=93?= =?UTF-8?q?=E5=BC=80=E5=BA=95=E9=83=A8=E5=BC=B9=E7=AA=97=20=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=AF=B9=E5=BA=94=E5=85=83=E7=B4=A0=20=E5=BA=95?= =?UTF-8?q?=E9=83=A8=E5=BC=B9=E7=AA=97=E4=B8=8D=E5=85=B3=E9=97=AD=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/common/deleteButton.vue | 2 ++ .../src/components/common/mixin/dataList.js | 1 + .../common/rightBox/addEndpointBox.vue | 2 +- .../common/rightBox/batchAddEndpoint.vue | 2 +- .../common/rightBox/batchModifyEndpoint.vue | 2 +- .../common/rightBox/editEndpointBoxNew.vue | 4 ++-- .../components/common/table/nzDataList.vue | 22 ++++++++++++++++++- 7 files changed, 29 insertions(+), 6 deletions(-) diff --git a/nezha-fronted/src/components/common/deleteButton.vue b/nezha-fronted/src/components/common/deleteButton.vue index 854fdc7ae..dc17fd1ef 100644 --- a/nezha-fronted/src/components/common/deleteButton.vue +++ b/nezha-fronted/src/components/common/deleteButton.vue @@ -10,6 +10,7 @@ From c8efd6773bd0c3ba540631394a8f0b6d38c830a3 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Mon, 20 Jun 2022 16:39:54 +0800 Subject: [PATCH 2/4] =?UTF-8?q?NEZ-1958=20fix=EF=BC=9A=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=BA=95=E5=BC=B9=E7=AA=97=E6=A0=B9=E6=8D=AE=E7=88=B6=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E7=9A=84=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/common/mixin/dataList.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nezha-fronted/src/components/common/mixin/dataList.js b/nezha-fronted/src/components/common/mixin/dataList.js index 20f62551f..2561bfc42 100644 --- a/nezha-fronted/src/components/common/mixin/dataList.js +++ b/nezha-fronted/src/components/common/mixin/dataList.js @@ -355,6 +355,8 @@ export default { } if (this.$route.query.orderBy && !this.isSubList) { this.orderBy = this.$route.query.orderBy + } else if (this.isSubList) { + return } let searchKeys = {} if (path === 'dc') { From b7facbfd3ce9d599ad47f4be0d92ab974e07ea24 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Mon, 20 Jun 2022 16:54:37 +0800 Subject: [PATCH 3/4] =?UTF-8?q?NEZ-1959=20fix=EF=BC=9A=E5=9C=A8=E4=B8=8D?= =?UTF-8?q?=E5=90=8C=E7=9A=84=E6=97=B6=E9=97=B4=E6=A0=BC=E5=BC=8F=E4=B8=8B?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E5=85=B6=E4=BB=96=E6=97=B6=E9=97=B4=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E4=B8=8B=E4=BD=BF=E7=94=A8=E8=BF=87=E7=9A=84=E6=9C=80?= =?UTF-8?q?=E8=BF=91=E6=97=B6=E9=97=B4=E6=98=BE=E7=A4=BA=E8=8C=83=E5=9B=B4?= =?UTF-8?q?=E6=97=B6=E5=86=85=E5=AE=B9=E6=98=BE=E7=A4=BA=E6=9C=89=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/common/timePicker.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nezha-fronted/src/components/common/timePicker.vue b/nezha-fronted/src/components/common/timePicker.vue index 3b8eb33c6..7d9dd74ba 100644 --- a/nezha-fronted/src/components/common/timePicker.vue +++ b/nezha-fronted/src/components/common/timePicker.vue @@ -92,9 +92,9 @@ class="date-range-history-item" @click="historyChange(item)" > - {{ timeFormate(item.start) }} + {{ momentTz(item.start) }} {{ $t("dashboard.panel.to") }} - {{ timeFormate(item.end) }} + {{ momentTz(item.end) }} @@ -340,8 +340,8 @@ export default { } this.isCustom = true this.rangeHistory.unshift({ - start: item[0], - end: item[1] + start: this.momentStrToTimestamp(item[0]), + end: this.momentStrToTimestamp(item[1]) }) localStorage.setItem( 'date-range-history' + this.sign, From 3c5043a498d3f5083c1ae93601da5a837db446a4 Mon Sep 17 00:00:00 2001 From: zyh Date: Mon, 20 Jun 2022 17:14:56 +0800 Subject: [PATCH 4/4] =?UTF-8?q?NEZ-1956=20feat=EF=BC=9Adashboard=E5=BF=AB?= =?UTF-8?q?=E7=85=A7=20=E5=A2=9E=E5=8A=A0=E6=98=BE=E7=A4=BA=E6=97=B6?= =?UTF-8?q?=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/chart/chartList.vue | 9 ++++++--- nezha-fronted/src/entrance/exportHtml/App.vue | 14 ++++++++++---- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/nezha-fronted/src/components/chart/chartList.vue b/nezha-fronted/src/components/chart/chartList.vue index bc3a280ac..5c2105477 100644 --- a/nezha-fronted/src/components/chart/chartList.vue +++ b/nezha-fronted/src/components/chart/chartList.vue @@ -359,7 +359,10 @@ export default { this.$refs['chart' + item.id][0] && this.$refs['chart' + item.id][0].groupShow(item.param.collapse) this.$refs['chart' + item.id][0] && this.$refs['chart' + item.id][0].$refs.chart && this.$refs['chart' + item.id][0].$refs.chart.$refs['chart' + item.id] && this.$refs['chart' + item.id][0].$refs.chart.$refs['chart' + item.id].$refs.chartList.resize() } - this.$refs['chart' + item.id][0] && this.$refs['chart' + item.id][0].resize() + try { + this.$refs['chart' + item.id][0] && this.$refs['chart' + item.id][0].resize() + } catch (error) { + } }) }, refreshPanel () { @@ -448,10 +451,10 @@ export default { // 监听查看模式变化 '$store.state.panel.mode': { immediate: true, - handler () { + handler (val) { setTimeout(() => { this.resize() - }, 100) + }, 200) } }, dataList: { diff --git a/nezha-fronted/src/entrance/exportHtml/App.vue b/nezha-fronted/src/entrance/exportHtml/App.vue index b4928343c..ce3feb569 100644 --- a/nezha-fronted/src/entrance/exportHtml/App.vue +++ b/nezha-fronted/src/entrance/exportHtml/App.vue @@ -14,7 +14,7 @@
{{dataJson.panel.data.name}}
- {{timeFormate(dataJson.start * 1000)}} - {{timeFormate(dataJson.end * 1000)}} + {{dateFormat(dataJson.start * 1000)}} - {{dateFormat(dataJson.end * 1000)}} ({{dataJson.timezone}})
@@ -50,7 +50,6 @@ import chartList from '@/components/chart/chartList.vue' import moment from 'moment-timezone' import { loadI18n } from '@/components/common/i18n' import i18nData from '@/entrance/exportHtml/i18nData' - const dataJson = window.dataJson || {} export default { name: 'Entrance', @@ -67,7 +66,8 @@ export default { created () { this.$i18n.locale = this.dataJson.language loadI18n(i18nData) - const localOffset = moment.tz.guess()// 默认 一分钟显示时区偏移的结果 + const localOffset = this.dataJson.timezone || moment.tz.guess() + this.dataJson.timezone = localOffset localStorage.setItem('nz-sys-timezone', localOffset) }, mounted () { @@ -78,7 +78,13 @@ export default { delChart () {}, addGroupItem () {}, chartListLoading () {}, - refreshPanel () {} + refreshPanel () {}, + // 时间戳转为UTC格式 + dateFormat (time) { + let offset = localStorage.getItem('nz-sys-timezone') + offset = moment.tz(offset).format('Z') + return moment(time).utcOffset(offset).format() + } } }