index.vue 18 KB

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