diff --git a/src/views/home/widgets/index_enm.vue b/src/views/home/widgets/index_enm.vue index 5d8e85a6..90eb177c 100644 --- a/src/views/home/widgets/index_enm.vue +++ b/src/views/home/widgets/index_enm.vue @@ -4,77 +4,334 @@
- + - +
-
-
{{ monthData.电石渣.total_production - }}
-
月电石渣产量
- - 90% +
+
+ {{ + monthData.电石渣 + .total_production + }} +
+
+ 月电石渣产量 +
+ + {{ + monthData.电石渣.run_rate + }}%
-
-
{{ monthData.原料磨.total_production - }}
+
+
+ {{ + monthData.石灰石破碎 + .total_production + }} +
+
+ 月石灰石破碎量 +
+ + {{ + monthData.石灰石破碎 + .run_rate + }}% + +
+
+
+ {{ + monthData.原料磨 + .total_production + }} +
月生料产量
- - 95% + + {{ + monthData.原料磨.run_rate + }}%
-
-
{{ monthData.回转窑.total_production - }}
+
+
+ {{ + monthData.回转窑 + .total_production + }} +
月熟料产量
- - 98% + + {{ + monthData.回转窑.run_rate + }}%
-
-
{{ monthData.水泥磨.total_production - }}
+
+
+ {{ + monthData.水泥磨 + .total_production + }} +
月水泥产量
- - 95% + + {{ + monthData.水泥磨.run_rate + }}%
-
-
-
{{ - yearData.电石渣.total_production }}
-
本年累计电石渣产量
- - 75% +
+
+ {{ + monthData.余热发电 + .total_production + }} +
+
+ 月余热发电量 +
+ + {{ + monthData.余热发电.run_rate + }}% + +
+
+
+
+ {{ + yearData.电石渣 + .total_production + }} +
+
+ 本年累计电石渣产量 +
+ + {{ + yearData.电石渣 + .run_rate + }}%
-
-
{{ - yearData.原料磨.total_production }}
-
本年累计生料产量
- - 70% +
+
+ {{ + yearData.石灰石破碎 + .total_production + }} +
+
+ 本年累计石灰石破碎量 +
+ + {{ + yearData.石灰石破碎 + .run_rate + }}%
-
-
{{ - yearData.回转窑.total_production }}
-
本年累计熟料产量
- - 80% +
+
+ {{ + yearData.原料磨 + .total_production + }} +
+
+ 本年累计生料产量 +
+ + {{ + yearData.原料磨 + .run_rate + }}%
-
-
{{ - yearData.水泥磨.total_production }}
-
本年累计水泥产量
- - 75% +
+
+ {{ + yearData.回转窑 + .total_production + }} +
+
+ 本年累计熟料产量 +
+ + {{ + yearData.回转窑 + .run_rate + }}% + +
+
+
+ {{ + yearData.水泥磨 + .total_production + }} +
+
+ 本年累计水泥产量 +
+ + {{ + yearData.水泥磨 + .run_rate + }}% + +
+
+
+ {{ + yearData.余热发电 + .total_production + }} +
+
+ 本年累计余热发电量 +
+ + {{ + yearData.余热发电 + .run_rate + }}%
@@ -82,133 +339,381 @@ - +
-
-
{{ monthData.电石渣.elec_consume_unit - }}
-
月电石渣分布电耗
-
-
-
{{ monthData.原料磨.elec_consume_unit - }}
-
月生料分布电耗
-
-
-
{{ monthData.回转窑.elec_consume_unit - }}
-
月熟料分布电耗
-
-
-
{{ monthData.回转窑.coal_consume_unit - }}
-
熟料月单位标煤耗
-
-
-
-
{{ - monthData.回转窑.celec_consume_unit }}
-
熟料月综合电耗
+
+
+ {{ + monthData.电石渣 + .elec_consume_unit + }}
- -
-
{{ - monthData.回转窑.cen_consume_unit }}
-
熟料月综合能耗
+
+ 月电石渣分布电耗
-
-
{{ - monthData.水泥磨.elec_consume_unit }}
-
月水泥粉磨分布电耗
+
+
+
+ {{ + monthData.石灰石破碎 + .elec_consume_unit + }}
-
-
{{ - monthData.水泥磨.cen_consume_unit }}
-
水泥月综合能耗
+
+ 月石灰石破碎分布电耗 +
+
+
+
+ {{ + monthData.原料磨 + .elec_consume_unit + }} +
+
+ 月生料分布电耗 +
+
+
+
+ {{ + monthData.回转窑 + .elec_consume_unit + }} +
+
+ 月熟料分布电耗 +
+
+
+
+ {{ + monthData.回转窑 + .coal_consume_unit + }} +
+
+ 月熟料单位标煤耗 +
+
+
+
+
+ {{ + monthData.回转窑 + .celec_consume_unit + }} +
+
+ 熟料月综合电耗 +
+
+
+
+ {{ + monthData.回转窑 + .cen_consume_unit + }} +
+
+ 熟料月综合能耗 +
+
+
+
+ {{ + monthData.水泥磨 + .elec_consume_unit + }} +
+
+ 月水泥粉磨分布电耗 +
+
+
+
+ {{ + monthData.水泥磨 + .cen_consume_unit + }} +
+
+ 水泥月综合能耗 +
+
+
+
+ {{ + monthData.余热发电 + .elec_consume + }} +
+
+ 月余热发电电耗 +
+
+
+
+ {{ + monthData.余热发电 + .total_production + }} +
+
+ 月余热发电电量 +
-
-
{{ yearData.电石渣.elec_consume_unit - }}
-
本年度电石渣分布电耗
-
-
-
{{ yearData.原料磨.elec_consume_unit - }}
-
本年度生料分布电耗
-
-
-
{{ yearData.回转窑.elec_consume_unit - }}
-
本年度熟料分布电耗
-
-
-
{{ yearData.回转窑.coal_consume_unit - }}
-
本年度熟料单位标煤耗
-
-
-
-
{{ - yearData.回转窑.celec_consume_unit }}
-
本年度熟料综合电耗
+
+
+ {{ + yearData.电石渣 + .elec_consume_unit + }}
-
-
{{ - yearData.回转窑.cen_consume_unit }}
-
本年度熟料综合能耗
+
+ 本年度电石渣分布电耗
-
-
{{ - yearData.水泥磨.elec_consume_unit }}
-
本年度水泥粉磨分布电耗
+
+
+
+ {{ + yearData.石灰石破碎 + .elec_consume_unit + }}
-
-
{{ - yearData.水泥磨.cen_consume_unit }}
-
本年度水泥综合能耗
+
+ 本年度石灰石破碎分布电耗 +
+
+
+
+ {{ + yearData.原料磨 + .elec_consume_unit + }} +
+
+ 本年度生料分布电耗 +
+
+
+
+ {{ + yearData.回转窑 + .elec_consume_unit + }} +
+
+ 本年度熟料分布电耗 +
+
+
+
+ {{ + yearData.回转窑 + .coal_consume_unit + }} +
+
+ 本年度熟料单位标煤耗 +
+
+
+
+
+ {{ + yearData.回转窑 + .celec_consume_unit + }} +
+
+ 本年度熟料综合电耗 +
+
+
+
+ {{ + yearData.回转窑 + .cen_consume_unit + }} +
+
+ 本年度熟料综合能耗 +
+
+
+
+ {{ + yearData.水泥磨 + .elec_consume_unit + }} +
+
+ 本年度水泥粉磨分布电耗 +
+
+
+
+ {{ + yearData.水泥磨 + .cen_consume_unit + }} +
+
+ 本年度水泥综合能耗 +
+
+
+
+ {{ + yearData.余热发电 + .elec_consume + }} +
+
+ 本年度余热发电电耗 +
+
+
+
+ {{ + yearData.余热发电 + .total_production + }} +
+
+ 本年度余热发电电量 +
- - + +
-
-
{{ - monthData.电石渣.production_cost_unit }}
-
月电石渣成本
+
+
+ {{ + monthData.电石渣 + .production_cost_unit + }} +
+
+ 月电石渣成本 +
-
-
{{ - monthData.原料磨.production_cost_unit }}
+
+
+ {{ + monthData.原料磨 + .production_cost_unit + }} +
月生料成本
-
-
{{ - monthData.回转窑.production_cost_unit }}
+
+
+ {{ + monthData.回转窑 + .production_cost_unit + }} +
月熟料成本
-
-
{{ - monthData.水泥磨.production_cost_unit }}
+
+
+ {{ + monthData.水泥磨 + .production_cost_unit + }} +
月水泥成本
- - -
-
能耗超标报警
+ + +
+
+ 能耗超标报警 +
- -
+ +
设备检验
@@ -224,18 +729,18 @@ export default { data() { return { - time: '', - day: '', - year_s: '', - month_s: '', + time: "", + day: "", + year_s: "", + month_s: "", yearData: [], monthData: [], warningNum: 0, warningNum2: 0, - } + }; }, mounted() { - this.$emit('on-mounted'); + this.$emit("on-mounted"); let that = this; var myDate = new Date(); let year = myDate.getFullYear(); @@ -254,32 +759,35 @@ export default { // 动态绑定Class bindClass(type) { let classInfo = { - socketDom: true, redColor: false, - orangeColor: false, yellowColor: false, blueColor: true + socketDom: true, + redColor: false, + orangeColor: false, + yellowColor: false, + blueColor: true, + }; + if (type == "") { + classInfo.redColor = true; } - if (type == '') { - classInfo.redColor = true - } - return classInfo + return classInfo; }, init() { - var that = this - if (typeof (WebSocket) === "undefined") { - alert("您的浏览器不支持socket") + var that = this; + if (typeof WebSocket === "undefined") { + alert("您的浏览器不支持socket"); } else { - this.ws = new WebSocket(this.path + tool.data.get("TOKEN")) + this.ws = new WebSocket(this.path + tool.data.get("TOKEN")); //监听是否连接成功 this.ws.onopen = () => { // console.log("socket连接成功"); setTimeout(() => { - that.ws.send(JSON.stringify({ 'type': 'event' })) - }, 500) - } + that.ws.send(JSON.stringify({ type: "event" })); + }, 500); + }; //接听服务器发回的信息并处理展示 this.ws.onmessage = (msg) => { - let data = JSON.parse(msg.data) - console.log(data) + let data = JSON.parse(msg.data); + console.log(data); that.getWraningNum(); // if(data.type=='event'){ // that.bindClass(); @@ -291,12 +799,12 @@ export default { }; // 监听并处理error事件 this.ws.onerror = function (error) { - console.log('ws断开,尝试重连') + console.log("ws断开,尝试重连"); setTimeout(() => { this.ws = null; - this.init() - }, 5000) - } + this.init(); + }, 5000); + }; } }, getMessage(msg) { @@ -312,58 +820,66 @@ export default { //获取报警事件数量 getWraningNum() { let that = this; - that.$API.ecm.event.list.req({ cates__code__in: 'consume_exceed', is_handled: 0, page: 1 }).then((res) => { - that.warningNum = res.count; - }) - that.$API.em.equipment.list.req({ tag: 'near_check', type: 20, page: 1 }).then((res) => { - debugger; - that.warningNum2 = res.count; - }) + that.$API.ecm.event.list + .req({ + cates__code__in: "consume_exceed", + is_handled: 0, + page: 1, + }) + .then((res) => { + that.warningNum = res.count; + }); + that.$API.em.equipment.list + .req({ tag: "near_check", type: 20, page: 1 }) + .then((res) => { + debugger; + that.warningNum2 = res.count; + }); }, getYearData() { let that = this; let obj = {}; obj.year_s = this.year_s; - obj.type = 'year_s'; + obj.type = "year_s"; obj.page = 0; this.$API.enm.enstat.req(obj).then((res) => { let yearData = {}; - res.forEach(item => { + res.forEach((item) => { let label = item.mgroup_name; yearData[label] = item; }); that.yearData = yearData; - }) + }); }, getMonthData() { let that = this; let obj = {}; obj.year_s = this.year_s; obj.month_s = this.month_s; - obj.type = 'month_s'; + obj.type = "month_s"; obj.page = 0; that.$API.enm.enstat.req(obj).then((res) => { let monthData = {}; - res.forEach(item => { + res.forEach((item) => { let label = item.mgroup_name; monthData[label] = item; }); + console.log("monthData", monthData); that.monthData = monthData; - }) + }); }, showTime() { - this.time = this.$TOOL.dateFormat(new Date(), 'hh:mm:ss') - this.day = this.$TOOL.dateFormat(new Date(), 'yyyy年MM月dd日') + this.time = this.$TOOL.dateFormat(new Date(), "hh:mm:ss"); + this.day = this.$TOOL.dateFormat(new Date(), "yyyy年MM月dd日"); }, interEvent() { - this.$router.replace({ path: '/events' }) + this.$router.replace({ path: "/events" }); }, interEquipment() { - this.$router.replace({ path: '/em/equipmentc' }) + this.$router.replace({ path: "/em/equipmentc" }); }, - - } -} + }, +};