From 0d5d4a8c55b562090f1a1ac48cda7fcab943979b Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期三, 15 十月 2025 15:48:40 +0800
Subject: [PATCH] 更新二进制文件及新增异步POST方法
---
CodeManagement/BigScreenVue/src/views/indexs/plan.vue | 52 +++++++++++++++++++++++++++++-----------------------
1 files changed, 29 insertions(+), 23 deletions(-)
diff --git a/CodeManagement/BigScreenVue/src/views/indexs/plan.vue b/CodeManagement/BigScreenVue/src/views/indexs/plan.vue
index 1d7896c..869d18b 100644
--- a/CodeManagement/BigScreenVue/src/views/indexs/plan.vue
+++ b/CodeManagement/BigScreenVue/src/views/indexs/plan.vue
@@ -11,7 +11,7 @@
<script>
// import { currentGET } from "api/modules";
import { graphic } from "echarts";
-import {ProductionsOut} 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",
},
@@ -82,7 +82,7 @@
],
series: [
{
- name: "鍗曚綅锛歅CS",
+ name: "鍗曚綅锛氭墭",
type: "bar",
barWidth: 20,
itemStyle: {
@@ -106,6 +106,7 @@
},
],
},
+ xAxisDates: [],
};
},
props: {},
@@ -129,21 +130,26 @@
}, 3000);
},
async getData() {
- // this.numberData.forEach((item, index) => {
- // item.number.number[0] += ++index
- // item.number = { ...item.number }
- // })
- var rep = await ProductionsOut();
- 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();
+ 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)
+);
+
+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 +169,7 @@
"浜ч噺" +
" : " +
item.value +
- "PCS</br>";
+ "鎵�</br>";
} else {
result += item.marker + " " + item.seriesName + " : - </br>";
}
@@ -172,7 +178,7 @@
},
},
legend: {
- data: ["鍗曚綅锛歅CS"],
+ data: ["鍗曚綅锛氭墭"],
textStyle: {
color: "#B4B4B4",
},
@@ -185,7 +191,7 @@
top: "20px",
},
xAxis: {
- data: todays.reverse(),
+ data:this.xAxisDates.reverse(),
axisLine: {
lineStyle: {
color: "#B4B4B4",
@@ -210,7 +216,7 @@
],
series: [
{
- name: "鍗曚綅锛歅CS",
+ name: "鍗曚綅锛氭墭",
type: "bar",
barWidth: 20,
itemStyle: {
--
Gitblit v1.9.3