Compare commits
22 Commits
master
...
2dfd975b46
| Author | SHA1 | Date | |
|---|---|---|---|
| 2dfd975b46 | |||
| d4e19d519b | |||
| 9212b45ece | |||
| b5916dd408 | |||
| 206b6915e5 | |||
| 5189fdb621 | |||
| db539893ce | |||
| a1922cdeaf | |||
| 674721504d | |||
| 0ec7b3ea88 | |||
| 2263b190f5 | |||
| 075352a33b | |||
| 2a531f9e32 | |||
| a3b2f14620 | |||
| d6b5c9ad44 | |||
| 36d1517eef | |||
| 30ce706280 | |||
| f22c2bedfe | |||
| be8576b887 | |||
| 5073f64240 | |||
| e363fb2799 | |||
| 81a9ed3dd1 |
Binary file not shown.
19
env.js
19
env.js
@@ -9,15 +9,21 @@ const currentEnv = import.meta.env?.MODE || process.env.NODE_ENV;
|
||||
// 环境配置映射
|
||||
const envConfig = {
|
||||
[ENV.DEV]: {
|
||||
//baseURL: 'http://192.168.2.59:8081',//http://192.168.2.56:8081
|
||||
//baseURL: 'http://1.95.137.212:8081',//http://192.168.2.56:8081
|
||||
baseURL: 'http://1.95.137.212:59003',//http://192.168.2.56:8081
|
||||
|
||||
////baseURL: 'http://1.95.137.212:59015',//http://192.168.2.56:8081
|
||||
//WS_URL: 'ws://192.168.2.59:9002/ws/',
|
||||
//mqtt_url: "ws://1.95.137.212:8083/mqtt",
|
||||
//geoserver_url: "http://192.168.2.59:7000/geoserver"
|
||||
|
||||
baseURL: 'http://1.95.137.212:8081',//http://192.168.2.56:8081
|
||||
//baseURL: 'http://1.95.137.212:8081',//http://192.168.2.56:8081
|
||||
//baseURL: 'http://192.168.2.62:8081',//http://192.168.2.56:8081
|
||||
WS_URL: 'ws://1.95.137.212:59005/ws/',
|
||||
|
||||
//baseURL: 'https://serviceri.satabot.com',
|
||||
WS_URL: 'ws://1.95.137.212:9002/ws/',
|
||||
//WS_URL: 'ws://1.95.137.212:9002/ws/',
|
||||
//WS_URL: 'ws://192.168.2.62:9002/ws/',
|
||||
mqtt_url: "ws://1.95.137.212:8083/mqtt",
|
||||
geoserver_url: "http://1.95.137.212:7900/geoserver"
|
||||
|
||||
@@ -35,10 +41,13 @@ const envConfig = {
|
||||
//mqtt_url: "ws://1.95.137.212:8083/mqtt",
|
||||
//geoserver_url: "http://1.95.137.212:59018/geoserver"
|
||||
|
||||
baseURL: 'http://1.95.137.212:59003',//http://192.168.2.56:8081
|
||||
WS_URL: 'ws://1.95.137.212:59005/ws/',
|
||||
|
||||
baseURL: 'http://1.95.137.212:8081',//http://192.168.2.56:8081
|
||||
|
||||
//baseURL: 'http://1.95.137.212:8081',//http://192.168.2.56:8081
|
||||
//baseURL: 'https://serviceri.satabot.com',
|
||||
WS_URL: 'ws://1.95.137.212:9002/ws/',
|
||||
//WS_URL: 'ws://1.95.137.212:9002/ws/',
|
||||
mqtt_url: "ws://1.95.137.212:8083/mqtt",
|
||||
geoserver_url: "http://1.95.137.212:7900/geoserver"
|
||||
},
|
||||
|
||||
10
index.html
10
index.html
@@ -14,9 +14,13 @@
|
||||
<link rel="dns-prefetch" href="https://lf-unpkg.volccdn.com">
|
||||
|
||||
<!-- CSS 异步加载,不阻塞页面渲染 -->
|
||||
<link rel="stylesheet" href="/css/leaflet.css" media="print" onload="this.media='all'">
|
||||
<link rel="stylesheet" href="/css/widgets.css" media="print" onload="this.media='all'">
|
||||
<link rel="stylesheet" href="/css/veplayer.css" media="print" onload="this.media='all'">
|
||||
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" media="print"
|
||||
onload="this.media='all'">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/cesium@latest/Build/Cesium/Widgets/widgets.css"
|
||||
media="print" onload="this.media='all'">
|
||||
<link rel="stylesheet"
|
||||
href="https://lf-unpkg.volccdn.com/obj/vcloudfe/sdk/@volcengine/veplayer/2.11.2/umd/veplayer.production.css"
|
||||
media="print" onload="this.media='all'">
|
||||
<script src="/js/jswebrtc.min.js"></script>
|
||||
<script src="/js/cesium.js"></script>
|
||||
|
||||
|
||||
@@ -1,661 +0,0 @@
|
||||
/* required styles */
|
||||
|
||||
.leaflet-pane,
|
||||
.leaflet-tile,
|
||||
.leaflet-marker-icon,
|
||||
.leaflet-marker-shadow,
|
||||
.leaflet-tile-container,
|
||||
.leaflet-pane > svg,
|
||||
.leaflet-pane > canvas,
|
||||
.leaflet-zoom-box,
|
||||
.leaflet-image-layer,
|
||||
.leaflet-layer {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
.leaflet-container {
|
||||
overflow: hidden;
|
||||
}
|
||||
.leaflet-tile,
|
||||
.leaflet-marker-icon,
|
||||
.leaflet-marker-shadow {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
user-select: none;
|
||||
-webkit-user-drag: none;
|
||||
}
|
||||
/* Prevents IE11 from highlighting tiles in blue */
|
||||
.leaflet-tile::selection {
|
||||
background: transparent;
|
||||
}
|
||||
/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
|
||||
.leaflet-safari .leaflet-tile {
|
||||
image-rendering: -webkit-optimize-contrast;
|
||||
}
|
||||
/* hack that prevents hw layers "stretching" when loading new tiles */
|
||||
.leaflet-safari .leaflet-tile-container {
|
||||
width: 1600px;
|
||||
height: 1600px;
|
||||
-webkit-transform-origin: 0 0;
|
||||
}
|
||||
.leaflet-marker-icon,
|
||||
.leaflet-marker-shadow {
|
||||
display: block;
|
||||
}
|
||||
/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
|
||||
/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
|
||||
.leaflet-container .leaflet-overlay-pane svg {
|
||||
max-width: none !important;
|
||||
max-height: none !important;
|
||||
}
|
||||
.leaflet-container .leaflet-marker-pane img,
|
||||
.leaflet-container .leaflet-shadow-pane img,
|
||||
.leaflet-container .leaflet-tile-pane img,
|
||||
.leaflet-container img.leaflet-image-layer,
|
||||
.leaflet-container .leaflet-tile {
|
||||
max-width: none !important;
|
||||
max-height: none !important;
|
||||
width: auto;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.leaflet-container img.leaflet-tile {
|
||||
/* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */
|
||||
mix-blend-mode: plus-lighter;
|
||||
}
|
||||
|
||||
.leaflet-container.leaflet-touch-zoom {
|
||||
-ms-touch-action: pan-x pan-y;
|
||||
touch-action: pan-x pan-y;
|
||||
}
|
||||
.leaflet-container.leaflet-touch-drag {
|
||||
-ms-touch-action: pinch-zoom;
|
||||
/* Fallback for FF which doesn't support pinch-zoom */
|
||||
touch-action: none;
|
||||
touch-action: pinch-zoom;
|
||||
}
|
||||
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
|
||||
-ms-touch-action: none;
|
||||
touch-action: none;
|
||||
}
|
||||
.leaflet-container {
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
.leaflet-container a {
|
||||
-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
|
||||
}
|
||||
.leaflet-tile {
|
||||
filter: inherit;
|
||||
visibility: hidden;
|
||||
}
|
||||
.leaflet-tile-loaded {
|
||||
visibility: inherit;
|
||||
}
|
||||
.leaflet-zoom-box {
|
||||
width: 0;
|
||||
height: 0;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
z-index: 800;
|
||||
}
|
||||
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
|
||||
.leaflet-overlay-pane svg {
|
||||
-moz-user-select: none;
|
||||
}
|
||||
|
||||
.leaflet-pane { z-index: 400; }
|
||||
|
||||
.leaflet-tile-pane { z-index: 200; }
|
||||
.leaflet-overlay-pane { z-index: 400; }
|
||||
.leaflet-shadow-pane { z-index: 500; }
|
||||
.leaflet-marker-pane { z-index: 600; }
|
||||
.leaflet-tooltip-pane { z-index: 650; }
|
||||
.leaflet-popup-pane { z-index: 700; }
|
||||
|
||||
.leaflet-map-pane canvas { z-index: 100; }
|
||||
.leaflet-map-pane svg { z-index: 200; }
|
||||
|
||||
.leaflet-vml-shape {
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
}
|
||||
.lvml {
|
||||
behavior: url(#default#VML);
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
|
||||
/* control positioning */
|
||||
|
||||
.leaflet-control {
|
||||
position: relative;
|
||||
z-index: 800;
|
||||
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
|
||||
pointer-events: auto;
|
||||
}
|
||||
.leaflet-top,
|
||||
.leaflet-bottom {
|
||||
position: absolute;
|
||||
z-index: 1000;
|
||||
pointer-events: none;
|
||||
}
|
||||
.leaflet-top {
|
||||
top: 0;
|
||||
}
|
||||
.leaflet-right {
|
||||
right: 0;
|
||||
}
|
||||
.leaflet-bottom {
|
||||
bottom: 0;
|
||||
}
|
||||
.leaflet-left {
|
||||
left: 0;
|
||||
}
|
||||
.leaflet-control {
|
||||
float: left;
|
||||
clear: both;
|
||||
}
|
||||
.leaflet-right .leaflet-control {
|
||||
float: right;
|
||||
}
|
||||
.leaflet-top .leaflet-control {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.leaflet-bottom .leaflet-control {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.leaflet-left .leaflet-control {
|
||||
margin-left: 10px;
|
||||
}
|
||||
.leaflet-right .leaflet-control {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
|
||||
/* zoom and fade animations */
|
||||
|
||||
.leaflet-fade-anim .leaflet-popup {
|
||||
opacity: 0;
|
||||
-webkit-transition: opacity 0.2s linear;
|
||||
-moz-transition: opacity 0.2s linear;
|
||||
transition: opacity 0.2s linear;
|
||||
}
|
||||
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
|
||||
opacity: 1;
|
||||
}
|
||||
.leaflet-zoom-animated {
|
||||
-webkit-transform-origin: 0 0;
|
||||
-ms-transform-origin: 0 0;
|
||||
transform-origin: 0 0;
|
||||
}
|
||||
svg.leaflet-zoom-animated {
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
.leaflet-zoom-anim .leaflet-zoom-animated {
|
||||
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
|
||||
-moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
|
||||
transition: transform 0.25s cubic-bezier(0,0,0.25,1);
|
||||
}
|
||||
.leaflet-zoom-anim .leaflet-tile,
|
||||
.leaflet-pan-anim .leaflet-tile {
|
||||
-webkit-transition: none;
|
||||
-moz-transition: none;
|
||||
transition: none;
|
||||
}
|
||||
|
||||
.leaflet-zoom-anim .leaflet-zoom-hide {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
|
||||
/* cursors */
|
||||
|
||||
.leaflet-interactive {
|
||||
cursor: pointer;
|
||||
}
|
||||
.leaflet-grab {
|
||||
cursor: -webkit-grab;
|
||||
cursor: -moz-grab;
|
||||
cursor: grab;
|
||||
}
|
||||
.leaflet-crosshair,
|
||||
.leaflet-crosshair .leaflet-interactive {
|
||||
cursor: crosshair;
|
||||
}
|
||||
.leaflet-popup-pane,
|
||||
.leaflet-control {
|
||||
cursor: auto;
|
||||
}
|
||||
.leaflet-dragging .leaflet-grab,
|
||||
.leaflet-dragging .leaflet-grab .leaflet-interactive,
|
||||
.leaflet-dragging .leaflet-marker-draggable {
|
||||
cursor: move;
|
||||
cursor: -webkit-grabbing;
|
||||
cursor: -moz-grabbing;
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
/* marker & overlays interactivity */
|
||||
.leaflet-marker-icon,
|
||||
.leaflet-marker-shadow,
|
||||
.leaflet-image-layer,
|
||||
.leaflet-pane > svg path,
|
||||
.leaflet-tile-container {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.leaflet-marker-icon.leaflet-interactive,
|
||||
.leaflet-image-layer.leaflet-interactive,
|
||||
.leaflet-pane > svg path.leaflet-interactive,
|
||||
svg.leaflet-image-layer.leaflet-interactive path {
|
||||
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
/* visual tweaks */
|
||||
|
||||
.leaflet-container {
|
||||
background: #ddd;
|
||||
outline-offset: 1px;
|
||||
}
|
||||
.leaflet-container a {
|
||||
color: #0078A8;
|
||||
}
|
||||
.leaflet-zoom-box {
|
||||
border: 2px dotted #38f;
|
||||
background: rgba(255,255,255,0.5);
|
||||
}
|
||||
|
||||
|
||||
/* general typography */
|
||||
.leaflet-container {
|
||||
font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
|
||||
font-size: 12px;
|
||||
font-size: 0.75rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
|
||||
/* general toolbar styles */
|
||||
|
||||
.leaflet-bar {
|
||||
box-shadow: 0 1px 5px rgba(0,0,0,0.65);
|
||||
border-radius: 4px;
|
||||
}
|
||||
.leaflet-bar a {
|
||||
background-color: #fff;
|
||||
border-bottom: 1px solid #ccc;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
line-height: 26px;
|
||||
display: block;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
color: black;
|
||||
}
|
||||
.leaflet-bar a,
|
||||
.leaflet-control-layers-toggle {
|
||||
background-position: 50% 50%;
|
||||
background-repeat: no-repeat;
|
||||
display: block;
|
||||
}
|
||||
.leaflet-bar a:hover,
|
||||
.leaflet-bar a:focus {
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
.leaflet-bar a:first-child {
|
||||
border-top-left-radius: 4px;
|
||||
border-top-right-radius: 4px;
|
||||
}
|
||||
.leaflet-bar a:last-child {
|
||||
border-bottom-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
border-bottom: none;
|
||||
}
|
||||
.leaflet-bar a.leaflet-disabled {
|
||||
cursor: default;
|
||||
background-color: #f4f4f4;
|
||||
color: #bbb;
|
||||
}
|
||||
|
||||
.leaflet-touch .leaflet-bar a {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
}
|
||||
.leaflet-touch .leaflet-bar a:first-child {
|
||||
border-top-left-radius: 2px;
|
||||
border-top-right-radius: 2px;
|
||||
}
|
||||
.leaflet-touch .leaflet-bar a:last-child {
|
||||
border-bottom-left-radius: 2px;
|
||||
border-bottom-right-radius: 2px;
|
||||
}
|
||||
|
||||
/* zoom control */
|
||||
|
||||
.leaflet-control-zoom-in,
|
||||
.leaflet-control-zoom-out {
|
||||
font: bold 18px 'Lucida Console', Monaco, monospace;
|
||||
text-indent: 1px;
|
||||
}
|
||||
|
||||
.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
|
||||
/* layers control */
|
||||
|
||||
.leaflet-control-layers {
|
||||
box-shadow: 0 1px 5px rgba(0,0,0,0.4);
|
||||
background: #fff;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.leaflet-control-layers-toggle {
|
||||
background-image: url(images/layers.png);
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
}
|
||||
.leaflet-retina .leaflet-control-layers-toggle {
|
||||
background-image: url(images/layers-2x.png);
|
||||
background-size: 26px 26px;
|
||||
}
|
||||
.leaflet-touch .leaflet-control-layers-toggle {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
}
|
||||
.leaflet-control-layers .leaflet-control-layers-list,
|
||||
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
|
||||
display: none;
|
||||
}
|
||||
.leaflet-control-layers-expanded .leaflet-control-layers-list {
|
||||
display: block;
|
||||
position: relative;
|
||||
}
|
||||
.leaflet-control-layers-expanded {
|
||||
padding: 6px 10px 6px 6px;
|
||||
color: #333;
|
||||
background: #fff;
|
||||
}
|
||||
.leaflet-control-layers-scrollbar {
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
padding-right: 5px;
|
||||
}
|
||||
.leaflet-control-layers-selector {
|
||||
margin-top: 2px;
|
||||
position: relative;
|
||||
top: 1px;
|
||||
}
|
||||
.leaflet-control-layers label {
|
||||
display: block;
|
||||
font-size: 13px;
|
||||
font-size: 1.08333em;
|
||||
}
|
||||
.leaflet-control-layers-separator {
|
||||
height: 0;
|
||||
border-top: 1px solid #ddd;
|
||||
margin: 5px -10px 5px -6px;
|
||||
}
|
||||
|
||||
/* Default icon URLs */
|
||||
.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */
|
||||
background-image: url(images/marker-icon.png);
|
||||
}
|
||||
|
||||
|
||||
/* attribution and scale controls */
|
||||
|
||||
.leaflet-container .leaflet-control-attribution {
|
||||
background: #fff;
|
||||
background: rgba(255, 255, 255, 0.8);
|
||||
margin: 0;
|
||||
}
|
||||
.leaflet-control-attribution,
|
||||
.leaflet-control-scale-line {
|
||||
padding: 0 5px;
|
||||
color: #333;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.leaflet-control-attribution a {
|
||||
text-decoration: none;
|
||||
}
|
||||
.leaflet-control-attribution a:hover,
|
||||
.leaflet-control-attribution a:focus {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.leaflet-attribution-flag {
|
||||
display: inline !important;
|
||||
vertical-align: baseline !important;
|
||||
width: 1em;
|
||||
height: 0.6669em;
|
||||
}
|
||||
.leaflet-left .leaflet-control-scale {
|
||||
margin-left: 5px;
|
||||
}
|
||||
.leaflet-bottom .leaflet-control-scale {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.leaflet-control-scale-line {
|
||||
border: 2px solid #777;
|
||||
border-top: none;
|
||||
line-height: 1.1;
|
||||
padding: 2px 5px 1px;
|
||||
white-space: nowrap;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
background: rgba(255, 255, 255, 0.8);
|
||||
text-shadow: 1px 1px #fff;
|
||||
}
|
||||
.leaflet-control-scale-line:not(:first-child) {
|
||||
border-top: 2px solid #777;
|
||||
border-bottom: none;
|
||||
margin-top: -2px;
|
||||
}
|
||||
.leaflet-control-scale-line:not(:first-child):not(:last-child) {
|
||||
border-bottom: 2px solid #777;
|
||||
}
|
||||
|
||||
.leaflet-touch .leaflet-control-attribution,
|
||||
.leaflet-touch .leaflet-control-layers,
|
||||
.leaflet-touch .leaflet-bar {
|
||||
box-shadow: none;
|
||||
}
|
||||
.leaflet-touch .leaflet-control-layers,
|
||||
.leaflet-touch .leaflet-bar {
|
||||
border: 2px solid rgba(0,0,0,0.2);
|
||||
background-clip: padding-box;
|
||||
}
|
||||
|
||||
|
||||
/* popup */
|
||||
|
||||
.leaflet-popup {
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.leaflet-popup-content-wrapper {
|
||||
padding: 1px;
|
||||
text-align: left;
|
||||
border-radius: 12px;
|
||||
}
|
||||
.leaflet-popup-content {
|
||||
margin: 13px 24px 13px 20px;
|
||||
line-height: 1.3;
|
||||
font-size: 13px;
|
||||
font-size: 1.08333em;
|
||||
min-height: 1px;
|
||||
}
|
||||
.leaflet-popup-content p {
|
||||
margin: 17px 0;
|
||||
margin: 1.3em 0;
|
||||
}
|
||||
.leaflet-popup-tip-container {
|
||||
width: 40px;
|
||||
height: 20px;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
margin-top: -1px;
|
||||
margin-left: -20px;
|
||||
overflow: hidden;
|
||||
pointer-events: none;
|
||||
}
|
||||
.leaflet-popup-tip {
|
||||
width: 17px;
|
||||
height: 17px;
|
||||
padding: 1px;
|
||||
|
||||
margin: -10px auto 0;
|
||||
pointer-events: auto;
|
||||
|
||||
-webkit-transform: rotate(45deg);
|
||||
-moz-transform: rotate(45deg);
|
||||
-ms-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
.leaflet-popup-content-wrapper,
|
||||
.leaflet-popup-tip {
|
||||
background: white;
|
||||
color: #333;
|
||||
box-shadow: 0 3px 14px rgba(0,0,0,0.4);
|
||||
}
|
||||
.leaflet-container a.leaflet-popup-close-button {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
border: none;
|
||||
text-align: center;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
font: 16px/24px Tahoma, Verdana, sans-serif;
|
||||
color: #757575;
|
||||
text-decoration: none;
|
||||
background: transparent;
|
||||
}
|
||||
.leaflet-container a.leaflet-popup-close-button:hover,
|
||||
.leaflet-container a.leaflet-popup-close-button:focus {
|
||||
color: #585858;
|
||||
}
|
||||
.leaflet-popup-scrolled {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.leaflet-oldie .leaflet-popup-content-wrapper {
|
||||
-ms-zoom: 1;
|
||||
}
|
||||
.leaflet-oldie .leaflet-popup-tip {
|
||||
width: 24px;
|
||||
margin: 0 auto;
|
||||
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
|
||||
filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
|
||||
}
|
||||
|
||||
.leaflet-oldie .leaflet-control-zoom,
|
||||
.leaflet-oldie .leaflet-control-layers,
|
||||
.leaflet-oldie .leaflet-popup-content-wrapper,
|
||||
.leaflet-oldie .leaflet-popup-tip {
|
||||
border: 1px solid #999;
|
||||
}
|
||||
|
||||
|
||||
/* div icon */
|
||||
|
||||
.leaflet-div-icon {
|
||||
background: #fff;
|
||||
border: 1px solid #666;
|
||||
}
|
||||
|
||||
|
||||
/* Tooltip */
|
||||
/* Base styles for the element that has a tooltip */
|
||||
.leaflet-tooltip {
|
||||
position: absolute;
|
||||
padding: 6px;
|
||||
background-color: #fff;
|
||||
border: 1px solid #fff;
|
||||
border-radius: 3px;
|
||||
color: #222;
|
||||
white-space: nowrap;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
pointer-events: none;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,0.4);
|
||||
}
|
||||
.leaflet-tooltip.leaflet-interactive {
|
||||
cursor: pointer;
|
||||
pointer-events: auto;
|
||||
}
|
||||
.leaflet-tooltip-top:before,
|
||||
.leaflet-tooltip-bottom:before,
|
||||
.leaflet-tooltip-left:before,
|
||||
.leaflet-tooltip-right:before {
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
border: 6px solid transparent;
|
||||
background: transparent;
|
||||
content: "";
|
||||
}
|
||||
|
||||
/* Directions */
|
||||
|
||||
.leaflet-tooltip-bottom {
|
||||
margin-top: 6px;
|
||||
}
|
||||
.leaflet-tooltip-top {
|
||||
margin-top: -6px;
|
||||
}
|
||||
.leaflet-tooltip-bottom:before,
|
||||
.leaflet-tooltip-top:before {
|
||||
left: 50%;
|
||||
margin-left: -6px;
|
||||
}
|
||||
.leaflet-tooltip-top:before {
|
||||
bottom: 0;
|
||||
margin-bottom: -12px;
|
||||
border-top-color: #fff;
|
||||
}
|
||||
.leaflet-tooltip-bottom:before {
|
||||
top: 0;
|
||||
margin-top: -12px;
|
||||
margin-left: -6px;
|
||||
border-bottom-color: #fff;
|
||||
}
|
||||
.leaflet-tooltip-left {
|
||||
margin-left: -6px;
|
||||
}
|
||||
.leaflet-tooltip-right {
|
||||
margin-left: 6px;
|
||||
}
|
||||
.leaflet-tooltip-left:before,
|
||||
.leaflet-tooltip-right:before {
|
||||
top: 50%;
|
||||
margin-top: -6px;
|
||||
}
|
||||
.leaflet-tooltip-left:before {
|
||||
right: 0;
|
||||
margin-right: -12px;
|
||||
border-left-color: #fff;
|
||||
}
|
||||
.leaflet-tooltip-right:before {
|
||||
left: 0;
|
||||
margin-left: -12px;
|
||||
border-right-color: #fff;
|
||||
}
|
||||
|
||||
/* Printing */
|
||||
|
||||
@media print {
|
||||
/* Prevent printers from removing background-images of controls. */
|
||||
.leaflet-control {
|
||||
-webkit-print-color-adjust: exact;
|
||||
print-color-adjust: exact;
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -61,3 +61,4 @@ export default function App() {
|
||||
</I18nextProvider>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -455,6 +455,15 @@ export function hasPermission(params) {
|
||||
})
|
||||
}
|
||||
|
||||
///iot/workRecord/getTaskPath?taskId=74 get 获取算法回传的路径
|
||||
export function getTaskPath(params) {
|
||||
return request({
|
||||
url: '/iot/workRecord/getTaskPath',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
import request from './request';
|
||||
|
||||
export function getDeviceRunningHistoryStatistics(data) {
|
||||
return request({
|
||||
url: `/iot/device/runningHistoryStatistics`,
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
@@ -27,7 +27,7 @@ const CYAN_GLOW_COLOR = new window.Cesium.Color(
|
||||
);
|
||||
window.Cesium.Ion.defaultAccessToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmNjk0NjI1MC0wZGYyLTQ1YzItYjJmZi0wY2M5ODEwODllYzIiLCJpZCI6Mzk3MTQxLCJpYXQiOjE3NzI1MjkwMjV9.U6qmakhDgXJVXwLFyWzSxAUOFZRrDkIsRUPP6CCdnKg";
|
||||
|
||||
const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine, finishPoint, drawRealTime, realtimePosition, realtimeType, pathPoints = [], devices = [], onCameraClick, focusLocation, points = [], markedPoints = [], onPathChange, from, onClearDraw }, ref) => {
|
||||
const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine, finishPoint, drawRealTime, realtimePosition, realtimeType, pathPoints = [], devices = [], onCameraClick, focusLocation, points = [], markedPoints = [], onPathChange, from, onClearDraw, onMarkPoint, routeMode = '', polyPoints }, ref) => {
|
||||
const containerRef = useRef(null);
|
||||
const viewerRef = useRef(null);
|
||||
const tooltipRef = useRef(null);
|
||||
@@ -37,6 +37,7 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine,
|
||||
const alarmMapRef = useRef(new Map());
|
||||
const iotMapRef = useRef(new Map());
|
||||
const planLineRef = useRef(null); // points 规划航线
|
||||
const polygonRef = useRef(null); // coverage 区域多边形
|
||||
const navLineRef = useRef(null); // 完成点实时轨迹
|
||||
const markedPointsRef = useRef([]); // 标记点实体
|
||||
const { t } = useTranslation();
|
||||
@@ -153,6 +154,7 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine,
|
||||
}
|
||||
});
|
||||
}
|
||||
console.log(newPoints, "newPoints")
|
||||
|
||||
onPathChange && onPathChange(newPoints);
|
||||
};
|
||||
@@ -295,6 +297,159 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine,
|
||||
|
||||
};
|
||||
|
||||
const drawPolygon = (points) => {
|
||||
const viewer = viewerRef.current;
|
||||
if (!viewer) return;
|
||||
const isRealtimeMode = !!(
|
||||
realtimePosition?.lon &&
|
||||
realtimePosition?.lat &&
|
||||
!isNaN(Number(realtimePosition.lon)) &&
|
||||
!isNaN(Number(realtimePosition.lat))
|
||||
);
|
||||
|
||||
|
||||
const Cesium = window.Cesium;
|
||||
|
||||
// 每次绘制区域前,先移除上一次绘制的地块
|
||||
if (polygonRef.current) {
|
||||
try {
|
||||
viewer.entities.remove(polygonRef.current);
|
||||
polygonRef.current = null;
|
||||
} catch (e) { }
|
||||
}
|
||||
if (planLineRef.current) {
|
||||
try {
|
||||
viewer.entities.remove(planLineRef.current);
|
||||
planLineRef.current = null;
|
||||
} catch (e) { }
|
||||
}
|
||||
|
||||
const validPoints = points?.filter(p => {
|
||||
|
||||
const lon = Number(p.lng);
|
||||
const lat = Number(p.lat);
|
||||
return (
|
||||
!isNaN(lon) &&
|
||||
!isNaN(lat) &&
|
||||
Math.abs(lon) < 180 &&
|
||||
Math.abs(lat) < 90 &&
|
||||
lon !== 0 &&
|
||||
lat !== 0
|
||||
);
|
||||
});
|
||||
|
||||
if (validPoints.length === 0) return;
|
||||
|
||||
const positions = validPoints.map(point =>
|
||||
Cesium.Cartesian3.fromDegrees(
|
||||
Number(point.lng),
|
||||
Number(point.lat)
|
||||
)
|
||||
);
|
||||
|
||||
// coverage(区域覆盖)模式下以多边形 polygon 框绘制,否则为折线
|
||||
const isCoverage = routeMode === 'coverage';
|
||||
|
||||
let trackLine;
|
||||
if (isCoverage) {
|
||||
trackLine = viewer.entities.add({
|
||||
polygon: {
|
||||
hierarchy: positions,
|
||||
material: Cesium.Color.ORANGE.withAlpha(0.2),
|
||||
outline: true,
|
||||
outlineColor: Cesium.Color.ORANGE.withAlpha(0.8),
|
||||
height: 0,
|
||||
clampToGround: true,
|
||||
disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
trackLine = viewer.entities.add({
|
||||
polyline: {
|
||||
positions: positions,
|
||||
width: 2,
|
||||
|
||||
material: Cesium.Color.ORANGE.withAlpha(0.8),
|
||||
clampToGround: true,
|
||||
disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
polygonRef.current = trackLine;
|
||||
|
||||
// ======================
|
||||
// 🚀 非实时模式 -> 自动飞到轨迹
|
||||
// ======================
|
||||
if (!isRealtimeMode) {
|
||||
|
||||
let minLon = 180, maxLon = -180;
|
||||
let minLat = 90, maxLat = -90;
|
||||
|
||||
validPoints.forEach(p => {
|
||||
minLon = Math.min(minLon, p.lng);
|
||||
maxLon = Math.max(maxLon, p.lng);
|
||||
minLat = Math.min(minLat, p.lat);
|
||||
maxLat = Math.max(maxLat, p.lat);
|
||||
});
|
||||
if (getCameraMode() !== "track") return;
|
||||
|
||||
// 单个点
|
||||
if (validPoints.length === 1) {
|
||||
|
||||
|
||||
const p = validPoints[0];
|
||||
viewer.scene.requestRender();
|
||||
viewer.camera.flyTo({
|
||||
destination: Cesium.Cartesian3.fromDegrees(
|
||||
p.lng,
|
||||
p.lat,
|
||||
800
|
||||
),
|
||||
duration: 1.2
|
||||
});
|
||||
viewer.scene.requestRender();
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
const rectangle = Cesium.Rectangle.fromDegrees(
|
||||
minLon,
|
||||
minLat,
|
||||
maxLon,
|
||||
maxLat
|
||||
);
|
||||
|
||||
viewer.scene.requestRender();
|
||||
|
||||
viewer.camera.flyTo({
|
||||
destination: rectangle,
|
||||
duration: 1.2
|
||||
});
|
||||
|
||||
viewer.scene.requestRender();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
useEffect(() => {
|
||||
if (polyPoints && polyPoints.length > 0) {
|
||||
drawPolygon(polyPoints)
|
||||
} else {
|
||||
// polyPoints 被清空时,移除已绘制的区域
|
||||
const viewer = viewerRef.current;
|
||||
if (viewer && polygonRef.current) {
|
||||
try {
|
||||
viewer.entities.remove(polygonRef.current);
|
||||
polygonRef.current = null;
|
||||
} catch (e) { }
|
||||
}
|
||||
}
|
||||
|
||||
}, [polyPoints])
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (viewerRef.current) {
|
||||
@@ -401,7 +556,6 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine,
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log('已发布的图层:', publishedLayers);
|
||||
displayPublishedLayers(publishedLayers, baseUrl);
|
||||
})
|
||||
.catch(error => console.error('获取图层失败:', error));
|
||||
@@ -486,7 +640,7 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine,
|
||||
!isNaN(Number(realtimePosition.lon)) &&
|
||||
!isNaN(Number(realtimePosition.lat));
|
||||
|
||||
const hasTrack = (points && points.length > 0);
|
||||
const hasTrack = (points && points.length > 0) || polyPoints?.length > 0;
|
||||
|
||||
if (hasRealtime) return "realtime";
|
||||
if (hasTrack) return "track";
|
||||
@@ -500,9 +654,9 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine,
|
||||
//if (index == 2 && from == "other") {
|
||||
// //flyToLayer(layerIdentifier, baseUrl, 100);
|
||||
//}
|
||||
if (index == 1 && from == "other") {
|
||||
flyToLayer(layerIdentifier, baseUrl, 100);
|
||||
}
|
||||
//if (index == 0 && from == "other") {
|
||||
// flyToLayer(layerIdentifier, baseUrl, 100);
|
||||
//}
|
||||
//getLayerBoundsAndFit(wmsUrl, layerName);
|
||||
|
||||
if (baseUrl.includes('/gwc/service/wms')) {
|
||||
@@ -1097,7 +1251,12 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine,
|
||||
planLineRef.current = null;
|
||||
}
|
||||
|
||||
if (polygonRef.current) {
|
||||
viewer.entities.remove(polygonRef.current);
|
||||
|
||||
|
||||
polygonRef.current = null;
|
||||
}
|
||||
viewer.scene.requestRender();
|
||||
}
|
||||
prevIfClearPlanLine.current = ifClearPlanLine;
|
||||
@@ -1421,8 +1580,8 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine,
|
||||
}, window.Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
||||
|
||||
handler.setInputAction((movement) => {
|
||||
//if (from !== "device-control")
|
||||
return;
|
||||
if (from !== "deviceStatus")
|
||||
return;
|
||||
const cartesian = viewer.camera.pickEllipsoid(movement.position, viewer.scene.globe.ellipsoid);
|
||||
if (!cartesian) return;
|
||||
const cartographic = window.Cesium.Cartographic.fromCartesian(cartesian);
|
||||
@@ -1432,6 +1591,7 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine,
|
||||
const newPoints = [...drawPoints, newPoint];
|
||||
setDrawPoints(newPoints);
|
||||
updateDrawPath(newPoints);
|
||||
onMarkPoint?.({ lon, lat });
|
||||
}, window.Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
||||
|
||||
if (onClearDraw) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import React, { useState } from 'react';
|
||||
import {
|
||||
Form,
|
||||
Input,
|
||||
@@ -58,22 +58,12 @@ import {
|
||||
} from 'lucide-react';
|
||||
import dayjs from 'dayjs';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { getRoleList } from '@/api/role';
|
||||
import { useSelector } from 'react-redux';
|
||||
import { RootState } from '@/src/store';
|
||||
import { getUser } from '@/api/user';
|
||||
|
||||
const { Text, Title } = Typography;
|
||||
|
||||
const BasicSettings = () => {
|
||||
const { t } = useTranslation();
|
||||
const [form] = Form.useForm();
|
||||
const [roles, setRoles] = useState<any[]>([]);
|
||||
const { userInfo } = useSelector((state: RootState) => state.user);
|
||||
const { currentStation, stationId } = useSelector((state: RootState) => state.station);
|
||||
const [userList, setUserList] = useState<any[]>([]);
|
||||
|
||||
|
||||
|
||||
// 响应式字体大小
|
||||
const fontNormal = 'clamp(12px, 0.75vw, 13px)';
|
||||
@@ -129,7 +119,6 @@ const BasicSettings = () => {
|
||||
|
||||
// 角色权限概览
|
||||
const roleOverview = [
|
||||
//平台管理员
|
||||
{
|
||||
title: t('roles.superAdmin'),
|
||||
users: 2,
|
||||
@@ -139,68 +128,34 @@ const BasicSettings = () => {
|
||||
bg: '#e6f4ff',
|
||||
icon: <ShieldCheck size={20} color="#1677ff" />
|
||||
},
|
||||
//普通用户
|
||||
{
|
||||
title: t('systemSetting.fixed2OM'),
|
||||
users: 5,
|
||||
perms: 18,
|
||||
tags: ["处理工单", "处理任务"],
|
||||
tags: [t('router.devices'), '工单管理'],
|
||||
color: '#52c41a',
|
||||
bg: '#f6ffed',
|
||||
icon: <Wrench size={20} color="#52c41a" />
|
||||
},
|
||||
//机构管理员
|
||||
{
|
||||
title: t('systemSetting.fixed2Inspection2'),
|
||||
users: 8,
|
||||
perms: 12,
|
||||
tags: ['管理机构下所有场站', '告警处理'],
|
||||
tags: ['巡检管理', '告警处理'],
|
||||
color: '#fa8c16',
|
||||
bg: '#fff7e6',
|
||||
icon: <Users size={20} color="#fa8c16" />
|
||||
},
|
||||
//场站管理员
|
||||
{
|
||||
title: t('systemSetting.s322'),
|
||||
users: 3,
|
||||
perms: 15,
|
||||
tags: ['管理自己场站', '报表查看', '告警处理'],
|
||||
tags: ['数据分析', '报表查看'],
|
||||
color: '#722ed1',
|
||||
bg: '#f9f0ff',
|
||||
icon: <LineChart size={20} color="#722ed1" />
|
||||
},
|
||||
];
|
||||
const matchRoleStyle = (roleName: string) => {
|
||||
const found = roleOverview.find(item => item.title === roleName);
|
||||
if (found) return found;
|
||||
// 兜底默认样式
|
||||
return {
|
||||
color: '#8c8c8c',
|
||||
bg: '#f5f5f5',
|
||||
icon: null,
|
||||
tags: []
|
||||
};
|
||||
};
|
||||
|
||||
const getUserData = () => {
|
||||
const params = {
|
||||
pageNum: 1,
|
||||
pageSize: 9999,
|
||||
orgId: userInfo?.roleKey == "manager" ? userInfo?.orgId : currentStation?.orgId,
|
||||
...(userInfo?.roleKey == "manager"
|
||||
? {}
|
||||
: { siteId: stationId }
|
||||
)
|
||||
};
|
||||
|
||||
getUser(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
setUserList(res.rows || []);
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
// 设备状态
|
||||
const deviceStatuses = [
|
||||
@@ -213,21 +168,6 @@ const BasicSettings = () => {
|
||||
{ name: t('systemSetting.api'), count: t('roles.normal'), status: t('roles.normal') },
|
||||
{ name: 'Modbus', count: t('roles.normal'), status: t('roles.normal') },
|
||||
];
|
||||
const getRoleData = () => {
|
||||
const params = { pageNum: 1, pageSize: 9999 };
|
||||
getRoleList(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
let sortedRoles = (res.data || []).sort((a, b) => (a.roleSort || 999) - (b.roleSort || 999));
|
||||
setRoles(sortedRoles);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
getRoleData();
|
||||
getUserData();
|
||||
}, [])
|
||||
|
||||
|
||||
return (
|
||||
<div className="normal-spacing" style={{ padding: '8px 0px', background: '#f5f7fa', minHeight: '100vh' }}>
|
||||
@@ -240,11 +180,11 @@ const BasicSettings = () => {
|
||||
<Row gutter={[8, 8]} style={{ marginBottom: 8 }}>
|
||||
{topCards.map((item, idx) => (
|
||||
<Col key={idx} style={{ minWidth: '168px', flex: '1 0 auto', maxWidth: "250px" }}>
|
||||
<AntdCard bordered={false} bodyStyle={{ padding: '12px 16px' }} style={{ borderRadius: 10, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }}>
|
||||
<AntdCard variant="borderless" styles={{ body: { padding: '12px 16px' } }} style={{ borderRadius: 10, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
|
||||
{/*<div style={{ width: 40, height: 40, borderRadius: 10, background: item.bg, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
||||
<div style={{ width: 40, height: 40, borderRadius: 10, background: item.bg, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
||||
{React.cloneElement(item.icon as React.ReactElement, { size: 20, style: item.icon.props.style ? { ...item.icon.props.style, fontSize: 20 } : { fontSize: 20 } })}
|
||||
</div>*/}
|
||||
</div>
|
||||
<div style={{ flex: 1 }}>
|
||||
<div style={{ color: '#8c8c8c', fontSize: fontSmall, marginBottom: 2 }}>{item.title}</div>
|
||||
<div style={{ display: 'flex', alignItems: 'baseline', gap: 6 }}>
|
||||
@@ -265,9 +205,9 @@ const BasicSettings = () => {
|
||||
{/* 基础配置 */}
|
||||
<AntdCard
|
||||
title={<Space><SettingOutlined style={{ color: '#1677ff' }} /><b>{t('systemSetting.basicSettings')}</b></Space>}
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
style={{ borderRadius: 10, marginBottom: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
styles={{ body: { padding: '16px' } }}
|
||||
>
|
||||
<Form form={form} layout="vertical">
|
||||
<Row gutter={16}>
|
||||
@@ -346,9 +286,9 @@ const BasicSettings = () => {
|
||||
{/* 通知与告警策略 */}
|
||||
<AntdCard
|
||||
title={<Space><BellOutlined style={{ color: '#1677ff' }} /><b>{t('systemSetting.alert2')}</b></Space>}
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
style={{ borderRadius: 10, marginBottom: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
styles={{ body: { padding: '16px' } }}
|
||||
>
|
||||
<Row gutter={[12, 12]} style={{ marginBottom: 8 }}>
|
||||
{[
|
||||
@@ -360,7 +300,7 @@ const BasicSettings = () => {
|
||||
<Col xs={24} sm={12} lg={6} key={idx}>
|
||||
<div style={{ display: 'flex', alignItems: 'center', padding: '10px 12px', background: '#f8fafc', borderRadius: 8, border: '1px solid #f1f5f9' }}>
|
||||
<div style={{ width: 32, height: 32, borderRadius: '50%', background: '#fff', display: 'flex', alignItems: 'center', justifyContent: 'center', boxShadow: '0 1px 4px rgba(0,0,0,0.04)', marginRight: 10 }}>
|
||||
{/*{React.cloneElement(item.icon as React.ReactElement, { style: { color: item.color } })}*/}
|
||||
{React.cloneElement(item.icon as React.ReactElement, { style: { color: item.color } })}
|
||||
</div>
|
||||
<div style={{ flex: 1 }}>
|
||||
<div style={{ fontSize: 10, color: '#8c8c8c' }}>{item.label}</div>
|
||||
@@ -389,9 +329,9 @@ const BasicSettings = () => {
|
||||
{/* 用户与权限预览 */}
|
||||
<AntdCard
|
||||
title={<Space><Users size={16} style={{ color: '#1677ff' }} /><b>{t('systemSetting.fixed2RolePermissionFixed2OverviewFixed2')}</b></Space>}
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
style={{ borderRadius: 10, boxShadow: '0 2px 8px rgba(0,0,0,0.04)', marginBottom: 0 }}
|
||||
bodyStyle={{ padding: '12px' }}
|
||||
styles={{ body: { padding: '12px' } }}
|
||||
>
|
||||
<Table
|
||||
size="small"
|
||||
@@ -400,39 +340,42 @@ const BasicSettings = () => {
|
||||
empty={false}
|
||||
|
||||
|
||||
rowKey="name"
|
||||
pagination={{ size: 'small', total: 4, pageSize: 4, showTotal: (total) => `共 ${total} 条` }}
|
||||
columns={[
|
||||
{ title: t('systemSetting.s36'), dataIndex: 'userName', key: 'userName', fixed: 'left', },
|
||||
{ title: t('systemSetting.s36'), dataIndex: 'name', key: 'name', fixed: 'left', width: 80 },
|
||||
{
|
||||
title: t('users.role'),
|
||||
dataIndex: 'role',
|
||||
key: 'role',
|
||||
width: 100,
|
||||
render: (_val, record) => {
|
||||
const roleList = record.roles || [];
|
||||
return <>
|
||||
{roleList.map((rItem: any) => {
|
||||
//const conf = getRoleConfByKey(rItem.roleKey);
|
||||
return <Tag key={rItem.roleId}>{rItem.roleKey == "manager" ? t('systemSetting.fixed2Inspection2') : rItem.roleKey == "siteManager" ? t('systemSetting.s322') : t('systemSetting.fixed2OM')}</Tag>
|
||||
})}
|
||||
</>
|
||||
render: (role) => {
|
||||
const config: any = {
|
||||
'超级管理员': { color: '#1677ff', bg: '#e6f4ff' },
|
||||
'运维工程师': { color: '#52c41a', bg: '#f6ffed' },
|
||||
'巡检主管': { color: '#fa8c16', bg: '#fff7e6' },
|
||||
'数据分析师': { color: '#722ed1', bg: '#f9f0ff' },
|
||||
};
|
||||
const s = config[role] || { color: '#8c8c8c', bg: '#f5f5f5' };
|
||||
return <Tag variant="borderless" style={{ color: s.color, background: s.bg, fontSize: 10, margin: 0 }}>{role}</Tag>;
|
||||
}
|
||||
},
|
||||
{ title: t('users.phone'), dataIndex: 'phonenumber', key: 'phonenumber', },
|
||||
{ title: t('users.phone'), dataIndex: 'phone', key: 'phone', width: 110 },
|
||||
{ title: t('users.email'), dataIndex: 'email', key: 'email', ellipsis: true },
|
||||
{
|
||||
title: t('roles.status'),
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
width: 70,
|
||||
render: (status) => (
|
||||
<Space size={4}>
|
||||
<div style={{ width: 6, height: 6, borderRadius: '50%', background: status === t('devices.online') ? '#52c41a' : '#bfbfbf' }} />
|
||||
<span style={{ fontSize: 10 }}>{status == 1 ? "在线" : "离线"}</span>
|
||||
<span style={{ fontSize: 10 }}>{status}</span>
|
||||
</Space>
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('roles.actions'), key: 'action', render: () => <Button
|
||||
title: t('roles.actions'), key: 'action', width: 60, render: () => <Button
|
||||
type="link"
|
||||
size="small"
|
||||
icon={<EyeOutlined />}
|
||||
@@ -440,7 +383,12 @@ const BasicSettings = () => {
|
||||
>{t('common.view')}</Button>, fixed: 'right'
|
||||
},
|
||||
]}
|
||||
dataSource={userList}
|
||||
dataSource={[
|
||||
{ name: '张运维', role: '超级管理员', phone: '138****0001', email: 'zhangyw@pvsmart.com', status: t('devices.online') },
|
||||
{ name: '李工程师', role: '运维工程师', phone: '139****0002', email: 'li.gongcheng@pvsmart.com', status: t('devices.online') },
|
||||
{ name: '王班长', role: '巡检主管', phone: '137****0003', email: 'wang.banzhang@pvsmart.com', status: t('devices.online') },
|
||||
{ name: '赵分析师', role: '数据分析师', phone: '136****0004', email: 'zhao.fx@pvsmart.com', status: t('devices.online') },
|
||||
]}
|
||||
/>
|
||||
</AntdCard>
|
||||
</Col>
|
||||
@@ -450,46 +398,30 @@ const BasicSettings = () => {
|
||||
{/* 角色权限概览 */}
|
||||
<AntdCard
|
||||
title={<Space><Users size={16} style={{ color: '#1677ff' }} /><b>{t('systemSetting.fixed2RolePermissionFixed2OverviewFixed2')}</b></Space>}
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
style={{ borderRadius: 10, marginBottom: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }}
|
||||
bodyStyle={{ padding: '10px' }}
|
||||
styles={{ body: { padding: '10px' } }}
|
||||
>
|
||||
<Row gutter={[8, 8]}>
|
||||
{roles.map((role, idx) => {
|
||||
const styleConf = matchRoleStyle(role.roleName);
|
||||
return (
|
||||
<Col xs={24} sm={12} key={idx}>
|
||||
<div style={{ background: styleConf.bg, borderRadius: 8, padding: 8, height: '100%' }}>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 4, alignItems: 'center' }}>
|
||||
{styleConf.icon}
|
||||
</div>
|
||||
<div style={{ fontWeight: 600, fontSize: 11, color: styleConf.color, marginBottom: 2 }}>
|
||||
{role.roleName}
|
||||
</div>
|
||||
<div style={{ fontSize: 9, color: '#8c8c8c', marginBottom: 6 }}>
|
||||
用户 {role.users} | 菜单权限 {role.menuIds?.length ?? 0}
|
||||
</div>
|
||||
<div style={{ display: 'flex', gap: 4, flexWrap: 'wrap' }}>
|
||||
{styleConf.tags.map((tag, tidx) => (
|
||||
<span
|
||||
key={tidx}
|
||||
style={{
|
||||
fontSize: 8,
|
||||
padding: '0 4px',
|
||||
background: '#fff',
|
||||
color: styleConf.color,
|
||||
borderRadius: 2,
|
||||
border: `1px solid ${styleConf.color}20`
|
||||
}}
|
||||
>
|
||||
{tag}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
{roleOverview.map((role, idx) => (
|
||||
<Col xs={24} sm={12} key={idx}>
|
||||
<div style={{ background: role.bg, borderRadius: 8, padding: 8, height: '100%' }}>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 4 }}>
|
||||
{React.cloneElement(role.icon as React.ReactElement, { size: 16 })}
|
||||
<RightOutlined style={{ fontSize: 9, color: role.color }} />
|
||||
</div>
|
||||
</Col>
|
||||
);
|
||||
})}
|
||||
<div style={{ fontWeight: 600, fontSize: 11, color: role.color, marginBottom: 2 }}>{role.title}</div>
|
||||
<div style={{ fontSize: 9, color: '#8c8c8c', marginBottom: 6 }}>
|
||||
用户 {role.users} | 权限 {role.perms}
|
||||
</div>
|
||||
<div style={{ display: 'flex', gap: 4, flexWrap: 'wrap' }}>
|
||||
{role.tags.map((tag, tidx) => (
|
||||
<span key={tidx} style={{ fontSize: 8, padding: '0 4px', background: '#fff', color: role.color, borderRadius: 2, border: `1px solid ${role.color}20` }}>{tag}</span>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
))}
|
||||
</Row>
|
||||
</AntdCard>
|
||||
|
||||
@@ -497,9 +429,9 @@ const BasicSettings = () => {
|
||||
<AntdCard
|
||||
title={<Space><ApiOutlined style={{ color: '#1677ff' }} /><b>{t('systemSetting.fixed2DeviceAccessFixed2StatusFixed2')}</b></Space>}
|
||||
extra={<Button type="link" size="small" style={{ fontSize: 11, padding: 0 }}>{t('common.detail')}<RightOutlined style={{ fontSize: 9 }} /></Button>}
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
style={{ borderRadius: 10, marginBottom: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }}
|
||||
bodyStyle={{ padding: '12px' }}
|
||||
styles={{ body: { padding: '12px' } }}
|
||||
>
|
||||
<div style={{ display: 'flex', gap: 12 }}>
|
||||
<div style={{ flex: '0 0 90px' }}>
|
||||
@@ -556,9 +488,9 @@ const BasicSettings = () => {
|
||||
{/* 数据与安全 */}
|
||||
<AntdCard
|
||||
title={<Space><Shield size={16} style={{ color: '#1677ff' }} /><b>{t('systemSetting.dataSafety')}</b></Space>}
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
style={{ borderRadius: 10, marginBottom: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }}
|
||||
bodyStyle={{ padding: '12px' }}
|
||||
styles={{ body: { padding: '12px' } }}
|
||||
>
|
||||
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(120px, 1fr))', gap: '10px 16px' }}>
|
||||
{[
|
||||
@@ -587,9 +519,9 @@ const BasicSettings = () => {
|
||||
<AntdCard
|
||||
title={<Space><Wrench size={16} style={{ color: '#1677ff' }} /><b>{t('systemSetting.systemMaintenance')}</b></Space>}
|
||||
extra={<Button type="link" size="small" danger style={{ fontSize: 10, padding: 0 }}>{t('systemSetting.s192')}</Button>}
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
style={{ borderRadius: 10, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }}
|
||||
bodyStyle={{ padding: '12px' }}
|
||||
styles={{ body: { padding: '12px' } }}
|
||||
>
|
||||
<Row gutter={[8, 8]}>
|
||||
{[
|
||||
|
||||
@@ -104,7 +104,7 @@ const LogManagement = () => {
|
||||
<Text type="secondary" style={{ fontSize: 12 }}>{t('systemSetting.equipmentControlActionsSuperAdminViewFixed2')}</Text>
|
||||
</div>
|
||||
|
||||
<AntdCard bordered={false} style={{ borderRadius: 10, marginBottom: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }} bodyStyle={{ padding: 12 }}>
|
||||
<AntdCard variant="borderless" style={{ borderRadius: 10, marginBottom: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }} styles={{ body: { padding: 12 } }}>
|
||||
<Row gutter={[8, 8]} align="middle">
|
||||
<Col xs={24} sm={8} md={5}>
|
||||
<Select
|
||||
@@ -142,7 +142,7 @@ const LogManagement = () => {
|
||||
</Row>
|
||||
</AntdCard>
|
||||
|
||||
<AntdCard bordered={false} style={{ borderRadius: 10, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }} bodyStyle={{ padding: 4 }}>
|
||||
<AntdCard variant="borderless" style={{ borderRadius: 10, boxShadow: '0 2px 8px rgba(0,0,0,0.04)' }} styles={{ body: { padding: 4 } }}>
|
||||
<Table
|
||||
size="small"
|
||||
rowKey="id"
|
||||
|
||||
@@ -102,7 +102,7 @@ const OnlineUserPage = () => {
|
||||
|
||||
{/* ====================== Tab 1:在线用户 ====================== */}
|
||||
{activeTab === 'onlineUser' && (
|
||||
<Card bordered={false} style={{ borderRadius: 8 }}>
|
||||
<Card variant="borderless" style={{ borderRadius: 8 }}>
|
||||
{/* 搜索栏 */}
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 16, marginBottom: 20 }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
|
||||
@@ -140,14 +140,14 @@ const OnlineUserPage = () => {
|
||||
showTotal: (total) => `${t('common.total')} ${total} ${t('common.items')}`,
|
||||
showQuickJumper: true
|
||||
}}
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
/>
|
||||
</Card>
|
||||
)}
|
||||
|
||||
{/* ====================== Tab 2:其他页面(你可以随便改内容) ====================== */}
|
||||
{activeTab === 'other' && (
|
||||
<Card bordered={false} style={{ borderRadius: 8, padding: '40px 0', textAlign: 'center' }}>
|
||||
<Card variant="borderless" style={{ borderRadius: 8, padding: '40px 0', textAlign: 'center' }}>
|
||||
<h2>{t('systemSetting.fixed2OthersContentFixed2')}</h2>
|
||||
<p>{t('systemSetting.statusCpuContentFixed2')}</p>
|
||||
</Card>
|
||||
|
||||
@@ -12,7 +12,6 @@ import {
|
||||
getStationRegions, saveRegion, deleteRegion
|
||||
} from '../../api/stationManage';
|
||||
import { getOrgList } from '../../api/organization';
|
||||
import { fetchPublishedLayers } from '../../lib/geoServer';
|
||||
import { useSelector } from 'react-redux';
|
||||
import { RootState } from '../../store';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
@@ -27,9 +26,6 @@ export default function StationManage() {
|
||||
|
||||
// 组织列表
|
||||
const [orgList, setOrgList] = useState([]);
|
||||
// 发布图层列表(来自 GeoServer WMS)
|
||||
const [layerList, setLayerList] = useState<{ name: string; title: string }[]>([]);
|
||||
const [layerLoading, setLayerLoading] = useState(false);
|
||||
// 🔥 选中的组织ID(用于筛选)
|
||||
const [selectedOrgId, setSelectedOrgId] = useState<number | undefined>(undefined);
|
||||
|
||||
@@ -75,15 +71,6 @@ export default function StationManage() {
|
||||
});
|
||||
};
|
||||
|
||||
// ====================== 获取发布图层列表 ======================
|
||||
const getLayerData = () => {
|
||||
setLayerLoading(true);
|
||||
fetchPublishedLayers()
|
||||
.then(layers => setLayerList(layers || []))
|
||||
.catch(() => setLayerList([]))
|
||||
.finally(() => setLayerLoading(false));
|
||||
};
|
||||
|
||||
// ====================== 获取场站列表 ======================
|
||||
const getStationData = () => {
|
||||
const params = {
|
||||
@@ -94,7 +81,6 @@ export default function StationManage() {
|
||||
getStationList(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
setStationList(res.rows || []);
|
||||
|
||||
setPagination({
|
||||
...pagination,
|
||||
total: res.total || res.rows?.length || 0
|
||||
@@ -145,7 +131,6 @@ export default function StationManage() {
|
||||
|
||||
// ====================== 新增 / 编辑 场站 ======================
|
||||
const handleAdd = () => {
|
||||
getLayerData();
|
||||
form.resetFields();
|
||||
setEditRecord(null);
|
||||
// 默认全部推送关闭
|
||||
@@ -160,7 +145,6 @@ export default function StationManage() {
|
||||
};
|
||||
|
||||
const handleEdit = (record) => {
|
||||
getLayerData();
|
||||
setEditRecord(record);
|
||||
// 后端数字转布尔给Switch
|
||||
form.setFieldsValue({
|
||||
@@ -262,15 +246,6 @@ export default function StationManage() {
|
||||
// ====================== 表格列 ======================
|
||||
const columns = [
|
||||
{ title: t('systemSetting.siteName'), dataIndex: 'siteName' },
|
||||
{
|
||||
title: t('systemSetting.mappingLayer'),
|
||||
dataIndex: 'site_map_name',
|
||||
render: (value) => value ? (
|
||||
<Tag color="blue">{value}</Tag>
|
||||
) : (
|
||||
<span style={{ color: '#86909C' }}>—</span>
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('systemSetting.belongingOrg'),
|
||||
dataIndex: 'orgId',
|
||||
@@ -287,7 +262,7 @@ export default function StationManage() {
|
||||
<Space wrap size="small">
|
||||
<Button icon={<EditOutlined />} onClick={() => handleEdit(record)}>{t('roles.edit')}</Button>
|
||||
<Button icon={<BgColorsOutlined />} onClick={() => handleOpenArea(record)}>{t('systemSetting.settingsFixed2')}</Button>
|
||||
<Button onClick={() => handleOpenMap(record)}>{t('systemSetting.BoundaryDrawing')}</Button>
|
||||
<Button onClick={() => handleOpenMap(record)}>{t('systemSetting.s110')}</Button>
|
||||
<Popconfirm title={t('common.confirmDelete')} onConfirm={() => handleDelete(record.id)}>
|
||||
<Button danger>{t('roles.delete')}</Button>
|
||||
</Popconfirm>
|
||||
@@ -388,23 +363,6 @@ export default function StationManage() {
|
||||
<Input placeholder={t('systemSetting.s14')} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="site_map_name" label={t('systemSetting.mappingLayer')}>
|
||||
<Select
|
||||
placeholder={t('systemSetting.mappingLayerPlaceholder')}
|
||||
loading={layerLoading}
|
||||
allowClear
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
>
|
||||
{layerList.map(item => (
|
||||
<Option key={item.name} value={item.name} label={item.title}>
|
||||
<span style={{ display: 'inline-block', verticalAlign: 'middle' }}>{item.title}</span>
|
||||
<span style={{ color: '#999', fontSize: 12 }}>({item.name})</span>
|
||||
</Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
|
||||
<Divider orientation="left">{t('systemSetting.s3')}</Divider>
|
||||
|
||||
<Row gutter={16}>
|
||||
|
||||
@@ -185,7 +185,7 @@ const VideoManagement = () => {
|
||||
|
||||
</div>
|
||||
|
||||
<Card bordered={false} style={{ borderRadius: 10, marginBottom: 8 }} bodyStyle={{ padding: 12 }}>
|
||||
<Card variant="borderless" style={{ borderRadius: 10, marginBottom: 8 }} styles={{ body: { padding: 12 } }}>
|
||||
<Row gutter={[8, 8]} align="middle">
|
||||
<Col xs={24} sm={10} md={7}>
|
||||
<Text style={{ fontSize: 12, color: '#666' }}>{t('systemSetting.s0')}</Text>
|
||||
@@ -225,7 +225,7 @@ const VideoManagement = () => {
|
||||
</Row>
|
||||
</Card>
|
||||
|
||||
<Card bordered={false} style={{ borderRadius: 10 }} bodyStyle={{ padding: 4 }}>
|
||||
<Card variant="borderless" style={{ borderRadius: 10 }} styles={{ body: { padding: 4 } }}>
|
||||
{loading ? (
|
||||
<div style={{ textAlign: 'center', padding: 40 }}><Spin /></div>
|
||||
) : !channel ? (
|
||||
|
||||
@@ -61,44 +61,50 @@ class WebSocketManager {
|
||||
// ==================== 连接管理 ====================
|
||||
|
||||
public connect(serialNumber: string, wsUrl: string): void {
|
||||
console.log("创建开始");//ws://192.168.2.56:9002/ws/
|
||||
// 清除之前的重连计时器
|
||||
console.log("创建开始");
|
||||
|
||||
// 清除重连计时器
|
||||
if (this.reconnectTimer) {
|
||||
clearTimeout(this.reconnectTimer);
|
||||
this.reconnectTimer = null;
|
||||
}
|
||||
|
||||
if (serialNumber == null || serialNumber.trim() === "") {
|
||||
console.log("serialNumber 是空/空白,停止执行");
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果序列号相同且已连接,跳过
|
||||
if (this.ws && this.currentSerialRef === serialNumber && this.status === 'connected') {
|
||||
console.log('WebSocket already connected for this device');
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果序列号不同,先关闭旧连接
|
||||
if (this.ws && this.currentSerialRef !== serialNumber) {
|
||||
// ========== 重点修复:关闭旧连接,并且清空旧ws的事件监听,防止旧消息回调执行 ==========
|
||||
if (this.ws) {
|
||||
// 解绑所有事件,阻止旧ws继续触发onmessage/onclose
|
||||
this.ws.onopen = null;
|
||||
this.ws.onmessage = null;
|
||||
this.ws.onerror = null;
|
||||
this.ws.onclose = null;
|
||||
this.close();
|
||||
this.ws = null;
|
||||
}
|
||||
|
||||
this.currentSerialRef = serialNumber;
|
||||
this.setStatus('connecting');
|
||||
this.isManualCloseRef = false;
|
||||
// 提前赋值,不要等到new WebSocket之后
|
||||
this.wsSerialRef = serialNumber;
|
||||
|
||||
console.log('Connecting WebSocket for', serialNumber);
|
||||
|
||||
|
||||
if (serialNumber == null || serialNumber.trim() === "") {
|
||||
console.log("serialNumber 是空/空白,停止执行");
|
||||
return;
|
||||
}
|
||||
|
||||
this.ws = new WebSocket(wsUrl);
|
||||
this.wsSerialRef = serialNumber;
|
||||
|
||||
this.ws.onopen = () => {
|
||||
console.log('WebSocket Connected');
|
||||
this.setStatus('connected');
|
||||
|
||||
|
||||
const dataStr = localStorage.getItem('userInfo');
|
||||
if (!dataStr) {
|
||||
console.error('用户信息未找到,无法发送认证包');
|
||||
@@ -109,18 +115,21 @@ class WebSocketManager {
|
||||
|
||||
console.log('WebSocket%', token);
|
||||
console.log('WebSocket%', parse);
|
||||
console.log("开始发送认证包");//ws://192.168.2.56:9002/ws/
|
||||
// 发送 AUTH 认证消息
|
||||
console.log("开始发送认证包");
|
||||
this.send({
|
||||
type: 'AUTH',
|
||||
token: token,
|
||||
userName: parse.username,
|
||||
deviceId: serialNumber,
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
this.ws.onmessage = (event) => {
|
||||
// 【防御二次校验】只有当前活跃serial才处理消息,旧连接残留消息直接丢弃
|
||||
if (this.wsSerialRef !== this.currentSerialRef) {
|
||||
console.log('丢弃过期ws消息');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const data = JSON.parse(event.data);
|
||||
this.handleMessage(data);
|
||||
@@ -137,7 +146,7 @@ class WebSocketManager {
|
||||
const { code, reason, wasClean } = event;
|
||||
console.log('[WebSocket closed]', 'code =', code, 'reason =', reason || '(no reason)', 'wasClean =', wasClean);
|
||||
|
||||
// 如果不是当前设备的 ws,忽略
|
||||
// 不是当前设备直接忽略
|
||||
if (this.wsSerialRef !== this.currentSerialRef) {
|
||||
console.log('🟡 ignore old ws close');
|
||||
return;
|
||||
@@ -146,15 +155,13 @@ class WebSocketManager {
|
||||
this.ws = null;
|
||||
this.setStatus('disconnected');
|
||||
|
||||
// 主动关闭不重连
|
||||
if (this.isManualCloseRef || !this.currentSerialRef) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 5 秒后自动重连
|
||||
this.reconnectTimer = setTimeout(() => {
|
||||
if (this.currentSerialRef === this.wsSerialRef) {
|
||||
this.connect(this.currentSerialRef, wsUrl);
|
||||
this.connect(this.currentSerialRef!, wsUrl);
|
||||
}
|
||||
}, 5000);
|
||||
};
|
||||
@@ -164,21 +171,17 @@ class WebSocketManager {
|
||||
|
||||
public close(): void {
|
||||
this.isManualCloseRef = true;
|
||||
|
||||
if (this.reconnectTimer) {
|
||||
clearTimeout(this.reconnectTimer);
|
||||
this.reconnectTimer = null;
|
||||
}
|
||||
|
||||
if (this.ws) {
|
||||
console.log('Closing WebSocket');
|
||||
this.ws.close();
|
||||
this.ws = null;
|
||||
try {
|
||||
this.ws.close(1000, 'manual close');
|
||||
} catch (e) {
|
||||
console.warn('ws close exception', e);
|
||||
}
|
||||
}
|
||||
|
||||
this.currentSerialRef = null;
|
||||
this.wsSerialRef = null;
|
||||
this.setStatus('disconnected');
|
||||
}
|
||||
|
||||
// ==================== 消息发送 ====================
|
||||
|
||||
@@ -618,8 +618,8 @@ export default function AlarmCenterPage() {
|
||||
].map((item, idx) => (
|
||||
<Col key={idx} style={{ minWidth: '200px', flex: '1 1 auto', maxWidth: "400px" }}>
|
||||
<Card
|
||||
bordered={false}
|
||||
bodyStyle={{ padding: '16px 20px' }}
|
||||
variant="borderless"
|
||||
styles={{ body: { padding: '16px 20px' } }}
|
||||
style={{ borderRadius: 8, height: 120 }}
|
||||
>
|
||||
<Row align="middle" gutter={16} style={{ height: '100%' }}>
|
||||
@@ -658,7 +658,7 @@ export default function AlarmCenterPage() {
|
||||
</Row>
|
||||
<Row gutter={8} style={{ marginBottom: 8 }}>
|
||||
<Col span={24}>
|
||||
<Card bordered={false} bodyStyle={{ padding: '16px 24px' }} style={{ borderRadius: 8 }}>
|
||||
<Card variant="borderless" styles={{ body: { padding: '16px 24px' } }} style={{ borderRadius: 8 }}>
|
||||
<Row gutter={[8, 8]} align="middle">
|
||||
<Col>
|
||||
<div style={{ fontSize: 12, color: '#4E5969', marginBottom: 4 }}>{t('alerts.alertLevel')}</div>
|
||||
@@ -747,7 +747,7 @@ export default function AlarmCenterPage() {
|
||||
{/* 表格 */}
|
||||
<Row gutter={16} style={{ marginBottom: 8 }}>
|
||||
<Col flex="auto" style={{ minWidth: 0 }}>
|
||||
<Card bordered={false} bodyStyle={{ padding: '16px 24px' }} style={{ borderRadius: 8 }}>
|
||||
<Card variant="borderless" styles={{ body: { padding: '16px 24px' } }} style={{ borderRadius: 8 }}>
|
||||
<Spin spinning={loading}>
|
||||
<Table
|
||||
rowKey="id"
|
||||
@@ -774,7 +774,7 @@ export default function AlarmCenterPage() {
|
||||
{/* 三个图表 */}
|
||||
<Row gutter={16}>
|
||||
<Col span={8}>
|
||||
<Card bordered={false} title={t('alerts.alertTrend')} style={{ borderRadius: 8 }}>
|
||||
<Card variant="borderless" title={t('alerts.alertTrend')} style={{ borderRadius: 8 }}>
|
||||
<UniversalLineChart
|
||||
data={getAlarmTrendData()}
|
||||
xKey="date"
|
||||
@@ -807,7 +807,7 @@ export default function AlarmCenterPage() {
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Card bordered={false} title={t('alerts.alertTypeProportion')} style={{ borderRadius: 8 }}>
|
||||
<Card variant="borderless" title={t('alerts.alertTypeProportion')} style={{ borderRadius: 8 }}>
|
||||
<UniversalPieChart
|
||||
data={pieData}
|
||||
height={220}
|
||||
@@ -818,7 +818,7 @@ export default function AlarmCenterPage() {
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Card bordered={false} title={t('alerts.alertStatusStatistics')} style={{ borderRadius: 8 }}>
|
||||
<Card variant="borderless" title={t('alerts.alertStatusStatistics')} style={{ borderRadius: 8 }}>
|
||||
<UniversalBarChart
|
||||
data={[
|
||||
{
|
||||
|
||||
@@ -99,7 +99,7 @@ const AlarmStatistics = () => {
|
||||
|
||||
return (
|
||||
<div style={{ padding: 24, background: '#f5f7fa', minHeight: '100vh' }}>
|
||||
<Card title={t('alerts.alertOverview')} bordered={false} style={{ marginBottom: 24, borderRadius: 8 }}>
|
||||
<Card title={t('alerts.alertOverview')} variant="borderless" style={{ marginBottom: 24, borderRadius: 8 }}>
|
||||
<Row gutter={16} align="middle">
|
||||
<Col xs={24} sm={12} md={6}>
|
||||
<Space size={16}>
|
||||
@@ -153,13 +153,13 @@ const AlarmStatistics = () => {
|
||||
|
||||
<Row gutter={16}>
|
||||
<Col xs={24} md={12}>
|
||||
<Card bordered={false} style={{ borderRadius: 8 }}>
|
||||
<Card variant="borderless" style={{ borderRadius: 8 }}>
|
||||
<div ref={barChartRef} style={{ width: '100%', height: 360 }} />
|
||||
</Card>
|
||||
</Col>
|
||||
|
||||
<Col xs={24} md={12}>
|
||||
<Card bordered={false} style={{ borderRadius: 8 }}>
|
||||
<Card variant="borderless" style={{ borderRadius: 8 }}>
|
||||
<div ref={pieChartRef} style={{ width: '100%', height: 360 }} />
|
||||
</Card>
|
||||
</Col>
|
||||
|
||||
@@ -459,8 +459,17 @@ const RobotControlCenter = ({ setView }) => {
|
||||
}
|
||||
const getControl = (serialnum) => {
|
||||
setIsConnecting(true);
|
||||
let userParse = null;
|
||||
try {
|
||||
const dataStr = localStorage.getItem("userInfo");
|
||||
userParse = dataStr ? JSON.parse(dataStr) : null;
|
||||
} catch (e) {
|
||||
console.error("用户信息解析失败", e);
|
||||
}
|
||||
|
||||
const data = { platform: "web", deviceId: serialnum };
|
||||
const token = userParse.token || Cookies.get("Admin-Token");
|
||||
|
||||
const data = { platform: "web", deviceId: serialnum, token: token };
|
||||
getJurisdiction(data).then(res => {
|
||||
if (res?.data?.code === 200 && res?.data?.data?.remoteControl == true) {
|
||||
console.log("获取远程遥控权限成功");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useState, useEffect, useRef, useMemo } from 'react';
|
||||
import React, { useState, useEffect, useRef, useMemo, useCallback } from 'react';
|
||||
import {
|
||||
Layout, Card, Row, Col, Statistic, Tag, Button, Table,
|
||||
Typography, Space, Progress, Badge, Timeline, message,
|
||||
@@ -291,7 +291,7 @@ export default function DeviceOverviewPage() {
|
||||
}, [selectedDevice, uavState, persistentHostData, persistentDroneData?.wind_speed]);
|
||||
|
||||
// MQTT消息处理
|
||||
const handleMqttMessage = (topic, message) => {
|
||||
const handleMqttMessage = useCallback((topic, message) => {
|
||||
|
||||
|
||||
try {
|
||||
@@ -398,7 +398,7 @@ export default function DeviceOverviewPage() {
|
||||
} catch (err) {
|
||||
console.error('MQTT解析失败', err);
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
|
||||
// MQTT订阅
|
||||
const mqttTopics = useMemo(() => {
|
||||
@@ -417,6 +417,7 @@ export default function DeviceOverviewPage() {
|
||||
url: envConfig.mqtt_url,
|
||||
topic: mqttTopics,
|
||||
onMessage: handleMqttMessage,
|
||||
enabled: mqttTopics.length > 0,
|
||||
});
|
||||
|
||||
// 机器人视频
|
||||
@@ -586,8 +587,8 @@ export default function DeviceOverviewPage() {
|
||||
{dynamicTopCards.map((card, idx) => (
|
||||
<Col key={idx} style={{ minWidth: '200px', flex: '1 0 auto', maxWidth: "260px" }}>
|
||||
<Card
|
||||
bordered={false}
|
||||
bodyStyle={{ padding: '20px 20px', display: 'flex', alignItems: 'flex-start', justifyContent: 'space-between' }}
|
||||
variant="borderless"
|
||||
styles={{ body: { padding: '20px 20px', display: 'flex', alignItems: 'flex-start', justifyContent: 'space-between' } }}
|
||||
style={{ borderRadius: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.06)', height: 101 }}
|
||||
>
|
||||
{/* 左侧文字区域 */}
|
||||
@@ -627,7 +628,7 @@ export default function DeviceOverviewPage() {
|
||||
|
||||
<Row gutter={[8, 8]}>
|
||||
<Col xs={24} lg={14}>
|
||||
<Card title={<><EnvironmentOutlined />{t('devices.fixed2Equipment')}</>} extra={<Button type="text" icon={<SettingOutlined />} />} bordered={false} style={{ borderRadius: 8, marginBottom: 8 }} bodyStyle={{ padding: 0 }}>
|
||||
<Card title={<><EnvironmentOutlined />{t('devices.fixed2Equipment')}</>} extra={<Button type="text" icon={<SettingOutlined />} />} variant="borderless" style={{ borderRadius: 8, marginBottom: 8 }} styles={{ body: { padding: 0 } }}>
|
||||
<div style={{ width: '100%', height: 350, borderRadius: 8, position: 'relative', overflow: 'hidden' }}>
|
||||
<div style={{ position: 'absolute', zIndex: 9999, top: 12, left: 12, background: 'rgba(255,255,255,0.95)', borderRadius: 6, padding: 8 }}>
|
||||
<div style={{ fontSize: 11, fontWeight: 60, marginBottom: 4 }}>{t('devices.s22')}</div>
|
||||
@@ -645,7 +646,7 @@ export default function DeviceOverviewPage() {
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
<Card title={<><SettingOutlined />{t('devices.fixed2EquipmentListFixed2')}</>} bordered={false} style={{ borderRadius: 8, marginBottom: 8 }}>
|
||||
<Card title={<><SettingOutlined />{t('devices.fixed2EquipmentListFixed2')}</>} variant="borderless" style={{ borderRadius: 8, marginBottom: 8 }}>
|
||||
<Table rowKey={(record) => record.id || record.serialNumber || record.device_sn} size="small" pagination={false}
|
||||
columns={[
|
||||
{ title: t('devices.fixed2EquipmentFixed2NameFixed2'), dataIndex: 'name', width: 140 },
|
||||
@@ -720,7 +721,7 @@ export default function DeviceOverviewPage() {
|
||||
/>
|
||||
</Card>
|
||||
|
||||
<Card title={<><SettingOutlined /> <span >{t('devices.fixed2ControlFixed2LogDesc6Alert')}</span></>} bordered={false} style={{ borderRadius: 8 }} extra={<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}><Button size="small" style={{ borderRadius: 4, border: '1px solid #d9d9d9' }}>{t('devices.fixed2AllLevels')}</Button></div>}>
|
||||
<Card title={<><SettingOutlined /> <span >{t('devices.fixed2ControlFixed2LogDesc6Alert')}</span></>} variant="borderless" style={{ borderRadius: 8 }} extra={<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}><Button size="small" style={{ borderRadius: 4, border: '1px solid #d9d9d9' }}>{t('devices.fixed2AllLevels')}</Button></div>}>
|
||||
<Table rowKey="time" size="small" pagination={false} dataSource={logs} scroll={{ x: 'max-content' }}
|
||||
columns={[
|
||||
{ title: t('common.time'), dataIndex: 'time', width: 90, render: t => <span style={{ fontSize: 13 }}>{t}</span> },
|
||||
@@ -736,7 +737,7 @@ export default function DeviceOverviewPage() {
|
||||
|
||||
<Col xs={24} lg={10}>
|
||||
|
||||
<Card title={<><SettingOutlined style={{ marginRight: 6, }} />{t('devices.deviceControlPanel')}</>} bordered={false} style={{ borderRadius: 8, marginBottom: 8 }} bodyStyle={{ padding: 12, paddingBottom: 0 }}>
|
||||
<Card title={<><SettingOutlined style={{ marginRight: 6, }} />{t('devices.deviceControlPanel')}</>} variant="borderless" style={{ borderRadius: 8, marginBottom: 8 }} styles={{ body: { padding: 12, paddingBottom: 0 } }}>
|
||||
<Select
|
||||
style={{ width: "80%", marginBottom: 8 }}
|
||||
placeholder={t('workOrder.selectDeviceFixed2')}
|
||||
@@ -750,8 +751,8 @@ export default function DeviceOverviewPage() {
|
||||
String(option?.label || "").toLowerCase().includes(input.toLowerCase())
|
||||
}
|
||||
options={[
|
||||
{ label: <span>devices.robot</span>, options: devices.map(item => ({ value: item.device_sn || item.serialNumber, label: item.deviceAlias || item.deviceName || '未知设备' })) },
|
||||
{ label: <span>constants.uav</span>, options: planedevices.map(item => ({ value: item.device_sn, label: item.drone_callsign || item.callsign || '未知设备' })) },
|
||||
{ label: <span>{t('devices.robot')}</span>, options: devices.map(item => ({ value: item.device_sn || item.serialNumber, label: item.deviceAlias || item.deviceName || '未知设备' })) },
|
||||
{ label: <span>{t('constants.uav')}</span>, options: planedevices.map(item => ({ value: item.device_sn, label: item.drone_callsign || item.callsign || '未知设备' })) },
|
||||
]}
|
||||
/>
|
||||
|
||||
@@ -946,7 +947,7 @@ export default function DeviceOverviewPage() {
|
||||
)}
|
||||
</Card>
|
||||
|
||||
<Card title={<><ApiOutlined />{t('devices.fixed2AiActions')}</>} bordered={false} style={{ borderRadius: 12, marginBottom: 8 }}>
|
||||
<Card title={<><ApiOutlined />{t('devices.fixed2AiActions')}</>} variant="borderless" style={{ borderRadius: 12, marginBottom: 8 }}>
|
||||
<Row gutter={16} style={{ marginBottom: 8 }}>
|
||||
<Col span={6}><div style={{ display: 'flex', alignItems: 'center', gap: 10, padding: '6px 12px 4px', borderRadius: 12, border: '1px solid #e8e8e8' }}><div style={{ width: 30, height: 30, borderRadius: '50%', background: 'rgba(255,77,79,0.15)', display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#ff4d4f', fontSize: 20 }}><span role="img" aria-label="hotspot">🔥</span></div><div><div style={{ fontSize: 11, color: '#666' }}>{t('devices.hotspotSuspect')}</div><div style={{ fontSize: 22, fontWeight: 700, color: '#222' }}>2 <span style={{ fontSize: 12 }}>{t('devices.s32')}</span></div></div></div></Col>
|
||||
<Col span={6}><div style={{ display: 'flex', alignItems: 'center', gap: 10, padding: '6px 12px 4px', borderRadius: 12, border: '1px solid #e8e8e8' }}><div style={{ width: 30, height: 30, borderRadius: '50%', background: 'rgba(82,196,26,0.15)', display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#52c41a', fontSize: 16 }}><BranchesOutlined /></div><div><div style={{ fontSize: 11, color: '#666' }}>{t('devices.s33')}</div><div style={{ fontSize: 22, fontWeight: 700, color: '#222' }}>3 <span style={{ fontSize: 12 }}>{t('devices.s34')}</span></div></div></div></Col>
|
||||
@@ -977,7 +978,7 @@ export default function DeviceOverviewPage() {
|
||||
</Card>
|
||||
|
||||
{(selectedDevice?.productName?.includes(t('constants.uav')) || selectedDevice?.device_sn) && (
|
||||
<Card title={t('devices.s60')} bordered={false} style={{ borderRadius: 12, marginBottom: 8 }}>
|
||||
<Card title={t('devices.s60')} variant="borderless" style={{ borderRadius: 12, marginBottom: 8 }}>
|
||||
<div style={{ display: "flex", justifyContent: "space-between", gap: 12, alignItems: "center" }}>
|
||||
<div style={{ display: "flex", border: "1px solid #e8e8e8", borderRadius: 12, overflow: "hidden", flex: 1 }}>
|
||||
<div style={{ flex: 1, textAlign: 'center', whiteSpace: "nowrap", padding: "12px 4px", borderRight: "1px solid #e8e8e8" }}><div style={{ fontSize: 11, color: '#666', fontWeight: 600 }}>{t('devices.s44')}</div><div style={{ fontSize: 14, fontWeight: 700, color: '#222', marginTop: 2 }}>{fix2(realtimeDevice?.wind_speed)} m/s</div></div>
|
||||
@@ -997,7 +998,7 @@ export default function DeviceOverviewPage() {
|
||||
)}
|
||||
|
||||
{(!selectedDevice?.productName?.includes(t('constants.uav')) && !selectedDevice?.device_sn) && (
|
||||
<Card title={<div style={{ display: 'flex', alignItems: 'center', gap: 8, fontSize: 14, fontWeight: 600 }}><RobotOutlined style={{ color: '#165DFF' }} />{t('devices.fixed2RobotStatusFixed2')}</div>} bordered={false} style={{ borderRadius: 12, marginBottom: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.06)', border: '1px solid #f0f0f0' }}>
|
||||
<Card title={<div style={{ display: 'flex', alignItems: 'center', gap: 8, fontSize: 14, fontWeight: 600 }}><RobotOutlined style={{ color: '#165DFF' }} />{t('devices.fixed2RobotStatusFixed2')}</div>} variant="borderless" style={{ borderRadius: 12, marginBottom: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.06)', border: '1px solid #f0f0f0' }}>
|
||||
<Row gutter={16} style={{ alignItems: 'center' }}>
|
||||
<Col span={8}>
|
||||
<div style={{ padding: '12px 16px', borderRadius: 10, background: '#F7F8FA', textAlign: 'center', border: '1px solid transparent', transition: 'all 0.2s' }}
|
||||
@@ -1060,7 +1061,7 @@ export default function DeviceOverviewPage() {
|
||||
</Card>
|
||||
)}
|
||||
|
||||
<Card title={<><ClockCircleOutlined />{t('devices.fixed2TaskSuspended2Fixed2ExecutionTime')}</>} bordered={false} style={{ borderRadius: 12 }} extra={<div style={{ fontSize: 12, color: '#666' }}></div>}>
|
||||
<Card title={<><ClockCircleOutlined />{t('devices.fixed2TaskSuspended2Fixed2ExecutionTime')}</>} variant="borderless" style={{ borderRadius: 12 }} extra={<div style={{ fontSize: 12, color: '#666' }}></div>}>
|
||||
<Timeline mode="left">
|
||||
{taskTimeline.map((item, idx) => (
|
||||
<Timeline.Item key={idx} color={item.color} label={<div style={{ fontSize: 11, color: '#999' }}>{item.time}</div>}>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, {
|
||||
import React, {
|
||||
useState,
|
||||
useEffect,
|
||||
useMemo,
|
||||
@@ -78,6 +78,7 @@ export default function DeviceStatusPage() {
|
||||
const [arrivedPoint, setArrivedPoint] = useState(null);//完成点
|
||||
const [isLoopMode, setIsLoopMode] = useState(true);
|
||||
const controllerRef = useRef<DeviceController | null>(null);
|
||||
const isFirstConnect = useRef(true);
|
||||
const [messageApi, contextHolder] = message.useMessage();
|
||||
|
||||
|
||||
@@ -95,6 +96,7 @@ export default function DeviceStatusPage() {
|
||||
const [connecting, setConnecting] = useState(false);
|
||||
const [wsStatus, setWsStatus] = useState('disconnected');
|
||||
const [wsDeviceInfo, setWsDeviceInfo] = useState({});
|
||||
const [locationInfo, setLocationInfo] = useState({});
|
||||
|
||||
|
||||
// 👇 加上这两个
|
||||
@@ -121,7 +123,8 @@ export default function DeviceStatusPage() {
|
||||
const [isSaveModalVisible, setIsSaveModalVisible] = useState(false); // 保存模态框可见性
|
||||
const [plotName, setPlotName] = useState(''); // 地块名称
|
||||
const [isSaving, setIsSaving] = useState(false); // 是否正在保存
|
||||
const mapRef = useRef(null); // 地图 ref
|
||||
const mapRef = useRef(null);
|
||||
const clearDrawRef = useRef<(() => void) | null>(null); // 地图 ref
|
||||
|
||||
const location = useLocation();
|
||||
const queryParams = new URLSearchParams(location.search);
|
||||
@@ -244,7 +247,7 @@ export default function DeviceStatusPage() {
|
||||
};
|
||||
|
||||
// 当MQTT数据更新时,更新持久化数据(只在有新数据时更新)
|
||||
const handleMqttMessage = (topic, message) => {
|
||||
const handleMqttMessage = useCallback((topic, message) => {
|
||||
|
||||
try {
|
||||
const parsedMessage = JSON.parse(message);
|
||||
@@ -352,7 +355,7 @@ export default function DeviceStatusPage() {
|
||||
} catch (err) {
|
||||
console.error('DeviceStatusPage MQTT 消息解析失败:', err);
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
|
||||
// 根据选中设备动态构建MQTT主题
|
||||
const mqttTopics = useMemo(() => {
|
||||
@@ -374,6 +377,7 @@ export default function DeviceStatusPage() {
|
||||
url: envConfig.mqtt_url,
|
||||
topic: mqttTopics,
|
||||
onMessage: handleMqttMessage,
|
||||
enabled: mqttTopics.length > 0,
|
||||
});
|
||||
|
||||
// 合并无人机和机场数据
|
||||
@@ -388,7 +392,7 @@ export default function DeviceStatusPage() {
|
||||
|
||||
const runningStatus = useMemo(() => {
|
||||
// 判断对象是否为空
|
||||
if ((!wsDeviceInfo || Object.keys(wsDeviceInfo).length === 0) && !isUAV) {
|
||||
if ((!wsDeviceInfo || Object.keys(wsDeviceInfo).length === 0) && (!locationInfo || Object.keys(locationInfo).length === 0) && !isUAV) {
|
||||
return {};
|
||||
}
|
||||
if (isUAV) {
|
||||
@@ -403,8 +407,9 @@ export default function DeviceStatusPage() {
|
||||
: {
|
||||
...base,
|
||||
...wsDeviceInfo,
|
||||
...locationInfo
|
||||
};
|
||||
}, [device, wsDeviceInfo, isUAV]);
|
||||
}, [device, wsDeviceInfo, isUAV, locationInfo]);
|
||||
|
||||
const { video: robotVideo, error, ready } = useWebRTCPlayer(
|
||||
(!isUAV && isVideoPlaying) ? (device?.serialNumber || '') : '',
|
||||
@@ -418,6 +423,20 @@ export default function DeviceStatusPage() {
|
||||
// `webrtc://1.95.137.212/live/livestream/${device?.serialNumber}`,
|
||||
//);
|
||||
const getVal = (val) => val === "no_rain" ? t('devices.rainNo') : (val || '-');
|
||||
const fixStatusMap: Record<string, string> = {
|
||||
'no_fix': t('devices.noFix'),
|
||||
'single': t('devices.single'),
|
||||
'dgnss': t('devices.dgnss'),
|
||||
'ins': t('devices.ins'),
|
||||
'rtk_fixed': t('devices.rtkFixed'),
|
||||
'rtk_float': t('devices.rtkFloat'),
|
||||
'single_no_heading': t('devices.singleNoHeading'),
|
||||
'dgnss_no_heading': t('devices.dgnssNoHeading'),
|
||||
'rtk_fixed_no_heading': t('devices.rtkFixedNoHeading'),
|
||||
'rtk_float_no_heading': t('devices.rtkFloatNoHeading'),
|
||||
}
|
||||
|
||||
|
||||
|
||||
const realtimePosition = React.useMemo(() => {
|
||||
// 1. 无人机:优先用 MQTT 实时数据
|
||||
@@ -433,15 +452,15 @@ export default function DeviceStatusPage() {
|
||||
}
|
||||
|
||||
// 2. 机器人:从 wsDeviceInfo / runningStatus 取实时经纬度
|
||||
const robotLon = runningStatus?.longitude || wsDeviceInfo?.longitude;
|
||||
const robotLat = runningStatus?.latitude || wsDeviceInfo?.latitude;
|
||||
const robotLon = runningStatus.longitude || locationInfo.longitude;
|
||||
const robotLat = runningStatus.latitude || locationInfo.latitude;
|
||||
|
||||
if (robotLon && robotLat) {
|
||||
return {
|
||||
lon: robotLon,
|
||||
lat: robotLat,
|
||||
//heading: -98
|
||||
heading: runningStatus?.yaw || wsDeviceInfo?.yaw || 0,
|
||||
heading: runningStatus.yaw || wsDeviceInfo.yaw || 0,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -453,6 +472,7 @@ export default function DeviceStatusPage() {
|
||||
const controller = new DeviceController(userInfo, messageApi);
|
||||
|
||||
controller.onDeviceInfoUpdate = setWsDeviceInfo;
|
||||
controller.onLocationInfoUpdate = setLocationInfo;
|
||||
controller.onControlStatusChange = setIsControlled;
|
||||
controller.onHasControlRightChange = setHasControlRight;
|
||||
controller.onRequestControlStatusChange = setConnecting;
|
||||
@@ -480,13 +500,19 @@ export default function DeviceStatusPage() {
|
||||
|
||||
useEffect(() => {
|
||||
if (!device || !controllerRef.current || !device?.serialNumber || isUAV) {
|
||||
//controllerRef.current?.destroy();
|
||||
//setWsDeviceInfo({});
|
||||
return;
|
||||
}
|
||||
setWsDeviceInfo({});
|
||||
setLocationInfo({});
|
||||
|
||||
controllerRef.current.connectDevice(device);
|
||||
if (isFirstConnect.current) {
|
||||
|
||||
isFirstConnect.current = false;
|
||||
controllerRef.current.connectDevice(device);
|
||||
} else {
|
||||
|
||||
controllerRef.current.switchDevice(device);
|
||||
}
|
||||
|
||||
}, [device?.serialNumber]);
|
||||
|
||||
@@ -567,8 +593,8 @@ export default function DeviceStatusPage() {
|
||||
if (!device) return null;
|
||||
|
||||
// 优先使用持久化MQTT数据,其次使用uavState
|
||||
const lng = currentDroneData?.longitude ?? uavState?.longitude ?? runningStatus?.longitude ?? device.longitude;
|
||||
const lat = currentDroneData?.latitude ?? uavState?.latitude ?? runningStatus?.latitude ?? device.latitude;
|
||||
const lng = currentDroneData?.longitude ?? uavState?.longitude ?? runningStatus.longitude ?? device.longitude;
|
||||
const lat = currentDroneData?.latitude ?? uavState?.latitude ?? runningStatus.latitude ?? device.latitude;
|
||||
|
||||
return {
|
||||
...device,
|
||||
@@ -580,10 +606,10 @@ export default function DeviceStatusPage() {
|
||||
// 让地图取最新经纬度
|
||||
longitude: lng,
|
||||
latitude: lat,
|
||||
name: device?.deviceAlias || device?.callsign || device?.deviceName || t('devices.device'),
|
||||
name: device.deviceAlias || device.callsign || device.deviceName || t('devices.device'),
|
||||
type: isUAV
|
||||
? 'drone'
|
||||
: device?.productName?.includes(t('constants.mower'))
|
||||
: device.productName?.includes(t('constants.mower'))
|
||||
? 'mower'
|
||||
: 'robot',
|
||||
};
|
||||
@@ -648,111 +674,35 @@ export default function DeviceStatusPage() {
|
||||
messageApi.success(t('devices.pointMarked', { count: markedPoints.length + 1 }));
|
||||
};
|
||||
|
||||
// Map click to add marked point
|
||||
const handleMapMarkPoint = (point) => {
|
||||
setMarkedPoints([...markedPoints, { lon: Number(point.lon), lat: Number(point.lat) }]);
|
||||
messageApi.success(t('devices.pointMarked', { count: markedPoints.length + 1 }));
|
||||
};
|
||||
|
||||
// 清空标记点
|
||||
const handleClearPoints = () => {
|
||||
setMarkedPoints([]);
|
||||
setCompleteFlag(false);
|
||||
setSavePath(null);
|
||||
clearDrawRef.current?.();
|
||||
};
|
||||
|
||||
const getPathPoints = (coords) => {
|
||||
console.log("getPathPoints", coords)
|
||||
//setPathPoints(coords);
|
||||
if (!coords || coords.length === 0) return;
|
||||
const newWps = coords.map((p, i) => ({
|
||||
id: i + 1,
|
||||
lon: p.lon.toFixed(6),
|
||||
lat: p.lat.toFixed(6),
|
||||
}));
|
||||
console.log("newWps", newWps)
|
||||
//setWaypoints(newWps);
|
||||
};
|
||||
|
||||
|
||||
// 完成功能 - 调用路径规划接口
|
||||
const handleComplete = async () => {
|
||||
//如果时弓子模式
|
||||
if (isLoopMode) {
|
||||
if (markedPoints.length < 3) {
|
||||
messageApi.warning(t('devices.minThreePoints'));
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
// 准备路径规划请求参数
|
||||
const positionPoints = [...markedPoints];
|
||||
|
||||
|
||||
const requestParams = {
|
||||
reference: {
|
||||
lat: positionPoints[0].lat,
|
||||
lon: positionPoints[0].lon,
|
||||
},
|
||||
heading: 0,
|
||||
outer: {
|
||||
position: positionPoints.map(point => ({
|
||||
lat: point.lat,
|
||||
lon: point.lon,
|
||||
})),
|
||||
sideWidth: 0.0,
|
||||
},
|
||||
holes: [],
|
||||
workType: 0,
|
||||
};
|
||||
|
||||
const response = await fetch('https://servicepathplan.satabot.com/api/path', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(requestParams),
|
||||
});
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
if (result) {
|
||||
const path = result?.data?.path?.map(p => {
|
||||
return {
|
||||
lng: p.lon,
|
||||
lat: p.lat
|
||||
}
|
||||
})
|
||||
setPoints(path);
|
||||
setSavePath({
|
||||
path: path, // 存储返回的路径结果
|
||||
outer: requestParams?.outer?.position?.map(p => {
|
||||
return {
|
||||
lng: p.lon,
|
||||
lat: p.lat
|
||||
}
|
||||
}
|
||||
),
|
||||
planModel: 0,
|
||||
});
|
||||
setCompleteFlag(true);
|
||||
messageApi.success(t('devices.pathPlanDone'));
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('路径规划失败:', error);
|
||||
messageApi.error(t('devices.pathPlanFailRetry'));
|
||||
}
|
||||
} else {
|
||||
const positionPoints = [...markedPoints].map(item => {
|
||||
return {
|
||||
lng: item.lon,
|
||||
lat: item.lat
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
setPoints(positionPoints);
|
||||
setSavePath({
|
||||
path: positionPoints, // 存储返回的路径结果
|
||||
outer: [],
|
||||
planModel: 2,
|
||||
});
|
||||
setCompleteFlag(true);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// 打开保存模态框
|
||||
const handleOpenSaveModal = () => {
|
||||
if (!completeFlag) {
|
||||
messageApi.warning(t('devices.completePathFirst'));
|
||||
return;
|
||||
}
|
||||
setPlotName('');
|
||||
setIsSaveModalVisible(true);
|
||||
};
|
||||
|
||||
// 保存功能
|
||||
const handleSave = async () => {
|
||||
if (!plotName.trim()) {
|
||||
messageApi.warning(t('devices.inputPlotName'));
|
||||
@@ -761,6 +711,15 @@ export default function DeviceStatusPage() {
|
||||
|
||||
setIsSaving(true);
|
||||
try {
|
||||
// ✅重点:接收handleComplete返回的path数据,不再读组件savePath state
|
||||
const pathResult = await handleComplete();
|
||||
if (!pathResult) {
|
||||
messageApi.warning(t('devices.saveFail'));
|
||||
|
||||
// 路径规划失败/校验不通过直接终止
|
||||
return;
|
||||
}
|
||||
|
||||
// 1. 获取地图截图
|
||||
let screenshotDataUrl = null;
|
||||
if (mapRef.current) {
|
||||
@@ -776,18 +735,20 @@ export default function DeviceStatusPage() {
|
||||
const file = dataUrlToFile(screenshotDataUrl, "screenshot.jpg");
|
||||
console.log("blob", file)
|
||||
|
||||
|
||||
if (file instanceof File) {
|
||||
formData.append('file', file);
|
||||
}
|
||||
}
|
||||
|
||||
// 4. 添加 workRecord
|
||||
// 4. 添加 workRecord,直接使用函数返回的 pathResult,不读取state savePath
|
||||
const workRecord = {
|
||||
workName: plotName,
|
||||
siteId: stationId,
|
||||
jsonData: savePath,
|
||||
orgId: currentStation?.orgId,
|
||||
jsonData: pathResult, // 直接用返回值,彻底规避state异步延迟
|
||||
mode: isLoopMode ? "coverage" : "single_point",//"区域还是单点"
|
||||
};
|
||||
console.log("workRecord", workRecord)
|
||||
formData.append(
|
||||
"workRecord",
|
||||
new Blob([JSON.stringify(workRecord)], {
|
||||
@@ -795,8 +756,6 @@ export default function DeviceStatusPage() {
|
||||
})
|
||||
);
|
||||
|
||||
//formData.append('workRecord', JSON.stringify(workRecord));
|
||||
|
||||
// 5. 调用保存接口
|
||||
const res = await addRoute(formData);
|
||||
|
||||
@@ -818,6 +777,95 @@ export default function DeviceStatusPage() {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 修改handleComplete:计算完成后 return路径对象;失败返回null
|
||||
*/
|
||||
const handleComplete = async () => {
|
||||
//如果是闭环模式
|
||||
if (isLoopMode) {
|
||||
if (markedPoints.length < 3) {
|
||||
messageApi.warning(t('devices.minThreePoints'));
|
||||
return null; //校验失败返回null
|
||||
}
|
||||
|
||||
try {
|
||||
// 准备路径规划请求参数
|
||||
let positionPoints = [...markedPoints];
|
||||
|
||||
// =========新增:保证闭环,第一个点和最后一个点一致=========
|
||||
const firstPt = positionPoints[0];
|
||||
const lastPt = positionPoints[positionPoints.length - 1];
|
||||
// 判断经纬度是否相等,不相等就把首点追加到末尾
|
||||
if (!(firstPt.lat === lastPt.lat && firstPt.lon === lastPt.lon)) {
|
||||
positionPoints.push({ ...firstPt });
|
||||
}
|
||||
|
||||
const requestParams = {
|
||||
outer: {
|
||||
position: positionPoints.map(point => ({
|
||||
lat: point.lat,
|
||||
lng: point.lon,
|
||||
})),
|
||||
},
|
||||
};
|
||||
|
||||
const path = requestParams?.outer?.position
|
||||
setPoints(path);
|
||||
|
||||
const resultObj = {
|
||||
path: path,
|
||||
outer: requestParams?.outer?.position?.map(p => {
|
||||
return {
|
||||
lng: p.lon,
|
||||
lat: p.lat
|
||||
}
|
||||
}),
|
||||
};
|
||||
|
||||
setSavePath(resultObj);
|
||||
setCompleteFlag(true);
|
||||
messageApi.success(t('devices.pathPlanDone'));
|
||||
return resultObj; // ✅返回计算好的数据给上层调用
|
||||
} catch (error) {
|
||||
console.error('路径规划失败:', error);
|
||||
messageApi.error(t('devices.pathPlanFailRetry'));
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
// 单点模式
|
||||
const positionPoints = [...markedPoints].map(item => {
|
||||
return {
|
||||
lng: item.lon,
|
||||
lat: item.lat
|
||||
}
|
||||
});
|
||||
|
||||
setPoints(positionPoints);
|
||||
|
||||
const resultObj = {
|
||||
path: positionPoints,
|
||||
outer: [],
|
||||
};
|
||||
setSavePath(resultObj);
|
||||
setCompleteFlag(true);
|
||||
|
||||
return resultObj; // ✅返回
|
||||
}
|
||||
};
|
||||
|
||||
// 打开保存模态框
|
||||
const handleOpenSaveModal = () => {
|
||||
//if (!completeFlag) {
|
||||
// messageApi.warning(t('devices.completePathFirst'));
|
||||
// return;
|
||||
//}
|
||||
setPlotName('');
|
||||
setIsSaveModalVisible(true);
|
||||
};
|
||||
|
||||
|
||||
|
||||
const realtimeType = useMemo(() => {
|
||||
return isUAV ? 'plane' : 'car';
|
||||
}, [isUAV]);
|
||||
@@ -857,7 +905,7 @@ export default function DeviceStatusPage() {
|
||||
>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
|
||||
<Text strong>{t('devices.pathPlanning')}:</Text>
|
||||
<Text type="secondary">{t('devices.markedPointsCount', { count: markedPoints?.length })}</Text>
|
||||
<Text type="secondary">{t('devices.markedPointsCount', { count: markedPoints.length })}</Text>
|
||||
</div>
|
||||
<Space size="middle">
|
||||
<Space>
|
||||
@@ -882,18 +930,18 @@ export default function DeviceStatusPage() {
|
||||
>
|
||||
{t('devices.clearMarks')}
|
||||
</Button>
|
||||
<Button
|
||||
{/*<Button
|
||||
type="primary"
|
||||
ghost
|
||||
onClick={handleComplete}
|
||||
disabled={markedPoints?.length < 2}
|
||||
disabled={markedPoints.length < 2}
|
||||
>
|
||||
{t('devices.complete')}
|
||||
</Button>
|
||||
</Button>*/}
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={handleOpenSaveModal}
|
||||
disabled={!completeFlag}
|
||||
//disabled={!completeFlag}
|
||||
>
|
||||
{t('common.save')}
|
||||
</Button>
|
||||
@@ -920,12 +968,12 @@ export default function DeviceStatusPage() {
|
||||
optionFilterProp="label"
|
||||
placeholder={t('video.selectDevice')}
|
||||
allowClear={false}
|
||||
loading={devicesAll?.length === 0}
|
||||
loading={devicesAll.length === 0}
|
||||
options={[
|
||||
{
|
||||
label: t('devices.robot'),
|
||||
title: 'robot',
|
||||
options: devicesAll?.filter(item => !item.gateway_sn && !item.drone_callsign && item.serialNumber).map(item => ({
|
||||
options: devicesAll.filter(item => !item.gateway_sn && !item.drone_callsign && item.serialNumber).map(item => ({
|
||||
value: item.device_sn || item.serialNumber,
|
||||
label: `${item.deviceAlias || item.deviceName || t('devices.unknownDevice')} `,
|
||||
})),
|
||||
@@ -933,12 +981,12 @@ export default function DeviceStatusPage() {
|
||||
{
|
||||
label: t('constants.uav'),
|
||||
title: 'uav',
|
||||
options: devicesAll?.filter(item => item?.gateway_sn || item?.drone_callsign).map(item => ({
|
||||
value: item?.device_sn,
|
||||
label: `${item?.drone_callsign || item?.callsign || t('devices.unknownDrone')}`,
|
||||
options: devicesAll.filter(item => item.gateway_sn || item.drone_callsign).map(item => ({
|
||||
value: item.device_sn,
|
||||
label: `${item.drone_callsign || item.callsign || t('devices.unknownDrone')}`,
|
||||
})),
|
||||
},
|
||||
].filter(group => group?.options?.length > 0)}
|
||||
].filter(group => group.options.length > 0)}
|
||||
/>
|
||||
|
||||
<Tag color={isUAV ? 'cyan' : 'blue'}>
|
||||
@@ -964,9 +1012,9 @@ export default function DeviceStatusPage() {
|
||||
{t('devices.stationVideo')}
|
||||
</>
|
||||
}
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
style={{ borderRadius: 12, marginBottom: 8 }}
|
||||
bodyStyle={{ padding: 12 }}
|
||||
styles={{ body: { padding: 12 } }}
|
||||
>
|
||||
<div style={{ borderRadius: 8, overflow: 'hidden', height: 300 }}>
|
||||
<DroneVideoPlayer
|
||||
@@ -1008,13 +1056,13 @@ export default function DeviceStatusPage() {
|
||||
setClearPlanLine((v) => v + 1);
|
||||
}}
|
||||
>
|
||||
{t('devices.clearPlannedRoute')}
|
||||
{t('devices.clearPlanRoute')}
|
||||
</Button>
|
||||
</Space>
|
||||
}
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
style={{ borderRadius: 12 }}
|
||||
bodyStyle={{ padding: 12, height: 400 }}
|
||||
styles={{ body: { padding: 12, height: 400 } }}
|
||||
>
|
||||
<CesiumMap
|
||||
ref={mapRef}
|
||||
@@ -1023,11 +1071,13 @@ export default function DeviceStatusPage() {
|
||||
markedPoints={markedPoints}
|
||||
realtimePosition={realtimePosition}
|
||||
realtimeType={realtimeType}
|
||||
onPathChange={getPathPoints}
|
||||
|
||||
drawRealTime={true}
|
||||
finishPoint={arrivedPoint}
|
||||
ifClearNavLine={clearNavLine}
|
||||
ifClearPlanLine={clearPlanLine}
|
||||
from="deviceStatus"
|
||||
from="deviceStatus" onMarkPoint={handleMapMarkPoint} onClearDraw={(fn) => { clearDrawRef.current = fn; }}
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
@@ -1042,9 +1092,9 @@ export default function DeviceStatusPage() {
|
||||
{t('devices.droneVideo')}
|
||||
</>
|
||||
}
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
style={{ borderRadius: 12, marginBottom: 8 }}
|
||||
bodyStyle={{ padding: 12 }}
|
||||
styles={{ body: { padding: 12 } }}
|
||||
>
|
||||
<div style={{ borderRadius: 8, overflow: 'hidden', height: "100%" }}>
|
||||
<DroneVideoPlayer
|
||||
@@ -1071,9 +1121,9 @@ export default function DeviceStatusPage() {
|
||||
{t('devices.realtimeVideoMonitor')}
|
||||
</>
|
||||
}
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
style={{ borderRadius: 12, marginBottom: 8 }}
|
||||
bodyStyle={{ padding: 12, height: 'calc(100vh - 220px)', minHeight: 500 }}
|
||||
styles={{ body: { padding: 12, height: 'calc(100vh - 220px)', minHeight: 500 } }}
|
||||
|
||||
extra={
|
||||
<Button
|
||||
@@ -1103,46 +1153,42 @@ export default function DeviceStatusPage() {
|
||||
}}>
|
||||
<div style={{ marginBottom: 6, fontWeight: 600, color: '#1890ff' }}>{t('devices.robotStatus')}</div>
|
||||
<div style={{ display: 'flex', gap: '3px 10px', flexWrap: 'wrap' }}>
|
||||
<span>{t('devices.rtBattery')}</span>
|
||||
<span style={{ color: (runningStatus?.battery || 0) < 20 ? '#ff4d4f' : '#52c41a' }}>
|
||||
{runningStatus?.battery !== undefined ? `${runningStatus?.battery}%` : '-'}
|
||||
<span>{t('devices.rtBattery')}:</span>
|
||||
<span style={{ color: (runningStatus.battery || 0) < 20 ? '#ff4d4f' : '#52c41a' }}>
|
||||
{runningStatus.battery !== undefined ? `${runningStatus.battery}%` : '-'}
|
||||
</span>
|
||||
<span>{t('devices.rtVoltage')}</span>
|
||||
<span>{runningStatus?.voltage !== undefined ? `${Number(runningStatus?.voltage).toFixed(2)}V` : '-'}</span>
|
||||
<span>{t('devices.rtLeftMotor')}</span>
|
||||
<span>{runningStatus?.leftCurrent !== undefined ? `${Number(runningStatus?.leftCurrent).toFixed(2)}A` : '-'}</span>
|
||||
<span>{t('devices.rtRightMotor')}</span>
|
||||
<span>{runningStatus?.rightCurrent !== undefined ? `${Number(runningStatus?.rightCurrent).toFixed(2)}A` : '-'}</span>
|
||||
<span>{t('devices.rtLeftSpeed')}</span>
|
||||
<span>{runningStatus?.leftMeasureSpeed !== undefined ? `${Number(runningStatus?.leftMeasureSpeed).toFixed(1)}rpm` : '-'}</span>
|
||||
<span>{t('devices.rtRightSpeed')}</span>
|
||||
<span>{runningStatus?.rightMeasureSpeed !== undefined ? `${Number(runningStatus?.rightMeasureSpeed).toFixed(1)}rpm` : '-'}</span>
|
||||
<span>{t('devices.rtLeftTemp')}</span>
|
||||
<span>{runningStatus?.leftMotorTemp !== undefined ? `${Number(runningStatus?.leftMotorTemp).toFixed(1)}℃` : '-'}</span>
|
||||
<span>{t('devices.rtRightTemp')}</span>
|
||||
<span>{runningStatus?.rightMotorTemp !== undefined ? `${Number(runningStatus?.rightMotorTemp).toFixed(1)}℃` : '-'}</span>
|
||||
<span>{t('devices.rtMainTemp')}</span>
|
||||
<span>{runningStatus?.chipTemp !== undefined ? `${Number(runningStatus?.chipTemp).toFixed(1)}℃` : '-'}</span>
|
||||
<span>{t('devices.rtHeadingAngle')}</span>
|
||||
<span>{runningStatus?.yaw !== undefined ? `${Number(runningStatus?.yaw).toFixed(1)}°` : '-'}</span>
|
||||
<span>{t('devices.rtPitchAngle')}</span>
|
||||
<span>{runningStatus?.pitch !== undefined ? `${Number(runningStatus?.pitch).toFixed(1)}°` : '-'}</span>
|
||||
<span>{t('devices.rtHeadingStatus')}</span>
|
||||
<span>{runningStatus?.headingStatus !== undefined ? `${runningStatus?.headingStatus == 1 ? t('devices.rtInitialized') : t('devices.uninitialized')}` : '-'}</span>
|
||||
<span>{t('devices.rtPositioning')}</span>
|
||||
<span>{t('devices.rtVoltage')}:</span>
|
||||
<span>{runningStatus.voltage !== undefined ? `${Number(runningStatus.voltage).toFixed(2)}V` : '-'}</span>
|
||||
<span>{t('devices.rtLeftMotor')}:</span>
|
||||
<span>{runningStatus.leftCurrent !== undefined ? `${Number(runningStatus.leftCurrent).toFixed(2)}A` : '-'}</span>
|
||||
<span>{t('devices.rtRightMotor')}:</span>
|
||||
<span>{runningStatus.rightCurrent !== undefined ? `${Number(runningStatus.rightCurrent).toFixed(2)}A` : '-'}</span>
|
||||
<span>{t('devices.rtLeftSpeed')}:</span>
|
||||
<span>{runningStatus.leftMeasureSpeed !== undefined ? `${Number(runningStatus.leftMeasureSpeed).toFixed(1)}rpm` : '-'}</span>
|
||||
<span>{t('devices.rtRightSpeed')}:</span>
|
||||
<span>{runningStatus.rightMeasureSpeed !== undefined ? `${Number(runningStatus.rightMeasureSpeed).toFixed(1)}rpm` : '-'}</span>
|
||||
<span>{t('devices.rtLeftTemp')}:</span>
|
||||
<span>{runningStatus.leftMotorTemp !== undefined ? `${Number(runningStatus.leftMotorTemp).toFixed(1)}℃` : '-'}</span>
|
||||
<span>{t('devices.rtRightTemp')}:</span>
|
||||
<span>{runningStatus.rightMotorTemp !== undefined ? `${Number(runningStatus.rightMotorTemp).toFixed(1)}℃` : '-'}</span>
|
||||
<span>{t('devices.rtMainTemp')}:</span>
|
||||
<span>{runningStatus.chipTemp !== undefined ? `${Number(runningStatus.chipTemp).toFixed(1)}℃` : '-'}</span>
|
||||
<span>{t('devices.rtHeadingAngle')}:</span>
|
||||
<span>{runningStatus.yaw !== undefined ? `${Number(runningStatus.yaw).toFixed(1)}°` : '-'}</span>
|
||||
<span>{t('devices.rtPitchAngle')}:</span>
|
||||
<span>{runningStatus.pitch !== undefined ? `${Number(runningStatus.pitch).toFixed(1)}°` : '-'}</span>
|
||||
<span>{t('devices.rtHeadingStatus')}:</span>
|
||||
<span>{runningStatus.headingStatus !== undefined ? `${runningStatus.headingStatus == 1 ? t('devices.rtInitialized') : t('devices.uninitialized')}` : '-'}</span>
|
||||
<span>{t('devices.rtPositioning')}:</span>
|
||||
<span>
|
||||
{runningStatus?.qual == 0 ? t('constants.locationInvalid') :
|
||||
runningStatus?.qual == 1 ? t('devices.gpsSingle') :
|
||||
runningStatus?.qual == 2 ? t('devices.dgpsDiff') :
|
||||
runningStatus?.qual == 4 ? t('devices.rtkFixed2') :
|
||||
runningStatus?.qual == 5 ? t('devices.rtkFloat') : t('constants.locationUnknown')}
|
||||
{runningStatus.fix_status ? fixStatusMap[runningStatus.fix_status] : t('constants.locationUnknown')}
|
||||
</span>
|
||||
<span>{t('devices.rtSatellites')}</span>
|
||||
<span>{t('devices.satelliteCount', { count: runningStatus?.satelliteCnt || 0 })}</span>
|
||||
<span>{t('devices.rtMode')}</span>
|
||||
<span>{t('devices.rtSatellites')}:</span>
|
||||
<span>{t('devices.satelliteCount', { count: runningStatus.satelliteCnt || 0 })}</span>
|
||||
<span>{t('devices.rtMode')}:</span>
|
||||
<span>
|
||||
{runningStatus?.controlMode == 1 ? t('devices.localMode') :
|
||||
runningStatus?.controlMode == 3 ? t('devices.remoteMode') : t('constants.locationUnknown')}
|
||||
{runningStatus.controlMode == 1 ? t('devices.localMode') :
|
||||
runningStatus.controlMode == 3 ? t('devices.remoteMode') : t('constants.locationUnknown')}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1217,45 +1263,42 @@ export default function DeviceStatusPage() {
|
||||
<div style={{ marginBottom: 6, fontWeight: 600, color: '#1890ff' }}>{t('devices.robotStatus')}</div>
|
||||
<div style={{ display: 'grid', gridTemplateColumns: 'auto auto', gap: '3px 10px' }}>
|
||||
<span>{t('devices.rtBattery')}</span>
|
||||
<span style={{ color: (runningStatus?.battery || 0) < 20 ? '#ff4d4f' : '#52c41a' }}>
|
||||
{runningStatus?.battery !== undefined ? `${runningStatus?.battery}%` : '-'}
|
||||
<span style={{ color: (runningStatus.battery || 0) < 20 ? '#ff4d4f' : '#52c41a' }}>
|
||||
{runningStatus.battery !== undefined ? `${runningStatus.battery}%` : '-'}
|
||||
</span>
|
||||
<span>{t('devices.rtVoltage')}</span>
|
||||
<span>{runningStatus?.voltage !== undefined ? `${Number(runningStatus?.voltage).toFixed(2)}V` : '-'}</span>
|
||||
<span>{runningStatus.voltage !== undefined ? `${Number(runningStatus.voltage).toFixed(2)}V` : '-'}</span>
|
||||
<span>{t('devices.rtLeftMotor')}</span>
|
||||
<span>{runningStatus?.leftCurrent !== undefined ? `${Number(runningStatus?.leftCurrent).toFixed(2)}A` : '-'}</span>
|
||||
<span>{runningStatus.leftCurrent !== undefined ? `${Number(runningStatus.leftCurrent).toFixed(2)}A` : '-'}</span>
|
||||
<span>{t('devices.rtRightMotor')}</span>
|
||||
<span>{runningStatus?.rightCurrent !== undefined ? `${Number(runningStatus?.rightCurrent).toFixed(2)}A` : '-'}</span>
|
||||
<span>{runningStatus.rightCurrent !== undefined ? `${Number(runningStatus.rightCurrent).toFixed(2)}A` : '-'}</span>
|
||||
<span>{t('devices.rtLeftSpeed')}</span>
|
||||
<span>{runningStatus?.leftMeasureSpeed !== undefined ? `${Number(runningStatus?.leftMeasureSpeed).toFixed(1)}rpm` : '-'}</span>
|
||||
<span>{runningStatus.leftMeasureSpeed !== undefined ? `${Number(runningStatus.leftMeasureSpeed).toFixed(1)}rpm` : '-'}</span>
|
||||
<span>{t('devices.rtRightSpeed')}</span>
|
||||
<span>{runningStatus?.rightMeasureSpeed !== undefined ? `${Number(runningStatus?.rightMeasureSpeed).toFixed(1)}rpm` : '-'}</span>
|
||||
<span>{runningStatus.rightMeasureSpeed !== undefined ? `${Number(runningStatus.rightMeasureSpeed).toFixed(1)}rpm` : '-'}</span>
|
||||
<span>{t('devices.rtLeftTemp')}</span>
|
||||
<span>{runningStatus?.leftMotorTemp !== undefined ? `${Number(runningStatus?.leftMotorTemp).toFixed(1)}℃` : '-'}</span>
|
||||
<span>{runningStatus.leftMotorTemp !== undefined ? `${Number(runningStatus.leftMotorTemp).toFixed(1)}℃` : '-'}</span>
|
||||
<span>{t('devices.rtRightTemp')}</span>
|
||||
<span>{runningStatus?.rightMotorTemp !== undefined ? `${Number(runningStatus?.rightMotorTemp).toFixed(1)}℃` : '-'}</span>
|
||||
<span>{runningStatus.rightMotorTemp !== undefined ? `${Number(runningStatus.rightMotorTemp).toFixed(1)}℃` : '-'}</span>
|
||||
<span>{t('devices.rtMainTemp')}</span>
|
||||
<span>{runningStatus?.chipTemp !== undefined ? `${Number(runningStatus?.chipTemp).toFixed(1)}℃` : '-'}</span>
|
||||
<span>{runningStatus.chipTemp !== undefined ? `${Number(runningStatus.chipTemp).toFixed(1)}℃` : '-'}</span>
|
||||
<span>{t('devices.rtHeadingAngle')}</span>
|
||||
<span>{runningStatus?.yaw !== undefined ? `${Number(runningStatus?.yaw).toFixed(1)}°` : '-'}</span>
|
||||
<span>{runningStatus.yaw !== undefined ? `${Number(runningStatus.yaw).toFixed(1)}°` : '-'}</span>
|
||||
<span>{t('devices.rtPitchAngle')}</span>
|
||||
<span>{runningStatus?.pitch !== undefined ? `${Number(runningStatus?.pitch).toFixed(1)}°` : '-'}</span>
|
||||
<span>{runningStatus.pitch !== undefined ? `${Number(runningStatus.pitch).toFixed(1)}°` : '-'}</span>
|
||||
<span>{t('devices.rtHeadingStatus')}</span>
|
||||
<span>{runningStatus?.headingStatus !== undefined ? `${runningStatus?.headingStatus == 1 ? t('devices.rtInitialized') : t('devices.uninitialized')}` : '-'}</span>
|
||||
<span>{runningStatus.headingStatus !== undefined ? `${runningStatus.headingStatus == 1 ? t('devices.rtInitialized') : t('devices.uninitialized')}` : '-'}</span>
|
||||
<span>{t('devices.rtPositioning')}</span>
|
||||
<span>
|
||||
{runningStatus?.qual == 0 ? t('constants.locationInvalid') :
|
||||
runningStatus?.qual == 1 ? t('devices.gpsSingle') :
|
||||
runningStatus?.qual == 2 ? t('devices.dgpsDiff') :
|
||||
runningStatus?.qual == 4 ? t('devices.rtkFixed2') :
|
||||
runningStatus?.qual == 5 ? t('devices.rtkFloat') : t('constants.locationUnknown')}
|
||||
{runningStatus.fix_status ? fixStatusMap[runningStatus.fix_status] : t('constants.locationUnknown')}
|
||||
|
||||
</span>
|
||||
<span>{t('devices.rtSatellites')}</span>
|
||||
<span>{t('devices.satelliteCount', { count: runningStatus?.satelliteCnt || 0 })}</span>
|
||||
<span>{t('devices.satelliteCount', { count: runningStatus.satelliteCnt || 0 })}</span>
|
||||
<span>{t('devices.rtMode')}</span>
|
||||
<span>
|
||||
{runningStatus?.controlMode == 1 ? t('devices.localMode') :
|
||||
runningStatus?.controlMode == 3 ? t('devices.remoteMode') : t('constants.locationUnknown')}
|
||||
{runningStatus.controlMode == 1 ? t('devices.localMode') :
|
||||
runningStatus.controlMode == 3 ? t('devices.remoteMode') : t('constants.locationUnknown')}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1294,13 +1337,13 @@ export default function DeviceStatusPage() {
|
||||
setClearPlanLine((v) => v + 1);
|
||||
}}
|
||||
>
|
||||
{t('devices.clearPlannedRoute')}
|
||||
{t('devices.clearPlanRoute')}
|
||||
</Button>
|
||||
</Space>
|
||||
}
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
style={{ borderRadius: 12, marginBottom: 8, flex: 1, minHeight: 280 }}
|
||||
bodyStyle={{ padding: 12, height: 'calc((100vh - 260px) / 2)', minHeight: 280 }}
|
||||
styles={{ body: { padding: 12, height: 'calc((100vh - 260px) / 2)', minHeight: 280 } }}
|
||||
>
|
||||
<CesiumMap
|
||||
ref={mapRef}
|
||||
@@ -1313,7 +1356,7 @@ export default function DeviceStatusPage() {
|
||||
finishPoint={arrivedPoint}
|
||||
ifClearNavLine={clearNavLine}
|
||||
ifClearPlanLine={clearPlanLine}
|
||||
from="deviceStatus"
|
||||
from="deviceStatus" onMarkPoint={handleMapMarkPoint} onClearDraw={(fn) => { clearDrawRef.current = fn; }}
|
||||
/>
|
||||
</Card>
|
||||
|
||||
@@ -1325,10 +1368,12 @@ export default function DeviceStatusPage() {
|
||||
{t('devices.remoteControl')}
|
||||
</>
|
||||
}
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
style={{ borderRadius: 12, background: '#0f172a', flex: 1, minHeight: 280, }}
|
||||
headStyle={{ color: '#fff' }}
|
||||
bodyStyle={{ display: 'flex', justifyContent: 'center', alignItems: 'center', height: 'calc(100% - 57px)' }}
|
||||
styles={{
|
||||
header: { color: '#fff', },
|
||||
body: { display: 'flex', justifyContent: 'center', alignItems: 'center', height: 'calc(100% - 57px)' },
|
||||
}}
|
||||
>
|
||||
<XboxController
|
||||
onGamepadUpdate={handleGamepadUpdate}
|
||||
@@ -1346,11 +1391,11 @@ export default function DeviceStatusPage() {
|
||||
open={isModalOpen}
|
||||
onOk={handleOk}
|
||||
onCancel={handleCancel}
|
||||
title={modalContent?.title}
|
||||
title={modalContent.title}
|
||||
okText={t('common.ok')}
|
||||
cancelText={t('common.cancel')}
|
||||
>
|
||||
<p>{modalContent?.content}</p>
|
||||
<p>{modalContent.content}</p>
|
||||
</Modal>
|
||||
|
||||
{/* 保存路径模态框 */}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import React, { useState, useEffect, useRef, useMemo } from 'react';
|
||||
import React, { useState, useEffect, useRef, useMemo } from 'react';
|
||||
import {
|
||||
Row, Col, Card, Button, Space, Table, Tag, Typography, Progress, Badge,
|
||||
Tabs, Input, Switch, Divider, Tooltip, Timeline, Select, message, DatePicker,
|
||||
Modal, InputNumber,
|
||||
TimePicker,
|
||||
Popconfirm,
|
||||
App
|
||||
App,
|
||||
Radio
|
||||
} from 'antd';
|
||||
import {
|
||||
PlusOutlined, ImportOutlined, NodeIndexOutlined,
|
||||
@@ -35,6 +36,7 @@ import {
|
||||
getSiteDeviceTaskHistory,
|
||||
getRouteByTask,
|
||||
deleteRoute,
|
||||
getTaskPath,
|
||||
} from '../../api/device';
|
||||
import dayjs from 'dayjs';
|
||||
import DraggableBox from '../Draggable';
|
||||
@@ -64,6 +66,8 @@ export default function RobotTaskPage() {
|
||||
const [taskList, setTaskList] = useState([]);
|
||||
const [arrivedPoint, setArrivedPoint] = useState(null);//完成点
|
||||
const { modal } = App.useApp();
|
||||
const [polyPoints, setPolyPoints] = useState([]);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -75,6 +79,7 @@ export default function RobotTaskPage() {
|
||||
|
||||
const [focusLocation, setFocusLocation] = useState(null);
|
||||
const [points, setPoints] = useState([]);
|
||||
const [routeMode, setRouteMode] = useState('');
|
||||
const [clearNavLine, setClearNavLine] = useState(0);
|
||||
const [clearPlanLine, setClearPlanLine] = useState(0);
|
||||
|
||||
@@ -116,6 +121,8 @@ export default function RobotTaskPage() {
|
||||
robot: null,
|
||||
dateRange: null,
|
||||
});
|
||||
// 取消任务模式 normal普通取消 force强制取消
|
||||
const [cancelMode, setCancelMode] = useState<'normal' | 'force'>('normal');
|
||||
|
||||
|
||||
|
||||
@@ -137,13 +144,26 @@ export default function RobotTaskPage() {
|
||||
});
|
||||
const [messageApi, contextHolder] = message.useMessage();
|
||||
const controllerRef = useRef<DeviceController | null>(null);
|
||||
const isFirstConnect = useRef(true);
|
||||
const fixStatusMap: Record<string, string> = {
|
||||
'no_fix': t('devices.noFix'),
|
||||
'single': t('devices.single'),
|
||||
'dgnss': t('devices.dgnss'),
|
||||
'ins': t('devices.ins'),
|
||||
'rtk_fixed': t('devices.rtkFixed'),
|
||||
'rtk_float': t('devices.rtkFloat'),
|
||||
'single_no_heading': t('devices.singleNoHeading'),
|
||||
'dgnss_no_heading': t('devices.dgnssNoHeading'),
|
||||
'rtk_fixed_no_heading': t('devices.rtkFixedNoHeading'),
|
||||
'rtk_float_no_heading': t('devices.rtkFloatNoHeading'),
|
||||
}
|
||||
|
||||
|
||||
const handleFinish = (data) => {
|
||||
setExecute(false);
|
||||
setShowVideo(false); // 任务完成关闭视频
|
||||
utils.message.success(t('devices.fixed2TaskSuspended2Fixed2CompletedFixed2'));
|
||||
//if (controllerRef.current) {
|
||||
// controllerRef.current.destroy?.();
|
||||
//}
|
||||
|
||||
setClearNavLine(clearNavLine + 1);
|
||||
setSelectedRobotForExecute(null);
|
||||
setSelectedRouteForExecute(null);
|
||||
@@ -152,6 +172,7 @@ export default function RobotTaskPage() {
|
||||
fetchTaskPoolList();
|
||||
|
||||
|
||||
|
||||
}
|
||||
const handleFinishEdPoint = (point) => {
|
||||
setArrivedPoint(point);
|
||||
@@ -171,7 +192,8 @@ export default function RobotTaskPage() {
|
||||
} catch (err) {
|
||||
console.error('解析任务路径数据失败:', err);
|
||||
}
|
||||
setPoints(pathPoints);
|
||||
setRouteMode('coverage')
|
||||
setPolyPoints(pathPoints);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('获取任务路径失败:', err);
|
||||
@@ -236,7 +258,7 @@ export default function RobotTaskPage() {
|
||||
setExecute(true);
|
||||
setExecutingRobot(targetDevice);
|
||||
setClearNavLine(v => v + 1); // 清空地图轨迹
|
||||
controllerRef.current?.connectDevice(targetDevice);
|
||||
if (isFirstConnect.current) { isFirstConnect.current = false; controllerRef.current?.connectDevice(targetDevice); } else { controllerRef.current?.switchDevice(targetDevice); }
|
||||
setShowVideo(true);
|
||||
};
|
||||
|
||||
@@ -244,9 +266,12 @@ export default function RobotTaskPage() {
|
||||
useEffect(() => {
|
||||
const controller = new DeviceController(userInfo, messageApi);
|
||||
|
||||
controller.onDeviceInfoUpdate = setRobotRealtimePosition;
|
||||
controller.onLocationInfoUpdate = setRobotRealtimePosition;
|
||||
controller.onIsFinished = handleFinish;
|
||||
controller.handleArrivedPoint = handleFinishEdPoint;
|
||||
controller.onRoutePost = setPoints;
|
||||
|
||||
|
||||
|
||||
controller.init();
|
||||
|
||||
@@ -279,6 +304,7 @@ export default function RobotTaskPage() {
|
||||
const runningTask = taskPoolList.find(item => ['EXECUTING', 'PAUSE'].includes(item.taskStaus));
|
||||
|
||||
if (!runningTask) return;
|
||||
fetchRouteDetail(runningTask?.id);
|
||||
|
||||
// 找到对应的设备
|
||||
const targetDevice = devices.find(d => d.serialNumber === runningTask.deviceId);
|
||||
@@ -296,7 +322,7 @@ export default function RobotTaskPage() {
|
||||
setExecute(true);
|
||||
setExecutingRobot(targetDevice);
|
||||
setClearNavLine(v => v + 1); // 清空地图轨迹
|
||||
controllerRef.current?.connectDevice(targetDevice);
|
||||
if (isFirstConnect.current) { isFirstConnect.current = false; controllerRef.current?.connectDevice(targetDevice); } else { controllerRef.current?.switchDevice(targetDevice); }
|
||||
setShowVideo(true);
|
||||
|
||||
}, [devices, taskPoolList, executingRobot, runningPoolTask]);
|
||||
@@ -386,57 +412,14 @@ export default function RobotTaskPage() {
|
||||
}
|
||||
};
|
||||
useEffect(() => {
|
||||
if (!selectedPathWork?.id) {
|
||||
//console.log('获取任务列表', selectedPathWork?.id);
|
||||
if (!selectedRobotForExecute?.id || !execute) {
|
||||
setPoints([]);
|
||||
return;
|
||||
}
|
||||
|
||||
// 调用接口获取路线详情
|
||||
const fetchRouteDetail = async () => {
|
||||
try {
|
||||
const res = await getSingleRouteList({ id: selectedPathWork.id });
|
||||
if (res?.code === 200 && res?.data) {
|
||||
let pathPoints = [];
|
||||
let outerPoints = [];
|
||||
let method = '';//0弓子 2 回子
|
||||
try {
|
||||
// 尝试解析 JSON
|
||||
if (res.data.jsonData) {
|
||||
const data = typeof res.data.jsonData === 'string'
|
||||
? JSON.parse(res.data.jsonData)
|
||||
: res.data.jsonData;
|
||||
pathPoints = data?.path || [];
|
||||
outerPoints = data?.outer || [];
|
||||
method = data?.planModel;
|
||||
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('解析路线数据失败:', err);
|
||||
}
|
||||
|
||||
if (pathPoints.length === 0) {
|
||||
utils.message.warning(t('devices.route2'));
|
||||
}
|
||||
//if (outerPoints.length === 0 && method == 2) {
|
||||
// utils.message.warning(t('devices.route2'));
|
||||
//}
|
||||
//if (method == 0) {
|
||||
setPoints(pathPoints);
|
||||
//} else {
|
||||
// setPoints(outerPoints);
|
||||
|
||||
//}
|
||||
} else {
|
||||
setPoints([]);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('获取路线详情失败:', err);
|
||||
setPoints([]);
|
||||
}
|
||||
};
|
||||
|
||||
fetchRouteDetail();
|
||||
}, [selectedPathWork]);
|
||||
}, [selectedRobotForExecute?.id]);
|
||||
|
||||
// 监听任务池列表变化,自动加载第一个任务的路径
|
||||
useEffect(() => {
|
||||
@@ -445,6 +428,79 @@ export default function RobotTaskPage() {
|
||||
|
||||
}
|
||||
}, [taskPoolList]);
|
||||
const getRouteOut = async () => {
|
||||
try {
|
||||
|
||||
const res = await getSingleRouteList({ id: selectedPathWork?.id });
|
||||
// coverage(区域覆盖)绘制为多边形,其余为折线/单点
|
||||
const mode = res?.data?.mode;
|
||||
setRouteMode(mode);
|
||||
|
||||
if (res?.code === 200 && res?.data?.jsonData) {
|
||||
let pathPoints = [];
|
||||
|
||||
try {
|
||||
// 尝试解析 JSON
|
||||
pathPoints = res?.data?.jsonData?.path || [];
|
||||
} catch (err) {
|
||||
console.error('解析路线数据失败:', err);
|
||||
}
|
||||
|
||||
if (pathPoints.length === 0) {
|
||||
utils.message.warning(t('devices.route2'));
|
||||
}
|
||||
|
||||
setPolyPoints(pathPoints);
|
||||
|
||||
} else {
|
||||
setPolyPoints([]);
|
||||
setRouteMode('');
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('获取路线详情失败:', err);
|
||||
setPolyPoints([]);
|
||||
setRouteMode('');
|
||||
}
|
||||
}
|
||||
useEffect(() => {
|
||||
getRouteOut();
|
||||
}, [selectedPathWork?.id])
|
||||
// 调用接口获取路线详情
|
||||
const fetchRouteDetail = async (id) => {
|
||||
console.log(id, "获取正在执行任务的id")
|
||||
try {
|
||||
const params = {
|
||||
taskId: id,
|
||||
}
|
||||
|
||||
const res = await getTaskPath(params)
|
||||
//const res = await getSingleRouteList({ id: selectedPathWork.id });
|
||||
|
||||
if (res?.code === 200 && res?.data) {
|
||||
let pathPoints = [];
|
||||
|
||||
try {
|
||||
// 尝试解析 JSON
|
||||
pathPoints = res.data || [];
|
||||
} catch (err) {
|
||||
console.error('解析路线数据失败:', err);
|
||||
}
|
||||
|
||||
if (pathPoints.length === 0) {
|
||||
utils.message.warning(t('devices.route2'));
|
||||
}
|
||||
|
||||
setPoints(pathPoints);
|
||||
|
||||
} else {
|
||||
setPoints([]);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('获取路线详情失败:', err);
|
||||
setPoints([]);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -460,7 +516,7 @@ export default function RobotTaskPage() {
|
||||
setExecute(true);
|
||||
setExecutingRobot(targetDevice);
|
||||
setClearNavLine(v => v + 1); // 清空地图轨迹
|
||||
controllerRef.current?.connectDevice(targetDevice);
|
||||
if (isFirstConnect.current) { isFirstConnect.current = false; controllerRef.current?.connectDevice(targetDevice); } else { controllerRef.current?.switchDevice(targetDevice); }
|
||||
setShowVideo(true);
|
||||
}
|
||||
}
|
||||
@@ -513,7 +569,7 @@ export default function RobotTaskPage() {
|
||||
setSelectedRobotForExecute(null);
|
||||
|
||||
// 调用接口检查是否有路径点
|
||||
const res = await getSingleRouteList({ id: route.id });
|
||||
const res = await getSingleRouteList({ id: route?.id });
|
||||
let hasPathPoints = false;
|
||||
|
||||
if (res?.code === 200 && res?.data) {
|
||||
@@ -566,7 +622,7 @@ export default function RobotTaskPage() {
|
||||
fetchTaskList();
|
||||
fetchTaskPoolList();
|
||||
fetchTaskHistoryList();
|
||||
controllerRef.current?.connectDevice(selectedRobotForExecute);
|
||||
if (isFirstConnect.current) { isFirstConnect.current = false; controllerRef.current?.connectDevice(selectedRobotForExecute); } else { controllerRef.current?.switchDevice(selectedRobotForExecute); }
|
||||
setShowVideo(true); // 连接成功后自动打开视频
|
||||
|
||||
} else {
|
||||
@@ -653,13 +709,14 @@ export default function RobotTaskPage() {
|
||||
};
|
||||
|
||||
// 取消任务
|
||||
const handleCancelTask = async (task) => {
|
||||
const handleCancelTask = async (task, mode) => {
|
||||
try {
|
||||
const params = {
|
||||
taskId: task.id,
|
||||
//deviceId: task.deviceId,
|
||||
siteId: stationId,
|
||||
orgId: task.orgId,
|
||||
forceCancel: mode === 'force' ? true : false,
|
||||
};
|
||||
const res = await cancelRoute(params);
|
||||
if (res.code === 200 && res.data == true) {
|
||||
@@ -673,6 +730,8 @@ export default function RobotTaskPage() {
|
||||
setSelectedRobotForExecute(null);
|
||||
setSelectedRouteForExecute(null);
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
utils.message.error(t('devices.taskCancelFail'));
|
||||
}
|
||||
@@ -832,15 +891,17 @@ export default function RobotTaskPage() {
|
||||
dataIndex: 'taskStaus',
|
||||
width: 100,
|
||||
render: (status, record) => {
|
||||
console.log('status', status, record);
|
||||
const statusMap = {
|
||||
'NEW': { color: 'default', text: t('devices.statusNew') },
|
||||
'EXECUTING': { color: 'processing', text: t('workOrder.inProgress') },
|
||||
'PAUSE': { color: 'warning', text: t('devices.statusPaused') },
|
||||
'FINISH': { color: 'success', text: t('devices.statusFinished') },
|
||||
'FAILED': { color: 'error', text: t('devices.statusFailed') }
|
||||
'FAILED': { color: 'error', text: t('devices.statusFailed') },
|
||||
"CANCELING": { color: 'warning', text: t('devices.statusCanceling') },
|
||||
};
|
||||
const item = statusMap[status] || { color: 'default', text: record.taskStausTranslate || t('constants.locationUnknown') };
|
||||
return <Tag color={item.color}>{item.text}</Tag>;
|
||||
return <Tag color={item.color}>{record.taskStausTranslate}</Tag>;
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -889,7 +950,8 @@ export default function RobotTaskPage() {
|
||||
'EXECUTING': { color: 'processing', text: t('workOrder.inProgress') },
|
||||
'PAUSE': { color: 'warning', text: t('devices.statusPaused') },
|
||||
'FINISH': { color: 'success', text: t('devices.statusFinished') },
|
||||
'FAILED': { color: 'error', text: t('devices.statusFailed') }
|
||||
'FAILED': { color: 'error', text: t('devices.statusFailed') },
|
||||
"CANCELING": { color: 'warning', text: t('devices.statusCanceling') },
|
||||
};
|
||||
const item = statusMap[status] || { color: 'default', text: t('constants.locationUnknown') };
|
||||
return <Tag color={item.color}>{item.text}</Tag>;
|
||||
@@ -909,27 +971,46 @@ export default function RobotTaskPage() {
|
||||
|
||||
<>
|
||||
{/*{record.taskStaus === 'NEW' && (*/}
|
||||
<Popconfirm
|
||||
title={t('devices.confirmCancelTask')}
|
||||
onConfirm={() => handleCancelTask(record)}
|
||||
okText={t('common.ok')} cancelText={t('common.cancel')}
|
||||
>
|
||||
<Button type="text" size="small" danger icon={<CloseOutlined />} onClick={(e) => e.stopPropagation()}>
|
||||
{t('common.cancel')}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
<Popconfirm
|
||||
title={t('devices.confirmCancelTask')}
|
||||
description={
|
||||
<Radio.Group
|
||||
value={cancelMode}
|
||||
onChange={(e) => setCancelMode(e.target.value)}
|
||||
style={{ marginTop: 8 }}
|
||||
>
|
||||
<Space direction="vertical">
|
||||
<Radio value="normal">{t('devices.normalCancel')}</Radio>
|
||||
<Radio value="force">{t('devices.forceCancel')}</Radio>
|
||||
</Space>
|
||||
</Radio.Group>
|
||||
}
|
||||
onConfirm={() => handleCancelTask(record, cancelMode)}
|
||||
okText={t('common.ok')}
|
||||
cancelText={t('common.cancel')}
|
||||
>
|
||||
<Button
|
||||
type="text"
|
||||
size="small"
|
||||
danger
|
||||
icon={<CloseOutlined />}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
>
|
||||
{t('common.cancel')}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
{/*//)}*/}
|
||||
|
||||
{/*{record.taskStaus === 'EXECUTING' && (*/}
|
||||
<Popconfirm
|
||||
title={t('devices.confirmPauseTask')}
|
||||
onConfirm={() => handlePauseTask(record)}
|
||||
okText={t('common.ok')} cancelText={t('common.cancel')}
|
||||
>
|
||||
<Button type="text" size="small" style={{ color: '#FF9500' }} onClick={(e) => e.stopPropagation()}>
|
||||
{t('video.pause')}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
<Popconfirm
|
||||
title={t('devices.confirmPauseTask')}
|
||||
onConfirm={() => handlePauseTask(record)}
|
||||
okText={t('common.ok')} cancelText={t('common.cancel')}
|
||||
>
|
||||
<Button type="text" size="small" style={{ color: '#FF9500' }} onClick={(e) => e.stopPropagation()}>
|
||||
{t('video.pause')}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
{/*)}/*/}
|
||||
|
||||
{record.taskStaus === 'PAUSE' && (
|
||||
@@ -1043,12 +1124,14 @@ export default function RobotTaskPage() {
|
||||
{topCards.map((item, index) => (
|
||||
<Col xs={12} sm={8} md={4} key={index}>
|
||||
<Card
|
||||
bordered={false}
|
||||
bodyStyle={{
|
||||
padding: '12px 14px',
|
||||
height: '100%',
|
||||
display: 'flex',
|
||||
alignItems: 'center'
|
||||
variant="borderless"
|
||||
styles={{
|
||||
body: {
|
||||
padding: '12px 14px',
|
||||
height: '100%',
|
||||
display: 'flex',
|
||||
alignItems: 'center'
|
||||
}
|
||||
}}
|
||||
style={{
|
||||
...cardStyle,
|
||||
@@ -1136,7 +1219,7 @@ export default function RobotTaskPage() {
|
||||
extra={
|
||||
<Space size={4} wrap> {/* Space开启自动换行,小屏按钮自动折行 */}
|
||||
<Button size="small" icon={<DeleteOutlined />} type="primary" style={{ borderRadius: 4 }} onClick={() => setClearNavLine(v => v + 1)}>{t('devices.clearRealtimeTrack')}</Button>
|
||||
<Button size="small" icon={<DeleteOutlined />} danger style={{ borderRadius: 4 }} onClick={() => { setPoints([]); setClearPlanLine(v => v + 1); }}>{t('devices.clearPlanRoute')}</Button>
|
||||
<Button size="small" icon={<DeleteOutlined />} danger style={{ borderRadius: 4 }} onClick={() => { setPoints([]); setRouteMode(""); setClearPlanLine(v => v + 1); }}>{t('devices.clearPlanRoute')}</Button>
|
||||
{/*<Button size="small" icon={<PlusOutlined />} style={{ borderRadius: 4 }}>{t('common.addNew')}</Button>
|
||||
<Button size="small" icon={<ImportOutlined />} style={{ borderRadius: 4 }}>{t('common.import')}</Button>
|
||||
<Button size="small" icon={<NodeIndexOutlined />} style={{ borderRadius: 4 }}>{t('devices.optimize')}</Button>
|
||||
@@ -1144,8 +1227,8 @@ export default function RobotTaskPage() {
|
||||
{/*<Button size="small" icon={<Maximize2 size={12} />} />*/}
|
||||
</Space>
|
||||
}
|
||||
bordered={false}
|
||||
bodyStyle={{ padding: 0, position: 'relative' }}
|
||||
variant="borderless"
|
||||
styles={{ body: { padding: 0, position: 'relative' } }}
|
||||
style={{ ...cardStyle, marginBottom: 10 }}
|
||||
>
|
||||
<div style={{ width: '100%', height: 420, background: '#e8f3ff center/cover', position: 'relative' }}>
|
||||
@@ -1154,12 +1237,14 @@ export default function RobotTaskPage() {
|
||||
points={points}
|
||||
focusLocation={focusLocation}
|
||||
realtimePosition={realtimePosition}
|
||||
polyPoints={polyPoints}
|
||||
realtimeType="robot"
|
||||
from="device-control"
|
||||
from="deviceStatus"
|
||||
drawRealTime={execute}
|
||||
finishPoint={arrivedPoint}
|
||||
ifClearNavLine={clearNavLine}
|
||||
ifClearPlanLine={clearPlanLine}
|
||||
routeMode={routeMode}
|
||||
/>
|
||||
|
||||
{/* 机器人状态悬浮面板 - 绝对定位左上角 */}
|
||||
@@ -1197,6 +1282,19 @@ export default function RobotTaskPage() {
|
||||
<span style={{ color: '#9eff9e' }}>{t('devices.remoteMode')}</span>
|
||||
)}
|
||||
</span>
|
||||
{/* const fixStatusMap: Record<string, string> = {
|
||||
'no_fix': t('devices.noFix'),
|
||||
'single': t('devices.single'),
|
||||
'dgnss': t('devices.dgnss'),
|
||||
'ins': t('devices.ins'),
|
||||
'rtk_fixed': t('devices.rtkFixed'),
|
||||
'rtk_float': t('devices.rtkFloat'),
|
||||
'single_no_heading': t('devices.singleNoHeading'),
|
||||
'dgnss_no_heading': t('devices.dgnssNoHeading'),
|
||||
'rtk_fixed_no_heading': t('devices.rtkFixedNoHeading'),
|
||||
'rtk_float_no_heading': t('devices.rtkFloatNoHeading'),
|
||||
}
|
||||
*/}
|
||||
|
||||
<span>
|
||||
{t('devices.heading')}
|
||||
@@ -1209,11 +1307,7 @@ export default function RobotTaskPage() {
|
||||
|
||||
<span>
|
||||
{t('devices.location')}
|
||||
{(() => {
|
||||
const qual = robotRealtimePosition?.qual;
|
||||
const info = getLocationQuality(qual);
|
||||
return <span style={{ color: info.color }}>{info.text}</span>;
|
||||
})()}
|
||||
{robotRealtimePosition?.fix_status ? fixStatusMap[robotRealtimePosition?.fix_status] : t('constants.locationUnknown')}
|
||||
</span>
|
||||
|
||||
{/* 视频开关 */}
|
||||
@@ -1236,8 +1330,8 @@ export default function RobotTaskPage() {
|
||||
{/* 机器人任务模块,带Tab切换 */}
|
||||
<Card
|
||||
size="small"
|
||||
bordered={false}
|
||||
bodyStyle={{ padding: 0, display: 'flex', flexDirection: 'column', height: "calc(100%)", overflow: "auto" }}
|
||||
variant="borderless"
|
||||
styles={{ body: { padding: 0, display: 'flex', flexDirection: 'column', height: "calc(100%)", overflow: "auto" } }}
|
||||
style={{ ...cardStyle, maxHeight: "300px", flex: 1, marginBottom: 0 }}
|
||||
|
||||
>
|
||||
@@ -1468,31 +1562,52 @@ export default function RobotTaskPage() {
|
||||
<Col xs={24} xl={10} style={{ display: "flex", flexDirection: "column" }} >
|
||||
<Card
|
||||
title={<span style={{ fontSize: fontTitle, fontWeight: 700 }}>{t('devices.operationSuggestion')}</span>}
|
||||
bordered={false}
|
||||
bodyStyle={{ padding: '12px 16px' }}
|
||||
variant="borderless"
|
||||
styles={{ body: { padding: '12px 16px' } }}
|
||||
style={{ ...cardStyle, marginBottom: 8 }}
|
||||
>
|
||||
<Timeline mode="left">
|
||||
<Timeline.Item label="09:30" color="green">
|
||||
<Text strong>{t('devices.timelineMow', { robot: 'RBT-01' })}</Text>
|
||||
<div style={{ fontSize: 12, color: '#86909C' }}>{t('devices.timelineMowDetail')}</div>
|
||||
</Timeline.Item>
|
||||
<Timeline.Item label="11:00" color="blue">
|
||||
<Text strong>{t('devices.timelineInspect', { robot: 'RBT-02' })}</Text>
|
||||
<div style={{ fontSize: 12, color: '#86909C' }}>{t('devices.timelineInspectDetail')}</div>
|
||||
</Timeline.Item>
|
||||
<Timeline.Item label="14:00" color="gray">
|
||||
<Text strong>{t('devices.timelineMaintenance')}</Text>
|
||||
<div style={{ fontSize: 12, color: '#86909C' }}>{t('devices.timelineMaintenanceDetail')}</div>
|
||||
</Timeline.Item>
|
||||
</Timeline>
|
||||
<Timeline
|
||||
mode="left"
|
||||
items={[
|
||||
{
|
||||
color: 'green',
|
||||
label: '09:30',
|
||||
children: (
|
||||
<>
|
||||
<Text strong>{t('devices.timelineMow', { robot: 'RBT-01' })}</Text>
|
||||
<div style={{ fontSize: 12, color: '#86909C' }}>{t('devices.timelineMowDetail')}</div>
|
||||
</>
|
||||
)
|
||||
},
|
||||
{
|
||||
color: 'blue',
|
||||
label: '11:00',
|
||||
children: (
|
||||
<>
|
||||
<Text strong>{t('devices.timelineInspect', { robot: 'RBT-02' })}</Text>
|
||||
<div style={{ fontSize: 12, color: '#86909C' }}>{t('devices.timelineInspectDetail')}</div>
|
||||
</>
|
||||
)
|
||||
},
|
||||
{
|
||||
color: 'gray',
|
||||
label: '14:00',
|
||||
children: (
|
||||
<>
|
||||
<Text strong>{t('devices.timelineMaintenance')}</Text>
|
||||
<div style={{ fontSize: 12, color: '#86909C' }}>{t('devices.timelineMaintenanceDetail')}</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
]}
|
||||
/>
|
||||
<Button type="primary" block style={{ marginTop: 16, borderRadius: 18 }}>{t('devices.autoGenerateTodayPlan')}</Button>
|
||||
</Card>
|
||||
|
||||
<Card
|
||||
title={<span style={{ fontSize: fontTitle, fontWeight: 700 }}>{t('devices.deviceEnvironment')}</span>}
|
||||
bordered={false}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
variant="borderless"
|
||||
styles={{ body: { padding: '16px' } }}
|
||||
style={{ ...cardStyle, flex: 1 }}
|
||||
>
|
||||
<Row gutter={[8, 8]}>
|
||||
@@ -1544,8 +1659,8 @@ export default function RobotTaskPage() {
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
bordered={false}
|
||||
bodyStyle={{ padding: '12px', height: 400, overflow: 'auto' }}
|
||||
variant="borderless"
|
||||
styles={{ body: { padding: '12px', height: 400, overflow: 'auto' } }}
|
||||
style={cardStyle}
|
||||
>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
|
||||
@@ -1676,8 +1791,8 @@ export default function RobotTaskPage() {
|
||||
<Col xs={24} xl={18}>
|
||||
<Card
|
||||
title={<span style={{ fontSize: fontTitle, fontWeight: 700 }}>{t('devices.taskBoard')}</span>}
|
||||
bordered={false}
|
||||
bodyStyle={{ padding: '12px' }}
|
||||
variant="borderless"
|
||||
styles={{ body: { padding: '12px' } }}
|
||||
style={{ ...cardStyle, height: '100%' }}
|
||||
>
|
||||
<Row gutter={16}>
|
||||
@@ -1815,6 +1930,7 @@ const NewTaskModal = ({ isOpen, onClose, robots, selectedPathWork, handlGetTaskL
|
||||
if (selectedPathWork) {
|
||||
setFormData(prev => ({ ...prev, path: selectedPathWork }));
|
||||
}
|
||||
|
||||
}, [selectedPathWork]);
|
||||
|
||||
// ====================== 周/月选择 ======================
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useState, useEffect, useRef } from 'react';
|
||||
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
||||
import {
|
||||
Row, Col, Card, Button, Space, Table, Tag, Typography, Progress, Badge,
|
||||
Tabs, Input, Switch, Divider, Tooltip, Timeline, Select, message, DatePicker,
|
||||
@@ -93,7 +93,7 @@ export default function WayLinePage({ onRefresh }) {
|
||||
|
||||
|
||||
// 当MQTT数据更新时,更新持久化数据(只在有新数据时更新)
|
||||
const handleMqttMessage = (topic, message) => {
|
||||
const handleMqttMessage = useCallback((topic, message) => {
|
||||
|
||||
try {
|
||||
const parsedMessage = JSON.parse(message);
|
||||
@@ -201,7 +201,7 @@ export default function WayLinePage({ onRefresh }) {
|
||||
} catch (err) {
|
||||
console.error('WayLinePage MQTT 消息解析失败:', err);
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
|
||||
// 根据选中设备动态构建MQTT主题
|
||||
const mqttTopics = React.useMemo(() => {
|
||||
@@ -223,6 +223,7 @@ export default function WayLinePage({ onRefresh }) {
|
||||
url: envConfig.mqtt_url,
|
||||
topic: mqttTopics,
|
||||
onMessage: handleMqttMessage,
|
||||
enabled: mqttTopics.length > 0,
|
||||
});
|
||||
|
||||
// 优先使用持久化数据,保持显示稳定
|
||||
@@ -831,7 +832,7 @@ export default function WayLinePage({ onRefresh }) {
|
||||
<Row gutter={[16, 16]} style={{ marginBottom: 8 }}>
|
||||
{topCards.map((item, index) => (
|
||||
<Col xs={12} sm={8} md={4} key={index}>
|
||||
<Card bordered={false} bodyStyle={{ padding: '12px 14px' }} style={cardStyle}>
|
||||
<Card variant="borderless" styles={{ body: { padding: '12px 14px' } }} style={cardStyle}>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
|
||||
<div style={{ width: 36, height: 36, background: item.bg, borderRadius: 10, display: 'flex', justifyContent: 'center', alignItems: 'center', color: item.color }}>
|
||||
{React.cloneElement(item.icon, { size: 18 })}
|
||||
@@ -890,8 +891,8 @@ export default function WayLinePage({ onRefresh }) {
|
||||
<Button size="small" icon={<Maximize2 size={12} />} />
|
||||
</Space>
|
||||
}
|
||||
bordered={false}
|
||||
bodyStyle={{ padding: 0, position: 'relative' }}
|
||||
variant="borderless"
|
||||
styles={{ body: { padding: 0, position: 'relative' } }}
|
||||
style={{ ...cardStyle, marginBottom: 10 }}
|
||||
>
|
||||
<div style={{ width: '100%', height: 420, background: '#e8f3ff url(https://picsum.photos/seed/solar_map_v2/1600/1000) center/cover', position: 'relative' }}>
|
||||
@@ -957,8 +958,8 @@ export default function WayLinePage({ onRefresh }) {
|
||||
/>
|
||||
</Tooltip>
|
||||
}
|
||||
bordered={false}
|
||||
bodyStyle={{ padding: 0, display: 'flex', flexDirection: 'column', height: "calc(100% - 40px)", overflow: "auto" }}
|
||||
variant="borderless"
|
||||
styles={{ body: { padding: 0, display: 'flex', flexDirection: 'column', height: "calc(100% - 40px)", overflow: "auto" } }}
|
||||
style={{ ...cardStyle, maxHeight: "250px", flex: 1, marginBottom: 0 }}
|
||||
>
|
||||
<Table
|
||||
@@ -982,8 +983,8 @@ export default function WayLinePage({ onRefresh }) {
|
||||
<Col xs={24} xl={10} style={{ display: "flex", flexDirection: "column" }} >
|
||||
<Card
|
||||
title={<span style={{ fontSize: fontTitle, fontWeight: 700 }}>{t('devices.taskOrchestrationAI')}</span>}
|
||||
bordered={false}
|
||||
bodyStyle={{ padding: '12px 16px' }}
|
||||
variant="borderless"
|
||||
styles={{ body: { padding: '12px 16px' } }}
|
||||
style={{ ...cardStyle, marginBottom: 8 }}
|
||||
>
|
||||
<Table
|
||||
@@ -1025,8 +1026,8 @@ export default function WayLinePage({ onRefresh }) {
|
||||
<Card
|
||||
title={<span style={{ fontSize: fontTitle, fontWeight: 700 }}>{t('devices.waylineParamsTitle')}</span>}
|
||||
extra={<Text type="secondary" style={{ fontSize: 12 }}>{t('devices.currentWayline')}{selectedTask?.name || '-'}</Text>}
|
||||
bordered={false}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
variant="borderless"
|
||||
styles={{ body: { padding: '16px' } }}
|
||||
style={{ ...cardStyle, marginBottom: 8 }}
|
||||
>
|
||||
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: '8px', marginBottom: 8 }}>
|
||||
@@ -1141,8 +1142,8 @@ export default function WayLinePage({ onRefresh }) {
|
||||
|
||||
<Card
|
||||
title={<span style={{ fontSize: fontTitle, fontWeight: 700 }}>{t('devices.weatherWindowTitle')}</span>}
|
||||
bordered={false}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
variant="borderless"
|
||||
styles={{ body: { padding: '16px' } }}
|
||||
style={{ ...cardStyle, flex: 1, }}
|
||||
>
|
||||
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(5, 1fr)', gap: '8px', marginBottom: 16 }}>
|
||||
@@ -1248,8 +1249,8 @@ export default function WayLinePage({ onRefresh }) {
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
bordered={false}
|
||||
bodyStyle={{ padding: '12px', display: 'flex', flexDirection: 'column', height: 480 }}
|
||||
variant="borderless"
|
||||
styles={{ body: { padding: '12px', display: 'flex', flexDirection: 'column', height: 480 } }}
|
||||
style={{ ...cardStyle, height: '100%' }}
|
||||
>
|
||||
<Input
|
||||
@@ -1313,8 +1314,8 @@ export default function WayLinePage({ onRefresh }) {
|
||||
<Card
|
||||
title={<span style={{ fontSize: fontTitle, fontWeight: 700 }}>{t('devices.ganttViewTitle')} <Text type="secondary" style={{ fontSize: 11, fontWeight: 400, marginLeft: 12 }}></Text></span>}
|
||||
extra={<MoreOutlined style={{ cursor: 'pointer', fontSize: 18 }} />}
|
||||
bordered={false}
|
||||
bodyStyle={{ padding: 16 }}
|
||||
variant="borderless"
|
||||
styles={{ body: { padding: 16 } }}
|
||||
style={{ ...cardStyle, height: '100%' }}
|
||||
>
|
||||
<div style={{ position: 'relative', border: '1px solid #F2F3F5', borderRadius: 8, padding: '16px 12px' }}>
|
||||
@@ -1393,8 +1394,8 @@ export default function WayLinePage({ onRefresh }) {
|
||||
</Space>
|
||||
</div>
|
||||
}
|
||||
bordered={false}
|
||||
bodyStyle={{ padding: 16 }}
|
||||
variant="borderless"
|
||||
styles={{ body: { padding: 16 } }}
|
||||
style={{ ...cardStyle, height: '100%', maxHeight: 480, overflow: "auto" }}
|
||||
>
|
||||
<Row gutter={10}>
|
||||
|
||||
@@ -116,7 +116,7 @@ const XboxController = ({ onGamepadUpdate, handleControlModal, isControlled, isC
|
||||
return (
|
||||
<div className="relative h-[252px] aspect-[4/3] flex items-center justify-center "
|
||||
onClick={() => {
|
||||
if (connected && !isControlled && hasControlRight) {
|
||||
if (!isControlled) {
|
||||
console.log("点击了无控制权限,发起权限请求");
|
||||
// 示例:调用你代码中已有的权限请求弹窗逻辑
|
||||
handleControlModal({ control: true, type: "switchPermission" });
|
||||
@@ -125,7 +125,7 @@ const XboxController = ({ onGamepadUpdate, handleControlModal, isControlled, isC
|
||||
{/* Gamepad Status Badge */}
|
||||
<div
|
||||
className={`absolute top-0 right-0 px-2 py-0.5 rounded text-[8px] font-bold tracking-widest border
|
||||
${connected || !hasControlRight
|
||||
${connected
|
||||
? isConnecting
|
||||
? 'bg-yellow-500/20 text-yellow-400 border-yellow-500/30'
|
||||
: isControlled
|
||||
@@ -137,8 +137,6 @@ const XboxController = ({ onGamepadUpdate, handleControlModal, isControlled, isC
|
||||
>
|
||||
{!connected ? (
|
||||
t('devices.controllerNotConnected')
|
||||
) : !hasControlRight ? (
|
||||
t('devices.otherWebConnected')
|
||||
) : isConnecting ? (
|
||||
t('devices.control2')
|
||||
) : isControlled ? (
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import throttle from 'lodash/throttle';
|
||||
import { wsManager } from '../WebSocketManager.ts';
|
||||
import {
|
||||
getControlRight,
|
||||
getJurisdiction,
|
||||
releaseControl
|
||||
} from '../../api/device.ts';
|
||||
|
||||
import envConfig from '../../../env';
|
||||
@@ -17,7 +17,7 @@ export default class DeviceController {
|
||||
envConfig.WS_URL || 'wss://ri.satabot.com/ws/';
|
||||
|
||||
this.connectedDeviceSn = null;
|
||||
this.currentDevice = null; // 保存当前设备
|
||||
this.currentDevice = null;
|
||||
|
||||
this.requestDeviceId = '';
|
||||
|
||||
@@ -27,22 +27,27 @@ export default class DeviceController {
|
||||
|
||||
this.wsStatus = 'disconnected';
|
||||
this.wsDeviceInfo = {};
|
||||
this.locationInfo = {};
|
||||
|
||||
this.controlTimeout = null;
|
||||
this.keepAliveInterval = null; // 后台保活定时器
|
||||
this.keepAliveInterval = null;
|
||||
|
||||
this.onDeviceInfoUpdate = null;
|
||||
this.onLocationInfoUpdate = null;
|
||||
|
||||
this.onControlStatusChange = null;
|
||||
this.onWsStatusChange = null;
|
||||
this.onHasControlRightChange = null;
|
||||
this.onRequestControlStatusChange = null;
|
||||
this.onPermissionRequest = null;
|
||||
this.onRoutePost = null;
|
||||
this.onIsFinished = null;
|
||||
this.handleArrivedPoint = null;
|
||||
|
||||
this.handleWsMessage = this.handleWsMessage.bind(this);
|
||||
this.handleWsStatus = this.handleWsStatus.bind(this);
|
||||
this.handleVisibilityChange = this.handleVisibilityChange.bind(this);
|
||||
this.handleBeforeUnload = this.handleBeforeUnload.bind(this);
|
||||
|
||||
this.sendGamepad = throttle(
|
||||
this.sendGamepad.bind(this),
|
||||
@@ -55,36 +60,38 @@ export default class DeviceController {
|
||||
this.unSubMessage = wsManager.onMessage(this.handleWsMessage);
|
||||
this.unSubStatus = wsManager.onStatusChange(this.handleWsStatus);
|
||||
|
||||
// ========== 【集成】页面可见性监听 ==========
|
||||
document.addEventListener('visibilitychange', this.handleVisibilityChange);
|
||||
document.addEventListener('beforeunload', this.handleBeforeUnload);
|
||||
}
|
||||
levae() {
|
||||
wsManager.close();
|
||||
|
||||
// ========== 【集成】后台保活定时 ==========
|
||||
//this.startKeepAlive();
|
||||
}
|
||||
|
||||
// ========== 【集成】页面切前台重连 ==========
|
||||
handleVisibilityChange() {
|
||||
// 切后台:关闭 WS
|
||||
if (document.visibilityState === 'hidden') {
|
||||
console.log('🔌 页面切后台,关闭 WebSocket');
|
||||
console.log('Page hidden, release control');
|
||||
//this.release();
|
||||
wsManager.close();
|
||||
this.connectedDeviceSn = null;
|
||||
|
||||
|
||||
this.isControlled = false;
|
||||
this.onControlStatusChange?.(false);
|
||||
}
|
||||
if (document.visibilityState === 'visible' && this.currentDevice) {
|
||||
if (!this.currentDevice?.serialNumber) return;
|
||||
console.log('✅ 页面切回前台,自动重连 WebSocket');
|
||||
console.log('Page visible, reconnect WebSocket');
|
||||
setTimeout(() => {
|
||||
this.connectDevice(this.currentDevice);
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
|
||||
// ========== 【集成】后台保活 ==========
|
||||
handleBeforeUnload() {
|
||||
console.log('Browser closing/refreshing, release control');
|
||||
this.release();
|
||||
}
|
||||
|
||||
startKeepAlive() {
|
||||
this.keepAliveInterval = setInterval(() => {
|
||||
if (
|
||||
@@ -92,47 +99,50 @@ export default class DeviceController {
|
||||
this.wsStatus !== 'connected' &&
|
||||
this.currentDevice?.serialNumber
|
||||
) {
|
||||
console.log('🔄 后台保活:尝试重连 WebSocket');
|
||||
console.log('Keep alive: reconnect WebSocket');
|
||||
this.connectDevice(this.currentDevice);
|
||||
}
|
||||
}, 8000);
|
||||
}
|
||||
release() {
|
||||
if (this.isControlled && this.connectedDeviceSn) {
|
||||
const data = {
|
||||
platform: "web",
|
||||
type: 1
|
||||
};
|
||||
const url = `${envConfig.baseURL}/forward/device/releaseControl`;
|
||||
|
||||
try {
|
||||
const blob = new Blob([JSON.stringify(data)], { type: 'application/json' });
|
||||
navigator.sendBeacon(url, blob);
|
||||
} catch (e) {
|
||||
console.error('Failed to send releaseControl beacon:', e);
|
||||
}
|
||||
async release() {
|
||||
if (!this.connectedDeviceSn) return;
|
||||
const data = {
|
||||
platform: 'web',
|
||||
type: 1,
|
||||
deviceId: this.connectedDeviceSn,
|
||||
token: this.userInfo.token,
|
||||
};
|
||||
const url = `${envConfig.baseURL}/forward/device/releaseControl`;
|
||||
|
||||
try {
|
||||
await releaseControl(data);
|
||||
const blob = new Blob([JSON.stringify(data)], { type: 'application/json' });
|
||||
navigator.sendBeacon(url, blob);
|
||||
console.log('releaseControl sent');
|
||||
} catch (e) {
|
||||
console.error('Failed to send releaseControl:', e);
|
||||
}
|
||||
}
|
||||
|
||||
destroy() {
|
||||
this.clearControlTimeout();
|
||||
|
||||
// 清理保活
|
||||
if (this.keepAliveInterval) {
|
||||
clearInterval(this.keepAliveInterval);
|
||||
this.keepAliveInterval = null;
|
||||
}
|
||||
|
||||
// 移除监听
|
||||
document.removeEventListener('visibilitychange', this.handleVisibilityChange);
|
||||
document.removeEventListener('beforeunload', this.handleBeforeUnload);
|
||||
|
||||
this.release();
|
||||
this.levae();
|
||||
|
||||
this.unSubMessage?.();
|
||||
this.unSubStatus?.();
|
||||
//this.release();
|
||||
|
||||
//wsManager.close();
|
||||
this.connectedDeviceSn = null;
|
||||
|
||||
}
|
||||
|
||||
handleWsStatus(status) {
|
||||
@@ -148,7 +158,6 @@ export default class DeviceController {
|
||||
async connectDevice(device) {
|
||||
if (!device) return;
|
||||
|
||||
// 保存当前设备,用于保活/重连
|
||||
this.currentDevice = device;
|
||||
if (!device.serialNumber) return;
|
||||
|
||||
@@ -156,31 +165,17 @@ export default class DeviceController {
|
||||
|
||||
this.connectedDeviceSn = null;
|
||||
this.wsDeviceInfo = {};
|
||||
this.locationInfo = {};
|
||||
this.isControlled = false;
|
||||
this.onControlStatusChange?.(false);
|
||||
|
||||
wsManager.close();
|
||||
|
||||
try {
|
||||
const res = await getControlRight({
|
||||
userName: this.userInfo.username,
|
||||
sourceType: 1,
|
||||
token: this.userInfo.token,
|
||||
});
|
||||
|
||||
this.hasControlRight = res?.code === 200 && res.data == true;
|
||||
this.onHasControlRightChange?.(this.hasControlRight);
|
||||
|
||||
console.log('Connecting to', this.wsUrl);
|
||||
wsManager.connect(sn, this.wsUrl);
|
||||
this.connectedDeviceSn = sn;
|
||||
|
||||
if (!this.hasControlRight) {
|
||||
this.messageApi.warning(i18n.t('devices.fixed2OthersControlFixed2'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
await this.getControl(sn);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
@@ -188,11 +183,42 @@ export default class DeviceController {
|
||||
}
|
||||
}
|
||||
|
||||
async switchDevice(device) {
|
||||
if (!device) return;
|
||||
if (!device.serialNumber) return;
|
||||
|
||||
const newSn = device.serialNumber;
|
||||
|
||||
if (this.connectedDeviceSn === newSn && this.wsStatus === 'connected') {
|
||||
console.log('switchDevice: same device, skip');
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('Connecting to switchDevice: switching to', newSn);
|
||||
|
||||
this.currentDevice = device;
|
||||
this.connectedDeviceSn = newSn;
|
||||
this.wsDeviceInfo = {};
|
||||
this.locationInfo = {};
|
||||
this.isControlled = false;
|
||||
this.onControlStatusChange?.(false);
|
||||
|
||||
wsManager.send({
|
||||
type: 'AUTH',
|
||||
token: this.userInfo.token,
|
||||
userName: this.userInfo.username,
|
||||
deviceId: newSn,
|
||||
});
|
||||
|
||||
await this.getControl(newSn);
|
||||
}
|
||||
|
||||
async getControl(serialnum) {
|
||||
try {
|
||||
const res = await getJurisdiction({
|
||||
platform: 'web',
|
||||
deviceId: serialnum,
|
||||
token: this.userInfo.token,
|
||||
});
|
||||
|
||||
this.isControlled = res?.code === 200 && res?.data?.remoteControl === true;
|
||||
@@ -206,10 +232,7 @@ export default class DeviceController {
|
||||
|
||||
requestControl() {
|
||||
if (this.isRequestControl) return;
|
||||
if (!this.hasControlRight) {
|
||||
this.messageApi.warning(i18n.t('devices.noneControl'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
this.isRequestControl = true;
|
||||
this.onRequestControlStatusChange?.(true);
|
||||
@@ -252,7 +275,7 @@ export default class DeviceController {
|
||||
}
|
||||
|
||||
handleWsMessage(msg) {
|
||||
console.log('📨 收到消息:', msg);
|
||||
console.log('WS message:', msg);
|
||||
switch (msg.type) {
|
||||
case 'deviceInfo': {
|
||||
const data = {};
|
||||
@@ -263,6 +286,15 @@ export default class DeviceController {
|
||||
this.onDeviceInfoUpdate?.(data);
|
||||
break;
|
||||
}
|
||||
case 'locationInfo': {
|
||||
const data = {};
|
||||
msg.data.forEach((item) => {
|
||||
data[item.name] = item.value;
|
||||
});
|
||||
this.locationInfo = data;
|
||||
this.onLocationInfoUpdate?.(data);
|
||||
break;
|
||||
}
|
||||
|
||||
case 'AUTH': {
|
||||
if (msg.isAuth) {
|
||||
@@ -277,7 +309,7 @@ export default class DeviceController {
|
||||
this.isRequestControl = false;
|
||||
this.onRequestControlStatusChange?.(false);
|
||||
|
||||
if (msg.success === false || msg?.respond?.switchResult === false) {
|
||||
if (msg?.success === false || msg?.respond?.switchResult === false) {
|
||||
this.isControlled = false;
|
||||
this.onControlStatusChange?.(false);
|
||||
this.messageApi.error({ key: 'control', content: msg.message || i18n.t('devices.controlFailed') });
|
||||
@@ -291,19 +323,16 @@ export default class DeviceController {
|
||||
case "device_task_change": {
|
||||
if (msg.deviceId != this.connectedDeviceSn) return;
|
||||
this.onIsFinished?.(true);
|
||||
console.log('🔌 控制结果任务变更,', msg);
|
||||
|
||||
console.log('task change:', msg);
|
||||
break;
|
||||
}
|
||||
//完成点
|
||||
case "device_task_arrive_point": {
|
||||
if (msg.deviceId != this.connectedDeviceSn) return;
|
||||
|
||||
this.handleArrivedPoint?.(msg.entity);
|
||||
console.log('🔌 到达完成点,', msg);
|
||||
|
||||
console.log('arrive point:', msg);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case 'switchPermission': {
|
||||
const platform = (msg.platform || '').toLowerCase();
|
||||
if (!platform || platform === 'null') return;
|
||||
@@ -330,6 +359,14 @@ export default class DeviceController {
|
||||
});
|
||||
break;
|
||||
|
||||
case 'route_post':
|
||||
console.log('route post:', msg);
|
||||
if (msg.deviceId) {
|
||||
this.onRoutePost?.(msg.data);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import {
|
||||
LineChart,
|
||||
Line,
|
||||
|
||||
@@ -1,388 +0,0 @@
|
||||
import React, { useEffect, useState, useMemo, useCallback } from 'react';
|
||||
import {
|
||||
Card, Row, Col, Select, DatePicker, Button, Space, Checkbox, Table, Tag,
|
||||
Typography, message, Empty, Spin
|
||||
} from 'antd';
|
||||
import {
|
||||
RobotOutlined, SearchOutlined, DownloadOutlined, LineChartOutlined
|
||||
} from '@ant-design/icons';
|
||||
import dayjs from 'dayjs';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useSelector } from 'react-redux';
|
||||
import { RootState } from '../../store';
|
||||
import { getSiteDevice } from '../../api/device';
|
||||
import { getDeviceRunningHistoryStatistics } from '../../api/machine';
|
||||
import { UniversalLineChart } from '../recharts';
|
||||
import utils from '@/lib/utils';
|
||||
|
||||
|
||||
const { RangePicker } = DatePicker;
|
||||
const { Option } = Select;
|
||||
const { Title } = Typography;
|
||||
|
||||
// 参数配置:i18n key + 后端字段 + 单位 + 颜色
|
||||
const PARAM_CONFIG = [
|
||||
{ key: 'voltage', labelKey: 'devices.rtVoltage', unit: 'V', color: '#1677ff' },
|
||||
{ key: 'leftCurrent', labelKey: 'devices.rtLeftMotor', unit: 'A', color: '#52c41a' },
|
||||
{ key: 'rightCurrent', labelKey: 'devices.rtRightMotor', unit: 'A', color: '#fa8c16' },
|
||||
{ key: 'leftMeasureSpeed', labelKey: 'devices.rtLeftSpeed', unit: 'rpm', color: '#eb2f96' },
|
||||
{ key: 'rightMeasureSpeed', labelKey: 'devices.rtRightSpeed', unit: 'rpm', color: '#722ed1' },
|
||||
{ key: 'leftMotorTemp', labelKey: 'devices.rtLeftTemp', unit: '℃', color: '#13c2c2' },
|
||||
{ key: 'rightMotorTemp', labelKey: 'devices.rtRightTemp', unit: '℃', color: '#f5222d' },
|
||||
{ key: 'chipTemp', labelKey: 'devices.rtMainTemp', unit: '℃', color: '#2f54eb' },
|
||||
];
|
||||
|
||||
// 默认选中全部参数
|
||||
const DEFAULT_PARAM_KEYS = PARAM_CONFIG.map(p => p.key);
|
||||
|
||||
// 兼容多种时间字段
|
||||
function getRowTime(row: any): string {
|
||||
const t = row.createTime || row.ts || row.timestamp || row.time || row.recordTime || row.collectTime;
|
||||
if (!t) return '';
|
||||
return dayjs(typeof t === 'number' ? t : String(t)).format('YYYY-MM-DD HH:mm:ss');
|
||||
}
|
||||
|
||||
// 兼容多种返回结构
|
||||
function extractRows(res: any): any[] {
|
||||
if (!res) return [];
|
||||
if (Array.isArray(res)) return res;
|
||||
if (Array.isArray(res.rows)) return res.rows;
|
||||
if (Array.isArray(res.data)) return res.data;
|
||||
if (res.data && Array.isArray(res.data.list)) return res.data.list;
|
||||
if (res.data && Array.isArray(res.data.records)) return res.data.records;
|
||||
return [];
|
||||
}
|
||||
|
||||
export default function MachineDataReport() {
|
||||
const { t } = useTranslation();
|
||||
const { stationId, currentStation } = useSelector((state: RootState) => state.station);
|
||||
|
||||
const [deviceList, setDeviceList] = useState<any[]>([]);
|
||||
const [deviceLoading, setDeviceLoading] = useState(false);
|
||||
const [selectedDeviceSn, setSelectedDeviceSn] = useState<string | undefined>();
|
||||
const [dateRange, setDateRange] = useState<[dayjs.Dayjs, dayjs.Dayjs]>([
|
||||
dayjs().startOf('day'),
|
||||
dayjs(),
|
||||
]);
|
||||
const [selectedParams, setSelectedParams] = useState<string[]>(DEFAULT_PARAM_KEYS);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [rawRows, setRawRows] = useState<any[]>([]);
|
||||
|
||||
// 获取机器人列表
|
||||
const fetchDevices = useCallback(async () => {
|
||||
if (!stationId) return;
|
||||
setDeviceLoading(true);
|
||||
try {
|
||||
const res = await getSiteDevice({
|
||||
siteId: stationId,
|
||||
pageSize: 9999,
|
||||
pageNum: 1,
|
||||
orgId: currentStation?.orgId,
|
||||
});
|
||||
const rows = res?.code === 200 ? (res.rows || []) : [];
|
||||
setDeviceList(rows);
|
||||
if (rows.length > 0) {
|
||||
setSelectedDeviceSn(rows[0].serialNumber);
|
||||
} else {
|
||||
setSelectedDeviceSn(undefined);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('fetch devices failed', e);
|
||||
} finally {
|
||||
setDeviceLoading(false);
|
||||
}
|
||||
}, [stationId, currentStation, selectedDeviceSn]);
|
||||
|
||||
useEffect(() => {
|
||||
fetchDevices();
|
||||
}, [fetchDevices]);
|
||||
|
||||
// 查询报表数据
|
||||
const handleQuery = useCallback(async () => {
|
||||
if (!selectedDeviceSn) {
|
||||
utils.message.warning(t('report.selectRobot'));
|
||||
return;
|
||||
}
|
||||
if (selectedParams.length === 0) {
|
||||
utils.message.warning(t('report.selectParameters'));
|
||||
return;
|
||||
}
|
||||
setLoading(true);
|
||||
try {
|
||||
const params: any = {
|
||||
deviceId: selectedDeviceSn,
|
||||
|
||||
startTime: dateRange[0].format('YYYY-MM-DD HH:mm:ss'),
|
||||
endTime: dateRange[1].format('YYYY-MM-DD HH:mm:ss'),
|
||||
};
|
||||
const res = await getDeviceRunningHistoryStatistics(params);
|
||||
const rows = extractRows(res);
|
||||
setRawRows(rows);
|
||||
if (rows.length === 0) {
|
||||
utils.message.info(t('common.noData'));
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('fetch intraday data failed', e);
|
||||
utils.message.error(t('common.noData'));
|
||||
setRawRows([]);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
}, [selectedDeviceSn, dateRange, selectedParams, t]);
|
||||
|
||||
// 进入页面自动查询一次(如果有默认设备)
|
||||
useEffect(() => {
|
||||
if (selectedDeviceSn && dateRange) {
|
||||
handleQuery();
|
||||
}
|
||||
}, [selectedDeviceSn]);
|
||||
|
||||
// 整理图表数据:每行 { time, [paramKey]: value }
|
||||
const chartData = useMemo(() => {
|
||||
return rawRows.map(row => {
|
||||
const item: any = { time: getRowTime(row) };
|
||||
selectedParams.forEach(k => {
|
||||
const v = row[k];
|
||||
item[k] = (typeof v === 'number') ? v : (v != null ? Number(v) : null);
|
||||
});
|
||||
return item;
|
||||
}).sort((a, b) => (a.time < b.time ? -1 : a.time > b.time ? 1 : 0));
|
||||
}, [rawRows, selectedParams]);
|
||||
|
||||
// 图表 series 配置
|
||||
const chartSeries = useMemo(() => {
|
||||
return PARAM_CONFIG
|
||||
.filter(p => selectedParams.includes(p.key))
|
||||
.map(p => ({
|
||||
key: p.key,
|
||||
name: `${t(p.labelKey)}(${p.unit})`,
|
||||
color: p.color,
|
||||
}));
|
||||
}, [selectedParams, t]);
|
||||
|
||||
// 表格列
|
||||
const tableColumns = useMemo(() => {
|
||||
const cols: any[] = [
|
||||
{
|
||||
title: t('report.generateTime') || '时间',
|
||||
dataIndex: '_time',
|
||||
key: '_time',
|
||||
width: 180,
|
||||
fixed: 'left',
|
||||
render: (v: string) => v || '-',
|
||||
},
|
||||
];
|
||||
PARAM_CONFIG
|
||||
.filter(p => selectedParams.includes(p.key))
|
||||
.forEach(p => {
|
||||
cols.push({
|
||||
title: `${t(p.labelKey)}(${p.unit})`,
|
||||
dataIndex: p.key,
|
||||
key: p.key,
|
||||
width: 140,
|
||||
render: (v: any) => (v != null && !isNaN(Number(v))) ? Number(v).toFixed(2) : '-',
|
||||
});
|
||||
});
|
||||
return cols;
|
||||
}, [selectedParams, t]);
|
||||
|
||||
// 表格数据源
|
||||
const tableData = useMemo(() => {
|
||||
return rawRows.map((row, idx) => {
|
||||
const item: any = {
|
||||
key: idx,
|
||||
_time: getRowTime(row),
|
||||
};
|
||||
PARAM_CONFIG.forEach(p => {
|
||||
const v = row[p.key];
|
||||
item[p.key] = (typeof v === 'number') ? v : (v != null ? Number(v) : null);
|
||||
});
|
||||
return item;
|
||||
}).sort((a, b) => (a._time < b._time ? -1 : a._time > b._time ? 1 : 0));
|
||||
}, [rawRows]);
|
||||
|
||||
// 导出 CSV
|
||||
const handleExport = useCallback(() => {
|
||||
if (tableData.length === 0) {
|
||||
utils.message.warning(t('common.noData'));
|
||||
return;
|
||||
}
|
||||
const headers = tableColumns.map((c: any) => c.title);
|
||||
const keys = tableColumns.map((c: any) => c.dataIndex);
|
||||
const lines = [headers.join(',')];
|
||||
tableData.forEach(row => {
|
||||
lines.push(keys.map(k => {
|
||||
const v = row[k];
|
||||
if (v == null) return '';
|
||||
const s = typeof v === 'number' ? v.toFixed(2) : String(v);
|
||||
return `"${s.replace(/"/g, '""')}"`;
|
||||
}).join(','));
|
||||
});
|
||||
const csv = '\uFEFF' + lines.join('\r\n');
|
||||
const blob = new Blob([csv], { type: 'text/csv;charset=utf-8;' });
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
const deviceName = deviceList.find(d => d.serialNumber === selectedDeviceSn)?.deviceAlias || selectedDeviceSn || 'machine';
|
||||
a.href = url;
|
||||
a.download = `machine_data_${deviceName}_${dayjs().format('YYYYMMDD_HHmmss')}.csv`;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
URL.revokeObjectURL(url);
|
||||
}, [tableData, tableColumns, deviceList, selectedDeviceSn, t]);
|
||||
|
||||
const cardStyle = {
|
||||
borderRadius: 12,
|
||||
border: '1px solid #f0f0f0',
|
||||
boxShadow: '0 4px 12px rgba(0,0,0,0.05)',
|
||||
};
|
||||
|
||||
return (
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
|
||||
{/* 筛选栏 */}
|
||||
<Card bordered={false} style={cardStyle} bodyStyle={{ padding: '16px 20px' }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center', flexWrap: 'wrap', gap: 20 }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||
<span style={{ fontSize: 13, color: '#86909C', marginRight: 8, whiteSpace: 'nowrap' }}>
|
||||
<RobotOutlined style={{ marginRight: 4 }} />{t('report.selectRobot')}:
|
||||
</span>
|
||||
<Select
|
||||
showSearch
|
||||
value={selectedDeviceSn}
|
||||
onChange={setSelectedDeviceSn}
|
||||
style={{ width: 420 }}
|
||||
placeholder={t('common.pleaseSelect')}
|
||||
loading={deviceLoading}
|
||||
optionFilterProp="children"
|
||||
filterOption={(input, option) =>
|
||||
String(option?.children ?? '').toLowerCase().includes(input.toLowerCase())
|
||||
}
|
||||
>
|
||||
{deviceList.map((d) => (
|
||||
<Option key={d.serialNumber} value={d.serialNumber}>
|
||||
{d.deviceAlias || d.deviceName || d.serialNumber}
|
||||
</Option>
|
||||
))}
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||
<span style={{ fontSize: 13, color: '#86909C', marginRight: 8, whiteSpace: 'nowrap' }}>
|
||||
{t('common.timeRange')}:
|
||||
</span>
|
||||
<RangePicker
|
||||
showTime
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
value={dateRange}
|
||||
onChange={(v) => v && v[0] && v[1] && setDateRange([v[0], v[1]])}
|
||||
style={{ width: 380 }}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||
<span style={{ fontSize: 13, color: '#86909C', marginRight: 8, whiteSpace: 'nowrap' }}>
|
||||
{t('report.selectParameters')}:
|
||||
</span>
|
||||
<Checkbox.Group
|
||||
value={selectedParams}
|
||||
onChange={(v) => setSelectedParams(v as string[])}
|
||||
style={{ maxWidth: 700 }}
|
||||
>
|
||||
<Row gutter={[8, 4]}>
|
||||
{PARAM_CONFIG.map(p => (
|
||||
<Col key={p.key}>
|
||||
<Checkbox value={p.key}>{t(p.labelKey)}</Checkbox>
|
||||
</Col>
|
||||
))}
|
||||
</Row>
|
||||
</Checkbox.Group>
|
||||
</div>
|
||||
|
||||
<div style={{ marginLeft: 'auto' }}>
|
||||
<Space size={8}>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<SearchOutlined />}
|
||||
onClick={handleQuery}
|
||||
loading={loading}
|
||||
style={{ borderRadius: 6, height: 32, padding: '0 16px' }}
|
||||
>
|
||||
{t('report.query')}
|
||||
</Button>
|
||||
<Button
|
||||
icon={<DownloadOutlined />}
|
||||
onClick={handleExport}
|
||||
disabled={tableData.length === 0}
|
||||
style={{ borderRadius: 6, height: 32, color: '#00B42A', borderColor: '#00B42A' }}
|
||||
>
|
||||
{t('report.exportTable')}
|
||||
</Button>
|
||||
</Space>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
{/* 统计曲线图 */}
|
||||
<Card
|
||||
bordered={false}
|
||||
style={cardStyle}
|
||||
bodyStyle={{ padding: '20px' }}
|
||||
title={
|
||||
<Space>
|
||||
<LineChartOutlined style={{ color: '#165DFF' }} />
|
||||
<span style={{ fontSize: 15, fontWeight: 700, color: '#1D2129' }}>
|
||||
{t('report.aiAnalysisStatistics')}
|
||||
</span>
|
||||
</Space>
|
||||
}
|
||||
extra={
|
||||
selectedParams.length > 0 && (
|
||||
<span style={{ fontSize: 12, color: '#86909C' }}>
|
||||
{t('common.total', { count: chartData.length })} {t('report.unitItem')}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
>
|
||||
<Spin spinning={loading}>
|
||||
{chartData.length > 0 && chartSeries.length > 0 ? (
|
||||
<UniversalLineChart
|
||||
data={chartData}
|
||||
xKey="time"
|
||||
series={chartSeries}
|
||||
height={420}
|
||||
/>
|
||||
) : (
|
||||
<Empty
|
||||
style={{ margin: '60px 0' }}
|
||||
description={loading ? '' : t('common.noData')}
|
||||
/>
|
||||
)}
|
||||
</Spin>
|
||||
</Card>
|
||||
|
||||
{/* 数据表格 */}
|
||||
<Card
|
||||
bordered={false}
|
||||
style={cardStyle}
|
||||
bodyStyle={{ padding: 0 }}
|
||||
title={
|
||||
<span style={{ fontSize: 15, fontWeight: 700, color: '#1D2129' }}>
|
||||
{t('report.machineRecords')}
|
||||
</span>
|
||||
}
|
||||
>
|
||||
<Table
|
||||
rowKey="key"
|
||||
columns={tableColumns}
|
||||
dataSource={tableData}
|
||||
size="small"
|
||||
loading={loading}
|
||||
scroll={{ x: 'max-content', y: 400 }}
|
||||
pagination={{ pageSize: 20, showSizeChanger: true, showTotal: (total) => `${total}` }}
|
||||
className="compact-table"
|
||||
locale={{ emptyText: t('common.noData') }}
|
||||
/>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,53 +1,188 @@
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { useEffect, useRef, useCallback, useState } from 'react';
|
||||
import mqtt, { MqttClient } from 'mqtt';
|
||||
|
||||
interface Options {
|
||||
url: string;
|
||||
topic: string | string[];
|
||||
onMessage: (topic: string, message: string) => void;
|
||||
/* ============================================================
|
||||
* MQTT 连接池 —— 同一 URL 共享一个连接,避免重复建连
|
||||
* ============================================================ */
|
||||
const connectionPool = new Map<string, { client: MqttClient; refCount: number }>();
|
||||
|
||||
function getOrCreateClient(url: string, options?: mqtt.IClientOptions): MqttClient {
|
||||
const entry = connectionPool.get(url);
|
||||
if (entry) {
|
||||
entry.refCount++;
|
||||
return entry.client;
|
||||
}
|
||||
const client = mqtt.connect(url, {
|
||||
reconnectPeriod: 3000,
|
||||
clean: true,
|
||||
...options,
|
||||
});
|
||||
connectionPool.set(url, { client, refCount: 1 });
|
||||
|
||||
// 连接断开后自动清理池条目
|
||||
client.on('close', () => {
|
||||
const cur = connectionPool.get(url);
|
||||
if (cur && cur.client === client) {
|
||||
connectionPool.delete(url);
|
||||
}
|
||||
});
|
||||
|
||||
return client;
|
||||
}
|
||||
|
||||
export function useMqtt({ url, topic, onMessage }: Options) {
|
||||
const clientRef = useRef<MqttClient | null>(null);
|
||||
function releaseClient(url: string): void {
|
||||
const entry = connectionPool.get(url);
|
||||
if (!entry) return;
|
||||
entry.refCount--;
|
||||
if (entry.refCount <= 0) {
|
||||
entry.client.end(true);
|
||||
connectionPool.delete(url);
|
||||
}
|
||||
}
|
||||
|
||||
/* ============================================================
|
||||
* useMqtt Hook
|
||||
* ============================================================ */
|
||||
interface UseMqttOptions {
|
||||
/** broker 地址,如 wss://xxx/mqtt */
|
||||
url: string;
|
||||
/** 要订阅的主题(字符串或数组),传空则不订阅 */
|
||||
topic: string | string[];
|
||||
/** 收到消息的回调 */
|
||||
onMessage: (topic: string, message: string) => void;
|
||||
/** 是否启用订阅,默认 true;设为 false 时不会建立连接 */
|
||||
enabled?: boolean;
|
||||
/** MQTT 连接额外配置(可选) */
|
||||
connectOptions?: mqtt.IClientOptions;
|
||||
}
|
||||
|
||||
interface UseMqttReturn {
|
||||
/** 当前连接状态 */
|
||||
connected: boolean;
|
||||
/** 手动发布消息 */
|
||||
publish: (topic: string, message: string) => void;
|
||||
}
|
||||
|
||||
export function useMqtt({
|
||||
url,
|
||||
topic,
|
||||
onMessage,
|
||||
enabled = true,
|
||||
connectOptions,
|
||||
}: UseMqttOptions): UseMqttReturn {
|
||||
const clientRef = useRef<MqttClient | null>(null);
|
||||
const onMessageRef = useRef(onMessage);
|
||||
const [connected, setConnected] = useState(false);
|
||||
|
||||
// 始终保持 onMessage 回调为最新引用,避免闭包过期
|
||||
useEffect(() => {
|
||||
const client = mqtt.connect(url, {
|
||||
reconnectPeriod: 3000,
|
||||
onMessageRef.current = onMessage;
|
||||
}, [onMessage]);
|
||||
|
||||
// 将 topic 统一转为数组,方便做 diff
|
||||
const topicList = (Array.isArray(topic) ? topic : [topic]).filter(Boolean);
|
||||
const topicKey = topicList.join(',');
|
||||
|
||||
/* ---------- 核心:建连 / 订阅 / 清理 ---------- */
|
||||
useEffect(() => {
|
||||
if (!enabled || !url) return;
|
||||
|
||||
const client = getOrCreateClient(url, {
|
||||
username: 'maibu',
|
||||
password: 'jsmbzn520',
|
||||
clean: true,
|
||||
...connectOptions,
|
||||
});
|
||||
|
||||
clientRef.current = client;
|
||||
|
||||
client.on('connect', () => {
|
||||
console.log('MQTT connected');
|
||||
client.subscribe(topic);
|
||||
});
|
||||
|
||||
client.on('message', (t, payload) => {
|
||||
onMessage(t, payload.toString());
|
||||
});
|
||||
|
||||
client.on('error', err => {
|
||||
console.error('MQTT error', err);
|
||||
});
|
||||
|
||||
return () => {
|
||||
client.end(true);
|
||||
/* --- 连接成功 → 订阅主题 --- */
|
||||
const handleConnect = () => {
|
||||
setConnected(true);
|
||||
if (topicList.length > 0) {
|
||||
client.subscribe(topicList, (err) => {
|
||||
if (err) console.error('[useMqtt] subscribe failed:', err);
|
||||
});
|
||||
}
|
||||
};
|
||||
}, [url, JSON.stringify(topic)]);
|
||||
|
||||
return clientRef;
|
||||
/* --- 收到消息 → 回调 --- */
|
||||
const handleMessage = (t: string, payload: Buffer) => {
|
||||
console.log(payload.toString(), "订阅无人机数据")
|
||||
onMessageRef.current(t, payload.toString());
|
||||
};
|
||||
|
||||
/* --- 连接状态变化 --- */
|
||||
const handleReconnect = () => setConnected(false);
|
||||
const handleOffline = () => setConnected(false);
|
||||
const handleError = (err: Error) => {
|
||||
console.error('[useMqtt] error:', err);
|
||||
};
|
||||
|
||||
client.on('connect', handleConnect);
|
||||
client.on('message', handleMessage);
|
||||
client.on('reconnect', handleReconnect);
|
||||
client.on('offline', handleOffline);
|
||||
client.on('error', handleError);
|
||||
|
||||
// 如果连接已经建立,直接订阅
|
||||
if (client.connected && topicList.length > 0) {
|
||||
client.subscribe(topicList);
|
||||
setConnected(true);
|
||||
}
|
||||
|
||||
/* --- 清理:退出路由时取消订阅 & 释放连接 --- */
|
||||
return () => {
|
||||
// 取消当前 hook 订阅的主题
|
||||
if (topicList.length > 0) {
|
||||
client.unsubscribe(topicList);
|
||||
}
|
||||
// 移除本 hook 注册的事件监听
|
||||
client.removeListener('connect', handleConnect);
|
||||
client.removeListener('message', handleMessage);
|
||||
client.removeListener('reconnect', handleReconnect);
|
||||
client.removeListener('offline', handleOffline);
|
||||
client.removeListener('error', handleError);
|
||||
|
||||
setConnected(false);
|
||||
|
||||
// 释放连接池引用(refCount=0 时自动断开)
|
||||
releaseClient(url);
|
||||
clientRef.current = null;
|
||||
};
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [enabled, url, topicKey]);
|
||||
|
||||
/* ---------- 主题热更新:topic 变化时 diff 订阅 ---------- */
|
||||
const prevTopicKeyRef = useRef(topicKey);
|
||||
useEffect(() => {
|
||||
const client = clientRef.current;
|
||||
if (!client || !client.connected) return;
|
||||
|
||||
const prevKey = prevTopicKeyRef.current;
|
||||
prevTopicKeyRef.current = topicKey;
|
||||
|
||||
if (prevKey === topicKey) return;
|
||||
|
||||
// 取消旧主题
|
||||
const prevTopics = prevKey ? prevKey.split(',').filter(Boolean) : [];
|
||||
if (prevTopics.length > 0) {
|
||||
client.unsubscribe(prevTopics);
|
||||
}
|
||||
// 订阅新主题
|
||||
if (topicList.length > 0) {
|
||||
client.subscribe(topicList);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [topicKey]);
|
||||
|
||||
/* ---------- 手动发布 ---------- */
|
||||
const publish = useCallback((t: string, message: string) => {
|
||||
const client = clientRef.current;
|
||||
if (client && client.connected) {
|
||||
client.publish(t, message);
|
||||
} else {
|
||||
console.warn('[useMqtt] publish skipped: not connected');
|
||||
}
|
||||
}, []);
|
||||
|
||||
return { connected, publish };
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 使用 */
|
||||
// useMqtt({
|
||||
// url: 'wss://broker.emqx.io:8084/mqtt',
|
||||
// topic: 'robot/status',
|
||||
// onMessage: (_, message) => {
|
||||
// setMsg(message);
|
||||
// },
|
||||
// });
|
||||
|
||||
@@ -154,6 +154,11 @@ h4, .ant-typography h4 { font-size: clamp(1rem, 1.5vw, 1.25rem) !important; }
|
||||
background-color: #f0f7ff !important;
|
||||
}
|
||||
|
||||
.recharts-responsive-container>div{
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
import envConfig from '../../env';
|
||||
|
||||
// 获取发布图层列表
|
||||
// 通过 GetCapabilities 解析 WMS 发布的所有图层(workspace:layer)
|
||||
export function fetchPublishedLayers(): Promise<{ name: string; title: string }[]> {
|
||||
const baseUrl = envConfig.geoserver_url;
|
||||
const getCapabilitiesUrl = `${baseUrl}/wms?service=WMS&version=1.1.1&request=GetCapabilities`;
|
||||
|
||||
return fetch(getCapabilitiesUrl)
|
||||
.then(response => response.text())
|
||||
.then(xmlText => {
|
||||
const parser = new DOMParser();
|
||||
const xmlDoc = parser.parseFromString(xmlText, 'text/xml');
|
||||
const layerElements = xmlDoc.getElementsByTagName('Layer');
|
||||
const uniqueLayerNames = new Set();
|
||||
const publishedLayers: { name: string; title: string }[] = [];
|
||||
|
||||
for (let i = 0; i < layerElements.length; i++) {
|
||||
const layer = layerElements[i];
|
||||
const nameElement = layer.getElementsByTagName('Name')[0];
|
||||
const titleElement = layer.getElementsByTagName('Title')[0];
|
||||
if (nameElement && nameElement.textContent) {
|
||||
const layerName = nameElement.textContent;
|
||||
if (layerName.includes(':') && !uniqueLayerNames.has(layerName)) {
|
||||
uniqueLayerNames.add(layerName);
|
||||
publishedLayers.push({
|
||||
name: layerName,
|
||||
title: titleElement ? titleElement.textContent : layerName
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
return publishedLayers;
|
||||
});
|
||||
}
|
||||
@@ -241,6 +241,7 @@ const en = {
|
||||
},
|
||||
devices: {
|
||||
deviceManagement: 'Device Management',
|
||||
distributable: 'Distributable',
|
||||
deviceOverview: 'Device Overview',
|
||||
deviceStatus: 'Device Status',
|
||||
waylineTask: 'Wayline Tasks',
|
||||
@@ -659,6 +660,8 @@ const en = {
|
||||
optimize: 'Optimize',
|
||||
optionalEmpty: 'Optional Empty',
|
||||
otherWebControlling: 'Other Web Controlling',
|
||||
platformRequestControl: "{{platform}} platformRequestControl",
|
||||
|
||||
outDock: 'Out Dock',
|
||||
outdoor: 'Outdoor',
|
||||
panorama: 'Panorama',
|
||||
@@ -989,6 +992,9 @@ const en = {
|
||||
working: 'Working',
|
||||
workingCurrent: 'Working Current',
|
||||
zoomLens: 'Zoom Lens',
|
||||
controllerNotConnected: "controllerNotConnected",
|
||||
otherWebConnected: "otherWebConnected",
|
||||
clickToRequestControl: "clickToRequestControl",
|
||||
|
||||
fixed2TaskSuspended2: 'Fixed2 Task Suspended2 态势',
|
||||
|
||||
@@ -1023,11 +1029,18 @@ const en = {
|
||||
fixed2Video: 'Fixed2 Video 已配',
|
||||
|
||||
batteryFixed2: '电池 Battery Fixed2',
|
||||
noFix: 'noFix',
|
||||
single: 'single',
|
||||
dgnss: 'dgnss',
|
||||
ins: 'ins',
|
||||
|
||||
singleNoHeading: 'singleNoHeading',
|
||||
dgnssNoHeading: 'dgnssNoHeading',
|
||||
rtkFixedNoHeading: 'rtkFixedNoHeading',
|
||||
rtkFloatNoHeading: 'rtkFloatNoHeading',
|
||||
s62: 'Signal/Satellite',
|
||||
|
||||
s72: 'Wind Speed',
|
||||
distributable: 'Distributable',
|
||||
UnitsRobot: '',
|
||||
UnitsDrone: '',
|
||||
executing: 'Executing',
|
||||
@@ -1282,9 +1295,10 @@ const en = {
|
||||
|
||||
failedFixed22: '权限校验 Failed Fixed2',
|
||||
|
||||
noneControl: 'None Control 权限',
|
||||
noneControl: 'None Control jurisdiction',
|
||||
|
||||
fixed2ControlFixed2: 'Fixed2 Control 请求 超时 Fixed2',
|
||||
controlFailed: "controlFailed",
|
||||
},
|
||||
video: {
|
||||
onlineVideo: 'Online Video',
|
||||
@@ -2268,12 +2282,7 @@ const en = {
|
||||
totalWorkOrders: 'Total Work Orders',
|
||||
completionRate: 'Completion Rate',
|
||||
averageEfficiency: 'Average Efficiency',
|
||||
machineAnalysisReport: 'Machine Data Report',
|
||||
selectRobot: 'Select Robot',
|
||||
selectParameters: 'Select Parameters',
|
||||
query: 'Query',
|
||||
exportTable: 'Export Table',
|
||||
machineRecords: 'Machine Records',
|
||||
aiAnalysisReport: 'ai Analysis Report',
|
||||
aiAnalysisStatistics: 'ai Analysis Statistics',
|
||||
aiDiagnosisDaily: 'ai Diagnosis Daily',
|
||||
alarmCount: 'Alarm Count',
|
||||
@@ -3059,11 +3068,7 @@ const en = {
|
||||
|
||||
s412: 'Auto Backup',
|
||||
|
||||
BoundaryDrawing: 'Boundary Drawing',
|
||||
|
||||
s110: 'Unbind person',
|
||||
mappingLayer: 'Mapped Layer',
|
||||
mappingLayerPlaceholder: 'Select a published layer to map',
|
||||
s110: 'Boundary Drawing',
|
||||
|
||||
fixed2Camera2: 'Total Cameras',
|
||||
|
||||
|
||||
@@ -237,13 +237,24 @@ const zh = {
|
||||
|
||||
failedFixed2: '❌ 工单生成接口调用失败',
|
||||
solarPanel: "组件阵列",
|
||||
WeatherStation: "气象站",
|
||||
weatherStation: "气象站",
|
||||
environmentalSensor: "环境传感器",
|
||||
distributable: "可调度",
|
||||
|
||||
},
|
||||
devices: {
|
||||
noFix: '无定位',
|
||||
single: '单点定位',
|
||||
dgnss: '差分定位',
|
||||
ins: '惯导定位',
|
||||
rtkFixed: 'RTK固定解',
|
||||
rtkFloat: 'RTK浮点解',
|
||||
singleNoHeading: '单点定位(无航向)',
|
||||
dgnssNoHeading: '差分定位(无航向)',
|
||||
rtkFixedNoHeading: 'RTK固定解(无航向)',
|
||||
rtkFloatNoHeading: 'RTK浮点解(无航向)',
|
||||
deviceManagement: '设备管理',
|
||||
distributable: '可调度',
|
||||
deviceOverview: '设备总览',
|
||||
deviceStatus: '设备状态',
|
||||
waylineTask: '航线任务',
|
||||
@@ -344,7 +355,7 @@ const zh = {
|
||||
good: '良好',
|
||||
robotRouteMonitor: '机器人路径规划与监控',
|
||||
clearRealtimeTrack: '清空实时轨迹',
|
||||
clearPlanRoute: '清空规划航线',
|
||||
clearPlanRoute: '清空规划区域',
|
||||
controlMode: '控制模式:',
|
||||
localMode: '本地',
|
||||
remoteMode: '远程',
|
||||
@@ -372,7 +383,6 @@ const zh = {
|
||||
currentTemp: '当前温度',
|
||||
humidity: '环境湿度',
|
||||
positionAccuracy: '定位精度',
|
||||
rtkFixed: 'RTK 固定',
|
||||
networkLatency: '网络延迟',
|
||||
waterRiskWarning: '注意:区域 B 存在积水风险,建议避开',
|
||||
presetRoutes: '预设路线',
|
||||
@@ -487,7 +497,6 @@ const zh = {
|
||||
connectionFailed: '连接失败',
|
||||
controlLogTitle: '控制日志标题',
|
||||
controlRequestContent: '控制请求内容',
|
||||
controllerNotConnected: "控制器未连接",
|
||||
countUnit: '数量单位',
|
||||
coverClosed: '已关闭',
|
||||
coverOpen: '打开',
|
||||
@@ -559,6 +568,12 @@ const zh = {
|
||||
fillRequiredFields: '填写必填字段',
|
||||
firmwareVersion: '固件版本',
|
||||
fixed: '固定',
|
||||
controllerNotConnected: "控制器未连接",
|
||||
otherWebConnected: "其他网页已连接",
|
||||
clickToRequestControl: "点击请求控制",
|
||||
|
||||
controlling: "控制中",
|
||||
|
||||
fixed2: '',
|
||||
fixedEnv: '固定环境',
|
||||
flightAltitude: '飞行高度',
|
||||
@@ -667,8 +682,6 @@ const zh = {
|
||||
optimize: '优化',
|
||||
optionalEmpty: '可选空',
|
||||
otherWebControlling: '其他网页控制中',
|
||||
controlling: "控制中",
|
||||
clickToRequestControl: "点击请求控制",
|
||||
outDock: '舱外',
|
||||
outdoor: '室外',
|
||||
panorama: '全景',
|
||||
@@ -735,8 +748,8 @@ const zh = {
|
||||
positionInStation: '位置内电站',
|
||||
precipStatus: '降水状态',
|
||||
productType: '产品类型',
|
||||
rainNo: '雨无',
|
||||
rainYes: '雨是',
|
||||
rainNo: '无',
|
||||
rainYes: '降雨',
|
||||
rainfall: '降雨',
|
||||
realtimeMonitorList: '实时监控列表',
|
||||
realtimePicture: '实时图片',
|
||||
@@ -784,29 +797,28 @@ const zh = {
|
||||
routeLoadedWithName: '路线已加载带名称',
|
||||
routeNoPathPoints: '路线编号路径点',
|
||||
routeSavedLocal: '路线已保存本地',
|
||||
rtBattery: '实时电量',
|
||||
rtHeadingAngle: '实时航向角度',
|
||||
rtHeadingStatus: '实时航向状态',
|
||||
rtInitialized: '实时已初始化',
|
||||
rtLeftMotor: '实时左电机',
|
||||
rtLeftSpeed: '实时左速度',
|
||||
rtLeftTemp: '实时左温度',
|
||||
rtMainTemp: '实时主温度',
|
||||
rtMode: '实时模式',
|
||||
rtPitchAngle: '实时俯仰角度',
|
||||
rtPositioning: '实时定位',
|
||||
rtRightMotor: '实时右电机',
|
||||
rtRightSpeed: '实时右速度',
|
||||
rtRightTemp: '实时右温度',
|
||||
rtSatellites: '实时卫星',
|
||||
rtVoltage: '实时电压',
|
||||
rtBattery: '电量',
|
||||
rtHeadingAngle: '航向角度',
|
||||
rtHeadingStatus: '航向状态',
|
||||
rtInitialized: '已初始化',
|
||||
rtLeftMotor: '左电机',
|
||||
rtLeftSpeed: '左速度',
|
||||
rtLeftTemp: '左温度',
|
||||
rtMainTemp: '主温度',
|
||||
rtMode: '模式',
|
||||
rtPitchAngle: '俯仰角度',
|
||||
rtPositioning: '定位',
|
||||
rtRightMotor: '右电机',
|
||||
rtRightSpeed: '右速度',
|
||||
rtRightTemp: '右温度',
|
||||
rtSatellites: '卫星数量',
|
||||
rtVoltage: '电压',
|
||||
rthMode: '返航模式',
|
||||
rthOptimal: '返航最优',
|
||||
rthPreset: '返航预设',
|
||||
rtkCount: 'RTK数量',
|
||||
rtkEnvLabel: 'RTK环境标签',
|
||||
rtkFixed2: 'RTK',
|
||||
rtkFloat: 'RTK浮点',
|
||||
rtkFixed2: 'RTK固定',
|
||||
rtkHighPrecision: 'RTK高精度',
|
||||
rtkModeDesc: 'RTK模式描述',
|
||||
rtkStatus: 'RTK状态',
|
||||
@@ -819,11 +831,11 @@ const zh = {
|
||||
searchWaylinePlaceholder: '搜索航线占位',
|
||||
selectDevice: '选择设备',
|
||||
selectDrone: '选择无人机',
|
||||
selectExecuteDroneFirst: '选择执行无人机先',
|
||||
selectNoDrone: '选择无无人机',
|
||||
selectStartTimePlaceholder: '选择开始时间占位',
|
||||
selectExecuteDroneFirst: '执行无人机',
|
||||
selectNoDrone: '无无人机',
|
||||
selectStartTimePlaceholder: '开始时间',
|
||||
selectTaskFirst: '选择任务先',
|
||||
selectTaskStartTime: '选择任务开始时间',
|
||||
selectTaskStartTime: '任务开始时间',
|
||||
selectWayline: '选择航线',
|
||||
selectedWaylineColon: '已选航线冒号',
|
||||
signalSatellite: '信号卫星',
|
||||
@@ -837,18 +849,18 @@ const zh = {
|
||||
stationStatus: '电站状态',
|
||||
stationTopology: '电站拓扑',
|
||||
stationVideo: '电站视频',
|
||||
statusExecFailed: '状态执行失败',
|
||||
statusExecSuccess: '状态执行成功',
|
||||
statusExecFailed: '执行失败',
|
||||
statusExecSuccess: '执行成功',
|
||||
statusPendingApproval: '状态待处理审批',
|
||||
statusPreparing: '状态准备中',
|
||||
statusRestored: '状态已恢复',
|
||||
statusStartFailed: '状态开始失败',
|
||||
statusSuggestExec: '状态建议执行',
|
||||
statusTerminated: '状态已终止',
|
||||
statusTimeout: '状态超时',
|
||||
statusUpdateSuccess: '状态更新成功',
|
||||
statusWaitExec: '状态等待执行',
|
||||
statusWaitingStart: '状态等待中开始',
|
||||
statusPreparing: '准备中',
|
||||
statusRestored: '已恢复',
|
||||
statusStartFailed: '开始失败',
|
||||
statusSuggestExec: '建议执行',
|
||||
statusTerminated: '已终止',
|
||||
statusTimeout: '超时',
|
||||
statusUpdateSuccess: '更新成功',
|
||||
statusWaitExec: '等待执行',
|
||||
statusWaitingStart: '等待中开始',
|
||||
stopVideoBtn: '停止视频按钮',
|
||||
suggestAction: '建议操作',
|
||||
suggestTime: '建议时间',
|
||||
@@ -1299,6 +1311,9 @@ const zh = {
|
||||
cancel: "取消",
|
||||
UnitsRobot: "台",
|
||||
UnitsDrone: "架",
|
||||
platformRequestControl: "{{platform}} 正在请求控制权限",
|
||||
controlFailed: "controlFailed",
|
||||
|
||||
},
|
||||
video: {
|
||||
onlineVideo: '在线视频',
|
||||
@@ -2296,13 +2311,7 @@ const zh = {
|
||||
totalWorkOrders: '工单总数',
|
||||
completionRate: '完成率',
|
||||
averageEfficiency: '平均效率',
|
||||
machineAnalysisReport: '机器数据报表',
|
||||
selectRobot: '机器人',
|
||||
selectParameters: '选择参数',
|
||||
query: '查询',
|
||||
exportTable: '导出表格',
|
||||
machineRecords: '机器记录',
|
||||
|
||||
aiAnalysisReport: 'AI分析报表',
|
||||
aiAnalysisStatistics: 'AI分析统计',
|
||||
aiDiagnosisDaily: 'AI诊断每日',
|
||||
alarmCount: '告警数量',
|
||||
@@ -2645,7 +2654,7 @@ const zh = {
|
||||
|
||||
s28: '开启钉钉推送时必须填写加密密钥',
|
||||
|
||||
fixed2OM: '普通用户',
|
||||
fixed2OM: '运维工程师',
|
||||
|
||||
fixed2Inspection: '巡检区',
|
||||
|
||||
@@ -3086,19 +3095,15 @@ const zh = {
|
||||
|
||||
s282: '最近更新',
|
||||
|
||||
fixed2Inspection2: '机构管理员',
|
||||
fixed2Inspection2: '巡检主管',
|
||||
|
||||
s322: '场站管理员',
|
||||
s322: '数据分析师',
|
||||
|
||||
fixed2Login2: '登录审计',
|
||||
|
||||
s412: '自动备份',
|
||||
|
||||
s110: '人员',
|
||||
BoundaryDrawing: '边界绘制',
|
||||
|
||||
mappingLayer: '映射图层',
|
||||
mappingLayerPlaceholder: '请选择要映射的发布图层',
|
||||
s110: '边界绘制',
|
||||
|
||||
fixed2Camera2: '摄像头总数',
|
||||
|
||||
@@ -3347,17 +3352,17 @@ const zh = {
|
||||
male: '男',
|
||||
female: '女',
|
||||
notSet: '未设置',
|
||||
basicInfo: '基础提示',
|
||||
basicInfo: '基本信息',
|
||||
changePassword: '变更密码',
|
||||
confirmPasswordPlaceholder: '确认密码占位',
|
||||
confirmPasswordPlaceholder: '确认密码',
|
||||
confirmPasswordRequired: '确认密码必填',
|
||||
emailInvalid: '邮件无效',
|
||||
emailPlaceholder: '邮件占位',
|
||||
newPasswordPlaceholder: '新密码占位',
|
||||
oldPasswordPlaceholder: '旧密码占位',
|
||||
newPasswordPlaceholder: '新密码',
|
||||
oldPasswordPlaceholder: '旧密码',
|
||||
passwordLengthError: '密码长度错误',
|
||||
phoneInvalid: '电话无效',
|
||||
remarkPlaceholder: '备注占位',
|
||||
remarkPlaceholder: '备注',
|
||||
requestFailed: '请求失败',
|
||||
},
|
||||
users: {
|
||||
@@ -3428,7 +3433,7 @@ const zh = {
|
||||
roleNamePlaceholder: '角色名称占位',
|
||||
rolePermission: '角色权限',
|
||||
roleSortLabel: '角色排序标签',
|
||||
superAdmin: '平台管理员',
|
||||
superAdmin: '超级管理员',
|
||||
},
|
||||
constants: {
|
||||
// 工单类型
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useState } from 'react';
|
||||
import React, { useState } from 'react';
|
||||
import {
|
||||
Row, Col, Card, Button, Tag, Table, Typography, Space, Statistic, message, Divider, Tooltip, Avatar, Empty
|
||||
} from 'antd';
|
||||
@@ -210,8 +210,8 @@ export default function AIDiagnosisPage() {
|
||||
].map((item, index) => (
|
||||
<Col key={index} xs={24} sm={12} md={8} xl={4}>
|
||||
<Card
|
||||
bordered={false}
|
||||
bodyStyle={{ padding: '20px 16px' }}
|
||||
variant="borderless"
|
||||
styles={{ body: { padding: '20px 16px' } }}
|
||||
style={{ ...cardStyle, height: '100%' }}
|
||||
>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start' }}>
|
||||
@@ -245,8 +245,8 @@ export default function AIDiagnosisPage() {
|
||||
<Card
|
||||
title={<span style={{ fontSize: 15, fontWeight: 700, color: '#1D2129' }}>{t('aiAnalysis.fixed2UavInspection')}<InfoCircleOutlined style={{ marginLeft: 6, color: '#86909C', fontSize: 13 }} /></span>}
|
||||
extra={<Text type="secondary" style={{ fontSize: 12 }}>{t('aiAnalysis.fixed2Inspection202505200930')}<CalendarOutlined style={{ marginLeft: 4 }} /></Text>}
|
||||
bordered={false}
|
||||
bodyStyle={{ padding: '16px 20px' }}
|
||||
variant="borderless"
|
||||
styles={{ body: { padding: '16px 20px' } }}
|
||||
style={{ ...cardStyle, height: '100%' }}
|
||||
>
|
||||
<Row gutter={[12, 12]}>
|
||||
@@ -288,8 +288,8 @@ export default function AIDiagnosisPage() {
|
||||
<span>{t('aiAnalysis.s9')}<b style={{ color: '#1D2129' }}>160</b></span>
|
||||
<span>{t('aiAnalysis.fixed2Abnormal')}<b style={{ color: '#F53F3F' }}>8</b></span>
|
||||
</Space>}
|
||||
bordered={false}
|
||||
bodyStyle={{ padding: '16px 20px' }}
|
||||
variant="borderless"
|
||||
styles={{ body: { padding: '16px 20px' } }}
|
||||
style={{ ...cardStyle, height: '100%' }}
|
||||
>
|
||||
<Row gutter={[20, 20]}>
|
||||
@@ -383,8 +383,8 @@ export default function AIDiagnosisPage() {
|
||||
<Col xs={24} lg={7}>
|
||||
<Card
|
||||
title={<span style={{ fontSize: 15, fontWeight: 700, color: '#1D2129' }}>{t('aiAnalysis.s13')}<InfoCircleOutlined style={{ marginLeft: 6, color: '#86909C', fontSize: 13 }} /></span>}
|
||||
bordered={false}
|
||||
bodyStyle={{ padding: '16px 20px' }}
|
||||
variant="borderless"
|
||||
styles={{ body: { padding: '16px 20px' } }}
|
||||
style={{ ...cardStyle, height: '100%' }}
|
||||
>
|
||||
<div style={{ fontSize: 12, color: '#86909C', marginBottom: 16, display: 'flex', justifyContent: 'space-between' }}>
|
||||
@@ -432,8 +432,8 @@ export default function AIDiagnosisPage() {
|
||||
<Col xs={24} lg={10}>
|
||||
<Card
|
||||
title={<span style={{ fontSize: 15, fontWeight: 700, color: '#1D2129' }}>{t('aiAnalysis.generation')}<InfoCircleOutlined style={{ marginLeft: 6, color: '#86909C', fontSize: 13 }} /></span>}
|
||||
bordered={false}
|
||||
bodyStyle={{ padding: '16px 20px' }}
|
||||
variant="borderless"
|
||||
styles={{ body: { padding: '16px 20px' } }}
|
||||
style={{ ...cardStyle, height: '100%' }}
|
||||
>
|
||||
<div style={{ display: 'flex', gap: 20 }}>
|
||||
@@ -487,8 +487,8 @@ export default function AIDiagnosisPage() {
|
||||
|
||||
<Col xs={24} lg={7}>
|
||||
<Card
|
||||
bordered={false}
|
||||
bodyStyle={{ padding: 0 }}
|
||||
variant="borderless"
|
||||
styles={{ body: { padding: 0 } }}
|
||||
style={{ ...cardStyle, height: '100%' }}
|
||||
>
|
||||
{/* AI诊断总结 */}
|
||||
@@ -498,6 +498,7 @@ export default function AIDiagnosisPage() {
|
||||
<span style={{ fontSize: 12, color: '#86909C' }}>{t('aiAnalysis.fixed2UpdatedAt202505200945')}</span>
|
||||
</div>
|
||||
<Table
|
||||
rowKey="key"
|
||||
columns={[
|
||||
{ title: t('aiAnalysis.s36'), dataIndex: 'diagnosis', width: 78 },
|
||||
{ title: t('roles.status'), dataIndex: 'status', render: renderStatusTag, },
|
||||
@@ -524,6 +525,7 @@ export default function AIDiagnosisPage() {
|
||||
<div style={{ padding: '12px 14px' }}>
|
||||
<div style={{ fontSize: 14, fontWeight: 700, color: '#1D2129', marginBottom: 10 }}>{t('aiAnalysis.fixed2Ai')}</div>
|
||||
<Table
|
||||
rowKey="key"
|
||||
columns={[
|
||||
{ title: t('aiAnalysis.s39'), dataIndex: 'measure', ellipsis: true },
|
||||
{ title: t('workOrder.priority'), dataIndex: 'priority', render: renderPriorityTag, width: 58 },
|
||||
@@ -564,8 +566,8 @@ export default function AIDiagnosisPage() {
|
||||
{/* 底部:数据来源 */}
|
||||
<Card
|
||||
title={<span style={{ fontSize: 15, fontWeight: 700, color: '#1D2129' }}>{t('aiAnalysis.sourceFixed2')}</span>}
|
||||
bordered={false}
|
||||
bodyStyle={{ padding: '16px 20px' }}
|
||||
variant="borderless"
|
||||
styles={{ body: { padding: '16px 20px' } }}
|
||||
style={cardStyle}
|
||||
>
|
||||
<Row gutter={[16, 16]}>
|
||||
|
||||
@@ -35,7 +35,6 @@ export default function AlarmCenterPage() {
|
||||
<div style={{ display: 'flex', paddingBottom: "4px" }}>
|
||||
<div style={{ padding: '8px 12px 0' }}>
|
||||
<Typography.Title level={4} style={{ margin: 0, fontSize: 'clamp(14px, 1.2vw, 18px)' }}>{t('router.alerts')}</Typography.Title>
|
||||
<Text type="secondary" style={{ fontSize: '12px' }}>{t('alerts.subtitle')}</Text>
|
||||
</div>
|
||||
|
||||
<Header style={{ padding: 0, borderBottom: '1px solid #f0f0f0', position: 'sticky', top: 0, zIndex: 10, height: 40, lineHeight: '40px' }}>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useState } from 'react';
|
||||
import React, { useState } from 'react';
|
||||
import {
|
||||
Row, Col, Card, Button, Table, Tag, Typography, Space, Statistic, DatePicker,
|
||||
Divider, Progress, Badge, Select, Tooltip, Avatar
|
||||
@@ -226,8 +226,8 @@ export default function CleanOptimizationPage() {
|
||||
].map((item, index) => (
|
||||
<Col key={index} style={{ minWidth: '168px', flex: '1 0 auto', maxWidth: "250px" }}>
|
||||
<Card
|
||||
bordered={false}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
variant="borderless"
|
||||
styles={{ body: { padding: '16px' } }}
|
||||
style={{ borderRadius: 8, height: 120 }}
|
||||
>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', height: '100%' }}>
|
||||
@@ -298,7 +298,7 @@ export default function CleanOptimizationPage() {
|
||||
<Row gutter={[8, 8]} style={{ display: 'flex', alignItems: 'stretch' }}>
|
||||
{/* 左侧:分析图表 */}
|
||||
<Col xs={24} xl={6} style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
|
||||
<Card title={<span style={{ fontSize: 14, fontWeight: 700 }}>{t('clean.s6')}</span>} bordered={false} style={cardStyle} bodyStyle={{ padding: 16 }}>
|
||||
<Card title={<span style={{ fontSize: 14, fontWeight: 700 }}>{t('clean.s6')}</span>} variant="borderless" style={cardStyle} styles={{ body: { padding: 16 } }}>
|
||||
<div style={{ fontSize: 12, color: '#86909C', marginBottom: 16, display: 'flex', justifyContent: 'space-between' }}>
|
||||
<span>{t('clean.s7')}</span>
|
||||
<Space size={12}>
|
||||
@@ -329,7 +329,7 @@ export default function CleanOptimizationPage() {
|
||||
/>
|
||||
</Card>
|
||||
|
||||
<Card title={<span style={{ fontSize: 14, fontWeight: 700 }}>{t('clean.fixed2Generation')}<Text type="secondary" style={{ fontWeight: 400, fontSize: 12 }}>{t('clean.near7Days')}</Text></span>} bordered={false} style={cardStyle} bodyStyle={{ padding: 16 }}>
|
||||
<Card title={<span style={{ fontSize: 14, fontWeight: 700 }}>{t('clean.fixed2Generation')}<Text type="secondary" style={{ fontWeight: 400, fontSize: 12 }}>{t('clean.near7Days')}</Text></span>} variant="borderless" style={cardStyle} styles={{ body: { padding: 16 } }}>
|
||||
<div style={{ position: 'relative', height: "100%" }}>
|
||||
<UniversalPieChart
|
||||
data={pieChartData}
|
||||
@@ -346,7 +346,7 @@ export default function CleanOptimizationPage() {
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
<Card title={<span style={{ fontSize: 14, fontWeight: 700 }}>{t('clean.fixed2Cleaning2')}<Text type="secondary" style={{ fontWeight: 400, fontSize: 12 }}>{t('clean.nearLast')}</Text></span>} bordered={false} style={cardStyle} bodyStyle={{ padding: 16 }}>
|
||||
<Card title={<span style={{ fontSize: 14, fontWeight: 700 }}>{t('clean.fixed2Cleaning2')}<Text type="secondary" style={{ fontWeight: 400, fontSize: 12 }}>{t('clean.nearLast')}</Text></span>} variant="borderless" style={cardStyle} styles={{ body: { padding: 16 } }}>
|
||||
<UniversalBarChart
|
||||
data={compareChartData}
|
||||
xKey="date"
|
||||
@@ -367,7 +367,7 @@ export default function CleanOptimizationPage() {
|
||||
/>
|
||||
</Card>
|
||||
|
||||
<Card title={<span style={{ fontSize: 14, fontWeight: 700 }}>{t('clean.fixed2CleaningFixed2')}</span>} bordered={false} style={cardStyle} bodyStyle={{ padding: 16 }}>
|
||||
<Card title={<span style={{ fontSize: 14, fontWeight: 700 }}>{t('clean.fixed2CleaningFixed2')}</span>} variant="borderless" style={cardStyle} styles={{ body: { padding: 16 } }}>
|
||||
<Row gutter={[16, 16]}>
|
||||
<Col span={12}>
|
||||
<div style={{ fontSize: 11, color: '#86909C', marginBottom: 4 }}>{t('clean.generation')}</div>
|
||||
@@ -398,9 +398,9 @@ export default function CleanOptimizationPage() {
|
||||
<Col xs={24} xl={11} style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
|
||||
<Card
|
||||
title={<span style={{ fontSize: 15, fontWeight: 700 }}>{t('clean.recommendedCleanBlock')}</span>}
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
style={{ ...cardStyle, }}
|
||||
bodyStyle={{ padding: 0, position: 'relative', overflow: 'hidden', minHeight: 500 }}
|
||||
styles={{ body: { padding: 0, position: 'relative', overflow: 'hidden', minHeight: 500 } }}
|
||||
>
|
||||
<div style={{ background: '#f8fafc', padding: '10px 20px', display: 'flex', justifyContent: 'space-between', borderBottom: '1px solid #f0f0f0', flexWrap: 'wrap', gap: 8 }}>
|
||||
<Space size={16} wrap style={{ fontSize: 11 }}>
|
||||
@@ -455,11 +455,12 @@ export default function CleanOptimizationPage() {
|
||||
<Card
|
||||
title={<span style={{ fontSize: 15, fontWeight: 700 }}>{t('clean.fixed2Cleaning2')}</span>}
|
||||
extra={<Button type="link" size="small">{t('devices.viewMore')}<ChevronRight size={14} /></Button>}
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
style={cardStyle}
|
||||
bodyStyle={{ padding: 0 }}
|
||||
styles={{ body: { padding: 0 } }}
|
||||
>
|
||||
<Table
|
||||
rowKey="area"
|
||||
columns={[
|
||||
{ title: t('clean.s45'), dataIndex: 'area', key: 'area' },
|
||||
{ title: t('workOrder.priority'), dataIndex: 'priority', key: 'priority', render: renderPriorityTag },
|
||||
@@ -479,11 +480,12 @@ export default function CleanOptimizationPage() {
|
||||
|
||||
{/* 右侧:决策建议与参考 */}
|
||||
<Col xs={24} xl={7} style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
|
||||
<Card title={<span style={{ fontSize: 14, fontWeight: 700 }}>{t('clean.cleaning2')}</span>} bordered={false} style={cardStyle} bodyStyle={{ padding: 0 }}>
|
||||
<Card title={<span style={{ fontSize: 14, fontWeight: 700 }}>{t('clean.cleaning2')}</span>} variant="borderless" style={cardStyle} styles={{ body: { padding: 0 } }}>
|
||||
<div style={{ background: '#f8fafc', padding: '8px 16px', borderBottom: '1px solid #f0f0f0' }}>
|
||||
<Text type="secondary" style={{ fontSize: 11 }}>{t('clean.algorithmModel')}</Text>
|
||||
</div>
|
||||
<Table
|
||||
rowKey="id"
|
||||
columns={[
|
||||
{ title: t('clean.s48'), dataIndex: 'id', key: 'id', width: 85 },
|
||||
{ title: t('workOrder.priority'), dataIndex: 'priority', key: 'priority', render: (p) => <span style={{ color: p === t('workOrder.high') ? '#F53F3F' : '#F7BA1E', fontWeight: 600 }}>{p}</span>, width: 65 },
|
||||
@@ -498,7 +500,7 @@ export default function CleanOptimizationPage() {
|
||||
/>
|
||||
</Card>
|
||||
|
||||
<Card title={<span style={{ fontSize: 14, fontWeight: 700 }}>{t('clean.fixed2Cleaning2')}</span>} bordered={false} style={cardStyle} bodyStyle={{ padding: 16 }}>
|
||||
<Card title={<span style={{ fontSize: 14, fontWeight: 700 }}>{t('clean.fixed2Cleaning2')}</span>} variant="borderless" style={cardStyle} styles={{ body: { padding: 16 } }}>
|
||||
<Row gutter={12}>
|
||||
<Col span={12}>
|
||||
<div style={{ background: '#F9F0FF', borderRadius: 12, padding: 16, border: '1px solid #D3ADF7', height: '100%' }}>
|
||||
@@ -529,7 +531,7 @@ export default function CleanOptimizationPage() {
|
||||
</Row>
|
||||
</Card>
|
||||
|
||||
<Card title={<span style={{ fontSize: 14, fontWeight: 700 }}>{t('clean.fixed2WeatherAdvice2')}<Text type="secondary" style={{ fontSize: 12, fontWeight: 400 }}>({t('clean.plan', { name: '01' })})</Text></span>} bordered={false} style={cardStyle} bodyStyle={{ padding: 16 }}>
|
||||
<Card title={<span style={{ fontSize: 14, fontWeight: 700 }}>{t('clean.fixed2WeatherAdvice2')}<Text type="secondary" style={{ fontSize: 12, fontWeight: 400 }}>({t('clean.plan', { name: '01' })})</Text></span>} variant="borderless" style={cardStyle} styles={{ body: { padding: 16 } }}>
|
||||
<Row gutter={12}>
|
||||
<Col span={8}>
|
||||
<div style={{ background: '#f8fafc', padding: '10px 4px', borderRadius: 8, textAlign: 'center', border: '1px solid #f0f0f0' }}>
|
||||
@@ -561,7 +563,7 @@ export default function CleanOptimizationPage() {
|
||||
</Row>
|
||||
</Card>
|
||||
|
||||
<Card title={<span style={{ fontSize: 14, fontWeight: 700 }}>{t('clean.fixed2Cleaning')}</span>} bordered={false} style={cardStyle} bodyStyle={{ padding: 16 }}>
|
||||
<Card title={<span style={{ fontSize: 14, fontWeight: 700 }}>{t('clean.fixed2Cleaning')}</span>} variant="borderless" style={cardStyle} styles={{ body: { padding: 16 } }}>
|
||||
<Row gutter={[16, 16]}>
|
||||
{[
|
||||
{ icon: <Droplets size={18} color="#165DFF" />, bg: '#E8F3FF', label: t('clean.s52'), value: t('clean.tonUnit', { value: '18' }), sub: t('clean.waterSaveWithRobot', { value: '30%' }), subColor: '#00B42A' },
|
||||
|
||||
@@ -254,7 +254,7 @@ export default function StationDashboard() {
|
||||
maxWidth: '240px',
|
||||
minWidth: '160px'
|
||||
}}>
|
||||
<Card bordered={false} style={{ ...cardStyle, height: "100%" }} bodyStyle={{ padding: '12px' }}>
|
||||
<Card variant="borderless" style={{ ...cardStyle, height: "100%" }} styles={{ body: { padding: '12px' } }}>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
||||
<div>
|
||||
<div style={{ color: '#000', fontSize: '13px', fontWeight: 600, marginBottom: 4 }}>{item.title}</div>
|
||||
@@ -282,7 +282,7 @@ export default function StationDashboard() {
|
||||
{/* 左侧图表 */}
|
||||
<Col xs={24} xl={6}>
|
||||
<Space direction="vertical" size={8} style={{ width: '100%' }}>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('home.generationTrend')}</span>} extra={<Space><SyncOutlined /><FullscreenOutlined /></Space>} bordered={false} style={cardStyle} bodyStyle={{ padding: '8px' }}>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('home.generationTrend')}</span>} extra={<Space><SyncOutlined /><FullscreenOutlined /></Space>} variant="borderless" style={cardStyle} styles={{ body: { padding: '8px' } }}>
|
||||
<div style={{ fontSize: 11, color: '#666', marginBottom: 8 }}>今日发电功率趋势 (kW)</div>
|
||||
<UniversalLineChart
|
||||
data={powerTrendData}
|
||||
@@ -297,7 +297,7 @@ export default function StationDashboard() {
|
||||
]}
|
||||
/>
|
||||
</Card>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('home.irradianceTempTrend')}</span>} bordered={false} style={cardStyle} bodyStyle={{ padding: '8px' }}>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('home.irradianceTempTrend')}</span>} variant="borderless" style={cardStyle} styles={{ body: { padding: '8px' } }}>
|
||||
<UniversalLineChart
|
||||
data={irradianceData}
|
||||
xKey="time"
|
||||
@@ -311,7 +311,7 @@ export default function StationDashboard() {
|
||||
]}
|
||||
/>
|
||||
</Card>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('home.inverterEfficiency')}</span>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('home.inverterEfficiency')}</span>} variant="borderless" style={cardStyle} styles={{ body: { padding: '12px' } }}>
|
||||
<UniversalBarChart
|
||||
data={invEfficiencyData}
|
||||
xKey="device"
|
||||
@@ -322,7 +322,7 @@ export default function StationDashboard() {
|
||||
series={[{ key: 'efficiency', name: '效率', color: '#165DFF' }]}
|
||||
/>
|
||||
</Card>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('home.maintenanceProgress')}</span>} extra={<Button type="link" size="small">{t('home.fixed2MoreGt')}</Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('home.maintenanceProgress')}</span>} extra={<Button type="link" size="small">{t('home.fixed2MoreGt')}</Button>} variant="borderless" style={cardStyle} styles={{ body: { padding: '12px' } }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||
<UniversalPieChart
|
||||
data={taskProgressData}
|
||||
@@ -358,9 +358,9 @@ export default function StationDashboard() {
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
style={cardStyle}
|
||||
bodyStyle={{ padding: 0, position: 'relative', overflow: 'hidden', height: 500 }}
|
||||
styles={{ body: { padding: 0, position: 'relative', overflow: 'hidden', height: 500 } }}
|
||||
>
|
||||
<div style={{ height: "100%", background: '#111827', borderRadius: 8, width: '100%', overflow: 'hidden', position: "relative" }}>
|
||||
{/*<iframe
|
||||
@@ -378,8 +378,9 @@ export default function StationDashboard() {
|
||||
|
||||
<Row gutter={16}>
|
||||
<Col span={12}>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('home.recentInspection')}</span>} extra={<Button type="link" size="small">{t('home.fixed2MoreGt')}</Button>} bordered={false} style={{ ...cardStyle, height: "100%" }} bodyStyle={{ padding: '0 12px' }}>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('home.recentInspection')}</span>} extra={<Button type="link" size="small">{t('home.fixed2MoreGt')}</Button>} variant="borderless" style={{ ...cardStyle, height: "100%" }} styles={{ body: { padding: '0 12px' } }}>
|
||||
<Table
|
||||
rowKey="name"
|
||||
dataSource={patrolRecords}
|
||||
pagination={false}
|
||||
size="small"
|
||||
@@ -393,7 +394,7 @@ export default function StationDashboard() {
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('home.aiAnalysisSummary')}</span>} bordered={false} style={{ ...cardStyle, height: "100%" }} bodyStyle={{ padding: '12px' }}>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('home.aiAnalysisSummary')}</span>} variant="borderless" style={{ ...cardStyle, height: "100%" }} styles={{ body: { padding: '12px' } }}>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
|
||||
@@ -441,7 +442,7 @@ export default function StationDashboard() {
|
||||
{/* 右侧 */}
|
||||
<Col xs={24} xl={6}>
|
||||
<Space direction="vertical" size={8} style={{ width: '100%' }}>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('alerts.realtimeAlert')}</span>} extra={<Button type="link" size="small" onClick={() => navigate('/alerts/all')}>{t('home.fixed2MoreGt')}</Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('alerts.realtimeAlert')}</span>} extra={<Button type="link" size="small" onClick={() => navigate('/alerts/all')}>{t('home.fixed2MoreGt')}</Button>} variant="borderless" style={cardStyle} styles={{ body: { padding: '12px' } }}>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 12, padding: '0 4px 8px', borderBottom: '1px solid #f0f0f0', fontSize: 13, color: '#666' }}>
|
||||
<span style={{ flex: 3 }}>{t('alerts.alarmContent')}</span>
|
||||
<span style={{ flex: 1, textAlign: 'center' }}>{t('alerts.level')}</span>
|
||||
@@ -465,13 +466,13 @@ export default function StationDashboard() {
|
||||
})}
|
||||
</Card>
|
||||
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('home.deviceOnlineStatus')}</span>} extra={<Button type="link" size="small">{t('home.fixed2MoreGt')}</Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('home.deviceOnlineStatus')}</span>} extra={<Button type="link" size="small">{t('home.fixed2MoreGt')}</Button>} variant="borderless" style={cardStyle} styles={{ body: { padding: '12px' } }}>
|
||||
<Row gutter={[16, 16]}>
|
||||
{[
|
||||
{ name: t('home.solarPanel'), count: '320/320', icon: <AppstoreOutlined /> },
|
||||
{ name: t('home.inverter'), count: '5/5', icon: <ThunderboltOutlined /> },
|
||||
{ name: t('home.combinerBox'), count: '20/20', icon: <BranchesOutlined /> },
|
||||
{ name: t('home.WeatherStation'), count: '1/1', icon: <CloudOutlined /> },
|
||||
{ name: t('home.weatherStation'), count: '1/1', icon: <CloudOutlined /> },
|
||||
{ name: t('devices.camera'), count: '12/12', icon: <VideoCameraOutlined /> },
|
||||
{ name: t('home.environmentalSensor'), count: '8/8', icon: <ExperimentOutlined /> },
|
||||
{ name: t('constants.uav'), count: '1/1', icon: <RocketOutlined /> },
|
||||
@@ -490,7 +491,7 @@ export default function StationDashboard() {
|
||||
</Row>
|
||||
</Card>
|
||||
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('home.weatherInfo')}</span>} extra={<Button type="link" size="small">{t('home.gt')}</Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('home.weatherInfo')}</span>} extra={<Button type="link" size="small">{t('home.gt')}</Button>} variant="borderless" style={cardStyle} styles={{ body: { padding: '12px' } }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'start', gap: 20 }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
|
||||
<WeatherDisplay type={weatherType} />
|
||||
@@ -510,7 +511,7 @@ export default function StationDashboard() {
|
||||
{/* ====================================== */}
|
||||
{/* 👇 清洗建议 + 生成工单按钮(已完善) */}
|
||||
{/* ====================================== */}
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('clean.cleaningSuggestion')}</span>} extra={<Button type="link" size="small">{t('home.fixed2MoreGt')}</Button>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('clean.cleaningSuggestion')}</span>} extra={<Button type="link" size="small">{t('home.fixed2MoreGt')}</Button>} variant="borderless" style={cardStyle} styles={{ body: { padding: '12px' } }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 16, marginBottom: 16 }}>
|
||||
<div style={{ width: 80, height: 80, position: 'relative' }}>
|
||||
<UniversalPieChart
|
||||
|
||||
@@ -146,7 +146,7 @@ const Profile: React.FC = () => {
|
||||
{/* 左侧信息卡片 */}
|
||||
<Col xs={24} sm={24} md={8} lg={7} xl={6}>
|
||||
<Card
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
style={{
|
||||
borderRadius: 12,
|
||||
boxShadow: '0 2px 12px rgba(0,0,0,0.06)',
|
||||
@@ -220,7 +220,7 @@ const Profile: React.FC = () => {
|
||||
{/* 右侧表单卡片 */}
|
||||
<Col xs={24} sm={24} md={16} lg={17} xl={18}>
|
||||
<Card
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
style={{
|
||||
borderRadius: 12,
|
||||
boxShadow: '0 2px 12px rgba(0,0,0,0.06)',
|
||||
|
||||
@@ -121,9 +121,9 @@ const RealTimeMonitorPage = () => {
|
||||
<span style={{ display: 'flex', alignItems: 'center' }}><span style={{ color: '#1890ff', marginLeft: 4 }}>{t('page.s2')}</span></span>
|
||||
</div>
|
||||
}
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
style={{ ...cardStyle, borderRadius: 8 }}
|
||||
bodyStyle={{ padding: 0, position: 'relative', height: 400, overflow: 'hidden' }}
|
||||
styles={{ body: { padding: 0, position: 'relative', height: 400, overflow: 'hidden' } }}
|
||||
>
|
||||
<div style={{ height: "100%", background: '#111827', borderRadius: 8, width: '100%', overflow: 'hidden', position: "relative" }}>
|
||||
{/*<iframe
|
||||
@@ -149,7 +149,7 @@ const RealTimeMonitorPage = () => {
|
||||
{/* 设备实时监控列表 */}
|
||||
<Card
|
||||
title={<span style={{ fontWeight: 800, fontSize: 13 }}>{t('page.fixed2DeviceFixed2RealtimeMonitorListFixed2')}</span>}
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
style={{ ...cardStyle, borderRadius: 8 }}
|
||||
extra={
|
||||
<Space size={8}>
|
||||
@@ -173,7 +173,7 @@ const RealTimeMonitorPage = () => {
|
||||
/>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginTop: 12, alignItems: 'center' }}>
|
||||
<span style={{ color: '#999', fontSize: 11 }}>{t('page.56')}</span>
|
||||
<Pagination size="small" total={56} current={1} pageSize={10} showSizeChanger />
|
||||
<Pagination size="small" total={56} defaultCurrent={1} defaultPageSize={10} showSizeChanger />
|
||||
</div>
|
||||
</Card>
|
||||
</Space>
|
||||
@@ -193,7 +193,7 @@ const RealTimeMonitorPage = () => {
|
||||
{ title: t('home.ambientTemperature'), value: '28.0', unit: '℃', sub: '较昨日 +1.2 ℃', color: '#165DFF', icon: <CloudOutlined /> },
|
||||
].map((item, idx) => (
|
||||
<Col span={8} key={idx}>
|
||||
<Card bordered={false} style={{ ...cardStyle, height: '100%', borderRadius: 8 }} bodyStyle={{ padding: '8px' }}>
|
||||
<Card variant="borderless" style={{ ...cardStyle, height: '100%', borderRadius: 8 }} styles={{ body: { padding: '8px' } }}>
|
||||
<div style={{ display: 'flex', alignItems: 'flex-start', gap: 6 }}>
|
||||
<div style={{ color: item.color, fontSize: 18 }}>{item.icon}</div>
|
||||
<div style={{ flex: 1, minWidth: 0 }}>
|
||||
@@ -211,7 +211,7 @@ const RealTimeMonitorPage = () => {
|
||||
</Row>
|
||||
|
||||
{/* 实时功率曲线 */}
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('page.powerCurveFixed2')}</span>} extra={<Select defaultValue="today" size="small"><Option value="today">{t('page.s11')}</Option></Select>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('page.powerCurveFixed2')}</span>} extra={<Select defaultValue="today" size="small"><Option value="today">{t('page.s11')}</Option></Select>} variant="borderless" style={cardStyle} styles={{ body: { padding: '12px' } }}>
|
||||
<UniversalLineChart
|
||||
height={180}
|
||||
data={powerTrendData}
|
||||
@@ -232,7 +232,7 @@ const RealTimeMonitorPage = () => {
|
||||
</Card>
|
||||
|
||||
{/* 逆变器功率对比 */}
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('page.inverterPowerCompare')}</span>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('page.inverterPowerCompare')}</span>} variant="borderless" style={cardStyle} styles={{ body: { padding: '12px' } }}>
|
||||
<UniversalBarChart
|
||||
height={180}
|
||||
data={inverterPowerData}
|
||||
@@ -253,7 +253,7 @@ const RealTimeMonitorPage = () => {
|
||||
{/* 热力图与在线率 */}
|
||||
<Row gutter={8}>
|
||||
<Col span={12}>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('page.stringCurrentHeatmap')}</span>} extra={<Select defaultValue="a" size="small" style={{ width: 60 }}><Option value="a">{t('page.s12')}</Option></Select>} bordered={false} style={cardStyle} bodyStyle={{ padding: '12px' }}>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('page.stringCurrentHeatmap')}</span>} extra={<Select defaultValue="a" size="small" style={{ width: 60 }}><Option value="a">{t('page.s12')}</Option></Select>} variant="borderless" style={cardStyle} styles={{ body: { padding: '12px' } }}>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 4 }}>
|
||||
{['INV-01', 'INV-02', 'INV-03', 'INV-04', 'INV-05'].map((name, i) => (
|
||||
<div key={i} style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
|
||||
@@ -292,7 +292,7 @@ const RealTimeMonitorPage = () => {
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('devices.deviceOnlineRate')}</span>} bordered={false} style={{ ...cardStyle, height: "100%" }} bodyStyle={{ padding: '12px' }}>
|
||||
<Card title={<span style={{ fontWeight: 800 }}>{t('devices.deviceOnlineRate')}</span>} variant="borderless" style={{ ...cardStyle, height: "100%" }} styles={{ body: { padding: '12px' } }}>
|
||||
<div style={{ position: 'relative', height: 160 }}>
|
||||
<UniversalPieChart
|
||||
height={160}
|
||||
|
||||
@@ -20,7 +20,6 @@ import dayjs from 'dayjs';
|
||||
import { ChevronRight } from 'lucide-react';
|
||||
import { UniversalBarChart, UniversalLineChart, UniversalPieChart } from '../components/recharts';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import MachineDataReport from '../components/reports/MachineDataReport';
|
||||
|
||||
const { TabPane } = Tabs;
|
||||
const { RangePicker } = DatePicker;
|
||||
@@ -208,409 +207,405 @@ export default function ReportCenterPage() {
|
||||
<TabPane tab={t('report.generationReport')} key="power" />
|
||||
<TabPane tab={t('report.operationReport')} key="operation" />
|
||||
<TabPane tab={t('report.alertReport')} key="alarm" />
|
||||
<TabPane tab={t('report.machineAnalysisReport')} key="ai" />
|
||||
<TabPane tab={t('report.aiAnalysisReport')} key="ai" />
|
||||
</Tabs>
|
||||
</div>
|
||||
|
||||
{activeTab === 'ai' ? (
|
||||
<MachineDataReport />
|
||||
) : (
|
||||
<>
|
||||
<Row
|
||||
gutter={[12, 12]}
|
||||
style={{
|
||||
marginBottom: 8,
|
||||
flexWrap: 'wrap',
|
||||
}}
|
||||
>
|
||||
{overviewCards.map((card, idx) => (
|
||||
<Col key={idx} style={{ minWidth: '180px', flex: '1 0 auto', }}>
|
||||
<Card
|
||||
bordered={false}
|
||||
bodyStyle={{ padding: '20px 20px', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}
|
||||
style={{ borderRadius: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.06)' }}
|
||||
>
|
||||
{/* 左侧文字区域 */}
|
||||
<div style={{ flex: 1, display: 'flex', flexDirection: 'column', alignItems: 'flex-start' }}>
|
||||
<div style={{ fontSize: 14, color: '#86909C', marginBottom: 8, fontWeight: 500 }}>
|
||||
{card.title}
|
||||
</div>
|
||||
<div style={{ fontSize: 28, fontWeight: 700, color: card.color, lineHeight: 1, marginBottom: 8 }}>
|
||||
{card.value}
|
||||
<span style={{ fontSize: 14, fontWeight: 500, marginLeft: 2, color: '#1D2129' }}>{card.unit}</span>
|
||||
</div>
|
||||
{/* 底部环比/备注 */}
|
||||
<div style={{ fontSize: 12, color: '#86909C', fontWeight: 500 }}>
|
||||
{card.trend}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 右侧圆形图标区域 */}
|
||||
|
||||
<div
|
||||
style={{
|
||||
width: 48,
|
||||
height: 48,
|
||||
borderRadius: '50%',
|
||||
backgroundColor: card.iconBg || '#f0f7ff',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
flexShrink: 0,
|
||||
marginLeft: 8
|
||||
}}
|
||||
>
|
||||
{card.icon}
|
||||
</div>
|
||||
<Row
|
||||
gutter={[12, 12]}
|
||||
style={{
|
||||
marginBottom: 8,
|
||||
flexWrap: 'wrap',
|
||||
}}
|
||||
>
|
||||
{overviewCards.map((card, idx) => (
|
||||
<Col key={idx} style={{ minWidth: '180px', flex: '1 0 auto', }}>
|
||||
<Card
|
||||
variant="borderless"
|
||||
styles={{ body: { padding: '20px 20px', display: 'flex', alignItems: 'center', justifyContent: 'space-between' } }}
|
||||
style={{ borderRadius: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.06)' }}
|
||||
>
|
||||
{/* 左侧文字区域 */}
|
||||
<div style={{ flex: 1, display: 'flex', flexDirection: 'column', alignItems: 'flex-start' }}>
|
||||
<div style={{ fontSize: 14, color: '#86909C', marginBottom: 8, fontWeight: 500 }}>
|
||||
{card.title}
|
||||
</div>
|
||||
<div style={{ fontSize: 28, fontWeight: 700, color: card.color, lineHeight: 1, marginBottom: 8 }}>
|
||||
{card.value}
|
||||
<span style={{ fontSize: 14, fontWeight: 500, marginLeft: 2, color: '#1D2129' }}>{card.unit}</span>
|
||||
</div>
|
||||
{/* 底部环比/备注 */}
|
||||
<div style={{ fontSize: 12, color: '#86909C', fontWeight: 500 }}>
|
||||
{card.trend}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</Card>
|
||||
{/* 右侧圆形图标区域 */}
|
||||
|
||||
<div
|
||||
style={{
|
||||
width: 48,
|
||||
height: 48,
|
||||
borderRadius: '50%',
|
||||
backgroundColor: card.iconBg || '#f0f7ff',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
flexShrink: 0,
|
||||
marginLeft: 8
|
||||
}}
|
||||
>
|
||||
{card.icon}
|
||||
</div>
|
||||
|
||||
</Card>
|
||||
</Col>
|
||||
))}
|
||||
</Row>
|
||||
|
||||
{/* 筛选栏 */}
|
||||
<div style={{ display: 'flex', alignItems: 'center', marginBottom: 8, gap: 20, flexWrap: 'wrap' }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||
<span className="filter-label">{t('report.reportCycle')}:</span>
|
||||
<Select value={reportCycle} onChange={setReportCycle} style={{ width: 100 }} size="small">
|
||||
<Option value="day">{t('report.daily')}</Option>
|
||||
<Option value="week">{t('report.weekly')}</Option>
|
||||
<Option value="month">{t('report.monthly')}</Option>
|
||||
</Select>
|
||||
</div>
|
||||
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||
<span className="filter-label">{t('report.reportType')}:</span>
|
||||
<Select value={reportType} onChange={setReportType} style={{ width: 120 }} size="small">
|
||||
<Option value="all">{t('common.all')}</Option>
|
||||
<Option value="power">{t('report.generationReport')}</Option>
|
||||
<Option value="operation">{t('report.operationReport')}</Option>
|
||||
<Option value="alarm">{t('report.alertReport')}</Option>
|
||||
<Option value="ai">{t('report.aiAnalysisReport')}</Option>
|
||||
</Select>
|
||||
</div>
|
||||
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||
<span className="filter-label">{t('report.dateRange')}:</span>
|
||||
<RangePicker
|
||||
value={dateRange}
|
||||
onChange={setDateRange}
|
||||
style={{ width: 260 }}
|
||||
size="small"
|
||||
/>
|
||||
</div>
|
||||
<div style={{ marginLeft: 'auto' }}>
|
||||
<Space size={12}>
|
||||
<Button type="primary" icon={<FileTextOutlined />} size="small" style={{ borderRadius: 6, height: 32, padding: '0 16px' }}>{t('report.generateReport')}</Button>
|
||||
<Button icon={<FilePdfOutlined />} size="small" style={{ borderRadius: 6, height: 32, color: '#F53F3F', borderColor: '#F53F3F' }}>{t('report.exportPdf')}</Button>
|
||||
<Button icon={<FileExcelOutlined />} size="small" style={{ borderRadius: 6, height: 32, color: '#00B42A', borderColor: '#00B42A' }}>{t('report.exportExcel')}</Button>
|
||||
</Space>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Row gutter={[8, 8]}>
|
||||
{/* 左侧主内容区 */}
|
||||
<Col xs={24} xl={16} >
|
||||
{/* 月度综合经营分析 */}
|
||||
<Card variant="borderless" style={cardStyle} styles={{ body: { padding: '20px' } }} title={<span style={{ fontSize: 15, fontWeight: 700, color: '#1D2129' }}>{t('report.monthlyOperationAnalysis')}</span>}>
|
||||
<Row gutter={24}>
|
||||
<Col span={17}>
|
||||
<div style={{ fontSize: 11, color: '#86909C', marginBottom: 16, display: 'flex', justifyContent: 'flex-start', gap: 20 }}>
|
||||
<Space size={4}><div style={{ width: 10, height: 3, background: '#00B42A' }}></div>{t('report.generation')} (MWh)</Space>
|
||||
<Space size={4}><div style={{ width: 10, height: 1, borderTop: '1.5px dashed #165DFF' }}></div>{t('report.predictedGeneration')} (MWh)</Space>
|
||||
<Space size={4}><div style={{ width: 10, height: 1, borderTop: '1.5px solid #FF7D00' }}></div>PR (%)</Space>
|
||||
</div>
|
||||
<UniversalLineChart
|
||||
data={monthlyPowerData}
|
||||
xKey="date"
|
||||
height={260}
|
||||
series={[
|
||||
{
|
||||
key: 'generation',
|
||||
name: t('report.generation') + '(MWh)',
|
||||
color: '#52c41a',
|
||||
},
|
||||
{
|
||||
key: 'predicted',
|
||||
name: t('report.predictedGeneration') + '(MWh)',
|
||||
color: '#1890ff',
|
||||
dashed: true,
|
||||
},
|
||||
{
|
||||
key: 'pr',
|
||||
name: 'PR(%)',
|
||||
color: '#fa8c16',
|
||||
strokeWidth: 2,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
))}
|
||||
</Row>
|
||||
|
||||
{/* 筛选栏 */}
|
||||
<div style={{ display: 'flex', alignItems: 'center', marginBottom: 8, gap: 20, flexWrap: 'wrap' }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||
<span className="filter-label">{t('report.reportCycle')}:</span>
|
||||
<Select value={reportCycle} onChange={setReportCycle} style={{ width: 100 }} size="small">
|
||||
<Option value="day">{t('report.daily')}</Option>
|
||||
<Option value="week">{t('report.weekly')}</Option>
|
||||
<Option value="month">{t('report.monthly')}</Option>
|
||||
</Select>
|
||||
</div>
|
||||
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||
<span className="filter-label">{t('report.reportType')}:</span>
|
||||
<Select value={reportType} onChange={setReportType} style={{ width: 120 }} size="small">
|
||||
<Option value="all">{t('common.all')}</Option>
|
||||
<Option value="power">{t('report.generationReport')}</Option>
|
||||
<Option value="operation">{t('report.operationReport')}</Option>
|
||||
<Option value="alarm">{t('report.alertReport')}</Option>
|
||||
<Option value="ai">{t('report.machineAnalysisReport')}</Option>
|
||||
</Select>
|
||||
</div>
|
||||
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||
<span className="filter-label">{t('report.dateRange')}:</span>
|
||||
<RangePicker
|
||||
value={dateRange}
|
||||
onChange={setDateRange}
|
||||
style={{ width: 260 }}
|
||||
size="small"
|
||||
/>
|
||||
</div>
|
||||
<div style={{ marginLeft: 'auto' }}>
|
||||
<Space size={12}>
|
||||
<Button type="primary" icon={<FileTextOutlined />} size="small" style={{ borderRadius: 6, height: 32, padding: '0 16px' }}>{t('report.generateReport')}</Button>
|
||||
<Button icon={<FilePdfOutlined />} size="small" style={{ borderRadius: 6, height: 32, color: '#F53F3F', borderColor: '#F53F3F' }}>{t('report.exportPdf')}</Button>
|
||||
<Button icon={<FileExcelOutlined />} size="small" style={{ borderRadius: 6, height: 32, color: '#00B42A', borderColor: '#00B42A' }}>{t('report.exportExcel')}</Button>
|
||||
</Space>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Row gutter={[8, 8]}>
|
||||
{/* 左侧主内容区 */}
|
||||
<Col xs={24} xl={16} >
|
||||
{/* 月度综合经营分析 */}
|
||||
<Card bordered={false} style={cardStyle} bodyStyle={{ padding: '20px' }} title={<span style={{ fontSize: 15, fontWeight: 700, color: '#1D2129' }}>{t('report.monthlyOperationAnalysis')}</span>}>
|
||||
<Row gutter={24}>
|
||||
<Col span={17}>
|
||||
<div style={{ fontSize: 11, color: '#86909C', marginBottom: 16, display: 'flex', justifyContent: 'flex-start', gap: 20 }}>
|
||||
<Space size={4}><div style={{ width: 10, height: 3, background: '#00B42A' }}></div>{t('report.generation')} (MWh)</Space>
|
||||
<Space size={4}><div style={{ width: 10, height: 1, borderTop: '1.5px dashed #165DFF' }}></div>{t('report.predictedGeneration')} (MWh)</Space>
|
||||
<Space size={4}><div style={{ width: 10, height: 1, borderTop: '1.5px solid #FF7D00' }}></div>PR (%)</Space>
|
||||
</div>
|
||||
<UniversalLineChart
|
||||
data={monthlyPowerData}
|
||||
xKey="date"
|
||||
height={260}
|
||||
series={[
|
||||
{
|
||||
key: 'generation',
|
||||
name: t('report.generation') + '(MWh)',
|
||||
color: '#52c41a',
|
||||
},
|
||||
{
|
||||
key: 'predicted',
|
||||
name: t('report.predictedGeneration') + '(MWh)',
|
||||
color: '#1890ff',
|
||||
dashed: true,
|
||||
},
|
||||
{
|
||||
key: 'pr',
|
||||
name: 'PR(%)',
|
||||
color: '#fa8c16',
|
||||
strokeWidth: 2,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={7}>
|
||||
<div style={{ background: '#f8fafc', padding: '16px', borderRadius: 12, height: '100%' }}>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
|
||||
{[
|
||||
{ label: t('report.monthlyAccumulatedGeneration'), value: '138.6', unit: 'MWh' },
|
||||
{ label: t('report.theoreticalGeneration'), value: '166.8', unit: 'MWh' },
|
||||
{ label: t('report.prAverage'), value: '82.8', unit: '%' },
|
||||
{ label: t('report.generationDeviation'), value: '-3.4', unit: '%', color: '#F53F3F' },
|
||||
{ label: t('report.averageIrradiance'), value: '5.3', unit: t('report.unitIrradiancePerDay') },
|
||||
].map((item, idx) => (
|
||||
<div key={idx} style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
||||
<span style={{ fontSize: 12, color: '#4E5969' }}>{item.label}</span>
|
||||
<span style={{ fontSize: 14, fontWeight: 700, color: item.color || '#1D2129' }}>{item.value} <span style={{ fontSize: 10, fontWeight: 400, color: '#86909C' }}>{item.unit}</span></span>
|
||||
</div>
|
||||
))}
|
||||
<Col span={7}>
|
||||
<div style={{ background: '#f8fafc', padding: '16px', borderRadius: 12, height: '100%' }}>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
|
||||
{[
|
||||
{ label: t('report.monthlyAccumulatedGeneration'), value: '138.6', unit: 'MWh' },
|
||||
{ label: t('report.theoreticalGeneration'), value: '166.8', unit: 'MWh' },
|
||||
{ label: t('report.prAverage'), value: '82.8', unit: '%' },
|
||||
{ label: t('report.generationDeviation'), value: '-3.4', unit: '%', color: '#F53F3F' },
|
||||
{ label: t('report.averageIrradiance'), value: '5.3', unit: t('report.unitIrradiancePerDay') },
|
||||
].map((item, idx) => (
|
||||
<div key={idx} style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
||||
<span style={{ fontSize: 12, color: '#4E5969' }}>{item.label}</span>
|
||||
<span style={{ fontSize: 14, fontWeight: 700, color: item.color || '#1D2129' }}>{item.value} <span style={{ fontSize: 10, fontWeight: 400, color: '#86909C' }}>{item.unit}</span></span>
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
</Card>
|
||||
|
||||
{/* 第二排:三个图表 */}
|
||||
<Row gutter={[8, 8]} style={{ marginTop: 8 }}>
|
||||
<Col span={8}>
|
||||
<Card
|
||||
variant="borderless"
|
||||
style={{ ...cardStyle, height: "100%" }}
|
||||
styles={{ body: { padding: '16px' } }}
|
||||
title={<span style={{ fontSize: 14, fontWeight: 700 }}>{t('report.generationMeteorology')}</span>}
|
||||
>
|
||||
<div style={{ fontSize: 10, color: '#86909C', marginBottom: 12 }}>
|
||||
<Space size={8} wrap>
|
||||
<Badge color="#165DFF" text={`${t('report.generation')} (MWh)`} style={{ fontSize: 10 }} />
|
||||
<Badge color="#00B42A" text={`${t('home.irradiance')} (kWh/㎡)`} style={{ fontSize: 10 }} />
|
||||
<Badge color="#FF7D00" text={`${t('home.temperature')} (℃)`} style={{ fontSize: 10 }} />
|
||||
</Space>
|
||||
</div>
|
||||
<UniversalBarChart
|
||||
data={powerMeteorologyData}
|
||||
xKey="date"
|
||||
height={200}
|
||||
series={[
|
||||
{ key: 'generation', name: t('report.generation'), color: '#1890ff' },
|
||||
{ key: 'irradiance', name: t('home.irradiance'), color: '#52c41a' },
|
||||
{ key: 'temp', name: t('home.temperature'), color: '#fa8c16' },
|
||||
]}
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
|
||||
{/* 第二排:三个图表 */}
|
||||
<Row gutter={[8, 8]} style={{ marginTop: 8 }}>
|
||||
<Col span={8}>
|
||||
<Card
|
||||
bordered={false}
|
||||
style={{ ...cardStyle, height: "100%" }}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
title={<span style={{ fontSize: 14, fontWeight: 700 }}>{t('report.generationMeteorology')}</span>}
|
||||
>
|
||||
<div style={{ fontSize: 10, color: '#86909C', marginBottom: 12 }}>
|
||||
<Space size={8} wrap>
|
||||
<Badge color="#165DFF" text={`${t('report.generation')} (MWh)`} style={{ fontSize: 10 }} />
|
||||
<Badge color="#00B42A" text={`${t('home.irradiance')} (kWh/㎡)`} style={{ fontSize: 10 }} />
|
||||
<Badge color="#FF7D00" text={`${t('home.temperature')} (℃)`} style={{ fontSize: 10 }} />
|
||||
</Space>
|
||||
</div>
|
||||
<UniversalBarChart
|
||||
data={powerMeteorologyData}
|
||||
xKey="date"
|
||||
height={200}
|
||||
series={[
|
||||
{ key: 'generation', name: t('report.generation'), color: '#1890ff' },
|
||||
{ key: 'irradiance', name: t('home.irradiance'), color: '#52c41a' },
|
||||
{ key: 'temp', name: t('home.temperature'), color: '#fa8c16' },
|
||||
]}
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Card
|
||||
variant="borderless"
|
||||
style={{ ...cardStyle, height: "100%" }}
|
||||
styles={{ body: { padding: '16px' } }}
|
||||
title={<span style={{ fontSize: 14, fontWeight: 700 }}>{t('report.workOrderAlertClosure')}</span>}
|
||||
>
|
||||
<div style={{ fontSize: 10, color: '#86909C', marginBottom: 12 }}>
|
||||
<Space size={8} wrap>
|
||||
<Badge color="#165DFF" text={t('workOrder.newOrders')} style={{ fontSize: 10 }} />
|
||||
<Badge color="#00B42A" text={t('workOrder.completeOrder')} style={{ fontSize: 10 }} />
|
||||
<Badge color="#722ED1" text={`${t('report.closureRate')} (%)`} style={{ fontSize: 10 }} />
|
||||
</Space>
|
||||
</div>
|
||||
<UniversalBarChart
|
||||
data={orderAlarmData}
|
||||
xKey="date"
|
||||
height={200}
|
||||
series={[
|
||||
{ key: 'newOrder', name: t('workOrder.newOrders'), color: '#1890ff' },
|
||||
{ key: 'completed', name: t('workOrder.completeOrder'), color: '#52c41a' },
|
||||
{ key: 'alarmCount', name: t('report.alarmCount'), color: '#fa8c16' },
|
||||
{ key: 'closedRate', name: t('report.closureRate'), color: '#722ed1' },
|
||||
]}
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
|
||||
<Col span={8}>
|
||||
<Card
|
||||
bordered={false}
|
||||
style={{ ...cardStyle, height: "100%" }}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
title={<span style={{ fontSize: 14, fontWeight: 700 }}>{t('report.workOrderAlertClosure')}</span>}
|
||||
>
|
||||
<div style={{ fontSize: 10, color: '#86909C', marginBottom: 12 }}>
|
||||
<Space size={8} wrap>
|
||||
<Badge color="#165DFF" text={t('workOrder.newOrders')} style={{ fontSize: 10 }} />
|
||||
<Badge color="#00B42A" text={t('workOrder.completeOrder')} style={{ fontSize: 10 }} />
|
||||
<Badge color="#722ED1" text={`${t('report.closureRate')} (%)`} style={{ fontSize: 10 }} />
|
||||
</Space>
|
||||
</div>
|
||||
<UniversalBarChart
|
||||
data={orderAlarmData}
|
||||
xKey="date"
|
||||
height={200}
|
||||
series={[
|
||||
{ key: 'newOrder', name: t('workOrder.newOrders'), color: '#1890ff' },
|
||||
{ key: 'completed', name: t('workOrder.completeOrder'), color: '#52c41a' },
|
||||
{ key: 'alarmCount', name: t('report.alarmCount'), color: '#fa8c16' },
|
||||
{ key: 'closedRate', name: t('report.closureRate'), color: '#722ed1' },
|
||||
]}
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Card
|
||||
variant="borderless"
|
||||
style={{ ...cardStyle, height: "100%" }}
|
||||
styles={{ body: { padding: '16px' } }}
|
||||
title={<span style={{ fontSize: 14, fontWeight: 700 }}>{t('report.aiAnalysisStatistics')}</span>}
|
||||
>
|
||||
<div style={{ width: '100%', boxSizing: 'border-box' }}>
|
||||
<UniversalPieChart
|
||||
data={aiPieData}
|
||||
width={220}
|
||||
height={220}
|
||||
innerRadius={40}
|
||||
outerRadius={65}
|
||||
style={{ padding: 0 }}
|
||||
/>
|
||||
|
||||
<Col span={8}>
|
||||
<Card
|
||||
bordered={false}
|
||||
style={{ ...cardStyle, height: "100%" }}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
title={<span style={{ fontSize: 14, fontWeight: 700 }}>{t('report.aiAnalysisStatistics')}</span>}
|
||||
>
|
||||
<div style={{ width: '100%', boxSizing: 'border-box' }}>
|
||||
<UniversalPieChart
|
||||
data={aiPieData}
|
||||
width={220}
|
||||
height={220}
|
||||
innerRadius={40}
|
||||
outerRadius={65}
|
||||
style={{ padding: 0 }}
|
||||
/>
|
||||
|
||||
<div style={{
|
||||
<div style={{
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
gap: 10,
|
||||
paddingLeft: 8,
|
||||
width: '100%',
|
||||
boxSizing: 'border-box'
|
||||
}}>
|
||||
{aiAnalysisData.map((item, idx) => (
|
||||
<div key={idx} style={{
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
gap: 10,
|
||||
paddingLeft: 8,
|
||||
justifyContent: 'space-between',
|
||||
alignItems: 'center',
|
||||
width: '100%',
|
||||
boxSizing: 'border-box'
|
||||
flexWrap: 'wrap',
|
||||
wordBreak: 'break-all',
|
||||
whiteSpace: 'normal'
|
||||
}}>
|
||||
{aiAnalysisData.map((item, idx) => (
|
||||
<div key={idx} style={{
|
||||
display: 'flex',
|
||||
justifyContent: 'space-between',
|
||||
alignItems: 'center',
|
||||
width: '100%',
|
||||
flexWrap: 'wrap',
|
||||
wordBreak: 'break-all',
|
||||
whiteSpace: 'normal'
|
||||
}}>
|
||||
<Space size={6} style={{
|
||||
fontSize: 11,
|
||||
color: '#4E5969',
|
||||
flex: 1,
|
||||
minWidth: '60%',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
flexWrap: 'wrap'
|
||||
}}>
|
||||
<div style={{ width: 6, height: 6, borderRadius: '50%', background: item.color, flexShrink: 0 }}></div>
|
||||
<span style={{ wordBreak: 'break-all', whiteSpace: 'normal' }}>{item.type}</span>
|
||||
</Space>
|
||||
<span style={{
|
||||
fontSize: 12,
|
||||
fontWeight: 700,
|
||||
whiteSpace: 'nowrap',
|
||||
flexShrink: 0
|
||||
}}>
|
||||
{item.value} <Text type="secondary" style={{ fontSize: 10, fontWeight: 400 }}>{t('report.unitItem')}</Text>
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
{/* 订阅与分发 */}
|
||||
<Card bordered={false} style={{ ...cardStyle, marginTop: 8 }} bodyStyle={{ padding: '20px' }} title={<span style={{ fontSize: 15, fontWeight: 700, color: '#1D2129' }}>{t('report.subscriptionDispatch')}</span>}>
|
||||
<Row gutter={[16, 16]} wrap>
|
||||
<Col xs={24} sm={12} md={8}>
|
||||
<div style={{ fontSize: 12, color: '#86909C', marginBottom: 12 }}>{t('report.subscribers', { count: 6 })}</div>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 8, flexWrap: 'wrap' }}>
|
||||
{[
|
||||
{ name: '张运维', role: t('report.roleOmSupervisor'), img: 'https://img.icons8.com/fluency/48/user-male-circle.png' },
|
||||
{ name: '李工程师', role: t('report.roleStationEngineer'), img: 'https://img.icons8.com/fluency/48/user-male-circle.png' },
|
||||
{ name: '王运维', role: t('report.roleDeviceOm'), img: 'https://img.icons8.com/fluency/48/user-male-circle.png' },
|
||||
{ name: '陈经理', role: t('report.roleOmManager'), img: 'https://img.icons8.com/fluency/48/user-male-circle.png' },
|
||||
].map((p, idx) => (
|
||||
<Tooltip title={`${p.name} - ${p.role}`} key={idx}>
|
||||
<Avatar src={p.img} size={32} style={{ border: '2px solid #fff' }} />
|
||||
</Tooltip>
|
||||
))}
|
||||
<Avatar size={32} style={{ background: '#F2F3F5', color: '#165DFF', fontSize: 12, fontWeight: 700, border: '2px solid #fff' }}>+2</Avatar>
|
||||
</div>
|
||||
</Col>
|
||||
|
||||
<Col xs={24} sm={12} md={8}>
|
||||
<div style={{ fontSize: 12, color: '#86909C', marginBottom: 12 }}>{t('report.dispatchChannels')}</div>
|
||||
<Space size={12} wrap>
|
||||
<Button size="small" icon={<MailOutlined />} style={{ borderRadius: 6, background: '#E8F3FF', border: 'none', color: '#165DFF' }}>{t('report.email')} <CheckCircleFilled style={{ fontSize: 10, marginLeft: 4 }} /></Button>
|
||||
<Button size="small" style={{ borderRadius: 6, background: '#E8F3FF', border: 'none', color: '#165DFF' }}>Telegram <CheckCircleFilled style={{ fontSize: 10, marginLeft: 4 }} /></Button>
|
||||
<Button size="small" icon={<BellOutlined />} style={{ borderRadius: 6, background: '#E8F3FF', border: 'none', color: '#165DFF' }}>{t('report.systemNotification')} <CheckCircleFilled style={{ fontSize: 10, marginLeft: 4 }} /></Button>
|
||||
</Space>
|
||||
</Col>
|
||||
|
||||
<Col xs={24} sm={24} md={8}>
|
||||
<div style={{ fontSize: 12, color: '#86909C', marginBottom: 12 }}>{t('report.sendPlan')}</div>
|
||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', background: '#f8fafc', padding: '8px 12px', borderRadius: 8, gap: 8 }}>
|
||||
<Space size={8} wrap>
|
||||
<CalendarOutlined style={{ color: '#165DFF' }} />
|
||||
<span style={{ fontSize: 13, fontWeight: 700 }}>{t('report.weeklyAutoSend')}</span>
|
||||
</Space>
|
||||
<Button type="link" size="small" icon={<EditOutlined />} style={{ fontSize: 12, whiteSpace: 'nowrap' }}>{t('roles.edit')}</Button>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
</Card>
|
||||
</Col>
|
||||
|
||||
{/* 右侧边栏 */}
|
||||
<Col xs={24} xl={8}>
|
||||
{/* 报表目录 / 快捷下载 */}
|
||||
<Card bordered={false} style={cardStyle} bodyStyle={{ padding: 0 }} title={<span style={{ fontSize: 15, fontWeight: 700 }}>{t('report.reportDirectory')}</span>} extra={<Button type="link" size="small">{t('common.more')} <ChevronRight size={14} /></Button>}>
|
||||
<Table
|
||||
rowKey="name"
|
||||
columns={[
|
||||
{
|
||||
title: t('report.reportName'), dataIndex: 'name',
|
||||
render: (text) => <Space size={8}><FilePdfOutlined style={{ color: '#F53F3F' }} />{text}</Space>
|
||||
},
|
||||
{
|
||||
title: t('roles.status'), dataIndex: 'status', width: 80,
|
||||
render: (v) => <Tag color={v === t('report.generated') ? 'success' : 'warning'} style={{ borderRadius: 4, fontSize: 10, margin: 0 }}>{v}</Tag>
|
||||
},
|
||||
{
|
||||
title: t('roles.actions'), width: 120,
|
||||
render: () => (
|
||||
<Space split={<Divider type="vertical" />}>
|
||||
<Button type="link" size="small" icon={<EyeOutlined />} style={{ fontSize: 12, padding: 0 }}>{t('common.view')}</Button>
|
||||
<Button type="link" size="small" icon={<DownloadOutlined />} style={{ fontSize: 12, padding: 0 }}>{t('common.download')}</Button>
|
||||
<Space size={6} style={{
|
||||
fontSize: 11,
|
||||
color: '#4E5969',
|
||||
flex: 1,
|
||||
minWidth: '60%',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
flexWrap: 'wrap'
|
||||
}}>
|
||||
<div style={{ width: 6, height: 6, borderRadius: '50%', background: item.color, flexShrink: 0 }}></div>
|
||||
<span style={{ wordBreak: 'break-all', whiteSpace: 'normal' }}>{item.type}</span>
|
||||
</Space>
|
||||
)
|
||||
}
|
||||
]}
|
||||
dataSource={reportFileList}
|
||||
pagination={false}
|
||||
size="small"
|
||||
className="compact-table"
|
||||
/>
|
||||
</Card>
|
||||
|
||||
{/* 模板中心 */}
|
||||
<Card bordered={false} style={{ ...cardStyle, marginTop: 8 }} bodyStyle={{ padding: '16px' }} title={<span style={{ fontSize: 15, fontWeight: 700 }}>{t('report.templateCenter')}</span>} extra={<Button type="link" size="small">{t('common.more')} <ChevronRight size={14} /></Button>}>
|
||||
<Row gutter={[12, 12]}>
|
||||
{reportTemplates.map((tpl, idx) => (
|
||||
<Col span={12} key={idx}>
|
||||
<div style={{ background: '#f8fafc', padding: '12px', borderRadius: 10, height: '100%', border: '1px solid #f0f0f0' }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 10, marginBottom: 8 }}>
|
||||
<div style={{ width: 32, height: 32, borderRadius: 8, background: tpl.bg, color: tpl.color, display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: 16 }}>
|
||||
{tpl.icon}
|
||||
</div>
|
||||
<div style={{ fontSize: 13, fontWeight: 700, color: '#1D2129' }}>{tpl.name}</div>
|
||||
</div>
|
||||
<div style={{ fontSize: 11, color: '#86909C', lineHeight: 1.4 }}>{tpl.desc}</div>
|
||||
<span style={{
|
||||
fontSize: 12,
|
||||
fontWeight: 700,
|
||||
whiteSpace: 'nowrap',
|
||||
flexShrink: 0
|
||||
}}>
|
||||
{item.value} <Text type="secondary" style={{ fontSize: 10, fontWeight: 400 }}>{t('report.unitItem')}</Text>
|
||||
</span>
|
||||
</div>
|
||||
</Col>
|
||||
))}
|
||||
</Row>
|
||||
</Card>
|
||||
|
||||
{/* 报表生成记录 */}
|
||||
<Card bordered={false} style={{ ...cardStyle, marginTop: 8 }} bodyStyle={{ padding: 0 }} title={<span style={{ fontSize: 15, fontWeight: 700 }}>{t('report.generationRecords')}</span>} extra={<Button type="link" size="small">{t('common.more')} <ChevronRight size={14} /></Button>}>
|
||||
<Table
|
||||
rowKey="name"
|
||||
columns={[
|
||||
{ title: t('report.reportName'), dataIndex: 'name', width: 100, ellipsis: true },
|
||||
{ title: t('report.generateTime'), dataIndex: 'time', width: 130 },
|
||||
{ title: t('report.generator'), dataIndex: 'operator', width: 80 },
|
||||
{ title: t('common.type'), dataIndex: 'type', width: 80 },
|
||||
{
|
||||
title: t('roles.status'), dataIndex: 'status', width: 70,
|
||||
render: (v) => <Tag color={v === t('report.generated') ? 'success' : 'warning'} style={{ borderRadius: 4, fontSize: 10, margin: 0 }}>{v}</Tag>
|
||||
},
|
||||
{
|
||||
title: t('roles.actions'), width: 90,
|
||||
render: () => (
|
||||
<Space size={8}>
|
||||
<Button type="text" icon={<EyeOutlined />} size="small" />
|
||||
<Button type="text" icon={<DownloadOutlined />} size="small" />
|
||||
</Space>
|
||||
)
|
||||
}
|
||||
]}
|
||||
dataSource={generationRecord}
|
||||
pagination={false}
|
||||
size="small"
|
||||
className="compact-table"
|
||||
scroll={{ y: 240 }}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
</>
|
||||
)}
|
||||
{/* 订阅与分发 */}
|
||||
<Card variant="borderless" style={{ ...cardStyle, marginTop: 8 }} styles={{ body: { padding: '20px' } }} title={<span style={{ fontSize: 15, fontWeight: 700, color: '#1D2129' }}>{t('report.subscriptionDispatch')}</span>}>
|
||||
<Row gutter={[16, 16]} wrap>
|
||||
<Col xs={24} sm={12} md={8}>
|
||||
<div style={{ fontSize: 12, color: '#86909C', marginBottom: 12 }}>{t('report.subscribers', { count: 6 })}</div>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 8, flexWrap: 'wrap' }}>
|
||||
{[
|
||||
{ name: '张运维', role: t('report.roleOmSupervisor'), img: 'https://img.icons8.com/fluency/48/user-male-circle.png' },
|
||||
{ name: '李工程师', role: t('report.roleStationEngineer'), img: 'https://img.icons8.com/fluency/48/user-male-circle.png' },
|
||||
{ name: '王运维', role: t('report.roleDeviceOm'), img: 'https://img.icons8.com/fluency/48/user-male-circle.png' },
|
||||
{ name: '陈经理', role: t('report.roleOmManager'), img: 'https://img.icons8.com/fluency/48/user-male-circle.png' },
|
||||
].map((p, idx) => (
|
||||
<Tooltip title={`${p.name} - ${p.role}`} key={idx}>
|
||||
<Avatar src={p.img} size={32} style={{ border: '2px solid #fff' }} />
|
||||
</Tooltip>
|
||||
))}
|
||||
<Avatar size={32} style={{ background: '#F2F3F5', color: '#165DFF', fontSize: 12, fontWeight: 700, border: '2px solid #fff' }}>+2</Avatar>
|
||||
</div>
|
||||
</Col>
|
||||
|
||||
<Col xs={24} sm={12} md={8}>
|
||||
<div style={{ fontSize: 12, color: '#86909C', marginBottom: 12 }}>{t('report.dispatchChannels')}</div>
|
||||
<Space size={12} wrap>
|
||||
<Button size="small" icon={<MailOutlined />} style={{ borderRadius: 6, background: '#E8F3FF', border: 'none', color: '#165DFF' }}>{t('report.email')} <CheckCircleFilled style={{ fontSize: 10, marginLeft: 4 }} /></Button>
|
||||
<Button size="small" style={{ borderRadius: 6, background: '#E8F3FF', border: 'none', color: '#165DFF' }}>Telegram <CheckCircleFilled style={{ fontSize: 10, marginLeft: 4 }} /></Button>
|
||||
<Button size="small" icon={<BellOutlined />} style={{ borderRadius: 6, background: '#E8F3FF', border: 'none', color: '#165DFF' }}>{t('report.systemNotification')} <CheckCircleFilled style={{ fontSize: 10, marginLeft: 4 }} /></Button>
|
||||
</Space>
|
||||
</Col>
|
||||
|
||||
<Col xs={24} sm={24} md={8}>
|
||||
<div style={{ fontSize: 12, color: '#86909C', marginBottom: 12 }}>{t('report.sendPlan')}</div>
|
||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', background: '#f8fafc', padding: '8px 12px', borderRadius: 8, gap: 8 }}>
|
||||
<Space size={8} wrap>
|
||||
<CalendarOutlined style={{ color: '#165DFF' }} />
|
||||
<span style={{ fontSize: 13, fontWeight: 700 }}>{t('report.weeklyAutoSend')}</span>
|
||||
</Space>
|
||||
<Button type="link" size="small" icon={<EditOutlined />} style={{ fontSize: 12, whiteSpace: 'nowrap' }}>{t('roles.edit')}</Button>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
</Card>
|
||||
</Col>
|
||||
|
||||
{/* 右侧边栏 */}
|
||||
<Col xs={24} xl={8}>
|
||||
{/* 报表目录 / 快捷下载 */}
|
||||
<Card variant="borderless" style={cardStyle} styles={{ body: { padding: 0 } }} title={<span style={{ fontSize: 15, fontWeight: 700 }}>{t('report.reportDirectory')}</span>} extra={<Button type="link" size="small">{t('common.more')} <ChevronRight size={14} /></Button>}>
|
||||
<Table
|
||||
rowKey="name"
|
||||
columns={[
|
||||
{
|
||||
title: t('report.reportName'), dataIndex: 'name',
|
||||
render: (text) => <Space size={8}><FilePdfOutlined style={{ color: '#F53F3F' }} />{text}</Space>
|
||||
},
|
||||
{
|
||||
title: t('roles.status'), dataIndex: 'status', width: 80,
|
||||
render: (v) => <Tag color={v === t('report.generated') ? 'success' : 'warning'} style={{ borderRadius: 4, fontSize: 10, margin: 0 }}>{v}</Tag>
|
||||
},
|
||||
{
|
||||
title: t('roles.actions'), width: 120,
|
||||
render: () => (
|
||||
<Space split={<Divider type="vertical" />}>
|
||||
<Button type="link" size="small" icon={<EyeOutlined />} style={{ fontSize: 12, padding: 0 }}>{t('common.view')}</Button>
|
||||
<Button type="link" size="small" icon={<DownloadOutlined />} style={{ fontSize: 12, padding: 0 }}>{t('common.download')}</Button>
|
||||
</Space>
|
||||
)
|
||||
}
|
||||
]}
|
||||
dataSource={reportFileList}
|
||||
pagination={false}
|
||||
size="small"
|
||||
className="compact-table"
|
||||
/>
|
||||
</Card>
|
||||
|
||||
{/* 模板中心 */}
|
||||
<Card variant="borderless" style={{ ...cardStyle, marginTop: 8 }} styles={{ body: { padding: '16px' } }} title={<span style={{ fontSize: 15, fontWeight: 700 }}>{t('report.templateCenter')}</span>} extra={<Button type="link" size="small">{t('common.more')} <ChevronRight size={14} /></Button>}>
|
||||
<Row gutter={[12, 12]}>
|
||||
{reportTemplates.map((tpl, idx) => (
|
||||
<Col span={12} key={idx}>
|
||||
<div style={{ background: '#f8fafc', padding: '12px', borderRadius: 10, height: '100%', border: '1px solid #f0f0f0' }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 10, marginBottom: 8 }}>
|
||||
<div style={{ width: 32, height: 32, borderRadius: 8, background: tpl.bg, color: tpl.color, display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: 16 }}>
|
||||
{tpl.icon}
|
||||
</div>
|
||||
<div style={{ fontSize: 13, fontWeight: 700, color: '#1D2129' }}>{tpl.name}</div>
|
||||
</div>
|
||||
<div style={{ fontSize: 11, color: '#86909C', lineHeight: 1.4 }}>{tpl.desc}</div>
|
||||
</div>
|
||||
</Col>
|
||||
))}
|
||||
</Row>
|
||||
</Card>
|
||||
|
||||
{/* 报表生成记录 */}
|
||||
<Card variant="borderless" style={{ ...cardStyle, marginTop: 8 }} styles={{ body: { padding: 0 } }} title={<span style={{ fontSize: 15, fontWeight: 700 }}>{t('report.generationRecords')}</span>} extra={<Button type="link" size="small">{t('common.more')} <ChevronRight size={14} /></Button>}>
|
||||
<Table
|
||||
rowKey="name"
|
||||
columns={[
|
||||
{ title: t('report.reportName'), dataIndex: 'name', width: 100, ellipsis: true },
|
||||
{ title: t('report.generateTime'), dataIndex: 'time', width: 130 },
|
||||
{ title: t('report.generator'), dataIndex: 'operator', width: 80 },
|
||||
{ title: t('common.type'), dataIndex: 'type', width: 80 },
|
||||
{
|
||||
title: t('roles.status'), dataIndex: 'status', width: 70,
|
||||
render: (v) => <Tag color={v === t('report.generated') ? 'success' : 'warning'} style={{ borderRadius: 4, fontSize: 10, margin: 0 }}>{v}</Tag>
|
||||
},
|
||||
{
|
||||
title: t('roles.actions'), width: 90,
|
||||
render: () => (
|
||||
<Space size={8}>
|
||||
<Button type="text" icon={<EyeOutlined />} size="small" />
|
||||
<Button type="text" icon={<DownloadOutlined />} size="small" />
|
||||
</Space>
|
||||
)
|
||||
}
|
||||
]}
|
||||
dataSource={generationRecord}
|
||||
pagination={false}
|
||||
size="small"
|
||||
className="compact-table"
|
||||
scroll={{ y: 240 }}
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useState } from 'react';
|
||||
import React, { useState } from 'react';
|
||||
import {
|
||||
Card, Row, Col, Button, Space, Input, Select, Table, Tag, Typography, Dropdown, Menu,
|
||||
Timeline, Badge, Divider, Tooltip
|
||||
@@ -158,8 +158,8 @@ export default function VideoMonitorPage() {
|
||||
].map((item, index) => (
|
||||
<Col key={index} style={{ minWidth: '168px', flex: '1 0 auto', maxWidth: "250px" }}>
|
||||
<Card
|
||||
bordered={false}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
variant="borderless"
|
||||
styles={{ body: { padding: '16px' } }}
|
||||
style={{ borderRadius: 8, height: 120 }}
|
||||
>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', height: '100%' }}>
|
||||
@@ -201,9 +201,9 @@ export default function VideoMonitorPage() {
|
||||
<Button type="link" size="small" icon={<FullscreenOutlined />}>{t('video.fullScreen')}</Button>
|
||||
</Space>
|
||||
}
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
style={cardStyle}
|
||||
bodyStyle={{ padding: 16 }}
|
||||
styles={{ body: { padding: 16 } }}
|
||||
>
|
||||
<Row gutter={[12, 12]}>
|
||||
<Col span={14}>
|
||||
@@ -221,7 +221,7 @@ export default function VideoMonitorPage() {
|
||||
<ScissorOutlined style={{ color: '#fff', fontSize: 18, cursor: 'pointer' }} />
|
||||
<CameraOutlined style={{ color: '#fff', fontSize: 18, cursor: 'pointer' }} />
|
||||
<ExpandOutlined style={{ color: '#fff', fontSize: 18, cursor: 'pointer' }} />
|
||||
<Select defaultValue={t('video.high')} size="small" style={{ width: 80 }} bordered={false} className="video-select">
|
||||
<Select defaultValue={t('video.high')} size="small" style={{ width: 80 }} variant="borderless" className="video-select">
|
||||
<Option value={t('video.super')}>{t('video.super')}</Option>
|
||||
<Option value={t('video.high')}>{t('video.high')}</Option>
|
||||
<Option value={t('video.standard')}>{t('video.standard')}</Option>
|
||||
@@ -265,9 +265,9 @@ export default function VideoMonitorPage() {
|
||||
<Card
|
||||
title={<span style={{ fontSize: 16, fontWeight: 800, color: '#1D2129' }}>{t('video.fixed2AiVideoIntelligentAnalysisFixed2')}</span>}
|
||||
extra={<Button type="link" size="small">{t('common.settings')}<ChevronRight size={14} /></Button>}
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
style={{ ...cardStyle, height: '100%' }}
|
||||
bodyStyle={{ padding: '16px 20px' }}
|
||||
styles={{ body: { padding: '16px 20px' } }}
|
||||
>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>
|
||||
{[
|
||||
@@ -308,11 +308,12 @@ export default function VideoMonitorPage() {
|
||||
</Select>
|
||||
</Space>
|
||||
}
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
style={cardStyle}
|
||||
bodyStyle={{ padding: 0 }}
|
||||
styles={{ body: { padding: 0 } }}
|
||||
>
|
||||
<Table
|
||||
rowKey="key"
|
||||
columns={camColumns}
|
||||
dataSource={camList}
|
||||
pagination={false}
|
||||
@@ -327,9 +328,9 @@ export default function VideoMonitorPage() {
|
||||
<Card
|
||||
title={<span style={{ fontSize: 15, fontWeight: 800, color: '#1D2129' }}>{t('video.eventTimeline')}</span>}
|
||||
extra={<Select defaultValue={t('devices.allTypes')} size="small" style={{ width: 100 }}><Option value="全部类型">{t('devices.allTypes')}</Option></Select>}
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
style={cardStyle}
|
||||
bodyStyle={{ padding: '16px 20px' }}
|
||||
styles={{ body: { padding: '16px 20px' } }}
|
||||
>
|
||||
<Timeline style={{ marginTop: 8 }}>
|
||||
{[
|
||||
@@ -357,9 +358,9 @@ export default function VideoMonitorPage() {
|
||||
<Card
|
||||
title={<span style={{ fontSize: 15, fontWeight: 800, color: '#1D2129' }}>{t('video.alert')}</span>}
|
||||
extra={<Button type="link" size="small">{t('devices.viewMore')}<ChevronRight size={14} /></Button>}
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
style={cardStyle}
|
||||
bodyStyle={{ padding: '16px 20px' }}
|
||||
styles={{ body: { padding: '16px 20px' } }}
|
||||
>
|
||||
<div style={{ display: 'flex', flexWrap: "wrap", gap: 12, paddingBottom: 8 }} >
|
||||
{[
|
||||
|
||||
@@ -915,7 +915,7 @@ const WorkOrderPage = () => {
|
||||
<Row gutter={[8, 8]} style={{ marginBottom: 8 }}>
|
||||
{stats.map((item, index) => (
|
||||
<Col key={index} xs={24} sm={12} md={8} xl={4}>
|
||||
<Card bordered={false} bodyStyle={{ padding: '20px 16px' }} style={cardStyle}>
|
||||
<Card variant="borderless" styles={{ body: { padding: '20px 16px' } }} style={cardStyle}>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
||||
<div>
|
||||
<div style={{ fontSize: 'clamp(12px, 0.8vw, 13px)', color: '#86909C', marginBottom: 2 }}>{item.title}</div>
|
||||
@@ -940,7 +940,7 @@ const WorkOrderPage = () => {
|
||||
</Row>
|
||||
|
||||
{/* 筛选栏 */}
|
||||
<Card bordered={false} bodyStyle={{ padding: '8px 16px 0px 16px' }} style={{ ...cardStyle, marginBottom: 8 }}>
|
||||
<Card variant="borderless" styles={{ body: { padding: '8px 16px 0px 16px' } }} style={{ ...cardStyle, marginBottom: 8 }}>
|
||||
<Form form={queryForm} layout="inline" initialValues={{
|
||||
orderStatus: 1
|
||||
}}>
|
||||
@@ -976,7 +976,7 @@ const WorkOrderPage = () => {
|
||||
{/* 左侧:列表 + 底部图表 */}
|
||||
<Col xs={24} xl={15}>
|
||||
<Card
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
title={
|
||||
<Space size={8}>
|
||||
<Text strong style={{ fontSize: 15, color: '#1D2129' }}>{t('workOrder.listFixed2')}</Text>
|
||||
@@ -1002,7 +1002,7 @@ const WorkOrderPage = () => {
|
||||
)}
|
||||
</Space>
|
||||
}
|
||||
bodyStyle={{ padding: 0 }}
|
||||
styles={{ body: { padding: 0 } }}
|
||||
style={{ ...cardStyle, marginBottom: 8 }}
|
||||
>
|
||||
|
||||
@@ -1037,7 +1037,7 @@ const WorkOrderPage = () => {
|
||||
|
||||
<Row gutter={[12, 12]}>
|
||||
<Col xs={24} md={9}>
|
||||
<Card bordered={false} title={<Text strong style={{ fontSize: 14 }}>{t('workOrder.fixed2OrderStatus')}</Text>} style={{ ...cardStyle, height: 380 }}>
|
||||
<Card variant="borderless" title={<Text strong style={{ fontSize: 14 }}>{t('workOrder.fixed2OrderStatus')}</Text>} style={{ ...cardStyle, height: 380 }}>
|
||||
<div style={{ height: 300, position: 'relative' }}>
|
||||
<Pie
|
||||
data={pieData}
|
||||
@@ -1059,7 +1059,7 @@ const WorkOrderPage = () => {
|
||||
</Col>
|
||||
<Col xs={24} md={15}>
|
||||
<Card
|
||||
bordered={false}
|
||||
variant="borderless"
|
||||
title={<Text strong style={{ fontSize: 14 }}>{t('workOrder.fixed2TaskSuspended2')}</Text>}
|
||||
extra={
|
||||
<Button
|
||||
@@ -1070,7 +1070,7 @@ const WorkOrderPage = () => {
|
||||
</Button>
|
||||
}
|
||||
style={{ ...cardStyle, height: 380 }}
|
||||
bodyStyle={{ padding: '16px' }}
|
||||
styles={{ body: { padding: '16px' } }}
|
||||
>
|
||||
{/* 日期切换栏 */}
|
||||
<div style={{ marginBottom: 16 }}>
|
||||
@@ -1206,7 +1206,7 @@ const WorkOrderPage = () => {
|
||||
|
||||
{/* 右侧:详情 + AI + 告警 */}
|
||||
<Col xs={24} xl={9}>
|
||||
<Card bordered={false} style={cardStyle} bodyStyle={{ padding: '20px' }}>
|
||||
<Card variant="borderless" style={cardStyle} styles={{ body: { padding: '20px' } }}>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 8 }}>
|
||||
<Text strong style={{ fontSize: 16, color: '#1D2129' }}>{t('workOrder.detailFixed2')}</Text>
|
||||
<Text type="secondary" style={{ fontSize: 12 }}>{t('workOrder.fixed2OrderNo')}<span style={{ color: '#4E5969', fontWeight: 600 }}>{currentDetail?.orderNo || '--'}</span></Text>
|
||||
@@ -1464,8 +1464,8 @@ const WorkOrderPage = () => {
|
||||
|
||||
</Card>
|
||||
|
||||
<Card bordered={false} title={<Text strong style={{ fontSize: 14, color: '#1D2129' }}>{t('workOrder.aiSuggestion')}</Text>}
|
||||
style={{ ...cardStyle, marginTop: 8 }} bodyStyle={{ padding: '16px' }}>
|
||||
<Card variant="borderless" title={<Text strong style={{ fontSize: 14, color: '#1D2129' }}>{t('workOrder.aiSuggestion')}</Text>}
|
||||
style={{ ...cardStyle, marginTop: 8 }} styles={{ body: { padding: '16px' } }}>
|
||||
<Row gutter={12} style={{ marginBottom: 16 }}>
|
||||
<Col span={8}>
|
||||
<div style={{ background: '#F9F0FF', padding: '16px 8px', borderRadius: 12, textAlign: 'center', height: '100%', border: '1px solid #F3E8FF' }}>
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user