From ddc5f7e923f420e65d4adfa4f127fec62a4058bb Mon Sep 17 00:00:00 2001 From: zhangyu Date: Thu, 21 Jul 2022 18:32:25 +0800 Subject: [PATCH 1/5] =?UTF-8?q?NEZ-2059=20fix=EF=BC=9Apanel=20=E5=8F=98?= =?UTF-8?q?=E9=87=8F=20=E6=9C=AA=E5=AE=8C=E5=85=A8=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/chart/panelChart.vue | 20 +++++++++---------- .../rightBox/chart/otherChartConfig.vue | 2 +- .../rightBox/chart/systemChartConfig.vue | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/nezha-fronted/src/components/chart/panelChart.vue b/nezha-fronted/src/components/chart/panelChart.vue index 2dae84488..94ed585d0 100644 --- a/nezha-fronted/src/components/chart/panelChart.vue +++ b/nezha-fronted/src/components/chart/panelChart.vue @@ -546,22 +546,22 @@ export default { }, variablesReplace (expression) { let str = expression - let confirmReg = '' - let confirmRegItem = '' + let confirmReg = [] this.variablesArr.forEach(item => { const reg = '$' + item.name // 后续需要考虑 item,name 使用特殊字符的问题 const index = expression.indexOf(reg) if (index !== -1) { - if (reg.length > confirmReg.length) { - confirmReg = reg - confirmRegItem = item - } + confirmReg.push(item) } }) - if (confirmReg) { - const index = expression.indexOf(confirmReg) - const replaceStr = confirmRegItem.checked.map(label => label.replace(/\"/g, '\\"').replace(/\'/g, "\\'")).join('|') - str = str.substring(0, index) + replaceStr + str.substring(index + confirmReg.length) + confirmReg = this.$loadsh.sortBy(confirmReg, function (item) { // 根据 匹配的name的长度排序 避免匹配的 $a 没匹配 $asset的问题 + return item.name.length + }) + if (confirmReg.length) { + confirmReg.forEach(item => { + const reg = new RegExp('\\$' + item.name, 'g') // 后续需要考虑 item,name 使用特殊字符的问题 + str = str.replace(reg, item.checked.map(label => label.replace(/\"/g, '\\"').replace(/\'/g, "\\'")).join('|')) + }) } return str }, diff --git a/nezha-fronted/src/components/common/rightBox/chart/otherChartConfig.vue b/nezha-fronted/src/components/common/rightBox/chart/otherChartConfig.vue index aab7518f2..70c00e82a 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/otherChartConfig.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/otherChartConfig.vue @@ -150,7 +150,7 @@ -
+
{{$t('dashboard.panel.showHidden')}} -
+
{{$t('dashboard.panel.showHidden')}} Date: Thu, 21 Jul 2022 18:57:15 +0800 Subject: [PATCH 2/5] =?UTF-8?q?fix=EF=BC=9A=20alert=20rule=20trbShot=20?= =?UTF-8?q?=E6=9C=AA=E8=AE=BE=E7=BD=AE=E6=97=B6=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/chart/panelChart.vue | 6 ++++-- .../src/components/common/alert/alertMessageInfoTab.vue | 4 ++-- .../src/components/common/rightBox/alertRuleBox.vue | 3 +++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/nezha-fronted/src/components/chart/panelChart.vue b/nezha-fronted/src/components/chart/panelChart.vue index 94ed585d0..72380bf1c 100644 --- a/nezha-fronted/src/components/chart/panelChart.vue +++ b/nezha-fronted/src/components/chart/panelChart.vue @@ -554,9 +554,11 @@ export default { confirmReg.push(item) } }) - confirmReg = this.$loadsh.sortBy(confirmReg, function (item) { // 根据 匹配的name的长度排序 避免匹配的 $a 没匹配 $asset的问题 + confirmReg = this.$loadsh.orderBy(confirmReg, function (item) { // 根据 匹配的name的长度排序 避免匹配的 $a 没匹配 $asset的问题 + console.log(item.name.length) return item.name.length - }) + }, 'desc') + console.log(confirmReg) if (confirmReg.length) { confirmReg.forEach(item => { const reg = new RegExp('\\$' + item.name, 'g') // 后续需要考虑 item,name 使用特殊字符的问题 diff --git a/nezha-fronted/src/components/common/alert/alertMessageInfoTab.vue b/nezha-fronted/src/components/common/alert/alertMessageInfoTab.vue index a47d6b140..0b1ce75be 100644 --- a/nezha-fronted/src/components/common/alert/alertMessageInfoTab.vue +++ b/nezha-fronted/src/components/common/alert/alertMessageInfoTab.vue @@ -23,7 +23,7 @@ />
-
+
@@ -108,7 +108,7 @@ export default { this.cardNames.push(item) } }) - if (n.alertRule && n.alertRule.trbShot) { + if (n.alertRule && n.alertRule.trbShot && n.alertRule.trbShot != '


') { this.cardNames.push({ key: 'trbShot', label: this.$t('alert.config.trbShot') diff --git a/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue b/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue index b6fd00125..881fd55a1 100644 --- a/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue +++ b/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue @@ -507,6 +507,9 @@ export default { method: this.editAlertRule.method.join(','), type: this.editAlertRule.type } + if (this.editAlertRule.trbShot && this.editAlertRule.trbShot == '


') { + this.editAlertRule.trbShot = '' + } this.$refs.alertRuleForm.validate((valid) => { if (valid) { params.receiver = this.editAlertRule.receiverShow.join(',') From a9f8c464fd953b8a35c70adecbf6be7990931de3 Mon Sep 17 00:00:00 2001 From: zyh Date: Thu, 21 Jul 2022 19:39:16 +0800 Subject: [PATCH 3/5] =?UTF-8?q?NEZ-2037=20feat=EF=BC=9Abubble=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E4=BD=BF=E7=94=A8D3=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/chart/chart/chartBubble.vue | 377 ++++++++++-------- .../chart/chart/options/chartBubble.js | 23 -- .../src/components/chart/chart/tools.js | 5 - .../src/components/chart/chartList.vue | 1 - 4 files changed, 207 insertions(+), 199 deletions(-) delete mode 100644 nezha-fronted/src/components/chart/chart/options/chartBubble.js diff --git a/nezha-fronted/src/components/chart/chart/chartBubble.vue b/nezha-fronted/src/components/chart/chart/chartBubble.vue index 06b97bf85..3f6846c0b 100644 --- a/nezha-fronted/src/components/chart/chart/chartBubble.vue +++ b/nezha-fronted/src/components/chart/chart/chartBubble.vue @@ -1,19 +1,32 @@