From 06b18cf58b7eea41108b2e2afd4325a324cc1292 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Thu, 24 Aug 2023 18:02:38 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-3129=20fix:Record=20rule=20=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E9=A1=B5=E9=9D=A2=20interval=20=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../css/components/common/latIngPicker.scss | 20 +++++++++++++++++++ .../src/components/chart/renderChart.js | 8 ++++---- .../common/rightBox/alertRuleBox.vue | 19 ++++++++++++++++-- .../common/rightBox/recordRuleBox.vue | 3 ++- .../page/config/system/notifyMethodTab.vue | 8 ++++---- 5 files changed, 47 insertions(+), 11 deletions(-) diff --git a/nezha-fronted/src/assets/css/components/common/latIngPicker.scss b/nezha-fronted/src/assets/css/components/common/latIngPicker.scss index a29e9f594..1510d47f3 100644 --- a/nezha-fronted/src/assets/css/components/common/latIngPicker.scss +++ b/nezha-fronted/src/assets/css/components/common/latIngPicker.scss @@ -41,4 +41,24 @@ width: 48px; } } +.append_unit{ + display: flex; + .el-input--small .el-input__inner { + border-radius: 4px 0 0 4px; + border-right: none; + } + &::after{ + content: attr(data-unit); + //position: absolute; + display: inline-block; + top: 0; + right: 100%; + padding: 0 20px; + color: $--color-text-secondary; + background-color: $--background-color-base; + border: 1px solid $--border-color-light; + border-radius:0 4px 4px 0; + width: auto; + } +} diff --git a/nezha-fronted/src/components/chart/renderChart.js b/nezha-fronted/src/components/chart/renderChart.js index 60383446c..cdd5a44c6 100644 --- a/nezha-fronted/src/components/chart/renderChart.js +++ b/nezha-fronted/src/components/chart/renderChart.js @@ -30,13 +30,13 @@ export default { ] } // 左y轴 - const leftData = chartData.filter(item => !item[0].yAxisIndex) + const leftData = chartData.filter(item => item[0] && !item[0].yAxisIndex) const leftInfo = this.getMinMaxFromData(leftData, chartInfo.unit, chartInfo.param) // console.log(leftData, leftInfo) chartOption.yAxis[0].minInterval = chartDataFormat.Interval(leftInfo.maxValue, leftInfo.copies, leftInfo.unit.type, 'min') chartOption.yAxis[0].maxInterval = chartDataFormat.Interval(leftInfo.maxValue, leftInfo.copies, leftInfo.unit.type, 'max') * Math.ceil(this.series.length / 5) if (chartInfo.param.stack) { - chartOption.yAxis[0].maxInterval = chartOption.yAxis[0].maxInterval * (Math.ceil(chartOption.series.length / 5) + 1) + chartOption.yAxis[0].maxInterval = chartOption.yAxis[0].maxInterval * (Math.ceil(leftData.length / 5) + 1) } if (leftInfo.unit.type === 'Time' || leftInfo.unit.type === 'Date & Time') { delete chartOption.yAxis[0].minInterval @@ -64,13 +64,13 @@ export default { const unit = chartDataFormat.getUnit(lodash.get(chartInfo, 'param.rightYAxis.unit', 2)) const allRight = this.series.every(item => item.yAxisIndex == 1) chartOption.yAxis[1].splitLine.show = allRight - const rightData = chartData.filter(item => item[0].yAxisIndex) + const rightData = chartData.filter(item => item[0] && item[0].yAxisIndex) console.log(rightData, unit) const rightInfo = this.getMinMaxFromData(rightData, lodash.get(chartInfo, 'param.rightYAxis.unit', 2), lodash.get(chartInfo, 'param.rightYAxis', {}))// chartOption.yAxis[1].minInterval = chartDataFormat.Interval(rightInfo.maxValue, rightInfo.copies, rightInfo.unit.type, 'min') chartOption.yAxis[1].maxInterval = chartDataFormat.Interval(rightInfo.maxValue, rightInfo.copies, rightInfo.unit.type, 'max') * Math.ceil(this.series.length / 5) if (chartInfo.param.stack) { - chartOption.yAxis[1].maxInterval = chartOption.yAxis[1].maxInterval * (Math.ceil(chartOption.series.length / 5) + 1) + chartOption.yAxis[1].maxInterval = chartOption.yAxis[1].maxInterval * (Math.ceil(rightData.length / 5) + 1) } if (unit.type === 'Time' || unit.type === 'Date & Time') { delete chartOption.yAxis[1].minInterval diff --git a/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue b/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue index bffbf9bff..bc8c42186 100644 --- a/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue +++ b/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue @@ -124,7 +124,22 @@ - + + + + - + diff --git a/nezha-fronted/src/components/common/rightBox/recordRuleBox.vue b/nezha-fronted/src/components/common/rightBox/recordRuleBox.vue index 4ad7f978d..d16802201 100644 --- a/nezha-fronted/src/components/common/rightBox/recordRuleBox.vue +++ b/nezha-fronted/src/components/common/rightBox/recordRuleBox.vue @@ -69,7 +69,8 @@ - + + diff --git a/nezha-fronted/src/components/page/config/system/notifyMethodTab.vue b/nezha-fronted/src/components/page/config/system/notifyMethodTab.vue index 49cacbd90..3095cbfd6 100644 --- a/nezha-fronted/src/components/page/config/system/notifyMethodTab.vue +++ b/nezha-fronted/src/components/page/config/system/notifyMethodTab.vue @@ -39,10 +39,10 @@
-
. Please make sure the script file exists and has executable permissions
-
. The script file receives two parameters:
-
    ① Notification account
-
    ② Alert message(json) +
. {{$t('noftiyMethod.permissions')}}
+
. {{$t('noftiyMethod.parameters')}}
+
    ① {{$t('noftiyMethod.account')}}
+
    ② {{$t('noftiyMethod.json')}}
                {