From 31cdf53daf33f310931c5d08fbacc8d365c017b0 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Wed, 30 Mar 2022 16:03:07 +0800 Subject: [PATCH 1/7] =?UTF-8?q?NEZ-1735=20fix=EF=BC=9A=20=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=86=85=E5=AE=B9=E6=9C=AA=E8=BF=9B=E8=A1=8C=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/common/project/L5/CanvasProps.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nezha-fronted/src/components/common/project/L5/CanvasProps.vue b/nezha-fronted/src/components/common/project/L5/CanvasProps.vue index feb4e2b23..a227f5220 100644 --- a/nezha-fronted/src/components/common/project/L5/CanvasProps.vue +++ b/nezha-fronted/src/components/common/project/L5/CanvasProps.vue @@ -6,7 +6,7 @@ - --> - +
@@ -650,7 +650,7 @@
- +
{{ $t('project.topology.textContent') }}
From 8861effc7eb2c5633027b294c55f01843d6cc19c Mon Sep 17 00:00:00 2001 From: zhangyu Date: Wed, 30 Mar 2022 16:12:29 +0800 Subject: [PATCH 2/7] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=94=B9=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E6=8C=89=E9=92=AE=20=E4=B8=8D=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/common/js/tools.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nezha-fronted/src/components/common/js/tools.js b/nezha-fronted/src/components/common/js/tools.js index 25f955a6e..8c923cae4 100644 --- a/nezha-fronted/src/components/common/js/tools.js +++ b/nezha-fronted/src/components/common/js/tools.js @@ -162,9 +162,9 @@ export const cancelWithChange = { if (!binding.value || !binding.value.obj) return const unsavedChange = localStorage.getItem('nz-unnsaved-change') const oldValue = JSON.parse(JSON.stringify(binding.value.obj)) + el.__newValue__ = oldValue function domClick (e) { - const newValue = JSON.parse(JSON.stringify(binding.value.obj)) - if (unsavedChange == 'on' && !isEqual(oldValue, newValue)) { + if (unsavedChange == 'on' && !isEqual(oldValue, el.__newValue__)) { MessageBox.confirm(i18n.t('tip.confirmCancel'), { confirmButtonText: i18n.t('tip.yes'), cancelButtonText: i18n.t('tip.no'), @@ -181,6 +181,9 @@ export const cancelWithChange = { el.__vueDomClick__ = domClick el.addEventListener('click', domClick) }, + update (el, binding, vnode) { + el.__newValue__ = binding.value.obj + }, unbind: function (el, binding) { // 解除事件监听 document.removeEventListener('click', el.__vueDomClick__) From 27f9f37fe368e523cb8140367bec6c2ead07abbc Mon Sep 17 00:00:00 2001 From: zhangyu Date: Wed, 30 Mar 2022 16:37:39 +0800 Subject: [PATCH 3/7] =?UTF-8?q?fix=EF=BC=9A=E8=A1=A5=E5=85=85=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/page/asset/asset.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nezha-fronted/src/components/page/asset/asset.vue b/nezha-fronted/src/components/page/asset/asset.vue index 6b3b04aac..b9eeebf6e 100644 --- a/nezha-fronted/src/components/page/asset/asset.vue +++ b/nezha-fronted/src/components/page/asset/asset.vue @@ -622,7 +622,7 @@ export default { 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)) - let result = originalTitle.concat([{ label: 'Label', show: false, NotSet: true, type: 'title', prop: 'table-label' }]) + let result = originalTitle.concat([{ label: this.$t('alert.list.labels'), show: false, NotSet: true, type: 'title', prop: 'table-label' }]) result = result.concat(keepLabel).concat(newLabel) this.tools.customTableTitle = JSON.parse(JSON.stringify(result)) From 4a959f9267a7972b60734220b4d176641c41aace Mon Sep 17 00:00:00 2001 From: zhangyu Date: Wed, 30 Mar 2022 17:25:15 +0800 Subject: [PATCH 4/7] =?UTF-8?q?NEZ-1755=20fix=EF=BC=9A=E7=BB=84=E5=86=85?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E5=9B=BE=E8=A1=A8=E5=90=8E=20=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E7=A7=BB=E8=87=B3=E6=9C=80=E5=90=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/common/rightBox/chart/chartRightBox.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue index fa725da8a..eaab25dbf 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue @@ -234,11 +234,11 @@ export default { params.x = 0 params.y = 0 } - if (!params.x && !params.y && params.groupId) { // group 内的坐标需要单独计算 + if (isNaN(params.y) && isNaN(params.y) && params.groupId) { // group 内的坐标需要单独计算 params.x = 0 params.y = 999 } - if (!params.x && !params.y) { + if (isNaN(params.y) && isNaN(params.y)) { params.x = this.chartLastPosition.x + params.span > 12 ? 0 : this.chartLastPosition.x params.y = this.chartLastPosition.y + 12 } From ac53f7b7d39fcb86df50e5ca44cbe63745fab45d Mon Sep 17 00:00:00 2001 From: zhangyu Date: Wed, 30 Mar 2022 17:45:45 +0800 Subject: [PATCH 5/7] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8D=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=AE=BD=E5=BA=A6=20=E5=BC=95=E8=B5=B7=E9=87=8D?= =?UTF-8?q?=E5=8F=A0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/common/rightBox/chart/chartRightBox.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue index eaab25dbf..48aa7572f 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue @@ -242,6 +242,10 @@ export default { params.x = this.chartLastPosition.x + params.span > 12 ? 0 : this.chartLastPosition.x params.y = this.chartLastPosition.y + 12 } + if (params.x + params.span > 12) { + params.x = 0 + params.y += 1 + } delete params.panel if (params.type === 'table') { delete params.param.tags From ece3b2edef7d7226b36bb8fec4373b1d6e286a0a Mon Sep 17 00:00:00 2001 From: zhangyu Date: Wed, 30 Mar 2022 18:06:03 +0800 Subject: [PATCH 6/7] =?UTF-8?q?fix=EF=BC=9A=E4=BC=98=E5=8C=96=20value?= =?UTF-8?q?=E5=B0=8F=E4=BA=8E1=E7=9A=84=20Y=E8=BD=B4=E8=A1=A8=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/chart/chart.vue | 1 - nezha-fronted/src/components/chart/chart/chartTimeSeries.vue | 1 - nezha-fronted/src/components/charts/chartDataFormat.js | 4 ++-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/nezha-fronted/src/components/chart/chart.vue b/nezha-fronted/src/components/chart/chart.vue index b4f28f687..862f804e4 100644 --- a/nezha-fronted/src/components/chart/chart.vue +++ b/nezha-fronted/src/components/chart/chart.vue @@ -297,7 +297,6 @@ export default { this.chartChildrenData = flag }, resize () { - console.log(this.$refs['chart' + this.chartInfo.id]) this.$refs['chart' + this.chartInfo.id] && this.$refs['chart' + this.chartInfo.id].resize() }, refreshLogs (params) { diff --git a/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue b/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue index ba8f082b7..75bb0c083 100644 --- a/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue +++ b/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue @@ -331,7 +331,6 @@ export default { } }, resize () { - console.log(213) setTimeout(() => { getChart(this.chartId) && getChart(this.chartId).resize() }, 100) diff --git a/nezha-fronted/src/components/charts/chartDataFormat.js b/nezha-fronted/src/components/charts/chartDataFormat.js index a00fd0d7b..7be42b71a 100644 --- a/nezha-fronted/src/components/charts/chartDataFormat.js +++ b/nezha-fronted/src/components/charts/chartDataFormat.js @@ -34,7 +34,7 @@ function percent02 (value, index) { if (!numberWithEConvent(scientificNotationValue)) { return `${scientificNotationValue} %` } - value = parseFloat(keepDoubleNumber(Number(value) * 100)) + value = parseFloat(keepDoubleNumber((Number(value) * 100).toFixed(2))) return `${value} %` } function localFormat (value, index) { @@ -728,7 +728,7 @@ export default { pow++ value = value * 10 } - return Math.ceil(value + 1) / Math.pow(10, pow) + return Math.floor(value + 1) / Math.pow(10, pow) } if (type === 'Time') { return value From 5db4f9cb090ee04eb4967bd4732f45f51509860e Mon Sep 17 00:00:00 2001 From: zhangyu Date: Wed, 30 Mar 2022 18:27:50 +0800 Subject: [PATCH 7/7] =?UTF-8?q?NEZ-1756=20fix=EF=BC=9Aexplore=20table=20ti?= =?UTF-8?q?me=20=E5=88=97=E6=97=B6=E5=8C=BA=E8=BD=AC=E6=8D=A2=E4=B8=8D?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nezha-fronted/src/main.js b/nezha-fronted/src/main.js index 2e137d83c..579138526 100644 --- a/nezha-fronted/src/main.js +++ b/nezha-fronted/src/main.js @@ -104,7 +104,7 @@ Vue.mixin({ }, utcTimeToTimezoneStr: function (time) { if (time) { - return bus.timeFormate(bus.UTCTimeToConfigTimezone(time), localStorage.getItem('nz-default-dateFormat') ? localStorage.getItem('nz-default-dateFormat') : localStorage.getItem('nz-default-dateFormat') ? localStorage.getItem('nz-default-dateFormat') : 'YYYY-MM-DD HH:mm:ss') + return bus.timeFormate(time, localStorage.getItem('nz-default-dateFormat') || 'YYYY-MM-DD HH:mm:ss') } else { return '-' }