From 3c0e874ab22a6c15d0c7fde5334973ef24d2a186 Mon Sep 17 00:00:00 2001 From: chenjinsong <523037378@qq.com> Date: Tue, 23 Feb 2021 16:38:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8D=95=E5=80=BC/table=E7=9A=84valuem?= =?UTF-8?q?apping=E5=A2=9E=E5=8A=A0{{name}}?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/charts/chart-single-stat.vue | 4 +- .../src/components/charts/chart-table.vue | 2 +- .../components/page/config/terminallog.vue | 37 ++++++------------- 3 files changed, 15 insertions(+), 28 deletions(-) diff --git a/nezha-fronted/src/components/charts/chart-single-stat.vue b/nezha-fronted/src/components/charts/chart-single-stat.vue index f162e3e03..ee7c1b063 100644 --- a/nezha-fronted/src/components/charts/chart-single-stat.vue +++ b/nezha-fronted/src/components/charts/chart-single-stat.vue @@ -436,7 +436,7 @@ export default { if(this.mapping&&!this.mapping.color){ this.mapping.color={bac:'#fff',text:'#000'} } - this.serieSingleStat = mapping?mapping.text.replace('{{value}}', singleStatTmp):chartDataFormat.getUnit(chartItem.unit?chartItem.unit:2).compute(singleStatTmp,null,2); + this.serieSingleStat = mapping?mapping.text.replace('{{value}}', singleStatTmp).replace('{{name}}', chartItem.elements[0].legend):chartDataFormat.getUnit(chartItem.unit?chartItem.unit:2).compute(singleStatTmp,null,2); }else{ this.serieSingleStat = chartDataFormat.getUnit(chartItem.unit?chartItem.unit:2).compute(singleStatTmp,null,2); } @@ -472,7 +472,7 @@ export default { if(this.mapping&&!this.mapping.color){ this.mapping.color={bac:'#fff',text:'#000'} } - this.serieSingleStat = mapping?mapping.text.replace('{{value}}', singleStatTmp):chartDataFormat.getUnit(chartItem.unit?chartItem.unit:2).compute(singleStatTmp,null,2); + this.serieSingleStat = mapping?mapping.text.replace('{{value}}', singleStatTmp).replace('{{name}}', chartItem.elements[0].legend):chartDataFormat.getUnit(chartItem.unit?chartItem.unit:2).compute(singleStatTmp,null,2); }else{ this.serieSingleStat = chartDataFormat.getUnit(chartItem.unit?chartItem.unit:2).compute(singleStatTmp,null,2); } diff --git a/nezha-fronted/src/components/charts/chart-table.vue b/nezha-fronted/src/components/charts/chart-table.vue index 62ccc02c5..33b54db96 100644 --- a/nezha-fronted/src/components/charts/chart-table.vue +++ b/nezha-fronted/src/components/charts/chart-table.vue @@ -409,7 +409,7 @@ } this.mapping=mapping; item.mapping=mapping; - item.value = mapping?mapping.text.replace('{{value}}', item.value):chartDataFormat.getUnit(chartItem.unit?chartItem.unit:2).compute(value,null,2); + item.value = mapping?mapping.text.replace('{{value}}', item.value).replace('{{name}}', item.element.alias):chartDataFormat.getUnit(chartItem.unit?chartItem.unit:2).compute(value,null,2); } return item; })); diff --git a/nezha-fronted/src/components/page/config/terminallog.vue b/nezha-fronted/src/components/page/config/terminallog.vue index 38c16c6d5..203c0602b 100644 --- a/nezha-fronted/src/components/page/config/terminallog.vue +++ b/nezha-fronted/src/components/page/config/terminallog.vue @@ -217,32 +217,19 @@ searchMsg: { //给搜索框子组件传递的信息 zheze_none: true, searchLabelList: [ - // { - // id: 10, - // name: this.$t('config.terminallog.protocol'), - // type: 'selectType', - // label: 'protocol', - // disabled: false - // }, { - id: 11, - name: this.$t('config.terminallog.host'), - type: 'input', - label: 'host', - disabled: false - },{ - id: 12, - name: this.$t('config.terminallog.user'), - type: 'input', - label: 'user', - disabled: false - },{ - id: 14, - name: this.$t('config.terminallog.userId'), - type: 'input', - label: 'userId', - disabled: false - } + id: 11, + name: this.$t('config.terminallog.host'), + type: 'input', + label: 'host', + disabled: false + },{ + id: 12, + name: this.$t('config.terminallog.user'), + type: 'input', + label: 'username', + disabled: false + } ], }, searchLabel: {}, //搜索参数