index.vue 35 KB

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