diff --git a/.workbuddy/memory/2026-11-16.md b/.workbuddy/memory/2026-11-16.md index f08a9ef..d5bc602 100644 --- a/.workbuddy/memory/2026-11-16.md +++ b/.workbuddy/memory/2026-11-16.md @@ -16,3 +16,30 @@ - `软著/机器人智慧服务系统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) - 模板规则提醒:源代码超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页) diff --git a/.workbuddy/memory/2026-11-17.md b/.workbuddy/memory/2026-11-17.md new file mode 100644 index 0000000..0567a14 --- /dev/null +++ b/.workbuddy/memory/2026-11-17.md @@ -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 打开时有 ~$ 锁文件,操作临时副本即可 diff --git a/src/components/AgrtcRoomRobot.tsx b/src/components/AgrtcRoomRobot.tsx index 626a6cf..ca7cfd3 100644 --- a/src/components/AgrtcRoomRobot.tsx +++ b/src/components/AgrtcRoomRobot.tsx @@ -4,8 +4,8 @@ import { Badge, message } from "antd"; AgoraRTC.setLogLevel(2); // 2=只输出warning/error,屏蔽debug日志 -const APP_ID = "7887b4db6033410d9ac3264b40ca9c1a"; -const TOKEN = "007eJxTYPh6QSj59sUzD3mPNm64dK9n/n1PP64UzrhzdwUeqMUKv1BVYDC3sDBPMklJMjMwNjYxNEixTEw2NjIzSTIxSE60TDZMlOdYldUQyMiQXKbEwAiFID43g4mhbklGUWpiroExAwMAjGAhHQ=="; +const APP_ID = "5afc6f096ddf433aa690df6f251274a4"; +const TOKEN = "007eJxTYHj/XqzNYP1utbUqvUkLly0/ypRz8liNgdKBqBeqqzX3+WgqMJgmpiWbpRlYmqWkpJkYGycmmlkapKSZpRmZGhqZmySaRH37ndUQyMjgu3k5KyMDBIL47AzJiblGuobmDAwA6vwg4g=="; export default function AgrtcRoomRobot({ CHANNEL }: { CHANNEL: string }) { const [uid] = useState(() => Number(Math.floor(Math.random() * 100000))); diff --git a/src/components/devices/DeviceOverviewPage.css b/src/components/devices/DeviceOverviewPage.css new file mode 100644 index 0000000..9072d72 --- /dev/null +++ b/src/components/devices/DeviceOverviewPage.css @@ -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; +} diff --git a/src/components/devices/DeviceOverviewPage.tsx b/src/components/devices/DeviceOverviewPage.tsx index a3ce302..0711b9c 100644 --- a/src/components/devices/DeviceOverviewPage.tsx +++ b/src/components/devices/DeviceOverviewPage.tsx @@ -44,6 +44,7 @@ import { sendEmergencyStop, subscribeEmergencyStop, syncEmergencyStop } from './ import AlarmLevelTag from '../AlarmLevelTag.tsx'; import { getDeviceTastPool } from '@/api/device.ts'; import { backToRestPointCommand } from '@/api/mapEdit'; +import './DeviceOverviewPage.css'; const { Content } = Layout; const { Text, Title } = Typography; @@ -245,6 +246,7 @@ export default function DeviceOverviewPage() { feStatus: rt?.feStatus, taskId: rt?.t, isRealtimeOnly: true, + emergencyStop: rt?.emergencyStop, // 同步写入 locationMessage / lastRunningStatus,确保 Map.jsx 设备渲染 useEffect 能读到实时坐标 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 }, @@ -293,7 +295,15 @@ export default function DeviceOverviewPage() { (d?.longitude && d?.latitude) ); }, [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) => { // 仅机器人允许编辑,无人机直接提示 @@ -475,8 +485,8 @@ export default function DeviceOverviewPage() { // 实时数据里的急停状态同步到共享锁存状态:true=已急停,false=未急停 useEffect(() => { - syncEmergencyStop(realtimeDevice?.emergency_stop); - }, [realtimeDevice?.emergency_stop]); + syncEmergencyStop(realtimeDevice?.emergencyStop); + }, [realtimeDevice?.emergencyStop]); // MQTT消息处理 const handleMqttMessage = useCallback((topic, message) => { @@ -700,7 +710,7 @@ export default function DeviceOverviewPage() { return [ { title: t('devices.fixed2DroneAirportFixed2StatusFixed2'), - icon: , + icon: , value: `${onlineDrones} / ${totalDrones}`, sub: `${t('devices.distributable')} ${onlineDrones} ${t('devices.UnitsDrone')}`, color: '#165DFF', @@ -708,7 +718,7 @@ export default function DeviceOverviewPage() { }, { title: t('home.inspectionRobot'), - icon: , + icon: , value: `${onlineRobots} / ${totalRobots}`, sub: `${t('devices.online')} ${onlineRobots}`, color: '#13c2c2', @@ -716,7 +726,7 @@ export default function DeviceOverviewPage() { }, { title: t('devices.mowingRobot'), - icon: , + icon: , value: `${totalRobots} ${t('devices.UnitsRobot')}`, sub: `${t('devices.executing')} ${activeMowers}`, color: '#722ED1', @@ -724,7 +734,7 @@ export default function DeviceOverviewPage() { }, { title: t('devices.washDrone'), - icon: , + icon: , value: `${totalDrones} ${t('devices.UnitsDrone')}`, sub: `${t('devices.waiting')} ${washDroneStandby}`, color: '#eb2f96', @@ -732,7 +742,7 @@ export default function DeviceOverviewPage() { }, { title: t('devices.todayTaskExecute'), - icon: , + icon: , value: `${completedTasks} / ${totalTasks}`, sub: `${t('devices.completionRate')} ${completionRate}%`, color: '#2f54eb', @@ -833,46 +843,35 @@ export default function DeviceOverviewPage() { }, [selectedDevice]); return ( -
-
- {t('devices.fixed2Equipment')} +
+
+ {t('devices.fixed2Equipment')}
- - + + {dynamicTopCards.map((card, idx) => ( - + {/* 左侧文字区域 */} -
-
+
+
{card.title}
-
+
{card.value}
{/* 底部环比/备注 */} - {card.sub &&
+ {card.sub &&
{card.sub}
}
{/* 右侧圆形图标区域 */}
{card.icon}
@@ -883,8 +882,8 @@ export default function DeviceOverviewPage() { - {t('devices.fixed2Equipment')}} extra={