index.vue 18 KB

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