This commit is contained in:
shijing 2024-12-30 13:32:03 +08:00
commit 589d30de9b
1 changed files with 44 additions and 9 deletions

View File

@ -43,6 +43,19 @@
v-if="query.type==2"
class="headerSearch"
/>
<el-date-picker
v-model="daterange"
type="datetimerange"
:shortcuts="shortcuts"
range-separator="To"
start-placeholder="Start date"
end-placeholder="End date"
placeholder="时间范围"
value-format="YYYY-MM-DD hh:mm:ss"
v-if="query.type==3"
style="margin-right: 6px"
@change="changeDate"
/>
<el-button
type="primary"
icon="el-icon-search"
@ -99,6 +112,8 @@ import * as echarts from 'echarts';
start_time:'',
end_time:'',
},
tableDatas_range:[],
daterange:[],
headers: ['生料立磨','循环风机','高温风机','尾排风机','回转窑','水泥磨','水泥循环风机','水泥系统风机','电石渣','原料磨','煤磨','水泥粉磨','水泥包装'],
mpoint_name: ['原料立磨主电机','循环风机-原料磨','高温风机','尾排风机','回转窑合计','水泥高压进线','循环风机-水泥磨','系统风机','电石渣合计','原料磨合计','煤磨合计','水泥磨主电机','包装进线'],
tableData: [
@ -114,9 +129,11 @@ import * as echarts from 'echarts';
{id:0,name:'日统计'},
{id:1,name:'月统计'},
{id:2,name:'年统计'},
{id:3,name:'时间范围'},
],
row_list : ['peak','high','low','deep','flat'],
row_translate: ['峰值', '高峰', '低谷', '深谷', '平谷'],
row_translate: ['尖峰', '高峰', '低谷', '深谷', '平谷'],
colors :["#EB1B1D", "#FE9900", "#0E4E51", "#2B8C05", "#A9C0A0"],//
};
},
@ -147,12 +164,25 @@ import * as echarts from 'echarts';
rowspan: 1,
colspan: 0,
};
}
}
}
}
},
translate(){
},
changeDate(){
let obj = {};
obj.type = "hour";
obj.start_time = this.daterange[0];
obj.end_time = this.daterange[1];
obj.mpoint__in = this.mpointList[0];
obj.page = 0;
this.$API.enm.mpointstat.groupValues.req(obj).then((res) => {
//res total_val
res.forEach(item => {
item.total_val = Number(item.total_val).toFixed(2);
});
this.tableDatas_range = res;
});
},
dateChange() {
let that = this;
let arr = [],
@ -171,6 +201,9 @@ import * as echarts from 'echarts';
obj.days = new Date(that.query.year, that.query.month, 0).getDate(); //
} else if (that.query.type === 2) { //
obj.year = that.query.year;
} else if (that.query.type === 3) { //
obj.start_time = that.daterange[0];
obj.end_time = that.daterange[1];
}
obj.page = 0;
obj.type = 'hour';
@ -196,7 +229,6 @@ import * as echarts from 'echarts';
});
});
//
console.log('chartData',chartData);
that.createBarChart(chartData);
})
.catch((error) => {
@ -214,7 +246,7 @@ import * as echarts from 'echarts';
let seriesData = [];
let categories = this.mpoint_name; //
let rowList = this.row_list; // ['peak', 'high', 'low', 'deep', 'flat']
let row_translate = this.row_translate; // ['', '', '', '', '']
let row_translate = this.row_translate; // ['', '', '', '', '']
// 'peak', 'high', 'low', 'deep', 'flat'
rowList.forEach((level, index) => {
let data = categories.map(device => {
@ -231,6 +263,9 @@ import * as echarts from 'echarts';
show: true,
position: 'top',
formatter: '{c}' //
},
itemStyle: {
color: this.colors[index] //
}
});
});