diff --git a/nezha-fronted/src/components/charts/chart-list.vue b/nezha-fronted/src/components/charts/chart-list.vue index 2d5db8aa5..25f7b489b 100644 --- a/nezha-fronted/src/components/charts/chart-list.vue +++ b/nezha-fronted/src/components/charts/chart-list.vue @@ -261,11 +261,11 @@ export default { }, metric_name: '', }; - if(chartInfo.type === 'stackArea'){ - seriesItem.theData.type='line'; - seriesItem.theData.stack=chartInfo.title - seriesItem.theData.areaStyle={}; - } + // if(chartInfo.type === 'stackArea'){ + // seriesItem.theData.type='line'; + // // seriesItem.theData.stack=chartInfo.title + // seriesItem.theData.areaStyle={}; + // } // 图表中每条线的名字,后半部分 let host = '';//up, if(queryItem.metric.__name__){ @@ -284,7 +284,7 @@ export default { if(host.endsWith(',')){host = host.substr(0,host.length-1);} host +="}"; //处理legend别名 - let alias=this.dealLegendAlias(host,chartItem.elements[innerPos].legend); + let alias=this.$refs.editChart[index].dealLegendAlias(host,chartItem.elements[innerPos].legend); legend.push({name:host,alias:alias}); // 图表中每条线的名字,去掉最后的逗号与空格:metric名称, 标签1=a,标签2=c seriesItem.theData.name = host; @@ -397,24 +397,6 @@ export default { chartBox[index].style.width = `${(size / 12) * 100}%`; }); }, - dealLegendAlias:function(legend,expression){ - if(/\{\{.+\}\}/.test(expression)){ - let labelValue=expression.replace(/(\{\{.+?\}\})/g,function(i){ - let label=i.substr(i.indexOf('{{')+2,i.indexOf('}}')-i.indexOf('{{')-2) - let reg=new RegExp(label+'=".+?"') - let value=null; - if(reg.test(legend)){ - let find=legend.match(reg)[0]; - value=find.substr(find.indexOf('"')+1,find.lastIndexOf('"')-find.indexOf('"')-1); - } - return value?value:label; - }) - return labelValue - }else{ - return expression; - } - - }, getNewTime(time, num) { const date = new Date(time); const newDate = new Date(parseInt(date.getTime(), 10) + num); diff --git a/nezha-fronted/src/components/charts/chart-table.vue b/nezha-fronted/src/components/charts/chart-table.vue index 37c486b75..12341893f 100644 --- a/nezha-fronted/src/components/charts/chart-table.vue +++ b/nezha-fronted/src/components/charts/chart-table.vue @@ -39,12 +39,13 @@ {{ scope.row.element.alias?scope.row.element.alias:scope.row.element.element}} - + + @@ -70,7 +71,7 @@ {{ unit.compute(scope.row.value,null,2)}} - + - + @@ -97,8 +97,8 @@ :rules="{ required: true, trigger: 'change' }"> {{item.name}} @@ -278,7 +278,7 @@ export default { }); } }, - + /* // 取消创建modal cancel() { diff --git a/nezha-fronted/src/components/page/project/project.vue b/nezha-fronted/src/components/page/project/project.vue index 3e71191af..b9f6b66cf 100644 --- a/nezha-fronted/src/components/page/project/project.vue +++ b/nezha-fronted/src/components/page/project/project.vue @@ -225,10 +225,11 @@ -
+
- `; + let str = `
`; params.forEach((item, i) => { let tip=temp.legend.find((element)=>{ return element.name == item.seriesName; @@ -1145,9 +1145,7 @@ }, showEndpoint:function(endpoint){ this.tableShow=3; - // this.queryEdpLoading=true; - console.log(this.$refs) - this.$refs.loading.startLoading(); + this.queryEdpLoading=true; if(endpoint){ this.curEndpoint=endpoint; this.formatTime=''; @@ -1217,8 +1215,7 @@ this.showTableData.push(edpQueryData); } this.showTableDataCopy=JSON.stringify(this.showTableData); - // this.queryEdpLoading=false; - this.$refs.loading.endLoading(); + this.queryEdpLoading=false; this.gutterHandler(".endpoint-query-table"); //控制table右边距 this.showTopBtn2 = false; this.$nextTick(() => { @@ -1320,7 +1317,7 @@ this.chartDatas=[]; this.legend=[]; this.graphShow=true; - setTimeout(()=>{this.queryChartDate();},10) + setTimeout(()=>{this.$refs.graphLoading.startLoading();this.queryChartDate();},10) }, dialogClose:function(){ @@ -1408,9 +1405,10 @@ this.chartOptions.series=this.chartDatas; this.graphChart.setOption(this.chartOptions);//创建图表 this.$refs.chartScrollbar.update(); + this.$refs.graphLoading.endLoading(); } }); - this.$refs.graphLoading.endLoading(); + }) }, dateChange:function(){ @@ -1421,7 +1419,6 @@ }, initDialog:function(){ - this.$refs.graphLoading.startLoading(); this.graphChart = echarts.init(document.getElementById('viewGraphChart')); // this.queryChartDate(); // this.chartOptions.legend.data=this.legend; @@ -1972,4 +1969,19 @@ top:0px !important; left:2px; } + .endpoint-query-table .el-loading-spinner .circular{ + width: 42px; + height: 42px; + animation: loading-rotate 2s linear infinite; + display: none; + } + .endpoint-query-table .el-loading-spinner{ + background: url(../../../assets/img/loading.gif) no-repeat; + background-size: 48px 48px; + width: 100%; + height: 100%; + position: relative; + top: 50%; + left: 48.5%; + }