machine-monitor-content.html 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597
  1. <!DOCTYPE html>
  2. <html lang="zh-CN" class="iframe-content">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>农机实时监控 - 爱智农</title>
  7. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css">
  8. <link rel="stylesheet" href="https://at.alicdn.com/t/font_3114978_qe0b39no76.css">
  9. <link rel="stylesheet" href="../assets/css/global.css">
  10. <style>
  11. body {
  12. font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  13. background-color: #f5f7f9;
  14. color: #333;
  15. margin: 0;
  16. padding: 0;
  17. height: auto; overflow-y: auto; overflow-x: hidden;
  18. min-height: 100%;
  19. overflow-y: auto;
  20. overflow-x: hidden;
  21. padding-top: 15px; /* 添加顶部填充以确保内容不被系统元素遮挡 */
  22. }
  23. .page-container {
  24. padding: 20px;
  25. position: relative;
  26. min-height: 100vh; width: 100%; max-width: 100%; box-sizing: border-box;
  27. padding-top: 40px; /* 增加顶部内边距,给按钮腾出空间 */
  28. }
  29. /* 防止重复菜单 */
  30. body > div:not(.page-container):not(.modal-container),
  31. iframe#sidebar,
  32. div.system-menu,
  33. [id^="system-menu"],
  34. [class^="system-menu"],
  35. #admin-sidebar,
  36. .menu-popup,
  37. .user-avatar-circle {
  38. display: none !important;
  39. width: 0 !important;
  40. height: 0 !important;
  41. opacity: 0 !important;
  42. position: absolute !important;
  43. top: -9999px !important;
  44. left: -9999px !important;
  45. z-index: -9999 !important;
  46. pointer-events: none !important;
  47. }
  48. /* 防止右侧白圈和浮动元素 */
  49. .circle-btn,
  50. .floating-circle,
  51. .round-button,
  52. .scroll-top-btn,
  53. [class*="round"],
  54. [class*="circle"],
  55. .help-btn,
  56. .chat-btn,
  57. body > .btn,
  58. body > button,
  59. body > div:not(.page-container):not(.modal-container) {
  60. display: none !important;
  61. visibility: hidden !important;
  62. opacity: 0 !important;
  63. pointer-events: none !important;
  64. }
  65. /* 页面标题和操作按钮容器 */
  66. .page-header {
  67. display: flex;
  68. justify-content: space-between;
  69. align-items: center;
  70. margin-bottom: 20px;
  71. padding-bottom: 16px;
  72. border-bottom: 1px solid #e0e0e0;
  73. padding-top: 10px;
  74. position: relative;
  75. z-index: 10;
  76. }
  77. /* 添加按钮的特定样式 */
  78. .button-container {
  79. position: relative;
  80. z-index: 20;
  81. }
  82. #refreshBtn,
  83. #settingsBtn {
  84. position: relative;
  85. z-index: 5;
  86. height: 38px;
  87. visibility: visible !important;
  88. opacity: 1 !important;
  89. display: inline-flex !important;
  90. }
  91. .card {
  92. background-color: white;
  93. border-radius: 8px;
  94. box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  95. }
  96. .map-container {
  97. height: 480px;
  98. width: 100%;
  99. position: relative;
  100. overflow: hidden;
  101. border-radius: 8px;
  102. }
  103. .monitor-card {
  104. height: 100%;
  105. transition: all 0.3s;
  106. }
  107. .monitor-card:hover {
  108. transform: translateY(-3px);
  109. box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  110. }
  111. .status-indicator {
  112. width: 10px;
  113. height: 10px;
  114. border-radius: 50%;
  115. display: inline-block;
  116. margin-right: 6px;
  117. }
  118. .status-online {
  119. background-color: #10b981;
  120. }
  121. .status-offline {
  122. background-color: #ef4444;
  123. }
  124. .status-warning {
  125. background-color: #f59e0b;
  126. }
  127. .progress-bar {
  128. height: 8px;
  129. border-radius: 4px;
  130. background-color: #e5e7eb;
  131. overflow: hidden;
  132. }
  133. .progress-fill {
  134. height: 100%;
  135. border-radius: 4px;
  136. }
  137. .btn {
  138. display: inline-flex;
  139. align-items: center;
  140. justify-content: center;
  141. padding: 8px 16px;
  142. border-radius: 4px;
  143. font-weight: 500;
  144. cursor: pointer;
  145. transition: all 0.2s;
  146. }
  147. .btn-primary {
  148. background-color: #4CAF50;
  149. color: white;
  150. }
  151. .btn-primary:hover {
  152. background-color: #388E3C;
  153. }
  154. .btn-default {
  155. background-color: white;
  156. border: 1px solid #d1d5db;
  157. color: #374151;
  158. }
  159. .btn-default:hover {
  160. background-color: #f9fafb;
  161. }
  162. .btn-sm {
  163. padding: 4px 8px;
  164. font-size: 12px;
  165. }
  166. .btn-icon {
  167. margin-right: 4px;
  168. }
  169. .map-controls {
  170. position: absolute;
  171. top: 20px;
  172. right: 20px;
  173. z-index: 10;
  174. }
  175. .map-control {
  176. background-color: white;
  177. width: 36px;
  178. height: 36px;
  179. border-radius: 4px;
  180. box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  181. display: flex;
  182. align-items: center;
  183. justify-content: center;
  184. margin-bottom: 8px;
  185. cursor: pointer;
  186. transition: all 0.2s;
  187. }
  188. .map-control:hover {
  189. background-color: #f3f4f6;
  190. }
  191. .machine-info {
  192. position: absolute;
  193. bottom: 20px;
  194. left: 20px;
  195. background-color: white;
  196. border-radius: 8px;
  197. box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  198. padding: 16px;
  199. width: 300px;
  200. max-width: 90%;
  201. display: none;
  202. }
  203. .machine-info.show {
  204. display: block;
  205. }
  206. .device-marker {
  207. cursor: pointer;
  208. transition: all 0.2s;
  209. }
  210. .device-marker:hover {
  211. transform: scale(1.1);
  212. }
  213. .gauge {
  214. position: relative;
  215. width: 100%;
  216. height: 120px;
  217. }
  218. .gauge-value {
  219. position: absolute;
  220. bottom: 0;
  221. left: 50%;
  222. transform: translateX(-50%);
  223. font-size: 20px;
  224. font-weight: bold;
  225. }
  226. .timeline {
  227. position: relative;
  228. padding-left: 32px;
  229. }
  230. .timeline-item {
  231. position: relative;
  232. padding-bottom: 16px;
  233. }
  234. .timeline-item:last-child {
  235. padding-bottom: 0;
  236. }
  237. .timeline-item::before {
  238. content: "";
  239. position: absolute;
  240. left: -24px;
  241. top: 6px;
  242. width: 12px;
  243. height: 12px;
  244. border-radius: 50%;
  245. background-color: #4CAF50;
  246. z-index: 1;
  247. }
  248. .timeline-item::after {
  249. content: "";
  250. position: absolute;
  251. left: -19px;
  252. top: 18px;
  253. width: 2px;
  254. height: calc(100% - 18px);
  255. background-color: #e5e7eb;
  256. }
  257. .timeline-item:last-child::after {
  258. display: none;
  259. }
  260. .timeline-time {
  261. font-size: 12px;
  262. color: #6b7280;
  263. margin-bottom: 2px;
  264. }
  265. .gauge-svg {
  266. width: 100%;
  267. height: 100%;
  268. }
  269. </style>
  270. </head>
  271. <body>
  272. <div class="page-container responsive-container">
  273. <div class="flex justify-between items-center mb-6 page-header">
  274. <h1 class="text-2xl font-bold">农机实时监控</h1>
  275. <div class="flex gap-2 button-container">
  276. <button class="btn btn-default" id="refreshBtn">
  277. <i class="iconfont icon-reload btn-icon"></i>
  278. 刷新数据
  279. </button>
  280. <button class="btn btn-primary" id="settingsBtn">
  281. <i class="iconfont icon-setting btn-icon"></i>
  282. 监控设置
  283. </button>
  284. </div>
  285. </div>
  286. <div class="grid grid-cols-1 lg:grid-cols-4 gap-6 mb-6">
  287. <div class="card p-4 text-center">
  288. <div class="text-gray-500 mb-1">在线设备</div>
  289. <div class="text-3xl font-bold text-green-600">8</div>
  290. <div class="text-sm text-gray-400 mt-1">总数:12</div>
  291. </div>
  292. <div class="card p-4 text-center">
  293. <div class="text-gray-500 mb-1">作业中</div>
  294. <div class="text-3xl font-bold text-blue-600">5</div>
  295. <div class="text-sm text-gray-400 mt-1">总数:8</div>
  296. </div>
  297. <div class="card p-4 text-center">
  298. <div class="text-gray-500 mb-1">告警设备</div>
  299. <div class="text-3xl font-bold text-yellow-600">2</div>
  300. <div class="text-sm text-gray-400 mt-1">未处理:1</div>
  301. </div>
  302. <div class="card p-4 text-center">
  303. <div class="text-gray-500 mb-1">今日作业面积</div>
  304. <div class="text-3xl font-bold text-purple-600">126 亩</div>
  305. <div class="text-sm text-gray-400 mt-1">计划:180 亩</div>
  306. </div>
  307. </div>
  308. <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
  309. <div class="lg:col-span-2">
  310. <div class="card">
  311. <div class="map-container">
  312. <!-- 模拟地图,实际项目中应替换为地图组件 -->
  313. <svg width="100%" height="100%" viewBox="0 0 1000 600" preserveAspectRatio="xMidYMid slice">
  314. <defs>
  315. <pattern id="grid" width="50" height="50" patternUnits="userSpaceOnUse">
  316. <path d="M 50 0 L 0 0 0 50" fill="none" stroke="#ccc" stroke-width="1"/>
  317. </pattern>
  318. </defs>
  319. <rect width="100%" height="100%" fill="#f3f4f6"/>
  320. <rect width="100%" height="100%" fill="url(#grid)"/>
  321. <!-- 地块区域 -->
  322. <polygon points="150,150 350,150 350,250 150,250" fill="#4CAF5022" stroke="#4CAF50" stroke-width="2"/>
  323. <polygon points="400,150 500,150 500,350 400,350" fill="#FF980022" stroke="#FF9800" stroke-width="2"/>
  324. <polygon points="150,300 350,300 350,450 150,450" fill="#2196F322" stroke="#2196F3" stroke-width="2"/>
  325. <polygon points="600,150 800,150 800,300 600,300" fill="#9C27B022" stroke="#9C27B0" stroke-width="2"/>
  326. <!-- 道路 -->
  327. <line x1="0" y1="400" x2="1000" y2="400" stroke="#795548" stroke-width="15"/>
  328. <line x1="550" y1="0" x2="550" y2="600" stroke="#795548" stroke-width="10"/>
  329. <!-- 设备位置标记 -->
  330. <circle cx="250" cy="200" r="12" fill="#4CAF50" class="device-marker" data-id="1"/>
  331. <circle cx="450" cy="250" r="12" fill="#FF9800" class="device-marker" data-id="2"/>
  332. <circle cx="250" cy="350" r="12" fill="#2196F3" class="device-marker" data-id="3"/>
  333. <circle cx="700" cy="220" r="12" fill="#ef4444" class="device-marker" data-id="4"/>
  334. <circle cx="600" cy="400" r="12" fill="#4CAF50" class="device-marker" data-id="5"/>
  335. <!-- 设备移动路径 -->
  336. <path d="M 250,200 L 260,210 L 270,230 L 290,240" fill="none" stroke="#4CAF5088" stroke-width="3" stroke-dasharray="5,5"/>
  337. <path d="M 450,250 L 460,270 L 470,300 L 480,320" fill="none" stroke="#FF980088" stroke-width="3" stroke-dasharray="5,5"/>
  338. </svg>
  339. <!-- 地图控制按钮 -->
  340. <div class="map-controls">
  341. <div class="map-control" title="放大">
  342. <i class="iconfont icon-zoom-in"></i>
  343. </div>
  344. <div class="map-control" title="缩小">
  345. <i class="iconfont icon-zoom-out"></i>
  346. </div>
  347. <div class="map-control" title="定位">
  348. <i class="iconfont icon-location"></i>
  349. </div>
  350. <div class="map-control" title="全屏">
  351. <i class="iconfont icon-fullscreen"></i>
  352. </div>
  353. </div>
  354. <!-- 设备信息窗口 -->
  355. <div class="machine-info" id="machineInfo">
  356. <div class="flex justify-between items-center mb-4">
  357. <h3 class="font-bold">拖拉机 #1</h3>
  358. <div class="flex items-center">
  359. <span class="status-indicator status-online"></span>
  360. <span>在线</span>
  361. </div>
  362. </div>
  363. <div class="mb-4">
  364. <div class="mb-1 flex justify-between">
  365. <span>设备状态</span>
  366. <span class="font-medium">作业中</span>
  367. </div>
  368. <div class="mb-1 flex justify-between">
  369. <span>当前速度</span>
  370. <span class="font-medium">5.6 km/h</span>
  371. </div>
  372. <div class="mb-1 flex justify-between">
  373. <span>油量</span>
  374. <span class="font-medium">75%</span>
  375. </div>
  376. <div class="mb-1 flex justify-between">
  377. <span>作业面积</span>
  378. <span class="font-medium">35 亩</span>
  379. </div>
  380. <div class="mb-1 flex justify-between">
  381. <span>运行时间</span>
  382. <span class="font-medium">3.5 小时</span>
  383. </div>
  384. </div>
  385. <div class="flex gap-2">
  386. <button class="btn btn-default btn-sm flex-1">
  387. <i class="iconfont icon-eye btn-icon"></i>
  388. 实时视频
  389. </button>
  390. <button class="btn btn-default btn-sm flex-1">
  391. <i class="iconfont icon-file-text btn-icon"></i>
  392. 详细信息
  393. </button>
  394. </div>
  395. </div>
  396. </div>
  397. </div>
  398. </div>
  399. <div class="grid grid-rows-3 gap-6">
  400. <!-- 设备列表 -->
  401. <div class="card p-4 row-span-1 overflow-auto" style="max-height: 300px;">
  402. <h3 class="font-bold mb-4">设备列表</h3>
  403. <div class="mb-3 pb-3 border-b">
  404. <div class="flex justify-between items-center mb-1">
  405. <div class="flex items-center">
  406. <span class="status-indicator status-online"></span>
  407. <span class="font-medium">拖拉机 #1</span>
  408. </div>
  409. <span class="text-xs bg-green-100 text-green-800 px-2 py-1 rounded">作业中</span>
  410. </div>
  411. <div class="text-xs text-gray-500">东区1号地块 | 驾驶员:张三</div>
  412. </div>
  413. <div class="mb-3 pb-3 border-b">
  414. <div class="flex justify-between items-center mb-1">
  415. <div class="flex items-center">
  416. <span class="status-indicator status-warning"></span>
  417. <span class="font-medium">收割机 #2</span>
  418. </div>
  419. <span class="text-xs bg-yellow-100 text-yellow-800 px-2 py-1 rounded">告警</span>
  420. </div>
  421. <div class="text-xs text-gray-500">西区2号地块 | 驾驶员:李四</div>
  422. </div>
  423. <div class="mb-3 pb-3 border-b">
  424. <div class="flex justify-between items-center mb-1">
  425. <div class="flex items-center">
  426. <span class="status-indicator status-online"></span>
  427. <span class="font-medium">播种机 #3</span>
  428. </div>
  429. <span class="text-xs bg-green-100 text-green-800 px-2 py-1 rounded">作业中</span>
  430. </div>
  431. <div class="text-xs text-gray-500">南区3号地块 | 驾驶员:王五</div>
  432. </div>
  433. <div class="mb-3 pb-3 border-b">
  434. <div class="flex justify-between items-center mb-1">
  435. <div class="flex items-center">
  436. <span class="status-indicator status-offline"></span>
  437. <span class="font-medium">喷药机 #4</span>
  438. </div>
  439. <span class="text-xs bg-red-100 text-red-800 px-2 py-1 rounded">离线</span>
  440. </div>
  441. <div class="text-xs text-gray-500">北区4号地块 | 驾驶员:赵六</div>
  442. </div>
  443. <div class="mb-3 pb-3 border-b">
  444. <div class="flex justify-between items-center mb-1">
  445. <div class="flex items-center">
  446. <span class="status-indicator status-online"></span>
  447. <span class="font-medium">拖拉机 #5</span>
  448. </div>
  449. <span class="text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded">待机</span>
  450. </div>
  451. <div class="text-xs text-gray-500">中央区域 | 驾驶员:钱七</div>
  452. </div>
  453. </div>
  454. <!-- 燃油监控 -->
  455. <div class="card p-4 row-span-1">
  456. <h3 class="font-bold mb-4">燃油监控</h3>
  457. <div class="gauge">
  458. <svg class="gauge-svg" viewBox="0 0 200 100">
  459. <path d="M 40 90 A 60 60 0 0 1 160 90" fill="none" stroke="#e5e7eb" stroke-width="16" stroke-linecap="round" />
  460. <path d="M 40 90 A 60 60 0 0 1 160 90" fill="none" stroke="#4CAF50" stroke-width="16" stroke-linecap="round" stroke-dasharray="188.5 188.5" stroke-dashoffset="47.1" />
  461. </svg>
  462. <div class="gauge-value">75%</div>
  463. </div>
  464. <div class="grid grid-cols-2 gap-4 mt-2">
  465. <div>
  466. <div class="text-xs text-gray-500 mb-1">今日消耗</div>
  467. <div class="font-medium">32.5 L</div>
  468. </div>
  469. <div>
  470. <div class="text-xs text-gray-500 mb-1">剩余可用</div>
  471. <div class="font-medium">125.8 L</div>
  472. </div>
  473. <div>
  474. <div class="text-xs text-gray-500 mb-1">平均油耗</div>
  475. <div class="font-medium">9.2 L/h</div>
  476. </div>
  477. <div>
  478. <div class="text-xs text-gray-500 mb-1">预计续航</div>
  479. <div class="font-medium">13.7 小时</div>
  480. </div>
  481. </div>
  482. </div>
  483. <!-- 设备动态 -->
  484. <div class="card p-4 row-span-1">
  485. <h3 class="font-bold mb-4">设备动态</h3>
  486. <div class="timeline">
  487. <div class="timeline-item">
  488. <div class="timeline-time">10:25</div>
  489. <div class="font-medium">拖拉机 #1 开始作业</div>
  490. </div>
  491. <div class="timeline-item">
  492. <div class="timeline-time">09:48</div>
  493. <div class="font-medium">收割机 #2 发出低油量警告</div>
  494. </div>
  495. <div class="timeline-item">
  496. <div class="timeline-time">09:15</div>
  497. <div class="font-medium">播种机 #3 完成作业</div>
  498. </div>
  499. <div class="timeline-item">
  500. <div class="timeline-time">08:30</div>
  501. <div class="font-medium">喷药机 #4 离线</div>
  502. </div>
  503. </div>
  504. </div>
  505. </div>
  506. </div>
  507. </div>
  508. <script>
  509. document.addEventListener('DOMContentLoaded', function() {
  510. // 点击设备标记显示信息窗口
  511. const deviceMarkers = document.querySelectorAll('.device-marker');
  512. const machineInfo = document.getElementById('machineInfo');
  513. deviceMarkers.forEach(marker => {
  514. marker.addEventListener('click', function() {
  515. const deviceId = this.getAttribute('data-id');
  516. // 在实际应用中,这里应该根据设备ID获取详细信息
  517. machineInfo.style.display = 'block';
  518. });
  519. });
  520. // 模拟实时数据更新
  521. setInterval(function() {
  522. // 这里可以添加实时数据更新逻辑
  523. // 例如通过WebSocket接收设备位置、状态等信息
  524. }, 3000);
  525. });
  526. </script>
  527. </body>
  528. </html>