fix:生产小时报告去掉常为0的项

This commit is contained in:
shijing 2024-05-17 10:47:39 +08:00
parent bbb24409a5
commit 08130abf6a
5 changed files with 306 additions and 138 deletions

View File

@ -282,11 +282,14 @@ export default {
echartType: "line",
asynDialog: false,
option1: {
color: colors,
color: ["#647bfe", "#91CC75"],
tooltip: tooltip,
grid: grid,
toolbox: toolbox,
legend: legend,
legend: {
top: "2%",
data: ["总产量", "分布电耗"],
},
xAxis: {
axisTick: {
show: true,
@ -309,7 +312,38 @@ export default {
"十二月",
],
},
yAxis: yAxis,
yAxis: [
{
type: "value",
name: "产量 (t)",
position: "left",
alignTicks: true,
axisLine: {
show: true,
lineStyle: {
color: colors[0],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "分布电耗(KW.h/t)",
position: "right",
alignTicks: true,
axisLine: {
show: true,
lineStyle: {
color: colors[3],
},
},
axisLabel: {
formatter: "{value}",
},
},
],
series: [
{
name: "总产量",
@ -317,22 +351,10 @@ export default {
yAxisIndex: 0,
data: [],
},
{
name: "台时产量",
type: "bar",
yAxisIndex: 0,
data: [],
},
{
name: "运转率",
type: "line",
yAxisIndex: 1,
data: [],
},
{
name: "分布电耗",
type: "bar",
yAxisIndex: 2,
yAxisIndex: 1,
data: [],
},
],
@ -665,22 +687,16 @@ export default {
query.mgroup = that.query.mgroup;
this.$API.enm.enstat.req(query).then((response) => {
let seriesData0 = [],
seriesData1 = [],
seriesData2 = [],
seriesData3 = [];
seriesData1 = [];
let data = response;
data.forEach((item) => {
let ind = item.hour;
seriesData0[ind] = item.total_production; //
seriesData1[ind] = item.production_hour; //
seriesData2[ind] = item.run_rate; //
seriesData3[ind] = item.elec_consume_unit; //
seriesData1[ind] = item.elec_consume_unit; //
});
let options = { ...that.option1 };
options.series[0].data = seriesData0;
options.series[1].data = seriesData1;
options.series[2].data = seriesData2;
options.series[3].data = seriesData3;
let hourXAxis = [];
for (let i = 0; i < 24; i++) {
let item = i + "时";

View File

@ -315,13 +315,15 @@ let toolbox = {
};
let legend = {
top: "2%",
data: ["总发电量", "单位发电量", "运转时间", "运转率", "用电量"],
data: ["总发电量", "发电功率", "吨熟料发电量", "运转率", "用电量"],
};
let yAxis = [
{
type: "value",
name: "电量 (KW·h)",
position: "left",
offset: 80,
alignTicks: true,
axisLine: {
show: true,
@ -336,9 +338,8 @@ let yAxis = [
{
type: "value",
name: "运转率",
position: "right",
position: "left",
alignTicks: true,
offset: 80,
axisLine: {
show: true,
lineStyle: {
@ -351,7 +352,7 @@ let yAxis = [
},
{
type: "value",
name: "运转时间(h)",
name: "吨熟料发电量(KW·h/t)",
position: "right",
alignTicks: true,
axisLine: {
@ -410,11 +411,14 @@ export default {
echartType: "line",
asynDialog: false,
option1: {
color: colors,
color: ["#647bfe", "#a9b6fe", "#91CC75"],
tooltip: tooltip,
grid: grid,
toolbox: toolbox,
legend: legend,
legend: {
top: "2%",
data: ["总发电量", "吨熟料发电量", "用电量"],
},
xAxis: {
axisTick: {
show: true,
@ -423,7 +427,38 @@ export default {
},
data: [],
},
yAxis: yAxis,
yAxis: [
{
type: "value",
name: "电量 (KW·h)",
position: "left",
alignTicks: true,
axisLine: {
show: true,
lineStyle: {
color: colors[0],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "吨熟料发电量KW·h/t",
position: "right",
alignTicks: true,
axisLine: {
show: true,
lineStyle: {
color: colors[3],
},
},
axisLabel: {
formatter: "{value}",
},
},
],
series: [
{
name: "总发电量",
@ -432,20 +467,8 @@ export default {
data: [],
},
{
name: "单位发电量",
name: "吨熟料发电量",
type: "bar",
yAxisIndex: 0,
data: [],
},
{
name: "运转时间",
type: "bar",
yAxisIndex: 2,
data: [],
},
{
name: "运转率",
type: "line",
yAxisIndex: 1,
data: [],
},
@ -494,13 +517,13 @@ export default {
data: [],
},
{
name: "单位发电量",
name: "发电功率",
type: "bar",
yAxisIndex: 0,
data: [],
},
{
name: "运转时间",
name: "吨熟料发电量",
type: "bar",
yAxisIndex: 2,
data: [],
@ -542,13 +565,13 @@ export default {
data: [],
},
{
name: "单位发电量",
name: "发电功率",
type: "bar",
yAxisIndex: 0,
data: [],
},
{
name: "运转时间",
name: "吨熟料发电量",
type: "bar",
yAxisIndex: 2,
data: [],
@ -820,24 +843,18 @@ export default {
this.$API.enm.enstat.req(query).then((response) => {
let seriesData0 = [],
seriesData1 = [],
seriesData2 = [],
seriesData3 = [],
seriesData4 = [];
seriesData2 = [];
let data = response;
data.forEach((item) => {
let ind = item.hour;
seriesData0[ind] = item.total_production;
seriesData1[ind] = item.production_hour; //
seriesData2[ind] = item.run_hour;
seriesData3[ind] = item.run_rate;
seriesData4[ind] = item.elec_consume;
seriesData1[ind] = item.production_elec_unit;
seriesData2[ind] = item.elec_consume;
});
let options = { ...that.option1 };
options.series[0].data = seriesData0;
options.series[1].data = seriesData1;
options.series[2].data = seriesData2;
options.series[3].data = seriesData3;
options.series[4].data = seriesData4;
let hourXAxis = [];
for (let i = 0; i < 24; i++) {
let item = i + "时";
@ -868,7 +885,7 @@ export default {
let ind = item.day_s - 1;
seriesData0[ind] = item.total_production;
seriesData1[ind] = item.production_hour;
seriesData2[ind] = item.run_hour;
seriesData2[ind] = item.production_elec_unit;
seriesData3[ind] = item.run_rate;
seriesData4[ind] = item.elec_consume;
});
@ -907,7 +924,7 @@ export default {
let ind = item.month_s - 1;
seriesData0[ind] = item.total_production;
seriesData1[ind] = item.production_hour;
seriesData2[ind] = item.run_hour;
seriesData2[ind] = item.production_elec_unit;
seriesData3[ind] = item.run_rate;
seriesData4[ind] = item.elec_consume;
});

View File

@ -418,11 +418,14 @@ export default {
echartType: "line",
asynDialog: false,
option1: {
color: colors,
color: ["#647bfe", "#cbd3fe", "#91CC75"],
tooltip: tooltip,
grid: grid,
toolbox: toolbox,
legend: legend,
legend: {
top: "2%",
data: ["总产量", "分布电耗", "单位产品标煤耗"],
},
xAxis: {
axisTick: {
show: true,
@ -431,7 +434,55 @@ export default {
},
data: [],
},
yAxis: yAxis,
yAxis: [
{
type: "value",
name: "产量 (t)",
position: "left",
alignTicks: true,
axisLine: {
show: true,
lineStyle: {
color: colors[0],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "分布电耗",
position: "left",
alignTicks: true,
offset: 70,
axisLine: {
show: true,
lineStyle: {
color: colors[3],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "标煤耗",
position: "right",
alignTicks: true,
axisLine: {
show: true,
lineStyle: {
color: colors[4],
},
},
axisLabel: {
formatter: "{value}",
},
},
],
series: [
{
name: "总产量",
@ -439,28 +490,16 @@ export default {
yAxisIndex: 0,
data: [],
},
{
name: "台时产量",
type: "bar",
yAxisIndex: 0,
data: [],
},
{
name: "运转率",
type: "line",
yAxisIndex: 1,
data: [],
},
{
name: "分布电耗",
type: "bar",
yAxisIndex: 2,
yAxisIndex: 1,
data: [],
},
{
name: "单位产品标煤耗",
type: "bar",
yAxisIndex: 3,
yAxisIndex: 2,
data: [],
},
],
@ -861,24 +900,18 @@ export default {
this.$API.enm.enstat.req(query).then((response) => {
let seriesData0 = [],
seriesData1 = [],
seriesData2 = [],
seriesData3 = [],
seriesData4 = [];
seriesData2 = [];
let data = response;
data.forEach((item) => {
let ind = item.hour;
seriesData0[ind] = item.total_production;
seriesData1[ind] = item.production_hour;
seriesData2[ind] = item.run_rate;
seriesData3[ind] = item.elec_consume_unit;
seriesData4[ind] = item.coal_consume_unit;
seriesData1[ind] = item.elec_consume_unit;
seriesData2[ind] = item.coal_consume_unit;
});
let options = { ...that.option1 };
options.series[0].data = seriesData0;
options.series[1].data = seriesData1;
options.series[2].data = seriesData2;
options.series[3].data = seriesData3;
options.series[4].data = seriesData4;
let hourXAxis = [];
for (let i = 0; i < 24; i++) {
let item = i + "时";

View File

@ -411,11 +411,14 @@ export default {
echartType: "line",
asynDialog: false,
option1: {
color: colors,
color: ["#647bfe", "#91CC75"],
tooltip: tooltip,
grid: grid,
toolbox: toolbox,
legend: legend,
legend: {
top: "2%",
data: ["总产量", "分布电耗"],
},
xAxis: {
axisTick: {
show: true,
@ -425,7 +428,38 @@ export default {
},
data: [],
},
yAxis: yAxis,
yAxis: [
{
type: "value",
name: "产量 (t)",
position: "left",
alignTicks: true,
axisLine: {
show: true,
lineStyle: {
color: colors[0],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "分布电耗(KW.h/t)",
position: "right",
alignTicks: true,
axisLine: {
show: true,
lineStyle: {
color: colors[3],
},
},
axisLabel: {
formatter: "{value}",
},
},
],
series: [
{
name: "总产量",
@ -433,22 +467,10 @@ export default {
yAxisIndex: 0,
data: [],
},
{
name: "台时产量",
type: "bar",
yAxisIndex: 1,
data: [],
},
{
name: "运转率",
type: "line",
yAxisIndex: 2,
data: [],
},
{
name: "分布电耗",
type: "bar",
yAxisIndex: 3,
yAxisIndex: 1,
data: [],
},
],
@ -802,22 +824,16 @@ export default {
query.mgroup = that.query.mgroup;
this.$API.enm.enstat.req(query).then((response) => {
let seriesData0 = [],
seriesData1 = [],
seriesData2 = [],
seriesData3 = [];
seriesData1 = [];
let data = response;
data.forEach((item) => {
let ind = item.hour;
seriesData0[ind] = item.total_production;
seriesData1[ind] = Number(item.production_hour).toFixed(2);
seriesData2[ind] = item.run_rate;
seriesData3[ind] = item.elec_consume_unit;
seriesData1[ind] = item.elec_consume_unit;
});
let options = { ...that.option1 };
options.series[0].data = seriesData0;
options.series[1].data = seriesData1;
options.series[2].data = seriesData2;
options.series[3].data = seriesData3;
let hourXAxis = [];
for (let i = 0; i < 24; i++) {
let item = i + "时";

View File

@ -94,7 +94,7 @@
<el-button
link
size="small"
@click="table_link(scope.row)"
@click="table_equip(scope.row)"
v-auth="'mgroup.update'"
type="primary"
>设备</el-button
@ -134,7 +134,56 @@
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
<el-dialog title="熟料产量编辑" v-model="visible">
<el-drawer
title="关联设备"
v-model="visibleEquip"
:size="800"
destroy-on-close
@closed="visibleEquip = false"
>
<el-container>
<el-button
type="primary"
icon="el-icon-plus"
@click="equip_add"
v-auth="'equipment'"
style="position: absolute; z-index: 10; left: 110px; top: 16px"
>新增</el-button
>
<el-main style="padding: 0 20px 20px 20px">
<scTable
ref="drawer_table"
:apiObj="apiObj2"
row-key="id"
stripe
hideDo
hideSetting
:params="query2"
:query="query2"
>
<el-table-column type="index" width="50" />
<el-table-column
label="设备名称"
prop="equipment_name"
show-overflow-tooltip
>
</el-table-column>
<el-table-column label="操作" align="center">
<template #default="scope">
<el-link
type="danger"
@click="equip_del(scope.row)"
v-auth="'equipment.delete'"
>
删除
</el-link>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-drawer>
<el-dialog title="排放口设备" v-model="visible">
<el-main style="padding: 0 20px 20px 20px">
<el-form
ref="dialogForm"
@ -146,22 +195,21 @@
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="排放口名称:">
<span>{{ form.name }}</span>
<span>{{ drain_name }}</span>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="排放口编号:">
<span>{{ form.number }}</span>
<span>{{ drain_number }}</span>
</el-form-item>
</el-col>
<el-col>
<el-form-item label="关联设备:">
<el-select
v-model="form.equipments"
v-model="form.equipment"
placeholder="关联设备"
clearable
filterable
multiple
style="width: 100%"
>
<el-option
@ -194,10 +242,22 @@ export default {
data() {
return {
apiObj: this.$API.enp.drain.list,
apiObj2: null,
query: {},
query2: {
drain: "",
page: 0,
},
dialog: {
save: false,
},
form: {
drain: "",
equipment: "",
},
drainId: "",
drain_name: "",
drain_number: "",
selection: [],
level_: { 10: "主要排放口", 20: "次要排放口" },
cate_: {
@ -207,8 +267,12 @@ export default {
},
visible: false,
options: [],
visibleEquip: false,
};
},
mounted() {
this.getOptions();
},
methods: {
getOptions() {
this.$API.em.equipment.list
@ -217,29 +281,6 @@ export default {
this.options = res;
});
},
//
table_link(row) {
this.visible = true;
this.form = row;
this.getOptions();
},
//
submit() {
this.$refs.dialogForm.validate((valid) => {
if (valid) {
this.isSaveing = true;
this.$API.enp.drain.update
.req(this.form.id, this.form)
.then((res) => {
this.visible = false;
this.isSaveing = false;
})
.catch(() => {
this.isSaveing = false;
});
}
});
},
//
table_add() {
this.dialog.save = true;
@ -274,6 +315,51 @@ export default {
this.dialog.save = false;
this.$refs.table.refresh();
},
//
table_equip(row) {
this.drainId = row.id;
this.drain_name = row.name;
this.drain_number = row.number;
this.query2.drain = row.id;
this.apiObj2 = this.$API.enp.drain_equip.list;
this.visibleEquip = true;
},
//
equip_add() {
this.visible = true;
this.form.drain = this.drainId;
},
//
submit() {
let that = this;
console.log(that.form);
that.$refs.dialogForm.validate((valid) => {
if (valid) {
that.isSaveing = true;
that.$API.enp.drain_equip.create
.req(that.form)
.then((res) => {
that.visible = false;
that.isSaveing = false;
this.$refs.drawer_table.refresh();
})
.catch(() => {
that.isSaveing = false;
});
}
});
},
//
equip_del(row) {
this.$API.enp.drain_equip.delete.req(row.id).then((res) => {
if (res.err_msg) {
this.$message.error(res.err_msg);
} else {
this.$refs.drawer_table.refresh();
this.$message.success("删除成功");
}
});
},
},
};
</script>