From 08130abf6ac0c68d4fc02ce6b2983955e759c8fd Mon Sep 17 00:00:00 2001 From: shijing Date: Fri, 17 May 2024 10:47:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=94=9F=E4=BA=A7=E5=B0=8F=E6=97=B6?= =?UTF-8?q?=E6=8A=A5=E5=91=8A=E5=8E=BB=E6=8E=89=E5=B8=B8=E4=B8=BA0?= =?UTF-8?q?=E7=9A=84=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/enm_coalbase/report.vue | 64 +++++++----- src/views/enm_cogeneration/report.vue | 87 +++++++++------- src/views/enm_kilnbase/report.vue | 85 ++++++++++----- src/views/enm_rmbase/report.vue | 64 +++++++----- src/views/enp/pfk.vue | 144 ++++++++++++++++++++------ 5 files changed, 306 insertions(+), 138 deletions(-) diff --git a/src/views/enm_coalbase/report.vue b/src/views/enm_coalbase/report.vue index d861d565..f3fbca05 100644 --- a/src/views/enm_coalbase/report.vue +++ b/src/views/enm_coalbase/report.vue @@ -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 + "时"; diff --git a/src/views/enm_cogeneration/report.vue b/src/views/enm_cogeneration/report.vue index f7c641a2..2fafcb02 100644 --- a/src/views/enm_cogeneration/report.vue +++ b/src/views/enm_cogeneration/report.vue @@ -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; }); diff --git a/src/views/enm_kilnbase/report.vue b/src/views/enm_kilnbase/report.vue index baddb644..9c922f02 100644 --- a/src/views/enm_kilnbase/report.vue +++ b/src/views/enm_kilnbase/report.vue @@ -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 + "时"; diff --git a/src/views/enm_rmbase/report.vue b/src/views/enm_rmbase/report.vue index efb33b95..da471bda 100644 --- a/src/views/enm_rmbase/report.vue +++ b/src/views/enm_rmbase/report.vue @@ -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 + "时"; diff --git a/src/views/enp/pfk.vue b/src/views/enp/pfk.vue index 3f4639e3..388a51b8 100644 --- a/src/views/enp/pfk.vue +++ b/src/views/enp/pfk.vue @@ -94,7 +94,7 @@ 设备 - + + + 新增 + + + + + + + + + + + + + - {{ form.name }} + {{ drain_name }} - {{ form.number }} + {{ drain_number }} { - 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("删除成功"); + } + }); + }, }, };