diff --git a/__pycache__/e2e_mes_verify.cpython-313.pyc b/__pycache__/e2e_mes_verify.cpython-313.pyc new file mode 100644 index 0000000..7e861d5 Binary files /dev/null and b/__pycache__/e2e_mes_verify.cpython-313.pyc differ diff --git a/__pycache__/e2e_union_verify.cpython-313.pyc b/__pycache__/e2e_union_verify.cpython-313.pyc new file mode 100644 index 0000000..97c973b Binary files /dev/null and b/__pycache__/e2e_union_verify.cpython-313.pyc differ diff --git a/bj_power_dashboard/package-lock.json b/bj_power_dashboard/package-lock.json index 91963d0..49d23d6 100644 --- a/bj_power_dashboard/package-lock.json +++ b/bj_power_dashboard/package-lock.json @@ -13,12 +13,14 @@ "echarts": "^5.5.1", "react": "^18.3.1", "react-dom": "^18.3.1", + "three": "^0.185.1", "tslib": "^2.7.0" }, "devDependencies": { "@types/node": "^26.4.0", "@types/react": "^18.3.11", "@types/react-dom": "^18.3.1", + "@types/three": "^0.185.4", "@vitejs/plugin-react": "^4.3.3", "typescript": "^5.6.3", "vite": "^5.4.10" @@ -315,6 +317,13 @@ "node": ">=6.9.0" } }, + "node_modules/@dimforge/rapier3d-compat": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@dimforge/rapier3d-compat/-/rapier3d-compat-0.12.0.tgz", + "integrity": "sha512-uekIGetywIgopfD97oDL5PfeezkFpNhwlzlaEYNOA0N6ghdsOvh/HYjSMek5Q2O1PYvRSDFcqFVJl4r4ZBwOow==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/@dnd-kit/accessibility": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/@dnd-kit/accessibility/-/accessibility-3.1.1.tgz", @@ -1011,9 +1020,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1122,9 +1128,6 @@ "arm" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1139,9 +1142,6 @@ "arm" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1156,9 +1156,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1173,9 +1170,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1190,9 +1184,6 @@ "loong64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1207,9 +1198,6 @@ "loong64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1224,9 +1212,6 @@ "ppc64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1241,9 +1226,6 @@ "ppc64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1258,9 +1240,6 @@ "riscv64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1275,9 +1254,6 @@ "riscv64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1292,9 +1268,6 @@ "s390x" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1309,9 +1282,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1326,9 +1296,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1919,6 +1886,13 @@ "@tiptap/pm": "3.30.5" } }, + "node_modules/@tweenjs/tween.js": { + "version": "23.1.3", + "resolved": "https://registry.npmjs.org/@tweenjs/tween.js/-/tween.js-23.1.3.tgz", + "integrity": "sha512-vJmvvwFxYuGnF2axRtPYocag6Clbb5YS7kLL+SO/TeVFzHqDIWrNKYtcsPMibjDx9O+bu+psAy9NKfWklassUA==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/babel__core": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", @@ -2053,6 +2027,28 @@ "@types/react": "^18.0.0" } }, + "node_modules/@types/stats.js": { + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/stats.js/-/stats.js-0.17.4.tgz", + "integrity": "sha512-jIBvWWShCvlBqBNIZt0KAshWpvSjhkwkEu4ZUcASoAvhmrgAUI2t1dXrjSL4xXVLB4FznPrIsX3nKXFl/Dt4vA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/three": { + "version": "0.185.4", + "resolved": "https://registry.npmjs.org/@types/three/-/three-0.185.4.tgz", + "integrity": "sha512-gAsBIC07NIFrxjbf7tH2t71c38uulFfk/RFoC7FNBSjMRAQ8J1x/RBvusX0N5PJouaYFJawXQqfCQ0RKUx/1nA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@dimforge/rapier3d-compat": "~0.12.0", + "@tweenjs/tween.js": "~23.1.3", + "@types/stats.js": "*", + "@types/webxr": ">=0.5.17", + "fflate": "~0.8.2", + "meshoptimizer": "~1.1.1" + } + }, "node_modules/@types/unist": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", @@ -2065,6 +2061,13 @@ "integrity": "sha512-zFDAD+tlpf2r4asuHEj0XH6pY6i0g5NeAHPn+15wk3BV6JA69eERFXC1gyGThDkVa1zCyKr5jox1+2LbV/AMLg==", "license": "MIT" }, + "node_modules/@types/webxr": { + "version": "0.5.24", + "resolved": "https://registry.npmjs.org/@types/webxr/-/webxr-0.5.24.tgz", + "integrity": "sha512-h8fgEd/DpoS9CBrjEQXR+dIDraopAEfu4wYVNY2tEPwk60stPWhvZMf4Foo5FakuQ7HFZoa8WceaWFervK2Ovg==", + "dev": true, + "license": "MIT" + }, "node_modules/@ungap/structured-clone": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.4.0.tgz", @@ -2633,6 +2636,13 @@ "node": ">=6.0.0" } }, + "node_modules/fflate": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.3.tgz", + "integrity": "sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==", + "dev": true, + "license": "MIT" + }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -3191,6 +3201,13 @@ "integrity": "sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==", "license": "MIT" }, + "node_modules/meshoptimizer": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/meshoptimizer/-/meshoptimizer-1.1.1.tgz", + "integrity": "sha512-oRFNWJRDA/WTrVj7NWvqa5HqE1t9MYDj2VaWirQCzCCrAd2GHrqR/sQezCxiWATPNlKTcRaPRHPJwIRoPBAp5g==", + "dev": true, + "license": "MIT" + }, "node_modules/micromark": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.2.tgz", @@ -4577,6 +4594,12 @@ "inline-style-parser": "0.2.7" } }, + "node_modules/three": { + "version": "0.185.1", + "resolved": "https://registry.npmjs.org/three/-/three-0.185.1.tgz", + "integrity": "sha512-5aojFCXKwnjBRZvUnt3WFfEcvUJgkN5LlijRFN95hMy8WVkG4I0QNcJE+OuWvuJ0bOdStrbfXn0pkd6/QyiAlg==", + "license": "MIT" + }, "node_modules/trim-lines": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", diff --git a/bj_power_dashboard/package.json b/bj_power_dashboard/package.json index 3c79df6..aee7bf8 100644 --- a/bj_power_dashboard/package.json +++ b/bj_power_dashboard/package.json @@ -15,12 +15,14 @@ "echarts": "^5.5.1", "react": "^18.3.1", "react-dom": "^18.3.1", + "three": "^0.185.1", "tslib": "^2.7.0" }, "devDependencies": { "@types/node": "^26.4.0", "@types/react": "^18.3.11", "@types/react-dom": "^18.3.1", + "@types/three": "^0.185.4", "@vitejs/plugin-react": "^4.3.3", "typescript": "^5.6.3", "vite": "^5.4.10" diff --git a/bj_power_dashboard/src/App.tsx b/bj_power_dashboard/src/App.tsx index d7287b5..d543953 100644 --- a/bj_power_dashboard/src/App.tsx +++ b/bj_power_dashboard/src/App.tsx @@ -1,49 +1,56 @@ -import { useState } from 'react'; +import { useEffect, useState } from 'react'; import { Layout, Nav, Tag, Spin } from '@douyinfe/semi-ui'; -import { IconMonitorStroked, IconSaveStroked, IconAlertCircle, IconGridView } from '@douyinfe/semi-icons'; +import { IconMonitorStroked, IconSaveStroked, IconGridView } from '@douyinfe/semi-icons'; import { useDashboardData } from '@bj_power_dashboard/hooks/useDashboardData'; import { ProductionBoard } from '@bj_power_dashboard/pages/ProductionBoard'; import { WarehouseBoard } from '@bj_power_dashboard/pages/WarehouseBoard'; -import { AlarmBoard } from '@bj_power_dashboard/pages/AlarmBoard'; import { LineModel } from '@bj_power_dashboard/pages/LineModel'; import { ErrorRetry } from '@bj_power_dashboard/components/ErrorRetry'; -type PageKey = 'production' | 'warehouse' | 'alarms' | 'model'; +type PageKey = 'production' | 'warehouse' | 'model'; + +const navItems = [ + { itemKey: 'production', text: '生产总览', icon: }, + { itemKey: 'warehouse', text: '仓储动态', icon: }, + { itemKey: 'model', text: '产线孪生', icon: }, +]; + +const CYCLE_ORDER: PageKey[] = ['production', 'warehouse', 'model']; +const CYCLE_MS = 40_000; export function App() { const [page, setPage] = useState('production'); const { data: dashboard, mode, error, retry } = useDashboardData(); const loading = !dashboard && !error; - const navItems = [ - { itemKey: 'production', text: '生产数据看板', icon: }, - { itemKey: 'warehouse', text: '仓储数据看板', icon: }, - { itemKey: 'alarms', text: '异常报警', icon: }, - { itemKey: 'model', text: '产线模型', icon: }, - ]; + // 无人值守自动轮播:40s 切下一屏;手动点选后重新计时 + useEffect(() => { + const timer = setInterval(() => { + setPage((cur) => { + const idx = CYCLE_ORDER.indexOf(cur); + return CYCLE_ORDER[(idx + 1) % CYCLE_ORDER.length]; + }); + }, CYCLE_MS); + return () => clearInterval(timer); + }, [page]); + + const selectPage = (k: string) => setPage(k as PageKey); return (
北京电力智能产线 · 生产看板
- {mode === 'sse' ? ( - SSE 实时 - ) : mode === 'polling' ? ( - HTTP 轮询 10s - ) : ( - 连接中 - )} + {mode === 'sse' && 实时推送} + {mode === 'polling' && 轮询刷新} + {mode === 'demo' && 演示数据} + {mode === 'init' && 连接中} {new Date().toLocaleTimeString('zh-CN')}
-