crop-yield-prediction.html 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  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. <script src="https://cdn.jsdelivr.net/npm/echarts@5.4.0/dist/echarts.min.js"></script>
  11. <style>
  12. body {
  13. font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  14. background-color: #f5f7f9;
  15. color: #333;
  16. }
  17. .page-container {
  18. padding: 20px;
  19. }
  20. .card {
  21. background-color: white;
  22. border-radius: 8px;
  23. box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  24. }
  25. .btn {
  26. display: inline-flex;
  27. align-items: center;
  28. justify-content: center;
  29. padding: 8px 16px;
  30. border-radius: 4px;
  31. font-weight: 500;
  32. cursor: pointer;
  33. transition: all 0.2s;
  34. }
  35. .btn-primary {
  36. background-color: #4CAF50;
  37. color: white;
  38. }
  39. .btn-primary:hover {
  40. background-color: #388E3C;
  41. }
  42. .btn-default {
  43. background-color: white;
  44. border: 1px solid #d1d5db;
  45. color: #374151;
  46. }
  47. .btn-default:hover {
  48. background-color: #f9fafb;
  49. }
  50. .chart-container {
  51. height: 350px;
  52. width: 100%;
  53. }
  54. .prediction-card {
  55. background: linear-gradient(135deg, #e0f2f1, #b2dfdb);
  56. border-left: 4px solid #4CAF50;
  57. }
  58. .yield-indicator {
  59. position: relative;
  60. height: 40px;
  61. width: 100%;
  62. background-color: #f3f4f6;
  63. border-radius: 20px;
  64. margin: 20px 0;
  65. overflow: hidden;
  66. }
  67. .yield-range {
  68. position: absolute;
  69. height: 100%;
  70. background: linear-gradient(90deg, #4CAF50, #8BC34A);
  71. border-radius: 20px;
  72. }
  73. .yield-marker {
  74. position: absolute;
  75. top: -6px;
  76. width: 12px;
  77. height: 52px;
  78. background-color: #1e293b;
  79. z-index: 5;
  80. }
  81. .yield-label {
  82. position: absolute;
  83. bottom: -25px;
  84. transform: translateX(-50%);
  85. font-size: 12px;
  86. white-space: nowrap;
  87. }
  88. .factor-card {
  89. border-left: 3px solid;
  90. transition: all 0.2s;
  91. }
  92. .factor-card:hover {
  93. transform: translateY(-2px);
  94. box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  95. }
  96. .positive-factor {
  97. border-color: #4CAF50;
  98. }
  99. .negative-factor {
  100. border-color: #f44336;
  101. }
  102. .neutral-factor {
  103. border-color: #9e9e9e;
  104. }
  105. .factor-icon {
  106. width: 36px;
  107. height: 36px;
  108. border-radius: 50%;
  109. display: flex;
  110. align-items: center;
  111. justify-content: center;
  112. font-size: 18px;
  113. }
  114. .positive-icon {
  115. background-color: #e8f5e9;
  116. color: #4CAF50;
  117. }
  118. .negative-icon {
  119. background-color: #ffebee;
  120. color: #f44336;
  121. }
  122. .neutral-icon {
  123. background-color: #f5f5f5;
  124. color: #9e9e9e;
  125. }
  126. .impact-meter {
  127. height: 6px;
  128. background-color: #e5e7eb;
  129. border-radius: 3px;
  130. overflow: hidden;
  131. }
  132. .impact-fill {
  133. height: 100%;
  134. border-radius: 3px;
  135. }
  136. .positive-impact {
  137. background-color: #4CAF50;
  138. }
  139. .negative-impact {
  140. background-color: #f44336;
  141. }
  142. .neutral-impact {
  143. background-color: #9e9e9e;
  144. }
  145. .filter-button {
  146. padding: 6px 12px;
  147. border-radius: 16px;
  148. font-size: 14px;
  149. transition: all 0.2s;
  150. }
  151. .filter-button.active {
  152. background-color: #4CAF50;
  153. color: white;
  154. }
  155. </style>
  156. </head>
  157. <body>
  158. <div class="page-container">
  159. <div class="flex justify-between items-center mb-6">
  160. <h1 class="text-2xl font-bold">产量智能预测</h1>
  161. <div class="flex gap-2">
  162. <button class="btn btn-default">
  163. <i class="iconfont icon-history mr-1"></i>
  164. 历史预测
  165. </button>
  166. <button class="btn btn-default">
  167. <i class="iconfont icon-download mr-1"></i>
  168. 导出报告
  169. </button>
  170. <button class="btn btn-primary">
  171. <i class="iconfont icon-reload mr-1"></i>
  172. 更新预测
  173. </button>
  174. </div>
  175. </div>
  176. <!-- 筛选器 -->
  177. <div class="mb-6 flex items-center">
  178. <div class="mr-3 text-gray-500">筛选:</div>
  179. <div class="flex gap-2">
  180. <button class="filter-button bg-gray-100 active">全部作物</button>
  181. <button class="filter-button bg-gray-100">水稻</button>
  182. <button class="filter-button bg-gray-100">小麦</button>
  183. <button class="filter-button bg-gray-100">玉米</button>
  184. <button class="filter-button bg-gray-100">大豆</button>
  185. </div>
  186. <div class="ml-auto">
  187. <select class="px-3 py-2 bg-white border border-gray-300 rounded-md">
  188. <option>2023年</option>
  189. <option>2022年</option>
  190. <option>2021年</option>
  191. </select>
  192. </div>
  193. </div>
  194. <!-- 产量预测总览 -->
  195. <div class="card p-6 mb-6">
  196. <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
  197. <div class="col-span-2">
  198. <h2 class="text-lg font-bold mb-4">农场产量预测</h2>
  199. <div id="yieldPredictionChart" class="chart-container"></div>
  200. </div>
  201. <div>
  202. <h2 class="text-lg font-bold mb-4">本年度产量预计</h2>
  203. <div class="space-y-6">
  204. <div class="prediction-card p-4 rounded-md">
  205. <div class="flex justify-between items-center">
  206. <div class="text-sm text-gray-600">总产量预测</div>
  207. <div class="text-lg font-bold">2,850 吨</div>
  208. </div>
  209. <div class="text-sm text-green-600 mt-1">
  210. <i class="iconfont icon-arrow-up"></i>
  211. 较去年 +8.2%
  212. </div>
  213. <div class="text-xs text-gray-500 mt-1">
  214. 置信区间: 2,730 - 2,950 吨
  215. </div>
  216. </div>
  217. <div class="prediction-card p-4 rounded-md">
  218. <div class="flex justify-between items-center">
  219. <div class="text-sm text-gray-600">亩均产量预测</div>
  220. <div class="text-lg font-bold">1,120 斤</div>
  221. </div>
  222. <div class="text-sm text-green-600 mt-1">
  223. <i class="iconfont icon-arrow-up"></i>
  224. 较去年 +5.6%
  225. </div>
  226. <div class="text-xs text-gray-500 mt-1">
  227. 置信区间: 1,080 - 1,150 斤
  228. </div>
  229. </div>
  230. <div class="prediction-card p-4 rounded-md">
  231. <div class="flex justify-between items-center">
  232. <div class="text-sm text-gray-600">潜在最高产量</div>
  233. <div class="text-lg font-bold">3,120 吨</div>
  234. </div>
  235. <div class="text-xs text-gray-500 mt-1">
  236. 实现率: 91.3% (优)
  237. </div>
  238. </div>
  239. </div>
  240. </div>
  241. </div>
  242. </div>
  243. <!-- 作物产量预测详情 -->
  244. <div class="card p-6 mb-6">
  245. <h2 class="text-lg font-bold mb-4">各作物产量预测详情</h2>
  246. <div class="overflow-x-auto">
  247. <table class="min-w-full">
  248. <thead>
  249. <tr class="bg-gray-50">
  250. <th class="px-4 py-3 text-left">作物</th>
  251. <th class="px-4 py-3 text-left">种植面积(亩)</th>
  252. <th class="px-4 py-3 text-left">预测产量(吨)</th>
  253. <th class="px-4 py-3 text-left">亩均产量(斤)</th>
  254. <th class="px-4 py-3 text-left">较去年</th>
  255. <th class="px-4 py-3 text-left">预测准确率</th>
  256. <th class="px-4 py-3 text-left">风险因素</th>
  257. </tr>
  258. </thead>
  259. <tbody class="divide-y">
  260. <tr class="hover:bg-gray-50">
  261. <td class="px-4 py-3">
  262. <div class="flex items-center">
  263. <div class="w-8 h-8 rounded-full bg-yellow-100 flex items-center justify-center mr-2">
  264. 🌾
  265. </div>
  266. 水稻
  267. </div>
  268. </td>
  269. <td class="px-4 py-3">1,200</td>
  270. <td class="px-4 py-3 font-medium">1,380</td>
  271. <td class="px-4 py-3">1,150</td>
  272. <td class="px-4 py-3 text-green-600">+9.1%</td>
  273. <td class="px-4 py-3">92%</td>
  274. <td class="px-4 py-3">
  275. <span class="bg-yellow-100 text-yellow-800 rounded-full px-2 py-1 text-xs">高温</span>
  276. </td>
  277. </tr>
  278. <tr class="hover:bg-gray-50">
  279. <td class="px-4 py-3">
  280. <div class="flex items-center">
  281. <div class="w-8 h-8 rounded-full bg-amber-100 flex items-center justify-center mr-2">
  282. 🌽
  283. </div>
  284. 玉米
  285. </div>
  286. </td>
  287. <td class="px-4 py-3">800</td>
  288. <td class="px-4 py-3 font-medium">920</td>
  289. <td class="px-4 py-3">1,150</td>
  290. <td class="px-4 py-3 text-green-600">+7.3%</td>
  291. <td class="px-4 py-3">88%</td>
  292. <td class="px-4 py-3">
  293. <span class="bg-blue-100 text-blue-800 rounded-full px-2 py-1 text-xs">雨量</span>
  294. </td>
  295. </tr>
  296. <tr class="hover:bg-gray-50">
  297. <td class="px-4 py-3">
  298. <div class="flex items-center">
  299. <div class="w-8 h-8 rounded-full bg-amber-50 flex items-center justify-center mr-2">
  300. 🌾
  301. </div>
  302. 小麦
  303. </div>
  304. </td>
  305. <td class="px-4 py-3">600</td>
  306. <td class="px-4 py-3 font-medium">480</td>
  307. <td class="px-4 py-3">800</td>
  308. <td class="px-4 py-3 text-red-600">-2.1%</td>
  309. <td class="px-4 py-3">85%</td>
  310. <td class="px-4 py-3">
  311. <span class="bg-red-100 text-red-800 rounded-full px-2 py-1 text-xs">病害</span>
  312. </td>
  313. </tr>
  314. <tr class="hover:bg-gray-50">
  315. <td class="px-4 py-3">
  316. <div class="flex items-center">
  317. <div class="w-8 h-8 rounded-full bg-green-100 flex items-center justify-center mr-2">
  318. 🫘
  319. </div>
  320. 大豆
  321. </div>
  322. </td>
  323. <td class="px-4 py-3">120</td>
  324. <td class="px-4 py-3 font-medium">70</td>
  325. <td class="px-4 py-3">583</td>
  326. <td class="px-4 py-3 text-green-600">+11.5%</td>
  327. <td class="px-4 py-3">90%</td>
  328. <td class="px-4 py-3">
  329. <span class="bg-gray-100 text-gray-800 rounded-full px-2 py-1 text-xs">无</span>
  330. </td>
  331. </tr>
  332. </tbody>
  333. </table>
  334. </div>
  335. </div>
  336. <!-- 水稻产量详细预测 -->
  337. <div class="card p-6 mb-6">
  338. <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
  339. <div class="lg:col-span-2">
  340. <div class="flex justify-between items-center mb-4">
  341. <h2 class="text-lg font-bold">水稻产量详细预测</h2>
  342. <select class="px-3 py-2 bg-white border border-gray-300 rounded-md text-sm">
  343. <option>按地块查看</option>
  344. <option>按月份查看</option>
  345. <option>按品种查看</option>
  346. </select>
  347. </div>
  348. <div id="detailedPredictionChart" class="chart-container mb-4"></div>
  349. <div>
  350. <h3 class="font-medium mb-2">产量预测区间</h3>
  351. <div class="yield-indicator">
  352. <div class="yield-range" style="left: 20%; right: 20%"></div>
  353. <div class="yield-marker" style="left: 50%"></div>
  354. <div class="yield-label" style="left: 0%">
  355. 低产 (1,000吨)
  356. </div>
  357. <div class="yield-label" style="left: 20%">
  358. 1,240吨
  359. </div>
  360. <div class="yield-label" style="left: 50%">
  361. 预测值: 1,380吨
  362. </div>
  363. <div class="yield-label" style="left: 80%">
  364. 1,520吨
  365. </div>
  366. <div class="yield-label" style="left: 100%">
  367. 高产 (1,650吨)
  368. </div>
  369. </div>
  370. </div>
  371. </div>
  372. <div>
  373. <h2 class="text-lg font-bold mb-4">影响因素分析</h2>
  374. <div class="space-y-3">
  375. <div class="factor-card positive-factor p-3 bg-white rounded-md shadow-sm">
  376. <div class="flex items-center">
  377. <div class="factor-icon positive-icon mr-3">
  378. <i class="iconfont icon-sun"></i>
  379. </div>
  380. <div>
  381. <div class="font-medium">光照充足</div>
  382. <div class="text-xs text-gray-500">平均日照时长较理想值高8%</div>
  383. <div class="flex items-center mt-1">
  384. <div class="text-xs mr-2">影响:</div>
  385. <div class="impact-meter flex-grow">
  386. <div class="impact-fill positive-impact" style="width: 75%"></div>
  387. </div>
  388. <div class="text-xs ml-2">+7.5%</div>
  389. </div>
  390. </div>
  391. </div>
  392. </div>
  393. <div class="factor-card positive-factor p-3 bg-white rounded-md shadow-sm">
  394. <div class="flex items-center">
  395. <div class="factor-icon positive-icon mr-3">
  396. <i class="iconfont icon-experiment"></i>
  397. </div>
  398. <div>
  399. <div class="font-medium">优质品种</div>
  400. <div class="text-xs text-gray-500">使用"丰优838"高产水稻品种</div>
  401. <div class="flex items-center mt-1">
  402. <div class="text-xs mr-2">影响:</div>
  403. <div class="impact-meter flex-grow">
  404. <div class="impact-fill positive-impact" style="width: 60%"></div>
  405. </div>
  406. <div class="text-xs ml-2">+6.0%</div>
  407. </div>
  408. </div>
  409. </div>
  410. </div>
  411. <div class="factor-card neutral-factor p-3 bg-white rounded-md shadow-sm">
  412. <div class="flex items-center">
  413. <div class="factor-icon neutral-icon mr-3">
  414. <i class="iconfont icon-water"></i>
  415. </div>
  416. <div>
  417. <div class="font-medium">降水量适中</div>
  418. <div class="text-xs text-gray-500">降水量与多年平均值相当</div>
  419. <div class="flex items-center mt-1">
  420. <div class="text-xs mr-2">影响:</div>
  421. <div class="impact-meter flex-grow">
  422. <div class="impact-fill neutral-impact" style="width: 40%"></div>
  423. </div>
  424. <div class="text-xs ml-2">+0.5%</div>
  425. </div>
  426. </div>
  427. </div>
  428. </div>
  429. <div class="factor-card negative-factor p-3 bg-white rounded-md shadow-sm">
  430. <div class="flex items-center">
  431. <div class="factor-icon negative-icon mr-3">
  432. <i class="iconfont icon-temperature"></i>
  433. </div>
  434. <div>
  435. <div class="font-medium">高温胁迫</div>
  436. <div class="text-xs text-gray-500">灌浆期连续5天高温(>35°C)</div>
  437. <div class="flex items-center mt-1">
  438. <div class="text-xs mr-2">影响:</div>
  439. <div class="impact-meter flex-grow">
  440. <div class="impact-fill negative-impact" style="width: 50%"></div>
  441. </div>
  442. <div class="text-xs ml-2">-5.0%</div>
  443. </div>
  444. </div>
  445. </div>
  446. </div>
  447. </div>
  448. <div class="mt-4 p-4 bg-gray-50 rounded-md">
  449. <h3 class="font-medium mb-2">AI优化建议</h3>
  450. <ul class="text-sm space-y-2">
  451. <li class="flex">
  452. <i class="iconfont icon-check-circle text-green-500 mr-2"></i>
  453. <span>针对高温胁迫,建议增加灌溉频次,保持田间湿度</span>
  454. </li>
  455. <li class="flex">
  456. <i class="iconfont icon-check-circle text-green-500 mr-2"></i>
  457. <span>适当增加钾肥施用量,提高植株抗逆性</span>
  458. </li>
  459. <li class="flex">
  460. <i class="iconfont icon-check-circle text-green-500 mr-2"></i>
  461. <span>预计产量可提升至1,450吨(+5%)</span>
  462. </li>
  463. </ul>
  464. </div>
  465. </div>
  466. </div>
  467. </div>
  468. </div>
  469. <script>
  470. document.addEventListener('DOMContentLoaded', function() {
  471. // 总体产量预测图表
  472. const yieldPredictionChart = echarts.init(document.getElementById('yieldPredictionChart'));
  473. yieldPredictionChart.setOption({
  474. tooltip: {
  475. trigger: 'axis',
  476. axisPointer: {
  477. type: 'shadow'
  478. }
  479. },
  480. legend: {
  481. data: ['实际产量', '预测产量', '误差范围']
  482. },
  483. grid: {
  484. left: '3%',
  485. right: '4%',
  486. bottom: '3%',
  487. containLabel: true
  488. },
  489. xAxis: {
  490. type: 'category',
  491. data: ['2017', '2018', '2019', '2020', '2021', '2022', '2023']
  492. },
  493. yAxis: {
  494. type: 'value',
  495. name: '产量(吨)'
  496. },
  497. series: [
  498. {
  499. name: '实际产量',
  500. type: 'bar',
  501. data: [1800, 1920, 2100, 2250, 2400, 2630, null],
  502. color: '#66BB6A'
  503. },
  504. {
  505. name: '预测产量',
  506. type: 'bar',
  507. data: [null, null, null, null, null, null, 2850],
  508. color: '#42A5F5'
  509. },
  510. {
  511. name: '误差范围',
  512. type: 'boxplot',
  513. data: [
  514. [null, null, null, null, null],
  515. [null, null, null, null, null],
  516. [null, null, null, null, null],
  517. [null, null, null, null, null],
  518. [null, null, null, null, null],
  519. [null, null, null, null, null],
  520. [2730, 2800, 2850, 2900, 2950]
  521. ],
  522. itemStyle: {
  523. color: '#90CAF9'
  524. }
  525. }
  526. ]
  527. });
  528. // 详细预测图表
  529. const detailedPredictionChart = echarts.init(document.getElementById('detailedPredictionChart'));
  530. detailedPredictionChart.setOption({
  531. tooltip: {
  532. trigger: 'axis'
  533. },
  534. legend: {
  535. data: ['去年产量', '预测产量']
  536. },
  537. grid: {
  538. left: '3%',
  539. right: '4%',
  540. bottom: '3%',
  541. containLabel: true
  542. },
  543. xAxis: {
  544. type: 'category',
  545. data: ['东区A', '东区B', '西区A', '西区B', '南区', '北区A', '北区B']
  546. },
  547. yAxis: {
  548. type: 'value',
  549. name: '产量(吨)'
  550. },
  551. series: [
  552. {
  553. name: '去年产量',
  554. type: 'bar',
  555. data: [220, 182, 191, 234, 290, 150, 198],
  556. color: '#AED581'
  557. },
  558. {
  559. name: '预测产量',
  560. type: 'bar',
  561. data: [240, 195, 210, 250, 310, 160, 215],
  562. color: '#4CAF50'
  563. }
  564. ]
  565. });
  566. // 响应式调整图表大小
  567. window.addEventListener('resize', function() {
  568. yieldPredictionChart.resize();
  569. detailedPredictionChart.resize();
  570. });
  571. // 筛选按钮点击事件
  572. const filterButtons = document.querySelectorAll('.filter-button');
  573. filterButtons.forEach(button => {
  574. button.addEventListener('click', function() {
  575. filterButtons.forEach(btn => btn.classList.remove('active'));
  576. this.classList.add('active');
  577. });
  578. });
  579. });
  580. </script>
  581. </body>
  582. </html>