|
@@ -513,14 +513,49 @@
|
|
},
|
|
},
|
|
res => {
|
|
res => {
|
|
if (res.code == "ok") {
|
|
if (res.code == "ok") {
|
|
|
|
+ var cycle = res.data.cycle,
|
|
|
|
+ runtime = res.data.runtime,
|
|
|
|
+ xData = [],
|
|
|
|
+ avg = [],
|
|
|
|
+ max = [],
|
|
|
|
+ min = [],
|
|
|
|
+ the = [],
|
|
|
|
+ sData = [];
|
|
|
|
+
|
|
|
|
+ var num = 0;
|
|
|
|
+ for(var i in cycle) {
|
|
|
|
+ xData.push(i);
|
|
|
|
+ max.push(cycle[i].maxCycle/1000);
|
|
|
|
+ min.push(cycle[i].minCycle/1000);
|
|
|
|
+ avg.push(cycle[i].avgCycle/1000);
|
|
|
|
+ the.push(cycle[i].theoryCycle/1000);
|
|
|
|
+ if(runtime.length == 0) {
|
|
|
|
+ sData.push({value: 0 , color: "#009ad6"})
|
|
|
|
+ } else {
|
|
|
|
+ for(var j in runtime) {
|
|
|
|
+ if(i == j) {
|
|
|
|
+ if(num%2 == 0) {
|
|
|
|
+ sData.push({value: runtime[j].runtime , color: "#009ad6"});
|
|
|
|
+ } else {
|
|
|
|
+ sData.push({value: runtime[j].runtime , color: "#98F898"});
|
|
|
|
+ }
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ num++;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ let myChart = this.echarts.init(document.getElementById("myChart2"));
|
|
|
|
+ this.echarts2 = myChart;
|
|
var option = {
|
|
var option = {
|
|
tooltip: {
|
|
tooltip: {
|
|
trigger: 'axis'
|
|
trigger: 'axis'
|
|
},
|
|
},
|
|
legend: {
|
|
legend: {
|
|
- data:[this.$t('runTest.maxOpenCycle'),this.$t('runTest.minOpenCycle'),this.$t('runTest.avgOpenCycle'),this.$t('runTest.theoryCycle'),this.$t('runTest.openNum')],
|
|
|
|
|
|
+ data:[this.$t('runTest.maxOpenCycle'),this.$t('runTest.minOpenCycle'),this.$t('runTest.avgOpenCycle'),this.$t('runTest.theoryCycle')],//,this.$t('runTest.openNum')
|
|
x: '30%',
|
|
x: '30%',
|
|
- y: '-5'
|
|
|
|
|
|
+ y: '-4'
|
|
},
|
|
},
|
|
toolbox: {
|
|
toolbox: {
|
|
right: '20',
|
|
right: '20',
|
|
@@ -548,12 +583,12 @@
|
|
xAxis: [
|
|
xAxis: [
|
|
{
|
|
{
|
|
type: 'category',
|
|
type: 'category',
|
|
- data: [],
|
|
|
|
|
|
+ data: xData,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
gridIndex: 1,
|
|
gridIndex: 1,
|
|
type: 'category',
|
|
type: 'category',
|
|
- data: []
|
|
|
|
|
|
+ data: xData
|
|
}
|
|
}
|
|
],
|
|
],
|
|
yAxis: [
|
|
yAxis: [
|
|
@@ -605,7 +640,7 @@
|
|
{
|
|
{
|
|
name: this.$t('runTest.maxOpenCycle'),
|
|
name: this.$t('runTest.maxOpenCycle'),
|
|
type: 'line',
|
|
type: 'line',
|
|
- data:[],
|
|
|
|
|
|
+ data: max,
|
|
itemStyle : {
|
|
itemStyle : {
|
|
normal : {
|
|
normal : {
|
|
color: "#d93a49", //改变折线点的颜色
|
|
color: "#d93a49", //改变折线点的颜色
|
|
@@ -618,7 +653,7 @@
|
|
{
|
|
{
|
|
name: this.$t('runTest.minOpenCycle'),
|
|
name: this.$t('runTest.minOpenCycle'),
|
|
type:'line',
|
|
type:'line',
|
|
- data:[],
|
|
|
|
|
|
+ data: min,
|
|
itemStyle : {
|
|
itemStyle : {
|
|
normal : {
|
|
normal : {
|
|
color: "#67E0E3", //改变折线点的颜色
|
|
color: "#67E0E3", //改变折线点的颜色
|
|
@@ -631,7 +666,7 @@
|
|
{
|
|
{
|
|
name: this.$t('runTest.avgOpenCycle'),
|
|
name: this.$t('runTest.avgOpenCycle'),
|
|
type: 'line',
|
|
type: 'line',
|
|
- data:[],
|
|
|
|
|
|
+ data: avg,
|
|
itemStyle : {
|
|
itemStyle : {
|
|
normal : {
|
|
normal : {
|
|
color: "#7fb80e", //改变折线点的颜色
|
|
color: "#7fb80e", //改变折线点的颜色
|
|
@@ -644,7 +679,7 @@
|
|
{
|
|
{
|
|
name: this.$t('runTest.theoryCycle'),
|
|
name: this.$t('runTest.theoryCycle'),
|
|
type: 'line',
|
|
type: 'line',
|
|
- data:[],
|
|
|
|
|
|
+ data: the,
|
|
itemStyle : {
|
|
itemStyle : {
|
|
normal : {
|
|
normal : {
|
|
color: "#f58220", //改变折线点的颜色
|
|
color: "#f58220", //改变折线点的颜色
|
|
@@ -657,16 +692,25 @@
|
|
{
|
|
{
|
|
name: this.$t('runTest.openNum'),
|
|
name: this.$t('runTest.openNum'),
|
|
type: 'bar',
|
|
type: 'bar',
|
|
- barWidth : 30,
|
|
|
|
|
|
+ barWidth : '60%',
|
|
xAxisIndex: 1,
|
|
xAxisIndex: 1,
|
|
yAxisIndex: 1,
|
|
yAxisIndex: 1,
|
|
- data: [],
|
|
|
|
|
|
+ data: sData,
|
|
itemStyle : {
|
|
itemStyle : {
|
|
normal : {
|
|
normal : {
|
|
- color: "#009ad6", //改变折线点的颜色
|
|
|
|
- lineStyle:{
|
|
|
|
- color: "#009ad6" //改变折线颜色
|
|
|
|
- }
|
|
|
|
|
|
+ color: function(params) {
|
|
|
|
+ var colorItem = ['#009ad6','#9FE6B8', '#FFDB5C'];
|
|
|
|
+ var currentItem = 0;
|
|
|
|
+ var colorList=[];
|
|
|
|
+ for(var i = 0 ; i < sData.length;i++){
|
|
|
|
+ colorList.push(colorItem[currentItem]);
|
|
|
|
+ currentItem ++;
|
|
|
|
+ if(currentItem > 2) {
|
|
|
|
+ currentItem = 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return colorList[params.dataIndex]
|
|
|
|
+ }//: "#009ad6", //改变折线点的颜色
|
|
}
|
|
}
|
|
},
|
|
},
|
|
label: {
|
|
label: {
|
|
@@ -679,42 +723,9 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
]
|
|
- },
|
|
|
|
- cycle = res.data.cycle,
|
|
|
|
- runtime = res.data.runtime,
|
|
|
|
- xData = [],
|
|
|
|
- avg = [],
|
|
|
|
- max = [],
|
|
|
|
- min = [],
|
|
|
|
- the = [],
|
|
|
|
- sData = [];
|
|
|
|
-
|
|
|
|
- for(var i in cycle) {
|
|
|
|
- xData.push(i);
|
|
|
|
- max.push(cycle[i].maxCycle/1000);
|
|
|
|
- min.push(cycle[i].minCycle/1000);
|
|
|
|
- avg.push(cycle[i].avgCycle/1000);
|
|
|
|
- the.push(cycle[i].theoryCycle/1000);
|
|
|
|
- if(runtime.length == 0) {
|
|
|
|
- sData.push(0)
|
|
|
|
- } else {
|
|
|
|
- for(var j in runtime) {
|
|
|
|
- if(i == j) {
|
|
|
|
- sData.push(runtime[j].runtime);
|
|
|
|
- break
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- option.xAxis[0].data = xData;
|
|
|
|
- option.xAxis[1].data = xData;
|
|
|
|
- option.series[0].data = max;
|
|
|
|
- option.series[1].data = min;
|
|
|
|
- option.series[2].data = avg;
|
|
|
|
- option.series[3].data = the;
|
|
|
|
- option.series[4].data = sData;
|
|
|
|
-
|
|
|
|
- this.drawEchart(2,JSON.stringify(option));
|
|
|
|
|
|
+ };
|
|
|
|
+ // this.drawEchart(2,JSON.stringify(option));
|
|
|
|
+ myChart.setOption(option);
|
|
} else {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
message: res.msg,
|
|
message: res.msg,
|
|
@@ -731,9 +742,6 @@
|
|
},
|
|
},
|
|
|
|
|
|
drawEchart(type,option) {
|
|
drawEchart(type,option) {
|
|
- let myChart = this.echarts.init(document.getElementById("myChart2"));
|
|
|
|
- this.echarts2 = myChart;
|
|
|
|
- myChart.setOption(JSON.parse(option));
|
|
|
|
},
|
|
},
|
|
|
|
|
|
changeOpen(type) {
|
|
changeOpen(type) {
|