累计作业面积 时长实现 急停全局数据接入 局部内联样式 换为 外联 优化控制模式和系统模式的切换 功能控制面板加入急停 任务界面 加入急停
This commit is contained in:
@@ -16,3 +16,30 @@
|
|||||||
- `软著/机器人智慧服务系统V1.0-源代码-格式优化版.docx`(94页):按源代码模板——A4、左右2.0cm上下1.0cm边距、页眉"机器人智慧服务系统V1.0+页码"、正文沿用原7.5pt/12磅行距(5042行,约54行/页≥50行要求)、内容逐行不变
|
- `软著/机器人智慧服务系统V1.0-源代码-格式优化版.docx`(94页):按源代码模板——A4、左右2.0cm上下1.0cm边距、页眉"机器人智慧服务系统V1.0+页码"、正文沿用原7.5pt/12磅行距(5042行,约54行/页≥50行要求)、内容逐行不变
|
||||||
- 踩坑:docx 固定行距(exact 20pt)会把内嵌图片裁剪成细条 → 图片段落必须单独设单倍行距;.doc 转 .docx 用 Word COM(SaveAs 16)
|
- 踩坑:docx 固定行距(exact 20pt)会把内嵌图片裁剪成细条 → 图片段落必须单独设单倍行距;.doc 转 .docx 用 Word COM(SaveAs 16)
|
||||||
- 模板规则提醒:源代码超60页时申报只需前30页+后30页(第30页断开),已在回复中告知用户
|
- 模板规则提醒:源代码超60页时申报只需前30页+后30页(第30页断开),已在回复中告知用户
|
||||||
|
|
||||||
|
## 四页面用户使用手册(2026-11-16 夜)
|
||||||
|
- 完成此前中断的任务:为 devices/overview、devices/status、devices/robotTask、alerts/all 四个页面生成面向用户与营销的详细使用手册
|
||||||
|
- 产出:`D:/code/机器人智慧服务系统/机器人智慧服务系统-用户使用手册-核心页面详解V1.0.docx`(22页,7章,9张截图)
|
||||||
|
- 流程与要点:
|
||||||
|
- Explore 代理逐行核对源码输出功能报告(i18n 文案取自 src/locales/zh/index.ts;告警中心实际只挂载 AlarmOverview,其余 Alarm* 子组件未启用)
|
||||||
|
- 截图:npm run dev(3001)+ agent-browser(npm i -g agent-browser && agent-browser install)登录 admin/admin123(RuoYi 默认,见 2026-08-11 日志);`agent-browser set viewport 1920 1080` 提高清晰度;截图存 shots/manual/
|
||||||
|
- 踩坑:robotTask 页 Cesium 较重,守护进程会 EOF 超时,需重开浏览器重登录(登录态随会话丢失);截图务必用绝对路径(相对路径曾出现文件"消失"假象);页面 window 不滚动(内部容器滚动),整页 1920 一图即可覆盖
|
||||||
|
- 文档生成:python-docx(venv),页眉+PAGE 域页脚、宋体正文/黑体标题、Table Grid+蓝灰表头;脚本内中文文本的英文引号会破坏 Python 字符串,用"两侧CJK/一侧CJK一侧英数"规则批量替换为中文引号
|
||||||
|
- 校验:Word COM 转 PDF(22页)+ PyMuPDF 渲染抽查
|
||||||
|
|
||||||
|
## 产品说明书丰富版(2026-11-16 深夜)
|
||||||
|
- 用户要求在《机器人智慧服务系统-产品说明书-格式优化版.docx》基础上补充 7 类内容:软件结构图/功能流程图/逻辑框图/总体设计/接口设计/模块名称功能/函数名称功能,重新生成
|
||||||
|
- 产出:`软著/机器人智慧服务系统-产品说明书-丰富版V1.1.docx`(23页,原格式优化版未动)
|
||||||
|
- 做法要点:
|
||||||
|
- 复用 build_manual_v2.py 生成脚本,改输出名 + 图号顺延(替换顺序必须从大到小:5-1→6-1、4-x→5-x、3-1→4-1)+ 在"安装和运行方法"与"软件功能"之间插入 H1"软件设计说明"章节(7 个 H2 小节)
|
||||||
|
- 三张设计图用 matplotlib(Agg)+ 微软雅黑字体(C:/Windows/Fonts/msyh.ttc,FontProperties fname 方式避免注册字体)绘制:结构图=五层分层框图;流程图=纵向主干+正常/异常菱形分支;逻辑框图=四页面→通信服务层→支撑组件→设备网关
|
||||||
|
- 接口表:从 src/api/*.ts|js grep url+method 逐条核对请求方式(GET/POST),勿凭猜测
|
||||||
|
- 模块表/函数表:从路由 routes.tsx 与组件/控制器源码提取真实名称(useMqtt、wsManager、emergencyStopControl 系列等)
|
||||||
|
- 校验:Word COM 统计 23 页 + PyMuPDF 渲染抽查 + 正则提取全部"图 x-y"标题确认编号连续
|
||||||
|
- 踩坑:matplotlib 未装需 pip 到 venv;流程图第一版布局重叠(泳道+斜线连接太乱),改纵向主干+分支后清晰
|
||||||
|
|
||||||
|
## 丰富版图示修改(2026-11-16 深夜 2)
|
||||||
|
- 按用户要求修改三张设计图:结构图去无人机(设备层=割草/清洁机器人)、流程图去工单分支(异常分支改为 产生告警→查看→处置/归档→闭环归档)、逻辑框图去机器人控制页面与无人机(三页面+四支撑组件)
|
||||||
|
- 同步改章节文字:流程图段落"转工单闭环"→"处置后归档,形成处理闭环";逻辑框图"四个业务页面"→"装备总览、任务规划、告警中心三个业务页面";设备层 bullet 去无人机
|
||||||
|
- 接口表/模块表/函数表中的工单条目保留(软件实际有该功能,用户只要求改图)
|
||||||
|
- 注意:丰富版V1.1.docx 被用户打开占用导致 PermissionError,改存 `丰富版V1.2.docx`(23页)
|
||||||
|
|||||||
10
.workbuddy/memory/2026-11-17.md
Normal file
10
.workbuddy/memory/2026-11-17.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# 2026-11-17
|
||||||
|
|
||||||
|
## 软著登记申请表填写(2026-11-17)
|
||||||
|
- 用户要求根据产品说明书V1.2填写空白申请表模板(软著/提交/软件著作权登记申请表-空白模板.doc),不动模板与说明书
|
||||||
|
- 关键信息来源:父目录《采集表-已完善.doc》——软件全称"机器人光伏运维智慧服务系统"、简称"机器人智慧服务系统"、V1.0、完成/发表日期 2026-11-06、源程序量 78700 行、开发环境、领域等;著作权人名称在采集表中也是空白
|
||||||
|
- 产出(提交目录):`软件著作权登记申请表-机器人光伏运维智慧服务系统V1.0.docx` + 同名 `.doc`(6页)
|
||||||
|
- 填写方式:.doc→.docx(Word COM SaveAs 16)→ python-docx 按嵌套表格路径 set_cell(保留原 run 格式但强制黑色、多段依次 addnext 保持顺序)→ Word COM 校验页数/导 .doc/导 PDF → PyMuPDF 渲染抽查
|
||||||
|
- 主要功能 933 字(500-1300 达标,按说明书 V1.2 口径写五大功能,含告警转工单;未突出无人机);技术特点 99 字、开发目的 93 字(均 ≤100)
|
||||||
|
- 未填待用户补:著作权人(姓名/类别/证件号/省份)、分类号、首次发表地点、联系人信息(申请方式默认⊙由代理人申请,代理人为南京经纬 谭安琪,模板自带)
|
||||||
|
- 踩坑:①python-docx 多段落用 p0.addnext 逐个插入会逆序,须用 anchor 逐段后移;②set_cell 继承占位符红色字体,提交前须把 w:color 改 000000;③模板 doc 打开时有 ~$ 锁文件,操作临时副本即可
|
||||||
@@ -4,8 +4,8 @@ import { Badge, message } from "antd";
|
|||||||
|
|
||||||
AgoraRTC.setLogLevel(2); // 2=只输出warning/error,屏蔽debug日志
|
AgoraRTC.setLogLevel(2); // 2=只输出warning/error,屏蔽debug日志
|
||||||
|
|
||||||
const APP_ID = "7887b4db6033410d9ac3264b40ca9c1a";
|
const APP_ID = "5afc6f096ddf433aa690df6f251274a4";
|
||||||
const TOKEN = "007eJxTYPh6QSj59sUzD3mPNm64dK9n/n1PP64UzrhzdwUeqMUKv1BVYDC3sDBPMklJMjMwNjYxNEixTEw2NjIzSTIxSE60TDZMlOdYldUQyMiQXKbEwAiFID43g4mhbklGUWpiroExAwMAjGAhHQ==";
|
const TOKEN = "007eJxTYHj/XqzNYP1utbUqvUkLly0/ypRz8liNgdKBqBeqqzX3+WgqMJgmpiWbpRlYmqWkpJkYGycmmlkapKSZpRmZGhqZmySaRH37ndUQyMjgu3k5KyMDBIL47AzJiblGuobmDAwA6vwg4g==";
|
||||||
|
|
||||||
export default function AgrtcRoomRobot({ CHANNEL }: { CHANNEL: string }) {
|
export default function AgrtcRoomRobot({ CHANNEL }: { CHANNEL: string }) {
|
||||||
const [uid] = useState(() => Number(Math.floor(Math.random() * 100000)));
|
const [uid] = useState(() => Number(Math.floor(Math.random() * 100000)));
|
||||||
|
|||||||
567
src/components/devices/DeviceOverviewPage.css
Normal file
567
src/components/devices/DeviceOverviewPage.css
Normal file
@@ -0,0 +1,567 @@
|
|||||||
|
/* 设备总览页样式(由 DeviceOverviewPage.tsx 内联样式外联而来) */
|
||||||
|
|
||||||
|
/* ===== 顶部统计卡片 ===== */
|
||||||
|
.device-overview-page {
|
||||||
|
background: #f5f7fa;
|
||||||
|
min-height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-title-wrap {
|
||||||
|
padding: 4px 0px 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-title.ant-typography {
|
||||||
|
margin: 0;
|
||||||
|
font-size: clamp(14px, 1.2vw, 18px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-content.ant-layout-content {
|
||||||
|
margin: 0 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-top-row.ant-row {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-top-col.ant-col {
|
||||||
|
min-width: 200px;
|
||||||
|
flex: 1 0 auto;
|
||||||
|
max-width: 260px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-top-icon-blue.anticon {
|
||||||
|
color: #165DFF;
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-top-icon-cyan.anticon {
|
||||||
|
color: #13c2c2;
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-top-icon-purple.anticon {
|
||||||
|
color: #722ED1;
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-top-icon-pink.anticon {
|
||||||
|
color: #eb2f96;
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-top-icon-indigo.anticon {
|
||||||
|
color: #2f54eb;
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-stat-card.ant-card {
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
||||||
|
height: 101px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-stat-card .ant-card-body {
|
||||||
|
padding: 20px 20px;
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-stat-info {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-stat-title {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #86909C;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-stat-value {
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 1;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
color: var(--card-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-stat-sub {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #86909C;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-stat-icon {
|
||||||
|
width: 48px;
|
||||||
|
height: 48px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: var(--icon-bg);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-left: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== 地图 / 设备列表卡片 ===== */
|
||||||
|
.device-overview-card.ant-card {
|
||||||
|
border-radius: 8px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-map-card .ant-card-body {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-control-card .ant-card-body {
|
||||||
|
padding: 12px;
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-map-container {
|
||||||
|
width: 100%;
|
||||||
|
height: 350px;
|
||||||
|
border-radius: 8px;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-tag-flat.ant-tag {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== 任务日志 / 告警记录面板 ===== */
|
||||||
|
.device-overview-panels-row.ant-row {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-panel-card.ant-card {
|
||||||
|
border-radius: 8px;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-text-13 {
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-more {
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-more-btn.ant-btn {
|
||||||
|
font-size: 13px;
|
||||||
|
color: #1890ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-time-nowrap {
|
||||||
|
font-size: 12px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-text-12 {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-handled-tag.ant-tag {
|
||||||
|
font-size: 11px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-handle-btn.ant-btn {
|
||||||
|
padding: 0;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== 设备控制面板 ===== */
|
||||||
|
.device-overview-control-title-icon.anticon {
|
||||||
|
margin-right: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-device-select.ant-select {
|
||||||
|
width: 80%;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-block-12 {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-device-head {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-device-type-icon {
|
||||||
|
font-size: 20px;
|
||||||
|
color: #1890ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-device-name {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-detail-btn.ant-btn {
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 11px;
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-stats-row {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-stat-cell {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-battery-icon {
|
||||||
|
color: #52c41a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-temp-cell {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-temp-value {
|
||||||
|
color: #faad14;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-detail-list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 6px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
max-height: 160px;
|
||||||
|
overflow: auto;
|
||||||
|
scrollbar-width: thin;
|
||||||
|
scrollbar-color: #ccc transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-detail-row {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-label-12 {
|
||||||
|
color: #666;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-detail-row-top {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-label-nowrap {
|
||||||
|
color: #666;
|
||||||
|
font-size: 12px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-sn-value {
|
||||||
|
font-size: 12px;
|
||||||
|
word-break: break-all;
|
||||||
|
white-space: normal;
|
||||||
|
text-align: right;
|
||||||
|
max-width: 70%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-rtk-badge.ant-badge {
|
||||||
|
background-color: #52c41a;
|
||||||
|
transform: scale(0.8);
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-action-row {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-action-btn.ant-btn {
|
||||||
|
border-radius: 8px;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-block-8 {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== 视频区域 ===== */
|
||||||
|
.device-overview-video-head {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-video-title {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-video-stop {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-video-source-select.ant-select {
|
||||||
|
width: 120px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-video-box {
|
||||||
|
width: 100%;
|
||||||
|
height: 160px;
|
||||||
|
border-radius: 8px;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-video-inner {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #000;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-video-loading {
|
||||||
|
color: #ccc;
|
||||||
|
display: flex;
|
||||||
|
height: 100%;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-play-overlay {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
cursor: pointer;
|
||||||
|
background: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-play-btn {
|
||||||
|
width: 48px;
|
||||||
|
height: 48px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: rgba(255, 255, 255, 0.25);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 22px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-manual-row {
|
||||||
|
display: flex;
|
||||||
|
gap: 12px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== 气象/执行条件卡片 ===== */
|
||||||
|
.device-overview-weather-card.ant-card {
|
||||||
|
border-radius: 12px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-weather-body {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 12px;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-weather-grid {
|
||||||
|
display: flex;
|
||||||
|
border: 1px solid #e8e8e8;
|
||||||
|
border-radius: 12px;
|
||||||
|
overflow: hidden;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-weather-cell {
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
white-space: nowrap;
|
||||||
|
padding: 12px 4px;
|
||||||
|
border-right: 1px solid #e8e8e8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-weather-cell-last {
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
white-space: nowrap;
|
||||||
|
padding: 12px 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-weather-cell-label {
|
||||||
|
font-size: 11px;
|
||||||
|
color: #666;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-weather-cell-value {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #222;
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-weather-cell-value-good {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #52c41a;
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-weather-good {
|
||||||
|
width: 110px;
|
||||||
|
padding: 12px 4px;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: #f6ffed;
|
||||||
|
border: 1px solid #b7eb8f;
|
||||||
|
text-align: center;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-weather-good-title {
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #52c41a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-weather-good-icon {
|
||||||
|
width: 18px;
|
||||||
|
height: 18px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #52c41a;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-weather-good-icon-mark.anticon {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-weather-good-sub {
|
||||||
|
font-size: 11px;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== 机器人状态统计 ===== */
|
||||||
|
.device-overview-robot-card.ant-card {
|
||||||
|
border-radius: 12px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
||||||
|
border: 1px solid #f0f0f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-robot-title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-robot-title-icon.anticon {
|
||||||
|
color: #165DFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-robot-stats.ant-row {
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-robot-stat {
|
||||||
|
padding: 12px 16px;
|
||||||
|
border-radius: 10px;
|
||||||
|
background: #F7F8FA;
|
||||||
|
text-align: center;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
transition: all 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-robot-stat-title {
|
||||||
|
font-size: 11px;
|
||||||
|
color: #666666;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-robot-statistic.ant-statistic .ant-statistic-content {
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #165DFF;
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== 任务执行时间 ===== */
|
||||||
|
.device-overview-schedule-card.ant-card {
|
||||||
|
border-radius: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-schedule-extra {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-timeline-label {
|
||||||
|
font-size: 11px;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-empty.ant-empty {
|
||||||
|
margin-top: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-more-12 {
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== 编辑机器人设备信息弹窗 ===== */
|
||||||
|
.device-overview-edit-body {
|
||||||
|
padding: 8px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-edit-row {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-required-mark {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-overview-edit-hint {
|
||||||
|
margin-top: 8px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
@@ -44,6 +44,7 @@ import { sendEmergencyStop, subscribeEmergencyStop, syncEmergencyStop } from './
|
|||||||
import AlarmLevelTag from '../AlarmLevelTag.tsx';
|
import AlarmLevelTag from '../AlarmLevelTag.tsx';
|
||||||
import { getDeviceTastPool } from '@/api/device.ts';
|
import { getDeviceTastPool } from '@/api/device.ts';
|
||||||
import { backToRestPointCommand } from '@/api/mapEdit';
|
import { backToRestPointCommand } from '@/api/mapEdit';
|
||||||
|
import './DeviceOverviewPage.css';
|
||||||
|
|
||||||
const { Content } = Layout;
|
const { Content } = Layout;
|
||||||
const { Text, Title } = Typography;
|
const { Text, Title } = Typography;
|
||||||
@@ -245,6 +246,7 @@ export default function DeviceOverviewPage() {
|
|||||||
feStatus: rt?.feStatus,
|
feStatus: rt?.feStatus,
|
||||||
taskId: rt?.t,
|
taskId: rt?.t,
|
||||||
isRealtimeOnly: true,
|
isRealtimeOnly: true,
|
||||||
|
emergencyStop: rt?.emergencyStop,
|
||||||
// 同步写入 locationMessage / lastRunningStatus,确保 Map.jsx 设备渲染 useEffect 能读到实时坐标
|
// 同步写入 locationMessage / lastRunningStatus,确保 Map.jsx 设备渲染 useEffect 能读到实时坐标
|
||||||
locationMessage: { longitude: rt?.lng, latitude: rt?.lat, heading: rt?.yaw, batteryLevel: rt?.battery },
|
locationMessage: { longitude: rt?.lng, latitude: rt?.lat, heading: rt?.yaw, batteryLevel: rt?.battery },
|
||||||
lastRunningStatus: { longitude: rt?.lng, latitude: rt?.lat, heading: rt?.yaw, batteryLevel: rt?.battery },
|
lastRunningStatus: { longitude: rt?.lng, latitude: rt?.lat, heading: rt?.yaw, batteryLevel: rt?.battery },
|
||||||
@@ -293,7 +295,15 @@ export default function DeviceOverviewPage() {
|
|||||||
(d?.longitude && d?.latitude)
|
(d?.longitude && d?.latitude)
|
||||||
);
|
);
|
||||||
}, [devices, realtimeMap]);
|
}, [devices, realtimeMap]);
|
||||||
|
const formatTime = (seconds) => {
|
||||||
|
const time = Number(seconds || 0);
|
||||||
|
|
||||||
|
if (time >= 86400) {
|
||||||
|
return `${(time / 86400).toFixed(2)} d`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return `${(time / 3600).toFixed(2)} h`;
|
||||||
|
};
|
||||||
// 打开编辑弹窗
|
// 打开编辑弹窗
|
||||||
const openEditRobotModal = (record) => {
|
const openEditRobotModal = (record) => {
|
||||||
// 仅机器人允许编辑,无人机直接提示
|
// 仅机器人允许编辑,无人机直接提示
|
||||||
@@ -475,8 +485,8 @@ export default function DeviceOverviewPage() {
|
|||||||
|
|
||||||
// 实时数据里的急停状态同步到共享锁存状态:true=已急停,false=未急停
|
// 实时数据里的急停状态同步到共享锁存状态:true=已急停,false=未急停
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
syncEmergencyStop(realtimeDevice?.emergency_stop);
|
syncEmergencyStop(realtimeDevice?.emergencyStop);
|
||||||
}, [realtimeDevice?.emergency_stop]);
|
}, [realtimeDevice?.emergencyStop]);
|
||||||
|
|
||||||
// MQTT消息处理
|
// MQTT消息处理
|
||||||
const handleMqttMessage = useCallback((topic, message) => {
|
const handleMqttMessage = useCallback((topic, message) => {
|
||||||
@@ -700,7 +710,7 @@ export default function DeviceOverviewPage() {
|
|||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
title: t('devices.fixed2DroneAirportFixed2StatusFixed2'),
|
title: t('devices.fixed2DroneAirportFixed2StatusFixed2'),
|
||||||
icon: <EnvironmentOutlined style={{ color: '#165DFF', fontSize: 24 }} />,
|
icon: <EnvironmentOutlined className="device-overview-top-icon-blue" />,
|
||||||
value: `${onlineDrones} / ${totalDrones}`,
|
value: `${onlineDrones} / ${totalDrones}`,
|
||||||
sub: `${t('devices.distributable')} ${onlineDrones} ${t('devices.UnitsDrone')}`,
|
sub: `${t('devices.distributable')} ${onlineDrones} ${t('devices.UnitsDrone')}`,
|
||||||
color: '#165DFF',
|
color: '#165DFF',
|
||||||
@@ -708,7 +718,7 @@ export default function DeviceOverviewPage() {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('home.inspectionRobot'),
|
title: t('home.inspectionRobot'),
|
||||||
icon: <RobotOutlined style={{ color: '#13c2c2', fontSize: 24 }} />,
|
icon: <RobotOutlined className="device-overview-top-icon-cyan" />,
|
||||||
value: `${onlineRobots} / ${totalRobots}`,
|
value: `${onlineRobots} / ${totalRobots}`,
|
||||||
sub: `${t('devices.online')} ${onlineRobots}`,
|
sub: `${t('devices.online')} ${onlineRobots}`,
|
||||||
color: '#13c2c2',
|
color: '#13c2c2',
|
||||||
@@ -716,7 +726,7 @@ export default function DeviceOverviewPage() {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('devices.mowingRobot'),
|
title: t('devices.mowingRobot'),
|
||||||
icon: <CarOutlined style={{ color: '#722ED1', fontSize: 24 }} />,
|
icon: <CarOutlined className="device-overview-top-icon-purple" />,
|
||||||
value: `${totalRobots} ${t('devices.UnitsRobot')}`,
|
value: `${totalRobots} ${t('devices.UnitsRobot')}`,
|
||||||
sub: `${t('devices.executing')} ${activeMowers}`,
|
sub: `${t('devices.executing')} ${activeMowers}`,
|
||||||
color: '#722ED1',
|
color: '#722ED1',
|
||||||
@@ -724,7 +734,7 @@ export default function DeviceOverviewPage() {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('devices.washDrone'),
|
title: t('devices.washDrone'),
|
||||||
icon: <CloudOutlined style={{ color: '#eb2f96', fontSize: 24 }} />,
|
icon: <CloudOutlined className="device-overview-top-icon-pink" />,
|
||||||
value: `${totalDrones} ${t('devices.UnitsDrone')}`,
|
value: `${totalDrones} ${t('devices.UnitsDrone')}`,
|
||||||
sub: `${t('devices.waiting')} ${washDroneStandby}`,
|
sub: `${t('devices.waiting')} ${washDroneStandby}`,
|
||||||
color: '#eb2f96',
|
color: '#eb2f96',
|
||||||
@@ -732,7 +742,7 @@ export default function DeviceOverviewPage() {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('devices.todayTaskExecute'),
|
title: t('devices.todayTaskExecute'),
|
||||||
icon: <CheckCircleOutlined style={{ color: '#2f54eb', fontSize: 24 }} />,
|
icon: <CheckCircleOutlined className="device-overview-top-icon-indigo" />,
|
||||||
value: `${completedTasks} / ${totalTasks}`,
|
value: `${completedTasks} / ${totalTasks}`,
|
||||||
sub: `${t('devices.completionRate')} ${completionRate}%`,
|
sub: `${t('devices.completionRate')} ${completionRate}%`,
|
||||||
color: '#2f54eb',
|
color: '#2f54eb',
|
||||||
@@ -833,46 +843,35 @@ export default function DeviceOverviewPage() {
|
|||||||
}, [selectedDevice]);
|
}, [selectedDevice]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ background: '#f5f7fa', minHeight: '100%' }}>
|
<div className="device-overview-page">
|
||||||
<div style={{ padding: '4px 0px 8px' }}>
|
<div className="device-overview-title-wrap">
|
||||||
<Typography.Title level={4} style={{ margin: 0, fontSize: 'clamp(14px, 1.2vw, 18px)' }}>{t('devices.fixed2Equipment')}</Typography.Title>
|
<Typography.Title level={4} className="device-overview-title">{t('devices.fixed2Equipment')}</Typography.Title>
|
||||||
</div>
|
</div>
|
||||||
<Content style={{ margin: '0 8', }}>
|
<Content className="device-overview-content">
|
||||||
<Row gutter={[12, 12]} style={{ marginBottom: 8, flexWrap: 'wrap' }}>
|
<Row gutter={[12, 12]} className="device-overview-top-row">
|
||||||
{dynamicTopCards.map((card, idx) => (
|
{dynamicTopCards.map((card, idx) => (
|
||||||
<Col key={idx} style={{ minWidth: '200px', flex: '1 0 auto', maxWidth: "260px" }}>
|
<Col key={idx} className="device-overview-top-col">
|
||||||
<Card
|
<Card
|
||||||
variant="borderless"
|
variant="borderless"
|
||||||
styles={{ body: { padding: '20px 20px', display: 'flex', alignItems: 'flex-start', justifyContent: 'space-between' } }}
|
className="device-overview-stat-card"
|
||||||
style={{ borderRadius: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.06)', height: 101 }}
|
|
||||||
>
|
>
|
||||||
{/* 左侧文字区域 */}
|
{/* 左侧文字区域 */}
|
||||||
<div style={{ flex: 1, display: 'flex', flexDirection: 'column', alignItems: 'flex-start' }}>
|
<div className="device-overview-stat-info">
|
||||||
<div style={{ fontSize: 14, color: '#86909C', marginBottom: 8, fontWeight: 500 }}>
|
<div className="device-overview-stat-title">
|
||||||
{card.title}
|
{card.title}
|
||||||
</div>
|
</div>
|
||||||
<div style={{ fontSize: 28, fontWeight: 700, color: card.color, lineHeight: 1, marginBottom: 8 }}>
|
<div className="device-overview-stat-value" style={{ '--card-color': card.color } as React.CSSProperties}>
|
||||||
{card.value}
|
{card.value}
|
||||||
</div>
|
</div>
|
||||||
{/* 底部环比/备注 */}
|
{/* 底部环比/备注 */}
|
||||||
{card.sub && <div style={{ fontSize: 12, color: '#86909C', fontWeight: 500 }}>
|
{card.sub && <div className="device-overview-stat-sub">
|
||||||
{card.sub}
|
{card.sub}
|
||||||
</div>}
|
</div>}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 右侧圆形图标区域 */}
|
{/* 右侧圆形图标区域 */}
|
||||||
<div
|
<div
|
||||||
style={{
|
className="device-overview-stat-icon" style={{ '--icon-bg': card.iconBg || '#f0f7ff' } as React.CSSProperties}
|
||||||
width: 48,
|
|
||||||
height: 48,
|
|
||||||
borderRadius: '50%',
|
|
||||||
backgroundColor: card.iconBg || '#f0f7ff',
|
|
||||||
display: 'flex',
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
flexShrink: 0,
|
|
||||||
marginLeft: 8
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{card.icon}
|
{card.icon}
|
||||||
</div>
|
</div>
|
||||||
@@ -883,8 +882,8 @@ export default function DeviceOverviewPage() {
|
|||||||
|
|
||||||
<Row gutter={[8, 8]}>
|
<Row gutter={[8, 8]}>
|
||||||
<Col xs={24} lg={14}>
|
<Col xs={24} lg={14}>
|
||||||
<Card title={<><EnvironmentOutlined />{t('devices.fixed2Equipment')}</>} extra={<Button type="text" icon={<SettingOutlined />} />} variant="borderless" style={{ borderRadius: 8, marginBottom: 8 }} styles={{ body: { padding: 0 } }}>
|
<Card title={<><EnvironmentOutlined />{t('devices.fixed2Equipment')}</>} extra={<Button type="text" icon={<SettingOutlined />} />} variant="borderless" className="device-overview-card device-overview-map-card">
|
||||||
<div style={{ width: '100%', height: 350, borderRadius: 8, position: 'relative', overflow: 'hidden' }}>
|
<div className="device-overview-map-container">
|
||||||
{/*<div style={{ position: 'absolute', zIndex: 11, top: 12, left: 12, background: 'rgba(255,255,255,0.95)', borderRadius: 6, padding: 8 }}>
|
{/*<div style={{ position: 'absolute', zIndex: 11, 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>
|
<div style={{ fontSize: 11, fontWeight: 60, marginBottom: 4 }}>{t('devices.s22')}</div>
|
||||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 4, fontSize: 10 }}>
|
<div style={{ display: 'flex', flexDirection: 'column', gap: 4, fontSize: 10 }}>
|
||||||
@@ -901,7 +900,7 @@ export default function DeviceOverviewPage() {
|
|||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<Card title={<><SettingOutlined />{t('devices.fixed2EquipmentListFixed2')}</>} extra={<Button type="text" icon={<ReloadOutlined />} onClick={fetchAllData} />} variant="borderless" style={{ borderRadius: 8, marginBottom: 8 }}>
|
<Card title={<><SettingOutlined />{t('devices.fixed2EquipmentListFixed2')}</>} extra={<Button type="text" icon={<ReloadOutlined />} onClick={fetchAllData} />} variant="borderless" className="device-overview-card">
|
||||||
<Table rowKey={(record) => record.id || record.serialNumber || record.device_sn} size="small" pagination={false}
|
<Table rowKey={(record) => record.id || record.serialNumber || record.device_sn} size="small" pagination={false}
|
||||||
columns={[
|
columns={[
|
||||||
{ title: t('devices.fixed2EquipmentFixed2NameFixed2'), dataIndex: 'name', width: 180 },
|
{ title: t('devices.fixed2EquipmentFixed2NameFixed2'), dataIndex: 'name', width: 180 },
|
||||||
@@ -931,7 +930,7 @@ export default function DeviceOverviewPage() {
|
|||||||
if (text == '2') color = 'success';
|
if (text == '2') color = 'success';
|
||||||
if (text == '3') color = 'default'; // default 就是灰色标签
|
if (text == '3') color = 'default'; // default 就是灰色标签
|
||||||
|
|
||||||
return <Tag color={color} style={{ margin: 0 }}>
|
return <Tag color={color} className="device-overview-tag-flat">
|
||||||
{text == '1' ? "工作中" : text == '2' ? "空闲中" : "离线"}
|
{text == '1' ? "工作中" : text == '2' ? "空闲中" : "离线"}
|
||||||
</Tag>;
|
</Tag>;
|
||||||
|
|
||||||
@@ -987,14 +986,14 @@ export default function DeviceOverviewPage() {
|
|||||||
scroll={{ x: 'max-content', y: 280 }}
|
scroll={{ x: 'max-content', y: 280 }}
|
||||||
/>
|
/>
|
||||||
</Card>
|
</Card>
|
||||||
<Row wrap={false} gutter={16} style={{ width: '100%' }}>
|
<Row wrap={false} gutter={16} className="device-overview-panels-row">
|
||||||
<Col flex="1 1 0">
|
<Col flex="1 1 0">
|
||||||
<Card
|
<Card
|
||||||
title={<>
|
title={<>
|
||||||
<SettingOutlined /> <span>{t('devices.TaskLog')}</span>
|
<SettingOutlined /> <span>{t('devices.TaskLog')}</span>
|
||||||
</>}
|
</>}
|
||||||
variant="borderless"
|
variant="borderless"
|
||||||
style={{ borderRadius: 8, height: '100%' }}
|
className="device-overview-panel-card"
|
||||||
|
|
||||||
>
|
>
|
||||||
<Table
|
<Table
|
||||||
@@ -1004,8 +1003,8 @@ export default function DeviceOverviewPage() {
|
|||||||
dataSource={taskList}
|
dataSource={taskList}
|
||||||
scroll={{ x: 'max-content' }}
|
scroll={{ x: 'max-content' }}
|
||||||
columns={[
|
columns={[
|
||||||
{ title: t('common.createTime'), dataIndex: 'startTime', width: 90, render: (v) => <span style={{ fontSize: 13 }}>{v}</span> },
|
{ title: t('common.createTime'), dataIndex: 'startTime', width: 90, render: (v) => <span className="device-overview-text-13">{v}</span> },
|
||||||
{ title: t('devices.deviceId'), dataIndex: 'deviceId', width: 100, render: (v) => <span style={{ fontSize: 13 }}>{v}</span> },
|
{ title: t('devices.deviceId'), dataIndex: 'deviceId', width: 100, render: (v) => <span className="device-overview-text-13">{v}</span> },
|
||||||
|
|
||||||
{
|
{
|
||||||
title: t('devices.executionPlan'),
|
title: t('devices.executionPlan'),
|
||||||
@@ -1068,8 +1067,8 @@ export default function DeviceOverviewPage() {
|
|||||||
{ title: t('devices.taskName'), dataIndex: 'planName' },
|
{ title: t('devices.taskName'), dataIndex: 'planName' },
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
<div style={{ textAlign: 'center', marginTop: 8 }}>
|
<div className="device-overview-more">
|
||||||
<Button type="link" size="small" style={{ fontSize: 13, color: '#1890ff' }} onClick={() => navigate('/devices/robotTask')}>
|
<Button type="link" size="small" className="device-overview-more-btn" onClick={() => navigate('/devices/robotTask')}>
|
||||||
{t('devices.viewMoreLogs')}
|
{t('devices.viewMoreLogs')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
@@ -1081,7 +1080,7 @@ export default function DeviceOverviewPage() {
|
|||||||
<SettingOutlined /> <span>{t('devices.AlertRecord')}</span>
|
<SettingOutlined /> <span>{t('devices.AlertRecord')}</span>
|
||||||
</>}
|
</>}
|
||||||
variant="borderless"
|
variant="borderless"
|
||||||
style={{ borderRadius: 8, height: '100%' }}
|
className="device-overview-panel-card"
|
||||||
|
|
||||||
>
|
>
|
||||||
<Table
|
<Table
|
||||||
@@ -1095,14 +1094,14 @@ export default function DeviceOverviewPage() {
|
|||||||
title: t('common.time'),
|
title: t('common.time'),
|
||||||
dataIndex: 'alarmTime',
|
dataIndex: 'alarmTime',
|
||||||
width: 145,
|
width: 145,
|
||||||
render: (v) => <span style={{ fontSize: 12, whiteSpace: 'nowrap' }}>{formatAlarmTime(v) || '-'}</span>
|
render: (v) => <span className="device-overview-time-nowrap">{formatAlarmTime(v) || '-'}</span>
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('devices.device'),
|
title: t('devices.device'),
|
||||||
dataIndex: 'deviceName',
|
dataIndex: 'deviceName',
|
||||||
width: 110,
|
width: 110,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
render: (v, record) => <span style={{ fontSize: 12 }}>{record?.deviceAlias || record?.deviceId || v || '-'}</span>
|
render: (v, record) => <span className="device-overview-text-12">{record?.deviceAlias || record?.deviceId || v || '-'}</span>
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('alerts.alarmTitle'),
|
title: t('alerts.alarmTitle'),
|
||||||
@@ -1112,7 +1111,7 @@ export default function DeviceOverviewPage() {
|
|||||||
const text = getAlarmTitleText(record);
|
const text = getAlarmTitleText(record);
|
||||||
return (
|
return (
|
||||||
<Tooltip title={text}>
|
<Tooltip title={text}>
|
||||||
<span style={{ fontSize: 12 }}>{text || '-'}</span>
|
<span className="device-overview-text-12">{text || '-'}</span>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1126,17 +1125,17 @@ export default function DeviceOverviewPage() {
|
|||||||
title: t('alerts.handle'),
|
title: t('alerts.handle'),
|
||||||
width: 70,
|
width: 70,
|
||||||
render: (_, record) => record?.handleStatus === 2
|
render: (_, record) => record?.handleStatus === 2
|
||||||
? <Tag style={{ fontSize: 11, margin: 0 }}>{t('alerts.handled')}</Tag>
|
? <Tag className="device-overview-handled-tag">{t('alerts.handled')}</Tag>
|
||||||
: (
|
: (
|
||||||
<Button type="link" size="small" style={{ padding: 0, fontSize: 12 }} onClick={() => handleAlarmItem(record)}>
|
<Button type="link" size="small" className="device-overview-handle-btn" onClick={() => handleAlarmItem(record)}>
|
||||||
{t('alerts.handle')}
|
{t('alerts.handle')}
|
||||||
</Button>
|
</Button>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
<div style={{ textAlign: 'center', marginTop: 8 }}>
|
<div className="device-overview-more">
|
||||||
<Button type="link" size="small" style={{ fontSize: 13, color: '#1890ff' }} onClick={() => navigate('/alerts/all')}>
|
<Button type="link" size="small" className="device-overview-more-btn" onClick={() => navigate('/alerts/all')}>
|
||||||
{t('devices.viewMoreLogs')}
|
{t('devices.viewMoreLogs')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
@@ -1149,9 +1148,9 @@ export default function DeviceOverviewPage() {
|
|||||||
|
|
||||||
<Col xs={24} lg={10}>
|
<Col xs={24} lg={10}>
|
||||||
|
|
||||||
<Card title={<><SettingOutlined style={{ marginRight: 6, }} />{t('devices.deviceControlPanel')}</>} variant="borderless" style={{ borderRadius: 8, marginBottom: 8 }} styles={{ body: { padding: 12, paddingBottom: 0 } }}>
|
<Card title={<><SettingOutlined className="device-overview-control-title-icon" />{t('devices.deviceControlPanel')}</>} variant="borderless" className="device-overview-card device-overview-control-card">
|
||||||
<Select
|
<Select
|
||||||
style={{ width: "80%", marginBottom: 8 }}
|
className="device-overview-device-select"
|
||||||
placeholder={t('workOrder.selectDeviceFixed2')}
|
placeholder={t('workOrder.selectDeviceFixed2')}
|
||||||
value={selectedDevice?.device_sn || selectedDevice?.serialNumber}
|
value={selectedDevice?.device_sn || selectedDevice?.serialNumber}
|
||||||
onChange={handleDeviceChange}
|
onChange={handleDeviceChange}
|
||||||
@@ -1171,85 +1170,85 @@ export default function DeviceOverviewPage() {
|
|||||||
{selectedDevice && (
|
{selectedDevice && (
|
||||||
<Row gutter={8}>
|
<Row gutter={8}>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<div style={{ marginBottom: 12 }}>
|
<div className="device-overview-block-12">
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: 6, marginBottom: 12, flexWrap: "wrap" }}>
|
<div className="device-overview-device-head">
|
||||||
{String(selectedDevice.deviceType || '').toUpperCase() === 'U' || selectedDevice.deviceName?.includes(t('constants.uav')) || selectedDevice.drone_callsign ? (
|
{String(selectedDevice.deviceType || '').toUpperCase() === 'U' || selectedDevice.deviceName?.includes(t('constants.uav')) || selectedDevice.drone_callsign ? (
|
||||||
<span style={{ fontSize: 20, color: '#1890ff' }}><RocketOutlined /></span>
|
<span className="device-overview-device-type-icon"><RocketOutlined /></span>
|
||||||
) : (
|
) : (
|
||||||
<span style={{ fontSize: 20, color: '#1890ff' }}><CarOutlined /></span>
|
<span className="device-overview-device-type-icon"><CarOutlined /></span>
|
||||||
)}
|
)}
|
||||||
<span style={{ fontSize: 14, fontWeight: 600 }}>{selectedDevice.deviceAlias || selectedDevice.drone_callsign || selectedDevice.callsign || selectedDevice.deviceName}</span>
|
<span className="device-overview-device-name">{selectedDevice.deviceAlias || selectedDevice.drone_callsign || selectedDevice.callsign || selectedDevice.deviceName}</span>
|
||||||
<Tag color={realtimeDevice.status == 1 || realtimeDevice.status == 2 ? "success" : "default"} size="small" style={{ margin: 0 }}>
|
<Tag color={realtimeDevice.status == 1 || realtimeDevice.status == 2 ? "success" : "default"} size="small" className="device-overview-tag-flat">
|
||||||
{realtimeDevice.status == 1 || realtimeDevice.status == 2 ? t('devices.online') : t('devices.offline')}
|
{realtimeDevice.status == 1 || realtimeDevice.status == 2 ? t('devices.online') : t('devices.offline')}
|
||||||
</Tag>
|
</Tag>
|
||||||
<Button
|
<Button
|
||||||
type="primary" size="small" ghost icon={<InfoCircleOutlined />}
|
type="primary" size="small" ghost icon={<InfoCircleOutlined />}
|
||||||
style={{ borderRadius: 4, fontSize: 11, marginLeft: 'auto' }}
|
className="device-overview-detail-btn"
|
||||||
onClick={() => onViewStatus(selectedDevice.device_sn || selectedDevice.serialNumber)}
|
onClick={() => onViewStatus(selectedDevice.device_sn || selectedDevice.serialNumber)}
|
||||||
>{t('common.detail')}</Button>
|
>{t('common.detail')}</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 4 }}>
|
<div className="device-overview-stats-row">
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
|
<div className="device-overview-stat-cell">
|
||||||
<span style={{ color: '#52c41a' }}><ThunderboltOutlined /></span>
|
<span className="device-overview-battery-icon"><ThunderboltOutlined /></span>
|
||||||
<span style={{ fontSize: 12 }}>{t('devices.batteryLevel')}: {fix2(realtimeDevice?.battery)}%</span>
|
<span className="device-overview-text-12">{t('devices.batteryLevel')}: {fix2(realtimeDevice?.battery)}%</span>
|
||||||
</div>
|
</div>
|
||||||
{realtimeDevice?.environment_temperature && (
|
{realtimeDevice?.environment_temperature && (
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: 6 }}>
|
<div className="device-overview-temp-cell">
|
||||||
<span style={{ fontSize: 12 }}>{t('home.temperature')}</span>
|
<span className="device-overview-text-12">{t('home.temperature')}</span>
|
||||||
<span style={{ color: '#faad14' }}>{formatTemperature(Number(realtimeDevice.environment_temperature || 25), 1).label}</span>
|
<span className="device-overview-temp-value">{formatTemperature(Number(realtimeDevice.environment_temperature || 25), 1).label}</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 6, marginBottom: 12, maxHeight: "160px", overflow: "auto", scrollbarWidth: 'thin', scrollbarColor: '#ccc transparent' }}>
|
<div className="device-overview-detail-list">
|
||||||
{selectedDevice.productName && (
|
{selectedDevice.productName && (
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
<div className="device-overview-detail-row">
|
||||||
<span style={{ color: '#666', fontSize: 12 }}>{t('devices.productType')}</span>
|
<span className="device-overview-label-12">{t('devices.productType')}</span>
|
||||||
<span style={{ fontSize: 12 }}>{getVal(selectedDevice.productName)}</span>
|
<span className="device-overview-text-12">{getVal(selectedDevice.productName)}</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', gap: 8 }}>
|
<div className="device-overview-detail-row-top">
|
||||||
<span style={{ color: '#666', fontSize: 12, whiteSpace: 'nowrap' }}>{t('systemSetting.fixed2DeviceSn')}</span>
|
<span className="device-overview-label-nowrap">{t('systemSetting.fixed2DeviceSn')}</span>
|
||||||
<span style={{ fontSize: 12, wordBreak: 'break-all', whiteSpace: 'normal', textAlign: 'right', maxWidth: '70%' }}>
|
<span className="device-overview-sn-value">
|
||||||
{getVal(selectedDevice.device_sn || selectedDevice.serialNumber)}
|
{getVal(selectedDevice.device_sn || selectedDevice.serialNumber)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{selectedDevice.activeTime && (
|
{selectedDevice.activeTime && (
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
<div className="device-overview-detail-row">
|
||||||
<span style={{ color: '#666', fontSize: 12 }}>{t('devices.timeFixed2')}</span>
|
<span className="device-overview-label-12">{t('devices.timeFixed2')}</span>
|
||||||
<span style={{ fontSize: 12 }}>{selectedDevice.activeTime}</span>
|
<span className="device-overview-text-12">{selectedDevice.activeTime}</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{selectedDevice.firmwareVersion && (
|
{selectedDevice.firmwareVersion && (
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
<div className="device-overview-detail-row">
|
||||||
<span style={{ color: '#666', fontSize: 12 }}>{t('devices.firmwareVersion')}</span>
|
<span className="device-overview-label-12">{t('devices.firmwareVersion')}</span>
|
||||||
<span style={{ fontSize: 12 }}>v{selectedDevice.firmwareVersion}</span>
|
<span className="device-overview-text-12">v{selectedDevice.firmwareVersion}</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{selectedDevice.deviceType && (
|
{selectedDevice.deviceType && (
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
<div className="device-overview-detail-row">
|
||||||
<span style={{ color: '#666', fontSize: 12 }}>{t('devices.deviceType')}</span>
|
<span className="device-overview-label-12">{t('devices.deviceType')}</span>
|
||||||
<span style={{ fontSize: 12 }}>{selectedDevice.deviceType}</span>
|
<span className="device-overview-text-12">{selectedDevice.deviceType}</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{(selectedDevice.productName?.includes(t('constants.uav')) || selectedDevice.device_sn) && (
|
{(selectedDevice.productName?.includes(t('constants.uav')) || selectedDevice.device_sn) && (
|
||||||
<>
|
<>
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
<div className="device-overview-detail-row">
|
||||||
<span style={{ color: '#666', fontSize: 12 }}>{t('devices.flightAltitude')}</span>
|
<span className="device-overview-label-12">{t('devices.flightAltitude')}</span>
|
||||||
<span style={{ fontSize: 12 }}>{fix2(realtimeDevice?.height)} m</span>
|
<span className="device-overview-text-12">{fix2(realtimeDevice?.height)} m</span>
|
||||||
</div>
|
</div>
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
<div className="device-overview-detail-row">
|
||||||
<span style={{ color: '#666', fontSize: 12 }}>{t('devices.s21')}</span>
|
<span className="device-overview-label-12">{t('devices.s21')}</span>
|
||||||
<span style={{ fontSize: 12 }}>{fix2(realtimeDevice?.wind_speed)} m/s</span>
|
<span className="device-overview-text-12">{fix2(realtimeDevice?.wind_speed)} m/s</span>
|
||||||
</div>
|
</div>
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
<div className="device-overview-detail-row">
|
||||||
<span style={{ color: '#666', fontSize: 12 }}>{t('devices.rtkQuantityFixed2')}</span>
|
<span className="device-overview-label-12">{t('devices.rtkQuantityFixed2')}</span>
|
||||||
<span style={{ fontSize: 12 }}>
|
<span className="device-overview-text-12">
|
||||||
<Badge
|
<Badge
|
||||||
showZero={true}
|
showZero={true}
|
||||||
count={realtimeDevice?.position_state?.rtk_number || 0}
|
count={realtimeDevice?.position_state?.rtk_number || 0}
|
||||||
style={{ backgroundColor: '#52c41a', transform: 'scale(0.8)' }}
|
className="device-overview-rtk-badge"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -1257,10 +1256,10 @@ export default function DeviceOverviewPage() {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style={{ display: 'flex', justifyContent: "space-between", flexWrap: 'wrap', gap: 6 }}>
|
<div className="device-overview-action-row">
|
||||||
{/*<Button type="primary" style={{ borderRadius: 8, flex: 1 }} onClick={handleStart}>{t('devices.s23')}</Button>*/}
|
{/*<Button type="primary" style={{ borderRadius: 8, flex: 1 }} onClick={handleStart}>{t('devices.s23')}</Button>*/}
|
||||||
{/*<Button style={{ borderRadius: 8, flex: 1 }} onClick={handlePause}>{t('video.pause')}</Button>*/}
|
{/*<Button style={{ borderRadius: 8, flex: 1 }} onClick={handlePause}>{t('video.pause')}</Button>*/}
|
||||||
<Button type="primary" style={{ borderRadius: 8, flex: 1 }} onClick={handleAutoBack}>{t('devices.returnHome')}</Button>
|
<Button type="primary" className="device-overview-action-btn" onClick={handleAutoBack}>{t('devices.returnHome')}</Button>
|
||||||
{/*<Button style={{ flex: 1, background: '#52c41a', borderColor: '#52c41a', color: "#fff", borderRadius: 8, }} onClick={handleRecharge}>{t('devices.s24')}</Button>*/}
|
{/*<Button style={{ flex: 1, background: '#52c41a', borderColor: '#52c41a', color: "#fff", borderRadius: 8, }} onClick={handleRecharge}>{t('devices.s24')}</Button>*/}
|
||||||
<Button danger={!eStopActive} type={eStopActive ? 'primary' : 'default'} style={{ flex: 1, borderRadius: 8, background: eStopActive ? '#cf1322' : undefined, borderColor: eStopActive ? '#cf1322' : undefined, color: eStopActive ? '#fff' : undefined }} onClick={handleEmergencyStop}>{eStopActive ? t('devices.estopTriggered') : t('devices.s29')}</Button>
|
<Button danger={!eStopActive} type={eStopActive ? 'primary' : 'default'} style={{ flex: 1, borderRadius: 8, background: eStopActive ? '#cf1322' : undefined, borderColor: eStopActive ? '#cf1322' : undefined, color: eStopActive ? '#fff' : undefined }} onClick={handleEmergencyStop}>{eStopActive ? t('devices.estopTriggered') : t('devices.s29')}</Button>
|
||||||
|
|
||||||
@@ -1269,11 +1268,11 @@ export default function DeviceOverviewPage() {
|
|||||||
</Col>
|
</Col>
|
||||||
|
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<div style={{ marginBottom: 8 }}>
|
<div className="device-overview-block-8">
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 4 }}>
|
<div className="device-overview-video-head">
|
||||||
<span style={{ fontSize: 14, fontWeight: 500, color: "#666" }}>{t('devices.s25')}</span>
|
<span className="device-overview-video-title">{t('devices.s25')}</span>
|
||||||
{!isUAV && robotPlayActive && (
|
{!isUAV && robotPlayActive && (
|
||||||
<div style={{ textAlign: 'right' }}>
|
<div className="device-overview-video-stop">
|
||||||
<Button
|
<Button
|
||||||
size="small"
|
size="small"
|
||||||
danger
|
danger
|
||||||
@@ -1287,7 +1286,7 @@ export default function DeviceOverviewPage() {
|
|||||||
{isUAV && (
|
{isUAV && (
|
||||||
<Select
|
<Select
|
||||||
size="small"
|
size="small"
|
||||||
style={{ width: 120 }}
|
className="device-overview-video-source-select"
|
||||||
value={videoSource}
|
value={videoSource}
|
||||||
onChange={setVideoSource}
|
onChange={setVideoSource}
|
||||||
options={[
|
options={[
|
||||||
@@ -1299,7 +1298,7 @@ export default function DeviceOverviewPage() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* ✅ 关键:videoDevice 绝不随MQTT更新,视频永不闪烁 */}
|
{/* ✅ 关键:videoDevice 绝不随MQTT更新,视频永不闪烁 */}
|
||||||
<div style={{ width: '100%', height: 160, borderRadius: 8, position: 'relative', overflow: 'hidden', background: '#000' }}>
|
<div className="device-overview-video-box">
|
||||||
{isUAV ? (
|
{isUAV ? (
|
||||||
<DroneVideoPlayer
|
<DroneVideoPlayer
|
||||||
device={videoDevice}
|
device={videoDevice}
|
||||||
@@ -1311,7 +1310,7 @@ export default function DeviceOverviewPage() {
|
|||||||
) : (
|
) : (
|
||||||
robotPlayActive ? (
|
robotPlayActive ? (
|
||||||
selectedDevice?.hasHost ? (
|
selectedDevice?.hasHost ? (
|
||||||
<div style={{ width: '100%', height: '100%', position: 'relative', overflow: 'hidden', background: '#000', borderRadius: 8 }}>
|
<div className="device-overview-video-inner">
|
||||||
<AgrtcRoomRobot CHANNEL={selectedDevice?.serialNumber || ''} />
|
<AgrtcRoomRobot CHANNEL={selectedDevice?.serialNumber || ''} />
|
||||||
</div>
|
</div>
|
||||||
) : robotVideo ? (
|
) : robotVideo ? (
|
||||||
@@ -1324,34 +1323,16 @@ export default function DeviceOverviewPage() {
|
|||||||
ready={ready}
|
ready={ready}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<div style={{ color: '#ccc', display: 'flex', height: '100%', alignItems: 'center', justifyContent: 'center' }}>{t('video.videoLoading')}</div>
|
<div className="device-overview-video-loading">{t('video.videoLoading')}</div>
|
||||||
)
|
)
|
||||||
) : (
|
) : (
|
||||||
// ========== 未点击播放时:显示播放大按钮 ==========
|
// ========== 未点击播放时:显示播放大按钮 ==========
|
||||||
<div
|
<div
|
||||||
onClick={() => setRobotPlayActive(true)}
|
onClick={() => setRobotPlayActive(true)}
|
||||||
style={{
|
className="device-overview-play-overlay"
|
||||||
width: '100%',
|
|
||||||
height: '100%',
|
|
||||||
display: 'flex',
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
cursor: 'pointer',
|
|
||||||
background: '#000',
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
style={{
|
className="device-overview-play-btn"
|
||||||
width: 48,
|
|
||||||
height: 48,
|
|
||||||
borderRadius: '50%',
|
|
||||||
background: 'rgba(255,255,255,0.25)',
|
|
||||||
display: 'flex',
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
color: '#fff',
|
|
||||||
fontSize: 22,
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
▶
|
▶
|
||||||
</div>
|
</div>
|
||||||
@@ -1363,7 +1344,7 @@ export default function DeviceOverviewPage() {
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style={{ display: 'flex', gap: 12, flexWrap: 'wrap' }}>
|
<div className="device-overview-manual-row">
|
||||||
{/*<Button size="large" style={{ flex: 1, borderRadius: 8 }}>{t('devices.switchManual')}</Button>*/}
|
{/*<Button size="large" style={{ flex: 1, borderRadius: 8 }}>{t('devices.switchManual')}</Button>*/}
|
||||||
</div>
|
</div>
|
||||||
</Col>
|
</Col>
|
||||||
@@ -1402,30 +1383,30 @@ export default function DeviceOverviewPage() {
|
|||||||
</Card>*/}
|
</Card>*/}
|
||||||
|
|
||||||
{(selectedDevice?.productName?.includes(t('constants.uav')) || selectedDevice?.device_sn) && (
|
{(selectedDevice?.productName?.includes(t('constants.uav')) || selectedDevice?.device_sn) && (
|
||||||
<Card title={t('devices.s60')} variant="borderless" style={{ borderRadius: 12, marginBottom: 8 }}>
|
<Card title={t('devices.s60')} variant="borderless" className="device-overview-weather-card">
|
||||||
<div style={{ display: "flex", justifyContent: "space-between", gap: 12, alignItems: "center" }}>
|
<div className="device-overview-weather-body">
|
||||||
<div style={{ display: "flex", border: "1px solid #e8e8e8", borderRadius: 12, overflow: "hidden", flex: 1 }}>
|
<div className="device-overview-weather-grid">
|
||||||
<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>
|
<div className="device-overview-weather-cell"><div className="device-overview-weather-cell-label">{t('devices.s44')}</div><div className="device-overview-weather-cell-value">{fix2(realtimeDevice?.wind_speed)} m/s</div></div>
|
||||||
<div style={{ flex: 1, textAlign: 'center', whiteSpace: "nowrap", padding: "12px 4px", borderRight: "1px solid #e8e8e8" }}><div style={{ fontSize: 11, color: '#666', fontWeight: 600 }}>{t('home.temperature')}</div><div style={{ fontSize: 14, fontWeight: 700, color: '#222', marginTop: 2 }}>{formatTemperature(Number(realtimeDevice?.environment_temperature || 0), 1).label}</div></div>
|
<div className="device-overview-weather-cell"><div className="device-overview-weather-cell-label">{t('home.temperature')}</div><div className="device-overview-weather-cell-value">{formatTemperature(Number(realtimeDevice?.environment_temperature || 0), 1).label}</div></div>
|
||||||
<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.rainfall')}</div><div style={{ fontSize: 14, fontWeight: 700, color: '#222', marginTop: 2 }}>{getVal(realtimeDevice?.rainfall)}</div></div>
|
<div className="device-overview-weather-cell"><div className="device-overview-weather-cell-label">{t('devices.rainfall')}</div><div className="device-overview-weather-cell-value">{getVal(realtimeDevice?.rainfall)}</div></div>
|
||||||
<div style={{ flex: 1, textAlign: 'center', whiteSpace: "nowrap", padding: "12px 4px" }}><div style={{ fontSize: 11, color: '#666', fontWeight: 600 }}>RTK</div><div style={{ fontSize: 14, fontWeight: 700, color: '#52c41a', marginTop: 2 }}>{realtimeDevice?.position_state?.is_fixed === 'fixing_successful' ? '固定' : '未固定'}</div></div>
|
<div className="device-overview-weather-cell-last"><div className="device-overview-weather-cell-label">RTK</div><div className="device-overview-weather-cell-value-good">{realtimeDevice?.position_state?.is_fixed === 'fixing_successful' ? '固定' : '未固定'}</div></div>
|
||||||
</div>
|
</div>
|
||||||
<div style={{ width: 110, padding: '12px 4px', borderRadius: 8, background: '#f6ffed', border: '1px solid #b7eb8f', textAlign: 'center', display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', gap: 4 }}>
|
<div className="device-overview-weather-good">
|
||||||
<div className="flex items-center gap-1">
|
<div className="flex items-center gap-1">
|
||||||
<div style={{ fontSize: 12, fontWeight: 700, color: '#52c41a' }}>{t('devices.suitableExec')}</div>
|
<div className="device-overview-weather-good-title">{t('devices.suitableExec')}</div>
|
||||||
<div style={{ width: 18, height: 18, borderRadius: '50%', background: '#52c41a', display: 'flex', alignItems: 'center', justifyContent: 'center' }}><CheckCircleOutlined style={{ fontSize: 12, color: '#fff' }} /></div>
|
<div className="device-overview-weather-good-icon"><CheckCircleOutlined className="device-overview-weather-good-icon-mark" /></div>
|
||||||
</div>
|
</div>
|
||||||
<div style={{ fontSize: 11, color: '#666' }}>{t('devices.normal')}</div>
|
<div className="device-overview-weather-good-sub">{t('devices.normal')}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{(!selectedDevice?.productName?.includes(t('constants.uav')) && !selectedDevice?.device_sn) && (
|
{(!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>} variant="borderless" style={{ borderRadius: 12, marginBottom: 8, boxShadow: '0 2px 8px rgba(0,0,0,0.06)', border: '1px solid #f0f0f0' }}>
|
<Card title={<div className="device-overview-robot-title"><RobotOutlined className="device-overview-robot-title-icon" />{t('devices.fixed2RobotStatusFixed2')}</div>} variant="borderless" className="device-overview-robot-card">
|
||||||
<Row gutter={16} style={{ alignItems: 'center' }}>
|
<Row gutter={16} className="device-overview-robot-stats">
|
||||||
<Col span={8}>
|
<Col span={8}>
|
||||||
<div style={{ padding: '12px 16px', borderRadius: 10, background: '#F7F8FA', textAlign: 'center', border: '1px solid transparent', transition: 'all 0.2s' }}
|
<div className="device-overview-robot-stat"
|
||||||
onMouseEnter={e => {
|
onMouseEnter={e => {
|
||||||
e.currentTarget.style.background = '#E8F3FF';
|
e.currentTarget.style.background = '#E8F3FF';
|
||||||
e.currentTarget.style.borderColor = '#165DFF';
|
e.currentTarget.style.borderColor = '#165DFF';
|
||||||
@@ -1435,16 +1416,15 @@ export default function DeviceOverviewPage() {
|
|||||||
e.currentTarget.style.borderColor = 'transparent';
|
e.currentTarget.style.borderColor = 'transparent';
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Statistic
|
<Statistic className="device-overview-robot-statistic"
|
||||||
title={<span style={{ fontSize: 11, color: '#666666', fontWeight: 400 }}>{t('devices.statTotalDistance')}(m)</span>}
|
title={<span className="device-overview-robot-stat-title">{t('devices.statTotalDistance')}(m)</span>}
|
||||||
value={deviceStatistics?.distance ? Number(deviceStatistics.distance).toFixed(2) : Number(deviceStatistics?.workArea / 0.7 || 0).toFixed(2)}
|
value={deviceStatistics?.distance ? Number(deviceStatistics.distance).toFixed(2) : Number(deviceStatistics?.workArea / 0.7 || 0).toFixed(2)}
|
||||||
suffix=""
|
suffix=""
|
||||||
valueStyle={{ fontSize: 20, fontWeight: 700, color: '#165DFF', marginTop: 4 }}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={8}>
|
<Col span={8}>
|
||||||
<div style={{ padding: '12px 16px', borderRadius: 10, background: '#F7F8FA', textAlign: 'center', border: '1px solid transparent', transition: 'all 0.2s' }}
|
<div className="device-overview-robot-stat"
|
||||||
onMouseEnter={e => {
|
onMouseEnter={e => {
|
||||||
e.currentTarget.style.background = '#E8F3FF';
|
e.currentTarget.style.background = '#E8F3FF';
|
||||||
e.currentTarget.style.borderColor = '#165DFF';
|
e.currentTarget.style.borderColor = '#165DFF';
|
||||||
@@ -1454,16 +1434,15 @@ export default function DeviceOverviewPage() {
|
|||||||
e.currentTarget.style.borderColor = 'transparent';
|
e.currentTarget.style.borderColor = 'transparent';
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Statistic
|
<Statistic className="device-overview-robot-statistic"
|
||||||
title={<span style={{ fontSize: 11, color: '#666666', fontWeight: 400 }}>{t('devices.s50')}(㎡)</span>}
|
title={<span className="device-overview-robot-stat-title">{t('devices.s50')}(㎡)</span>}
|
||||||
value={Number(deviceStatistics?.workArea || 0).toFixed(2)}
|
value={Number(deviceStatistics?.workArea || 0).toFixed(2)}
|
||||||
suffix=""
|
suffix=""
|
||||||
valueStyle={{ fontSize: 20, fontWeight: 700, color: '#165DFF', marginTop: 4 }}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={8}>
|
<Col span={8}>
|
||||||
<div style={{ padding: '12px 16px', borderRadius: 10, background: '#F7F8FA', textAlign: 'center', border: '1px solid transparent', transition: 'all 0.2s' }}
|
<div className="device-overview-robot-stat"
|
||||||
onMouseEnter={e => {
|
onMouseEnter={e => {
|
||||||
e.currentTarget.style.background = '#E8F3FF';
|
e.currentTarget.style.background = '#E8F3FF';
|
||||||
e.currentTarget.style.borderColor = '#165DFF';
|
e.currentTarget.style.borderColor = '#165DFF';
|
||||||
@@ -1474,10 +1453,14 @@ export default function DeviceOverviewPage() {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Statistic
|
<Statistic
|
||||||
title={<span style={{ fontSize: 11, color: '#666666', fontWeight: 400 }}>{t('devices.s51')}(min)</span>}
|
className="device-overview-robot-statistic"
|
||||||
value={Number(deviceStatistics?.time || 0).toFixed(2)}
|
title={
|
||||||
|
<span className="device-overview-robot-stat-title">
|
||||||
|
{t('devices.s51')}
|
||||||
|
</span>
|
||||||
|
}
|
||||||
|
value={formatTime(deviceStatistics?.time)}
|
||||||
suffix=""
|
suffix=""
|
||||||
valueStyle={{ fontSize: 20, fontWeight: 700, color: '#165DFF', marginTop: 4 }}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Col>
|
</Col>
|
||||||
@@ -1485,21 +1468,21 @@ export default function DeviceOverviewPage() {
|
|||||||
</Card>
|
</Card>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Card title={<><ClockCircleOutlined />{t('devices.fixed2TaskSuspended2Fixed2ExecutionTime')}</>} variant="borderless" style={{ borderRadius: 12 }} extra={<div style={{ fontSize: 12, color: '#666' }}></div>}>
|
<Card title={<><ClockCircleOutlined />{t('devices.fixed2TaskSuspended2Fixed2ExecutionTime')}</>} variant="borderless" className="device-overview-schedule-card" extra={<div className="device-overview-schedule-extra"></div>}>
|
||||||
{taskPoolList.length > 0 ? (
|
{taskPoolList.length > 0 ? (
|
||||||
<Timeline mode="left">
|
<Timeline mode="left">
|
||||||
{taskPoolList.map((item, idx) => (
|
{taskPoolList.map((item, idx) => (
|
||||||
<Timeline.Item key={idx} color={item.color} label={<div style={{ fontSize: 11, color: '#999' }}>{item.time}</div>}>
|
<Timeline.Item key={idx} color={item.color} label={<div className="device-overview-timeline-label">{item.time}</div>}>
|
||||||
<div style={{ fontSize: 13 }}>{item.text}</div>
|
<div className="device-overview-text-13">{item.text}</div>
|
||||||
<div style={{ fontSize: 11, color: '#999' }}>{item.status}</div>
|
<div className="device-overview-timeline-label">{item.status}</div>
|
||||||
</Timeline.Item>
|
</Timeline.Item>
|
||||||
))}
|
))}
|
||||||
</Timeline>
|
</Timeline>
|
||||||
) : (
|
) : (
|
||||||
<Empty description={t('common.noData')} style={{ marginTop: 100 }} />
|
<Empty description={t('common.noData')} className="device-overview-empty" />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div style={{ textAlign: 'center', marginTop: 12 }}><Button type="link" onClick={() => navigate('/devices/robotTask')}>{t('devices.viewMore')}</Button></div>
|
<div className="device-overview-more-12"><Button type="link" onClick={() => navigate('/devices/robotTask')}>{t('devices.viewMore')}</Button></div>
|
||||||
</Card>
|
</Card>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
@@ -1514,19 +1497,19 @@ export default function DeviceOverviewPage() {
|
|||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
>
|
>
|
||||||
{currentEditRobot && (
|
{currentEditRobot && (
|
||||||
<div style={{ padding: '8px 0' }}>
|
<div className="device-overview-edit-body">
|
||||||
<div style={{ marginBottom: 16 }}>
|
<div className="device-overview-edit-row">
|
||||||
<Typography.Text strong>{t('devices.fixed2Fixed2DeviceSn')}</Typography.Text>
|
<Typography.Text strong>{t('devices.fixed2Fixed2DeviceSn')}</Typography.Text>
|
||||||
<Typography.Text copyable>
|
<Typography.Text copyable>
|
||||||
{currentEditRobot.device_sn || currentEditRobot.serialNumber}
|
{currentEditRobot.device_sn || currentEditRobot.serialNumber}
|
||||||
</Typography.Text>
|
</Typography.Text>
|
||||||
</div>
|
</div>
|
||||||
<div style={{ marginBottom: 16 }}>
|
<div className="device-overview-edit-row">
|
||||||
<Typography.Text strong>{t('devices.fixed2DeviceType')}</Typography.Text>
|
<Typography.Text strong>{t('devices.fixed2DeviceType')}</Typography.Text>
|
||||||
<Typography.Text>{currentEditRobot.productName || t('constants.locationUnknown')}</Typography.Text>
|
<Typography.Text>{currentEditRobot.productName || t('constants.locationUnknown')}</Typography.Text>
|
||||||
</div>
|
</div>
|
||||||
<div style={{ marginBottom: 8 }}>
|
<div className="device-overview-block-8">
|
||||||
<Typography.Text strong>{t('devices.fixed2Device')}<span style={{ color: 'red' }}>*</span></Typography.Text>
|
<Typography.Text strong>{t('devices.fixed2Device')}<span className="device-overview-required-mark">*</span></Typography.Text>
|
||||||
</div>
|
</div>
|
||||||
<Input
|
<Input
|
||||||
value={editAliasInput}
|
value={editAliasInput}
|
||||||
@@ -1535,7 +1518,7 @@ export default function DeviceOverviewPage() {
|
|||||||
maxLength={30}
|
maxLength={30}
|
||||||
allowClear
|
allowClear
|
||||||
/>
|
/>
|
||||||
<div style={{ marginTop: 8, fontSize: 12, color: '#999' }}>{t('devices.deviceListControlDeviceFixed2')}</div>
|
<div className="device-overview-edit-hint">{t('devices.deviceListControlDeviceFixed2')}</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
@@ -705,7 +705,8 @@ export default function DeviceStatusPage() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//console.log(runningStatus,controlMode, "现在的控制controlmode")
|
//console.log(runningStatus,controlMode, "现在的控制controlmode")
|
||||||
if (controlMode == 3 && runningStatus?.control_mode == 3) {
|
if ((controlMode == 3 && runningStatus?.control_mode == 3) || runningStatus?.systemMode == 3) {
|
||||||
|
messageApi.warning(t('devices.onRemoteControl'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const data = {
|
const data = {
|
||||||
@@ -716,7 +717,7 @@ export default function DeviceStatusPage() {
|
|||||||
if (res.code == 200 && res?.data) {
|
if (res.code == 200 && res?.data) {
|
||||||
messageApi.success(t('devices.controlModeSuccess'));
|
messageApi.success(t('devices.controlModeSuccess'));
|
||||||
} else {
|
} else {
|
||||||
messageApi.error(res.msg || t('devices.controlModeFail'));
|
messageApi.error(t('devices.controlModeFail'));
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
messageApi.success(t('devices.controlModeFail'));
|
messageApi.success(t('devices.controlModeFail'));
|
||||||
@@ -731,29 +732,44 @@ export default function DeviceStatusPage() {
|
|||||||
...currentDroneData, // 持久化数据最后覆盖,确保优先显示
|
...currentDroneData, // 持久化数据最后覆盖,确保优先显示
|
||||||
};
|
};
|
||||||
}, [device, uavState, currentDroneData]);
|
}, [device, uavState, currentDroneData]);
|
||||||
|
// 模式/权限提示节流:仅在用户真实操作(有按键或摇杆输入)时提示,2 秒内只提示一次
|
||||||
|
// 避免点击页面其他区域、手柄轮询中性帧、失焦复位等无输入帧误触发提示
|
||||||
|
const controlWarnRef = useRef(0);
|
||||||
const handleGamepadUpdate = useCallback((state) => {
|
const handleGamepadUpdate = useCallback((state) => {
|
||||||
// 无控制权限时:不发送消息,且只发起一次权限申请(避免手柄/方向盘高频更新刷屏)
|
const hasInput =
|
||||||
if (!isControlled) {
|
//(Array.isArray(state?.buttons) && state.buttons.some((v: any) => v == true || v == 1)) ||
|
||||||
messageApi.warning("请获取控制权限");
|
(Array.isArray(state?.axes) && state.axes.some((v: any) => Math.abs(Number(v) || 0) > 0.05));
|
||||||
//if (!hasRequestedControlRef.current && !connecting) {
|
// 只有真实操作才做模式与权限校验,中性帧(无按键、轴为 0)不提示
|
||||||
// hasRequestedControlRef.current = true;
|
if (hasInput) {
|
||||||
// handleControlModal();
|
const now = Date.now();
|
||||||
//}
|
if (now - controlWarnRef.current > 2000) {
|
||||||
//return;
|
let warned = false;
|
||||||
}
|
// 无控制权限时:提示(避免手柄/方向盘高频更新刷屏)
|
||||||
console.log(realtimePosition?.controlMode, "现在的控制controlmode")
|
if (!isControlled) {
|
||||||
if (
|
messageApi.warning("请获取控制权限");
|
||||||
realtimePosition?.controlMode != 3 &&
|
warned = true;
|
||||||
realtimePosition?.controlMode != 0 &&
|
}
|
||||||
realtimePosition?.controlMode != null
|
console.log(runningStatus, "realtimePosition1111")
|
||||||
) {
|
if (!(runningStatus?.control_mode == 3 || runningStatus?.systemMode == 3)) {
|
||||||
messageApi.warning(t('devices.noRemoteControl'));
|
messageApi.warning(t('devices.switchControl'));
|
||||||
|
warned = true;
|
||||||
|
} else if (
|
||||||
|
runningStatus?.controlMode != 3 &&
|
||||||
|
runningStatus?.controlMode != 0 &&
|
||||||
|
runningStatus?.controlMode != null
|
||||||
|
) {
|
||||||
|
messageApi.warning(t('devices.noRemoteControl'));
|
||||||
|
warned = true;
|
||||||
|
}
|
||||||
|
if (warned) controlWarnRef.current = now;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
console.log('Gamepad state updated:', state);
|
console.log('Gamepad state updated:', state);
|
||||||
// 记录方向盘 xy 坐标,用于倒车影像叠加层
|
// 记录方向盘 xy 坐标,用于倒车影像叠加层
|
||||||
if (state?.axes) {
|
if (state?.axes) {
|
||||||
setSteerXY({ x: state.axes[2] || 0, y: state.axes[1] || 0 });
|
setSteerXY({ x: state.axes[2] || 0, y: state.axes[1] || 0 });
|
||||||
}
|
}
|
||||||
|
// 无论是否有输入(含 false/中性帧)都必须下发,保证设备侧能收到释放/停止状态
|
||||||
controllerRef.current?.sendGamepad(state);
|
controllerRef.current?.sendGamepad(state);
|
||||||
}, [isControlled, connecting]);
|
}, [isControlled, connecting]);
|
||||||
// 手柄已连接时拦截面板操作并提示(2 秒内只提示一次,避免高频刷屏)
|
// 手柄已连接时拦截面板操作并提示(2 秒内只提示一次,避免高频刷屏)
|
||||||
@@ -1324,23 +1340,30 @@ export default function DeviceStatusPage() {
|
|||||||
<ConsoleRow
|
<ConsoleRow
|
||||||
icon={<DashboardOutlined />}
|
icon={<DashboardOutlined />}
|
||||||
label={t('devices.systemMode')}
|
label={t('devices.systemMode')}
|
||||||
value={
|
value={(() => {
|
||||||
(runningStatus?.system_mode ?? runningStatus?.systemMode) !== undefined
|
const mode =
|
||||||
? (() => {
|
runningStatus?.system_mode ??
|
||||||
const mode = runningStatus?.system_mode ?? runningStatus?.systemMode;
|
runningStatus?.systemMode ??
|
||||||
switch (mode) {
|
runningStatus?.control_mode ??
|
||||||
case '2':
|
runningStatus?.controlMode;
|
||||||
case 2:
|
|
||||||
return t('devices.autoTask');
|
switch (mode) {
|
||||||
case '3':
|
case '2':
|
||||||
case 3:
|
case 2:
|
||||||
return t('devices.remoteControl');
|
return t('devices.autoTask');
|
||||||
default:
|
case '3':
|
||||||
return "-";
|
case 3:
|
||||||
}
|
return t('devices.remoteControl');
|
||||||
})()
|
case '0':
|
||||||
: '-'
|
case 0:
|
||||||
}
|
return t('devices.controlOff');
|
||||||
|
case '1':
|
||||||
|
case 1:
|
||||||
|
return t('devices.localCpntrol');
|
||||||
|
default:
|
||||||
|
return '-';
|
||||||
|
}
|
||||||
|
})()}
|
||||||
/>
|
/>
|
||||||
<ConsoleRow icon={<DashboardOutlined />} label={t('devices.forwardSpeed')} value={(runningStatus?.linear_speed ?? runningStatus?.linearSpeed) !== undefined ? Number(runningStatus?.linear_speed ?? runningStatus?.linearSpeed).toFixed(2) + ' m/s' : '-'} />
|
<ConsoleRow icon={<DashboardOutlined />} label={t('devices.forwardSpeed')} value={(runningStatus?.linear_speed ?? runningStatus?.linearSpeed) !== undefined ? Number(runningStatus?.linear_speed ?? runningStatus?.linearSpeed).toFixed(2) + ' m/s' : '-'} />
|
||||||
<ConsoleRow icon={<DashboardOutlined />} label={t('devices.turnSpeed')} value={(runningStatus?.angular_speed ?? runningStatus?.angularSpeed) !== undefined ? Number(runningStatus?.angular_speed ?? runningStatus?.angularSpeed).toFixed(2) + ' rad/s' : '-'} />
|
<ConsoleRow icon={<DashboardOutlined />} label={t('devices.turnSpeed')} value={(runningStatus?.angular_speed ?? runningStatus?.angularSpeed) !== undefined ? Number(runningStatus?.angular_speed ?? runningStatus?.angularSpeed).toFixed(2) + ' rad/s' : '-'} />
|
||||||
@@ -1397,7 +1420,7 @@ export default function DeviceStatusPage() {
|
|||||||
</div>
|
</div>
|
||||||
) : mowerView === 'front' ? (
|
) : mowerView === 'front' ? (
|
||||||
<div style={{ position: 'absolute', top: 0, left: 0, right: 0, bottom: 0 }}>
|
<div style={{ position: 'absolute', top: 0, left: 0, right: 0, bottom: 0 }}>
|
||||||
<AgrtcRoomRobot CHANNEL={"41-thream03"} />
|
<AgrtcRoomRobot CHANNEL={"cam2-17"} />
|
||||||
<CarReverseGuideLine
|
<CarReverseGuideLine
|
||||||
direction="forward"
|
direction="forward"
|
||||||
steer={steerXY.x * 45}
|
steer={steerXY.x * 45}
|
||||||
@@ -1553,7 +1576,7 @@ export default function DeviceStatusPage() {
|
|||||||
bodyStyle={{ padding: 10, display: 'flex', flex: "auto" }}
|
bodyStyle={{ padding: 10, display: 'flex', flex: "auto" }}
|
||||||
>
|
>
|
||||||
<RobotFeatureButtons
|
<RobotFeatureButtons
|
||||||
showEmergencyStop={false}
|
showEmergencyStop
|
||||||
deviceId={selectedSn}
|
deviceId={selectedSn}
|
||||||
activeFeatures={['response', 'obstacleAvoidance', 'lowBatteryReturn', 'tiltProtection', "findCar"]}
|
activeFeatures={['response', 'obstacleAvoidance', 'lowBatteryReturn', 'tiltProtection', "findCar"]}
|
||||||
onToggle={(feature, enabled) => { console.log('[DeviceStatusPage] Feature toggled: ' + feature + ' = ' + enabled); }}
|
onToggle={(feature, enabled) => { console.log('[DeviceStatusPage] Feature toggled: ' + feature + ' = ' + enabled); }}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
import { RootState } from '@/store';
|
import { RootState } from '@/store';
|
||||||
import { sendEmergencyStop } from './emergencyStopControl';
|
import { sendEmergencyStop, subscribeEmergencyStop } from './emergencyStopControl';
|
||||||
import {
|
import {
|
||||||
ShieldAlert,
|
ShieldAlert,
|
||||||
Zap,
|
Zap,
|
||||||
@@ -77,6 +77,9 @@ const RobotFeatureButtons: React.FC<RobotFeatureButtonsProps> = ({
|
|||||||
const [active, setActive] = useState<Set<RobotFeature>>(new Set(activeFeatures));
|
const [active, setActive] = useState<Set<RobotFeature>>(new Set(activeFeatures));
|
||||||
// 临时按压闪烁标记
|
// 临时按压闪烁标记
|
||||||
const [flashKey, setFlashKey] = useState<RobotFeature | null>(null);
|
const [flashKey, setFlashKey] = useState<RobotFeature | null>(null);
|
||||||
|
// 急停锁存状态:与 DPad / 手柄共用同一份状态,点击后保持按下态
|
||||||
|
const [eStopActive, setEStopActive] = useState(false);
|
||||||
|
useEffect(() => subscribeEmergencyStop(setEStopActive), []);
|
||||||
|
|
||||||
// 一次性触发,不toggle的按钮列表
|
// 一次性触发,不toggle的按钮列表
|
||||||
const oneShotKeys: RobotFeature[] = ['emergencyStop', 'findCar', 'autoback', 'controlMode', 'personFollow'];
|
const oneShotKeys: RobotFeature[] = ['emergencyStop', 'findCar', 'autoback', 'controlMode', 'personFollow'];
|
||||||
@@ -138,9 +141,11 @@ const RobotFeatureButtons: React.FC<RobotFeatureButtonsProps> = ({
|
|||||||
`}
|
`}
|
||||||
</style>
|
</style>
|
||||||
{list.map((f) => {
|
{list.map((f) => {
|
||||||
const isOneShot = oneShotKeys.includes(f.key);
|
const isEmergency = f.key === 'emergencyStop';
|
||||||
const isActive = active.has(f.key);
|
const isOneShot = oneShotKeys.includes(f.key) && !isEmergency;
|
||||||
const isFlashing = flashKey === f.key;
|
// 急停走锁存状态,其余按钮沿用本地 toggle 状态
|
||||||
|
const isActive = isEmergency ? eStopActive : active.has(f.key);
|
||||||
|
const isFlashing = flashKey === f.key
|
||||||
const shouldGlow = f.key === 'controlMode' && controlMode != 3;
|
const shouldGlow = f.key === 'controlMode' && controlMode != 3;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,186 +1,368 @@
|
|||||||
import React, { useState, useEffect, useMemo } from 'react';
|
import React, { useState, useEffect, useMemo } from 'react';
|
||||||
|
|
||||||
import { Row, Col, Card, Space, Typography, Select, Empty } from 'antd';
|
import { Row, Col, Card, Space, Typography, Select, Empty } from 'antd';
|
||||||
|
|
||||||
import { Car, Satellite, LayoutGrid, CheckCircle2, AlertCircle, TrendingUp } from 'lucide-react';
|
import { Car, Satellite, LayoutGrid, CheckCircle2, AlertCircle, TrendingUp } from 'lucide-react';
|
||||||
|
|
||||||
import { getSiteDevice, getSiteUAVList } from '../../api/device';
|
import { getSiteDevice, getSiteUAVList } from '../../api/device';
|
||||||
|
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
|
|
||||||
import { RootState } from '@/src/store';
|
import { RootState } from '@/src/store';
|
||||||
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { WayLineView } from './WayLineView';
|
import { WayLineView } from './WayLineView';
|
||||||
|
|
||||||
import { TaskPlanningView } from './TaskPlanningView';
|
import { TaskPlanningView } from './TaskPlanningView';
|
||||||
|
|
||||||
import type { ViewStats } from './WayLineView';
|
import type { ViewStats } from './WayLineView';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const { Text } = Typography;
|
const { Text } = Typography;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ==================== 合并页面:任务规划 + 地图编辑 + 航线任务 ====================
|
// ==================== 合并页面:任务规划 + 地图编辑 + 航线任务 ====================
|
||||||
|
|
||||||
interface MachineOption {
|
interface MachineOption {
|
||||||
|
|
||||||
value: string;
|
value: string;
|
||||||
|
|
||||||
label: string;
|
label: string;
|
||||||
|
|
||||||
group: 'robot' | 'plane';
|
group: 'robot' | 'plane';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default function RobotTaskPage() {
|
export default function RobotTaskPage() {
|
||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const { stationId, currentStation } = useSelector((state: RootState) => state.station);
|
const { stationId, currentStation } = useSelector((state: RootState) => state.station);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const [machineOptions, setMachineOptions] = useState<MachineOption[]>([]);
|
const [machineOptions, setMachineOptions] = useState<MachineOption[]>([]);
|
||||||
|
|
||||||
const [selectedMachine, setSelectedMachine] = useState<string | undefined>(undefined);
|
const [selectedMachine, setSelectedMachine] = useState<string | undefined>(undefined);
|
||||||
|
|
||||||
const [selectedGroup, setSelectedGroup] = useState<'robot' | 'plane' | undefined>(undefined);
|
const [selectedGroup, setSelectedGroup] = useState<'robot' | 'plane' | undefined>(undefined);
|
||||||
|
|
||||||
const [robotStats, setRobotStats] = useState<ViewStats>({});
|
const [robotStats, setRobotStats] = useState<ViewStats>({});
|
||||||
|
|
||||||
const [droneStats, setDroneStats] = useState<ViewStats>({});
|
const [droneStats, setDroneStats] = useState<ViewStats>({});
|
||||||
|
|
||||||
const [robotOnline, setRobotOnline] = useState({ online: 0, total: 0 });
|
const [robotOnline, setRobotOnline] = useState({ online: 0, total: 0 });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 顶部统一机器列表:机器人 + 无人机合并
|
// 顶部统一机器列表:机器人 + 无人机合并
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
||||||
if (!stationId) return;
|
if (!stationId) return;
|
||||||
|
|
||||||
let ignore = false;
|
let ignore = false;
|
||||||
|
|
||||||
const loadMachines = async () => {
|
const loadMachines = async () => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
const [robotRes, planeRes] = await Promise.all([
|
const [robotRes, planeRes] = await Promise.all([
|
||||||
|
|
||||||
getSiteDevice({ siteId: stationId, pageSize: 9999, pageNum: 1, orgId: currentStation?.orgId }),
|
getSiteDevice({ siteId: stationId, pageSize: 9999, pageNum: 1, orgId: currentStation?.orgId }),
|
||||||
|
|
||||||
getSiteUAVList(stationId),
|
getSiteUAVList(stationId),
|
||||||
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (ignore) return;
|
if (ignore) return;
|
||||||
|
|
||||||
const robots = robotRes?.code === 200 ? (robotRes.rows || []) : [];
|
const robots = robotRes?.code === 200 ? (robotRes.rows || []) : [];
|
||||||
|
|
||||||
const planes = planeRes?.code === 200 ? (planeRes.rows || []) : [];
|
const planes = planeRes?.code === 200 ? (planeRes.rows || []) : [];
|
||||||
|
|
||||||
const options: MachineOption[] = [
|
const options: MachineOption[] = [
|
||||||
|
|
||||||
...robots
|
...robots
|
||||||
|
|
||||||
.filter((r) => !!r.serialNumber)
|
.filter((r) => !!r.serialNumber)
|
||||||
|
|
||||||
.map((r) => ({ value: r.serialNumber, label: r.deviceAlias || r.deviceName || r.serialNumber, group: 'robot' as const })),
|
.map((r) => ({ value: r.serialNumber, label: r.deviceAlias || r.deviceName || r.serialNumber, group: 'robot' as const })),
|
||||||
|
|
||||||
...planes
|
...planes
|
||||||
|
|
||||||
.filter((p) => !!p.device_sn)
|
.filter((p) => !!p.device_sn)
|
||||||
|
|
||||||
.map((p) => ({ value: p.device_sn, label: p.drone_callsign || p.device_sn, group: 'plane' as const })),
|
.map((p) => ({ value: p.device_sn, label: p.drone_callsign || p.device_sn, group: 'plane' as const })),
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
setMachineOptions(options);
|
setMachineOptions(options);
|
||||||
|
|
||||||
// 初始化时默认选中机器人分组的第一个(无机器人时取第一个选项)
|
// 初始化时默认选中机器人分组的第一个(无机器人时取第一个选项)
|
||||||
|
|
||||||
const firstRobot = options.find((o) => o.group === 'robot') || options[0];
|
const firstRobot = options.find((o) => o.group === 'robot') || options[0];
|
||||||
|
|
||||||
if (firstRobot) {
|
if (firstRobot) {
|
||||||
|
|
||||||
setSelectedMachine(firstRobot.value);
|
setSelectedMachine(firstRobot.value);
|
||||||
|
|
||||||
setSelectedGroup(firstRobot.group);
|
setSelectedGroup(firstRobot.group);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setRobotOnline({
|
setRobotOnline({
|
||||||
|
|
||||||
online: robots.filter((r) => r.onlineStatus == 1).length,
|
online: robots.filter((r) => r.onlineStatus == 1).length,
|
||||||
|
|
||||||
total: robots.length,
|
total: robots.length,
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
||||||
console.error('获取机器列表失败', err);
|
console.error('获取机器列表失败', err);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
loadMachines();
|
loadMachines();
|
||||||
|
|
||||||
return () => { ignore = true; };
|
return () => { ignore = true; };
|
||||||
|
|
||||||
}, [stationId, currentStation?.orgId]);
|
}, [stationId, currentStation?.orgId]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const handleMachineChange = (value: string | undefined) => {
|
const handleMachineChange = (value: string | undefined) => {
|
||||||
|
|
||||||
setSelectedMachine(value);
|
setSelectedMachine(value);
|
||||||
|
|
||||||
const hit = machineOptions.find((o) => o.value === value);
|
const hit = machineOptions.find((o) => o.value === value);
|
||||||
|
|
||||||
setSelectedGroup(hit?.group);
|
setSelectedGroup(hit?.group);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 分组下拉:仅有对应机器时才显示该分组
|
// 分组下拉:仅有对应机器时才显示该分组
|
||||||
|
|
||||||
const groupedOptions = useMemo(() => {
|
const groupedOptions = useMemo(() => {
|
||||||
|
|
||||||
const groups: { label: string; options: { value: string; label: string }[] }[] = [];
|
const groups: { label: string; options: { value: string; label: string }[] }[] = [];
|
||||||
|
|
||||||
const robots = machineOptions.filter((o) => o.group === 'robot');
|
const robots = machineOptions.filter((o) => o.group === 'robot');
|
||||||
|
|
||||||
const planes = machineOptions.filter((o) => o.group === 'plane');
|
const planes = machineOptions.filter((o) => o.group === 'plane');
|
||||||
|
|
||||||
if (robots.length) {
|
if (robots.length) {
|
||||||
|
|
||||||
groups.push({ label: t('devices.robot'), options: robots.map((o) => ({ value: o.value, label: o.label })) });
|
groups.push({ label: t('devices.robot'), options: robots.map((o) => ({ value: o.value, label: o.label })) });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (planes.length) {
|
if (planes.length) {
|
||||||
|
|
||||||
groups.push({ label: t('devices.drone'), options: planes.map((o) => ({ value: o.value, label: o.label })) });
|
groups.push({ label: t('devices.drone'), options: planes.map((o) => ({ value: o.value, label: o.label })) });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return groups;
|
return groups;
|
||||||
|
|
||||||
}, [machineOptions]);
|
}, [machineOptions]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const cardStyle = { borderRadius: 12, border: 'none', boxShadow: '0 2px 12px rgba(0,0,0,0.04)' };
|
const cardStyle = { borderRadius: 12, border: 'none', boxShadow: '0 2px 12px rgba(0,0,0,0.04)' };
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 顶部统计卡:机器人任务 + 无人机航线任务数据合并
|
||||||
|
|
||||||
|
const mergedCards = useMemo(() => {
|
||||||
|
|
||||||
|
const planTotal = (robotStats.planTotal || 0) + (droneStats.planTotal || 0);
|
||||||
|
|
||||||
|
const working = (robotStats.working || 0) + (droneStats.working || 0);
|
||||||
|
|
||||||
|
const finishCount = (robotStats.finishCount || 0) + (droneStats.finishCount || 0);
|
||||||
|
|
||||||
|
const totalCount = (robotStats.totalCount || 0) + (droneStats.totalCount || 0);
|
||||||
|
|
||||||
|
const completionRate = totalCount ? Math.round((finishCount / totalCount) * 100) : 0;
|
||||||
|
|
||||||
|
const onlineRate = robotOnline.total ? Math.round((robotOnline.online / robotOnline.total) * 100) : 0;
|
||||||
|
const totalWorkArea = robotStats?.workArea ?? "0";
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
{ title: t('devices.statTodayPlan'), value: planTotal, unit: t('devices.unitPlan'), desc: t('devices.statInProgress'), icon: <LayoutGrid size={22} />, color: '#165DFF' },
|
||||||
|
|
||||||
|
{ title: t('devices.statWorkingRobots'), value: working, unit: t('devices.unitRobot'), desc: t('devices.statWorking'), icon: <Car size={22} />, color: '#165DFF' },
|
||||||
|
|
||||||
|
//{ title: t('devices.totalWorkArea'), value: totalWorkArea, unit: '㎡', trend: "", trendColor: '#00B42A', icon: <TrendingUp size={22} />, color: '#722ED1' },
|
||||||
|
|
||||||
|
{ title: t('devices.statCompletionRate'), value: completionRate, unit: '%', trend: t('devices.vsYesterday', { value: '+5%' }), trendColor: '#00B42A', icon: <CheckCircle2 size={22} />, color: '#00B42A' },
|
||||||
|
|
||||||
|
{ title: t('devices.statAlerts'), value: '0', unit: t('devices.unitTimes'), trend: t('devices.vsYesterday', { value: '-1' }), trendColor: '#00B42A', icon: <AlertCircle size={22} />, color: '#F53F3F' },
|
||||||
|
|
||||||
|
{ title: t('devices.statOnlineRate'), value: `${onlineRate}`, unit: '%', desc: t('devices.good'), icon: <Satellite size={22} />, color: '#165DFF' },
|
||||||
|
|
||||||
|
] as { title: string; value: any; unit: string; desc?: string; trend?: string; trendColor?: string; icon: React.ReactElement; color: string }[];
|
||||||
|
|
||||||
|
}, [robotStats, droneStats, robotOnline, t]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return (
|
||||||
|
|
||||||
|
<div style={{ background: '#f5f7fa', minHeight: '100vh' }}>
|
||||||
|
|
||||||
|
<div style={{ zIndex: 100, padding: '8px 24px', display: 'flex', alignItems: 'center', justifyContent: 'space-between', flexWrap: 'wrap', gap: 12 }}>
|
||||||
|
|
||||||
|
<Typography.Title level={4} style={{ margin: 0, fontSize: 'clamp(14px, 1.2vw, 18px)' }}>
|
||||||
|
|
||||||
|
{t('devices.robotTask')}
|
||||||
|
|
||||||
|
</Typography.Title>
|
||||||
|
|
||||||
|
<Space>
|
||||||
|
|
||||||
|
<Text type="secondary">{t('devices.mapEditor.selectRobot')}</Text>
|
||||||
|
|
||||||
|
<Select
|
||||||
|
|
||||||
|
showSearch
|
||||||
|
|
||||||
|
allowClear
|
||||||
|
|
||||||
|
style={{ width: 340 }}
|
||||||
|
|
||||||
|
placeholder={t('devices.mapEditor.selectRobot')}
|
||||||
|
|
||||||
|
value={selectedMachine}
|
||||||
|
|
||||||
|
onChange={handleMachineChange}
|
||||||
|
|
||||||
|
optionFilterProp="label"
|
||||||
|
|
||||||
|
options={groupedOptions}
|
||||||
|
|
||||||
|
/>
|
||||||
|
|
||||||
|
</Space>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div style={{ padding: '8px 2px 0' }}>
|
||||||
|
<Row gutter={[16, 16]} wrap={false} style={{ marginBottom: 8 }}>
|
||||||
|
{mergedCards.map((item, index) => (
|
||||||
|
<Col flex="1" key={index}>
|
||||||
|
<Card
|
||||||
|
|
||||||
|
variant="borderless"
|
||||||
|
|
||||||
|
styles={{ body: { padding: '12px 14px', height: '100%', display: 'flex', alignItems: 'center' } }}
|
||||||
|
|
||||||
|
style={{ ...cardStyle, height: '100%', minHeight: '84px' }}
|
||||||
|
|
||||||
|
>
|
||||||
|
|
||||||
|
<div style={{ display: 'flex', alignItems: 'center', gap: 10, width: '100%' }}>
|
||||||
|
|
||||||
|
<div
|
||||||
|
|
||||||
|
style={{
|
||||||
|
|
||||||
|
width: 36,
|
||||||
|
|
||||||
|
height: 36,
|
||||||
|
|
||||||
|
background: 'rgba(22, 93, 255, 0.1)',
|
||||||
|
|
||||||
|
borderRadius: 10,
|
||||||
|
|
||||||
|
display: 'flex',
|
||||||
|
|
||||||
|
justifyContent: 'center',
|
||||||
|
|
||||||
|
alignItems: 'center',
|
||||||
|
|
||||||
|
color: item.color,
|
||||||
|
|
||||||
|
flexShrink: 0,
|
||||||
|
|
||||||
|
}}
|
||||||
|
|
||||||
|
>
|
||||||
|
|
||||||
|
{React.cloneElement(item.icon as React.ReactElement, { size: 18 })}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style={{ flex: 1, minWidth: 0 }}>
|
||||||
|
|
||||||
|
<div style={{ fontSize: 13, color: '#86909C', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{item.title}</div>
|
||||||
|
|
||||||
|
<div style={{ display: 'flex', alignItems: 'baseline', gap: 4, margin: '2px 0' }}>
|
||||||
|
|
||||||
|
<span style={{ fontSize: 'clamp(16px, 1vw, 20px)', fontWeight: 700, color: '#1D2129', lineHeight: '1.2' }}>{item.value}</span>
|
||||||
|
|
||||||
|
<span style={{ fontSize: 9, color: '#4E5969' }}>{item.unit}</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style={{ fontSize: 9, color: (item as any).trendColor || '#86909C', fontWeight: 500, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>
|
||||||
|
|
||||||
|
{item.trend || item.desc}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</Card>
|
||||||
|
</Col>
|
||||||
|
))}
|
||||||
|
</Row>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{!selectedMachine ? (
|
||||||
|
|
||||||
|
<TaskPlanningView selectedMachineSn={selectedMachine} embedded onStatsChange={setRobotStats} />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
) : selectedGroup === 'plane' ? (
|
||||||
|
|
||||||
|
<WayLineView selectedSn={selectedMachine} embedded onStatsChange={setDroneStats} />
|
||||||
|
|
||||||
|
) : (
|
||||||
|
|
||||||
|
<TaskPlanningView selectedMachineSn={selectedMachine} embedded onStatsChange={setRobotStats} />
|
||||||
|
|
||||||
|
)}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { Row, Col, Card, Button, Space, Table, Tag, Typography, Badge, Tabs, Inp
|
|||||||
import { PlusOutlined, ImportOutlined, NodeIndexOutlined, SaveOutlined, DeleteOutlined, CloseOutlined, ReloadOutlined, ExclamationCircleOutlined, EnvironmentOutlined, EnvironmentFilled } from '@ant-design/icons';
|
import { PlusOutlined, ImportOutlined, NodeIndexOutlined, SaveOutlined, DeleteOutlined, CloseOutlined, ReloadOutlined, ExclamationCircleOutlined, EnvironmentOutlined, EnvironmentFilled } from '@ant-design/icons';
|
||||||
import { Car, Navigation, MapPinned, Route, Satellite, LayoutGrid, CheckCircle2, AlertCircle, TrendingUp, Maximize2 } from 'lucide-react';
|
import { Car, Navigation, MapPinned, Route, Satellite, LayoutGrid, CheckCircle2, AlertCircle, TrendingUp, Maximize2 } from 'lucide-react';
|
||||||
import TaskTypeRadio from '../taskRadio/taskRadio';
|
import TaskTypeRadio from '../taskRadio/taskRadio';
|
||||||
import { getRobotRouteList, getSingleRouteList, saveDeviceTask, getRobotTaskList, deleteDeviceTask, getSiteDevice, excuetRoute, cancelRoute, pauseRoute, recoverRoute, getDeviceTastPool, getSiteDeviceTaskHistory, getRouteByTask, deleteRoute, getTaskPath, createConsecutiveTasks, cancelConsecutiveTask, getConsecutiveTask, modeChage } from '../../api/device';
|
import { getRobotRouteList, getSingleRouteList, saveDeviceTask, getRobotTaskList, deleteDeviceTask, getSiteDevice, excuetRoute, cancelRoute, pauseRoute, recoverRoute, getDeviceTastPool, getSiteDeviceTaskHistory, getRouteByTask, deleteRoute, getTaskPath, createConsecutiveTasks, cancelConsecutiveTask, getConsecutiveTask, modeChage, getDeviceTotalData } from '../../api/device';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import DraggableBox from '../Draggable';
|
import DraggableBox from '../Draggable';
|
||||||
import utils from '../../lib/utils';
|
import utils from '../../lib/utils';
|
||||||
@@ -18,6 +18,7 @@ import { Reorder } from 'motion/react';
|
|||||||
import { MapEditorView } from './MapEditorView';
|
import { MapEditorView } from './MapEditorView';
|
||||||
import type { ViewStats } from './WayLineView';
|
import type { ViewStats } from './WayLineView';
|
||||||
import { backToRestPointCommand } from '@/api/mapEdit';
|
import { backToRestPointCommand } from '@/api/mapEdit';
|
||||||
|
import { sendEmergencyStop, subscribeEmergencyStop, syncEmergencyStop } from './emergencyStopControl';
|
||||||
|
|
||||||
|
|
||||||
const { Text, Title } = Typography;
|
const { Text, Title } = Typography;
|
||||||
@@ -50,6 +51,9 @@ export function TaskPlanningView({ selectedMachineSn, embedded = false, onStatsC
|
|||||||
const [excuteStatus, setExcuteStatus] = useState("stop"); //"stop" "running" "pause"
|
const [excuteStatus, setExcuteStatus] = useState("stop"); //"stop" "running" "pause"
|
||||||
// 全量设备实时状态(mapPush),实时数据统一从这里取
|
// 全量设备实时状态(mapPush),实时数据统一从这里取
|
||||||
const [realtimeMap, setRealtimeMap] = useState<any>({});
|
const [realtimeMap, setRealtimeMap] = useState<any>({});
|
||||||
|
// 急停锁存状态:与 DPad / 手柄 / 设备控制页共用同一份状态
|
||||||
|
const [eStopActive, setEStopActive] = useState(false);
|
||||||
|
useEffect(() => subscribeEmergencyStop(setEStopActive), []);
|
||||||
const [execute, setExecute] = useState(false); // 是否执行任务
|
const [execute, setExecute] = useState(false); // 是否执行任务
|
||||||
const [taskList, setTaskList] = useState([]);
|
const [taskList, setTaskList] = useState([]);
|
||||||
const { modal } = App.useApp();
|
const { modal } = App.useApp();
|
||||||
@@ -57,6 +61,7 @@ export function TaskPlanningView({ selectedMachineSn, embedded = false, onStatsC
|
|||||||
const [detectReportInfo, setDeportInfo] = useState<any>(null);
|
const [detectReportInfo, setDeportInfo] = useState<any>(null);
|
||||||
const [selectedDeviceMap, setSelectedDeviceMap] = useState<Record<string, string>>({});
|
const [selectedDeviceMap, setSelectedDeviceMap] = useState<Record<string, string>>({});
|
||||||
const [consecutiveTaskList, setConsecutiveTaskList] = useState([]);
|
const [consecutiveTaskList, setConsecutiveTaskList] = useState([]);
|
||||||
|
const [deviceStatistics, setDeviceStatistics] = useState<any>({});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -389,6 +394,8 @@ export function TaskPlanningView({ selectedMachineSn, embedded = false, onStatsC
|
|||||||
};
|
};
|
||||||
}, [userInfo, stationId]);
|
}, [userInfo, stationId]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 监听任务列表和设备列表变化,自动连接正在执行中的机器人(仅在没有选择任务时)
|
// 监听任务列表和设备列表变化,自动连接正在执行中的机器人(仅在没有选择任务时)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!taskPoolList || taskPoolList.length == 0) {
|
if (!taskPoolList || taskPoolList.length == 0) {
|
||||||
@@ -462,8 +469,9 @@ export function TaskPlanningView({ selectedMachineSn, embedded = false, onStatsC
|
|||||||
longitude: rt?.lng,
|
longitude: rt?.lng,
|
||||||
latitude: rt?.lat,
|
latitude: rt?.lat,
|
||||||
fix_status: rt?.fixStatus,
|
fix_status: rt?.fixStatus,
|
||||||
controlMode: rt?.controlMode ?? targetRobot?.lastRunningStatus?.controlMode,
|
controlMode: rt?.controlMode ?? rt?.control_mode ?? targetRobot?.lastRunningStatus?.controlMode,
|
||||||
sm: rt?.sm,
|
sm: rt?.sm,
|
||||||
|
e: rt?.emergencyStop,
|
||||||
};
|
};
|
||||||
}, [realtimeMap, targetRobot]);
|
}, [realtimeMap, targetRobot]);
|
||||||
|
|
||||||
@@ -757,6 +765,10 @@ export function TaskPlanningView({ selectedMachineSn, embedded = false, onStatsC
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
syncEmergencyStop(robotRealtimePosition?.emergencyStop);
|
||||||
|
}, [robotRealtimePosition?.emergencyStop]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1359,16 +1371,40 @@ export function TaskPlanningView({ selectedMachineSn, embedded = false, onStatsC
|
|||||||
}];
|
}];
|
||||||
|
|
||||||
// 向合并页面汇报统计口径(与无人机任务统计合并展示)
|
// 向合并页面汇报统计口径(与无人机任务统计合并展示)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const workingCount = taskPoolList?.filter(item => ['EXECUTING', 'PAUSE'].includes(item.taskStaus))?.length || 0;
|
if (!selectedMachineSn) return;
|
||||||
|
|
||||||
|
const params = {
|
||||||
|
deviceId: selectedMachineSn,
|
||||||
|
};
|
||||||
|
|
||||||
|
getDeviceTotalData(params).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
setDeviceStatistics(res.data || {});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, [selectedMachineSn]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const workingCount = taskPoolList?.filter(item =>
|
||||||
|
['EXECUTING', 'PAUSE'].includes(item.taskStaus)
|
||||||
|
)?.length || 0;
|
||||||
|
|
||||||
onStatsChange?.({
|
onStatsChange?.({
|
||||||
planTotal: taskList.length,
|
planTotal: taskList.length,
|
||||||
working: workingCount,
|
working: workingCount,
|
||||||
finishCount: successfulTaskList.length,
|
finishCount: successfulTaskList.length,
|
||||||
totalCount: taskHistoryList.length,
|
totalCount: taskHistoryList.length,
|
||||||
|
...deviceStatistics,
|
||||||
});
|
});
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
}, [
|
||||||
}, [taskList.length, taskPoolList, successfulTaskList.length, taskHistoryList.length]);
|
taskList.length,
|
||||||
|
taskPoolList,
|
||||||
|
successfulTaskList.length,
|
||||||
|
taskHistoryList.length,
|
||||||
|
deviceStatistics,
|
||||||
|
]);
|
||||||
|
|
||||||
// ===== 分区列表 =====
|
// ===== 分区列表 =====
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -1408,6 +1444,11 @@ export function TaskPlanningView({ selectedMachineSn, embedded = false, onStatsC
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 急停:与 DPad 保持一致,调用共享锁存接口(再次点击解除)
|
||||||
|
const handleEmergencyStop = () => {
|
||||||
|
sendEmergencyStop(selectedMachineSn || targetRobot?.serialNumber || '');
|
||||||
|
};
|
||||||
|
|
||||||
// 选中的路径对象列表(用于拖拽排序显示)
|
// 选中的路径对象列表(用于拖拽排序显示)
|
||||||
const selectedRouteObjects = useMemo(() => {
|
const selectedRouteObjects = useMemo(() => {
|
||||||
// 根据 dispatchRouteIds 的顺序返回路径对象
|
// 根据 dispatchRouteIds 的顺序返回路径对象
|
||||||
@@ -1812,7 +1853,9 @@ export function TaskPlanningView({ selectedMachineSn, embedded = false, onStatsC
|
|||||||
<span>
|
<span>
|
||||||
{t('devices.controlMode')}
|
{t('devices.controlMode')}
|
||||||
{(() => {
|
{(() => {
|
||||||
const mode = robotRealtimePosition?.controlMode || robotRealtimePosition?.control_mode;
|
const mode =
|
||||||
|
robotRealtimePosition?.controlMode ??
|
||||||
|
robotRealtimePosition?.control_mode;
|
||||||
|
|
||||||
const modeConfig: Record<string, { label: string; color: string }> = {
|
const modeConfig: Record<string, { label: string; color: string }> = {
|
||||||
'0': {
|
'0': {
|
||||||
@@ -1839,11 +1882,11 @@ export function TaskPlanningView({ selectedMachineSn, embedded = false, onStatsC
|
|||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
return config ? (
|
return config ? (
|
||||||
<span style={{ color: config.color }}>{config.label}</span>
|
<span style={{ color: config.color }}>
|
||||||
) : (
|
{config.label}
|
||||||
<span style={{ color: '#999999' }}>
|
|
||||||
-
|
|
||||||
</span>
|
</span>
|
||||||
|
) : (
|
||||||
|
<span style={{ color: '#999999' }}>-</span>
|
||||||
);
|
);
|
||||||
})()}
|
})()}
|
||||||
</span>
|
</span>
|
||||||
@@ -1938,6 +1981,27 @@ export function TaskPlanningView({ selectedMachineSn, embedded = false, onStatsC
|
|||||||
{t('devices.features.autoback')}
|
{t('devices.features.autoback')}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
<span
|
||||||
|
onClick={handleEmergencyStop}
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
gap: 4,
|
||||||
|
padding: '3px 10px',
|
||||||
|
background: eStopActive ? '#cf1322' : 'rgba(255,255,255,0.18)',
|
||||||
|
borderRadius: 12,
|
||||||
|
cursor: 'pointer',
|
||||||
|
whiteSpace: 'nowrap',
|
||||||
|
fontWeight: 600,
|
||||||
|
transition: 'background 0.2s',
|
||||||
|
}}
|
||||||
|
onMouseEnter={e => { if (!eStopActive) e.currentTarget.style.background = 'rgba(255,255,255,0.3)'; }}
|
||||||
|
onMouseLeave={e => { e.currentTarget.style.background = eStopActive ? '#cf1322' : 'rgba(255,255,255,0.18)'; }}
|
||||||
|
>
|
||||||
|
<ExclamationCircleOutlined />
|
||||||
|
{eStopActive ? t('devices.estopTriggered') : t('devices.features.emergencyStop')}
|
||||||
|
</span>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
||||||
import {
|
import {
|
||||||
Row, Col, Card, Button, Space, Table, Tag, Typography, Progress, Badge,
|
Row, Col, Card, Button, Space, Table, Tag, Typography, Progress, Badge,
|
||||||
Tabs, Input, Switch, Divider, Tooltip, Timeline, Select, message, DatePicker,
|
Tabs, Input, Switch, Divider, Tooltip, Timeline, Select, message, DatePicker,
|
||||||
|
|||||||
@@ -135,6 +135,7 @@ export default class DeviceController {
|
|||||||
const key = String(it?.id ?? '');
|
const key = String(it?.id ?? '');
|
||||||
if (!key) return;
|
if (!key) return;
|
||||||
next[key] = {
|
next[key] = {
|
||||||
|
...it,
|
||||||
id: key,
|
id: key,
|
||||||
lng: String(it?.lng ?? it?.lon ?? it?.longitude),
|
lng: String(it?.lng ?? it?.lon ?? it?.longitude),
|
||||||
lat: String(it?.lat ?? it?.latitude),
|
lat: String(it?.lat ?? it?.latitude),
|
||||||
@@ -150,6 +151,8 @@ export default class DeviceController {
|
|||||||
controlMode: it?.cm ?? it?.controlMode,
|
controlMode: it?.cm ?? it?.controlMode,
|
||||||
progress: it?.p ?? it?.progress,
|
progress: it?.p ?? it?.progress,
|
||||||
workName: it?.wk ?? null,
|
workName: it?.wk ?? null,
|
||||||
|
sm: it?.sm ?? null,
|
||||||
|
emergencyStop: it?.e
|
||||||
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@@ -161,6 +164,7 @@ export default class DeviceController {
|
|||||||
console.log('task finish');
|
console.log('task finish');
|
||||||
this.onIsFinished?.(msg);
|
this.onIsFinished?.(msg);
|
||||||
} else {
|
} else {
|
||||||
|
console.log("device_task_change", msg.status)
|
||||||
this.onIsExecuting?.(true);
|
this.onIsExecuting?.(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import utils from '../../lib/utils';
|
||||||
import { eStopChange } from '../../api/device';
|
import { eStopChange } from '../../api/device';
|
||||||
|
|
||||||
// 本地锁存状态
|
// 本地锁存状态
|
||||||
@@ -43,9 +44,12 @@ export const sendEmergencyStop = async (deviceId: string) => {
|
|||||||
if (res?.code == 200) {
|
if (res?.code == 200) {
|
||||||
active = newActive;
|
active = newActive;
|
||||||
emit();
|
emit();
|
||||||
|
utils.message.success('急停状态切换成功');
|
||||||
|
|
||||||
console.log('[EmergencyStop] eStop=' + (active ? 1 : 0) + ' success');
|
console.log('[EmergencyStop] eStop=' + (active ? 1 : 0) + ' success');
|
||||||
} else {
|
} else {
|
||||||
|
utils.message.error('急停状态切换失败');
|
||||||
|
|
||||||
console.warn('[EmergencyStop] eStop failed:', res);
|
console.warn('[EmergencyStop] eStop failed:', res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1567,6 +1567,8 @@
|
|||||||
fixed2TaskSuspended22: 'Fixed2 Task Suspended2 已启动',
|
fixed2TaskSuspended22: 'Fixed2 Task Suspended2 已启动',
|
||||||
|
|
||||||
fixed2ReturnHomeFixed2CommandIssuedFixed2: 'Return Home Command Issued ',
|
fixed2ReturnHomeFixed2CommandIssuedFixed2: 'Return Home Command Issued ',
|
||||||
|
switchControl: 'switchControl',
|
||||||
|
onRemoteControl: "onRemoteControl",
|
||||||
fixed2ReturnHomeFixed2CommandIssuedFixed2Failed: 'Return Home Command Issued Failed ',
|
fixed2ReturnHomeFixed2CommandIssuedFixed2Failed: 'Return Home Command Issued Failed ',
|
||||||
|
|
||||||
commandIssuedFixed2: '回充 Command Issued Fixed2',
|
commandIssuedFixed2: '回充 Command Issued Fixed2',
|
||||||
|
|||||||
@@ -1529,9 +1529,13 @@ const zh = {
|
|||||||
"ultrasonicPresent": "超声波在位",
|
"ultrasonicPresent": "超声波在位",
|
||||||
"dacPresent": "DAC在位",
|
"dacPresent": "DAC在位",
|
||||||
"operator": "质检员",
|
"operator": "质检员",
|
||||||
|
onRemoteControl: "当前正处于远程控制状态",
|
||||||
|
|
||||||
"inspectionNo": "检测报告号",
|
"inspectionNo": "检测报告号",
|
||||||
"activeTime": "激活时间",
|
"activeTime": "激活时间",
|
||||||
"dealer": "经销商",
|
"dealer": "经销商",
|
||||||
|
switchControl: '请先模式切换',
|
||||||
|
|
||||||
taskConsecutive: '连续任务',
|
taskConsecutive: '连续任务',
|
||||||
|
|
||||||
paramEnum: {
|
paramEnum: {
|
||||||
@@ -1879,6 +1883,7 @@ const zh = {
|
|||||||
restored: '已恢复',
|
restored: '已恢复',
|
||||||
ignored: '已忽略',
|
ignored: '已忽略',
|
||||||
ignore: "忽略",
|
ignore: "忽略",
|
||||||
|
|
||||||
unableToHandle: '无法处理',
|
unableToHandle: '无法处理',
|
||||||
manufacturerHandling: '厂家处理中',
|
manufacturerHandling: '厂家处理中',
|
||||||
falseAlarm: '误报',
|
falseAlarm: '误报',
|
||||||
|
|||||||
432
src/pages/Agri.css
Normal file
432
src/pages/Agri.css
Normal file
@@ -0,0 +1,432 @@
|
|||||||
|
/* 农业AI算法分析页面样式(由 Agri.jsx 内联样式外联而来) */
|
||||||
|
|
||||||
|
/* ===== 页面骨架 ===== */
|
||||||
|
.agri-page {
|
||||||
|
padding: 8px;
|
||||||
|
background: #f4f7f9;
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-page-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-page-title.ant-typography {
|
||||||
|
margin: 0;
|
||||||
|
font-size: clamp(18px, 1.5vw, 24px);
|
||||||
|
color: #1D2129;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-main-row.ant-row {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== 顶部统计卡片 ===== */
|
||||||
|
.agri-stats-row.ant-row {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-stat-card.ant-card {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-stat-card.ant-card .ant-card-body {
|
||||||
|
padding: 20px 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-stat-head {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-stat-main {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-stat-title {
|
||||||
|
font-size: clamp(12px, 0.8vw, 13px);
|
||||||
|
color: #86909C;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-stat-value {
|
||||||
|
font-size: clamp(20px, 1.4vw, 24px);
|
||||||
|
font-weight: 800;
|
||||||
|
color: var(--agri-stat-value-color);
|
||||||
|
display: flex;
|
||||||
|
align-items: baseline;
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-stat-unit {
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #86909C;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-stat-icon-box {
|
||||||
|
width: 44px;
|
||||||
|
height: 44px;
|
||||||
|
background: var(--agri-stat-icon-bg);
|
||||||
|
border-radius: 12px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
flex-shrink: 0;
|
||||||
|
box-shadow: var(--agri-stat-icon-shadow);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== 通用间距 ===== */
|
||||||
|
.agri-mb-16 {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-mt-16.ant-row,
|
||||||
|
.agri-mt-16.ant-space {
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-mt-24,
|
||||||
|
.agri-mt-24.ant-space {
|
||||||
|
margin-top: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== 检测/分割工作区 ===== */
|
||||||
|
.agri-workspace-pane {
|
||||||
|
padding: 0 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-model-label.ant-typography {
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-model-select.ant-select {
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-field-label.ant-typography {
|
||||||
|
font-size: 13px;
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-field-hint.ant-typography {
|
||||||
|
font-size: 12px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-full-width.ant-input-number,
|
||||||
|
.agri-full-width.ant-select {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-detect-dragger.ant-upload-wrapper .ant-upload-drag {
|
||||||
|
background: #fafafa;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-seg-dragger.ant-upload-wrapper .ant-upload-drag {
|
||||||
|
background: #fafafa;
|
||||||
|
border-radius: 8px;
|
||||||
|
height: 120px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-upload-icon.anticon {
|
||||||
|
color: #1677ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-seg-drag-icon.ant-upload-drag-icon {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-seg-upload-hint {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== 结果卡片标题/提示 ===== */
|
||||||
|
.agri-card-title.ant-typography {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-card-extra.ant-typography {
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-json-hint.ant-typography {
|
||||||
|
font-size: 11px;
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-note-hint.ant-typography {
|
||||||
|
font-size: 11px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-workspace-intro.ant-typography {
|
||||||
|
font-size: 11px;
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-result-card.ant-card {
|
||||||
|
margin-top: 12px;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-result-card.ant-card .ant-card-body {
|
||||||
|
padding: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-preview-card.ant-card {
|
||||||
|
height: 480px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-side-card.ant-card {
|
||||||
|
border-radius: 8px;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-side-card.ant-card .ant-card-body {
|
||||||
|
padding: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-workspace-card.ant-card {
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-workspace-card.ant-card .ant-card-body {
|
||||||
|
padding: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-detail-card.ant-card {
|
||||||
|
height: 400px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-detail-card.ant-card .ant-card-body {
|
||||||
|
height: 350px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== 媒体/JSON 展示区 ===== */
|
||||||
|
.agri-media-stage {
|
||||||
|
height: 400px;
|
||||||
|
background: #001529;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-result-stage {
|
||||||
|
height: 400px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background: #fafafa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-json-stage {
|
||||||
|
height: 400px;
|
||||||
|
overflow-y: auto;
|
||||||
|
background: #fafafa;
|
||||||
|
padding: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-json-pre {
|
||||||
|
font-size: 10px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-media-fit {
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== 分割结果:顶部统计块 ===== */
|
||||||
|
.agri-stat-tile.ant-card {
|
||||||
|
border-radius: 8px;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-stat-tile.ant-card .ant-card-body {
|
||||||
|
padding: 12px 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-stat-tile-green.ant-card {
|
||||||
|
background: #E8FFEA;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-stat-tile-blue.ant-card {
|
||||||
|
background: #E6F4FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-stat-tile-orange.ant-card {
|
||||||
|
background: #FFF7E8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-stat-tile-purple.ant-card {
|
||||||
|
background: #F3E8FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-stat-tile-title {
|
||||||
|
font-size: 15px;
|
||||||
|
color: #86909C;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-stat-count-red.ant-statistic .ant-statistic-content {
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #FF4D4F;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-stat-count-blue.ant-statistic .ant-statistic-content {
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #1677FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-stat-count-orange.ant-statistic .ant-statistic-content {
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #FF7D00;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-stat-count-purple.ant-statistic .ant-statistic-content {
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #722ED1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== 分割结果:热成像图与热点 ===== */
|
||||||
|
.agri-thermal-stage {
|
||||||
|
background: #001529;
|
||||||
|
border-radius: 8px;
|
||||||
|
height: 400px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== 分割结果:点位详情 ===== */
|
||||||
|
.agri-detail-body {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-detail-top {
|
||||||
|
flex: 1;
|
||||||
|
min-height: 0;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding-right: 4px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-detail-bottom {
|
||||||
|
flex: 1;
|
||||||
|
min-height: 0;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding-right: 4px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-detail-row {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 8px 0;
|
||||||
|
border-bottom: 1px dashed #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-detail-divider {
|
||||||
|
height: 1px;
|
||||||
|
background: #eee;
|
||||||
|
margin: 12px 0;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-panel-item {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 8px 12px;
|
||||||
|
border-radius: 4px;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
background: var(--agri-panel-item-bg);
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-panel-temp {
|
||||||
|
color: #ff4d4f;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== 算法列表 ===== */
|
||||||
|
.agri-algo-item {
|
||||||
|
padding: 12px;
|
||||||
|
border-radius: 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
border: 1px solid var(--agri-algo-border-color);
|
||||||
|
background: var(--agri-algo-bg);
|
||||||
|
transition: all 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-algo-head {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-algo-tag.ant-tag {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-algo-meta {
|
||||||
|
font-size: 11px;
|
||||||
|
color: #999;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-algo-desc {
|
||||||
|
font-size: 11px;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== 历史记录 ===== */
|
||||||
|
.agri-history-item {
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 6px;
|
||||||
|
border: 1px solid #f0f0f0;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-history-head {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-history-id {
|
||||||
|
color: #999;
|
||||||
|
font-size: 11px;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agri-history-time {
|
||||||
|
color: #ccc;
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
@@ -24,6 +24,7 @@ import {
|
|||||||
} from '../api/aiAnalysis';
|
} from '../api/aiAnalysis';
|
||||||
import utils from '../lib/utils';
|
import utils from '../lib/utils';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import './Agri.css';
|
||||||
|
|
||||||
const { Title, Text } = Typography;
|
const { Title, Text } = Typography;
|
||||||
const { Dragger } = Upload;
|
const { Dragger } = Upload;
|
||||||
|
|||||||
38
src/pages/Alerts.css
Normal file
38
src/pages/Alerts.css
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
/* 告警中心页面样式(由 Alerts.tsx 内联样式外联而来) -- test */
|
||||||
|
|
||||||
|
.alerts-layout {
|
||||||
|
min-height: 100vh;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.alerts-topbar {
|
||||||
|
display: flex;
|
||||||
|
padding-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.alerts-title-box {
|
||||||
|
padding: 8px 12px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.alerts-title {
|
||||||
|
margin: 0;
|
||||||
|
font-size: clamp(14px, 1.2vw, 18px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.alerts-header {
|
||||||
|
padding: 0;
|
||||||
|
border-bottom: 1px solid #f0f0f0;
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
z-index: 10;
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.alerts-content {
|
||||||
|
max-height: calc(100vh - 40px);
|
||||||
|
overflow-y: auto;
|
||||||
|
background: #f5f7fa;
|
||||||
|
scrollbar-width: none;
|
||||||
|
ms-overflow-style: none;
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@ import { getMenuList } from '../api/mune';
|
|||||||
import AlarmOverview from '../components/alerts/AlarmOverview';
|
import AlarmOverview from '../components/alerts/AlarmOverview';
|
||||||
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import './Alerts.css';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -31,13 +32,13 @@ export default function AlarmCenterPage() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout style={{ minHeight: '100vh', overflow: 'hidden' }}>
|
<Layout className="alerts-layout">
|
||||||
<div style={{ display: 'flex', paddingBottom: "4px" }}>
|
<div className="alerts-topbar">
|
||||||
<div style={{ padding: '8px 12px 0' }}>
|
<div className="alerts-title-box">
|
||||||
<Typography.Title level={4} style={{ margin: 0, fontSize: 'clamp(14px, 1.2vw, 18px)' }}>{t('router.alerts')}</Typography.Title>
|
<Typography.Title level={4} className="alerts-title">{t('router.alerts')}</Typography.Title>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Header style={{ padding: 0, borderBottom: '1px solid #f0f0f0', position: 'sticky', top: 0, zIndex: 10, height: 40, lineHeight: '40px' }}>
|
<Header className="alerts-header">
|
||||||
{/*<Menu
|
{/*<Menu
|
||||||
mode="horizontal"
|
mode="horizontal"
|
||||||
selectedKeys={[activeTab]}
|
selectedKeys={[activeTab]}
|
||||||
@@ -55,10 +56,7 @@ export default function AlarmCenterPage() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<Content style={{
|
<Content className="alerts-content">
|
||||||
maxHeight: 'calc(100vh - 40px)', overflowY: 'auto', background: '#f5f7fa',
|
|
||||||
scrollbarWidth: 'none', msOverflowStyle: 'none',
|
|
||||||
}}>
|
|
||||||
{renderTabContent()}
|
{renderTabContent()}
|
||||||
</Content>
|
</Content>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|||||||
BIN
机器人智慧服务系统-用户使用手册-核心页面详解V1.0.docx
Normal file
BIN
机器人智慧服务系统-用户使用手册-核心页面详解V1.0.docx
Normal file
Binary file not shown.
Reference in New Issue
Block a user