This commit is contained in:
gtz 2025-08-25 15:21:36 +08:00
parent 40791bc619
commit ebe2a03023
23 changed files with 78 additions and 75 deletions

View File

@ -102,7 +102,7 @@ function CenterDown() {
// @ts-ignore // @ts-ignore
data.weekProductionRates[keys[0]].forEach((item,index)=>{ data.weekProductionRates[keys[0]].forEach((item,index)=>{
// @ts-ignore // @ts-ignore
dataSource.week.xData.push(dayjs(item.recTime).format("HH:mm")) dataSource.week.xData.push(dayjs(item.recTime).format("MM-DD"))
}) })
keys.forEach((item,index)=>{ keys.forEach((item,index)=>{
let obj = { let obj = {
@ -155,6 +155,8 @@ function CenterDown() {
dataSource.month.xData = [] dataSource.month.xData = []
dataSource.month.series = [] dataSource.month.series = []
} }
console.log('activeName', activeName)
console.log('dataSource', dataSource)
let chartData = (dataSource as { [key: string]: any })[activeName]; let chartData = (dataSource as { [key: string]: any })[activeName];
const options = getOptions(chartData); const options = getOptions(chartData);
return ( return (

View File

@ -34,7 +34,7 @@ function TitleBox(props: titleProps) {
case "right_up": case "right_up":
return { return {
img: Num, img: Num,
title: "各工段投入和产出", title: "各工段当日投入和产出",
}; };
default: default:
return { return {

View File

@ -82,20 +82,20 @@ function LeftUp() {
} }
sum.push(sumIner) sum.push(sumIner)
} }
dataSource.day.series.push({ // dataSource.day.series.push({
data: sum, // data: sum,
type: "bar", // type: "bar",
stack: "a", // stack: "a",
name: "", // name: "",
label: { // label: {
show: true, // show: true,
position: "top", // position: "top",
color: "#fff", // color: "#fff",
formatter: function (params: any) { // formatter: function (params: any) {
return sum[params.dataIndex]; // return sum[params.dataIndex];
}, // },
}, // },
}) // })
}else{ }else{
dataSource.day.xData = [] dataSource.day.xData = []
dataSource.day.series = [] dataSource.day.series = []
@ -150,20 +150,20 @@ function LeftUp() {
} }
sum.push(sumIner) sum.push(sumIner)
} }
dataSource.week.series.push({ // dataSource.week.series.push({
data: sum, // data: sum,
type: "bar", // type: "bar",
stack: "a", // stack: "a",
name: "", // name: "",
label: { // label: {
show: true, // show: true,
position: "top", // position: "top",
color: "#fff", // color: "#fff",
formatter: function (params: any) { // formatter: function (params: any) {
return sum[params.dataIndex]; // return sum[params.dataIndex];
}, // },
}, // },
}) // })
}else{ }else{
dataSource.week.xData = [] dataSource.week.xData = []
dataSource.week.series = [] dataSource.week.series = []
@ -218,20 +218,20 @@ function LeftUp() {
} }
sum.push(sumIner) sum.push(sumIner)
} }
dataSource.month.series.push({ // dataSource.month.series.push({
data: sum, // data: sum,
type: "bar", // type: "bar",
stack: "a", // stack: "a",
name: "", // name: "",
label: { // label: {
show: true, // show: true,
position: "top", // position: "top",
color: "#fff", // color: "#fff",
formatter: function (params: any) { // formatter: function (params: any) {
return sum[params.dataIndex]; // return sum[params.dataIndex];
}, // },
}, // },
}) // })
}else{ }else{
dataSource.month.xData = [] dataSource.month.xData = []
dataSource.month.series = [] dataSource.month.series = []

View File

@ -9,8 +9,8 @@ import { useDispatch } from 'react-redux';
import { UpdateLine1Before } from "../../store/LinePageSlice"; import { UpdateLine1Before } from "../../store/LinePageSlice";
function LinePage() { function LinePage() {
const dispatch = useDispatch(); const dispatch = useDispatch();
// const myUrl = "192.168.8.22" const myUrl = "192.168.8.22"
const myUrl = window.location.host; // const myUrl = window.location.host;
useEffect(() => { useEffect(() => {
let websocket1_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=1-1-" + Date.now()); let websocket1_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=1-1-" + Date.now());
// @ts-ignore // @ts-ignore
@ -18,6 +18,7 @@ function LinePage() {
let msgData = event.data let msgData = event.data
try { try {
msgData = JSON.parse(event.data); msgData = JSON.parse(event.data);
console.log(msgData)
} catch (error) { } catch (error) {
console.log("websocket: [unable to msgData] : ", event.data); console.log("websocket: [unable to msgData] : ", event.data);
} }

View File

@ -34,7 +34,7 @@ function TitleBox(props: titleProps) {
case "right_up": case "right_up":
return { return {
img: Num, img: Num,
title: "各工段投入和产出", title: "各工段当日投入和产出",
}; };
default: default:
return { return {

View File

@ -9,8 +9,8 @@ import { useDispatch } from 'react-redux';
import { UpdateLine1After } from "../../store/LinePageSlice"; import { UpdateLine1After } from "../../store/LinePageSlice";
function LinePage() { function LinePage() {
const dispatch = useDispatch(); const dispatch = useDispatch();
// const myUrl = "192.168.8.22" const myUrl = "192.168.8.22"
const myUrl = window.location.host; // const myUrl = window.location.host;
useEffect(() => { useEffect(() => {
let websocket1_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=1-2-" + Date.now()); let websocket1_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=1-2-" + Date.now());
// @ts-ignore // @ts-ignore

View File

@ -34,7 +34,7 @@ function TitleBox(props: titleProps) {
case "right_up": case "right_up":
return { return {
img: Num, img: Num,
title: "各工段投入和产出", title: "各工段当日投入和产出",
}; };
default: default:
return { return {

View File

@ -9,8 +9,8 @@ import { useDispatch } from 'react-redux';
import { UpdateLine2Before } from "../../store/LinePageSlice"; import { UpdateLine2Before } from "../../store/LinePageSlice";
function LinePage() { function LinePage() {
const dispatch = useDispatch(); const dispatch = useDispatch();
// const myUrl = "192.168.8.22" const myUrl = "192.168.8.22"
const myUrl = window.location.host; // const myUrl = window.location.host;
useEffect(() => { useEffect(() => {
let websocket2_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=2-1-" + Date.now()); let websocket2_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=2-1-" + Date.now());
// @ts-ignore // @ts-ignore

View File

@ -34,7 +34,7 @@ function TitleBox(props: titleProps) {
case "right_up": case "right_up":
return { return {
img: Num, img: Num,
title: "各工段投入和产出", title: "各工段当日投入和产出",
}; };
default: default:
return { return {

View File

@ -9,8 +9,8 @@ import { useDispatch } from 'react-redux';
import { UpdateLine2After } from "../../store/LinePageSlice"; import { UpdateLine2After } from "../../store/LinePageSlice";
function LinePage() { function LinePage() {
const dispatch = useDispatch(); const dispatch = useDispatch();
// const myUrl = "192.168.8.22" const myUrl = "192.168.8.22"
const myUrl = window.location.host; // const myUrl = window.location.host;
useEffect(() => { useEffect(() => {
let websocket2_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=2-2-" + Date.now()); let websocket2_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=2-2-" + Date.now());
// @ts-ignore // @ts-ignore

View File

@ -34,7 +34,7 @@ function TitleBox(props: titleProps) {
case "right_up": case "right_up":
return { return {
img: Num, img: Num,
title: "各工段投入和产出", title: "各工段当日投入和产出",
}; };
default: default:
return { return {

View File

@ -9,8 +9,8 @@ import { useDispatch } from 'react-redux';
import { UpdateLine3Before } from "../../store/LinePageSlice"; import { UpdateLine3Before } from "../../store/LinePageSlice";
function LinePage() { function LinePage() {
const dispatch = useDispatch(); const dispatch = useDispatch();
// const myUrl = "192.168.8.22" const myUrl = "192.168.8.22"
const myUrl = window.location.host; // const myUrl = window.location.host;
useEffect(() => { useEffect(() => {
let websocket3_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=3-1-" + Date.now()); let websocket3_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=3-1-" + Date.now());
// @ts-ignore // @ts-ignore

View File

@ -34,7 +34,7 @@ function TitleBox(props: titleProps) {
case "right_up": case "right_up":
return { return {
img: Num, img: Num,
title: "各工段投入和产出", title: "各工段当日投入和产出",
}; };
default: default:
return { return {

View File

@ -9,8 +9,8 @@ import { useDispatch } from 'react-redux';
import { UpdateLine3After } from "../../store/LinePageSlice"; import { UpdateLine3After } from "../../store/LinePageSlice";
function LinePage() { function LinePage() {
const dispatch = useDispatch(); const dispatch = useDispatch();
// const myUrl = "192.168.8.22" const myUrl = "192.168.8.22"
const myUrl = window.location.host; // const myUrl = window.location.host;
useEffect(() => { useEffect(() => {
let websocket3_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=3-2-" + Date.now()); let websocket3_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=3-2-" + Date.now());
// @ts-ignore // @ts-ignore

View File

@ -34,7 +34,7 @@ function TitleBox(props: titleProps) {
case "right_up": case "right_up":
return { return {
img: Num, img: Num,
title: "各工段投入和产出", title: "各工段当日投入和产出",
}; };
default: default:
return { return {

View File

@ -9,8 +9,8 @@ import { useDispatch } from 'react-redux';
import { UpdateLine4Before } from "../../store/LinePageSlice"; import { UpdateLine4Before } from "../../store/LinePageSlice";
function LinePage() { function LinePage() {
const dispatch = useDispatch(); const dispatch = useDispatch();
// const myUrl = "192.168.8.22" const myUrl = "192.168.8.22"
const myUrl = window.location.host; // const myUrl = window.location.host;
useEffect(() => { useEffect(() => {
let websocket4_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=4-1-" + Date.now()); let websocket4_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=4-1-" + Date.now());
// @ts-ignore // @ts-ignore

View File

@ -34,7 +34,7 @@ function TitleBox(props: titleProps) {
case "right_up": case "right_up":
return { return {
img: Num, img: Num,
title: "各工段投入和产出", title: "各工段当日投入和产出",
}; };
default: default:
return { return {

View File

@ -9,8 +9,8 @@ import { useDispatch } from 'react-redux';
import { UpdateLine4After } from "../../store/LinePageSlice"; import { UpdateLine4After } from "../../store/LinePageSlice";
function LinePage() { function LinePage() {
const dispatch = useDispatch(); const dispatch = useDispatch();
// const myUrl = "192.168.8.22" const myUrl = "192.168.8.22"
const myUrl = window.location.host; // const myUrl = window.location.host;
useEffect(() => { useEffect(() => {
let websocket4_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=4-2-" + Date.now()); let websocket4_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=4-2-" + Date.now());
// @ts-ignore // @ts-ignore

View File

@ -34,7 +34,7 @@ function TitleBox(props: titleProps) {
case "right_up": case "right_up":
return { return {
img: Num, img: Num,
title: "各工段投入和产出", title: "各工段当日投入和产出",
}; };
default: default:
return { return {

View File

@ -9,8 +9,8 @@ import { useDispatch } from 'react-redux';
import { UpdateLine5Before } from "../../store/LinePageSlice"; import { UpdateLine5Before } from "../../store/LinePageSlice";
function LinePage() { function LinePage() {
const dispatch = useDispatch(); const dispatch = useDispatch();
// const myUrl = "192.168.8.22" const myUrl = "192.168.8.22"
const myUrl = window.location.host; // const myUrl = window.location.host;
useEffect(() => { useEffect(() => {
let websocket5_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=5-1-" + Date.now()); let websocket5_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=5-1-" + Date.now());
// @ts-ignore // @ts-ignore

View File

@ -34,7 +34,7 @@ function TitleBox(props: titleProps) {
case "right_up": case "right_up":
return { return {
img: Num, img: Num,
title: "各工段投入和产出", title: "各工段当日投入和产出",
}; };
default: default:
return { return {

View File

@ -9,8 +9,8 @@ import { useDispatch } from 'react-redux';
import { UpdateLine5After } from "../../store/LinePageSlice"; import { UpdateLine5After } from "../../store/LinePageSlice";
function LinePage() { function LinePage() {
const dispatch = useDispatch(); const dispatch = useDispatch();
// const myUrl = "192.168.8.22" const myUrl = "192.168.8.22"
const myUrl = window.location.host; // const myUrl = window.location.host;
useEffect(() => { useEffect(() => {
let websocket5_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=5-2-" + Date.now()); let websocket5_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=5-2-" + Date.now());
// @ts-ignore // @ts-ignore

View File

@ -21,8 +21,8 @@ function UpdateData() {
// .then((r) => { // .then((r) => {
// setUrl(r.data.url) // setUrl(r.data.url)
// }) // })
// const myUrl = "192.168.8.22" const myUrl = "192.168.8.22"
const myUrl = window.location.host; // const myUrl = window.location.host;
let websocketAllLine = null; let websocketAllLine = null;
// let websocket1_1 = null; // let websocket1_1 = null;
// let websocket1_2 = null; // let websocket1_2 = null;