index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  1. <template>
  2. <div class="achievement-report-page">
  3. <custom-header name="报告详情"></custom-header>
  4. <div class="report-content-wrap" v-loading="loading">
  5. <div class="report-content" ref="reportDom">
  6. <!-- <img src="@/assets/img/home/qrcode.png" alt="" class="code-icon" /> -->
  7. <img class="header-img" src="@/assets/img/home/report.png" alt="" />
  8. <div class="report-header">
  9. <!-- <img class="header-book" src="@/assets/img/home/book.png" alt="" /> -->
  10. <div class="time-tag">{{ workItem?.reportDate }}</div>
  11. <div class="report-title">长势报告</div>
  12. <div class="report-info">
  13. <div class="info-item">
  14. <img class="info-icon" src="@/assets/img/home/farm.png" alt="" />
  15. <span class="info-text">{{ workItem?.orchardName }}</span>
  16. </div>
  17. </div>
  18. </div>
  19. <div class="report-box">
  20. <div class="box-title">农情总结</div>
  21. <div class="box-text">
  22. {{ workItem?.summaryAgricultural || "--" }}
  23. </div>
  24. </div>
  25. <div class="report-box">
  26. <div class="box-title">物候与长势</div>
  27. <div class="box-text">
  28. <div class="box-bg">
  29. <span class="box-subtitle">背景描述:</span>
  30. <div v-html="workItem?.phenologyBackground"></div>
  31. </div>
  32. <div class="box-advice">
  33. <span class="box-subtitle">对策建议:</span>
  34. <div v-html="workItem?.phenologySuggestion"></div>
  35. </div>
  36. <div class="box-sum" v-html="workItem?.phenologySummary"></div>
  37. </div>
  38. </div>
  39. <div class="report-box">
  40. <div class="box-title">病虫害问题</div>
  41. <div class="box-text">
  42. <div class="box-bg">
  43. <span class="box-subtitle">背景描述:</span>
  44. <div v-html="workItem?.pestBackground"></div>
  45. </div>
  46. <div class="box-advice">
  47. <span class="box-subtitle">对策建议:</span>
  48. <div v-html="workItem?.pestSuggestion"></div>
  49. </div>
  50. <div class="box-sum">
  51. <div v-html="workItem?.pestSummary"></div>
  52. </div>
  53. </div>
  54. </div>
  55. <div class="report-box">
  56. <div class="box-title">未来预测</div>
  57. <div class="box-text">
  58. <div class="box-bg">
  59. <span class="box-subtitle">背景描述:</span>
  60. <div v-html="workItem?.forecastBackground"></div>
  61. </div>
  62. <div class="box-advice">
  63. <span class="box-subtitle">对策建议:</span>
  64. <div v-html="workItem?.forecastSuggestion"></div>
  65. </div>
  66. </div>
  67. </div>
  68. <div class="report-box">
  69. <div class="box-text next-info">
  70. <div class="box-bg">
  71. <span class="box-subtitle">下一次农情互动预告:</span>
  72. <div v-html="workItem?.nextInteractionPreview"></div>
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </template>
  80. <script setup>
  81. import CustomHeader from "@/components/customHeader.vue";
  82. import { ref, onActivated, onDeactivated, onUnmounted } from "vue";
  83. import { useRoute } from "vue-router";
  84. const route = useRoute();
  85. const loading = ref(false);
  86. const workItem = ref({
  87. executeDate: '2026-02-02',
  88. farmName: '荔枝博览园',
  89. resultInfo: '近7天时间地点,当下农情指标(物候期指标等等),面临的风险和出现的问题。',
  90. growthInfo: {
  91. description: '当前处于蒂蛀虫高发期,请及时采集。处于蒂蛀虫高发期',
  92. advice: '根据问题写一下需要注意的事项有哪些;简单描述农事该怎么做(可以链接详细的操作贴);更加详细的意见,等待专家进一步确认。如果都没有问题,那么这个时期高发什么风险,需要密切关注。',
  93. },
  94. futureInfo: {
  95. description: '为什么这个气象风险很重要,对产量有什么影响;',
  96. advice: '如果需要做农事,就建议农事,如果暂时不需要做农事,就提醒密切关注长势动态。',
  97. },
  98. nextInfo: {
  99. advice: '时间和主题,主要是为了什么互动,说明其重要性。',
  100. },
  101. });
  102. function formatArea(val) {
  103. const num = typeof val === "number" ? val : parseFloat(val);
  104. if (Number.isNaN(num)) return val;
  105. return Number.isInteger(num) ? num : num.toFixed(2) + "亩";
  106. }
  107. const paramsPage = ref({});
  108. onActivated(() => {
  109. window.scrollTo(0, 0);
  110. paramsPage.value = route.query || {};
  111. getDetail();
  112. // getResultReport();
  113. });
  114. const setReadStatus = (id) => {
  115. VE_API.farm.readReportByFarm({ id,isRead:1 }).then(({ data }) => {
  116. console.log(data);
  117. });
  118. }
  119. const getDetail = () => {
  120. if (!paramsPage.value.farmId) return;
  121. loading.value = true;
  122. VE_API.farm
  123. .growthReportByFarm({ farmId: paramsPage.value.farmId, limit: 20 })
  124. .then(({ data }) => {
  125. workItem.value = data[0];
  126. setReadStatus(data[0].id);
  127. })
  128. .finally(() => {
  129. loading.value = false;
  130. });
  131. };
  132. // 清理数据的函数
  133. const clearData = () => {
  134. workItem.value = {};
  135. paramsPage.value = {};
  136. loading.value = false;
  137. };
  138. onDeactivated(() => {
  139. clearData();
  140. });
  141. onUnmounted(() => {
  142. clearData();
  143. });
  144. </script>
  145. <style lang="scss" scoped>
  146. .achievement-report-page {
  147. width: 100%;
  148. height: 100vh;
  149. background: linear-gradient(195.35deg, #d4e4ff 16.34%, rgba(93, 189, 255, 0) 50.3%),
  150. linear-gradient(156.64deg, rgba(255, 255, 255, 0.16) 27.7%, rgba(255, 255, 255, 0) 72.82%);
  151. .report-content-wrap {
  152. height: calc(100% - 40px);
  153. // padding-bottom: 60px;
  154. overflow: auto;
  155. box-sizing: border-box;
  156. position: relative;
  157. .bottom-btn {
  158. z-index: 2;
  159. position: fixed;
  160. bottom: 0;
  161. left: 0;
  162. width: 100%;
  163. background: #fff;
  164. height: 60px;
  165. display: flex;
  166. align-items: center;
  167. justify-content: space-between;
  168. padding: 0 12px;
  169. box-sizing: border-box;
  170. box-shadow: 2px 2px 4.5px 0px rgba(0, 0, 0, 0.4);
  171. .btn-item {
  172. height: 40px;
  173. line-height: 40px;
  174. padding: 0 24px;
  175. border-radius: 20px;
  176. font-size: 14px;
  177. &.second {
  178. color: #666666;
  179. border: 1px solid rgba(153, 153, 153, 0.5);
  180. }
  181. &.primay {
  182. padding: 0 34px;
  183. background: linear-gradient(180deg, #76c3ff, #2199f8);
  184. color: #fff;
  185. }
  186. }
  187. }
  188. }
  189. .code-icon {
  190. position: absolute;
  191. right: 10px;
  192. top: 12px;
  193. width: 48px;
  194. }
  195. .report-content {
  196. // background: url("@/assets/img/home/report_bg.png") no-repeat center center;
  197. background: linear-gradient(0deg, #9BCCFF, #9BCCFF),
  198. linear-gradient(160deg, rgba(255, 255, 255, 0.16) 30%, rgba(255, 255, 255, 0) 72%);
  199. background-size: 100% auto;
  200. background-position: top center;
  201. padding: 24px 16px 16px;
  202. box-sizing: border-box;
  203. position: relative;
  204. min-height: 100%;
  205. .header-img {
  206. position: absolute;
  207. top: 0;
  208. left: 0;
  209. width: 100%;
  210. }
  211. .report-header {
  212. position: relative;
  213. .header-book {
  214. position: absolute;
  215. right: 0;
  216. bottom: -6px;
  217. height: 88px;
  218. z-index: 10;
  219. }
  220. .time-tag {
  221. background: linear-gradient(137.86deg, #9fd5ff 5.87%, #2199f8 82.98%);
  222. border-radius: 5px 0 5px 0;
  223. height: 23px;
  224. line-height: 23px;
  225. font-size: 13px;
  226. font-weight: 500;
  227. color: #fff;
  228. padding: 0 9px;
  229. width: fit-content;
  230. }
  231. .report-title {
  232. font-family: "PangMenZhengDao";
  233. font-size: 34px;
  234. line-height: 38px;
  235. color: #000000;
  236. }
  237. .report-info {
  238. padding: 10px 0 16px 0;
  239. .info-item {
  240. width: fit-content;
  241. display: flex;
  242. height: 33px;
  243. align-items: center;
  244. padding: 0 18px 0 6px;
  245. background: linear-gradient(90deg, rgba(255, 255, 255, 0.58) 0%, rgba(255, 255, 255, 0.0696) 100%);
  246. border-radius: 20px;
  247. border: 0.5px solid rgba(33, 153, 248, 0.35);
  248. gap: 6px;
  249. .info-icon {
  250. width: 26px;
  251. height: 26px;
  252. object-fit: cover;
  253. border-radius: 50%;
  254. }
  255. .info-text {
  256. font-size: 14px;
  257. color: #2199f8;
  258. }
  259. }
  260. .info-item + .info-item {
  261. margin-top: 5px;
  262. }
  263. }
  264. }
  265. .report-box {
  266. display: flex;
  267. align-items: center;
  268. padding: 8px;
  269. background: linear-gradient(0deg, #ffffff 86.32%, #2199f8 136.87%);
  270. border: 1px solid #ffffff;
  271. border-radius: 8px;
  272. gap: 5px;
  273. position: relative;
  274. .report-box-item {
  275. flex: 1;
  276. background: rgba(33, 153, 248, 0.1);
  277. border-radius: 8px;
  278. min-height: 62px;
  279. box-sizing: border-box;
  280. padding: 2px 4px;
  281. display: flex;
  282. flex-direction: column;
  283. justify-content: center;
  284. .item-content {
  285. color: #2199f8;
  286. font-size: 14px;
  287. text-align: center;
  288. }
  289. .item-title {
  290. color: #000000;
  291. font-size: 10px;
  292. text-align: center;
  293. padding-top: 5px;
  294. }
  295. }
  296. .box-title {
  297. position: absolute;
  298. top: -8px;
  299. left: -1px;
  300. height: 32px;
  301. line-height: 26px;
  302. font-family: "PangMenZhengDao";
  303. font-size: 14px;
  304. padding: 0 10px;
  305. color: #ffffff;
  306. background: url("@/assets/img/home/title-bg.png") no-repeat center center / 100% 100%;
  307. }
  308. .box-text {
  309. padding: 22px 0 8px 0;
  310. font-weight: 350;
  311. line-height: 21px;
  312. .box-subtitle {
  313. color: #000;
  314. }
  315. .box-bg {
  316. font-weight: 400;
  317. color: rgba(0, 0, 0, 0.5);
  318. }
  319. .box-advice {
  320. color: rgba(0, 0, 0, 0.5);
  321. padding-top: 10px;
  322. }
  323. .box-sum {
  324. margin-top: 10px;
  325. background: rgba(33, 153, 248, 0.1);
  326. border-radius: 5px;
  327. padding: 10px;
  328. line-height: 20px;
  329. color: #2199F8;
  330. }
  331. &.next-info {
  332. padding: 8px 0 8px 0;
  333. }
  334. }
  335. }
  336. .report-box + .report-box {
  337. margin-top: 20px;
  338. }
  339. .report-excute {
  340. position: relative;
  341. margin-top: 12px;
  342. .tag-label {
  343. position: absolute;
  344. top: 0;
  345. left: 0;
  346. padding: 4px 10px;
  347. background: rgba(54, 52, 52, 0.8);
  348. color: #fff;
  349. font-size: 12px;
  350. border-radius: 8px 0 8px 0;
  351. z-index: 1;
  352. }
  353. ::v-deep {
  354. .carousel-container .carousel-wrapper .carousel-img {
  355. min-width: calc(100vw - 32px);
  356. width: calc(100vw - 32px);
  357. }
  358. }
  359. }
  360. }
  361. .download-btn {
  362. position: fixed;
  363. bottom: 20px;
  364. left: 50%;
  365. // background: #fff;
  366. // box-shadow: 2px 2px 4.5px 0px #00000066;
  367. // width: 100%;
  368. transform: translateX(-50%);
  369. }
  370. .review-hide-box {
  371. position: absolute;
  372. left: 0;
  373. width: 100%;
  374. height: 100%;
  375. z-index: -1;
  376. bottom: 0;
  377. }
  378. .review-image {
  379. position: relative;
  380. display: flex;
  381. align-items: center;
  382. justify-content: center;
  383. gap: 8px;
  384. margin: 12px;
  385. background: #fff;
  386. border-radius: 8px;
  387. .review-mask {
  388. z-index: 1;
  389. pointer-events: none;
  390. position: absolute;
  391. left: 0;
  392. top: 0;
  393. width: 100%;
  394. height: 100%;
  395. border-radius: 8px;
  396. background: linear-gradient(
  397. 360deg,
  398. rgba(0, 0, 0, 0.78) 0%,
  399. rgba(0, 0, 0, 0.437208) 19.87%,
  400. rgba(0, 0, 0, 0) 33.99%
  401. );
  402. display: flex;
  403. flex-direction: column;
  404. align-items: baseline;
  405. justify-content: end;
  406. padding: 12px;
  407. box-sizing: border-box;
  408. color: #fff;
  409. .review-text {
  410. font-family: "PangMenZhengDao";
  411. font-size: 16px;
  412. margin-bottom: 1px;
  413. }
  414. .review-content {
  415. font-size: 10px;
  416. line-height: 15px;
  417. }
  418. }
  419. .vs-wrap {
  420. position: absolute;
  421. left: 50%;
  422. top: 50%;
  423. transform: translate(-50%, -50%);
  424. width: 40px;
  425. height: 40px;
  426. z-index: 10;
  427. img {
  428. width: 100%;
  429. height: 100%;
  430. object-fit: cover;
  431. }
  432. }
  433. .review-image-item {
  434. position: relative;
  435. flex: 1;
  436. .review-image-item-title {
  437. position: absolute;
  438. top: 0;
  439. left: 0;
  440. background: rgba(54, 52, 52, 0.6);
  441. padding: 4px 10px;
  442. border-radius: 8px 0 8px 0;
  443. backdrop-filter: 4px;
  444. font-size: 12px;
  445. color: #fff;
  446. }
  447. // .review-image-item-img {
  448. // width: 100%;
  449. // height: 250px;
  450. // object-fit: cover;
  451. // }
  452. .review-image-item-img {
  453. width: 100%;
  454. height: 100%;
  455. object-fit: cover;
  456. object-position: center;
  457. }
  458. .left-img {
  459. border-radius: 8px 0 0 8px;
  460. }
  461. .right-img {
  462. border-radius: 0 8px 8px 0;
  463. }
  464. }
  465. }
  466. }
  467. .cavans-popup {
  468. width: 100%;
  469. max-width: 100%;
  470. max-height: 92vh;
  471. background: none;
  472. border-radius: 12px;
  473. overflow: auto;
  474. display: flex;
  475. flex-direction: column;
  476. backdrop-filter: 4px;
  477. .cavans-content {
  478. text-align: center;
  479. padding: 0 12px;
  480. height: fit-content;
  481. overflow: auto;
  482. .current-img {
  483. width: 100%;
  484. }
  485. }
  486. // 底部操作按钮
  487. .bottom-actions {
  488. flex-shrink: 0;
  489. .action-buttons {
  490. padding: 12px 0 4px 0;
  491. display: flex;
  492. justify-content: space-around;
  493. .action-btn {
  494. display: flex;
  495. flex-direction: column;
  496. align-items: center;
  497. cursor: pointer;
  498. &.text-btn {
  499. font-size: 12px;
  500. color: rgba(255, 255, 255, 0.7);
  501. }
  502. .icon-circle {
  503. width: 48px;
  504. height: 48px;
  505. border-radius: 50%;
  506. display: flex;
  507. align-items: center;
  508. justify-content: center;
  509. color: #fff;
  510. margin-bottom: 4px;
  511. .el-icon {
  512. color: #fff;
  513. }
  514. img {
  515. width: 50px;
  516. }
  517. }
  518. &.blue-btn .icon-circle {
  519. background: #2199f8;
  520. }
  521. &.green-btn .icon-circle {
  522. background: #07c160;
  523. }
  524. &.orange-btn .icon-circle {
  525. background: #ff790b;
  526. }
  527. .btn-label {
  528. font-size: 12px;
  529. color: #fff;
  530. }
  531. }
  532. }
  533. .cancel-btn {
  534. text-align: center;
  535. font-size: 18px;
  536. color: #fff;
  537. cursor: pointer;
  538. }
  539. }
  540. }
  541. </style>