From ebe2a03023ac6a4b7edba54ae43d54dadb874eab Mon Sep 17 00:00:00 2001 From: gtz <535262213@qq.com> Date: Mon, 25 Aug 2025 15:21:36 +0800 Subject: [PATCH] 1 --- src/page/LinePage1-1/Center/CenterDown.tsx | 4 +- .../LinePage1-1/Component/TitleBox/index.tsx | 2 +- src/page/LinePage1-1/Left/LeftUp.tsx | 84 +++++++++---------- src/page/LinePage1-1/index.tsx | 5 +- .../LinePage1-2/Component/TitleBox/index.tsx | 2 +- src/page/LinePage1-2/index.tsx | 4 +- .../LinePage2-1/Component/TitleBox/index.tsx | 2 +- src/page/LinePage2-1/index.tsx | 4 +- .../LinePage2-2/Component/TitleBox/index.tsx | 2 +- src/page/LinePage2-2/index.tsx | 4 +- .../LinePage3-1/Component/TitleBox/index.tsx | 2 +- src/page/LinePage3-1/index.tsx | 4 +- .../LinePage3-2/Component/TitleBox/index.tsx | 2 +- src/page/LinePage3-2/index.tsx | 4 +- .../LinePage4-1/Component/TitleBox/index.tsx | 2 +- src/page/LinePage4-1/index.tsx | 4 +- .../LinePage4-2/Component/TitleBox/index.tsx | 2 +- src/page/LinePage4-2/index.tsx | 4 +- .../LinePage5-1/Component/TitleBox/index.tsx | 2 +- src/page/LinePage5-1/index.tsx | 4 +- .../LinePage5-2/Component/TitleBox/index.tsx | 2 +- src/page/LinePage5-2/index.tsx | 4 +- src/store/UpdateData.tsx | 4 +- 23 files changed, 78 insertions(+), 75 deletions(-) diff --git a/src/page/LinePage1-1/Center/CenterDown.tsx b/src/page/LinePage1-1/Center/CenterDown.tsx index 71623fd..d6b6f1f 100644 --- a/src/page/LinePage1-1/Center/CenterDown.tsx +++ b/src/page/LinePage1-1/Center/CenterDown.tsx @@ -102,7 +102,7 @@ function CenterDown() { // @ts-ignore data.weekProductionRates[keys[0]].forEach((item,index)=>{ // @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)=>{ let obj = { @@ -155,6 +155,8 @@ function CenterDown() { dataSource.month.xData = [] dataSource.month.series = [] } + console.log('activeName', activeName) + console.log('dataSource', dataSource) let chartData = (dataSource as { [key: string]: any })[activeName]; const options = getOptions(chartData); return ( diff --git a/src/page/LinePage1-1/Component/TitleBox/index.tsx b/src/page/LinePage1-1/Component/TitleBox/index.tsx index 6d654c1..2e33a98 100644 --- a/src/page/LinePage1-1/Component/TitleBox/index.tsx +++ b/src/page/LinePage1-1/Component/TitleBox/index.tsx @@ -34,7 +34,7 @@ function TitleBox(props: titleProps) { case "right_up": return { img: Num, - title: "各工段总投入和产出", + title: "各工段当日投入和产出", }; default: return { diff --git a/src/page/LinePage1-1/Left/LeftUp.tsx b/src/page/LinePage1-1/Left/LeftUp.tsx index b69229d..a2b7486 100644 --- a/src/page/LinePage1-1/Left/LeftUp.tsx +++ b/src/page/LinePage1-1/Left/LeftUp.tsx @@ -82,20 +82,20 @@ function LeftUp() { } sum.push(sumIner) } - dataSource.day.series.push({ - data: sum, - type: "bar", - stack: "a", - name: "", - label: { - show: true, - position: "top", - color: "#fff", - formatter: function (params: any) { - return sum[params.dataIndex]; - }, - }, - }) + // dataSource.day.series.push({ + // data: sum, + // type: "bar", + // stack: "a", + // name: "", + // label: { + // show: true, + // position: "top", + // color: "#fff", + // formatter: function (params: any) { + // return sum[params.dataIndex]; + // }, + // }, + // }) }else{ dataSource.day.xData = [] dataSource.day.series = [] @@ -150,20 +150,20 @@ function LeftUp() { } sum.push(sumIner) } - dataSource.week.series.push({ - data: sum, - type: "bar", - stack: "a", - name: "", - label: { - show: true, - position: "top", - color: "#fff", - formatter: function (params: any) { - return sum[params.dataIndex]; - }, - }, - }) + // dataSource.week.series.push({ + // data: sum, + // type: "bar", + // stack: "a", + // name: "", + // label: { + // show: true, + // position: "top", + // color: "#fff", + // formatter: function (params: any) { + // return sum[params.dataIndex]; + // }, + // }, + // }) }else{ dataSource.week.xData = [] dataSource.week.series = [] @@ -218,20 +218,20 @@ function LeftUp() { } sum.push(sumIner) } - dataSource.month.series.push({ - data: sum, - type: "bar", - stack: "a", - name: "", - label: { - show: true, - position: "top", - color: "#fff", - formatter: function (params: any) { - return sum[params.dataIndex]; - }, - }, - }) + // dataSource.month.series.push({ + // data: sum, + // type: "bar", + // stack: "a", + // name: "", + // label: { + // show: true, + // position: "top", + // color: "#fff", + // formatter: function (params: any) { + // return sum[params.dataIndex]; + // }, + // }, + // }) }else{ dataSource.month.xData = [] dataSource.month.series = [] diff --git a/src/page/LinePage1-1/index.tsx b/src/page/LinePage1-1/index.tsx index 27907ae..216deb0 100644 --- a/src/page/LinePage1-1/index.tsx +++ b/src/page/LinePage1-1/index.tsx @@ -9,8 +9,8 @@ import { useDispatch } from 'react-redux'; import { UpdateLine1Before } from "../../store/LinePageSlice"; function LinePage() { const dispatch = useDispatch(); - // const myUrl = "192.168.8.22" - const myUrl = window.location.host; + const myUrl = "192.168.8.22" + // const myUrl = window.location.host; useEffect(() => { let websocket1_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=1-1-" + Date.now()); // @ts-ignore @@ -18,6 +18,7 @@ function LinePage() { let msgData = event.data try { msgData = JSON.parse(event.data); + console.log(msgData) } catch (error) { console.log("websocket: [unable to msgData] : ", event.data); } diff --git a/src/page/LinePage1-2/Component/TitleBox/index.tsx b/src/page/LinePage1-2/Component/TitleBox/index.tsx index 6d654c1..2e33a98 100644 --- a/src/page/LinePage1-2/Component/TitleBox/index.tsx +++ b/src/page/LinePage1-2/Component/TitleBox/index.tsx @@ -34,7 +34,7 @@ function TitleBox(props: titleProps) { case "right_up": return { img: Num, - title: "各工段总投入和产出", + title: "各工段当日投入和产出", }; default: return { diff --git a/src/page/LinePage1-2/index.tsx b/src/page/LinePage1-2/index.tsx index c01f689..ca9d2bc 100644 --- a/src/page/LinePage1-2/index.tsx +++ b/src/page/LinePage1-2/index.tsx @@ -9,8 +9,8 @@ import { useDispatch } from 'react-redux'; import { UpdateLine1After } from "../../store/LinePageSlice"; function LinePage() { const dispatch = useDispatch(); - // const myUrl = "192.168.8.22" - const myUrl = window.location.host; + const myUrl = "192.168.8.22" + // const myUrl = window.location.host; useEffect(() => { let websocket1_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=1-2-" + Date.now()); // @ts-ignore diff --git a/src/page/LinePage2-1/Component/TitleBox/index.tsx b/src/page/LinePage2-1/Component/TitleBox/index.tsx index 6d654c1..2e33a98 100644 --- a/src/page/LinePage2-1/Component/TitleBox/index.tsx +++ b/src/page/LinePage2-1/Component/TitleBox/index.tsx @@ -34,7 +34,7 @@ function TitleBox(props: titleProps) { case "right_up": return { img: Num, - title: "各工段总投入和产出", + title: "各工段当日投入和产出", }; default: return { diff --git a/src/page/LinePage2-1/index.tsx b/src/page/LinePage2-1/index.tsx index 09501ac..69df568 100644 --- a/src/page/LinePage2-1/index.tsx +++ b/src/page/LinePage2-1/index.tsx @@ -9,8 +9,8 @@ import { useDispatch } from 'react-redux'; import { UpdateLine2Before } from "../../store/LinePageSlice"; function LinePage() { const dispatch = useDispatch(); - // const myUrl = "192.168.8.22" - const myUrl = window.location.host; + const myUrl = "192.168.8.22" + // const myUrl = window.location.host; useEffect(() => { let websocket2_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=2-1-" + Date.now()); // @ts-ignore diff --git a/src/page/LinePage2-2/Component/TitleBox/index.tsx b/src/page/LinePage2-2/Component/TitleBox/index.tsx index 6d654c1..2e33a98 100644 --- a/src/page/LinePage2-2/Component/TitleBox/index.tsx +++ b/src/page/LinePage2-2/Component/TitleBox/index.tsx @@ -34,7 +34,7 @@ function TitleBox(props: titleProps) { case "right_up": return { img: Num, - title: "各工段总投入和产出", + title: "各工段当日投入和产出", }; default: return { diff --git a/src/page/LinePage2-2/index.tsx b/src/page/LinePage2-2/index.tsx index 3a84ed4..83678b1 100644 --- a/src/page/LinePage2-2/index.tsx +++ b/src/page/LinePage2-2/index.tsx @@ -9,8 +9,8 @@ import { useDispatch } from 'react-redux'; import { UpdateLine2After } from "../../store/LinePageSlice"; function LinePage() { const dispatch = useDispatch(); - // const myUrl = "192.168.8.22" - const myUrl = window.location.host; + const myUrl = "192.168.8.22" + // const myUrl = window.location.host; useEffect(() => { let websocket2_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=2-2-" + Date.now()); // @ts-ignore diff --git a/src/page/LinePage3-1/Component/TitleBox/index.tsx b/src/page/LinePage3-1/Component/TitleBox/index.tsx index 6d654c1..2e33a98 100644 --- a/src/page/LinePage3-1/Component/TitleBox/index.tsx +++ b/src/page/LinePage3-1/Component/TitleBox/index.tsx @@ -34,7 +34,7 @@ function TitleBox(props: titleProps) { case "right_up": return { img: Num, - title: "各工段总投入和产出", + title: "各工段当日投入和产出", }; default: return { diff --git a/src/page/LinePage3-1/index.tsx b/src/page/LinePage3-1/index.tsx index 4176e61..d50ab32 100644 --- a/src/page/LinePage3-1/index.tsx +++ b/src/page/LinePage3-1/index.tsx @@ -9,8 +9,8 @@ import { useDispatch } from 'react-redux'; import { UpdateLine3Before } from "../../store/LinePageSlice"; function LinePage() { const dispatch = useDispatch(); - // const myUrl = "192.168.8.22" - const myUrl = window.location.host; + const myUrl = "192.168.8.22" + // const myUrl = window.location.host; useEffect(() => { let websocket3_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=3-1-" + Date.now()); // @ts-ignore diff --git a/src/page/LinePage3-2/Component/TitleBox/index.tsx b/src/page/LinePage3-2/Component/TitleBox/index.tsx index 6d654c1..2e33a98 100644 --- a/src/page/LinePage3-2/Component/TitleBox/index.tsx +++ b/src/page/LinePage3-2/Component/TitleBox/index.tsx @@ -34,7 +34,7 @@ function TitleBox(props: titleProps) { case "right_up": return { img: Num, - title: "各工段总投入和产出", + title: "各工段当日投入和产出", }; default: return { diff --git a/src/page/LinePage3-2/index.tsx b/src/page/LinePage3-2/index.tsx index d67114a..20383be 100644 --- a/src/page/LinePage3-2/index.tsx +++ b/src/page/LinePage3-2/index.tsx @@ -9,8 +9,8 @@ import { useDispatch } from 'react-redux'; import { UpdateLine3After } from "../../store/LinePageSlice"; function LinePage() { const dispatch = useDispatch(); - // const myUrl = "192.168.8.22" - const myUrl = window.location.host; + const myUrl = "192.168.8.22" + // const myUrl = window.location.host; useEffect(() => { let websocket3_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=3-2-" + Date.now()); // @ts-ignore diff --git a/src/page/LinePage4-1/Component/TitleBox/index.tsx b/src/page/LinePage4-1/Component/TitleBox/index.tsx index 6d654c1..2e33a98 100644 --- a/src/page/LinePage4-1/Component/TitleBox/index.tsx +++ b/src/page/LinePage4-1/Component/TitleBox/index.tsx @@ -34,7 +34,7 @@ function TitleBox(props: titleProps) { case "right_up": return { img: Num, - title: "各工段总投入和产出", + title: "各工段当日投入和产出", }; default: return { diff --git a/src/page/LinePage4-1/index.tsx b/src/page/LinePage4-1/index.tsx index 12eba4b..7e704b2 100644 --- a/src/page/LinePage4-1/index.tsx +++ b/src/page/LinePage4-1/index.tsx @@ -9,8 +9,8 @@ import { useDispatch } from 'react-redux'; import { UpdateLine4Before } from "../../store/LinePageSlice"; function LinePage() { const dispatch = useDispatch(); - // const myUrl = "192.168.8.22" - const myUrl = window.location.host; + const myUrl = "192.168.8.22" + // const myUrl = window.location.host; useEffect(() => { let websocket4_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=4-1-" + Date.now()); // @ts-ignore diff --git a/src/page/LinePage4-2/Component/TitleBox/index.tsx b/src/page/LinePage4-2/Component/TitleBox/index.tsx index 6d654c1..2e33a98 100644 --- a/src/page/LinePage4-2/Component/TitleBox/index.tsx +++ b/src/page/LinePage4-2/Component/TitleBox/index.tsx @@ -34,7 +34,7 @@ function TitleBox(props: titleProps) { case "right_up": return { img: Num, - title: "各工段总投入和产出", + title: "各工段当日投入和产出", }; default: return { diff --git a/src/page/LinePage4-2/index.tsx b/src/page/LinePage4-2/index.tsx index 9482f2b..31b37cf 100644 --- a/src/page/LinePage4-2/index.tsx +++ b/src/page/LinePage4-2/index.tsx @@ -9,8 +9,8 @@ import { useDispatch } from 'react-redux'; import { UpdateLine4After } from "../../store/LinePageSlice"; function LinePage() { const dispatch = useDispatch(); - // const myUrl = "192.168.8.22" - const myUrl = window.location.host; + const myUrl = "192.168.8.22" + // const myUrl = window.location.host; useEffect(() => { let websocket4_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=4-2-" + Date.now()); // @ts-ignore diff --git a/src/page/LinePage5-1/Component/TitleBox/index.tsx b/src/page/LinePage5-1/Component/TitleBox/index.tsx index 6d654c1..2e33a98 100644 --- a/src/page/LinePage5-1/Component/TitleBox/index.tsx +++ b/src/page/LinePage5-1/Component/TitleBox/index.tsx @@ -34,7 +34,7 @@ function TitleBox(props: titleProps) { case "right_up": return { img: Num, - title: "各工段总投入和产出", + title: "各工段当日投入和产出", }; default: return { diff --git a/src/page/LinePage5-1/index.tsx b/src/page/LinePage5-1/index.tsx index e8a585e..227df0f 100644 --- a/src/page/LinePage5-1/index.tsx +++ b/src/page/LinePage5-1/index.tsx @@ -9,8 +9,8 @@ import { useDispatch } from 'react-redux'; import { UpdateLine5Before } from "../../store/LinePageSlice"; function LinePage() { const dispatch = useDispatch(); - // const myUrl = "192.168.8.22" - const myUrl = window.location.host; + const myUrl = "192.168.8.22" + // const myUrl = window.location.host; useEffect(() => { let websocket5_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=5-1-" + Date.now()); // @ts-ignore diff --git a/src/page/LinePage5-2/Component/TitleBox/index.tsx b/src/page/LinePage5-2/Component/TitleBox/index.tsx index 6d654c1..2e33a98 100644 --- a/src/page/LinePage5-2/Component/TitleBox/index.tsx +++ b/src/page/LinePage5-2/Component/TitleBox/index.tsx @@ -34,7 +34,7 @@ function TitleBox(props: titleProps) { case "right_up": return { img: Num, - title: "各工段总投入和产出", + title: "各工段当日投入和产出", }; default: return { diff --git a/src/page/LinePage5-2/index.tsx b/src/page/LinePage5-2/index.tsx index 3874cad..747c130 100644 --- a/src/page/LinePage5-2/index.tsx +++ b/src/page/LinePage5-2/index.tsx @@ -9,8 +9,8 @@ import { useDispatch } from 'react-redux'; import { UpdateLine5After } from "../../store/LinePageSlice"; function LinePage() { const dispatch = useDispatch(); - // const myUrl = "192.168.8.22" - const myUrl = window.location.host; + const myUrl = "192.168.8.22" + // const myUrl = window.location.host; useEffect(() => { let websocket5_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=5-2-" + Date.now()); // @ts-ignore diff --git a/src/store/UpdateData.tsx b/src/store/UpdateData.tsx index 8d0d9dc..a19d52a 100644 --- a/src/store/UpdateData.tsx +++ b/src/store/UpdateData.tsx @@ -21,8 +21,8 @@ function UpdateData() { // .then((r) => { // setUrl(r.data.url) // }) - // const myUrl = "192.168.8.22" - const myUrl = window.location.host; + const myUrl = "192.168.8.22" + // const myUrl = window.location.host; let websocketAllLine = null; // let websocket1_1 = null; // let websocket1_2 = null;