From 7cafaf12da4e556a652a9bb7149476de55a98ac6 Mon Sep 17 00:00:00 2001 From: hyx Date: Fri, 17 Apr 2020 21:50:26 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=94=B9=E9=97=AE?= =?UTF-8?q?=E9=A2=98=201=20dashboard=E6=A8=A1=E5=9D=97prometheus=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=8E=A5=E5=8F=A3query=E5=86=85=E5=AE=B9=E8=BF=9B?= =?UTF-8?q?=E8=A1=8Cencode=202=20panel=E4=B8=8B=E6=8B=89=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E5=B7=A6=E4=BE=A7=E8=8F=9C=E5=8D=95=E6=94=B6?= =?UTF-8?q?=E7=BC=A9=E5=90=8E=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8=203=20ec?= =?UTF-8?q?harts=E5=9B=BE=E8=A1=A8=E5=AF=B9=E4=BA=8E=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E6=95=B0=E6=8D=AEmetric=E4=B8=BA=E7=A9=BA=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=EF=BC=8Ctooltip=E6=97=A0=E6=B3=95=E6=AD=A3=E5=B8=B8=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=BF=AE=E6=94=B9=EF=BC=88=E5=88=97=E8=A1=A8=E5=8F=8A?= =?UTF-8?q?=E5=85=A8=E5=B1=8F=EF=BC=8C=E9=A2=84=E8=A7=88=E5=8F=8A=E5=85=A8?= =?UTF-8?q?=E5=B1=8F=EF=BC=8Cexplore=E5=8F=8A=E5=85=A8=E5=B1=8F=EF=BC=89?= =?UTF-8?q?=204=20=E5=9B=BE=E8=A1=A8tooltip=E4=B8=AD=E7=9A=84=E5=86=92?= =?UTF-8?q?=E5=8F=B7=E5=88=A0=E6=8E=89=205=20metric=E9=80=89=E6=8B=A9?= =?UTF-8?q?=EF=BC=8Cmetric=E5=8F=8Alabel=E9=AB=98=E5=BA=A6=E4=B8=BA100%?= =?UTF-8?q?=EF=BC=8C=E6=97=A0=E6=BB=9A=E5=8A=A8=E6=9D=A1=206=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=BD=91=E6=A0=BC=EF=BC=8C=E5=8F=96=E6=B6=88y?= =?UTF-8?q?=E8=BD=B4=207=20tooltip=E5=86=85=E5=AE=B9=E5=92=8Clegend?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=98=BE=E7=A4=BA=E4=B8=8D=E4=B8=80=E8=87=B4?= =?UTF-8?q?=208=20tooltip=E9=A2=9C=E8=89=B2=E9=9A=8F=E6=9C=BA=E4=BA=A7?= =?UTF-8?q?=E7=94=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/charts/chart-list.vue | 7 +- .../src/components/charts/chart-url.vue | 17 +- .../src/components/charts/chartPreview.vue | 39 ++- .../components/charts/line-chart-block.vue | 37 +- .../components/common/js/radomcolor/color.txt | 177 ++++++++++ .../common/js/radomcolor/randomcolor.js | 322 ++++++++++++++++++ .../components/page/dashboard/chartMetric.vue | 14 +- 7 files changed, 575 insertions(+), 38 deletions(-) create mode 100644 nezha-fronted/src/components/common/js/radomcolor/color.txt create mode 100644 nezha-fronted/src/components/common/js/radomcolor/randomcolor.js diff --git a/nezha-fronted/src/components/charts/chart-list.vue b/nezha-fronted/src/components/charts/chart-list.vue index cc5f2261d..95f17ffba 100644 --- a/nezha-fronted/src/components/charts/chart-list.vue +++ b/nezha-fronted/src/components/charts/chart-list.vue @@ -69,8 +69,7 @@ handle:'.chartTitle', }" >@clone="clone" --> - @@ -41,7 +41,7 @@ {{data.title}} @@ -92,6 +92,7 @@ export default { minHeight:200, chartSpaceHeight:5,//top-border: 1,bottom-border: 1,padding-bottome:3 titleHeight:38,//title-height:28,magrin-bottom:10 + paddingBottom:6, divFirstShow:false, }; }, @@ -113,7 +114,7 @@ export default { } chartBox.style.height = `${height-this.chartSpaceHeight}px`; const urlBox = document.getElementById('urlContainer'+this.chartIndex); - urlBox.style.height = `${height-this.chartSpaceHeight-this.titleHeight}px`;// -75-32 + urlBox.style.height = `${height-this.chartSpaceHeight-this.titleHeight-this.paddingBottom}px`;// -75-32 }); this.startLoading(); this.setLoadFrame(); @@ -150,7 +151,7 @@ export default { this.setLoadFrameFull(); }, dragResize:function(e){ - console.log('========',this.data) + console.log('========',this.data); var diffWidth =20; //界面的宽度空白的地方的宽度 var chartBoxPadding = 22; var targetDiv= document.getElementById('chartUrlDiv'+this.chartIndex); //e.target.parentNode.parentNode;.children[0] @@ -214,7 +215,7 @@ export default { //表格的高度 const tableBox = document.getElementById('urlContainer'+_this.chartIndex); tableBox.style.height = `${containerHeight-_this.titleHeight}px`;//-75-32+25 - } + }; document.onmouseup=function(){ document.onmousemove=null; @@ -273,10 +274,10 @@ export default { height:(containerHeight+_this.chartSpaceHeight), prev:parseInt(_this.data.prev), next:parseInt(_this.data.next), - } - console.log('========2',_this.data) + }; + console.log('========2',_this.data); _this.$put('panel/'+ _this.panelIdInner+'/charts/modify',modifyParams).then(response => { - console.log('========3',_this.data) + console.log('========3',_this.data); if (response.code === 200) { //更新当前图表数据 _this.data.span= span; diff --git a/nezha-fronted/src/components/charts/chartPreview.vue b/nezha-fronted/src/components/charts/chartPreview.vue index 04eb56841..3f8518253 100644 --- a/nezha-fronted/src/components/charts/chartPreview.vue +++ b/nezha-fronted/src/components/charts/chartPreview.vue @@ -17,8 +17,9 @@ } #chartPreviewDailog .el-dialog__body { - padding-bottom:5px !important; + padding-bottom:20px !important; } +