feat: 修改大屏内容和生产报告查询

This commit is contained in:
zty 2025-01-06 17:39:17 +08:00
parent fd770c2562
commit b84d64b2f4
13 changed files with 995 additions and 154 deletions

View File

@ -431,12 +431,12 @@ export default {
{ name: "水泥磨", value: 0 , rate:0 }, { name: "水泥磨", value: 0 , rate:0 },
], ],
elecData: [ elecData: [
{ name: "电石渣", value: 0 }, { name: "电石渣工序", value: 0 },
{ name: "原料磨", value: 0 }, { name: "生料辅料工序", value: 0 },
{ name: "煤磨", value: 0 }, { name: "煤磨工序", value: 0 },
{ name: "回转窑", value: 0 }, { name: "烧成工序", value: 0 },
{ name: "水泥磨", value: 0 }, { name: "水泥工序", value: 0 },
{ name: "水泥包装", value: 0 }, { name: "水泥包装工序", value: 0 },
], ],
hotData: { hotData: {
celec_consume_unit: 0, // celec_consume_unit: 0, //
@ -544,16 +544,16 @@ export default {
radarOption: { radarOption: {
radar: { radar: {
indicator: [ indicator: [
{ name: "电石渣" }, { name: "电石渣工序" },
{ name: "原料磨" }, { name: "生料辅料工序" },
{ name: "煤磨" }, { name: "煤磨工序" },
{ name: "回转窑" }, { name: "烧成工序" },
{ name: "水泥磨" }, { name: "水泥工序" },
{ name: "水泥包装" }, { name: "水泥包装工序" },
], ],
name: { name: {
textStyle: { textStyle: {
padding: [20, 20], // padding padding: [15, 15], // padding
}, },
}, },
nameGap: 2, nameGap: 2,
@ -2227,11 +2227,11 @@ export default {
.bodyListItem_name { .bodyListItem_name {
width: 60px; width: 60px;
padding: 0.5vh 0; padding: 0.5vh 0;
font-size: 14px; font-size: 12px;
} }
.bodyListItem_num { .bodyListItem_num {
width: 65px; width: 65px;
font-size: 14px; font-size: 12px;
} }
.itemBodyFlex { .itemBodyFlex {
display: flex; display: flex;

View File

@ -290,6 +290,90 @@ let yAxis = [
}, },
}, },
]; ];
let yAxis_month = [
{
type: "value",
name: "产量 (t)",
position: "left",
alignTicks: true,
nameRotate: 50,
axisLine: {
show: true,
lineStyle: {
color: colors[0],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "台时(t/h)",
position: "left",
alignTicks: true,
nameRotate: 50,
offset: 50,
axisLine: {
show: true,
lineStyle: {
color: colors[1],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "煤磨运转率 (%)",
position: "right",
alignTicks: true,
offset: 50,
nameRotate: 50,
axisLine: {
show: true,
lineStyle: {
color: colors[2],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "煤磨分布电耗(kW·h/t)",
position: "right",
alignTicks: true,
nameRotate: 50,
axisLine: {
show: true,
lineStyle: {
color: colors[3],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "分布电耗目标值",
position: "right",
alignTicks: true,
nameRotate: 50,
axisLine: {
show: true,
lineStyle: {
color: colors[3],
},
},
axisLabel: {
formatter: "{value}",
},
},
];
let yAxis_hour = [ let yAxis_hour = [
{ {
type: "value", type: "value",
@ -341,6 +425,7 @@ export default {
myOption: null, myOption: null,
optionHour: {}, optionHour: {},
optionDay: {}, optionDay: {},
goal_list: [],
optionMonth: {}, optionMonth: {},
year: 2023, year: 2023,
month: 1, month: 1,
@ -459,7 +544,7 @@ export default {
tooltip: tooltip, tooltip: tooltip,
grid: grid, grid: grid,
toolbox: toolbox, toolbox: toolbox,
legend: legend, legend: Object.assign(legend, {data: ["煤磨总产量", "煤磨台时产量", "煤磨运转率", "煤磨分布电耗", "分布电耗目标值"]}),
xAxis: { xAxis: {
axisTick: { axisTick: {
show: true, show: true,
@ -481,7 +566,7 @@ export default {
"十二月", "十二月",
], ],
}, },
yAxis: yAxis, yAxis: yAxis_month,
series: [ series: [
{ {
name: "煤磨总产量", name: "煤磨总产量",
@ -507,6 +592,12 @@ export default {
yAxisIndex: 3, yAxisIndex: 3,
data: [], data: [],
}, },
{
name: "分布电耗目标值",
type: "line",
yAxisIndex: 4,
data: [],
},
], ],
}, },
}; };
@ -854,7 +945,26 @@ export default {
// //
getMonthData(year) { getMonthData(year) {
let that = this; let that = this;
let query2 = {}; let params5 = {};
params5.page = 0;
params5.year = year;
params5.mgroup = that.query.mgroup;
this.$API.mtm.goal.list
.req(params5)
.then((res5) => {
if (res5.length > 0) {
let data5 = res5;
data5.forEach((item5) => {
if (
item5.goal_cate_name ==
"单位产品分布电耗kW·h/t"
) {
that.goal_list.push(item5);
}
});
}
}).then(() => {
let query2 = {};
query2.page = 0; query2.page = 0;
query2.year_s = year; query2.year_s = year;
query2.type = "month_s"; query2.type = "month_s";
@ -863,21 +973,28 @@ export default {
let seriesData0 = [], let seriesData0 = [],
seriesData1 = [], seriesData1 = [],
seriesData2 = [], seriesData2 = [],
seriesData3 = []; seriesData3 = [],
seriesData4 = [];
let data = response; let data = response;
data.forEach((item) => { data.forEach((item) => {
let goal_index = 'goal_val_' + item.month_s;
let ind = item.month_s - 1; let ind = item.month_s - 1;
seriesData0[ind] = item.total_production; seriesData0[ind] = item.total_production;
seriesData1[ind] = item.production_hour; seriesData1[ind] = item.production_hour;
seriesData2[ind] = item.run_rate; seriesData2[ind] = item.run_rate;
seriesData3[ind] = item.elec_consume_unit; seriesData3[ind] = item.elec_consume_unit;
seriesData4[ind] = that.goal_list[0][goal_index];
}); });
let options = { ...that.option3 }; let options = { ...that.option3 };
options.series[0].data = seriesData0; options.series[0].data = seriesData0;
options.series[1].data = seriesData1; options.series[1].data = seriesData1;
options.series[2].data = seriesData2; options.series[2].data = seriesData2;
options.series[3].data = seriesData3; options.series[3].data = seriesData3;
options.series[4].data = seriesData4;
let monthXAxis = []; let monthXAxis = [];
if (year < that.year){
that.month = 12;
}
for (let i = 1; i <= that.month; i++) { for (let i = 1; i <= that.month; i++) {
let item = i + "月"; let item = i + "月";
monthXAxis.push(item); monthXAxis.push(item);
@ -885,6 +1002,8 @@ export default {
options.xAxis.data = monthXAxis; options.xAxis.data = monthXAxis;
that.optionMonth = options; that.optionMonth = options;
}); });
});
}, },
itemClick(type, item) { itemClick(type, item) {
this.type = type; this.type = type;

View File

@ -115,7 +115,7 @@ import * as echarts from 'echarts';
tableDatas_range:[], tableDatas_range:[],
daterange:[], daterange:[],
headers: ['生料立磨','循环风机','高温风机','尾排风机','回转窑','水泥磨','水泥循环风机','水泥系统风机','电石渣','原料磨','煤磨','水泥粉磨','水泥包装'], headers: ['生料立磨','循环风机','高温风机','尾排风机','回转窑','水泥磨','水泥循环风机','水泥系统风机','电石渣','原料磨','煤磨','水泥粉磨','水泥包装'],
mpoint_name: ['原料立磨主电机','循环风机-原料磨','高温风机','尾排风机','回转窑合计','水泥高压进线','循环风机-水泥磨','系统风机','电石渣合计','原料磨合计','煤磨合计','水泥磨主电机','包装进线'], mpoint_name: ['原料立磨主电机','循环风机-原料磨','高温风机','尾排风机','烧成工序用电合计','水泥高压进线','循环风机-水泥磨','系统风机','电石渣用电合计','生料辅料工序用电量','煤磨合计','水泥磨主电机','包装进线'],
tableData: [ tableData: [
['用电峰','用电尖峰','','','','','','','','','','','','',''], ['用电峰','用电尖峰','','','','','','','','','','','','',''],
['用电峰','用电高峰','','','','','','','','','','','','',''], ['用电峰','用电高峰','','','','','','','','','','','','',''],
@ -123,7 +123,7 @@ import * as echarts from 'echarts';
['用电谷','用电深谷','','','','','','','','','','','','',''], ['用电谷','用电深谷','','','','','','','','','','','','',''],
['用电平','用电平谷','','','','','','','','','','','','',''], ['用电平','用电平谷','','','','','','','','','','','','',''],
], ],
mpointList:["3631338253279723520,3631338547577257984,3631332708552392704,3631333116071026688,3631877739432493056,3631344327579828224,3631853750379200512,3631853436771090432,3631869508278722560,3631875738288111616,3631878174063050752,3631852596106797056,3631854361455820800"], mpointList:["3631338253279723520,3631338547577257984,3631332708552392704,3631333116071026688,3631877739432493056,3631344327579828224,3631853750379200512,3631853436771090432,3631869508278722560,3745109632247812096,3631878174063050752,3631852596106797056,3631854361455820800"],
tableName:'峰谷平', tableName:'峰谷平',
options:[ options:[
{id:0,name:'日统计'}, {id:0,name:'日统计'},

View File

@ -83,13 +83,14 @@
<thead class="myTableHead"> <thead class="myTableHead">
<tr> <tr>
<th rowspan="3">日期</th> <th rowspan="3">日期</th>
<th v-if="deptName=='原料车间'" colspan="11">原料车间</th> <th v-if="deptName=='原料车间'" colspan="15">原料车间</th>
<th v-if="deptName=='烧成车间'" colspan="16">烧成车间</th> <th v-if="deptName=='烧成车间'" colspan="16">烧成车间</th>
<th v-if="deptName=='水泥车间'" colspan="10">水泥车间</th> <th v-if="deptName=='水泥车间'" colspan="10">水泥车间</th>
</tr> </tr>
<tr v-if="deptName=='原料车间'"> <tr v-if="deptName=='原料车间'">
<th colspan="4">电石渣</th> <th colspan="4">电石渣</th>
<th colspan="4">原料磨</th> <th colspan="4">生料辅料</th>
<th colspan="4">生料</th>
<th rowspan="2">压缩空气m3</th> <th rowspan="2">压缩空气m3</th>
<th rowspan="2">单位压缩空气m3/t</th> <th rowspan="2">单位压缩空气m3/t</th>
</tr> </tr>
@ -120,10 +121,13 @@
<th v-else>单位产品能耗tce/t</th> <th v-else>单位产品能耗tce/t</th>
<th>电量kW·h</th> <th>电量kW·h</th>
<th>电量折标煤tce</th> <th>电量折标煤tce</th>
<!-- <th v-if="deptName=='原料车间'">t</th> -->
<!-- <th v-if="deptName=='原料车间'">窑尾余热利用tce</th> -->
<th>产品产量t</th> <th>产品产量t</th>
<th>单位产品能耗tce/t</th> <th>单位产品能耗tce/t</th>
<th v-if="deptName=='原料车间'">电量kW·h</th>
<th v-if="deptName=='原料车间'">电量折标煤tce</th>
<th v-if="deptName=='原料车间'">产品产量t</th>
<th v-if="deptName=='原料车间'">单位产品能耗tce/t</th>
</tr> </tr>
</thead> </thead>
<tr v-for="(item,index) in tableDatas3" :key="index"> <tr v-for="(item,index) in tableDatas3" :key="index">
@ -237,6 +241,8 @@
wrapArr[ind][0]=item wrapArr[ind][0]=item
}else if(item.mgroup_name=='原料磨'){ }else if(item.mgroup_name=='原料磨'){
wrapArr[ind][1]=item wrapArr[ind][1]=item
}else if(item.mgroup_name=='生料工序(二次配料)'){
wrapArr[ind][4]=item
}else if(item.mgroup_name=='原料压缩空气'){ }else if(item.mgroup_name=='原料压缩空气'){
wrapArr[ind][2]=item wrapArr[ind][2]=item
wrapArr[ind][3]=item wrapArr[ind][3]=item
@ -262,7 +268,7 @@
} }
}); });
// debugger; // debugger;
// console.log(wrapArr); console.log(wrapArr, "-----------wrapArr");
wrapArr.forEach((item1)=>{ wrapArr.forEach((item1)=>{
//item1------ //item1------
if(item1!=undefined){ if(item1!=undefined){
@ -330,6 +336,12 @@
itemArr.push(0) itemArr.push(0)
} }
} }
if (item1[4]){
itemArr.push( item1[4].elec_consume)
itemArr.push( item1[4].elec_coal_consume)
itemArr.push( item1[4].total_production)
itemArr.push( item1[4].en_consume_unit)
}
innerArr.push(itemArr) innerArr.push(itemArr)
} }
}) })

View File

@ -2,6 +2,19 @@
<div class="app-container"> <div class="app-container">
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-date-picker
v-model="query.year_s"
type="year"
value-format="YYYY"
format="YYYY"
placeholder="查询年份"
class="headerSearch"
/>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
<el-button <el-button
type="primary" type="primary"
@click="exportExcel()" @click="exportExcel()"
@ -125,6 +138,7 @@ export default {
year_s: "", year_s: "",
tableDatas: [], tableDatas: [],
optionMonth:{}, optionMonth:{},
query: {"year_s":""},
option1: { option1: {
color: colors, color: colors,
tooltip: tooltip, tooltip: tooltip,
@ -156,30 +170,40 @@ export default {
let that = this; let that = this;
var myDate = new Date(); var myDate = new Date();
let year = myDate.getFullYear(); let year = myDate.getFullYear();
that.year_s = year; that.query.year_s = year;
this.getData(); this.getData();
let month = (that.month = myDate.getMonth() + 1); let month = (that.month = myDate.getMonth() + 1);
}, },
methods: { methods: {
handleQuery() {
this.tableDatas = [];
this.getData();
},
getData() { getData() {
let that = this; let that = this;
let wrapArr = [], let wrapArr = [],
wrapArr2 = []; wrapArr2 = [];
let obj = {}; let obj = {};
obj.year_s = this.year_s - 1; obj.year_s = that.query.year_s - 1;
obj.page = 0; obj.page = 0;
obj.type = 'month_s'; obj.type = 'month_s';
that.$API.enm.enstat2.req(obj).then((res) => { that.$API.enm.enstat2.req(obj).then((res) => {
if (res.length > 0) { if (res.length > 0) {
res.forEach((item) => { res.forEach((item) => {
let ind = item.month_s - 1; let ind = 0;
wrapArr[ind] = item; // if (item.month_s == 1){
ind = 12;
wrapArr[ind] = item; //
}else{
ind = item.month_s;
wrapArr[ind] = item
}
}); });
} else { } else {
wrapArr = []; wrapArr = [];
} }
let obj2 = {}; let obj2 = {};
obj2.year_s = this.year_s; obj2.year_s = that.query.year_s;
obj2.page = 0; obj2.page = 0;
obj2.type = 'month_s'; obj2.type = 'month_s';
that.$API.enm.enstat2.req(obj2).then((res2) => { that.$API.enm.enstat2.req(obj2).then((res2) => {
@ -212,6 +236,7 @@ export default {
hValue3 = 0, hValue3 = 0,
tPercent3 = 0, tPercent3 = 0,
hPercent3 = 0; hPercent3 = 0;
console.log(wrapArr2[i].month_s, ".month_s")
if (wrapArr2[i].month_s > 1 && i>0) { if (wrapArr2[i].month_s > 1 && i>0) {
tValue3 = wrapArr2[i - 1] tValue3 = wrapArr2[i - 1]
? wrapArr2[i - 1].en_consume ? wrapArr2[i - 1].en_consume
@ -327,7 +352,7 @@ export default {
let options = { ...that.option1 }; let options = { ...that.option1 };
options.series[0].data = seriesData0; options.series[0].data = seriesData0;
let monthXAxis = []; let monthXAxis = [];
for (let i = 1; i <= that.month; i++) { for (let i = 1; i <= 12; i++) {
let item = i + "月"; let item = i + "月";
monthXAxis.push(item); monthXAxis.push(item);
} }

View File

@ -759,9 +759,10 @@ export default {
} }
seriesData[index][ind] = item.elec_consume_unit; seriesData[index][ind] = item.elec_consume_unit;
}); });
let options = { ...that.option3 };
options.legend.data = []; options.legend.data = [];
options.series = []; options.series = [];
let options = { ...that.option3 };
for (let j = 0; j < that.mpoints.length; j++) { for (let j = 0; j < that.mpoints.length; j++) {
let chartItem = {}; let chartItem = {};
chartItem.name = that.mpoints[j]; chartItem.name = that.mpoints[j];

View File

@ -288,7 +288,7 @@
</div> </div>
</template> </template>
<script> <script>
const colors = ["#5b9bd5", "#ed7d31", "#70ad47", "#ffc000", "#5f6694", "#cb9bff"]; const colors = ["#5b9bd5", "#ed7d31", "#70ad47", "#ffc000", "#5f6694", "#cb9bff", "#7DDA58"];
// ///// // /////
let tooltip = { let tooltip = {
show: true, show: true,
@ -438,6 +438,184 @@ let yAxis = [
// }, // },
}, },
]; ];
let yAxis_hour = [
{
type: "value",
name: "产量 (t)",
position: "left",
alignTicks: true,
nameRotate: 50,
axisLine: {
show: true,
lineStyle: {
color: colors[0],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "熟料分布电耗(kW·h/t)",
position: "right",
alignTicks: true,
nameRotate: 50,
axisLine: {
show: true,
lineStyle: {
color: colors[3],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "熟料标煤耗(kgce/t)",
position: "right",
alignTicks: true,
nameRotate: 50,
offset: 50,
axisLine: {
show: true,
lineStyle: {
color: colors[4],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "熟料单位成本(元/吨)",
position: "left",
alignTicks: true,
nameRotate: 50,
offset: 50,
axisLine: {
show: true,
lineStyle: {
color: colors[5],
},
},
},
];
let yAxis_month = [
{
type: "value",
name: "产量 (t)",
position: "left",
alignTicks: true,
nameRotate: 50,
axisLine: {
show: true,
lineStyle: {
color: colors[0],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "台时产量 (t/h)",
position: "left",
alignTicks: true,
nameRotate: 50,
axisLine: {
show: true,
lineStyle: {
color: colors[1],
},
},
offset: 100,
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "回转窑运转率(%) ",
position: "right",
alignTicks: true,
nameRotate: 50,
offset: 100,
axisLine: {
show: true,
lineStyle: {
color: colors[2],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "熟料分布电耗(kW·h/t)",
position: "right",
alignTicks: true,
nameRotate: 50,
axisLine: {
show: true,
lineStyle: {
color: colors[3],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "熟料标煤耗(kgce/t)",
position: "right",
alignTicks: true,
nameRotate: 50,
offset: 50,
axisLine: {
show: true,
lineStyle: {
color: colors[4],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "熟料单位成本(元/吨)",
position: "left",
alignTicks: true,
nameRotate: 50,
offset: 50,
axisLine: {
show: true,
lineStyle: {
color: colors[5],
},
},
},
{
type: "value",
name: "分布电耗目标值",
position: "left",
alignTicks: true,
nameRotate: 50,
offset: 150,
axisLine: {
show: true,
lineStyle: {
color: colors[6],
},
},
}
];
import scEcharts from "@/components/scEcharts"; import scEcharts from "@/components/scEcharts";
import { defineAsyncComponent } from "vue"; import { defineAsyncComponent } from "vue";
export default { export default {
@ -457,6 +635,7 @@ export default {
timeStamp: null, timeStamp: null,
optionHour: {}, optionHour: {},
optionDay: {}, optionDay: {},
goal_list: [],
optionMonth: {}, optionMonth: {},
year: 2023, year: 2023,
month: 1, month: 1,
@ -502,7 +681,7 @@ export default {
}, },
data: [], data: [],
}, },
yAxis: yAxis, yAxis: yAxis_hour,
series: [ series: [
{ {
name: "回转窑总产量", name: "回转窑总产量",
@ -510,34 +689,22 @@ export default {
yAxisIndex: 0, yAxisIndex: 0,
data: [], data: [],
}, },
{
name: "台时产量",
type: "bar",
yAxisIndex: 0,
data: [],
},
{
name: "回转窑运转率",
type: "line",
yAxisIndex: 1,
data: [],
},
{ {
name: "熟料分布电耗", name: "熟料分布电耗",
type: "bar", type: "bar",
yAxisIndex: 2, yAxisIndex: 1,
data: [], data: [],
}, },
{ {
name: "熟料标煤耗", name: "熟料标煤耗",
type: "bar", type: "bar",
yAxisIndex: 3, yAxisIndex: 2,
data: [], data: [],
}, },
{ {
name: "熟料单位成本", name: "熟料单位成本",
type: "bar", type: "bar",
yAxisIndex: 4, yAxisIndex: 3,
data: [], data: [],
}, },
], ],
@ -547,7 +714,7 @@ export default {
tooltip: tooltip, tooltip: tooltip,
grid: grid, grid: grid,
toolbox: toolbox, toolbox: toolbox,
legend: legend, legend: Object.assign(legend, {data: ["回转窑总产量", "台时产量", "回转窑运转率", "熟料分布电耗", "熟料标煤耗", "熟料单位成本"]}),
xAxis: { xAxis: {
axisTick: { axisTick: {
show: true, show: true,
@ -615,7 +782,7 @@ export default {
tooltip: tooltip, tooltip: tooltip,
grid: grid, grid: grid,
toolbox: toolbox, toolbox: toolbox,
legend: legend, legend: Object.assign(legend, {data: ["回转窑总产量", "台时产量", "回转窑运转率", "熟料分布电耗", "熟料标煤耗", "熟料单位成本","分布电耗目标值"]}),
xAxis: { xAxis: {
axisTick: { axisTick: {
show: true, show: true,
@ -624,7 +791,7 @@ export default {
}, },
data: [], data: [],
}, },
yAxis: yAxis, yAxis: yAxis_month,
series: [ series: [
{ {
name: "回转窑总产量", name: "回转窑总产量",
@ -662,6 +829,12 @@ export default {
yAxisIndex: 5, yAxisIndex: 5,
data: [], data: [],
}, },
{
name: "分布电耗目标值",
type: "line",
yAxisIndex: 6,
data: [],
},
], ],
}, },
}; };
@ -1063,9 +1236,9 @@ export default {
options.series[0].data = seriesData0; options.series[0].data = seriesData0;
// options.series[1].data = seriesData1; // options.series[1].data = seriesData1;
// options.series[2].data = seriesData2; // options.series[2].data = seriesData2;
options.series[3].data = seriesData3; options.series[1].data = seriesData3;
options.series[4].data = seriesData4; options.series[2].data = seriesData4;
options.series[5].data = seriesData5; options.series[3].data = seriesData5;
let hourXAxis = []; let hourXAxis = [];
for (let i = 0; i < 24; i++) { for (let i = 0; i < 24; i++) {
let item = i + "时"; let item = i + "时";
@ -1120,6 +1293,26 @@ export default {
// //
getMonthData(year) { getMonthData(year) {
let that = this; let that = this;
let params5 = {};
params5.page = 0;
params5.year = year;
params5.mgroup = that.query.mgroup;
this.$API.mtm.goal.list
.req(params5)
.then((res5) => {
if (res5.length > 0) {
let data5 = res5;
data5.forEach((item5) => {
if (
item5.goal_cate_name ==
"单位产品分布电耗kW·h/t"
) {
that.goal_list.push(item5);
}
});
}
}).then(() => {
let query2 = {}; let query2 = {};
query2.page = 0; query2.page = 0;
query2.year_s = year; query2.year_s = year;
@ -1131,9 +1324,11 @@ export default {
seriesData2 = [], seriesData2 = [],
seriesData3 = [], seriesData3 = [],
seriesData4 = [], seriesData4 = [],
seriesData5 = []; seriesData5 = [],
seriesData6 = [];
let data = response; let data = response;
data.forEach((item) => { data.forEach((item) => {
let goal_index = 'goal_val_' + item.month_s;
let ind = item.month_s - 1; let ind = item.month_s - 1;
seriesData0[ind] = item.total_production; seriesData0[ind] = item.total_production;
seriesData1[ind] = item.production_hour; seriesData1[ind] = item.production_hour;
@ -1141,6 +1336,7 @@ export default {
seriesData3[ind] = item.elec_consume_unit; seriesData3[ind] = item.elec_consume_unit;
seriesData4[ind] = item.coal_consume_unit; seriesData4[ind] = item.coal_consume_unit;
seriesData5[ind] = item.production_cost_unit; seriesData5[ind] = item.production_cost_unit;
seriesData6[ind] = that.goal_list[0][goal_index];
}); });
let options = { ...that.option3 }; let options = { ...that.option3 };
options.series[0].data = seriesData0; options.series[0].data = seriesData0;
@ -1149,7 +1345,11 @@ export default {
options.series[3].data = seriesData3; options.series[3].data = seriesData3;
options.series[4].data = seriesData4; options.series[4].data = seriesData4;
options.series[5].data = seriesData5; options.series[5].data = seriesData5;
options.series[6].data = seriesData6;
let monthXAxis = []; let monthXAxis = [];
if (year < that.year){
that.month = 12;
}
for (let i = 1; i <= that.month; i++) { for (let i = 1; i <= that.month; i++) {
let item = i + "月"; let item = i + "月";
monthXAxis.push(item); monthXAxis.push(item);
@ -1157,6 +1357,8 @@ export default {
options.xAxis.data = monthXAxis; options.xAxis.data = monthXAxis;
that.optionMonth = options; that.optionMonth = options;
}); });
})
}, },
itemClick(type, item) { itemClick(type, item) {
this.type = type; this.type = type;

View File

@ -274,7 +274,7 @@
</div> </div>
</template> </template>
<script> <script>
const colors = ["#5b9bd5", "#ed7d31", "#70ad47", "#ffc000", "#cb9bff"]; const colors = ["#5b9bd5", "#ed7d31", "#70ad47", "#ffc000", "#cb9bff", "#7DDA58"];
let tooltip = { let tooltip = {
show: true, show: true,
trigger: "axis", trigger: "axis",
@ -308,8 +308,9 @@ let legend = {
title: '反选' title: '反选'
} }
], ],
width: "500px",
top: "2%", top: "2%",
data: ["水泥磨总产量", "水泥磨台时产量", "水泥磨运转率", "分布电耗", "水泥单位成本"], data: ["水泥磨总产量", "分布电耗", "水泥单位成本"],
}; };
let yAxis = [ let yAxis = [
{ {
@ -380,6 +381,178 @@ let yAxis = [
}, },
}, },
]; ];
let yAxis_month = [
{
type: "value",
name: "产量 (t)",
position: "left",
alignTicks: true,
nameRotate: 30,
axisLine: {
show: true,
lineStyle: {
color: colors[0],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "水泥磨运转率(%)",
position: "right",
alignTicks: true,
nameRotate: 30,
offset: 80,
max:100,
axisLine: {
show: true,
lineStyle: {
color: colors[1],
},
},
axisLabel: {
formatter: "{value}",
},
},{
type: "value",
name: "水泥磨台时产量",
position: "right",
alignTicks: true,
nameRotate: 30,
offset: 80,
max:100,
axisLine: {
show: true,
lineStyle: {
color: colors[2],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "水泥磨运转率(%)",
position: "right",
alignTicks: true,
nameRotate: 30,
offset: 80,
max:100,
axisLine: {
show: true,
lineStyle: {
color: colors[3],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "分布电耗(kW·h/t)",
position: "right",
alignTicks: true,
nameRotate: 30,
axisLine: {
show: true,
lineStyle: {
color: colors[3],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "水泥单位成本(元/吨)",
position: "left",
alignTicks: true,
nameRotate: 30,
offset: 50,
axisLine: {
show: true,
lineStyle: {
color: colors[4],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "分布电耗目标值",
position: "left",
alignTicks: true,
nameRotate: 30,
offset: 90,
axisLine: {
show: true,
lineStyle: {
color: colors[5],
},
},
axisLabel: {
formatter: "{value}",
},
},
];
let yAxis_hour = [
{
type: "value",
name: "产量 (t)",
position: "left",
alignTicks: true,
nameRotate: 30,
axisLine: {
show: true,
lineStyle: {
color: colors[0],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "分布电耗(kW·h/t)",
position: "right",
alignTicks: true,
nameRotate: 30,
axisLine: {
show: true,
lineStyle: {
color: colors[3],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "水泥单位成本(元/吨)",
position: "left",
alignTicks: true,
nameRotate: 30,
offset: 70,
axisLine: {
show: true,
lineStyle: {
color: colors[4],
},
},
axisLabel: {
formatter: "{value}",
},
},
];
import scEcharts from "@/components/scEcharts"; import scEcharts from "@/components/scEcharts";
import { defineAsyncComponent } from "vue"; import { defineAsyncComponent } from "vue";
export default { export default {
@ -400,6 +573,7 @@ export default {
optionHour: {}, optionHour: {},
optionDay: {}, optionDay: {},
optionMonth: {}, optionMonth: {},
goal_list : [],
year: 2023, year: 2023,
month: 1, month: 1,
days: 1, days: 1,
@ -440,7 +614,7 @@ export default {
}, },
data: [], data: [],
}, },
yAxis: yAxis, yAxis: yAxis_hour,
series: [ series: [
{ {
name: "水泥磨总产量", name: "水泥磨总产量",
@ -448,28 +622,16 @@ export default {
yAxisIndex: 0, yAxisIndex: 0,
data: [], data: [],
}, },
{
name: "水泥磨台时产量",
type: "bar",
yAxisIndex: 0,
data: [],
},
{
name: "水泥磨运转率",
type: "line",
yAxisIndex: 1,
data: [],
},
{ {
name: "分布电耗", name: "分布电耗",
type: "bar", type: "bar",
yAxisIndex: 2, yAxisIndex: 1,
data: [], data: [],
}, },
{ {
name: "水泥单位成本", name: "水泥单位成本",
type: "bar", type: "bar",
yAxisIndex: 3, yAxisIndex: 2,
data: [], data: [],
}, },
], ],
@ -479,7 +641,7 @@ export default {
tooltip: tooltip, tooltip: tooltip,
grid: grid, grid: grid,
toolbox: toolbox, toolbox: toolbox,
legend: legend, legend: Object.assign(legend, {data: ["水泥磨总产量", "水泥磨台时产量", "水泥磨运转率","分布电耗","水泥单位成本"]}),
xAxis: { xAxis: {
axisTick: { axisTick: {
show: true, show: true,
@ -527,7 +689,7 @@ export default {
tooltip: tooltip, tooltip: tooltip,
grid: grid, grid: grid,
toolbox: toolbox, toolbox: toolbox,
legend: legend, legend: Object.assign(legend, {data: ["水泥磨总产量", "水泥磨台时产量", "水泥磨运转率","分布电耗","水泥单位成本", "分布电耗目标值"]}),
xAxis: { xAxis: {
axisTick: { axisTick: {
show: true, show: true,
@ -549,7 +711,7 @@ export default {
"十二月", "十二月",
], ],
}, },
yAxis: yAxis, yAxis: yAxis_month,
series: [ series: [
{ {
name: "水泥磨总产量", name: "水泥磨总产量",
@ -560,25 +722,31 @@ export default {
{ {
name: "水泥磨台时产量", name: "水泥磨台时产量",
type: "bar", type: "bar",
yAxisIndex: 0, yAxisIndex: 1,
data: [], data: [],
}, },
{ {
name: "水泥磨运转率", name: "水泥磨运转率",
type: "line", type: "line",
yAxisIndex: 1, yAxisIndex: 2,
data: [], data: [],
}, },
{ {
name: "分布电耗", name: "分布电耗",
type: "bar", type: "bar",
yAxisIndex: 2, yAxisIndex: 3,
data: [], data: [],
}, },
{ {
name: "水泥单位成本", name: "水泥单位成本",
type: "bar", type: "bar",
yAxisIndex: 3, yAxisIndex: 4,
data: [],
},
{
name: "分布电耗目标值",
type: "line",
yAxisIndex: 5,
data: [], data: [],
}, },
], ],
@ -921,8 +1089,8 @@ export default {
options.series[0].data = seriesData0; options.series[0].data = seriesData0;
// options.series[1].data = seriesData1; // options.series[1].data = seriesData1;
// options.series[2].data = seriesData2; // options.series[2].data = seriesData2;
options.series[3].data = seriesData4; options.series[1].data = seriesData4;
options.series[4].data = seriesData3; options.series[2].data = seriesData3;
let hourXAxis = []; let hourXAxis = [];
for (let i = 0; i < 24; i++) { for (let i = 0; i < 24; i++) {
let item = i + "时"; let item = i + "时";
@ -974,7 +1142,27 @@ export default {
// //
getMonthData(year) { getMonthData(year) {
let that = this; let that = this;
let query2 = {}; let params5 = {};
params5.page = 0;
params5.year = year;
params5.mgroup = that.query.mgroup;
this.$API.mtm.goal.list
.req(params5)
.then((res5) => {
if (res5.length > 0) {
let data5 = res5;
data5.forEach((item5) => {
if (
item5.goal_cate_name ==
"单位产品分布电耗kW·h/t"
) {
that.goal_list.push(item5);
}
});
}
}).then(() => {
let query2 = {};
query2.page = 0; query2.page = 0;
query2.year_s = year; query2.year_s = year;
query2.type = "month_s"; query2.type = "month_s";
@ -984,15 +1172,18 @@ export default {
seriesData1 = [], seriesData1 = [],
seriesData2 = [], seriesData2 = [],
seriesData3 = [], seriesData3 = [],
seriesData4 = []; seriesData4 = [],
seriesData5 = [];
let data = response; let data = response;
data.forEach((item) => { data.forEach((item) => {
let goal_index = 'goal_val_' + item.month_s;
let ind = item.month_s - 1; let ind = item.month_s - 1;
seriesData0[ind] = item.total_production; seriesData0[ind] = item.total_production;
seriesData1[ind] = item.production_hour; seriesData1[ind] = item.production_hour;
seriesData2[ind] = item.run_rate; seriesData2[ind] = item.run_rate;
seriesData3[ind] = item.production_cost_unit; seriesData3[ind] = item.production_cost_unit;
seriesData4[ind] = item.elec_consume_unit; seriesData4[ind] = item.elec_consume_unit;
seriesData5[ind] = that.goal_list[0][goal_index];
}); });
let options = { ...that.option3 }; let options = { ...that.option3 };
options.series[0].data = seriesData0; options.series[0].data = seriesData0;
@ -1000,7 +1191,11 @@ export default {
options.series[2].data = seriesData2; options.series[2].data = seriesData2;
options.series[3].data = seriesData4; options.series[3].data = seriesData4;
options.series[4].data = seriesData3; options.series[4].data = seriesData3;
options.series[5].data = seriesData5;
let monthXAxis = []; let monthXAxis = [];
if (year < that.year){
that.month = 12;
}
for (let i = 1; i <= that.month; i++) { for (let i = 1; i <= that.month; i++) {
let item = i + "月"; let item = i + "月";
monthXAxis.push(item); monthXAxis.push(item);
@ -1008,6 +1203,8 @@ export default {
options.xAxis.data = monthXAxis; options.xAxis.data = monthXAxis;
that.optionMonth = options; that.optionMonth = options;
}); });
})
}, },
itemClick(type, item) { itemClick(type, item) {
this.type = type; this.type = type;
@ -1018,7 +1215,7 @@ export default {
this.chartShow = false; this.chartShow = false;
this.$API.bi.dataset.exec.req("3322567213885833216").then((res) => { this.$API.bi.dataset.exec.req("3322567213885833216").then((res) => {
this.myOption = JSON.parse(res.echart_options); this.myOption = JSON.parse(res.echart_options);
debugger;
console.log(this.myOption); console.log(this.myOption);
this.chartShow = true; this.chartShow = true;
}); });

View File

@ -244,7 +244,7 @@
</div> </div>
</template> </template>
<script> <script>
const colors = ["#5b9bd5", "#cbd3fe", "#91CC75", "#EE6666", "#CC00CC", "#551e13"]; const colors = ["#5b9bd5", "#cbd3fe", "#91CC75", "#EE6666", "#CC00CC", "#7DDA58"];
let tooltip = { let tooltip = {
show: true, show: true,
trigger: "axis", trigger: "axis",
@ -335,6 +335,7 @@ export default {
myOption: null, myOption: null,
optionDay: {}, optionDay: {},
optionMonth: {}, optionMonth: {},
goal_list:[],
year: 2023, year: 2023,
month: 1, month: 1,
days: 1, days: 1,
@ -387,15 +388,11 @@ export default {
}, },
yAxis: yAxis, yAxis: yAxis,
selector:[{ selector:[{
//
type: 'all', type: 'all',
// title: '全选'
title: '全选'
}, },
{ {
//
type: 'inverse', type: 'inverse',
//
title: '反选' title: '反选'
}], }],
selector: true, selector: true,
@ -431,12 +428,13 @@ export default {
data: [], data: [],
}, },
], ],
}, },
option2: { option2: {
color: colors, color: colors,
tooltip: tooltip, tooltip: tooltip,
legend: legend, legend: Object.assign(legend, {data:["袋装合计", "散装合计", "熟料出厂合计", "出厂水泥合计", "复合水泥合计", "分布电耗目标值"]}),
grid: grid, grid: grid,
toolbox: toolbox, toolbox: toolbox,
xAxis: { xAxis: {
@ -492,6 +490,12 @@ export default {
yAxisIndex: 0, yAxisIndex: 0,
data: [], data: [],
}, },
{
name: "分布电耗目标值",
type: "line",
yAxisIndex: 0,
data: [],
},
], ],
}, },
}; };
@ -772,7 +776,27 @@ export default {
//- //-
getMonthData(year) { getMonthData(year) {
let that = this; let that = this;
let query2 = {}; let params5 = {};
params5.page = 0;
params5.year = year;
params5.mgroup = that.query.mgroup;
this.$API.mtm.goal.list
.req(params5)
.then((res5) => {
if (res5.length > 0) {
let data5 = res5;
data5.forEach((item5) => {
if (
item5.goal_cate_name ==
"单位产品分布电耗kW·h/t"
) {
that.goal_list.push(item5);
}
});
}
}).then(() => {
let query2 = {};
query2.page = 0; query2.page = 0;
query2.year_s = year; query2.year_s = year;
query2.type = "month_s"; query2.type = "month_s";
@ -783,10 +807,12 @@ export default {
seriesData2 = [], seriesData2 = [],
seriesData3 = [], seriesData3 = [],
seriesData4 = [], seriesData4 = [],
seriesData5 = []; seriesData5 = [],
seriesData6 = [];
let data = response; let data = response;
data.forEach((item) => { data.forEach((item) => {
let goal_index = 'goal_val_' + item.month_s;
let ind = item.month_s - 1; let ind = item.month_s - 1;
if (item.mpoint_name == "袋装水泥总和") { if (item.mpoint_name == "袋装水泥总和") {
seriesData1[ind] = item.val; seriesData1[ind] = item.val;
@ -800,6 +826,7 @@ export default {
console.log(item.mpoint_name, item.val); console.log(item.mpoint_name, item.val);
seriesData5[ind] = item.val; seriesData5[ind] = item.val;
} }
seriesData6[ind] = that.goal_list[0][goal_index];
}); });
let options = { ...that.option2 }; let options = { ...that.option2 };
options.series[0].data = seriesData1; options.series[0].data = seriesData1;
@ -807,8 +834,12 @@ export default {
options.series[2].data = seriesData3; options.series[2].data = seriesData3;
options.series[3].data = seriesData4; options.series[3].data = seriesData4;
options.series[4].data = seriesData5; options.series[4].data = seriesData5;
options.series[5].data = seriesData6;
let monthXAxis = []; let monthXAxis = [];
if (year < that.year){
that.month = 12;
}
for (let i = 1; i <= that.month; i++) { for (let i = 1; i <= that.month; i++) {
let item = i + "月"; let item = i + "月";
monthXAxis.push(item); monthXAxis.push(item);
@ -816,6 +847,8 @@ export default {
options.xAxis.data = monthXAxis; options.xAxis.data = monthXAxis;
that.optionMonth = options; that.optionMonth = options;
}); });
})
}, },
itemClick(type, item) { itemClick(type, item) {
this.type = type; this.type = type;

View File

@ -136,9 +136,11 @@ export default {
if (data0.length > 0) { if (data0.length > 0) {
data0.forEach((item0) => { data0.forEach((item0) => {
// //
let n0 = item0.month_s; let month = item0.month_s;
let ind0 = 0; if (!wrapArr0[month]) {
wrapArr0[ind0] = item0; wrapArr0[month] = [];
}
wrapArr0[month].push(item0);
}); });
} else {} } else {}
@ -178,22 +180,30 @@ export default {
arr[3] = item.elec_consume_unit; //kW·h/t arr[3] = item.elec_consume_unit; //kW·h/t
let keyVale = "goal_val_" + n; let keyVale = "goal_val_" + n;
arr[4] = goalData[keyVale]; //kW·h/t// if (goalData && goalData[keyVale]){
arr[4] = goalData[keyVale].goal_val_1;
}else{arr[4] = 0; //
}
arr[5] = (arr[3] - arr[4]).toFixed(2); //kW·h/t arr[5] = (arr[3] - arr[4]).toFixed(2); //kW·h/t
let ind_pre = 0, let ind_pre = 0,
huanbi = 0; huanbi = 0;
if (item.month_s == 1) { if (n == 1) {
ind_pre = 12; ind_pre = 12;
huanbi = wrapArr0[ind_pre] if (wrapArr0[ind_pre]) {
? wrapArr0[ind_pre].elec_consume_unit wrapArr0[ind_pre].forEach((item0) => {
: "/"; if (item0.team_name == item.team_name) {
} else { huanbi = item0.elec_consume_unit;
// wrapArr0wrapArritem.month_s1 item.namehuanbi }
compareArr0.forEach((item0) => { });
if (item0[0] == item.month_s - 1 && item0[1] == item.team_name) {
huanbi = item0[2];
} }
}) } else {
// wrapArr0wrapArritem.month_s1 item.namehuanbi
compareArr0.forEach((item0) => {
if (item0[0] == item.month_s - 1 && item0[1] == item.team_name) {
huanbi = item0[2];
}
})
} }
arr[6] =Number(huanbi); //kW·h/t\ arr[6] =Number(huanbi); //kW·h/t\
if (arr[6] !== "/"){ if (arr[6] !== "/"){

View File

@ -312,7 +312,8 @@ let legend = {
} }
], ],
top: "2%", top: "2%",
data: ["立磨总产量", "立磨台时产量", "立磨运转率", "分布电耗"], width: "500px",
data: ["立磨总产量", "立磨台时产量", "立磨运转率", "分布电耗", "分布电耗目标值"],
}; };
let yAxis = [ let yAxis = [
{ {
@ -380,6 +381,90 @@ let yAxis = [
formatter: "{value}", formatter: "{value}",
}, },
nameRotate: 50 nameRotate: 50
}
];
let yAxis_month = [
{
type: "value",
name: "产量 (t)",
position: "left",
alignTicks: true,
axisLine: {
show: true,
lineStyle: {
color: colors[0],
},
},
axisLabel: {
formatter: "{value}",
},
nameRotate: 50
},
{
type: "value",
name: "立磨台时产量 (t/h)",
position: "left",
alignTicks: true,
nameRotate: 50,
axisLine: {
show: true,
lineStyle: {
color: colors[1],
},
},
offset: 50,
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "立磨运转率 (%)",
position: "right",
alignTicks: true,
offset: 50,
axisLine: {
show: true,
lineStyle: {
color: colors[2],
},
},
axisLabel: {
formatter: "{value}",
},
nameRotate: 50
},
{
type: "value",
name: "分布电耗(kW·h)",
position: "right",
alignTicks: true,
axisLine: {
show: true,
lineStyle: {
color: colors[3],
},
},
axisLabel: {
formatter: "{value}",
},
nameRotate: 50
},
{
type: "value",
name: "分布电耗目标值",
position: "right",
alignTicks: true,
axisLine: {
show: true,
lineStyle: {
color: colors[4],
},
},
axisLabel: {
formatter: "{value}",
},
nameRotate: 50
}, },
]; ];
import * as echarts from "echarts"; import * as echarts from "echarts";
@ -497,7 +582,7 @@ export default {
tooltip: tooltip, tooltip: tooltip,
grid: grid, grid: grid,
toolbox: toolbox, toolbox: toolbox,
legend: legend, legend: Object.assign(legend, {data: ["立磨总产量", "立磨台时产量", "立磨运转率", "分布电耗"]}),
xAxis: { xAxis: {
axisTick: { axisTick: {
show: true, show: true,
@ -531,19 +616,19 @@ export default {
{ {
name: "立磨台时产量", name: "立磨台时产量",
type: "bar", type: "bar",
yAxisIndex: 0, yAxisIndex: 1,
data: [], data: [],
}, },
{ {
name: "立磨运转率", name: "立磨运转率",
type: "line", type: "line",
yAxisIndex: 1, yAxisIndex: 2,
data: [], data: [],
}, },
{ {
name: "分布电耗", name: "分布电耗",
type: "bar", type: "bar",
yAxisIndex: 2, yAxisIndex: 3,
data: [], data: [],
}, },
], ],
@ -553,7 +638,7 @@ export default {
tooltip: tooltip, tooltip: tooltip,
grid: grid, grid: grid,
toolbox: toolbox, toolbox: toolbox,
legend: legend, legend: Object.assign(legend, {data: ["立磨总产量", "立磨台时产量", "立磨运转率", "分布电耗", "分布电耗目标值"]}),
xAxis: { xAxis: {
axisTick: { axisTick: {
show: true, show: true,
@ -576,7 +661,7 @@ export default {
"十二月", "十二月",
], ],
}, },
yAxis: yAxis, yAxis: yAxis_month,
series: [ series: [
{ {
name: "立磨总产量", name: "立磨总产量",
@ -587,26 +672,33 @@ export default {
{ {
name: "立磨台时产量", name: "立磨台时产量",
type: "bar", type: "bar",
yAxisIndex: 0, yAxisIndex: 1,
data: [], data: [],
}, },
{ {
name: "立磨运转率", name: "立磨运转率",
type: "line", type: "line",
yAxisIndex: 1, yAxisIndex: 2,
data: [], data: [],
}, },
{ {
name: "分布电耗", name: "分布电耗",
type: "bar", type: "bar",
yAxisIndex: 2, yAxisIndex: 3,
data: [], data: [],
}, },
{
name: "分布电耗目标值",
type: "line",
yAxisIndex: 4,
data: [],
}
], ],
}, },
dataX: [], dataX: [],
dataY: [], dataY: [],
dataY2: [], dataY2: [],
goal_list: [],
option: { option: {
color: [ color: [
"#647bfe", "#647bfe",
@ -1131,30 +1223,58 @@ export default {
// //
getMonthData(year) { getMonthData(year) {
let that = this; let that = this;
let query2 = {}; let params5 = {};
params5.page = 0;
params5.year = year;
params5.mgroup = that.query.mgroup;
this.$API.mtm.goal.list
.req(params5)
.then((res5) => {
if (res5.length > 0) {
let data5 = res5;
data5.forEach((item5) => {
if (
item5.goal_cate_name ==
"单位产品分布电耗kW·h/t"
) {
that.goal_list.push(item5);
}
});
}
}).then(() => {
let query2 = {};
query2.page = 0; query2.page = 0;
query2.year_s = year; query2.year_s = year;
query2.type = "month_s"; query2.type = "month_s";
query2.mgroup = that.query.mgroup; query2.mgroup = that.query.mgroup;
this.$API.enm.enstat.req(query2).then((response) => { this.$API.enm.enstat.req(query2).then((response) => {
let seriesData0 = [], let seriesData0 = [],
seriesData1 = [], seriesData1 = [],
seriesData2 = [], seriesData2 = [],
seriesData3 = []; seriesData3 = [],
seriesData4 = [];
let data = response; let data = response;
data.forEach((item) => { data.forEach((item) => {
let goal_index = 'goal_val_' + item.month_s;
let ind = item.month_s - 1; let ind = item.month_s - 1;
seriesData0[ind] = item.total_production; seriesData0[ind] = item.total_production;
seriesData1[ind] = Number(item.production_hour).toFixed(2); seriesData1[ind] = Number(item.production_hour).toFixed(2);
seriesData2[ind] = item.run_rate; seriesData2[ind] = item.run_rate;
seriesData3[ind] = item.elec_consume_unit; seriesData3[ind] = item.elec_consume_unit;
seriesData4[ind] = that.goal_list[0][goal_index];
}); });
let options = { ...that.option3 }; let options = { ...that.option3 };
options.series[0].data = seriesData0; options.series[0].data = seriesData0;
options.series[1].data = seriesData1; options.series[1].data = seriesData1;
options.series[2].data = seriesData2; options.series[2].data = seriesData2;
options.series[3].data = seriesData3; options.series[3].data = seriesData3;
options.series[4].data = seriesData4;
let monthXAxis = []; let monthXAxis = [];
if (year < that.year){
that.month = 12;
}
for (let i = 1; i <= that.month; i++) { for (let i = 1; i <= that.month; i++) {
let item = i + "月"; let item = i + "月";
monthXAxis.push(item); monthXAxis.push(item);
@ -1162,6 +1282,8 @@ export default {
options.xAxis.data = monthXAxis; options.xAxis.data = monthXAxis;
that.optionMonth = options; that.optionMonth = options;
}); });
});
}, },
itemClick(type, item) { itemClick(type, item) {
this.type = type; this.type = type;

View File

@ -275,7 +275,7 @@
</div> </div>
</template> </template>
<script> <script>
const colors = ["#5b9bd5", "#ed7d31", "#70ad47", "#ffc000", "#cb9bff"]; const colors = ["#5b9bd5", "#ed7d31", "#70ad47", "#ffc000", "#cb9bff", "#7DDA58"];
let tooltip = { let tooltip = {
show: true, show: true,
trigger: "axis", trigger: "axis",
@ -301,6 +301,16 @@ let toolbox = {
orient: "vertical", orient: "vertical",
}; };
let legend = { let legend = {
selector: [
{
type: 'all',
title: '全选'
},
{
type: 'inverse',
title: '反选'
}
],
top: "2%", top: "2%",
data: ["生料总产量", "生料台时产量", "生料运转率", "分布电耗", "成本"], data: ["生料总产量", "生料台时产量", "生料运转率", "分布电耗", "成本"],
}; };
@ -389,6 +399,108 @@ let yAxis = [
nameRotate: 50 nameRotate: 50
}, },
]; ];
let yAxis_month = [
{
type: "value",
name: "产量 (t)",
position: "left",
alignTicks: true,
axisLine: {
show: true,
lineStyle: {
color: colors[0],
},
},
axisLabel: {
formatter: "{value}",
},
nameRotate: 50
},
{
type: "value",
name: "生料台时产量 (t/h)",
position: "left",
alignTicks: true,
nameRotate: 50,
axisLine: {
show: true,
lineStyle: {
color: colors[1],
},
},
offset: 100,
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "生料运转率 (%)",
position: "right",
alignTicks: true,
offset: 50,
axisLine: {
show: true,
lineStyle: {
color: colors[2],
},
},
axisLabel: {
formatter: "{value}",
},
nameRotate: 50
},
{
type: "value",
name: "分布电耗(kW·h)",
position: "right",
alignTicks: true,
axisLine: {
show: true,
lineStyle: {
color: colors[3],
},
},
axisLabel: {
formatter: "{value}",
},
nameRotate: 50
},
{
type: "value",
name: "成本(元/吨)",
position: "left",
alignTicks: true,
offset: 50,
axisLine: {
show: true,
lineStyle: {
color: colors[4],
},
},
axisLabel: {
formatter: "{value}",
},
nameRotate: 50
},
{
type: "value",
name: "分布电耗目标值",
position: "left",
alignTicks: true,
offset: 150,
axisLine: {
show: true,
lineStyle: {
color: colors[5],
},
},
axisLabel: {
formatter: "{value}",
},
nameRotate: 50
},
];
import * as echarts from "echarts"; import * as echarts from "echarts";
import scEcharts from "@/components/scEcharts"; import scEcharts from "@/components/scEcharts";
import { defineAsyncComponent } from "vue"; import { defineAsyncComponent } from "vue";
@ -410,6 +522,7 @@ export default {
optionHour: {}, optionHour: {},
optionDay: {}, optionDay: {},
optionMonth: {}, optionMonth: {},
goal_list: [],
year: 2023, year: 2023,
month: 1, month: 1,
days: 1, days: 1,
@ -492,7 +605,7 @@ export default {
tooltip: tooltip, tooltip: tooltip,
grid: grid, grid: grid,
toolbox: toolbox, toolbox: toolbox,
legend: legend, legend: Object.assign(legend, {data: ["生料总产量", "生料台时产量", "生料运转率", "分布电耗", "成本", "分布电耗目标值"]}),
xAxis: { xAxis: {
axisTick: { axisTick: {
show: true, show: true,
@ -577,7 +690,7 @@ export default {
"十二月", "十二月",
], ],
}, },
yAxis: yAxis, yAxis: yAxis_month,
series: [ series: [
{ {
name: "生料总产量", name: "生料总产量",
@ -609,6 +722,12 @@ export default {
yAxisIndex: 3, yAxisIndex: 3,
data: [], data: [],
}, },
{
name: "分布电耗目标值",
type: "line",
yAxisIndex: 4,
data: [],
},
], ],
}, },
dataX: [], dataX: [],
@ -1174,7 +1293,27 @@ export default {
// //
getMonthData(year) { getMonthData(year) {
let that = this; let that = this;
let query2 = {}; let params5 = {};
params5.page = 0;
params5.year = year;
params5.mgroup = that.query.mgroup;
this.$API.mtm.goal.list
.req(params5)
.then((res5) => {
if (res5.length > 0) {
let data5 = res5;
data5.forEach((item5) => {
if (
item5.goal_cate_name ==
"单位产品分布电耗kW·h/t"
) {
that.goal_list.push(item5);
}
});
}
}).then(() => {
let query2 = {};
query2.page = 0; query2.page = 0;
query2.year_s = year; query2.year_s = year;
query2.type = "month_s"; query2.type = "month_s";
@ -1184,15 +1323,18 @@ export default {
seriesData1 = [], seriesData1 = [],
seriesData2 = [], seriesData2 = [],
seriesData3 = [], seriesData3 = [],
seriesData5 = [],
seriesData4 = []; seriesData4 = [];
let data = response; let data = response;
data.forEach((item) => { data.forEach((item) => {
let goal_index = 'goal_val_' + item.month_s;
let ind = item.month_s - 1; let ind = item.month_s - 1;
seriesData0[ind] = item.total_production; seriesData0[ind] = item.total_production;
seriesData1[ind] = Number(item.production_hour).toFixed(2); seriesData1[ind] = Number(item.production_hour).toFixed(2);
seriesData2[ind] = item.run_rate; seriesData2[ind] = item.run_rate;
seriesData3[ind] = item.elec_consume_unit; seriesData3[ind] = item.elec_consume_unit;
seriesData4[ind] = item.production_cost_unit; seriesData4[ind] = item.production_cost_unit;
seriesData5[ind] = that.goal_list[0][goal_index];
}); });
let options = { ...that.option3 }; let options = { ...that.option3 };
options.series[0].data = seriesData0; options.series[0].data = seriesData0;
@ -1200,7 +1342,11 @@ export default {
options.series[2].data = seriesData2; options.series[2].data = seriesData2;
options.series[3].data = seriesData3; options.series[3].data = seriesData3;
options.series[4].data = seriesData4; options.series[4].data = seriesData4;
options.series[5].data = seriesData5;
let monthXAxis = []; let monthXAxis = [];
if (year < that.year){
that.month = 12;
}
for (let i = 1; i <= that.month; i++) { for (let i = 1; i <= that.month; i++) {
let item = i + "月"; let item = i + "月";
monthXAxis.push(item); monthXAxis.push(item);
@ -1208,6 +1354,7 @@ export default {
options.xAxis.data = monthXAxis; options.xAxis.data = monthXAxis;
that.optionMonth = options; that.optionMonth = options;
}); });
});
}, },
itemClick(type, item) { itemClick(type, item) {
this.type = type; this.type = type;

View File

@ -847,33 +847,6 @@ export default {
} }
} }
}, },
//
getGoalData(year) {
let params5 = {};
let goal_list = [];
let that = this;
params5.page = 0;
params5.year = year;
params5.mgroup = that.query.mgroup;
this.$API.mtm.goal.list
.req(params5)
.then((res5) => {
if (res5.length > 0) {
let data5 = res5;
data5.forEach((item5) => {
if (
item5.goal_cate_name ==
"单位产品分布电耗kW·h/t"
) {
goal_list.push(item5);
}
});
}
return res5;
})
},
// //
getDayData(year, month) { getDayData(year, month) {
let that = this; let that = this;
@ -946,7 +919,7 @@ export default {
} }
}).then(() => { }).then(() => {
let query2 = {}; let query2 = {};
query2.page = 0; query2.page = 0;
query2.year_s = year; query2.year_s = year;
query2.type = "month_s"; query2.type = "month_s";