diff --git a/src/components/scEnm/empchartsdialog.vue b/src/components/scEnm/empchartsdialog.vue new file mode 100644 index 00000000..ca80d1aa --- /dev/null +++ b/src/components/scEnm/empchartsdialog.vue @@ -0,0 +1,284 @@ + + + + + \ No newline at end of file diff --git a/src/components/scEnm/lineChartsdialog.vue b/src/components/scEnm/lineChartsdialog.vue index 0ad081d0..1465a6e4 100644 --- a/src/components/scEnm/lineChartsdialog.vue +++ b/src/components/scEnm/lineChartsdialog.vue @@ -15,27 +15,27 @@
-
+
查询
-
+
查询
-
+
查询
-
+
{ } }, showClose: { type: Boolean, default: true }, echartType: { type: String, default: 'bar' }, @@ -121,6 +123,7 @@ query:{ time:'' }, + cateName:'', myChart:null, option: { title: { @@ -139,7 +142,7 @@ orient: 'horizontal', //图例布局方式:水平 'horizontal' 、垂直 'vertical' x: 'right', // 横向放置位置,选项:'center'、'left'、'right'、'number'(横向值 px) y: '10',// 纵向放置位置,选项:'top'、'bottom'、'center'、'number'(纵向值 px) - data: ['查询对象'], + data: [], }, xAxis: { type: 'category', @@ -190,7 +193,7 @@ }, series: [ { - name: '查询对象', + name: '', data: [4,1,9,2,11,3,5,7,8,10,6,12], type: 'line', // symbolSize: function(value) { // 点的大小跟随数值增加而变大 @@ -230,23 +233,98 @@ } }, mounted() { - console.log(this.type); - console.log(this.title); - console.log(this.echartType); + let that = this; + var myDate = new Date(); + let year =that.year = myDate.getFullYear(); + let month = that.month = myDate.getMonth()+1; + let day = that.days = myDate.getDate(); + let start_time='',end_time=''; + if(this.type=='hour_s'){ + start_time = year+'-'+month+'-'+day+' 00'; + end_time = year+'-'+month+'-'+day+' 23'; + }else if(this.type=='day_s'){ + start_time = year+'-'+month+'-01'; + end_time = year+'-'+month+'-15'; + }else if(this.type=='month_s'){ + start_time = year+'-01'; + end_time = year+'-12'; + }else if(this.type=='year_s'){ + start_time = year-1; + end_time = year; + } + this.query.start_time = start_time; + this.query.end_time = end_time; this.visible = this.modelValue; + this.option.legend.data.push(that.cate); + this.option.series[0].name=that.cate; + if(that.cate=='总产量(t)'){ + that.cateName = 'total_production'; + }else if(that.cate=='单位产品分布电耗(KW·h/t)'||that.cate=='生料分布电耗(KW·h/t)'||that.cate=='煤磨分布电耗(KW·h/t)'){ + that.cateName = 'elec_consume_unit'; + }else if(that.cate=='台时产量(t/h)'){ + that.cateName = 'production_hour'; + }else if(that.cate=='运转时间(h)'){ + that.cateName = 'run_hour'; + }else if(that.cate=='运转率(%)'){ + that.cateName = 'run_rate'; + }else if(that.cate=='单位产品成本(元/吨)'||that.cate=='电石渣成本(元/吨)'||that.cate=='生料成本(元/吨)'){ + that.cateName = 'production_cost_unit'; + }else if(that.cate=='单位产品综合电耗(KW·h/t)'){ + that.cateName = 'celec_consume_unit'; + }else if(that.cate=='单位产品标煤耗(kgce/t)'){ + that.cateName = 'coal_consume_unit'; + }else if(that.cate=='单位产品综合能耗(kgce/t)'){ + that.cateName = 'cen_consume_unit'; + } this.$nextTick(res=>{ this.getChartsData(); }) - }, methods: { - async getChartsData(){ + getChartsData(){ let that = this; - // var res = await this.apiObj.req(this.query); - let chartDom = document.getElementById('myChart'); - that.myChart = echarts.init(chartDom); - // var option = {}; - that.myChart.setOption(that.option); + let params = {}; + params.page = 0; + params.type = this.type; + params.mgroup = this.mgroup; + let start_time='',end_time='',type = that.type,unit='时'; + if(this.type=='hour_s'){ + type = 'hour'; + start_time = this.query.start_time+':00:00' + end_time = this.query.end_time+':00:00' + }else if(this.type=='day_s'){ + unit='日'; + start_time = this.query.start_time+' 00:00:00' + end_time = this.query.end_time+' 00:00:00' + }else if(this.type=='month_s'){ + unit='月'; + start_time = this.query.start_time+'-01 00:00:00' + end_time = this.query.end_time+'-01 00:00:00' + }else if(this.type=='year_s'){ + unit='年'; + start_time = this.query.start_time+'-01-01 00:00:00' + end_time = this.query.end_time+'-01-01 00:00:00' + } + params.start_time = start_time; + params.end_time = end_time; + that.apiObj.req(params).then(res=>{ + console.log(res) + debugger; + let xAxisData = [],lineData = []; + res.forEach(item=>{ + lineData.push(item[that.cateName]) + 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); + }) + }, + dataSearch(){ + this.getChartsData(); }, //关闭 closeDialog(){ diff --git a/src/views/enm_coal/power.vue b/src/views/enm_coal/power.vue index 09eb6fc2..80688bec 100644 --- a/src/views/enm_coal/power.vue +++ b/src/views/enm_coal/power.vue @@ -180,7 +180,7 @@ const colors =['#647bfe','#8698fe','#a9b6fe','#cbd3fe','#91CC75','#EE6666']; export default { components: { scEcharts, - charts: defineAsyncComponent(() => import("@/components/scEnm/lineChartsdialog.vue")), + charts: defineAsyncComponent(() => import("@/components/scEnm/empchartsdialog.vue")), }, data() { return { diff --git a/src/views/enm_coal/report.vue b/src/views/enm_coal/report.vue index 3870978c..06dd6cb2 100644 --- a/src/views/enm_coal/report.vue +++ b/src/views/enm_coal/report.vue @@ -40,10 +40,10 @@ {{item[0]}} {{item[0]}} {{item[1]}} - {{item[2]}} - {{item[3]}} - {{item[4]}} - {{item[5]}} + {{item[2]}} + {{item[3]}} + {{item[4]}} + {{item[5]}} {{item[6]}} {{item[7]}} {{item[8]}} @@ -65,91 +65,13 @@
- - -
- - - - 查询 -
-
- - - 查询 -
-
- - - 查询 -
-
- - - 查询 -
- -
import("@/components/scEnm/lineChartsdialog.vue")), + charts: defineAsyncComponent(() => import("@/components/scEnm/empchartsdialog.vue")), }, data() { return { diff --git a/src/views/enm_kiln/report.vue b/src/views/enm_kiln/report.vue index af2646da..f82cb63f 100644 --- a/src/views/enm_kiln/report.vue +++ b/src/views/enm_kiln/report.vue @@ -41,10 +41,10 @@ {{ item[0] }} {{ item[0] }} {{item[1]}} - {{item[2]}} - {{item[3]}} - {{item[4]}} - {{item[5]}} + {{item[2]}} + {{item[3]}} + {{item[4]}} + {{item[5]}} {{item[6]}} {{item[7]}} {{item[8]}} @@ -151,6 +151,9 @@ v-if="asynDialog" :type="type" :title="title" + :cate="cate" + :apiObj = "apiObj" + :mgroup="query.mgroup" :modelValue="modelValue" :showClose="showClose" :echartType='echartType' @@ -302,9 +305,10 @@ const colors =['#647bfe','#8698fe','#a9b6fe','#cbd3fe','#91CC75','#EE6666']; ], tableName:'生产报告', modelValue:true, - type:'hours', + type:'hour_s', title:'回转窑工段', - apiObj:'', + cate:'', + apiObj:this.$API.enm.enstat, showClose:true, echartType:'line', asynDialog:false, @@ -772,6 +776,7 @@ const colors =['#647bfe','#8698fe','#a9b6fe','#cbd3fe','#91CC75','#EE6666']; }, itemClick(type,item){ this.type=type; + this.cate=item[1]; this.asynDialog = true; }, itemClick1(type,item){ diff --git a/src/views/enm_mill/power.vue b/src/views/enm_mill/power.vue index 797611bc..1eed7ead 100644 --- a/src/views/enm_mill/power.vue +++ b/src/views/enm_mill/power.vue @@ -179,7 +179,7 @@ const colors =['#647bfe','#8698fe','#a9b6fe','#cbd3fe','#91CC75','#EE6666']; export default { components: { scEcharts, - charts: defineAsyncComponent(() => import("@/components/scEnm/lineChartsdialog.vue")), + charts: defineAsyncComponent(() => import("@/components/scEnm/empchartsdialog.vue")), }, data() { return { diff --git a/src/views/enm_mill/report.vue b/src/views/enm_mill/report.vue index 042f0882..1ef22ca4 100644 --- a/src/views/enm_mill/report.vue +++ b/src/views/enm_mill/report.vue @@ -40,10 +40,10 @@ {{item[0]}} {{item[0]}} {{item[1]}} - {{item[2]}} - {{item[3]}} - {{item[4]}} - {{item[5]}} + {{item[2]}} + {{item[3]}} + {{item[4]}} + {{item[5]}} {{item[6]}} {{item[7]}} {{item[8]}} @@ -150,6 +150,9 @@ v-if="asynDialog" :type="type" :title="title" + :cate="cate" + :apiObj = "apiObj" + :mgroup="query.mgroup" :modelValue="modelValue" :showClose="showClose" :echartType='echartType' @@ -281,9 +284,10 @@ const colors =['#647bfe','#8698fe','#a9b6fe','#cbd3fe','#91CC75','#EE6666']; ], tableName:'生产报告', modelValue:true, - type:'hours', + type:'hour_s', title:'水泥磨工段', - apiObj:'', + cate:'', + apiObj:this.$API.enm.enstat, showClose:true, echartType:'line', asynDialog:false, @@ -711,6 +715,7 @@ const colors =['#647bfe','#8698fe','#a9b6fe','#cbd3fe','#91CC75','#EE6666']; }, itemClick(type,item){ this.type=type; + this.cate=item[1]; this.asynDialog = true; }, itemClick1(type,item){ diff --git a/src/views/enm_pack/report.vue b/src/views/enm_pack/report.vue index f878913e..5f1cea49 100644 --- a/src/views/enm_pack/report.vue +++ b/src/views/enm_pack/report.vue @@ -38,9 +38,9 @@ {{item[0]}} {{item[1]}} - {{item[2]}} - {{item[3]}} - {{item[4]}} + {{item[2]}} + {{item[3]}} + {{item[4]}} {{item[5]}} {{item[6]}} {{item[7]}} @@ -143,6 +143,9 @@ v-if="asynDialog" :type="type" :title="title" + :cate="cate" + :apiObj = "apiObj" + :mgroup="query.mgroup" :modelValue="modelValue" :showClose="showClose" :echartType='echartType' @@ -232,7 +235,7 @@ page:0 }, query: { - mgroup:'3347217757455728640', + mgroup:'3347217757455728640', }, tableDatas:[ ['产量','总产量(t)',0,0,0,0,0,0,0,0], @@ -240,9 +243,10 @@ ], tableName:'生产报告', modelValue:true, - type:'hours', + type:'hour_s', title:'水泥磨工段', - apiObj:'', + cate:'', + apiObj:this.$API.enm.enstat, showClose:true, echartType:'line', asynDialog:false, @@ -492,6 +496,7 @@ }, itemClick(type,item){ this.type=type; + this.cate=item[1]; this.asynDialog = true; }, itemClick1(type,item){ diff --git a/src/views/enm_rm/power.vue b/src/views/enm_rm/power.vue index 0e1369fb..5af99077 100644 --- a/src/views/enm_rm/power.vue +++ b/src/views/enm_rm/power.vue @@ -178,7 +178,7 @@ export default { components: { scEcharts, - charts: defineAsyncComponent(() => import("@/components/scEnm/lineChartsdialog.vue")), + charts: defineAsyncComponent(() => import("@/components/scEnm/empchartsdialog.vue")), }, data() { return { diff --git a/src/views/enm_rm/report.vue b/src/views/enm_rm/report.vue index cac9a192..4d05fd33 100644 --- a/src/views/enm_rm/report.vue +++ b/src/views/enm_rm/report.vue @@ -40,10 +40,10 @@ {{item[0]}} {{item[0]}} {{item[1]}} - {{item[2]}} - {{item[3]}} - {{item[4]}} - {{item[5]}} + {{item[2]}} + {{item[3]}} + {{item[4]}} + {{item[5]}} {{item[6]}} {{item[7]}} {{item[8]}} @@ -152,6 +152,9 @@ v-if="asynDialog" :type="type" :title="title" + :cate="cate" + :apiObj = "apiObj" + :mgroup="query.mgroup" :modelValue="modelValue" :showClose="showClose" :echartType='echartType' @@ -287,7 +290,8 @@ modelValue:true, type:'hours', title:'原料磨工段', - apiObj:'', + cate:'', + apiObj:this.$API.enm.enstat, showClose:true, echartType:'line', asynDialog:false, @@ -484,8 +488,8 @@ } ], dataX: [], - dataY: [], - dataY2: [], + dataY: [], + dataY2: [], option : { color: [ '#647bfe', '#8698fe', '#a9b6fe','#cbd3fe','#91CC75', '#EE6666'], tooltip: { @@ -649,33 +653,33 @@ } let that = this; this.$nextTick(() => { - this.dataX = this.list.map(item => item.x); - // 第1个Y轴 - this.dataY.push({ - name: "AA", - type: "line", // 直线 - yAxisIndex: 0, // 第几个Y轴 索引值 - symbolSize: '10', - // lineStyle: { color: '#4485f4' }, - data: this.list.map(item => item.y) - }); - // 第2个Y轴 - this.dataY.push({ - name: "BB", - type: "line", - yAxisIndex: 1, // 第几个Y轴 索引值 - data: this.list.map(item => item.z) - }); - // 第3个Y轴 - this.dataY.push({ - name: "CC", - type: "line", - yAxisIndex: 2, // 第几个Y轴 索引值 - data: this.list.map(item => item.k) - }); + this.dataX = this.list.map(item => item.x); + // 第1个Y轴 + this.dataY.push({ + name: "AA", + type: "line", // 直线 + yAxisIndex: 0, // 第几个Y轴 索引值 + symbolSize: '10', + // lineStyle: { color: '#4485f4' }, + data: this.list.map(item => item.y) + }); + // 第2个Y轴 + this.dataY.push({ + name: "BB", + type: "line", + yAxisIndex: 1, // 第几个Y轴 索引值 + data: this.list.map(item => item.z) + }); + // 第3个Y轴 + this.dataY.push({ + name: "CC", + type: "line", + yAxisIndex: 2, // 第几个Y轴 索引值 + data: this.list.map(item => item.k) + }); - this.init(this.dataX, this.dataY); - }); + this.init(this.dataX, this.dataY); + }); this.$nextTick(() => { var myDate = new Date(); let year =that.year = myDate.getFullYear(); @@ -950,6 +954,7 @@ }, itemClick(type,item){ this.type=type; + this.cate=item[1]; this.asynDialog = true; }, itemClick1(type,item){ diff --git a/src/views/enm_slag/power.vue b/src/views/enm_slag/power.vue index b0064b4d..4af356bd 100644 --- a/src/views/enm_slag/power.vue +++ b/src/views/enm_slag/power.vue @@ -172,7 +172,7 @@ export default { components: { scEcharts, - charts: defineAsyncComponent(() => import("@/components/scEnm/lineChartsdialog.vue")), + charts: defineAsyncComponent(() => import("@/components/scEnm/empchartsdialog.vue")), }, data() { return { diff --git a/src/views/enm_slag/report.vue b/src/views/enm_slag/report.vue index d619f821..e2ea36da 100644 --- a/src/views/enm_slag/report.vue +++ b/src/views/enm_slag/report.vue @@ -15,139 +15,141 @@
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
电石渣工段生产报告
参数昨日本月本年月目标值月完成度年目标值年完成度
{{item[0]}}{{item[1]}}{{item[2]}}{{item[3]}}{{item[4]}}{{item[6]}}{{item[6]}}{{item[7]}}{{item[8]}}
-
-
本月生产参数统计图
- -
-
-
本年生产参数统计图
- + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
电石渣工段生产报告
参数昨日本月本年月目标值月完成度年目标值年完成度
{{item[0]}}{{item[1]}}{{item[2]}}{{item[3]}}{{item[4]}}{{item[6]}}{{item[6]}}{{item[7]}}{{item[8]}}
+
+
本月生产参数统计图
+ +
+
+
本年生产参数统计图
+ +
-
- - -
- - - - 查询 -
-
- - - 查询 -
-
- - - 查询 -
-
- - - 查询 -
- -
- + +
+ + + + 查询 +
+
+ + + 查询 +
+
+ + + 查询 +
+
+ + + 查询 +
+ +
+
@@ -163,8 +165,7 @@ }, confine:false, showContent: true, - triggerOn:"mousemove", - // alwaysShowContent:true, + triggerOn:"mousemove", }; let grid={ right: '7%', @@ -251,11 +252,12 @@ ['能耗','单位产品分布电耗(KW·h/t)',0,0,0,0,0,0,0,0], ['成本','电石渣成本(元/吨)',0,0,0,0,0,0,0,0], ], + cate:'', + apiObj:this.$API.enm.enstat, tableName:'生产报告', modelValue:true, - type:'hours', + type:'hour_s', title:'电石渣工段', - apiObj:'', showClose:true, echartType:'line', asynDialog:false, @@ -503,6 +505,7 @@ }, itemClick(type,item){ this.type=type; + this.cate=item[1]; this.asynDialog = true; }, itemClick1(type,item){