This commit is contained in:
zty 2024-12-27 17:21:25 +08:00
commit 7400a6d02c
6 changed files with 151 additions and 54 deletions

View File

@ -153,6 +153,7 @@ export default {
code: "", code: "",
cateName: "", cateName: "",
myChart: null, myChart: null,
isMpoint:false,
dictData: [], dictData: [],
option: { option: {
title: { title: {
@ -323,6 +324,7 @@ export default {
} else if ( } else if (
that.cate == "单位产品成本(元/吨)" || that.cate == "单位产品成本(元/吨)" ||
that.cate == "电石渣成本(元/吨)" || that.cate == "电石渣成本(元/吨)" ||
that.cate == "电石渣成本(元/吨)" ||
that.cate == "生料成本(元/吨)" that.cate == "生料成本(元/吨)"
) { ) {
that.cateName = "production_cost_unit"; that.cateName = "production_cost_unit";
@ -336,15 +338,59 @@ export default {
that.cateName = "production_hour"; that.cateName = "production_hour";
} else if (that.cate == "吨熟料发电量KW·h/t") { } else if (that.cate == "吨熟料发电量KW·h/t") {
that.cateName = "production_elec_unit"; that.cateName = "production_elec_unit";
} else if (that.cate == "总电耗KW·h") { } else if (that.cate == "总电耗KW·h"||that.cate =="总电量KW·h") {
that.cateName = "elec_consume"; that.cateName = "elec_consume";
}else if (that.cate == "消耗") {
that.cateName = "amount_consume";
}else if (that.cate == "进厂") {
that.cateName = "amount_consume";
}else if (that.cate == "氨水消耗量(t)") {
that.cateName = "ammonia_consume";
}else if (that.cate == "单位氨水消耗量(kg/t)") {
that.cateName = "ammonia_consume_unit";
}
else if (that.cate == "P.O42.5R 散装t") {
that.cateName = "x水泥+P.O42.5R 散装";
that.isMpoint = true;
}else if (that.cate == "P.O42.5R 袋装t") {
that.cateName = "x水泥+P.O42.5R 袋装";
that.isMpoint = true;
}else if (that.cate == "P.O42.5 袋装t") {
that.cateName = "x水泥+P.O42.5 袋装";
that.isMpoint = true;
}else if (that.cate == "P.O42.5 散装t") {
that.cateName = "x水泥+P.O42.5 散装";
that.isMpoint = true;
}else if (that.cate == "复合硅酸盐水泥;42.5R;袋装水泥(t)") {
that.cateName = "x复合硅酸盐水泥;42.5R;袋装水泥";
that.isMpoint = true;
}else if (that.cate == "复合硅酸盐水泥;42.5R;散装水泥(t)") {
that.cateName = "x复合硅酸盐水泥;42.5R;散装水泥";
that.isMpoint = true;
}else if (that.cate == "普通硅酸盐水泥;52.5;散装水泥(t)") {
that.cateName = "x普通硅酸盐水泥;52.5;散装水泥";
that.isMpoint = true;
}else if (that.cate == "散装水泥(t)") {
that.cateName = "szsn_hj";
that.isMpoint = true;
}else if (that.cate == "袋装水泥(t)") {
that.cateName = "dzsn_hj";
that.isMpoint = true;
}else if (that.cate == "出厂水泥合计t") {
that.cateName = "ccsn_hj";
that.isMpoint = true;
}else if (that.cate == "熟料t") {
that.cateName = "x通用水泥熟料";
that.isMpoint = true;
} }
} else { } else {
that.cateName = "elec_consume_unit"; that.cateName = "elec_consume_unit";
} }
this.$nextTick((res) => { this.$nextTick((res) => {
this.getDict(); console.log('that.isMpoint',that.isMpoint);
this.getChartsData(); this.getChartsData();
this.getDict();
}); });
}, },
methods: { methods: {
@ -395,32 +441,73 @@ export default {
} else { } else {
params.mpoint = that.mpoint; params.mpoint = that.mpoint;
} }
that.apiObj.req(params).then((res) => { console.log(params);
let xAxisData = [], console.log(that.cateName);
lineData = []; if(that.isMpoint){
res.forEach((item) => { params.mpoint__code = that.cateName;
let ind = 0; that.$API.enm.mpointstat.list.req(params).then((res1) => {
let values = Number(item[that.cateName]); let xAxisData = [],
if (type == "hour_s") { lineData = [];
ind = item[type]; if(res1.length>0){
xAxisData[ind] = item[type] + unit; res1.reverse();
lineData[ind] = values; res1.forEach((item) => {
} else { let ind = 0;
lineData.push(values); if (type == "hour_s") {
let xAxis = item[type] + unit; ind = item[type];
xAxisData.push(xAxis); xAxisData[ind] = item[type] + unit;
lineData[ind] = item.val;
// ind = item[type] - 1; } else {
// xAxisData[ind] = item[type] + unit; lineData.push(item.val);
// lineData[ind] = values; let xAxis = item[type] + unit;
xAxisData.push(xAxis);
}
})
let chartDom = document.getElementById("myChart");
that.myChart = echarts.init(chartDom);
that.option.xAxis.data = xAxisData;
that.option.series[0].data = lineData;
that.myChart.setOption(that.option);
console.log(that.option);
} }
})
}else{
that.apiObj.req(params).then((res) => {
let xAxisData = [],
lineData = [];
res.forEach((item) => {
let ind = 0;
let values = 0;
if(that.cateName === "amount_consume"){
if(that.cate == "消耗"){
values = item.imaterial_data_dict.湿电石渣消耗.amount_consume;
}else{
values = item.imaterial_data_dict.湿电石渣进厂.amount_consume;
}
}else if(that.cateName ==="ammonia_consume_unit"){
values = (item.ammonia_consume*1000/item.total_production).toFixed(2);
}else{
values = Number(item[that.cateName]);
}
if (type == "hour_s") {
ind = item[type];
xAxisData[ind] = item[type] + unit;
lineData[ind] = values;
} else {
lineData.push(values);
let xAxis = item[type] + unit;
xAxisData.push(xAxis);
}
});
let chartDom = document.getElementById("myChart");
that.myChart = echarts.init(chartDom);
that.option.xAxis.data = xAxisData;
that.option.series[0].data = lineData;
that.myChart.setOption(that.option);
}); });
let chartDom = document.getElementById("myChart"); }
that.myChart = echarts.init(chartDom); },
that.option.xAxis.data = xAxisData; getChartsData2(){
that.option.series[0].data = lineData;
that.myChart.setOption(that.option);
});
}, },
dataSearch() { dataSearch() {
this.getChartsData(); this.getChartsData();

View File

@ -94,9 +94,9 @@
> >
<!-- <el-radio-button label="day">本日</el-radio-button> --> <!-- <el-radio-button label="day">本日</el-radio-button> -->
<el-radio-button label="month" <el-radio-button label="month"
>本月</el-radio-button ></el-radio-button
> >
<el-radio-button label="year">本年</el-radio-button> <el-radio-button label="year"></el-radio-button>
</el-radio-group> </el-radio-group>
<div style="position: absolute; right: 20px"> <div style="position: absolute; right: 20px">
<el-date-picker <el-date-picker
@ -184,7 +184,7 @@ let tooltip = {
let grid = { let grid = {
right: "10%", right: "10%",
left: "4%", left: "4%",
top: "15%", top: "20%",
}; };
let toolbox = { let toolbox = {
right: "2%", right: "2%",
@ -204,6 +204,7 @@ let yAxis = [
name: "产量 (t)", name: "产量 (t)",
position: "left", position: "left",
alignTicks: true, alignTicks: true,
nameRotate: 30,
axisLine: { axisLine: {
show: true, show: true,
lineStyle: { lineStyle: {
@ -221,6 +222,7 @@ let yAxis = [
alignTicks: true, alignTicks: true,
offset: 60, offset: 60,
max: 100, max: 100,
nameRotate: 30,
axisLine: { axisLine: {
show: true, show: true,
lineStyle: { lineStyle: {
@ -233,9 +235,10 @@ let yAxis = [
}, },
{ {
type: "value", type: "value",
name: "分布电耗(KW.h)", name: "分布电耗(KW.h/t)",
position: "right", position: "right",
alignTicks: true, alignTicks: true,
nameRotate: 30,
axisLine: { axisLine: {
show: true, show: true,
lineStyle: { lineStyle: {

View File

@ -2,8 +2,8 @@
<el-container> <el-container>
<el-main style="background: #fff;"> <el-main style="background: #fff;">
<div class="pictureContainer"> <div class="pictureContainer">
<!-- <img src="/media/elec_flow.png" class="flowImg" > --> <img src="/media/elec_flow.png" class="flowImg" >
<img src="/img/energy.png" class="flowImg" /> <!-- <img src="/img/energy.png" class="flowImg" /> -->
<div class="pictureHeader" style="top: 35px;"> <div class="pictureHeader" style="top: 35px;">
本日数据 时间段 00:00--24:00 本日数据 时间段 00:00--24:00
</div> </div>

View File

@ -104,11 +104,11 @@
v-model="typeRadio" v-model="typeRadio"
@change="typeRadioChange" @change="typeRadioChange"
> >
<el-radio-button label="day">本日</el-radio-button> <el-radio-button label="day">小时</el-radio-button>
<el-radio-button label="month" <el-radio-button label="month"
>本月</el-radio-button ></el-radio-button
> >
<el-radio-button label="year">本年</el-radio-button> <el-radio-button label="year"></el-radio-button>
</el-radio-group> </el-radio-group>
<div style="position: absolute; right: 20px"> <div style="position: absolute; right: 20px">
<el-date-picker <el-date-picker
@ -308,7 +308,7 @@ let tooltip = {
let grid = { let grid = {
right: "12%", right: "12%",
left: "10%", left: "10%",
top: "15%", top: "20%",
}; };
let toolbox = { let toolbox = {
right: "2%", right: "2%",
@ -334,6 +334,7 @@ let yAxis = [
name: "产量 (t)", name: "产量 (t)",
position: "left", position: "left",
alignTicks: true, alignTicks: true,
nameRotate: 30,
axisLine: { axisLine: {
show: true, show: true,
lineStyle: { lineStyle: {
@ -346,10 +347,12 @@ let yAxis = [
}, },
{ {
type: "value", type: "value",
name: "运转率 ", name: "运转率(%) ",
position: "right", position: "right",
alignTicks: true, alignTicks: true,
nameRotate: 30,
offset: 120, offset: 120,
max:100,
axisLine: { axisLine: {
show: true, show: true,
lineStyle: { lineStyle: {
@ -362,10 +365,10 @@ let yAxis = [
}, },
{ {
type: "value", type: "value",
name: "分布电耗", name: "分布电耗(KW.h/t)",
position: "right", position: "right",
alignTicks: true, alignTicks: true,
offset: 60, nameRotate: 30,
axisLine: { axisLine: {
show: true, show: true,
lineStyle: { lineStyle: {
@ -378,9 +381,11 @@ let yAxis = [
}, },
{ {
type: "value", type: "value",
name: "标煤耗", name: "标煤耗(kgce/t)",
position: "right", position: "right",
alignTicks: true, alignTicks: true,
nameRotate: 30,
offset: 60,
axisLine: { axisLine: {
show: true, show: true,
lineStyle: { lineStyle: {
@ -396,6 +401,7 @@ let yAxis = [
name: "成本(元)", name: "成本(元)",
position: "left", position: "left",
alignTicks: true, alignTicks: true,
nameRotate: 30,
offset: 60, offset: 60,
axisLine: { axisLine: {
show: true, show: true,

View File

@ -93,11 +93,9 @@
v-model="typeRadio" v-model="typeRadio"
@change="typeRadioChange" @change="typeRadioChange"
> >
<el-radio-button label="day">本日</el-radio-button> <el-radio-button label="day">小时</el-radio-button>
<el-radio-button label="month" <el-radio-button label="month"></el-radio-button>
>本月</el-radio-button <el-radio-button label="year"></el-radio-button>
>
<el-radio-button label="year">本年</el-radio-button>
</el-radio-group> </el-radio-group>
<div style="position: absolute; right: 20px"> <div style="position: absolute; right: 20px">
<el-date-picker <el-date-picker
@ -297,7 +295,7 @@ let tooltip = {
let grid = { let grid = {
right: "10%", right: "10%",
left: "10%", left: "10%",
top: "15%", top: "20%",
}; };
let toolbox = { let toolbox = {
right: "2%", right: "2%",
@ -316,6 +314,7 @@ let yAxis = [
name: "产量 (t)", name: "产量 (t)",
position: "left", position: "left",
alignTicks: true, alignTicks: true,
nameRotate: 30,
axisLine: { axisLine: {
show: true, show: true,
lineStyle: { lineStyle: {
@ -328,10 +327,12 @@ let yAxis = [
}, },
{ {
type: "value", type: "value",
name: "运转率", name: "运转率(%)",
position: "right", position: "right",
alignTicks: true, alignTicks: true,
nameRotate: 30,
offset: 80, offset: 80,
max:100,
axisLine: { axisLine: {
show: true, show: true,
lineStyle: { lineStyle: {
@ -344,9 +345,10 @@ let yAxis = [
}, },
{ {
type: "value", type: "value",
name: "分布电耗(KW.h)", name: "分布电耗(KW.h/t)",
position: "right", position: "right",
alignTicks: true, alignTicks: true,
nameRotate: 30,
axisLine: { axisLine: {
show: true, show: true,
lineStyle: { lineStyle: {
@ -362,6 +364,7 @@ let yAxis = [
name: "成本(元)", name: "成本(元)",
position: "left", position: "left",
alignTicks: true, alignTicks: true,
nameRotate: 30,
offset: 70, offset: 70,
axisLine: { axisLine: {
show: true, show: true,
@ -407,7 +410,7 @@ export default {
["运转时间", "运转时间h", "/", 0, 0, "/", 0, 0, "/", "/"], ["运转时间", "运转时间h", "/", 0, 0, "/", 0, 0, "/", "/"],
["运转时间", "运转率(%", "/", 0, 0, "/", 0, 0, "/", "/"], ["运转时间", "运转率(%", "/", 0, 0, "/", 0, 0, "/", "/"],
["能耗", "单位产品分布电耗KW·h/t", 0, 0, 0, 0, 0, 0, 0, 0], ["能耗", "单位产品分布电耗KW·h/t", 0, 0, 0, 0, 0, 0, 0, 0],
["能耗", "单位产品综合能耗(KW·h/t", 0, 0, 0, 0, 0, 0, 0, 0], ["能耗", "单位产品综合能耗(kgce/t", 0, 0, 0, 0, 0, 0, 0, 0],
["能耗", "总电耗KW·h", 0, 0, 0, 0, "/", "/", "/", "/"], ["能耗", "总电耗KW·h", 0, 0, 0, 0, "/", "/", "/", "/"],
["成本", "单位产品成本(元/吨)", 0, 0, 0, 0, 0, 0, 0, 0], ["成本", "单位产品成本(元/吨)", 0, 0, 0, 0, 0, 0, 0, 0],
], ],

View File

@ -73,10 +73,8 @@
v-model="typeRadio" v-model="typeRadio"
@change="typeRadioChange" @change="typeRadioChange"
> >
<el-radio-button label="month" <el-radio-button label="month"></el-radio-button>
>本月</el-radio-button <el-radio-button label="year"></el-radio-button>
>
<el-radio-button label="year">本年</el-radio-button>
</el-radio-group> </el-radio-group>
<div style="position: absolute; right: 20px"> <div style="position: absolute; right: 20px">
<el-date-picker <el-date-picker
@ -291,7 +289,7 @@ let yAxis = [
}, },
{ {
type: "value", type: "value",
name: "分布电耗(KW.h)", name: "分布电耗(KW.h/t)",
position: "right", position: "right",
alignTicks: true, alignTicks: true,
axisLine: { axisLine: {