index.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  1. <template>
  2. <div class="base-container no-events">
  3. <fnHeader showDate></fnHeader>
  4. <div class="content">
  5. <navigation @handleTab="handleTab"></navigation>
  6. <div class="left yes-events">
  7. <component :is="components[currentComponent]" />
  8. </div>
  9. <!-- <div class="home-bottom">
  10. <div class="garden-file yes-events" :class="{ isShrink: isShrink }">
  11. <home-file></home-file>
  12. <div class="arrow" @click="handleShrink('bottom')">
  13. <el-icon class="icon" color="#141414"><DArrowLeft /></el-icon>
  14. </div>
  15. </div>
  16. </div> -->
  17. <div class="right yes-events">
  18. <div class="list adopt-list-wrap">
  19. <chart-box name="认养管理" arrow="">
  20. <el-tabs v-model="activeName" class="demo-tabs">
  21. <el-tab-pane label="认养列表" name="认养列表">
  22. <adopt-list></adopt-list>
  23. </el-tab-pane>
  24. <el-tab-pane label="客户列表" name="客户列表">
  25. <client-list></client-list>
  26. </el-tab-pane>
  27. <el-tab-pane label="认养申请" name="认养申请">
  28. <apply-list></apply-list>
  29. </el-tab-pane>
  30. <el-tab-pane label="确认地址" name="确认地址">
  31. <address-list></address-list>
  32. </el-tab-pane>
  33. </el-tabs>
  34. </chart-box>
  35. </div>
  36. </div>
  37. <!-- 图例 -->
  38. <div v-if="legendArr && legendArr.length" class="map-bg map-legend yes-events">
  39. <div class="item" v-for="(legend, legendI) in legendArr" :key="legendI">
  40. <span class="legend-block" :style="{background: legend.color}"></span>
  41. {{ legend.name }}
  42. </div>
  43. </div>
  44. <div v-else class="map-bg map-legend yes-events">
  45. <div class="item">
  46. <img src="@/assets/images/map/status/status-bh.png" alt="" />
  47. 病害异常
  48. </div>
  49. <div class="item">
  50. <img src="@/assets/images/map/status/status-ch.png" alt="" />
  51. 虫害异常
  52. </div>
  53. <div class="item">
  54. <img src="@/assets/images/map/status/status-zc.png" alt="" />
  55. 正常
  56. </div>
  57. <!-- <div class="item">
  58. <img src="@/assets/images/map/status/defalut-icon.png" alt="" />
  59. 无照片
  60. </div> -->
  61. </div>
  62. </div>
  63. </div>
  64. <custom-map class="bottom-map" ref="mapRef"></custom-map>
  65. <!-- 图片弹窗 -->
  66. <PicturePreview :imageUrl="urls" :curIndex="urlsIndex"></PicturePreview>
  67. <album-carousel></album-carousel>
  68. <PdfDialog title="果园报告"></PdfDialog>
  69. </template>
  70. <script setup>
  71. import { onMounted, onUnmounted, ref } from "vue";
  72. import config from "@/api/config.js";
  73. import timeLine from "@/components/timeLine.vue";
  74. import PicturePreview from "@/components/PicturePreview.vue";
  75. import fnHeader from "@/components/fnHeader.vue";
  76. import navigation from "@/components/navigation.vue";
  77. import chartBox from "@/components/chartBox.vue";
  78. import fileBar from "@/components/fileBar.vue";
  79. import homePage from "./components/homePage.vue";
  80. import adoptList from "./components/adoptList.vue";
  81. import clientList from "./components/clientList.vue";
  82. import customMap from "./homeMap.vue";
  83. import applyList from "./components/applyList.vue";
  84. import addressList from "./components/addressList.vue";
  85. import { convertPointToArray } from "@/utils/index";
  86. import { useRouter } from "vue-router";
  87. import { useStore } from "vuex";
  88. import eventBus from "@/api/eventBus";
  89. import AlbumCarousel from "./album_compoents/albumCarousel.vue";
  90. import PdfDialog from "../../components/PdfDialog";
  91. let store = useStore();
  92. const components = {
  93. homePage,
  94. };
  95. const router = useRouter();
  96. const mapRef = ref(null);
  97. const activeName = ref('认养列表')
  98. onMounted(() => {
  99. //区域切换监听事件
  100. eventBus.on("area:id", areaId);
  101. getPointList()
  102. });
  103. onUnmounted(() => {
  104. eventBus.off("area:id", areaId);
  105. });
  106. const pointList = ref([])
  107. const getPointList = () =>{
  108. VE_API.variety.pointList({ farmId:766, selectAll:1 }).then(({ data }) => {
  109. const arr = data.map(item =>{
  110. return{
  111. ...item,
  112. lngLat:convertPointToArray(item.point)
  113. }
  114. })
  115. if(mapRef.value){
  116. mapRef.value.initData(arr)
  117. }
  118. })
  119. }
  120. const blueList = ref([]);
  121. const getBlueRegionList = (callback) => {
  122. let selectAll = undefined;
  123. if (regionId.value === 0) {
  124. selectAll = 1;
  125. }
  126. const areaId = selectAll ? undefined : regionId.value;
  127. VE_API.farm.blueRegionList({ farmId: organId.value, regionId: areaId, selectAll }).then(({ data }) => {
  128. blueList.value = data.map((item) => {
  129. let color = "rgba(255, 255, 255, 0.5)"; //失效区域
  130. if (item.status === 2) {
  131. //物候期风险
  132. // color = "rgba(63, 255, 53, 0.5)";
  133. color = "#2BFE00";
  134. }
  135. if (item.status === 3) {
  136. //生长异常
  137. // color = "rgba(255, 252, 61, 0.5)";
  138. color = "#FF7410";
  139. }
  140. if (item.status === 4) {
  141. //病虫害
  142. // color = "rgba(255, 73, 73, 0.5)";
  143. color = "#F82121";
  144. }
  145. return {
  146. ...item,
  147. color,
  148. };
  149. });
  150. // blueRegionLayer.initData(blueList.value);
  151. callback && callback();
  152. });
  153. };
  154. // 图例
  155. const legendArr = ref([])
  156. const organId = ref(null);
  157. const regionId = ref(null);
  158. const tabName = ref("");
  159. const tabId = ref(0);
  160. eventBus.off("changePointLegend", toggleLegend)
  161. eventBus.on("changePointLegend", toggleLegend)
  162. function toggleLegend({colorObj}) {
  163. legendArr.value = colorObj?.list
  164. }
  165. //选项卡事件监听
  166. const handleTab = async ({ name, id, isUpdate, params, legend, colorObj }) => {
  167. eventBus.emit("changePointType", {legend, colorObj})
  168. legendArr.value = colorObj?.list
  169. tabName.value = name;
  170. tabId.value = id;
  171. if (id === 0) {
  172. getBlueRegionList();
  173. }
  174. };
  175. //区域切换监听事件
  176. function areaId({ areaId, farmId }) {
  177. organId.value = farmId;
  178. regionId.value = areaId;
  179. if (tabId.value === 0) {
  180. getBlueRegionList();
  181. }
  182. }
  183. const urls = ref([]);
  184. const urlsIndex = ref(0);
  185. const currentComponent = ref("homePage");
  186. </script>
  187. <style lang="scss" scoped>
  188. .base-container {
  189. width: 100%;
  190. height: 100vh;
  191. color: #fff;
  192. position: absolute;
  193. box-sizing: border-box;
  194. z-index: 1;
  195. .content {
  196. width: 100%;
  197. height: calc(100% - 74px - 48px);
  198. display: flex;
  199. justify-content: space-between;
  200. box-sizing: border-box;
  201. .left,
  202. .right {
  203. width: 376px;
  204. height: 100%;
  205. margin-top: 10px;
  206. box-sizing: border-box;
  207. display: flex;
  208. position: relative;
  209. }
  210. .left {
  211. background: #101010;
  212. border-radius: 4px;
  213. border: 1px solid #444444;
  214. margin-left: 25px;
  215. .arrow {
  216. position: absolute;
  217. right: -16px;
  218. top: calc(50% - 40px);
  219. background: #fff;
  220. width: 16px;
  221. height: 80px;
  222. line-height: 80px;
  223. border-radius: 0 5px 5px 0;
  224. text-align: center;
  225. cursor: pointer;
  226. }
  227. }
  228. .right {
  229. width: 376px;
  230. margin-right: 25px;
  231. .adopt-list-wrap {
  232. ::v-deep {
  233. .el-tabs {
  234. height: 100%;
  235. }
  236. .el-tabs__content {
  237. height: calc(100% - 40px - 15px);
  238. position: static;
  239. }
  240. .el-tabs__item {
  241. color: #727272;
  242. }
  243. .el-tabs__active-bar {
  244. background-color: #FFFFFF;
  245. height: 1px;
  246. }
  247. .el-tabs__item.is-active {
  248. color: #fff;
  249. }
  250. .el-tabs__nav-wrap:after {
  251. height: 1px;
  252. background-color: rgba(127, 127, 127, 0.3);
  253. }
  254. .el-tabs__nav {
  255. left: 50%;
  256. transform: translateX(-50%) !important;
  257. }
  258. .el-tab-pane {
  259. height: 100%;
  260. }
  261. }
  262. }
  263. .list {
  264. width: 100%;
  265. height: 100%;
  266. overflow: auto;
  267. .btn-wrap {
  268. width: 100%;
  269. height: 25px;
  270. line-height: 25px;
  271. margin: 10px 0;
  272. display: flex;
  273. align-items: center;
  274. justify-content: space-between;
  275. div {
  276. width: 48%;
  277. height: 100%;
  278. color: #ffd489;
  279. border: 1px solid rgba(255, 213, 137, 0.6);
  280. border-radius: 2px;
  281. text-align: center;
  282. font-size: 12px;
  283. cursor: pointer;
  284. &.active {
  285. background: #ffd489;
  286. color: #000;
  287. }
  288. }
  289. }
  290. .img-box {
  291. width: 100%;
  292. height: calc(100% - 35px);
  293. overflow: auto;
  294. }
  295. .img-box1 {
  296. width: 100%;
  297. height: calc(100% - 10px);
  298. overflow: auto;
  299. margin-top: 10px;
  300. }
  301. .img-box2 {
  302. width: 100%;
  303. height: calc(100% - 45px);
  304. overflow: auto;
  305. margin-top: 10px;
  306. }
  307. img {
  308. width: 100%;
  309. height: auto;
  310. object-fit: cover;
  311. margin-bottom: 12px;
  312. cursor: pointer;
  313. }
  314. .mt {
  315. margin-top: -12px;
  316. }
  317. }
  318. }
  319. .overflow {
  320. overflow: auto;
  321. }
  322. .home-bottom {
  323. display: flex;
  324. align-items: flex-end;
  325. width: calc(100% - 60px - 376px * 2);
  326. height: 152px;
  327. align-self: flex-end;
  328. .time-wrap {
  329. height: 85px;
  330. }
  331. .fly-icon {
  332. width: 148px;
  333. height: 100%;
  334. margin-left: 27px;
  335. }
  336. .log-box {
  337. height: 34%;
  338. width: calc(100% - 340px - 28px);
  339. margin-right: 28px;
  340. .box-name {
  341. width: 89px;
  342. height: 22px;
  343. text-align: center;
  344. line-height: 22px;
  345. border-radius: 20px;
  346. margin: 10px 0 5px 6px;
  347. cursor: pointer;
  348. background: linear-gradient(0deg, #bba269 0%, #3d3523 100%);
  349. }
  350. .log-content {
  351. font-size: 12px;
  352. line-height: 1.5;
  353. padding: 0 18px;
  354. }
  355. .chart-wrap {
  356. width: 100%;
  357. height: calc(100% - 50px);
  358. .line {
  359. margin-top: 10px;
  360. margin-bottom: 12px;
  361. }
  362. img {
  363. width: 100%;
  364. margin-bottom: 10px;
  365. }
  366. }
  367. }
  368. .garden-file {
  369. position: relative;
  370. top: 10px;
  371. // height: 30%;
  372. // min-height: 210px;
  373. // width: 640px;
  374. transition: all 0.3s;
  375. width: 800px;
  376. height: 320px;
  377. overflow: hidden;
  378. &.isShrink {
  379. height: 66px;
  380. width: 450px;
  381. overflow: hidden;
  382. .arrow {
  383. .icon {
  384. transform: rotate(90deg);
  385. }
  386. }
  387. }
  388. .arrow {
  389. position: absolute;
  390. right: 56px;
  391. top: 36px;
  392. background: #fff;
  393. height: 16px;
  394. width: 80px;
  395. line-height: 16px;
  396. border-radius: 0 0 5px 5px;
  397. text-align: center;
  398. cursor: pointer;
  399. .icon {
  400. transform: rotate(270deg);
  401. }
  402. }
  403. }
  404. .file-box {
  405. height: 25%;
  406. min-height: 210px;
  407. width: 340px;
  408. position: relative;
  409. img {
  410. width: 100%;
  411. margin-top: 12px;
  412. }
  413. .arrow-icon {
  414. top: -32px;
  415. left: 50%;
  416. position: absolute;
  417. background: #fff;
  418. width: 16px;
  419. height: 80px;
  420. line-height: 80px;
  421. border-radius: 5px 0 0 5px;
  422. text-align: center;
  423. transform: translateX(-50%) rotate(270deg);
  424. }
  425. .edit-btn {
  426. padding: 2px 24px;
  427. background: #ffd489;
  428. border-radius: 4px;
  429. color: #000;
  430. }
  431. }
  432. }
  433. .legend {
  434. position: fixed;
  435. bottom: 8px;
  436. right: 64px;
  437. // width: 525px;
  438. height: 20px;
  439. }
  440. .map-bg {
  441. position: fixed;
  442. z-index: 2;
  443. background: rgba(35, 35, 35, 0.8);
  444. border-radius: 18px;
  445. padding: 7px 16px;
  446. right: 460px;
  447. }
  448. .map-btn {
  449. top: 19px;
  450. cursor: pointer;
  451. }
  452. .map-legend {
  453. bottom: 34px;
  454. .item {
  455. display: flex;
  456. align-items: center;
  457. font-size: 14px;
  458. img {
  459. width: 16px;
  460. margin-right: 6px;
  461. }
  462. .legend-block {
  463. width: 16px;
  464. height: 16px;
  465. box-sizing: border-box;
  466. border-radius: 50%;
  467. border: 2px solid #fff;
  468. margin-right: 6px;
  469. }
  470. }
  471. .legend-title {
  472. border-bottom: 1px solid rgba(102, 102, 102, 0.35);
  473. }
  474. .item + .item {
  475. padding-top: 10px;
  476. }
  477. }
  478. }
  479. }
  480. .bottom-map {
  481. width: 100%;
  482. height: 100vh;
  483. position: absolute;
  484. z-index: 0;
  485. }
  486. .compare-start-btn {
  487. position: absolute;
  488. z-index: 2;
  489. left: 50%;
  490. transform: translateX(-50%);
  491. cursor: pointer;
  492. bottom: 106px;
  493. // right: 445px;
  494. img {
  495. height: 55px;
  496. }
  497. }
  498. </style>
  499. <style lang="less">
  500. .file-wrap {
  501. &.map-file {
  502. width: 367px;
  503. position: relative;
  504. background: url("@/assets/images/home/file-bg.png") no-repeat top center / 100% 100%;
  505. margin-left: 12px;
  506. padding: 12px;
  507. .file-title {
  508. font-size: 20px;
  509. color: #ffd489;
  510. .tag {
  511. border: 1px solid #FFD489;
  512. border-radius: 4px;
  513. font-size: 12px;
  514. display: inline-block;
  515. width: 44px;
  516. height: 20px;
  517. text-align: center;
  518. line-height: 18px;
  519. margin-left: 8px;
  520. padding: 1px 4px;
  521. }
  522. }
  523. .overview-file {
  524. padding-top: 20px;
  525. .box-title {
  526. font-size: 16px;
  527. padding-left: 13px;
  528. margin-bottom: 16px;
  529. position: relative;
  530. display: flex;
  531. justify-content: space-between;
  532. color: #fff;
  533. &::before {
  534. content: "";
  535. position: absolute;
  536. left: 0;
  537. top: 3px;
  538. width: 3px;
  539. height: 16px;
  540. background: #fff;
  541. border-radius: 11px;
  542. }
  543. }
  544. .title {
  545. color: #f3c11d;
  546. font-size: 16px;
  547. font-family: "PangMenZhengDao";
  548. margin-bottom: 20px;
  549. .big {
  550. width: 13px;
  551. height: 13px;
  552. margin: -10px 0 0 4px;
  553. }
  554. .small {
  555. width: 7px;
  556. height: 7px;
  557. margin-left: -3px;
  558. }
  559. }
  560. .base-data {
  561. background: rgba(207, 207, 207, 0.1);
  562. border-radius: 4px;
  563. padding: 6px 0;
  564. display: flex;
  565. .base-item {
  566. flex: 1;
  567. text-align: center;
  568. .label {
  569. font-size: 12px;
  570. color: #666666;
  571. }
  572. .value {
  573. padding-top: 2px;
  574. font-size: 16px;
  575. color: #ffffff;
  576. }
  577. }
  578. .base-item + .base-item {
  579. border-left: 1px solid rgba(102, 102, 102, 0.42);
  580. }
  581. }
  582. .list {
  583. margin-top: 15px;
  584. width: max-content;
  585. font-size: 14px;
  586. .list-item {
  587. color: #bbbbbb;
  588. display: flex;
  589. margin-bottom: 8px;
  590. .list-name {
  591. color: #f3c11d;
  592. margin-right: 6px;
  593. img {
  594. width: 17px;
  595. height: 13px;
  596. }
  597. }
  598. }
  599. }
  600. }
  601. .overview-file + .overview-file {
  602. margin-top: 8px;
  603. }
  604. .box-wrap {
  605. display: flex;
  606. .box-item {
  607. // flex: 1;
  608. min-width: 109px;
  609. display: flex;
  610. flex-direction: column;
  611. justify-content: center;
  612. align-items: center;
  613. padding: 6px;
  614. box-sizing: border-box;
  615. background: rgba(207, 207, 207, 0.1);
  616. border-radius: 4px;
  617. border: 1px solid rgba(207, 207, 207, 0.1);
  618. cursor: pointer;
  619. .item-name {
  620. font-size: 12px;
  621. color: #666666;
  622. width: max-content;
  623. }
  624. .item-val {
  625. font-size: 18px;
  626. color: #fff;
  627. width: max-content;
  628. padding-top: 3px;
  629. }
  630. &.active {
  631. background: rgba(255, 212, 137, 0.16);
  632. border: 1px solid #ffd489;
  633. .item-name {
  634. color: #bbbbbb;
  635. }
  636. }
  637. }
  638. .box-item + .box-item {
  639. margin-left: 8px;
  640. }
  641. }
  642. }
  643. }
  644. </style>