改变链接位置,改成在每个页面链接
This commit is contained in:
parent
45c8563892
commit
40791bc619
@ -81,7 +81,7 @@
|
|||||||
"workbox-webpack-plugin": "^6.4.1"
|
"workbox-webpack-plugin": "^6.4.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node scripts/start.js",
|
"start": "node --max-old-space-size=4096 scripts/start.js",
|
||||||
"build": "node scripts/build.js",
|
"build": "node scripts/build.js",
|
||||||
"test": "node scripts/test.js"
|
"test": "node scripts/test.js"
|
||||||
},
|
},
|
||||||
|
@ -185,7 +185,7 @@ function MybabylonJS({ modelPath }: MybabylonJSProps) {
|
|||||||
currentMeshesRef.current.push(...LOD0MESH2.meshes);
|
currentMeshesRef.current.push(...LOD0MESH2.meshes);
|
||||||
// ...为新加载的模型设置交互逻辑
|
// ...为新加载的模型设置交互逻辑
|
||||||
|
|
||||||
LOD0MESH1.meshes.map((mesh) => {
|
LOD0MESH1.meshes.forEach((mesh) => {
|
||||||
mesh.isPickable = true;
|
mesh.isPickable = true;
|
||||||
mesh.actionManager = new BABYLON.ActionManager(scene);
|
mesh.actionManager = new BABYLON.ActionManager(scene);
|
||||||
if (modelPath.slice(-1) === "1") {
|
if (modelPath.slice(-1) === "1") {
|
||||||
@ -227,7 +227,7 @@ function MybabylonJS({ modelPath }: MybabylonJSProps) {
|
|||||||
setSelectedMeshId(MeshNameId);
|
setSelectedMeshId(MeshNameId);
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
LOD0MESH2.meshes.map((mesh) => {
|
LOD0MESH2.meshes.forEach((mesh) => {
|
||||||
mesh.isPickable = true;
|
mesh.isPickable = true;
|
||||||
mesh.actionManager = new BABYLON.ActionManager(scene);
|
mesh.actionManager = new BABYLON.ActionManager(scene);
|
||||||
if (modelPath.slice(-1) === "1") {
|
if (modelPath.slice(-1) === "1") {
|
||||||
|
@ -12,6 +12,15 @@ import AlarmTipGreen from "./../page/assets/icon/g.png";
|
|||||||
import AlarmTipYellow from "./../page/assets/icon/y.png";
|
import AlarmTipYellow from "./../page/assets/icon/y.png";
|
||||||
import AlarmTipRed from "./../page/assets/icon/r.png";
|
import AlarmTipRed from "./../page/assets/icon/r.png";
|
||||||
import {selectLine1Before} from "../store/LinePageSlice";
|
import {selectLine1Before} from "../store/LinePageSlice";
|
||||||
|
import {selectLine1After} from "../store/LinePageSlice";
|
||||||
|
import {selectLine2Before} from "../store/LinePageSlice";
|
||||||
|
import {selectLine2After} from "../store/LinePageSlice";
|
||||||
|
import {selectLine3Before} from "../store/LinePageSlice";
|
||||||
|
import {selectLine3After} from "../store/LinePageSlice";
|
||||||
|
import {selectLine4Before} from "../store/LinePageSlice";
|
||||||
|
import {selectLine4After} from "../store/LinePageSlice";
|
||||||
|
import {selectLine5Before} from "../store/LinePageSlice";
|
||||||
|
import {selectLine5After} from "../store/LinePageSlice";
|
||||||
|
|
||||||
const lineNameNo = ["一","二","三","四","五"]
|
const lineNameNo = ["一","二","三","四","五"]
|
||||||
const myStyle = {
|
const myStyle = {
|
||||||
@ -40,7 +49,6 @@ interface EqMsg {
|
|||||||
}
|
}
|
||||||
function MybabylonJS({ modelPath }: MybabylonJSProps) {
|
function MybabylonJS({ modelPath }: MybabylonJSProps) {
|
||||||
const [eqList, setEqList] = useState<EqListType>({});
|
const [eqList, setEqList] = useState<EqListType>({});
|
||||||
const allData = useAppSelector(selectLine1Before) as any; // 使用`any`来绕过类型检查
|
|
||||||
const canvasRef = useRef(null);
|
const canvasRef = useRef(null);
|
||||||
const resetRef = useRef<(() => void) | null>(null);
|
const resetRef = useRef<(() => void) | null>(null);
|
||||||
const [selectedMeshName, setSelectedMeshName] = useState<string | null>(null);
|
const [selectedMeshName, setSelectedMeshName] = useState<string | null>(null);
|
||||||
@ -52,6 +60,23 @@ function MybabylonJS({ modelPath }: MybabylonJSProps) {
|
|||||||
});
|
});
|
||||||
const [showInfo, setShowInfo] = useState(true);
|
const [showInfo, setShowInfo] = useState(true);
|
||||||
|
|
||||||
|
const selectorMap: Record<string, (state: any) => any> = {
|
||||||
|
"Line1-1": selectLine1Before,
|
||||||
|
"Line1-2": selectLine1After,
|
||||||
|
"Line2-1": selectLine2Before,
|
||||||
|
"Line2-2": selectLine2After,
|
||||||
|
"Line3-1": selectLine3Before,
|
||||||
|
"Line3-2": selectLine3After,
|
||||||
|
"Line4-1": selectLine4Before,
|
||||||
|
"Line4-2": selectLine4After,
|
||||||
|
"Line5-1": selectLine5Before,
|
||||||
|
"Line5-2": selectLine5After
|
||||||
|
};
|
||||||
|
const selectedSelector = selectorMap[modelPath];
|
||||||
|
const allData = useAppSelector(selectedSelector);
|
||||||
|
// const allData = useAppSelector(selectLine1Before) as any;
|
||||||
|
|
||||||
|
|
||||||
// 使用 useRef 来存储当前加载的模型引用
|
// 使用 useRef 来存储当前加载的模型引用
|
||||||
const currentMeshesRef = useRef<Array<BABYLON.AbstractMesh>>([]);
|
const currentMeshesRef = useRef<Array<BABYLON.AbstractMesh>>([]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -183,7 +208,7 @@ function MybabylonJS({ modelPath }: MybabylonJSProps) {
|
|||||||
|
|
||||||
// ...为新加载的模型设置交互逻辑
|
// ...为新加载的模型设置交互逻辑
|
||||||
|
|
||||||
LOD0MESH.meshes.map((mesh) => {
|
LOD0MESH.meshes.forEach((mesh) => {
|
||||||
mesh.isPickable = true;
|
mesh.isPickable = true;
|
||||||
mesh.actionManager = new BABYLON.ActionManager(scene);
|
mesh.actionManager = new BABYLON.ActionManager(scene);
|
||||||
if (modelPath.slice(-1) === "1") {
|
if (modelPath.slice(-1) === "1") {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import * as echarts from "echarts";
|
|
||||||
export default function getOptions(tempData: any) {
|
export default function getOptions(tempData: any) {
|
||||||
if (Object.keys(tempData).length === 0) {
|
if (Object.keys(tempData).length === 0) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -5,7 +5,6 @@ import { deepClone } from "./util/utils";
|
|||||||
import { co } from "./util";
|
import { co } from "./util";
|
||||||
import classnames from "classnames";
|
import classnames from "classnames";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
import { current } from "@reduxjs/toolkit";
|
|
||||||
interface ScrollBoardProps {
|
interface ScrollBoardProps {
|
||||||
config?: object;
|
config?: object;
|
||||||
onClick?: () => void;
|
onClick?: () => void;
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
import React from "react";
|
|
||||||
import "./style/standard.css"
|
import "./style/standard.css"
|
||||||
import intl from "react-intl-universal";
|
|
||||||
|
|
||||||
|
|
||||||
function ErrorPage() {
|
function ErrorPage() {
|
||||||
|
@ -3,7 +3,6 @@ import TitleBox from "../Component/TitleBox";
|
|||||||
import getOptions from "../../Component/BarLineChart/chart.config";
|
import getOptions from "../../Component/BarLineChart/chart.config";
|
||||||
import {useAppSelector} from "./../../../store/hooks"
|
import {useAppSelector} from "./../../../store/hooks"
|
||||||
import { selectAllLine } from "./../../../store/LeaderPageSlice";
|
import { selectAllLine } from "./../../../store/LeaderPageSlice";
|
||||||
import { Fragment } from "react/jsx-runtime";
|
|
||||||
function LeftDown() {
|
function LeftDown() {
|
||||||
const data = useAppSelector(selectAllLine);
|
const data = useAppSelector(selectAllLine);
|
||||||
interface Detail {
|
interface Detail {
|
||||||
|
@ -29,7 +29,7 @@ function CenterDown() {
|
|||||||
{ name: "周", ename: "week" },
|
{ name: "周", ename: "week" },
|
||||||
{ name: "月", ename: "month" },
|
{ name: "月", ename: "month" },
|
||||||
];
|
];
|
||||||
const [activeName, setActiveName] = useState<string>(nameList[1].ename);
|
const [activeName] = useState<string>(nameList[1].ename);
|
||||||
// const handleButtonChange = (activeName: string) => {
|
// const handleButtonChange = (activeName: string) => {
|
||||||
// setActiveName(activeName);
|
// setActiveName(activeName);
|
||||||
// };
|
// };
|
||||||
@ -52,7 +52,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
sumAlarm = data.alarms.length
|
sumAlarm = data.alarms.length
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.alarms.map((item,index) => {
|
data.alarms.forEach((item,index) => {
|
||||||
let arrInner = []
|
let arrInner = []
|
||||||
arrInner.push(
|
arrInner.push(
|
||||||
index+1,
|
index+1,
|
||||||
@ -70,11 +70,11 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let keys = Object.keys(data.todayProductionRates)
|
let keys = Object.keys(data.todayProductionRates)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionRates[keys[0]].map((item,index)=>{
|
data.todayProductionRates[keys[0]].forEach((item,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
dataSource.day.xData.push(dayjs(item.recTime).format("HH:mm"))
|
dataSource.day.xData.push(dayjs(item.recTime).format("HH:mm"))
|
||||||
})
|
})
|
||||||
keys.map((item,index)=>{
|
keys.forEach((item,index)=>{
|
||||||
let obj = {
|
let obj = {
|
||||||
name: "",
|
name: "",
|
||||||
type: "line",
|
type: "line",
|
||||||
@ -85,7 +85,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.name = data.todayProductionRates[item][0].lineName
|
obj.name = data.todayProductionRates[item][0].lineName
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionRates[item].map((subItem,index)=>{
|
data.todayProductionRates[item].forEach((subItem,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.data.push(subItem.passRate)
|
obj.data.push(subItem.passRate)
|
||||||
})
|
})
|
||||||
@ -100,11 +100,11 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let keys = Object.keys(data.weekProductionRates)
|
let keys = Object.keys(data.weekProductionRates)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionRates[keys[0]].map((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("HH:mm"))
|
||||||
})
|
})
|
||||||
keys.map((item,index)=>{
|
keys.forEach((item,index)=>{
|
||||||
let obj = {
|
let obj = {
|
||||||
name: "",
|
name: "",
|
||||||
type: "line",
|
type: "line",
|
||||||
@ -115,7 +115,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.name = data.weekProductionRates[item][0].lineName
|
obj.name = data.weekProductionRates[item][0].lineName
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionRates[item].map((subItem,index)=>{
|
data.weekProductionRates[item].forEach((subItem,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.data.push(subItem.passRate)
|
obj.data.push(subItem.passRate)
|
||||||
})
|
})
|
||||||
@ -130,11 +130,11 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let keys = Object.keys(data.monthProductionRates)
|
let keys = Object.keys(data.monthProductionRates)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionRates[keys[0]].map((item,index)=>{
|
data.monthProductionRates[keys[0]].forEach((item,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
dataSource.month.xData.push(dayjs(item.recTime).format("HH:mm"))
|
dataSource.month.xData.push(dayjs(item.recTime).format("HH:mm"))
|
||||||
})
|
})
|
||||||
keys.map((item,index)=>{
|
keys.forEach((item,index)=>{
|
||||||
let obj = {
|
let obj = {
|
||||||
name: "",
|
name: "",
|
||||||
type: "line",
|
type: "line",
|
||||||
@ -145,7 +145,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.name = data.monthProductionRates[item][0].lineName
|
obj.name = data.monthProductionRates[item][0].lineName
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionRates[item].map((subItem,index)=>{
|
data.monthProductionRates[item].forEach((subItem,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.data.push(subItem.passRate)
|
obj.data.push(subItem.passRate)
|
||||||
})
|
})
|
||||||
@ -192,7 +192,7 @@ function CenterDown() {
|
|||||||
{<ReactECharts option={options} style={{ height: "100%" }} />}
|
{<ReactECharts option={options} style={{ height: "100%" }} />}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{chartData.xData.length==0 && (
|
{chartData.xData.length===0 && (
|
||||||
<p
|
<p
|
||||||
style={{
|
style={{
|
||||||
color: "#cccf",
|
color: "#cccf",
|
||||||
|
@ -77,7 +77,7 @@ function LeftDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.todayProductionScraps && data.todayProductionScraps.length > 0) {
|
if (data.todayProductionScraps && data.todayProductionScraps.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionScraps.map((item,index)=>{
|
data.todayProductionScraps.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
||||||
arr1.push(arrInner);
|
arr1.push(arrInner);
|
||||||
@ -90,7 +90,7 @@ function LeftDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.weekProductionScraps && data.weekProductionScraps.length > 0) {
|
if (data.weekProductionScraps && data.weekProductionScraps.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionScraps.map((item,index)=>{
|
data.weekProductionScraps.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
||||||
arr2.push(arrInner);
|
arr2.push(arrInner);
|
||||||
@ -103,7 +103,7 @@ function LeftDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.monthProductionScraps && data.monthProductionScraps.length > 0) {
|
if (data.monthProductionScraps && data.monthProductionScraps.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionScraps.map((item,index)=>{
|
data.monthProductionScraps.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
||||||
arr3.push(arrInner);
|
arr3.push(arrInner);
|
||||||
|
@ -37,7 +37,7 @@ function LeftUp() {
|
|||||||
let sum: number[] = [];
|
let sum: number[] = [];
|
||||||
// 生成obj
|
// 生成obj
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.scrapBars.map((item,index) => {
|
data.scrapBars.forEach((item,index) => {
|
||||||
let obj = {
|
let obj = {
|
||||||
data: [],
|
data: [],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
@ -67,7 +67,7 @@ function LeftUp() {
|
|||||||
for(let i = 0;i < dataSource.day.series.length;i++){
|
for(let i = 0;i < dataSource.day.series.length;i++){
|
||||||
let itemSeries = dataSource.day.series[i]
|
let itemSeries = dataSource.day.series[i]
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayAllProductionScraps[item].map((itemInner,indexInner)=>{
|
data.todayAllProductionScraps[item].forEach((itemInner,indexInner)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@ -105,7 +105,7 @@ function LeftUp() {
|
|||||||
let sum: number[] = [];
|
let sum: number[] = [];
|
||||||
// 生成obj
|
// 生成obj
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.scrapBars.map((item,index) => {
|
data.scrapBars.forEach((item,index) => {
|
||||||
let obj = {
|
let obj = {
|
||||||
data: [],
|
data: [],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
@ -135,7 +135,7 @@ function LeftUp() {
|
|||||||
for(let i = 0;i < dataSource.week.series.length;i++){
|
for(let i = 0;i < dataSource.week.series.length;i++){
|
||||||
let itemSeries = dataSource.week.series[i]
|
let itemSeries = dataSource.week.series[i]
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekAllProductionScraps[item].map((itemInner,indexInner)=>{
|
data.weekAllProductionScraps[item].forEach((itemInner,indexInner)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@ -173,7 +173,7 @@ function LeftUp() {
|
|||||||
let sum: number[] = [];
|
let sum: number[] = [];
|
||||||
// 生成obj
|
// 生成obj
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.scrapBars.map((item,index) => {
|
data.scrapBars.forEach((item,index) => {
|
||||||
let obj = {
|
let obj = {
|
||||||
data: [],
|
data: [],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
@ -203,7 +203,7 @@ function LeftUp() {
|
|||||||
for(let i = 0;i < dataSource.month.series.length;i++){
|
for(let i = 0;i < dataSource.month.series.length;i++){
|
||||||
let itemSeries = dataSource.month.series[i]
|
let itemSeries = dataSource.month.series[i]
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthAllProductionScraps[item].map((itemInner,indexInner)=>{
|
data.monthAllProductionScraps[item].forEach((itemInner,indexInner)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
@ -81,7 +81,7 @@ function RightDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.todayProductionDets && data.todayProductionDets.length > 0) {
|
if (data.todayProductionDets && data.todayProductionDets.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionDets.map((item,index)=>{
|
data.todayProductionDets.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(dayjs(item.recTime).format("HH:mm"),item.inputNum,item.outputNum);
|
arrInner.push(dayjs(item.recTime).format("HH:mm"),item.inputNum,item.outputNum);
|
||||||
arr1.push(arrInner);
|
arr1.push(arrInner);
|
||||||
@ -97,7 +97,7 @@ function RightDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.weekProductionDets && data.weekProductionDets.length > 0) {
|
if (data.weekProductionDets && data.weekProductionDets.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionDets.map((item,index)=>{
|
data.weekProductionDets.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
||||||
arr2.push(arrInner);
|
arr2.push(arrInner);
|
||||||
@ -113,7 +113,7 @@ function RightDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.monthProductionDets && data.monthProductionDets.length > 0) {
|
if (data.monthProductionDets && data.monthProductionDets.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionDets.map((item,index)=>{
|
data.monthProductionDets.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
||||||
arr3.push(arrInner);
|
arr3.push(arrInner);
|
||||||
|
@ -19,7 +19,7 @@ function RightUp() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.sectionDet && data.sectionDet.length > 0) {
|
if (data.sectionDet && data.sectionDet.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.sectionDet.map((item, index) => {
|
data.sectionDet.forEach((item, index) => {
|
||||||
let arrInner = []
|
let arrInner = []
|
||||||
arrInner.push(index + 1, item.lineName, item.inputNum, item.outputNum)
|
arrInner.push(index + 1, item.lineName, item.inputNum, item.outputNum)
|
||||||
arr.push(arrInner)
|
arr.push(arrInner)
|
||||||
|
@ -5,7 +5,31 @@ import Right from "./Right";
|
|||||||
import Center from "./Center";
|
import Center from "./Center";
|
||||||
import {useEffect} from 'react';
|
import {useEffect} from 'react';
|
||||||
import {useNavigate} from "react-router-dom";
|
import {useNavigate} from "react-router-dom";
|
||||||
|
import { useDispatch } from 'react-redux';
|
||||||
|
import { UpdateLine1Before } from "../../store/LinePageSlice";
|
||||||
function LinePage() {
|
function LinePage() {
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
// 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
|
||||||
|
websocket1_1.onmessage = function (event) {
|
||||||
|
let msgData = event.data
|
||||||
|
try {
|
||||||
|
msgData = JSON.parse(event.data);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("websocket: [unable to msgData] : ", event.data);
|
||||||
|
}
|
||||||
|
if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
||||||
|
dispatch(UpdateLine1Before(msgData));
|
||||||
|
}
|
||||||
|
// 清理函数
|
||||||
|
return () => {
|
||||||
|
websocket1_1.close();
|
||||||
|
};
|
||||||
|
}, [dispatch]);
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleKeyDown = (event:any) => {
|
const handleKeyDown = (event:any) => {
|
||||||
|
@ -29,7 +29,7 @@ function CenterDown() {
|
|||||||
{ name: "周", ename: "week" },
|
{ name: "周", ename: "week" },
|
||||||
{ name: "月", ename: "month" },
|
{ name: "月", ename: "month" },
|
||||||
];
|
];
|
||||||
const [activeName, setActiveName] = useState<string>(nameList[1].ename);
|
const [activeName] = useState<string>(nameList[1].ename);
|
||||||
// const handleButtonChange = (activeName: string) => {
|
// const handleButtonChange = (activeName: string) => {
|
||||||
// setActiveName(activeName);
|
// setActiveName(activeName);
|
||||||
// };
|
// };
|
||||||
@ -52,7 +52,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
sumAlarm = data.alarms.length
|
sumAlarm = data.alarms.length
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.alarms.map((item,index) => {
|
data.alarms.forEach((item,index) => {
|
||||||
let arrInner = []
|
let arrInner = []
|
||||||
arrInner.push(
|
arrInner.push(
|
||||||
index+1,
|
index+1,
|
||||||
@ -70,11 +70,11 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let keys = Object.keys(data.todayProductionRates)
|
let keys = Object.keys(data.todayProductionRates)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionRates[keys[0]].map((item,index)=>{
|
data.todayProductionRates[keys[0]].forEach((item,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
dataSource.day.xData.push(dayjs(item.recTime).format("HH:mm"))
|
dataSource.day.xData.push(dayjs(item.recTime).format("HH:mm"))
|
||||||
})
|
})
|
||||||
keys.map((item,index)=>{
|
keys.forEach((item,index)=>{
|
||||||
let obj = {
|
let obj = {
|
||||||
name: "",
|
name: "",
|
||||||
type: "line",
|
type: "line",
|
||||||
@ -85,7 +85,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.name = data.todayProductionRates[item][0].lineName
|
obj.name = data.todayProductionRates[item][0].lineName
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionRates[item].map((subItem,index)=>{
|
data.todayProductionRates[item].forEach((subItem,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.data.push(subItem.passRate)
|
obj.data.push(subItem.passRate)
|
||||||
})
|
})
|
||||||
@ -100,11 +100,11 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let keys = Object.keys(data.weekProductionRates)
|
let keys = Object.keys(data.weekProductionRates)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionRates[keys[0]].map((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("HH:mm"))
|
||||||
})
|
})
|
||||||
keys.map((item,index)=>{
|
keys.forEach((item,index)=>{
|
||||||
let obj = {
|
let obj = {
|
||||||
name: "",
|
name: "",
|
||||||
type: "line",
|
type: "line",
|
||||||
@ -115,7 +115,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.name = data.weekProductionRates[item][0].lineName
|
obj.name = data.weekProductionRates[item][0].lineName
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionRates[item].map((subItem,index)=>{
|
data.weekProductionRates[item].forEach((subItem,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.data.push(subItem.passRate)
|
obj.data.push(subItem.passRate)
|
||||||
})
|
})
|
||||||
@ -130,11 +130,11 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let keys = Object.keys(data.monthProductionRates)
|
let keys = Object.keys(data.monthProductionRates)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionRates[keys[0]].map((item,index)=>{
|
data.monthProductionRates[keys[0]].forEach((item,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
dataSource.month.xData.push(dayjs(item.recTime).format("HH:mm"))
|
dataSource.month.xData.push(dayjs(item.recTime).format("HH:mm"))
|
||||||
})
|
})
|
||||||
keys.map((item,index)=>{
|
keys.forEach((item,index)=>{
|
||||||
let obj = {
|
let obj = {
|
||||||
name: "",
|
name: "",
|
||||||
type: "line",
|
type: "line",
|
||||||
@ -145,7 +145,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.name = data.monthProductionRates[item][0].lineName
|
obj.name = data.monthProductionRates[item][0].lineName
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionRates[item].map((subItem,index)=>{
|
data.monthProductionRates[item].forEach((subItem,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.data.push(subItem.passRate)
|
obj.data.push(subItem.passRate)
|
||||||
})
|
})
|
||||||
@ -192,7 +192,7 @@ function CenterDown() {
|
|||||||
{<ReactECharts option={options} style={{ height: "100%" }} />}
|
{<ReactECharts option={options} style={{ height: "100%" }} />}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{chartData.xData.length==0 && (
|
{chartData.xData.length===0 && (
|
||||||
<p
|
<p
|
||||||
style={{
|
style={{
|
||||||
color: "#cccf",
|
color: "#cccf",
|
||||||
|
@ -77,7 +77,7 @@ function LeftDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.todayProductionScraps && data.todayProductionScraps.length > 0) {
|
if (data.todayProductionScraps && data.todayProductionScraps.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionScraps.map((item,index)=>{
|
data.todayProductionScraps.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
||||||
arr1.push(arrInner);
|
arr1.push(arrInner);
|
||||||
@ -90,7 +90,7 @@ function LeftDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.weekProductionScraps && data.weekProductionScraps.length > 0) {
|
if (data.weekProductionScraps && data.weekProductionScraps.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionScraps.map((item,index)=>{
|
data.weekProductionScraps.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
||||||
arr2.push(arrInner);
|
arr2.push(arrInner);
|
||||||
@ -103,7 +103,7 @@ function LeftDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.monthProductionScraps && data.monthProductionScraps.length > 0) {
|
if (data.monthProductionScraps && data.monthProductionScraps.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionScraps.map((item,index)=>{
|
data.monthProductionScraps.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
||||||
arr3.push(arrInner);
|
arr3.push(arrInner);
|
||||||
|
@ -37,7 +37,7 @@ function LeftUp() {
|
|||||||
let sum: number[] = [];
|
let sum: number[] = [];
|
||||||
// 生成obj
|
// 生成obj
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.scrapBars.map((item,index) => {
|
data.scrapBars.forEach((item,index) => {
|
||||||
let obj = {
|
let obj = {
|
||||||
data: [],
|
data: [],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
@ -67,7 +67,7 @@ function LeftUp() {
|
|||||||
for(let i = 0;i < dataSource.day.series.length;i++){
|
for(let i = 0;i < dataSource.day.series.length;i++){
|
||||||
let itemSeries = dataSource.day.series[i]
|
let itemSeries = dataSource.day.series[i]
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayAllProductionScraps[item].map((itemInner,indexInner)=>{
|
data.todayAllProductionScraps[item].forEach((itemInner,indexInner)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@ -105,7 +105,7 @@ function LeftUp() {
|
|||||||
let sum: number[] = [];
|
let sum: number[] = [];
|
||||||
// 生成obj
|
// 生成obj
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.scrapBars.map((item,index) => {
|
data.scrapBars.forEach((item,index) => {
|
||||||
let obj = {
|
let obj = {
|
||||||
data: [],
|
data: [],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
@ -135,7 +135,7 @@ function LeftUp() {
|
|||||||
for(let i = 0;i < dataSource.week.series.length;i++){
|
for(let i = 0;i < dataSource.week.series.length;i++){
|
||||||
let itemSeries = dataSource.week.series[i]
|
let itemSeries = dataSource.week.series[i]
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekAllProductionScraps[item].map((itemInner,indexInner)=>{
|
data.weekAllProductionScraps[item].forEach((itemInner,indexInner)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@ -173,7 +173,7 @@ function LeftUp() {
|
|||||||
let sum: number[] = [];
|
let sum: number[] = [];
|
||||||
// 生成obj
|
// 生成obj
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.scrapBars.map((item,index) => {
|
data.scrapBars.forEach((item,index) => {
|
||||||
let obj = {
|
let obj = {
|
||||||
data: [],
|
data: [],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
@ -203,7 +203,7 @@ function LeftUp() {
|
|||||||
for(let i = 0;i < dataSource.month.series.length;i++){
|
for(let i = 0;i < dataSource.month.series.length;i++){
|
||||||
let itemSeries = dataSource.month.series[i]
|
let itemSeries = dataSource.month.series[i]
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthAllProductionScraps[item].map((itemInner,indexInner)=>{
|
data.monthAllProductionScraps[item].forEach((itemInner,indexInner)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
@ -81,7 +81,7 @@ function RightDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.todayProductionDets && data.todayProductionDets.length > 0) {
|
if (data.todayProductionDets && data.todayProductionDets.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionDets.map((item,index)=>{
|
data.todayProductionDets.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(dayjs(item.recTime).format("HH:mm"),item.inputNum,item.outputNum);
|
arrInner.push(dayjs(item.recTime).format("HH:mm"),item.inputNum,item.outputNum);
|
||||||
arr1.push(arrInner);
|
arr1.push(arrInner);
|
||||||
@ -97,7 +97,7 @@ function RightDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.weekProductionDets && data.weekProductionDets.length > 0) {
|
if (data.weekProductionDets && data.weekProductionDets.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionDets.map((item,index)=>{
|
data.weekProductionDets.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
||||||
arr2.push(arrInner);
|
arr2.push(arrInner);
|
||||||
@ -113,7 +113,7 @@ function RightDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.monthProductionDets && data.monthProductionDets.length > 0) {
|
if (data.monthProductionDets && data.monthProductionDets.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionDets.map((item,index)=>{
|
data.monthProductionDets.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
||||||
arr3.push(arrInner);
|
arr3.push(arrInner);
|
||||||
|
@ -19,7 +19,7 @@ function RightUp() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.sectionDet && data.sectionDet.length > 0) {
|
if (data.sectionDet && data.sectionDet.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.sectionDet.map((item, index) => {
|
data.sectionDet.forEach((item, index) => {
|
||||||
let arrInner = []
|
let arrInner = []
|
||||||
arrInner.push(index + 1, item.lineName, item.inputNum, item.outputNum)
|
arrInner.push(index + 1, item.lineName, item.inputNum, item.outputNum)
|
||||||
arr.push(arrInner)
|
arr.push(arrInner)
|
||||||
|
@ -5,7 +5,31 @@ import Right from "./Right";
|
|||||||
import Center from "./Center";
|
import Center from "./Center";
|
||||||
import {useEffect} from 'react';
|
import {useEffect} from 'react';
|
||||||
import {useNavigate} from "react-router-dom";
|
import {useNavigate} from "react-router-dom";
|
||||||
|
import { useDispatch } from 'react-redux';
|
||||||
|
import { UpdateLine1After } from "../../store/LinePageSlice";
|
||||||
function LinePage() {
|
function LinePage() {
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
// 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
|
||||||
|
websocket1_2.onmessage = function (event) {
|
||||||
|
let msgData = event.data
|
||||||
|
try {
|
||||||
|
msgData = JSON.parse(event.data);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("websocket: [unable to msgData] : ", event.data);
|
||||||
|
}
|
||||||
|
if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
||||||
|
dispatch(UpdateLine1After(msgData));
|
||||||
|
}
|
||||||
|
// 清理函数
|
||||||
|
return () => {
|
||||||
|
websocket1_2.close();
|
||||||
|
};
|
||||||
|
}, [dispatch]);
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleKeyDown = (event:any) => {
|
const handleKeyDown = (event:any) => {
|
||||||
|
@ -29,7 +29,7 @@ function CenterDown() {
|
|||||||
{ name: "周", ename: "week" },
|
{ name: "周", ename: "week" },
|
||||||
{ name: "月", ename: "month" },
|
{ name: "月", ename: "month" },
|
||||||
];
|
];
|
||||||
const [activeName, setActiveName] = useState<string>(nameList[1].ename);
|
const [activeName] = useState<string>(nameList[1].ename);
|
||||||
// const handleButtonChange = (activeName: string) => {
|
// const handleButtonChange = (activeName: string) => {
|
||||||
// setActiveName(activeName);
|
// setActiveName(activeName);
|
||||||
// };
|
// };
|
||||||
@ -52,7 +52,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
sumAlarm = data.alarms.length
|
sumAlarm = data.alarms.length
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.alarms.map((item,index) => {
|
data.alarms.forEach((item,index) => {
|
||||||
let arrInner = []
|
let arrInner = []
|
||||||
arrInner.push(
|
arrInner.push(
|
||||||
index+1,
|
index+1,
|
||||||
@ -70,11 +70,11 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let keys = Object.keys(data.todayProductionRates)
|
let keys = Object.keys(data.todayProductionRates)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionRates[keys[0]].map((item,index)=>{
|
data.todayProductionRates[keys[0]].forEach((item,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
dataSource.day.xData.push(dayjs(item.recTime).format("HH:mm"))
|
dataSource.day.xData.push(dayjs(item.recTime).format("HH:mm"))
|
||||||
})
|
})
|
||||||
keys.map((item,index)=>{
|
keys.forEach((item,index)=>{
|
||||||
let obj = {
|
let obj = {
|
||||||
name: "",
|
name: "",
|
||||||
type: "line",
|
type: "line",
|
||||||
@ -85,7 +85,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.name = data.todayProductionRates[item][0].lineName
|
obj.name = data.todayProductionRates[item][0].lineName
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionRates[item].map((subItem,index)=>{
|
data.todayProductionRates[item].forEach((subItem,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.data.push(subItem.passRate)
|
obj.data.push(subItem.passRate)
|
||||||
})
|
})
|
||||||
@ -100,11 +100,11 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let keys = Object.keys(data.weekProductionRates)
|
let keys = Object.keys(data.weekProductionRates)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionRates[keys[0]].map((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("HH:mm"))
|
||||||
})
|
})
|
||||||
keys.map((item,index)=>{
|
keys.forEach((item,index)=>{
|
||||||
let obj = {
|
let obj = {
|
||||||
name: "",
|
name: "",
|
||||||
type: "line",
|
type: "line",
|
||||||
@ -115,7 +115,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.name = data.weekProductionRates[item][0].lineName
|
obj.name = data.weekProductionRates[item][0].lineName
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionRates[item].map((subItem,index)=>{
|
data.weekProductionRates[item].forEach((subItem,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.data.push(subItem.passRate)
|
obj.data.push(subItem.passRate)
|
||||||
})
|
})
|
||||||
@ -130,11 +130,11 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let keys = Object.keys(data.monthProductionRates)
|
let keys = Object.keys(data.monthProductionRates)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionRates[keys[0]].map((item,index)=>{
|
data.monthProductionRates[keys[0]].forEach((item,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
dataSource.month.xData.push(dayjs(item.recTime).format("HH:mm"))
|
dataSource.month.xData.push(dayjs(item.recTime).format("HH:mm"))
|
||||||
})
|
})
|
||||||
keys.map((item,index)=>{
|
keys.forEach((item,index)=>{
|
||||||
let obj = {
|
let obj = {
|
||||||
name: "",
|
name: "",
|
||||||
type: "line",
|
type: "line",
|
||||||
@ -145,7 +145,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.name = data.monthProductionRates[item][0].lineName
|
obj.name = data.monthProductionRates[item][0].lineName
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionRates[item].map((subItem,index)=>{
|
data.monthProductionRates[item].forEach((subItem,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.data.push(subItem.passRate)
|
obj.data.push(subItem.passRate)
|
||||||
})
|
})
|
||||||
@ -192,7 +192,7 @@ function CenterDown() {
|
|||||||
{<ReactECharts option={options} style={{ height: "100%" }} />}
|
{<ReactECharts option={options} style={{ height: "100%" }} />}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{chartData.xData.length==0 && (
|
{chartData.xData.length===0 && (
|
||||||
<p
|
<p
|
||||||
style={{
|
style={{
|
||||||
color: "#cccf",
|
color: "#cccf",
|
||||||
|
@ -77,7 +77,7 @@ function LeftDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.todayProductionScraps && data.todayProductionScraps.length > 0) {
|
if (data.todayProductionScraps && data.todayProductionScraps.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionScraps.map((item,index)=>{
|
data.todayProductionScraps.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
||||||
arr1.push(arrInner);
|
arr1.push(arrInner);
|
||||||
@ -90,7 +90,7 @@ function LeftDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.weekProductionScraps && data.weekProductionScraps.length > 0) {
|
if (data.weekProductionScraps && data.weekProductionScraps.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionScraps.map((item,index)=>{
|
data.weekProductionScraps.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
||||||
arr2.push(arrInner);
|
arr2.push(arrInner);
|
||||||
@ -103,7 +103,7 @@ function LeftDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.monthProductionScraps && data.monthProductionScraps.length > 0) {
|
if (data.monthProductionScraps && data.monthProductionScraps.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionScraps.map((item,index)=>{
|
data.monthProductionScraps.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
||||||
arr3.push(arrInner);
|
arr3.push(arrInner);
|
||||||
|
@ -37,7 +37,7 @@ function LeftUp() {
|
|||||||
let sum: number[] = [];
|
let sum: number[] = [];
|
||||||
// 生成obj
|
// 生成obj
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.scrapBars.map((item,index) => {
|
data.scrapBars.forEach((item,index) => {
|
||||||
let obj = {
|
let obj = {
|
||||||
data: [],
|
data: [],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
@ -67,7 +67,7 @@ function LeftUp() {
|
|||||||
for(let i = 0;i < dataSource.day.series.length;i++){
|
for(let i = 0;i < dataSource.day.series.length;i++){
|
||||||
let itemSeries = dataSource.day.series[i]
|
let itemSeries = dataSource.day.series[i]
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayAllProductionScraps[item].map((itemInner,indexInner)=>{
|
data.todayAllProductionScraps[item].forEach((itemInner,indexInner)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@ -105,7 +105,7 @@ function LeftUp() {
|
|||||||
let sum: number[] = [];
|
let sum: number[] = [];
|
||||||
// 生成obj
|
// 生成obj
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.scrapBars.map((item,index) => {
|
data.scrapBars.forEach((item,index) => {
|
||||||
let obj = {
|
let obj = {
|
||||||
data: [],
|
data: [],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
@ -135,7 +135,7 @@ function LeftUp() {
|
|||||||
for(let i = 0;i < dataSource.week.series.length;i++){
|
for(let i = 0;i < dataSource.week.series.length;i++){
|
||||||
let itemSeries = dataSource.week.series[i]
|
let itemSeries = dataSource.week.series[i]
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekAllProductionScraps[item].map((itemInner,indexInner)=>{
|
data.weekAllProductionScraps[item].forEach((itemInner,indexInner)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@ -173,7 +173,7 @@ function LeftUp() {
|
|||||||
let sum: number[] = [];
|
let sum: number[] = [];
|
||||||
// 生成obj
|
// 生成obj
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.scrapBars.map((item,index) => {
|
data.scrapBars.forEach((item,index) => {
|
||||||
let obj = {
|
let obj = {
|
||||||
data: [],
|
data: [],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
@ -203,7 +203,7 @@ function LeftUp() {
|
|||||||
for(let i = 0;i < dataSource.month.series.length;i++){
|
for(let i = 0;i < dataSource.month.series.length;i++){
|
||||||
let itemSeries = dataSource.month.series[i]
|
let itemSeries = dataSource.month.series[i]
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthAllProductionScraps[item].map((itemInner,indexInner)=>{
|
data.monthAllProductionScraps[item].forEach((itemInner,indexInner)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
@ -81,7 +81,7 @@ function RightDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.todayProductionDets && data.todayProductionDets.length > 0) {
|
if (data.todayProductionDets && data.todayProductionDets.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionDets.map((item,index)=>{
|
data.todayProductionDets.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(dayjs(item.recTime).format("HH:mm"),item.inputNum,item.outputNum);
|
arrInner.push(dayjs(item.recTime).format("HH:mm"),item.inputNum,item.outputNum);
|
||||||
arr1.push(arrInner);
|
arr1.push(arrInner);
|
||||||
@ -97,7 +97,7 @@ function RightDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.weekProductionDets && data.weekProductionDets.length > 0) {
|
if (data.weekProductionDets && data.weekProductionDets.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionDets.map((item,index)=>{
|
data.weekProductionDets.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
||||||
arr2.push(arrInner);
|
arr2.push(arrInner);
|
||||||
@ -113,7 +113,7 @@ function RightDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.monthProductionDets && data.monthProductionDets.length > 0) {
|
if (data.monthProductionDets && data.monthProductionDets.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionDets.map((item,index)=>{
|
data.monthProductionDets.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
||||||
arr3.push(arrInner);
|
arr3.push(arrInner);
|
||||||
|
@ -19,7 +19,7 @@ function RightUp() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.sectionDet && data.sectionDet.length > 0) {
|
if (data.sectionDet && data.sectionDet.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.sectionDet.map((item, index) => {
|
data.sectionDet.forEach((item, index) => {
|
||||||
let arrInner = []
|
let arrInner = []
|
||||||
arrInner.push(index + 1, item.lineName, item.inputNum, item.outputNum)
|
arrInner.push(index + 1, item.lineName, item.inputNum, item.outputNum)
|
||||||
arr.push(arrInner)
|
arr.push(arrInner)
|
||||||
|
@ -5,7 +5,31 @@ import Right from "./Right";
|
|||||||
import Center from "./Center";
|
import Center from "./Center";
|
||||||
import {useEffect} from 'react';
|
import {useEffect} from 'react';
|
||||||
import {useNavigate} from "react-router-dom";
|
import {useNavigate} from "react-router-dom";
|
||||||
|
import { useDispatch } from 'react-redux';
|
||||||
|
import { UpdateLine2Before } from "../../store/LinePageSlice";
|
||||||
function LinePage() {
|
function LinePage() {
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
// 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
|
||||||
|
websocket2_1.onmessage = function (event) {
|
||||||
|
let msgData = event.data
|
||||||
|
try {
|
||||||
|
msgData = JSON.parse(event.data);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("websocket: [unable to msgData] : ", event.data);
|
||||||
|
}
|
||||||
|
if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
||||||
|
dispatch(UpdateLine2Before(msgData));
|
||||||
|
}
|
||||||
|
// 清理函数
|
||||||
|
return () => {
|
||||||
|
websocket2_1.close();
|
||||||
|
};
|
||||||
|
}, [dispatch]);
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleKeyDown = (event:any) => {
|
const handleKeyDown = (event:any) => {
|
||||||
|
@ -29,7 +29,7 @@ function CenterDown() {
|
|||||||
{ name: "周", ename: "week" },
|
{ name: "周", ename: "week" },
|
||||||
{ name: "月", ename: "month" },
|
{ name: "月", ename: "month" },
|
||||||
];
|
];
|
||||||
const [activeName, setActiveName] = useState<string>(nameList[1].ename);
|
const [activeName] = useState<string>(nameList[1].ename);
|
||||||
// const handleButtonChange = (activeName: string) => {
|
// const handleButtonChange = (activeName: string) => {
|
||||||
// setActiveName(activeName);
|
// setActiveName(activeName);
|
||||||
// };
|
// };
|
||||||
@ -52,7 +52,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
sumAlarm = data.alarms.length
|
sumAlarm = data.alarms.length
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.alarms.map((item,index) => {
|
data.alarms.forEach((item,index) => {
|
||||||
let arrInner = []
|
let arrInner = []
|
||||||
arrInner.push(
|
arrInner.push(
|
||||||
index+1,
|
index+1,
|
||||||
@ -70,11 +70,11 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let keys = Object.keys(data.todayProductionRates)
|
let keys = Object.keys(data.todayProductionRates)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionRates[keys[0]].map((item,index)=>{
|
data.todayProductionRates[keys[0]].forEach((item,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
dataSource.day.xData.push(dayjs(item.recTime).format("HH:mm"))
|
dataSource.day.xData.push(dayjs(item.recTime).format("HH:mm"))
|
||||||
})
|
})
|
||||||
keys.map((item,index)=>{
|
keys.forEach((item,index)=>{
|
||||||
let obj = {
|
let obj = {
|
||||||
name: "",
|
name: "",
|
||||||
type: "line",
|
type: "line",
|
||||||
@ -85,7 +85,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.name = data.todayProductionRates[item][0].lineName
|
obj.name = data.todayProductionRates[item][0].lineName
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionRates[item].map((subItem,index)=>{
|
data.todayProductionRates[item].forEach((subItem,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.data.push(subItem.passRate)
|
obj.data.push(subItem.passRate)
|
||||||
})
|
})
|
||||||
@ -100,11 +100,11 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let keys = Object.keys(data.weekProductionRates)
|
let keys = Object.keys(data.weekProductionRates)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionRates[keys[0]].map((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("HH:mm"))
|
||||||
})
|
})
|
||||||
keys.map((item,index)=>{
|
keys.forEach((item,index)=>{
|
||||||
let obj = {
|
let obj = {
|
||||||
name: "",
|
name: "",
|
||||||
type: "line",
|
type: "line",
|
||||||
@ -115,7 +115,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.name = data.weekProductionRates[item][0].lineName
|
obj.name = data.weekProductionRates[item][0].lineName
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionRates[item].map((subItem,index)=>{
|
data.weekProductionRates[item].forEach((subItem,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.data.push(subItem.passRate)
|
obj.data.push(subItem.passRate)
|
||||||
})
|
})
|
||||||
@ -130,11 +130,11 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let keys = Object.keys(data.monthProductionRates)
|
let keys = Object.keys(data.monthProductionRates)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionRates[keys[0]].map((item,index)=>{
|
data.monthProductionRates[keys[0]].forEach((item,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
dataSource.month.xData.push(dayjs(item.recTime).format("HH:mm"))
|
dataSource.month.xData.push(dayjs(item.recTime).format("HH:mm"))
|
||||||
})
|
})
|
||||||
keys.map((item,index)=>{
|
keys.forEach((item,index)=>{
|
||||||
let obj = {
|
let obj = {
|
||||||
name: "",
|
name: "",
|
||||||
type: "line",
|
type: "line",
|
||||||
@ -145,7 +145,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.name = data.monthProductionRates[item][0].lineName
|
obj.name = data.monthProductionRates[item][0].lineName
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionRates[item].map((subItem,index)=>{
|
data.monthProductionRates[item].forEach((subItem,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.data.push(subItem.passRate)
|
obj.data.push(subItem.passRate)
|
||||||
})
|
})
|
||||||
@ -192,7 +192,7 @@ function CenterDown() {
|
|||||||
{<ReactECharts option={options} style={{ height: "100%" }} />}
|
{<ReactECharts option={options} style={{ height: "100%" }} />}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{chartData.xData.length==0 && (
|
{chartData.xData.length===0 && (
|
||||||
<p
|
<p
|
||||||
style={{
|
style={{
|
||||||
color: "#cccf",
|
color: "#cccf",
|
||||||
|
@ -77,7 +77,7 @@ function LeftDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.todayProductionScraps && data.todayProductionScraps.length > 0) {
|
if (data.todayProductionScraps && data.todayProductionScraps.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionScraps.map((item,index)=>{
|
data.todayProductionScraps.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
||||||
arr1.push(arrInner);
|
arr1.push(arrInner);
|
||||||
@ -90,7 +90,7 @@ function LeftDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.weekProductionScraps && data.weekProductionScraps.length > 0) {
|
if (data.weekProductionScraps && data.weekProductionScraps.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionScraps.map((item,index)=>{
|
data.weekProductionScraps.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
||||||
arr2.push(arrInner);
|
arr2.push(arrInner);
|
||||||
@ -103,7 +103,7 @@ function LeftDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.monthProductionScraps && data.monthProductionScraps.length > 0) {
|
if (data.monthProductionScraps && data.monthProductionScraps.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionScraps.map((item,index)=>{
|
data.monthProductionScraps.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
||||||
arr3.push(arrInner);
|
arr3.push(arrInner);
|
||||||
|
@ -37,7 +37,7 @@ function LeftUp() {
|
|||||||
let sum: number[] = [];
|
let sum: number[] = [];
|
||||||
// 生成obj
|
// 生成obj
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.scrapBars.map((item,index) => {
|
data.scrapBars.forEach((item,index) => {
|
||||||
let obj = {
|
let obj = {
|
||||||
data: [],
|
data: [],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
@ -67,7 +67,7 @@ function LeftUp() {
|
|||||||
for(let i = 0;i < dataSource.day.series.length;i++){
|
for(let i = 0;i < dataSource.day.series.length;i++){
|
||||||
let itemSeries = dataSource.day.series[i]
|
let itemSeries = dataSource.day.series[i]
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayAllProductionScraps[item].map((itemInner,indexInner)=>{
|
data.todayAllProductionScraps[item].forEach((itemInner,indexInner)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@ -105,7 +105,7 @@ function LeftUp() {
|
|||||||
let sum: number[] = [];
|
let sum: number[] = [];
|
||||||
// 生成obj
|
// 生成obj
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.scrapBars.map((item,index) => {
|
data.scrapBars.forEach((item,index) => {
|
||||||
let obj = {
|
let obj = {
|
||||||
data: [],
|
data: [],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
@ -135,7 +135,7 @@ function LeftUp() {
|
|||||||
for(let i = 0;i < dataSource.week.series.length;i++){
|
for(let i = 0;i < dataSource.week.series.length;i++){
|
||||||
let itemSeries = dataSource.week.series[i]
|
let itemSeries = dataSource.week.series[i]
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekAllProductionScraps[item].map((itemInner,indexInner)=>{
|
data.weekAllProductionScraps[item].forEach((itemInner,indexInner)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@ -173,7 +173,7 @@ function LeftUp() {
|
|||||||
let sum: number[] = [];
|
let sum: number[] = [];
|
||||||
// 生成obj
|
// 生成obj
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.scrapBars.map((item,index) => {
|
data.scrapBars.forEach((item,index) => {
|
||||||
let obj = {
|
let obj = {
|
||||||
data: [],
|
data: [],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
@ -203,7 +203,7 @@ function LeftUp() {
|
|||||||
for(let i = 0;i < dataSource.month.series.length;i++){
|
for(let i = 0;i < dataSource.month.series.length;i++){
|
||||||
let itemSeries = dataSource.month.series[i]
|
let itemSeries = dataSource.month.series[i]
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthAllProductionScraps[item].map((itemInner,indexInner)=>{
|
data.monthAllProductionScraps[item].forEach((itemInner,indexInner)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
@ -81,7 +81,7 @@ function RightDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.todayProductionDets && data.todayProductionDets.length > 0) {
|
if (data.todayProductionDets && data.todayProductionDets.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionDets.map((item,index)=>{
|
data.todayProductionDets.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(dayjs(item.recTime).format("HH:mm"),item.inputNum,item.outputNum);
|
arrInner.push(dayjs(item.recTime).format("HH:mm"),item.inputNum,item.outputNum);
|
||||||
arr1.push(arrInner);
|
arr1.push(arrInner);
|
||||||
@ -97,7 +97,7 @@ function RightDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.weekProductionDets && data.weekProductionDets.length > 0) {
|
if (data.weekProductionDets && data.weekProductionDets.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionDets.map((item,index)=>{
|
data.weekProductionDets.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
||||||
arr2.push(arrInner);
|
arr2.push(arrInner);
|
||||||
@ -113,7 +113,7 @@ function RightDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.monthProductionDets && data.monthProductionDets.length > 0) {
|
if (data.monthProductionDets && data.monthProductionDets.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionDets.map((item,index)=>{
|
data.monthProductionDets.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
||||||
arr3.push(arrInner);
|
arr3.push(arrInner);
|
||||||
|
@ -19,7 +19,7 @@ function RightUp() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.sectionDet && data.sectionDet.length > 0) {
|
if (data.sectionDet && data.sectionDet.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.sectionDet.map((item, index) => {
|
data.sectionDet.forEach((item, index) => {
|
||||||
let arrInner = []
|
let arrInner = []
|
||||||
arrInner.push(index + 1, item.lineName, item.inputNum, item.outputNum)
|
arrInner.push(index + 1, item.lineName, item.inputNum, item.outputNum)
|
||||||
arr.push(arrInner)
|
arr.push(arrInner)
|
||||||
|
@ -5,7 +5,31 @@ import Right from "./Right";
|
|||||||
import Center from "./Center";
|
import Center from "./Center";
|
||||||
import {useEffect} from 'react';
|
import {useEffect} from 'react';
|
||||||
import {useNavigate} from "react-router-dom";
|
import {useNavigate} from "react-router-dom";
|
||||||
|
import { useDispatch } from 'react-redux';
|
||||||
|
import { UpdateLine2After } from "../../store/LinePageSlice";
|
||||||
function LinePage() {
|
function LinePage() {
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
// 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
|
||||||
|
websocket2_2.onmessage = function (event) {
|
||||||
|
let msgData = event.data
|
||||||
|
try {
|
||||||
|
msgData = JSON.parse(event.data);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("websocket: [unable to msgData] : ", event.data);
|
||||||
|
}
|
||||||
|
if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
||||||
|
dispatch(UpdateLine2After(msgData));
|
||||||
|
}
|
||||||
|
// 清理函数
|
||||||
|
return () => {
|
||||||
|
websocket2_2.close();
|
||||||
|
};
|
||||||
|
}, [dispatch]);
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleKeyDown = (event:any) => {
|
const handleKeyDown = (event:any) => {
|
||||||
|
@ -29,7 +29,7 @@ function CenterDown() {
|
|||||||
{ name: "周", ename: "week" },
|
{ name: "周", ename: "week" },
|
||||||
{ name: "月", ename: "month" },
|
{ name: "月", ename: "month" },
|
||||||
];
|
];
|
||||||
const [activeName, setActiveName] = useState<string>(nameList[1].ename);
|
const [activeName] = useState<string>(nameList[1].ename);
|
||||||
// const handleButtonChange = (activeName: string) => {
|
// const handleButtonChange = (activeName: string) => {
|
||||||
// setActiveName(activeName);
|
// setActiveName(activeName);
|
||||||
// };
|
// };
|
||||||
@ -52,7 +52,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
sumAlarm = data.alarms.length
|
sumAlarm = data.alarms.length
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.alarms.map((item,index) => {
|
data.alarms.forEach((item,index) => {
|
||||||
let arrInner = []
|
let arrInner = []
|
||||||
arrInner.push(
|
arrInner.push(
|
||||||
index+1,
|
index+1,
|
||||||
@ -70,11 +70,11 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let keys = Object.keys(data.todayProductionRates)
|
let keys = Object.keys(data.todayProductionRates)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionRates[keys[0]].map((item,index)=>{
|
data.todayProductionRates[keys[0]].forEach((item,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
dataSource.day.xData.push(dayjs(item.recTime).format("HH:mm"))
|
dataSource.day.xData.push(dayjs(item.recTime).format("HH:mm"))
|
||||||
})
|
})
|
||||||
keys.map((item,index)=>{
|
keys.forEach((item,index)=>{
|
||||||
let obj = {
|
let obj = {
|
||||||
name: "",
|
name: "",
|
||||||
type: "line",
|
type: "line",
|
||||||
@ -85,7 +85,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.name = data.todayProductionRates[item][0].lineName
|
obj.name = data.todayProductionRates[item][0].lineName
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionRates[item].map((subItem,index)=>{
|
data.todayProductionRates[item].forEach((subItem,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.data.push(subItem.passRate)
|
obj.data.push(subItem.passRate)
|
||||||
})
|
})
|
||||||
@ -100,11 +100,11 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let keys = Object.keys(data.weekProductionRates)
|
let keys = Object.keys(data.weekProductionRates)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionRates[keys[0]].map((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("HH:mm"))
|
||||||
})
|
})
|
||||||
keys.map((item,index)=>{
|
keys.forEach((item,index)=>{
|
||||||
let obj = {
|
let obj = {
|
||||||
name: "",
|
name: "",
|
||||||
type: "line",
|
type: "line",
|
||||||
@ -115,7 +115,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.name = data.weekProductionRates[item][0].lineName
|
obj.name = data.weekProductionRates[item][0].lineName
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionRates[item].map((subItem,index)=>{
|
data.weekProductionRates[item].forEach((subItem,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.data.push(subItem.passRate)
|
obj.data.push(subItem.passRate)
|
||||||
})
|
})
|
||||||
@ -130,11 +130,11 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let keys = Object.keys(data.monthProductionRates)
|
let keys = Object.keys(data.monthProductionRates)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionRates[keys[0]].map((item,index)=>{
|
data.monthProductionRates[keys[0]].forEach((item,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
dataSource.month.xData.push(dayjs(item.recTime).format("HH:mm"))
|
dataSource.month.xData.push(dayjs(item.recTime).format("HH:mm"))
|
||||||
})
|
})
|
||||||
keys.map((item,index)=>{
|
keys.forEach((item,index)=>{
|
||||||
let obj = {
|
let obj = {
|
||||||
name: "",
|
name: "",
|
||||||
type: "line",
|
type: "line",
|
||||||
@ -145,7 +145,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.name = data.monthProductionRates[item][0].lineName
|
obj.name = data.monthProductionRates[item][0].lineName
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionRates[item].map((subItem,index)=>{
|
data.monthProductionRates[item].forEach((subItem,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.data.push(subItem.passRate)
|
obj.data.push(subItem.passRate)
|
||||||
})
|
})
|
||||||
@ -192,7 +192,7 @@ function CenterDown() {
|
|||||||
{<ReactECharts option={options} style={{ height: "100%" }} />}
|
{<ReactECharts option={options} style={{ height: "100%" }} />}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{chartData.xData.length==0 && (
|
{chartData.xData.length===0 && (
|
||||||
<p
|
<p
|
||||||
style={{
|
style={{
|
||||||
color: "#cccf",
|
color: "#cccf",
|
||||||
|
@ -77,7 +77,7 @@ function LeftDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.todayProductionScraps && data.todayProductionScraps.length > 0) {
|
if (data.todayProductionScraps && data.todayProductionScraps.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionScraps.map((item,index)=>{
|
data.todayProductionScraps.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
||||||
arr1.push(arrInner);
|
arr1.push(arrInner);
|
||||||
@ -90,7 +90,7 @@ function LeftDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.weekProductionScraps && data.weekProductionScraps.length > 0) {
|
if (data.weekProductionScraps && data.weekProductionScraps.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionScraps.map((item,index)=>{
|
data.weekProductionScraps.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
||||||
arr2.push(arrInner);
|
arr2.push(arrInner);
|
||||||
@ -103,7 +103,7 @@ function LeftDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.monthProductionScraps && data.monthProductionScraps.length > 0) {
|
if (data.monthProductionScraps && data.monthProductionScraps.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionScraps.map((item,index)=>{
|
data.monthProductionScraps.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
||||||
arr3.push(arrInner);
|
arr3.push(arrInner);
|
||||||
|
@ -37,7 +37,7 @@ function LeftUp() {
|
|||||||
let sum: number[] = [];
|
let sum: number[] = [];
|
||||||
// 生成obj
|
// 生成obj
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.scrapBars.map((item,index) => {
|
data.scrapBars.forEach((item,index) => {
|
||||||
let obj = {
|
let obj = {
|
||||||
data: [],
|
data: [],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
@ -67,7 +67,7 @@ function LeftUp() {
|
|||||||
for(let i = 0;i < dataSource.day.series.length;i++){
|
for(let i = 0;i < dataSource.day.series.length;i++){
|
||||||
let itemSeries = dataSource.day.series[i]
|
let itemSeries = dataSource.day.series[i]
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayAllProductionScraps[item].map((itemInner,indexInner)=>{
|
data.todayAllProductionScraps[item].forEach((itemInner,indexInner)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@ -105,7 +105,7 @@ function LeftUp() {
|
|||||||
let sum: number[] = [];
|
let sum: number[] = [];
|
||||||
// 生成obj
|
// 生成obj
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.scrapBars.map((item,index) => {
|
data.scrapBars.forEach((item,index) => {
|
||||||
let obj = {
|
let obj = {
|
||||||
data: [],
|
data: [],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
@ -135,7 +135,7 @@ function LeftUp() {
|
|||||||
for(let i = 0;i < dataSource.week.series.length;i++){
|
for(let i = 0;i < dataSource.week.series.length;i++){
|
||||||
let itemSeries = dataSource.week.series[i]
|
let itemSeries = dataSource.week.series[i]
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekAllProductionScraps[item].map((itemInner,indexInner)=>{
|
data.weekAllProductionScraps[item].forEach((itemInner,indexInner)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@ -173,7 +173,7 @@ function LeftUp() {
|
|||||||
let sum: number[] = [];
|
let sum: number[] = [];
|
||||||
// 生成obj
|
// 生成obj
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.scrapBars.map((item,index) => {
|
data.scrapBars.forEach((item,index) => {
|
||||||
let obj = {
|
let obj = {
|
||||||
data: [],
|
data: [],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
@ -203,7 +203,7 @@ function LeftUp() {
|
|||||||
for(let i = 0;i < dataSource.month.series.length;i++){
|
for(let i = 0;i < dataSource.month.series.length;i++){
|
||||||
let itemSeries = dataSource.month.series[i]
|
let itemSeries = dataSource.month.series[i]
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthAllProductionScraps[item].map((itemInner,indexInner)=>{
|
data.monthAllProductionScraps[item].forEach((itemInner,indexInner)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
@ -80,7 +80,7 @@ function RightDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.todayProductionDets && data.todayProductionDets.length > 0) {
|
if (data.todayProductionDets && data.todayProductionDets.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionDets.map((item,index)=>{
|
data.todayProductionDets.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(dayjs(item.recTime).format("HH:mm"),item.inputNum,item.outputNum);
|
arrInner.push(dayjs(item.recTime).format("HH:mm"),item.inputNum,item.outputNum);
|
||||||
arr1.push(arrInner);
|
arr1.push(arrInner);
|
||||||
@ -96,7 +96,7 @@ function RightDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.weekProductionDets && data.weekProductionDets.length > 0) {
|
if (data.weekProductionDets && data.weekProductionDets.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionDets.map((item,index)=>{
|
data.weekProductionDets.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
||||||
arr2.push(arrInner);
|
arr2.push(arrInner);
|
||||||
@ -112,7 +112,7 @@ function RightDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.monthProductionDets && data.monthProductionDets.length > 0) {
|
if (data.monthProductionDets && data.monthProductionDets.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionDets.map((item,index)=>{
|
data.monthProductionDets.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
||||||
arr3.push(arrInner);
|
arr3.push(arrInner);
|
||||||
|
@ -19,7 +19,7 @@ function RightUp() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.sectionDet && data.sectionDet.length > 0) {
|
if (data.sectionDet && data.sectionDet.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.sectionDet.map((item, index) => {
|
data.sectionDet.forEach((item, index) => {
|
||||||
let arrInner = []
|
let arrInner = []
|
||||||
arrInner.push(index + 1, item.lineName, item.inputNum, item.outputNum)
|
arrInner.push(index + 1, item.lineName, item.inputNum, item.outputNum)
|
||||||
arr.push(arrInner)
|
arr.push(arrInner)
|
||||||
|
@ -5,7 +5,31 @@ import Right from "./Right";
|
|||||||
import Center from "./Center";
|
import Center from "./Center";
|
||||||
import {useEffect} from 'react';
|
import {useEffect} from 'react';
|
||||||
import {useNavigate} from "react-router-dom";
|
import {useNavigate} from "react-router-dom";
|
||||||
|
import { useDispatch } from 'react-redux';
|
||||||
|
import { UpdateLine3Before } from "../../store/LinePageSlice";
|
||||||
function LinePage() {
|
function LinePage() {
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
// 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
|
||||||
|
websocket3_1.onmessage = function (event) {
|
||||||
|
let msgData = event.data
|
||||||
|
try {
|
||||||
|
msgData = JSON.parse(event.data);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("websocket: [unable to msgData] : ", event.data);
|
||||||
|
}
|
||||||
|
if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
||||||
|
dispatch(UpdateLine3Before(msgData));
|
||||||
|
}
|
||||||
|
// 清理函数
|
||||||
|
return () => {
|
||||||
|
websocket3_1.close();
|
||||||
|
};
|
||||||
|
}, [dispatch]);
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleKeyDown = (event:any) => {
|
const handleKeyDown = (event:any) => {
|
||||||
|
@ -29,7 +29,7 @@ function CenterDown() {
|
|||||||
{ name: "周", ename: "week" },
|
{ name: "周", ename: "week" },
|
||||||
{ name: "月", ename: "month" },
|
{ name: "月", ename: "month" },
|
||||||
];
|
];
|
||||||
const [activeName, setActiveName] = useState<string>(nameList[1].ename);
|
const [activeName] = useState<string>(nameList[1].ename);
|
||||||
// const handleButtonChange = (activeName: string) => {
|
// const handleButtonChange = (activeName: string) => {
|
||||||
// setActiveName(activeName);
|
// setActiveName(activeName);
|
||||||
// };
|
// };
|
||||||
@ -52,7 +52,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
sumAlarm = data.alarms.length
|
sumAlarm = data.alarms.length
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.alarms.map((item,index) => {
|
data.alarms.forEach((item,index) => {
|
||||||
let arrInner = []
|
let arrInner = []
|
||||||
arrInner.push(
|
arrInner.push(
|
||||||
index+1,
|
index+1,
|
||||||
@ -70,11 +70,11 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let keys = Object.keys(data.todayProductionRates)
|
let keys = Object.keys(data.todayProductionRates)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionRates[keys[0]].map((item,index)=>{
|
data.todayProductionRates[keys[0]].forEach((item,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
dataSource.day.xData.push(dayjs(item.recTime).format("HH:mm"))
|
dataSource.day.xData.push(dayjs(item.recTime).format("HH:mm"))
|
||||||
})
|
})
|
||||||
keys.map((item,index)=>{
|
keys.forEach((item,index)=>{
|
||||||
let obj = {
|
let obj = {
|
||||||
name: "",
|
name: "",
|
||||||
type: "line",
|
type: "line",
|
||||||
@ -85,7 +85,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.name = data.todayProductionRates[item][0].lineName
|
obj.name = data.todayProductionRates[item][0].lineName
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionRates[item].map((subItem,index)=>{
|
data.todayProductionRates[item].forEach((subItem,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.data.push(subItem.passRate)
|
obj.data.push(subItem.passRate)
|
||||||
})
|
})
|
||||||
@ -100,11 +100,11 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let keys = Object.keys(data.weekProductionRates)
|
let keys = Object.keys(data.weekProductionRates)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionRates[keys[0]].map((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("HH:mm"))
|
||||||
})
|
})
|
||||||
keys.map((item,index)=>{
|
keys.forEach((item,index)=>{
|
||||||
let obj = {
|
let obj = {
|
||||||
name: "",
|
name: "",
|
||||||
type: "line",
|
type: "line",
|
||||||
@ -115,7 +115,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.name = data.weekProductionRates[item][0].lineName
|
obj.name = data.weekProductionRates[item][0].lineName
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionRates[item].map((subItem,index)=>{
|
data.weekProductionRates[item].forEach((subItem,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.data.push(subItem.passRate)
|
obj.data.push(subItem.passRate)
|
||||||
})
|
})
|
||||||
@ -130,11 +130,11 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let keys = Object.keys(data.monthProductionRates)
|
let keys = Object.keys(data.monthProductionRates)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionRates[keys[0]].map((item,index)=>{
|
data.monthProductionRates[keys[0]].forEach((item,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
dataSource.month.xData.push(dayjs(item.recTime).format("HH:mm"))
|
dataSource.month.xData.push(dayjs(item.recTime).format("HH:mm"))
|
||||||
})
|
})
|
||||||
keys.map((item,index)=>{
|
keys.forEach((item,index)=>{
|
||||||
let obj = {
|
let obj = {
|
||||||
name: "",
|
name: "",
|
||||||
type: "line",
|
type: "line",
|
||||||
@ -145,7 +145,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.name = data.monthProductionRates[item][0].lineName
|
obj.name = data.monthProductionRates[item][0].lineName
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionRates[item].map((subItem,index)=>{
|
data.monthProductionRates[item].forEach((subItem,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.data.push(subItem.passRate)
|
obj.data.push(subItem.passRate)
|
||||||
})
|
})
|
||||||
@ -192,7 +192,7 @@ function CenterDown() {
|
|||||||
{<ReactECharts option={options} style={{ height: "100%" }} />}
|
{<ReactECharts option={options} style={{ height: "100%" }} />}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{chartData.xData.length==0 && (
|
{chartData.xData.length===0 && (
|
||||||
<p
|
<p
|
||||||
style={{
|
style={{
|
||||||
color: "#cccf",
|
color: "#cccf",
|
||||||
|
@ -77,7 +77,7 @@ function LeftDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.todayProductionScraps && data.todayProductionScraps.length > 0) {
|
if (data.todayProductionScraps && data.todayProductionScraps.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionScraps.map((item,index)=>{
|
data.todayProductionScraps.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
||||||
arr1.push(arrInner);
|
arr1.push(arrInner);
|
||||||
@ -90,7 +90,7 @@ function LeftDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.weekProductionScraps && data.weekProductionScraps.length > 0) {
|
if (data.weekProductionScraps && data.weekProductionScraps.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionScraps.map((item,index)=>{
|
data.weekProductionScraps.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
||||||
arr2.push(arrInner);
|
arr2.push(arrInner);
|
||||||
@ -103,7 +103,7 @@ function LeftDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.monthProductionScraps && data.monthProductionScraps.length > 0) {
|
if (data.monthProductionScraps && data.monthProductionScraps.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionScraps.map((item,index)=>{
|
data.monthProductionScraps.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
||||||
arr3.push(arrInner);
|
arr3.push(arrInner);
|
||||||
|
@ -37,7 +37,7 @@ function LeftUp() {
|
|||||||
let sum: number[] = [];
|
let sum: number[] = [];
|
||||||
// 生成obj
|
// 生成obj
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.scrapBars.map((item,index) => {
|
data.scrapBars.forEach((item,index) => {
|
||||||
let obj = {
|
let obj = {
|
||||||
data: [],
|
data: [],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
@ -67,7 +67,7 @@ function LeftUp() {
|
|||||||
for(let i = 0;i < dataSource.day.series.length;i++){
|
for(let i = 0;i < dataSource.day.series.length;i++){
|
||||||
let itemSeries = dataSource.day.series[i]
|
let itemSeries = dataSource.day.series[i]
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayAllProductionScraps[item].map((itemInner,indexInner)=>{
|
data.todayAllProductionScraps[item].forEach((itemInner,indexInner)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@ -105,7 +105,7 @@ function LeftUp() {
|
|||||||
let sum: number[] = [];
|
let sum: number[] = [];
|
||||||
// 生成obj
|
// 生成obj
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.scrapBars.map((item,index) => {
|
data.scrapBars.forEach((item,index) => {
|
||||||
let obj = {
|
let obj = {
|
||||||
data: [],
|
data: [],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
@ -135,7 +135,7 @@ function LeftUp() {
|
|||||||
for(let i = 0;i < dataSource.week.series.length;i++){
|
for(let i = 0;i < dataSource.week.series.length;i++){
|
||||||
let itemSeries = dataSource.week.series[i]
|
let itemSeries = dataSource.week.series[i]
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekAllProductionScraps[item].map((itemInner,indexInner)=>{
|
data.weekAllProductionScraps[item].forEach((itemInner,indexInner)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@ -173,7 +173,7 @@ function LeftUp() {
|
|||||||
let sum: number[] = [];
|
let sum: number[] = [];
|
||||||
// 生成obj
|
// 生成obj
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.scrapBars.map((item,index) => {
|
data.scrapBars.forEach((item,index) => {
|
||||||
let obj = {
|
let obj = {
|
||||||
data: [],
|
data: [],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
@ -203,7 +203,7 @@ function LeftUp() {
|
|||||||
for(let i = 0;i < dataSource.month.series.length;i++){
|
for(let i = 0;i < dataSource.month.series.length;i++){
|
||||||
let itemSeries = dataSource.month.series[i]
|
let itemSeries = dataSource.month.series[i]
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthAllProductionScraps[item].map((itemInner,indexInner)=>{
|
data.monthAllProductionScraps[item].forEach((itemInner,indexInner)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
@ -81,7 +81,7 @@ function RightDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.todayProductionDets && data.todayProductionDets.length > 0) {
|
if (data.todayProductionDets && data.todayProductionDets.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionDets.map((item,index)=>{
|
data.todayProductionDets.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(dayjs(item.recTime).format("HH:mm"),item.inputNum,item.outputNum);
|
arrInner.push(dayjs(item.recTime).format("HH:mm"),item.inputNum,item.outputNum);
|
||||||
arr1.push(arrInner);
|
arr1.push(arrInner);
|
||||||
@ -97,7 +97,7 @@ function RightDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.weekProductionDets && data.weekProductionDets.length > 0) {
|
if (data.weekProductionDets && data.weekProductionDets.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionDets.map((item,index)=>{
|
data.weekProductionDets.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
||||||
arr2.push(arrInner);
|
arr2.push(arrInner);
|
||||||
@ -113,7 +113,7 @@ function RightDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.monthProductionDets && data.monthProductionDets.length > 0) {
|
if (data.monthProductionDets && data.monthProductionDets.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionDets.map((item,index)=>{
|
data.monthProductionDets.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
||||||
arr3.push(arrInner);
|
arr3.push(arrInner);
|
||||||
|
@ -19,7 +19,7 @@ function RightUp() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.sectionDet && data.sectionDet.length > 0) {
|
if (data.sectionDet && data.sectionDet.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.sectionDet.map((item, index) => {
|
data.sectionDet.forEach((item, index) => {
|
||||||
let arrInner = []
|
let arrInner = []
|
||||||
arrInner.push(index + 1, item.lineName, item.inputNum, item.outputNum)
|
arrInner.push(index + 1, item.lineName, item.inputNum, item.outputNum)
|
||||||
arr.push(arrInner)
|
arr.push(arrInner)
|
||||||
|
@ -5,7 +5,31 @@ import Right from "./Right";
|
|||||||
import Center from "./Center";
|
import Center from "./Center";
|
||||||
import {useEffect} from 'react';
|
import {useEffect} from 'react';
|
||||||
import {useNavigate} from "react-router-dom";
|
import {useNavigate} from "react-router-dom";
|
||||||
|
import { useDispatch } from 'react-redux';
|
||||||
|
import { UpdateLine3After } from "../../store/LinePageSlice";
|
||||||
function LinePage() {
|
function LinePage() {
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
// 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
|
||||||
|
websocket3_2.onmessage = function (event) {
|
||||||
|
let msgData = event.data
|
||||||
|
try {
|
||||||
|
msgData = JSON.parse(event.data);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("websocket: [unable to msgData] : ", event.data);
|
||||||
|
}
|
||||||
|
if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
||||||
|
dispatch(UpdateLine3After(msgData));
|
||||||
|
}
|
||||||
|
// 清理函数
|
||||||
|
return () => {
|
||||||
|
websocket3_2.close();
|
||||||
|
};
|
||||||
|
}, [dispatch]);
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleKeyDown = (event:any) => {
|
const handleKeyDown = (event:any) => {
|
||||||
|
@ -29,7 +29,7 @@ function CenterDown() {
|
|||||||
{ name: "周", ename: "week" },
|
{ name: "周", ename: "week" },
|
||||||
{ name: "月", ename: "month" },
|
{ name: "月", ename: "month" },
|
||||||
];
|
];
|
||||||
const [activeName, setActiveName] = useState<string>(nameList[1].ename);
|
const [activeName] = useState<string>(nameList[1].ename);
|
||||||
// const handleButtonChange = (activeName: string) => {
|
// const handleButtonChange = (activeName: string) => {
|
||||||
// setActiveName(activeName);
|
// setActiveName(activeName);
|
||||||
// };
|
// };
|
||||||
@ -52,7 +52,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
sumAlarm = data.alarms.length
|
sumAlarm = data.alarms.length
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.alarms.map((item,index) => {
|
data.alarms.forEach((item,index) => {
|
||||||
let arrInner = []
|
let arrInner = []
|
||||||
arrInner.push(
|
arrInner.push(
|
||||||
index+1,
|
index+1,
|
||||||
@ -70,11 +70,11 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let keys = Object.keys(data.todayProductionRates)
|
let keys = Object.keys(data.todayProductionRates)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionRates[keys[0]].map((item,index)=>{
|
data.todayProductionRates[keys[0]].forEach((item,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
dataSource.day.xData.push(dayjs(item.recTime).format("HH:mm"))
|
dataSource.day.xData.push(dayjs(item.recTime).format("HH:mm"))
|
||||||
})
|
})
|
||||||
keys.map((item,index)=>{
|
keys.forEach((item,index)=>{
|
||||||
let obj = {
|
let obj = {
|
||||||
name: "",
|
name: "",
|
||||||
type: "line",
|
type: "line",
|
||||||
@ -85,7 +85,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.name = data.todayProductionRates[item][0].lineName
|
obj.name = data.todayProductionRates[item][0].lineName
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionRates[item].map((subItem,index)=>{
|
data.todayProductionRates[item].forEach((subItem,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.data.push(subItem.passRate)
|
obj.data.push(subItem.passRate)
|
||||||
})
|
})
|
||||||
@ -100,11 +100,11 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let keys = Object.keys(data.weekProductionRates)
|
let keys = Object.keys(data.weekProductionRates)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionRates[keys[0]].map((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("HH:mm"))
|
||||||
})
|
})
|
||||||
keys.map((item,index)=>{
|
keys.forEach((item,index)=>{
|
||||||
let obj = {
|
let obj = {
|
||||||
name: "",
|
name: "",
|
||||||
type: "line",
|
type: "line",
|
||||||
@ -115,7 +115,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.name = data.weekProductionRates[item][0].lineName
|
obj.name = data.weekProductionRates[item][0].lineName
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionRates[item].map((subItem,index)=>{
|
data.weekProductionRates[item].forEach((subItem,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.data.push(subItem.passRate)
|
obj.data.push(subItem.passRate)
|
||||||
})
|
})
|
||||||
@ -130,11 +130,11 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let keys = Object.keys(data.monthProductionRates)
|
let keys = Object.keys(data.monthProductionRates)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionRates[keys[0]].map((item,index)=>{
|
data.monthProductionRates[keys[0]].forEach((item,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
dataSource.month.xData.push(dayjs(item.recTime).format("HH:mm"))
|
dataSource.month.xData.push(dayjs(item.recTime).format("HH:mm"))
|
||||||
})
|
})
|
||||||
keys.map((item,index)=>{
|
keys.forEach((item,index)=>{
|
||||||
let obj = {
|
let obj = {
|
||||||
name: "",
|
name: "",
|
||||||
type: "line",
|
type: "line",
|
||||||
@ -145,7 +145,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.name = data.monthProductionRates[item][0].lineName
|
obj.name = data.monthProductionRates[item][0].lineName
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionRates[item].map((subItem,index)=>{
|
data.monthProductionRates[item].forEach((subItem,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.data.push(subItem.passRate)
|
obj.data.push(subItem.passRate)
|
||||||
})
|
})
|
||||||
@ -192,7 +192,7 @@ function CenterDown() {
|
|||||||
{<ReactECharts option={options} style={{ height: "100%" }} />}
|
{<ReactECharts option={options} style={{ height: "100%" }} />}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{chartData.xData.length==0 && (
|
{chartData.xData.length===0 && (
|
||||||
<p
|
<p
|
||||||
style={{
|
style={{
|
||||||
color: "#cccf",
|
color: "#cccf",
|
||||||
|
@ -77,7 +77,7 @@ function LeftDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.todayProductionScraps && data.todayProductionScraps.length > 0) {
|
if (data.todayProductionScraps && data.todayProductionScraps.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionScraps.map((item,index)=>{
|
data.todayProductionScraps.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
||||||
arr1.push(arrInner);
|
arr1.push(arrInner);
|
||||||
@ -90,7 +90,7 @@ function LeftDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.weekProductionScraps && data.weekProductionScraps.length > 0) {
|
if (data.weekProductionScraps && data.weekProductionScraps.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionScraps.map((item,index)=>{
|
data.weekProductionScraps.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
||||||
arr2.push(arrInner);
|
arr2.push(arrInner);
|
||||||
@ -103,7 +103,7 @@ function LeftDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.monthProductionScraps && data.monthProductionScraps.length > 0) {
|
if (data.monthProductionScraps && data.monthProductionScraps.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionScraps.map((item,index)=>{
|
data.monthProductionScraps.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
||||||
arr3.push(arrInner);
|
arr3.push(arrInner);
|
||||||
|
@ -37,7 +37,7 @@ function LeftUp() {
|
|||||||
let sum: number[] = [];
|
let sum: number[] = [];
|
||||||
// 生成obj
|
// 生成obj
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.scrapBars.map((item,index) => {
|
data.scrapBars.forEach((item,index) => {
|
||||||
let obj = {
|
let obj = {
|
||||||
data: [],
|
data: [],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
@ -67,7 +67,7 @@ function LeftUp() {
|
|||||||
for(let i = 0;i < dataSource.day.series.length;i++){
|
for(let i = 0;i < dataSource.day.series.length;i++){
|
||||||
let itemSeries = dataSource.day.series[i]
|
let itemSeries = dataSource.day.series[i]
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayAllProductionScraps[item].map((itemInner,indexInner)=>{
|
data.todayAllProductionScraps[item].forEach((itemInner,indexInner)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@ -105,7 +105,7 @@ function LeftUp() {
|
|||||||
let sum: number[] = [];
|
let sum: number[] = [];
|
||||||
// 生成obj
|
// 生成obj
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.scrapBars.map((item,index) => {
|
data.scrapBars.forEach((item,index) => {
|
||||||
let obj = {
|
let obj = {
|
||||||
data: [],
|
data: [],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
@ -135,7 +135,7 @@ function LeftUp() {
|
|||||||
for(let i = 0;i < dataSource.week.series.length;i++){
|
for(let i = 0;i < dataSource.week.series.length;i++){
|
||||||
let itemSeries = dataSource.week.series[i]
|
let itemSeries = dataSource.week.series[i]
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekAllProductionScraps[item].map((itemInner,indexInner)=>{
|
data.weekAllProductionScraps[item].forEach((itemInner,indexInner)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@ -173,7 +173,7 @@ function LeftUp() {
|
|||||||
let sum: number[] = [];
|
let sum: number[] = [];
|
||||||
// 生成obj
|
// 生成obj
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.scrapBars.map((item,index) => {
|
data.scrapBars.forEach((item,index) => {
|
||||||
let obj = {
|
let obj = {
|
||||||
data: [],
|
data: [],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
@ -203,7 +203,7 @@ function LeftUp() {
|
|||||||
for(let i = 0;i < dataSource.month.series.length;i++){
|
for(let i = 0;i < dataSource.month.series.length;i++){
|
||||||
let itemSeries = dataSource.month.series[i]
|
let itemSeries = dataSource.month.series[i]
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthAllProductionScraps[item].map((itemInner,indexInner)=>{
|
data.monthAllProductionScraps[item].forEach((itemInner,indexInner)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
@ -81,7 +81,7 @@ function RightDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.todayProductionDets && data.todayProductionDets.length > 0) {
|
if (data.todayProductionDets && data.todayProductionDets.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionDets.map((item,index)=>{
|
data.todayProductionDets.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(dayjs(item.recTime).format("HH:mm"),item.inputNum,item.outputNum);
|
arrInner.push(dayjs(item.recTime).format("HH:mm"),item.inputNum,item.outputNum);
|
||||||
arr1.push(arrInner);
|
arr1.push(arrInner);
|
||||||
@ -97,7 +97,7 @@ function RightDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.weekProductionDets && data.weekProductionDets.length > 0) {
|
if (data.weekProductionDets && data.weekProductionDets.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionDets.map((item,index)=>{
|
data.weekProductionDets.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
||||||
arr2.push(arrInner);
|
arr2.push(arrInner);
|
||||||
@ -113,7 +113,7 @@ function RightDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.monthProductionDets && data.monthProductionDets.length > 0) {
|
if (data.monthProductionDets && data.monthProductionDets.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionDets.map((item,index)=>{
|
data.monthProductionDets.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
arrInner.push(dayjs(item.recTime).format("YYYY/MM/DD"),item.inputNum,item.outputNum);
|
||||||
arr3.push(arrInner);
|
arr3.push(arrInner);
|
||||||
|
@ -19,7 +19,7 @@ function RightUp() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.sectionDet && data.sectionDet.length > 0) {
|
if (data.sectionDet && data.sectionDet.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.sectionDet.map((item, index) => {
|
data.sectionDet.forEach((item, index) => {
|
||||||
let arrInner = []
|
let arrInner = []
|
||||||
arrInner.push(index + 1, item.lineName, item.inputNum, item.outputNum)
|
arrInner.push(index + 1, item.lineName, item.inputNum, item.outputNum)
|
||||||
arr.push(arrInner)
|
arr.push(arrInner)
|
||||||
|
@ -5,7 +5,31 @@ import Right from "./Right";
|
|||||||
import Center from "./Center";
|
import Center from "./Center";
|
||||||
import {useEffect} from 'react';
|
import {useEffect} from 'react';
|
||||||
import {useNavigate} from "react-router-dom";
|
import {useNavigate} from "react-router-dom";
|
||||||
|
import { useDispatch } from 'react-redux';
|
||||||
|
import { UpdateLine4Before } from "../../store/LinePageSlice";
|
||||||
function LinePage() {
|
function LinePage() {
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
// 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
|
||||||
|
websocket4_1.onmessage = function (event) {
|
||||||
|
let msgData = event.data
|
||||||
|
try {
|
||||||
|
msgData = JSON.parse(event.data);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("websocket: [unable to msgData] : ", event.data);
|
||||||
|
}
|
||||||
|
if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
||||||
|
dispatch(UpdateLine4Before(msgData));
|
||||||
|
}
|
||||||
|
// 清理函数
|
||||||
|
return () => {
|
||||||
|
websocket4_1.close();
|
||||||
|
};
|
||||||
|
}, [dispatch]);
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleKeyDown = (event:any) => {
|
const handleKeyDown = (event:any) => {
|
||||||
|
@ -29,7 +29,7 @@ function CenterDown() {
|
|||||||
{ name: "周", ename: "week" },
|
{ name: "周", ename: "week" },
|
||||||
{ name: "月", ename: "month" },
|
{ name: "月", ename: "month" },
|
||||||
];
|
];
|
||||||
const [activeName, setActiveName] = useState<string>(nameList[1].ename);
|
const [activeName] = useState<string>(nameList[1].ename);
|
||||||
// const handleButtonChange = (activeName: string) => {
|
// const handleButtonChange = (activeName: string) => {
|
||||||
// setActiveName(activeName);
|
// setActiveName(activeName);
|
||||||
// };
|
// };
|
||||||
@ -52,7 +52,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
sumAlarm = data.alarms.length
|
sumAlarm = data.alarms.length
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.alarms.map((item,index) => {
|
data.alarms.forEach((item,index) => {
|
||||||
let arrInner = []
|
let arrInner = []
|
||||||
arrInner.push(
|
arrInner.push(
|
||||||
index+1,
|
index+1,
|
||||||
@ -70,11 +70,11 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let keys = Object.keys(data.todayProductionRates)
|
let keys = Object.keys(data.todayProductionRates)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionRates[keys[0]].map((item,index)=>{
|
data.todayProductionRates[keys[0]].forEach((item,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
dataSource.day.xData.push(dayjs(item.recTime).format("HH:mm"))
|
dataSource.day.xData.push(dayjs(item.recTime).format("HH:mm"))
|
||||||
})
|
})
|
||||||
keys.map((item,index)=>{
|
keys.forEach((item,index)=>{
|
||||||
let obj = {
|
let obj = {
|
||||||
name: "",
|
name: "",
|
||||||
type: "line",
|
type: "line",
|
||||||
@ -85,7 +85,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.name = data.todayProductionRates[item][0].lineName
|
obj.name = data.todayProductionRates[item][0].lineName
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionRates[item].map((subItem,index)=>{
|
data.todayProductionRates[item].forEach((subItem,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.data.push(subItem.passRate)
|
obj.data.push(subItem.passRate)
|
||||||
})
|
})
|
||||||
@ -100,11 +100,11 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let keys = Object.keys(data.weekProductionRates)
|
let keys = Object.keys(data.weekProductionRates)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionRates[keys[0]].map((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("HH:mm"))
|
||||||
})
|
})
|
||||||
keys.map((item,index)=>{
|
keys.forEach((item,index)=>{
|
||||||
let obj = {
|
let obj = {
|
||||||
name: "",
|
name: "",
|
||||||
type: "line",
|
type: "line",
|
||||||
@ -115,7 +115,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.name = data.weekProductionRates[item][0].lineName
|
obj.name = data.weekProductionRates[item][0].lineName
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionRates[item].map((subItem,index)=>{
|
data.weekProductionRates[item].forEach((subItem,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.data.push(subItem.passRate)
|
obj.data.push(subItem.passRate)
|
||||||
})
|
})
|
||||||
@ -130,11 +130,11 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let keys = Object.keys(data.monthProductionRates)
|
let keys = Object.keys(data.monthProductionRates)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionRates[keys[0]].map((item,index)=>{
|
data.monthProductionRates[keys[0]].forEach((item,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
dataSource.month.xData.push(dayjs(item.recTime).format("HH:mm"))
|
dataSource.month.xData.push(dayjs(item.recTime).format("HH:mm"))
|
||||||
})
|
})
|
||||||
keys.map((item,index)=>{
|
keys.forEach((item,index)=>{
|
||||||
let obj = {
|
let obj = {
|
||||||
name: "",
|
name: "",
|
||||||
type: "line",
|
type: "line",
|
||||||
@ -145,7 +145,7 @@ function CenterDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.name = data.monthProductionRates[item][0].lineName
|
obj.name = data.monthProductionRates[item][0].lineName
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionRates[item].map((subItem,index)=>{
|
data.monthProductionRates[item].forEach((subItem,index)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
obj.data.push(subItem.passRate)
|
obj.data.push(subItem.passRate)
|
||||||
})
|
})
|
||||||
@ -192,7 +192,7 @@ function CenterDown() {
|
|||||||
{<ReactECharts option={options} style={{ height: "100%" }} />}
|
{<ReactECharts option={options} style={{ height: "100%" }} />}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{chartData.xData.length==0 && (
|
{chartData.xData.length===0 && (
|
||||||
<p
|
<p
|
||||||
style={{
|
style={{
|
||||||
color: "#cccf",
|
color: "#cccf",
|
||||||
|
@ -77,7 +77,7 @@ function LeftDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.todayProductionScraps && data.todayProductionScraps.length > 0) {
|
if (data.todayProductionScraps && data.todayProductionScraps.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayProductionScraps.map((item,index)=>{
|
data.todayProductionScraps.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
||||||
arr1.push(arrInner);
|
arr1.push(arrInner);
|
||||||
@ -90,7 +90,7 @@ function LeftDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.weekProductionScraps && data.weekProductionScraps.length > 0) {
|
if (data.weekProductionScraps && data.weekProductionScraps.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekProductionScraps.map((item,index)=>{
|
data.weekProductionScraps.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
||||||
arr2.push(arrInner);
|
arr2.push(arrInner);
|
||||||
@ -103,7 +103,7 @@ function LeftDown() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (data.monthProductionScraps && data.monthProductionScraps.length > 0) {
|
if (data.monthProductionScraps && data.monthProductionScraps.length > 0) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthProductionScraps.map((item,index)=>{
|
data.monthProductionScraps.forEach((item,index)=>{
|
||||||
let arrInner = [];
|
let arrInner = [];
|
||||||
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
arrInner.push(index+1,item.sectionName,item.scrapNum || 0);
|
||||||
arr3.push(arrInner);
|
arr3.push(arrInner);
|
||||||
|
@ -37,7 +37,7 @@ function LeftUp() {
|
|||||||
let sum: number[] = [];
|
let sum: number[] = [];
|
||||||
// 生成obj
|
// 生成obj
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.scrapBars.map((item,index) => {
|
data.scrapBars.forEach((item,index) => {
|
||||||
let obj = {
|
let obj = {
|
||||||
data: [],
|
data: [],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
@ -67,7 +67,7 @@ function LeftUp() {
|
|||||||
for(let i = 0;i < dataSource.day.series.length;i++){
|
for(let i = 0;i < dataSource.day.series.length;i++){
|
||||||
let itemSeries = dataSource.day.series[i]
|
let itemSeries = dataSource.day.series[i]
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.todayAllProductionScraps[item].map((itemInner,indexInner)=>{
|
data.todayAllProductionScraps[item].forEach((itemInner,indexInner)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@ -105,7 +105,7 @@ function LeftUp() {
|
|||||||
let sum: number[] = [];
|
let sum: number[] = [];
|
||||||
// 生成obj
|
// 生成obj
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.scrapBars.map((item,index) => {
|
data.scrapBars.forEach((item,index) => {
|
||||||
let obj = {
|
let obj = {
|
||||||
data: [],
|
data: [],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
@ -135,7 +135,7 @@ function LeftUp() {
|
|||||||
for(let i = 0;i < dataSource.week.series.length;i++){
|
for(let i = 0;i < dataSource.week.series.length;i++){
|
||||||
let itemSeries = dataSource.week.series[i]
|
let itemSeries = dataSource.week.series[i]
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.weekAllProductionScraps[item].map((itemInner,indexInner)=>{
|
data.weekAllProductionScraps[item].forEach((itemInner,indexInner)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@ -173,7 +173,7 @@ function LeftUp() {
|
|||||||
let sum: number[] = [];
|
let sum: number[] = [];
|
||||||
// 生成obj
|
// 生成obj
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.scrapBars.map((item,index) => {
|
data.scrapBars.forEach((item,index) => {
|
||||||
let obj = {
|
let obj = {
|
||||||
data: [],
|
data: [],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
@ -203,7 +203,7 @@ function LeftUp() {
|
|||||||
for(let i = 0;i < dataSource.month.series.length;i++){
|
for(let i = 0;i < dataSource.month.series.length;i++){
|
||||||
let itemSeries = dataSource.month.series[i]
|
let itemSeries = dataSource.month.series[i]
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data.monthAllProductionScraps[item].map((itemInner,indexInner)=>{
|
data.monthAllProductionScraps[item].forEach((itemInner,indexInner)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
if (itemInner.sectionName.indexOf(itemSeries.name)!==-1) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
@ -5,7 +5,31 @@ import Right from "./Right";
|
|||||||
import Center from "./Center";
|
import Center from "./Center";
|
||||||
import {useEffect} from 'react';
|
import {useEffect} from 'react';
|
||||||
import {useNavigate} from "react-router-dom";
|
import {useNavigate} from "react-router-dom";
|
||||||
|
import { useDispatch } from 'react-redux';
|
||||||
|
import { UpdateLine4After } from "../../store/LinePageSlice";
|
||||||
function LinePage() {
|
function LinePage() {
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
// 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
|
||||||
|
websocket4_2.onmessage = function (event) {
|
||||||
|
let msgData = event.data
|
||||||
|
try {
|
||||||
|
msgData = JSON.parse(event.data);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("websocket: [unable to msgData] : ", event.data);
|
||||||
|
}
|
||||||
|
if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
||||||
|
dispatch(UpdateLine4After(msgData));
|
||||||
|
}
|
||||||
|
// 清理函数
|
||||||
|
return () => {
|
||||||
|
websocket4_2.close();
|
||||||
|
};
|
||||||
|
}, [dispatch]);
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleKeyDown = (event:any) => {
|
const handleKeyDown = (event:any) => {
|
||||||
|
@ -5,7 +5,31 @@ import Right from "./Right";
|
|||||||
import Center from "./Center";
|
import Center from "./Center";
|
||||||
import {useEffect} from 'react';
|
import {useEffect} from 'react';
|
||||||
import {useNavigate} from "react-router-dom";
|
import {useNavigate} from "react-router-dom";
|
||||||
|
import { useDispatch } from 'react-redux';
|
||||||
|
import { UpdateLine5Before } from "../../store/LinePageSlice";
|
||||||
function LinePage() {
|
function LinePage() {
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
// 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
|
||||||
|
websocket5_1.onmessage = function (event) {
|
||||||
|
let msgData = event.data
|
||||||
|
try {
|
||||||
|
msgData = JSON.parse(event.data);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("websocket: [unable to msgData] : ", event.data);
|
||||||
|
}
|
||||||
|
if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
||||||
|
dispatch(UpdateLine5Before(msgData));
|
||||||
|
}
|
||||||
|
// 清理函数
|
||||||
|
return () => {
|
||||||
|
websocket5_1.close();
|
||||||
|
};
|
||||||
|
}, [dispatch]);
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleKeyDown = (event:any) => {
|
const handleKeyDown = (event:any) => {
|
||||||
|
@ -192,7 +192,7 @@ function CenterDown() {
|
|||||||
{<ReactECharts option={options} style={{ height: "100%" }} />}
|
{<ReactECharts option={options} style={{ height: "100%" }} />}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{chartData.xData.length==0 && (
|
{chartData.xData.length===0 && (
|
||||||
<p
|
<p
|
||||||
style={{
|
style={{
|
||||||
color: "#cccf",
|
color: "#cccf",
|
||||||
|
@ -5,7 +5,31 @@ import Right from "./Right";
|
|||||||
import Center from "./Center";
|
import Center from "./Center";
|
||||||
import {useEffect} from 'react';
|
import {useEffect} from 'react';
|
||||||
import {useNavigate} from "react-router-dom";
|
import {useNavigate} from "react-router-dom";
|
||||||
|
import { useDispatch } from 'react-redux';
|
||||||
|
import { UpdateLine5After } from "../../store/LinePageSlice";
|
||||||
function LinePage() {
|
function LinePage() {
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
// 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
|
||||||
|
websocket5_2.onmessage = function (event) {
|
||||||
|
let msgData = event.data
|
||||||
|
try {
|
||||||
|
msgData = JSON.parse(event.data);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("websocket: [unable to msgData] : ", event.data);
|
||||||
|
}
|
||||||
|
if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
||||||
|
dispatch(UpdateLine5After(msgData));
|
||||||
|
}
|
||||||
|
// 清理函数
|
||||||
|
return () => {
|
||||||
|
websocket5_2.close();
|
||||||
|
};
|
||||||
|
}, [dispatch]);
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleKeyDown = (event:any) => {
|
const handleKeyDown = (event:any) => {
|
||||||
|
@ -1,50 +1,52 @@
|
|||||||
import {useState} from "react";
|
// import {useState} from "react";
|
||||||
import {useAppDispatch} from "./hooks";
|
import {useAppDispatch} from "./hooks";
|
||||||
import axios from "axios";
|
// import axios from "axios";
|
||||||
|
|
||||||
import {
|
// import {
|
||||||
UpdateLine1Before,
|
// UpdateLine1Before,
|
||||||
UpdateLine1After,
|
// UpdateLine1After,
|
||||||
UpdateLine2Before,
|
// UpdateLine2Before,
|
||||||
UpdateLine2After,
|
// UpdateLine2After,
|
||||||
UpdateLine3Before,
|
// UpdateLine3Before,
|
||||||
UpdateLine3After,
|
// UpdateLine3After,
|
||||||
UpdateLine4Before,
|
// UpdateLine4Before,
|
||||||
UpdateLine4After,
|
// UpdateLine4After,
|
||||||
UpdateLine5Before,
|
// UpdateLine5Before,
|
||||||
UpdateLine5After
|
// UpdateLine5After
|
||||||
} from "./LinePageSlice"
|
// } from "./LinePageSlice"
|
||||||
import { UpdateAllLine } from "./LeaderPageSlice"
|
import { UpdateAllLine } from "./LeaderPageSlice"
|
||||||
function UpdateData() {
|
function UpdateData() {
|
||||||
const [myUrl, setUrl] = useState('')
|
// const [myUrl, setUrl] = useState('')
|
||||||
axios.get('/wsconfig.json')
|
// axios.get('/wsconfig.json')
|
||||||
.then((r) => {
|
// .then((r) => {
|
||||||
setUrl(r.data.url)
|
// setUrl(r.data.url)
|
||||||
})
|
// })
|
||||||
|
// const myUrl = "192.168.8.22"
|
||||||
|
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;
|
||||||
let websocket2_1 = null;
|
// let websocket2_1 = null;
|
||||||
let websocket2_2 = null;
|
// let websocket2_2 = null;
|
||||||
let websocket3_1 = null;
|
// let websocket3_1 = null;
|
||||||
let websocket3_2 = null;
|
// let websocket3_2 = null;
|
||||||
let websocket4_1 = null;
|
// let websocket4_1 = null;
|
||||||
let websocket4_2 = null;
|
// let websocket4_2 = null;
|
||||||
let websocket5_1 = null;
|
// let websocket5_1 = null;
|
||||||
let websocket5_2 = null;
|
// let websocket5_2 = null;
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
if ('WebSocket' in window) {
|
if ('WebSocket' in window) {
|
||||||
websocketAllLine = new WebSocket("ws://" + myUrl + "/websocket/message?userId=all");
|
websocketAllLine = new WebSocket("ws://" + myUrl + "/websocket/message?userId=all");
|
||||||
websocket1_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=1-1-" + Date.now());
|
// websocket1_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=1-1-" + Date.now());
|
||||||
websocket1_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=1-2-" + Date.now());
|
// websocket1_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=1-2-" + Date.now());
|
||||||
websocket2_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=2-1-" + Date.now());
|
// websocket2_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=2-1-" + Date.now());
|
||||||
websocket2_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=2-2-" + Date.now());
|
// websocket2_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=2-2-" + Date.now());
|
||||||
websocket3_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=3-1-" + Date.now());
|
// websocket3_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=3-1-" + Date.now());
|
||||||
websocket3_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=3-2-" + Date.now());
|
// websocket3_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=3-2-" + Date.now());
|
||||||
websocket4_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=4-1-" + Date.now());
|
// websocket4_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=4-1-" + Date.now());
|
||||||
websocket4_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=4-2-" + Date.now());
|
// websocket4_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=4-2-" + Date.now());
|
||||||
websocket5_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=5-1-" + Date.now());
|
// websocket5_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=5-1-" + Date.now());
|
||||||
websocket5_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=5-2-" + Date.now());
|
// websocket5_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=5-2-" + Date.now());
|
||||||
//连接成功建立的回调方法
|
//连接成功建立的回调方法
|
||||||
} else {
|
} else {
|
||||||
alert('Not support websocket');
|
alert('Not support websocket');
|
||||||
@ -53,46 +55,46 @@ function UpdateData() {
|
|||||||
websocketAllLine.onopen = function (event) {
|
websocketAllLine.onopen = function (event) {
|
||||||
console.log("websocketAllLine-open");
|
console.log("websocketAllLine-open");
|
||||||
}
|
}
|
||||||
|
// // @ts-ignore
|
||||||
|
// websocket1_1.onopen = function (event) {
|
||||||
|
// console.log("websocket1_1-open");
|
||||||
|
// }
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
websocket1_1.onopen = function (event) {
|
// websocket1_2.onopen = function (event) {
|
||||||
console.log("websocket1_1-open");
|
// console.log("websocket1_2-open");
|
||||||
}
|
// }
|
||||||
// @ts-ignore
|
// // @ts-ignore
|
||||||
websocket1_2.onopen = function (event) {
|
// websocket2_1.onopen = function (event) {
|
||||||
console.log("websocket1_2-open");
|
// console.log("websocket2_1-open");
|
||||||
}
|
// }
|
||||||
// @ts-ignore
|
// // @ts-ignore
|
||||||
websocket2_1.onopen = function (event) {
|
// websocket2_2.onopen = function (event) {
|
||||||
console.log("websocket2_1-open");
|
// console.log("websocket2_2-open");
|
||||||
}
|
// }
|
||||||
// @ts-ignore
|
// // @ts-ignore
|
||||||
websocket2_2.onopen = function (event) {
|
// websocket3_1.onopen = function (event) {
|
||||||
console.log("websocket2_2-open");
|
// console.log("websocket3_1-open");
|
||||||
}
|
// }
|
||||||
// @ts-ignore
|
// // @ts-ignore
|
||||||
websocket3_1.onopen = function (event) {
|
// websocket3_2.onopen = function (event) {
|
||||||
console.log("websocket3_1-open");
|
// console.log("websocket3_2-open");
|
||||||
}
|
// }
|
||||||
// @ts-ignore
|
// // @ts-ignore
|
||||||
websocket3_2.onopen = function (event) {
|
// websocket4_1.onopen = function (event) {
|
||||||
console.log("websocket3_2-open");
|
// console.log("websocket4_1-open");
|
||||||
}
|
// }
|
||||||
// @ts-ignore
|
// // @ts-ignore
|
||||||
websocket4_1.onopen = function (event) {
|
// websocket4_2.onopen = function (event) {
|
||||||
console.log("websocket4_1-open");
|
// console.log("websocket4_2-open");
|
||||||
}
|
// }
|
||||||
// @ts-ignore
|
// // @ts-ignore
|
||||||
websocket4_2.onopen = function (event) {
|
// websocket5_1.onopen = function (event) {
|
||||||
console.log("websocket4_2-open");
|
// console.log("websocket5_1-open");
|
||||||
}
|
// }
|
||||||
// @ts-ignore
|
// // @ts-ignore
|
||||||
websocket5_1.onopen = function (event) {
|
// websocket5_2.onopen = function (event) {
|
||||||
console.log("websocket5_1-open");
|
// console.log("websocket5_2-open");
|
||||||
}
|
// }
|
||||||
// @ts-ignore
|
|
||||||
websocket5_2.onopen = function (event) {
|
|
||||||
console.log("websocket5_2-open");
|
|
||||||
}
|
|
||||||
//接收到消息的回调方法
|
//接收到消息的回调方法
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
websocketAllLine.onmessage = function (event) {
|
websocketAllLine.onmessage = function (event) {
|
||||||
@ -105,116 +107,116 @@ function UpdateData() {
|
|||||||
if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
||||||
dispatch(UpdateAllLine(msgData));
|
dispatch(UpdateAllLine(msgData));
|
||||||
}
|
}
|
||||||
|
// // @ts-ignore
|
||||||
|
// websocket1_1.onmessage = function (event) {
|
||||||
|
// let msgData = event.data
|
||||||
|
// try {
|
||||||
|
// msgData = JSON.parse(event.data);
|
||||||
|
// } catch (error) {
|
||||||
|
// console.log("websocket: [unable to msgData] : ", event.data);
|
||||||
|
// }
|
||||||
|
// if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
||||||
|
// dispatch(UpdateLine1Before(msgData));
|
||||||
|
// }
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
websocket1_1.onmessage = function (event) {
|
// websocket1_2.onmessage = function (event) {
|
||||||
let msgData = event.data
|
// let msgData = event.data
|
||||||
try {
|
// try {
|
||||||
msgData = JSON.parse(event.data);
|
// msgData = JSON.parse(event.data);
|
||||||
} catch (error) {
|
// } catch (error) {
|
||||||
console.log("websocket: [unable to msgData] : ", event.data);
|
// console.log("websocket: [unable to msgData] : ", event.data);
|
||||||
}
|
// }
|
||||||
if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
// if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
||||||
dispatch(UpdateLine1Before(msgData));
|
// dispatch(UpdateLine1After(msgData));
|
||||||
}
|
// }
|
||||||
// @ts-ignore
|
// // @ts-ignore
|
||||||
websocket1_2.onmessage = function (event) {
|
// websocket2_1.onmessage = function (event) {
|
||||||
let msgData = event.data
|
// let msgData = event.data
|
||||||
try {
|
// try {
|
||||||
msgData = JSON.parse(event.data);
|
// msgData = JSON.parse(event.data);
|
||||||
} catch (error) {
|
// } catch (error) {
|
||||||
console.log("websocket: [unable to msgData] : ", event.data);
|
// console.log("websocket: [unable to msgData] : ", event.data);
|
||||||
}
|
// }
|
||||||
if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
// if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
||||||
dispatch(UpdateLine1After(msgData));
|
// dispatch(UpdateLine2Before(msgData));
|
||||||
}
|
// }
|
||||||
// @ts-ignore
|
// // @ts-ignore
|
||||||
websocket2_1.onmessage = function (event) {
|
// websocket2_2.onmessage = function (event) {
|
||||||
let msgData = event.data
|
// let msgData = event.data
|
||||||
try {
|
// try {
|
||||||
msgData = JSON.parse(event.data);
|
// msgData = JSON.parse(event.data);
|
||||||
} catch (error) {
|
// } catch (error) {
|
||||||
console.log("websocket: [unable to msgData] : ", event.data);
|
// console.log("websocket: [unable to msgData] : ", event.data);
|
||||||
}
|
// }
|
||||||
if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
// if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
||||||
dispatch(UpdateLine2Before(msgData));
|
// dispatch(UpdateLine2After(msgData));
|
||||||
}
|
// }
|
||||||
// @ts-ignore
|
// // @ts-ignore
|
||||||
websocket2_2.onmessage = function (event) {
|
// websocket3_1.onmessage = function (event) {
|
||||||
let msgData = event.data
|
// let msgData = event.data
|
||||||
try {
|
// try {
|
||||||
msgData = JSON.parse(event.data);
|
// msgData = JSON.parse(event.data);
|
||||||
} catch (error) {
|
// } catch (error) {
|
||||||
console.log("websocket: [unable to msgData] : ", event.data);
|
// console.log("websocket: [unable to msgData] : ", event.data);
|
||||||
}
|
// }
|
||||||
if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
// if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
||||||
dispatch(UpdateLine2After(msgData));
|
// dispatch(UpdateLine3Before(msgData));
|
||||||
}
|
// }
|
||||||
// @ts-ignore
|
// // @ts-ignore
|
||||||
websocket3_1.onmessage = function (event) {
|
// websocket3_2.onmessage = function (event) {
|
||||||
let msgData = event.data
|
// let msgData = event.data
|
||||||
try {
|
// try {
|
||||||
msgData = JSON.parse(event.data);
|
// msgData = JSON.parse(event.data);
|
||||||
} catch (error) {
|
// } catch (error) {
|
||||||
console.log("websocket: [unable to msgData] : ", event.data);
|
// console.log("websocket: [unable to msgData] : ", event.data);
|
||||||
}
|
// }
|
||||||
if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
// if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
||||||
dispatch(UpdateLine3Before(msgData));
|
// dispatch(UpdateLine3After(msgData));
|
||||||
}
|
// }
|
||||||
// @ts-ignore
|
// // @ts-ignore
|
||||||
websocket3_2.onmessage = function (event) {
|
// websocket4_1.onmessage = function (event) {
|
||||||
let msgData = event.data
|
// let msgData = event.data
|
||||||
try {
|
// try {
|
||||||
msgData = JSON.parse(event.data);
|
// msgData = JSON.parse(event.data);
|
||||||
} catch (error) {
|
// } catch (error) {
|
||||||
console.log("websocket: [unable to msgData] : ", event.data);
|
// console.log("websocket: [unable to msgData] : ", event.data);
|
||||||
}
|
// }
|
||||||
if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
// if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
||||||
dispatch(UpdateLine3After(msgData));
|
// dispatch(UpdateLine4Before(msgData));
|
||||||
}
|
// }
|
||||||
// @ts-ignore
|
// // @ts-ignore
|
||||||
websocket4_1.onmessage = function (event) {
|
// websocket4_2.onmessage = function (event) {
|
||||||
let msgData = event.data
|
// let msgData = event.data
|
||||||
try {
|
// try {
|
||||||
msgData = JSON.parse(event.data);
|
// msgData = JSON.parse(event.data);
|
||||||
} catch (error) {
|
// } catch (error) {
|
||||||
console.log("websocket: [unable to msgData] : ", event.data);
|
// console.log("websocket: [unable to msgData] : ", event.data);
|
||||||
}
|
// }
|
||||||
if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
// if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
||||||
dispatch(UpdateLine4Before(msgData));
|
// dispatch(UpdateLine4After(msgData));
|
||||||
}
|
// }
|
||||||
// @ts-ignore
|
// // @ts-ignore
|
||||||
websocket4_2.onmessage = function (event) {
|
// websocket5_1.onmessage = function (event) {
|
||||||
let msgData = event.data
|
// let msgData = event.data
|
||||||
try {
|
// try {
|
||||||
msgData = JSON.parse(event.data);
|
// msgData = JSON.parse(event.data);
|
||||||
} catch (error) {
|
// } catch (error) {
|
||||||
console.log("websocket: [unable to msgData] : ", event.data);
|
// console.log("websocket: [unable to msgData] : ", event.data);
|
||||||
}
|
// }
|
||||||
if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
// if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
||||||
dispatch(UpdateLine4After(msgData));
|
// dispatch(UpdateLine5Before(msgData));
|
||||||
}
|
// }
|
||||||
// @ts-ignore
|
// // @ts-ignore
|
||||||
websocket5_1.onmessage = function (event) {
|
// websocket5_2.onmessage = function (event) {
|
||||||
let msgData = event.data
|
// let msgData = event.data
|
||||||
try {
|
// try {
|
||||||
msgData = JSON.parse(event.data);
|
// msgData = JSON.parse(event.data);
|
||||||
} catch (error) {
|
// } catch (error) {
|
||||||
console.log("websocket: [unable to msgData] : ", event.data);
|
// console.log("websocket: [unable to msgData] : ", event.data);
|
||||||
}
|
// }
|
||||||
if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
// if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
||||||
dispatch(UpdateLine5Before(msgData));
|
// dispatch(UpdateLine5After(msgData));
|
||||||
}
|
// }
|
||||||
// @ts-ignore
|
|
||||||
websocket5_2.onmessage = function (event) {
|
|
||||||
let msgData = event.data
|
|
||||||
try {
|
|
||||||
msgData = JSON.parse(event.data);
|
|
||||||
} catch (error) {
|
|
||||||
console.log("websocket: [unable to msgData] : ", event.data);
|
|
||||||
}
|
|
||||||
if (!Object.prototype.toString.call(msgData).includes('Object')) return;
|
|
||||||
dispatch(UpdateLine5After(msgData));
|
|
||||||
}
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user