index.vue 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084
  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. <tool-list direction="left" :list="leftToolList" @handleActive="handleActiveLeft"></tool-list>
  8. <component :is="components[currentComponent]" />
  9. <!-- 箭头 -->
  10. <div class="arrow" @click="handleShrink('left')">
  11. <el-icon class="icon" color="#141414"><DArrowLeft /></el-icon>
  12. </div>
  13. </div>
  14. <div class="home-bottom">
  15. <!-- <time-line class="time-wrap yes-events"></time-line>
  16. <img class="fly-icon" src="@/assets/images/home/fly-icon.png" alt=""> -->
  17. <!-- <div class="log-box yes-events">
  18. <chart-box class="overflow">
  19. <template #title-name>
  20. <div class="box-name" @click="handleSelectArea">果园日志</div>
  21. </template>
  22. <div class="log-content">
  23. 2月13日,共抽样193棵树,拍摄了193张照片,{{indicatorChartData.content}}
  24. </div>
  25. <div class="chart-wrap">
  26. <indicator-chart :key="0 + 'log'" type="feature" :chartData="indicatorChartData"></indicator-chart>
  27. </div>
  28. </chart-box>
  29. </div> -->
  30. <!-- <div class="file-box yes-events">
  31. <chart-box name="果园档案">
  32. <template #title-right>
  33. <el-icon class="arrow-icon cursor-pointer" color="#141414"
  34. ><DArrowLeft
  35. /></el-icon>
  36. <div class="edit-btn cursor-pointer" @click="toFilePage">编辑</div>
  37. </template>
  38. <file-bar></file-bar>
  39. </chart-box>
  40. </div> -->
  41. <div class="garden-file yes-events" :class="{ isShrink: isShrink }">
  42. <home-file></home-file>
  43. <!-- 箭头 -->
  44. <div class="arrow" @click="handleShrink('bottom')">
  45. <el-icon class="icon" color="#141414"><DArrowLeft /></el-icon>
  46. </div>
  47. </div>
  48. </div>
  49. <div class="right yes-events">
  50. <div class="list album-r">
  51. <chart-box name="农事列表" arrow="arrow-left" :class="{ 'list-wrap': rightIndex === 0 }">
  52. <template v-if="rightIndex === 0">
  53. <album></album>
  54. <!-- <img class="tabs" src="@/assets/images/home/ns-tabs.png" alt="">
  55. <div class="img-box">
  56. <img @click="handleAct(item)" v-for="item in 2" :key="item" :src="require(`@/assets/images/home/0${act<=2&&act==item?item+'-act':item}.png`)" alt="">
  57. </div> -->
  58. </template>
  59. <template v-if="rightIndex === 1">
  60. <div class="img-box1">
  61. <img src="@/assets/images/home/fh01.png" alt="" />
  62. <img src="@/assets/images/home/fh02.png" alt="" />
  63. </div>
  64. </template>
  65. <template v-if="rightIndex === 2">
  66. <div class="btn-wrap">
  67. <div :class="{ active: btnIndex === 0 }" @click="handleBtn(0)">
  68. {{ btnIndex === 0 && btnName != "" ? "采样分区:" + btnName : "选择采样分区" }}
  69. </div>
  70. <div :class="{ active: btnIndex === 1 }" @click="handleBtn(1)">
  71. {{ btnIndex === 1 && btnName != "" ? "单树编号:" + btnName : "选择树" }}
  72. </div>
  73. </div>
  74. <div class="img-box2" v-show="showPoint">
  75. <img v-if="showType === 'point'" src="@/assets/images/home/line-chart.png" alt="" />
  76. <img v-else src="@/assets/images/home/line-chart2.png" alt="" />
  77. <img src="@/assets/images/home/fh01.png" alt="" />
  78. </div>
  79. <div class="img-box2" v-show="!showPoint">
  80. <img v-if="showType === 'point'" src="@/assets/images/home/line-chart1.png" alt="" />
  81. <img v-else src="@/assets/images/home/line-chart3.png" alt="" />
  82. <img src="@/assets/images/home/fh02.png" alt="" />
  83. </div>
  84. </template>
  85. </chart-box>
  86. </div>
  87. <tool-list direction="right" :list="rightToolList" @handleActive="handleActiveRight"></tool-list>
  88. </div>
  89. <!-- 图例 -->
  90. <!-- <img class="legend yes-events" src="@/assets/images/home/legend-img.png" alt="" /> -->
  91. <div v-if="legendArr && legendArr.length" class="map-bg map-legend yes-events">
  92. <div class="item" v-for="(legend, legendI) in legendArr" :key="legendI">
  93. <span class="legend-block" :style="{background: legend.color}"></span>
  94. {{ legend.name }}
  95. </div>
  96. </div>
  97. <div v-else class="map-bg map-legend yes-events">
  98. <div class="item">
  99. <img src="@/assets/images/map/status/status-zc.png" alt="" />
  100. 有照片
  101. </div>
  102. <div class="item">
  103. <img src="@/assets/images/map/status/defalut-icon.png" alt="" />
  104. 无照片
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. <div ref="mapRef" class="bottom-map"></div>
  110. <!-- 图片弹窗 -->
  111. <PicturePreview :imageUrl="urls" :curIndex="urlsIndex"></PicturePreview>
  112. <album-carousel></album-carousel>
  113. <PdfDialog title="果园报告"></PdfDialog>
  114. <!-- 对比 -->
  115. <compareDialog></compareDialog>
  116. <div class="compare-start-btn yes-events" v-show="showCompareBtn" @click="showCompare">
  117. <img src="@/assets/images/home/compare-btn.png" alt="" />
  118. </div>
  119. <!-- 果树档案 -->
  120. <div class="file-wrap map-file" id="popup-file">
  121. <div class="file-title">
  122. <img src="@/assets/images/common/chart-yellow.png" alt="" />
  123. 果树档案
  124. <span id="tag-nh" class="tag">小农户</span>
  125. </div>
  126. <div class="overview-file">
  127. <div class="box-title">总体档案</div>
  128. <div class="base-data" id="file-overview">
  129. </div>
  130. <div class="list">
  131. <div class="list-item" v-for="item in photoList" :key="item.key">
  132. <div class="list-name">
  133. <img src="@/assets/images/common/title-icon.png" alt="" />
  134. {{ item.key }}
  135. </div>
  136. {{ item.statement }}
  137. </div>
  138. </div>
  139. </div>
  140. <div class="overview-file">
  141. <div class="box-title">产量信息</div>
  142. <div class="box-wrap" id="file-output">
  143. <div class="box-item">
  144. <div class="item-name"></div>
  145. <div class="item-val"></div>
  146. </div>
  147. </div>
  148. </div>
  149. <div class="overview-file">
  150. <div class="box-title">生态评估</div>
  151. <div class="box-wrap" id="file-quality">
  152. <div class="box-item">
  153. <div class="item-name"></div>
  154. <div class="item-val"></div>
  155. </div>
  156. </div>
  157. </div>
  158. </div>
  159. </template>
  160. <script setup>
  161. import { onMounted, onUnmounted, ref } from "vue";
  162. import config from "@/api/config.js";
  163. import timeLine from "@/components/timeLine.vue";
  164. import PicturePreview from "@/components/PicturePreview.vue";
  165. import fnHeader from "@/components/fnHeader.vue";
  166. import navigation from "@/components/navigation.vue";
  167. import chartBox from "@/components/chartBox.vue";
  168. import toolList from "@/components/toolList.vue";
  169. import fileBar from "@/components/fileBar.vue";
  170. import HomeMap from "./map/homeMap";
  171. import homePage from "./components/homePage.vue";
  172. import weatherPage from "./components/weatherPage.vue";
  173. import phenologyPage from "./components/phenologyPage.vue";
  174. import indicatorChart from "./components/indicatorChart.vue";
  175. import homeFile from "./components/homeFile.vue";
  176. import { useRouter } from "vue-router";
  177. import SamplePointLayer from "./map/samplePointLayer";
  178. import { useStore } from "vuex";
  179. import RegionLayer from "./map/regionLayer";
  180. import BlueRegionLayer from "./map/blueRegionLayer";
  181. import eventBus from "@/api/eventBus";
  182. import AlbumCarousel from "./album_compoents/albumCarousel.vue";
  183. import compareDialog from "./album_compoents/compareDialog.vue";
  184. import album from "./album/index.vue";
  185. import PdfDialog from "../../components/PdfDialog";
  186. let store = useStore();
  187. const components = {
  188. homePage,
  189. weatherPage,
  190. phenologyPage,
  191. };
  192. //当前农场
  193. const currentFarm = {
  194. id: store.getters.userinfo.curFarmId,
  195. name: store.getters.userinfo.curFarmName,
  196. };
  197. //当前区域
  198. const currentRegion = {
  199. id: null,
  200. name: null,
  201. };
  202. let homeMap = new HomeMap();
  203. let samplePointLayer = null;
  204. let regionLayer = null;
  205. let blueRegionLayer = null;
  206. const router = useRouter();
  207. const mapRef = ref();
  208. onMounted(() => {
  209. homeMap.initMap("POINT(113.61448114737868 23.585550924763083)", mapRef.value);
  210. // homeMap.initMap(store.getters.userinfo.location, mapRef.value);
  211. // regionLayer = new RegionLayer(homeMap.kmap.map, currentFarm, currentRegion)
  212. samplePointLayer = new SamplePointLayer(homeMap.kmap);
  213. blueRegionLayer = new BlueRegionLayer(homeMap.kmap);
  214. getYellow();
  215. // getFarmLog()
  216. //区域切换监听事件
  217. eventBus.on("area:id", areaId);
  218. //选项卡子项事件监听
  219. // eventBus.on("handleTabItem", handleTabItem);
  220. // 是否开启指标对比
  221. eventBus.on("compareTree", handleCompare)
  222. eventBus.on("clickToCompare:point", toggleCompare);
  223. });
  224. onUnmounted(() => {
  225. eventBus.off("area:id", areaId);
  226. // eventBus.off("handleTabItem", handleTabItem);
  227. eventBus.off("compareTree", handleCompare)
  228. eventBus.off("clickToCompare:point", toggleCompare);
  229. });
  230. function handleCompare(v) {
  231. isShrink.value = v
  232. if (v === false) {
  233. showCompareBtn.value = v
  234. }
  235. }
  236. const blueList = ref([]);
  237. const getBlueRegionList = (callback) => {
  238. let selectAll = undefined;
  239. if (regionId.value === 0) {
  240. selectAll = 1;
  241. }
  242. const areaId = selectAll ? undefined : regionId.value;
  243. VE_API.farm.blueRegionList({ farmId: organId.value, regionId: areaId, selectAll }).then(({ data }) => {
  244. blueList.value = data.map((item) => {
  245. let color = "rgba(255, 255, 255, 0.5)"; //失效区域
  246. if (item.status === 2) {
  247. //物候期风险
  248. // color = "rgba(63, 255, 53, 0.5)";
  249. color = "#2BFE00";
  250. }
  251. if (item.status === 3) {
  252. //生长异常
  253. // color = "rgba(255, 252, 61, 0.5)";
  254. color = "#FF7410";
  255. }
  256. if (item.status === 4) {
  257. //病虫害
  258. // color = "rgba(255, 73, 73, 0.5)";
  259. color = "#F82121";
  260. }
  261. return {
  262. ...item,
  263. color,
  264. };
  265. });
  266. blueRegionLayer.initData(blueList.value);
  267. callback && callback();
  268. });
  269. };
  270. // 图例
  271. const legendArr = ref([])
  272. const organId = ref(null);
  273. const regionId = ref(null);
  274. const tabName = ref("");
  275. const tabId = ref(0);
  276. eventBus.off("changePointLegend", toggleLegend)
  277. eventBus.on("changePointLegend", toggleLegend)
  278. function toggleLegend({colorObj}) {
  279. legendArr.value = colorObj?.list
  280. }
  281. //选项卡事件监听
  282. const handleTab = async ({ name, id, isUpdate, params, legend, colorObj }) => {
  283. eventBus.emit("changePointType", {legend, colorObj})
  284. legendArr.value = colorObj?.list
  285. console.log('name, id, isUpdate, params', name, id, isUpdate, params, legend, colorObj);
  286. tabName.value = name;
  287. tabId.value = id;
  288. if (id === 0) {
  289. getBlueRegionList(() => {
  290. if (isUpdate) {
  291. handleTabItem(params);
  292. }
  293. });
  294. } else {
  295. getFarmIndexReport(() => {
  296. if (isUpdate) {
  297. handleTabItem(params);
  298. }
  299. });
  300. }
  301. // 切换点位数据
  302. // samplePointLayer.changePointType(name, params)
  303. };
  304. //区域切换监听事件
  305. function areaId({ areaId, farmId }) {
  306. organId.value = farmId;
  307. regionId.value = areaId;
  308. samplePointLayer.initData(farmId, areaId);
  309. if (tabId.value === 0) {
  310. getBlueRegionList();
  311. } else {
  312. getFarmIndexReport();
  313. }
  314. }
  315. //选项卡子项事件监听
  316. const handleTabItem = (e) => {
  317. console.log('eeeeeeeeee', e, reportData.value);
  318. // if (reportData.value.blueZoneList) {
  319. // const index = reportData.value.blueZoneList.findIndex((item) => item.key === e);
  320. // let arr = [];
  321. // if (reportData.value.blueZoneList.length) {
  322. // arr = blueListConvert(reportData.value.blueZoneList[index].obj, index);
  323. // }
  324. // blueRegionLayer.initData(arr, "87");
  325. // }
  326. };
  327. const reportData = ref({});
  328. const blueListConvert = (data, index) => {
  329. const list = [];
  330. for (let key in data) {
  331. const filterData = reportData.value.blueZoneLegendList[index].list.filter((item) => item.val === key);
  332. const arr = data[key];
  333. arr.forEach((item) => {
  334. const listObj = blueList.value.filter((ele) => ele.blueZoneCode === item);
  335. const updateList = listObj.map((ele) => {
  336. return {
  337. ...ele,
  338. level: key,
  339. name: filterData[0].name,
  340. color: filterData[0].color,
  341. };
  342. });
  343. list.push(...updateList);
  344. });
  345. }
  346. return list;
  347. };
  348. const getFarmIndexReport = (callback) => {
  349. // const params = { farmId:organId.value,regionId:regionId.value, type: tabName.value };
  350. // VE_API.farm.farmIndexReport(params).then(({data,code}) => {
  351. // if (code === 0) {
  352. // reportData.value = data || {};
  353. // let arr = []
  354. // if(data.blueZoneList.length){
  355. // arr = blueListConvert(data.blueZoneList[0].obj,0)
  356. // }
  357. // blueRegionLayer.initData(arr,'87')
  358. // callback && callback()
  359. // }
  360. // });
  361. };
  362. const indicatorChartData = ref({});
  363. const blueZone = ref("ws0y1meyhxp4");
  364. const getFarmLog = () => {
  365. console.log("getfarmlog");
  366. const params = {
  367. id: null,
  368. farmId: 766,
  369. blueZone: blueZone.value,
  370. };
  371. VE_API.warning.fetchFarmLog(params).then(({ data }) => {
  372. indicatorChartData.value = data || {};
  373. eventBus.emit("chart:updateOption", data);
  374. });
  375. };
  376. const urls = ref([]);
  377. const urlsIndex = ref(0);
  378. const getYellow = () => {
  379. VE_API.home.getYellowList().then((res) => {
  380. // urls.value = res.data.map(item =>{
  381. // return {
  382. // ...item,
  383. // imgPath:config.base_img_url2+item.cloudFilename
  384. // }
  385. // })
  386. // urls.value = [
  387. // "@/assets/images/home/HB-ws0y1menggxv/HB-ws0y1menggxv2025-01-07.jpg",
  388. // "@/assets/images/home/HB-ws0y1menggxv/HB-ws0y1menggxv2025-01-08.jpg",
  389. // "@/assets/images/home/HB-ws0y1menggxv/HB-ws0y1menggxv2025-01-09.jpg",
  390. // "@/assets/images/home/HB-ws0y1menggxv/HB-ws0y1menggxv2025-01-10.jpg",
  391. // "@/assets/images/home/HB-ws0y1menggxv/HB-ws0y1menggxv2025-01-11.jpg",
  392. // "@/assets/images/home/HB-ws0y1menggxv/HB-ws0y1menggxv2025-01-12.jpg",
  393. // "@/assets/images/home/HB-ws0y1menggxv/HB-ws0y1menggxv2025-01-13.jpg",
  394. // ]
  395. });
  396. };
  397. const btnIndex = ref(null);
  398. const btnName = ref("");
  399. const handleBtn = (e) => {
  400. btnName.value = "";
  401. btnIndex.value = e;
  402. eventBus.emit("clear:area");
  403. samplePointLayer.updateAreaStatus(e === 0 ? true : false);
  404. regionLayer.resetData();
  405. samplePointLayer.resetPoint();
  406. };
  407. //点击果园日志
  408. const handleSelectArea = () => {
  409. btnName.value = "";
  410. btnIndex.value = null;
  411. eventBus.emit("clear:area");
  412. regionLayer.resetData();
  413. samplePointLayer.resetPoint();
  414. samplePointLayer.updateAreaStatus(true);
  415. };
  416. //农事点击高亮
  417. const act = ref(null);
  418. const handleAct = (v) => {
  419. act.value = v;
  420. samplePointLayer.resetPoint();
  421. if (v === 1) {
  422. regionLayer.selectAreaMultiple([
  423. { value: 2, color: "blue" },
  424. { value: 4, color: "blue1" },
  425. { value: 5, color: "blue2" },
  426. { value: 7, color: "blue" },
  427. { value: 13, color: "blue2" },
  428. ]);
  429. }
  430. if (v === 2) {
  431. regionLayer.selectAreaMultiple([
  432. { value: 1, color: "blue" },
  433. { value: 2, color: "blue1" },
  434. { value: 9, color: "blue2" },
  435. { value: 12, color: "blue2" },
  436. ]);
  437. }
  438. };
  439. //柱状图点击事件监听
  440. eventBus.on("echart:barClick", (e) => {
  441. btnName.value = "";
  442. btnIndex.value = null;
  443. eventBus.emit("clear:area");
  444. samplePointLayer.updateAreaStatus(false);
  445. const arr = ["花穗伸长", "啃食虫害", "毛毡病"];
  446. const isDraw = arr.includes(e);
  447. const index = arr.indexOf(e);
  448. if (isDraw) {
  449. if (index === 0) {
  450. regionLayer.selectAreaMultiple([
  451. { value: 0, color: "green" },
  452. { value: 1, color: "green" },
  453. { value: 2, color: "green" },
  454. { value: 3, color: "green1" },
  455. { value: 4, color: "green1" },
  456. { value: 5, color: "green2" },
  457. { value: 6, color: "green1" },
  458. { value: 7, color: "green2" },
  459. { value: 8, color: "green2" },
  460. { value: 9, color: "green" },
  461. { value: 10, color: "green" },
  462. { value: 11, color: "green1" },
  463. { value: 12, color: "green2" },
  464. { value: 13, color: "green" },
  465. { value: 14, color: "green2" },
  466. ]);
  467. } else if (index === 1) {
  468. regionLayer.selectAreaMultiple([{ value: 6, color: "red" }]);
  469. } else {
  470. regionLayer.selectAreaMultiple([
  471. { value: 12, color: "red2" },
  472. { value: 10, color: "red" },
  473. { value: 1, color: "red" },
  474. ]);
  475. }
  476. }
  477. });
  478. //黄板点击事件监听
  479. eventBus.on("click:yellowBlock", (e) => {
  480. const arr = ["113.61396985128522", "113.61390710255375", "113.61491218688275"];
  481. if (arr[0] == e) {
  482. urls.value = ["HB-ws0y1menggxv"];
  483. urlsIndex.value = 0;
  484. }
  485. if (arr[1] == e) {
  486. urls.value = ["HB-ws0y1mg0pvd"];
  487. urlsIndex.value = 3;
  488. }
  489. if (arr[2] == e) {
  490. urls.value = ["HB-ws0y1mg9wpcp"];
  491. urlsIndex.value = 6;
  492. }
  493. eventBus.emit("dialog:show", true);
  494. });
  495. const showPoint = ref(true);
  496. const showType = ref("point");
  497. eventBus.on("click:updateArea", (e) => {
  498. blueZone.value = e.value;
  499. btnName.value = e.name;
  500. regionLayer.selectArea(e.name * 1 === 0 ? 0 : e.name * 1 - 1, "blue");
  501. //getFarmLog()
  502. });
  503. const currentComponent = ref("homePage");
  504. const handleActiveLeft = (e) => {
  505. currentComponent.value = e.componentName;
  506. if (e.title === "首页") {
  507. router.push("/warningHome");
  508. }
  509. };
  510. const leftToolList = [
  511. {
  512. title: "首页",
  513. name: "home",
  514. componentName: "homePage",
  515. },
  516. {
  517. title: "气象预警",
  518. componentName: "weatherPage",
  519. },
  520. {
  521. title: "物候调节",
  522. componentName: "phenologyPage",
  523. },
  524. {
  525. title: "病虫测报",
  526. },
  527. {
  528. title: "营养评估",
  529. },
  530. ];
  531. const rightIndex = ref(0);
  532. const handleActiveRight = ({ index }) => {
  533. rightIndex.value = index;
  534. btnIndex.value = null;
  535. btnName.value = "";
  536. samplePointLayer.updateAreaStatus(false);
  537. regionLayer.resetData();
  538. samplePointLayer.resetPoint();
  539. if (index !== 0) {
  540. act.value = null;
  541. }
  542. };
  543. const hanleRightIndex = (num) => {
  544. rightIndex.value = num;
  545. eventBus.emit("tool:updateAct", num);
  546. };
  547. const rightToolList = [
  548. {
  549. title: "农事列表",
  550. index: 0,
  551. },
  552. {
  553. title: "处方分析",
  554. index: 2,
  555. },
  556. {
  557. title: "复核对比",
  558. index: 1,
  559. },
  560. ];
  561. // 跳转果园档案
  562. const toFilePage = () => {
  563. router.push("/garden-file");
  564. };
  565. // 地图图例
  566. const showMapLegend = ref(true);
  567. const handleLegend = (e) => {
  568. blueRegionLayer.toggleLayer(e);
  569. };
  570. // 对比
  571. const compareData = ref([]);
  572. const showCompareBtn = ref(false);
  573. function toggleCompare(arr) {
  574. // eventBus.emit("clickToCompare:point",{farmId:fs.get("farmId"),sampleId:fs.get("sampleId"), data: fs.getProperties()})
  575. compareData.value = [];
  576. arr.map((fs) => {
  577. compareData.value.push({ farmId: fs.get("farmId"), sampleId: fs.get("id"), data: fs.getProperties() });
  578. });
  579. console.log("compareData", compareData.value);
  580. showCompareBtn.value = compareData.value.length > 1 ? true : false;
  581. }
  582. function showCompare() {
  583. eventBus.emit("showCompareDialog", compareData.value);
  584. }
  585. const isShrink = ref(false);
  586. const isLeftShrink = ref(false);
  587. const isRightShrink = ref(false);
  588. const handleShrink = (position) => {
  589. switch (position) {
  590. case "bottom":
  591. isShrink.value = !isShrink.value;
  592. break;
  593. case "left":
  594. isLeftShrink.value = !isLeftShrink.value;
  595. break;
  596. case "rigth":
  597. isRightShrink.value = !isRightShrink.value;
  598. break;
  599. }
  600. };
  601. const photoList = ref([
  602. {key: "病虫", statement: "病虫 2025年02月19日,发现毛毡病异常1级"},
  603. {key: "异常", statement: "2025年03月17日,发现花量大异常3级"},
  604. {key: "营养", statement: "无营养异常"},
  605. ]);
  606. </script>
  607. <style lang="scss" scoped>
  608. .base-container {
  609. width: 100%;
  610. height: 100vh;
  611. color: #fff;
  612. position: absolute;
  613. box-sizing: border-box;
  614. z-index: 1;
  615. .content {
  616. width: 100%;
  617. height: calc(100% - 74px - 48px);
  618. display: flex;
  619. justify-content: space-between;
  620. box-sizing: border-box;
  621. .left,
  622. .right {
  623. width: calc(376px + 54px);
  624. height: 100%;
  625. margin-top: 10px;
  626. box-sizing: border-box;
  627. display: flex;
  628. position: relative;
  629. }
  630. .left {
  631. background: #101010;
  632. border-radius: 4px;
  633. border: 1px solid #444444;
  634. .arrow {
  635. position: absolute;
  636. right: -16px;
  637. top: calc(50% - 40px);
  638. background: #fff;
  639. width: 16px;
  640. height: 80px;
  641. line-height: 80px;
  642. border-radius: 0 5px 5px 0;
  643. text-align: center;
  644. cursor: pointer;
  645. }
  646. }
  647. .right {
  648. width: calc(376px + 54px + 10px);
  649. .album-r {
  650. .list-wrap {
  651. width: 375px;
  652. }
  653. }
  654. .list {
  655. width: 100%;
  656. height: 100%;
  657. .btn-wrap {
  658. width: 100%;
  659. height: 25px;
  660. line-height: 25px;
  661. margin: 10px 0;
  662. display: flex;
  663. align-items: center;
  664. justify-content: space-between;
  665. div {
  666. width: 48%;
  667. height: 100%;
  668. color: #ffd489;
  669. border: 1px solid rgba(255, 213, 137, 0.6);
  670. border-radius: 2px;
  671. text-align: center;
  672. font-size: 12px;
  673. cursor: pointer;
  674. &.active {
  675. background: #ffd489;
  676. color: #000;
  677. }
  678. }
  679. }
  680. .img-box {
  681. width: 100%;
  682. height: calc(100% - 35px);
  683. overflow: auto;
  684. }
  685. .img-box1 {
  686. width: 100%;
  687. height: calc(100% - 10px);
  688. overflow: auto;
  689. margin-top: 10px;
  690. }
  691. .img-box2 {
  692. width: 100%;
  693. height: calc(100% - 45px);
  694. overflow: auto;
  695. margin-top: 10px;
  696. }
  697. img {
  698. width: 100%;
  699. height: auto;
  700. object-fit: cover;
  701. margin-bottom: 12px;
  702. cursor: pointer;
  703. }
  704. .mt {
  705. margin-top: -12px;
  706. }
  707. .list-wrap {
  708. ::v-deep {
  709. .chart-content {
  710. padding: 16px 0 0 0;
  711. }
  712. }
  713. }
  714. }
  715. }
  716. .overflow {
  717. overflow: auto;
  718. }
  719. .home-bottom {
  720. display: flex;
  721. align-items: flex-end;
  722. width: calc(100% - 60px - 430px * 2);
  723. height: 152px;
  724. align-self: flex-end;
  725. .time-wrap {
  726. height: 85px;
  727. }
  728. .fly-icon {
  729. width: 148px;
  730. height: 100%;
  731. margin-left: 27px;
  732. }
  733. .log-box {
  734. height: 34%;
  735. width: calc(100% - 340px - 28px);
  736. margin-right: 28px;
  737. .box-name {
  738. width: 89px;
  739. height: 22px;
  740. text-align: center;
  741. line-height: 22px;
  742. border-radius: 20px;
  743. margin: 10px 0 5px 6px;
  744. cursor: pointer;
  745. background: linear-gradient(0deg, #bba269 0%, #3d3523 100%);
  746. }
  747. .log-content {
  748. font-size: 12px;
  749. line-height: 1.5;
  750. padding: 0 18px;
  751. }
  752. .chart-wrap {
  753. width: 100%;
  754. height: calc(100% - 50px);
  755. .line {
  756. margin-top: 10px;
  757. margin-bottom: 12px;
  758. }
  759. img {
  760. width: 100%;
  761. margin-bottom: 10px;
  762. }
  763. }
  764. }
  765. .garden-file {
  766. position: relative;
  767. top: 10px;
  768. // height: 30%;
  769. // min-height: 210px;
  770. // width: 640px;
  771. transition: all 0.3s;
  772. width: 800px;
  773. height: 320px;
  774. overflow: hidden;
  775. &.isShrink {
  776. height: 66px;
  777. width: 450px;
  778. overflow: hidden;
  779. .arrow {
  780. .icon {
  781. transform: rotate(90deg);
  782. }
  783. }
  784. }
  785. .arrow {
  786. position: absolute;
  787. right: 56px;
  788. top: 36px;
  789. background: #fff;
  790. height: 16px;
  791. width: 80px;
  792. line-height: 16px;
  793. border-radius: 0 0 5px 5px;
  794. text-align: center;
  795. cursor: pointer;
  796. .icon {
  797. transform: rotate(270deg);
  798. }
  799. }
  800. }
  801. .file-box {
  802. height: 25%;
  803. min-height: 210px;
  804. width: 340px;
  805. position: relative;
  806. img {
  807. width: 100%;
  808. margin-top: 12px;
  809. }
  810. .arrow-icon {
  811. top: -32px;
  812. left: 50%;
  813. position: absolute;
  814. background: #fff;
  815. width: 16px;
  816. height: 80px;
  817. line-height: 80px;
  818. border-radius: 5px 0 0 5px;
  819. text-align: center;
  820. transform: translateX(-50%) rotate(270deg);
  821. }
  822. .edit-btn {
  823. padding: 2px 24px;
  824. background: #ffd489;
  825. border-radius: 4px;
  826. color: #000;
  827. }
  828. }
  829. }
  830. .legend {
  831. position: fixed;
  832. bottom: 8px;
  833. right: 64px;
  834. // width: 525px;
  835. height: 20px;
  836. }
  837. .map-bg {
  838. position: fixed;
  839. z-index: 2;
  840. background: rgba(35, 35, 35, 0.8);
  841. border-radius: 18px;
  842. padding: 7px 16px;
  843. right: 460px;
  844. }
  845. .map-btn {
  846. top: 19px;
  847. cursor: pointer;
  848. }
  849. .map-legend {
  850. bottom: 34px;
  851. .item {
  852. display: flex;
  853. align-items: center;
  854. font-size: 14px;
  855. img {
  856. width: 16px;
  857. margin-right: 6px;
  858. }
  859. .legend-block {
  860. width: 16px;
  861. height: 16px;
  862. box-sizing: border-box;
  863. border-radius: 50%;
  864. border: 2px solid #fff;
  865. margin-right: 6px;
  866. }
  867. }
  868. .legend-title {
  869. border-bottom: 1px solid rgba(102, 102, 102, 0.35);
  870. }
  871. .item + .item {
  872. padding-top: 10px;
  873. }
  874. }
  875. }
  876. }
  877. .bottom-map {
  878. width: 100%;
  879. height: 100vh;
  880. position: absolute;
  881. z-index: 0;
  882. }
  883. .compare-start-btn {
  884. position: absolute;
  885. z-index: 2;
  886. left: 50%;
  887. transform: translateX(-50%);
  888. cursor: pointer;
  889. bottom: 106px;
  890. // right: 445px;
  891. img {
  892. height: 55px;
  893. }
  894. }
  895. </style>
  896. <style lang="less">
  897. .file-wrap {
  898. &.map-file {
  899. width: 367px;
  900. position: relative;
  901. background: url("@/assets/images/home/file-bg.png") no-repeat top center / 100% 100%;
  902. margin-left: 12px;
  903. padding: 12px;
  904. .file-title {
  905. font-size: 20px;
  906. color: #ffd489;
  907. .tag {
  908. border: 1px solid #FFD489;
  909. border-radius: 4px;
  910. font-size: 12px;
  911. display: inline-block;
  912. width: 44px;
  913. height: 20px;
  914. text-align: center;
  915. line-height: 18px;
  916. margin-left: 8px;
  917. padding: 1px 4px;
  918. }
  919. }
  920. .overview-file {
  921. padding-top: 20px;
  922. .box-title {
  923. font-size: 16px;
  924. padding-left: 13px;
  925. margin-bottom: 16px;
  926. position: relative;
  927. display: flex;
  928. justify-content: space-between;
  929. color: #fff;
  930. &::before {
  931. content: "";
  932. position: absolute;
  933. left: 0;
  934. top: 3px;
  935. width: 3px;
  936. height: 16px;
  937. background: #fff;
  938. border-radius: 11px;
  939. }
  940. }
  941. .title {
  942. color: #f3c11d;
  943. font-size: 16px;
  944. font-family: "PangMenZhengDao";
  945. margin-bottom: 20px;
  946. .big {
  947. width: 13px;
  948. height: 13px;
  949. margin: -10px 0 0 4px;
  950. }
  951. .small {
  952. width: 7px;
  953. height: 7px;
  954. margin-left: -3px;
  955. }
  956. }
  957. .base-data {
  958. background: rgba(207, 207, 207, 0.1);
  959. border-radius: 4px;
  960. padding: 6px 0;
  961. display: flex;
  962. .base-item {
  963. flex: 1;
  964. text-align: center;
  965. .label {
  966. font-size: 12px;
  967. color: #666666;
  968. }
  969. .value {
  970. padding-top: 2px;
  971. font-size: 16px;
  972. color: #ffffff;
  973. }
  974. }
  975. .base-item + .base-item {
  976. border-left: 1px solid rgba(102, 102, 102, 0.42);
  977. }
  978. }
  979. .list {
  980. margin-top: 15px;
  981. width: max-content;
  982. font-size: 14px;
  983. .list-item {
  984. color: #bbbbbb;
  985. display: flex;
  986. margin-bottom: 8px;
  987. .list-name {
  988. color: #f3c11d;
  989. margin-right: 6px;
  990. img {
  991. width: 17px;
  992. height: 13px;
  993. }
  994. }
  995. }
  996. }
  997. }
  998. .overview-file + .overview-file {
  999. margin-top: 8px;
  1000. }
  1001. .box-wrap {
  1002. display: flex;
  1003. .box-item {
  1004. // flex: 1;
  1005. min-width: 109px;
  1006. display: flex;
  1007. flex-direction: column;
  1008. justify-content: center;
  1009. align-items: center;
  1010. padding: 6px;
  1011. box-sizing: border-box;
  1012. background: rgba(207, 207, 207, 0.1);
  1013. border-radius: 4px;
  1014. border: 1px solid rgba(207, 207, 207, 0.1);
  1015. cursor: pointer;
  1016. .item-name {
  1017. font-size: 12px;
  1018. color: #666666;
  1019. width: max-content;
  1020. }
  1021. .item-val {
  1022. font-size: 18px;
  1023. color: #fff;
  1024. width: max-content;
  1025. padding-top: 3px;
  1026. }
  1027. &.active {
  1028. background: rgba(255, 212, 137, 0.16);
  1029. border: 1px solid #ffd489;
  1030. .item-name {
  1031. color: #bbbbbb;
  1032. }
  1033. }
  1034. }
  1035. .box-item + .box-item {
  1036. margin-left: 8px;
  1037. }
  1038. }
  1039. }
  1040. }
  1041. </style>