From 975ea3c28b1661b3b6eabee5277cc98d853736d3 Mon Sep 17 00:00:00 2001 From: huangxiaoqiang <1247017146@qq.com> Date: 星期二, 03 六月 2025 11:12:40 +0800 Subject: [PATCH] 合并 --- CodeManagement/BigScreenVue/src/views/indexs/center-bottom.vue | 177 +++++++++++++--------------------------------------------- 1 files changed, 40 insertions(+), 137 deletions(-) diff --git a/CodeManagement/BigScreenVue/src/views/indexs/center-bottom.vue b/CodeManagement/BigScreenVue/src/views/indexs/center-bottom.vue index 4a302d6..d9e82e9 100644 --- a/CodeManagement/BigScreenVue/src/views/indexs/center-bottom.vue +++ b/CodeManagement/BigScreenVue/src/views/indexs/center-bottom.vue @@ -11,7 +11,7 @@ <script> // import { currentGET } from "api/modules"; import { graphic } from "echarts"; -import {Productions} from "@/api/http.js" +import {Getproductionvolume} from "@/api/http.js" import axios from 'axios' export default { data() { @@ -35,7 +35,7 @@ "浜ч噺" + " : " + item.value + - "PCS</br>"; + "鎵�</br>"; } else { result += item.marker + " " + item.seriesName + " : - </br>"; } @@ -44,7 +44,7 @@ }, }, legend: { - data: ["鍗曚綅锛歅CS"], + data: ["鍗曚綅锛氭墭"], textStyle: { color: "#B4B4B4", }, @@ -57,14 +57,14 @@ top: "20px", }, xAxis: { - data: ['8/12','8/13','8/14','8/15','8/16','8/17','8/18'], + data: [], axisLine: { lineStyle: { color: "#B4B4B4", }, }, axisTick: { - show: false, + show: true, }, }, yAxis: [ @@ -82,7 +82,7 @@ ], series: [ { - name: "鍗曚綅锛歅CS", + name: "鍗曚綅锛氭墭", type: "bar", barWidth: 20, itemStyle: { @@ -106,8 +106,8 @@ }, ], }, - }; - }, + xAxisDates: [], + };}, props: {}, mounted() { this.getData(); @@ -129,21 +129,30 @@ }, 3000); }, async getData() { - // this.numberData.forEach((item, index) => { - // item.number.number[0] += ++index - // item.number = { ...item.number } - // }) - var rep = await Productions(); - console.log(rep); - //鑾峰彇rep涓璞$殑鐨則oday鍊兼暣鍚堟垚鏁扮粍 - var todays= rep.map((item) => { - return item.today; - }); - //鑾峰彇rep涓璞$殑鐨刾csCounts鍊兼暣鍚堟垚鏁扮粍 - var pcsCounts= rep.map((item) => { - return item.pcsCounts; - }); - console.log(todays); + const rep = await Getproductionvolume(); + console.log(rep) + var rep1=rep.filter(it=>it.taskType==100&&it.roadway.includes("CW")) + + // 鍒嗙粍骞舵帓搴� + const groupedData = rep1.reduce((acc, item) => { + const dateKey = item.createDate.split(' ')[0]; + acc[dateKey] = acc[dateKey] || { date: dateKey, tasks: [] }; + acc[dateKey].tasks.push(item); + return acc; + }, {}); + + const sortedGroups = Object.values(groupedData).sort( + (a, b) => new Date(b.date) - new Date(a.date) + ); + + // 鎻愬彇鏃ユ湡锛�7/2 鏍煎紡锛� + this.xAxisDates= sortedGroups.map(group => { + const date = new Date(group.date); + return `${date.getMonth() + 1}/${date.getDate()}`; + }); + + const pcsCounts = sortedGroups.map(group => group.tasks.length); + this.options = { tooltip: { trigger: "axis", @@ -163,7 +172,7 @@ "浜ч噺" + " : " + item.value + - "PCS</br>"; + "鎵�</br>"; } else { result += item.marker + " " + item.seriesName + " : - </br>"; } @@ -172,7 +181,7 @@ }, }, legend: { - data: ["鍗曚綅锛歅CS"], + data: ["鍗曚綅锛氭墭"], textStyle: { color: "#B4B4B4", }, @@ -185,14 +194,14 @@ top: "20px", }, xAxis: { - data: todays.reverse(), + data:this.xAxisDates.reverse(), axisLine: { lineStyle: { color: "#B4B4B4", }, }, axisTick: { - show: false, + show: true, }, }, yAxis: [ @@ -210,7 +219,7 @@ ], series: [ { - name: "鍗曚綅锛歅CS", + name: "鍗曚綅锛氭墭", type: "bar", barWidth: 20, itemStyle: { @@ -239,115 +248,9 @@ this.$store.state.setting.echartsAutoTime ); }, - - // async getData() { - // this.pageflag = true; - // let rep = await Timefault((a)=>{ - // console.log(a); - // }); - - // this.init(rep); - // currentGET("big6", { companyName: this.companyName }).then((res) => { - // console.log("鏁呴殰鏃堕暱缁熻", res); - - // // if (res.success) { - // // this.init(res.data); - // // console.log("娴嬭瘯2",res.data); - // // } else { - // // this.pageflag = false; - // // this.$Message({ - // // text: res.msg, - // // type: "warning", - // // }); - // // } - // }); - // }, - // init(val) { - // console.log(val); - // this.options = { - // tooltip: { - // trigger: "axis", - // backgroundColor: "rgba(0,0,0,.6)", - // borderColor: "rgba(147, 235, 248, .8)", - // textStyle: { - // color: "#FFF", - // }, - // formatter: function (params) { - // // 娣诲姞鍗曚綅 - // var result = params[0].name + "<br>"; - // params.forEach(function (item) { - // if (item.value) { - // result += - // item.marker + - // " " + - // "鍚堟牸浜ч噺" + - // " : " + - // item.value + - // "绠�</br>"; - // } else { - // result += item.marker + " " + item.seriesName + " : - </br>"; - // } - // }); - // return result; - // }, - // }, - // legend: { - // data: ["鍗曚綅锛氱"], - // textStyle: { - // color: "#B4B4B4", - // }, - // top: "-5", - // }, - // grid: { - // left: "50px", - // right: "40px", - // bottom: "30px", - // top: "20px", - // }, - // xAxis: { - // data: [val[6].datetime,val[5].datetime,val[4].datetime,val[3].datetime, - // val[2].datetime,val[1].datetime,val[0].datetime], - // axisLine: { - // lineStyle: { - // color: "#B4B4B4", - // }, - // }, - // axisTick: { - // show: false, - // }, - // }, - // yAxis: [ - // { - // splitLine: { show: true }, - // axisLine: { - // lineStyle: { - // color: "#B4B4B4", - // }, - // }, - // axisLabel: { - // formatter: "{value}", - // }, - // } - // ], - // series: [ - // { - // name: "鍗曚綅锛氱", - // type: "bar", - // barWidth: 20, - // itemStyle: { - // borderRadius: 5, - // color: new graphic.LinearGradient(0, 0, 0, 1, [ - // { offset: 0, color: "#956FD4" }, - // { offset: 1, color: "#3EACE5" }, - // ]), - // }, - // data: [val[6].qty,val[5].qty,val[4].qty,val[3].qty, - // val[2].qty,val[1].qty,val[0].qty], - // }, - // ], - // }; - // }, - }, + + + } }; </script> <style lang="scss" scoped> -- Gitblit v1.9.3