index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  1. <template>
  2. <div>
  3. <Bg></Bg>
  4. <Header></Header>
  5. <div class="container2">
  6. <div class="mainDiv">
  7. <div class="leftBox">
  8. <Title class="title" title="农事分析"></Title>
  9. </div>
  10. <div class="rightBox">
  11. <Title class="title" title="一梢营养"></Title>
  12. <div class="box-item flex">
  13. <div class="basic-info">
  14. <div class="box-title">
  15. <span>农事基本信息</span>
  16. <img src="@/assets/img/analysisDetails/edit_icon.png" alt="" />
  17. </div>
  18. <div class="box-cont">
  19. <div class="text">
  20. <img src="@/assets/img/analysisDetails/round.png" alt="" />
  21. <span>执行时间:</span>
  22. <span class="value">2024.03.04</span>
  23. </div>
  24. <div class="text">
  25. <img src="@/assets/img/analysisDetails/round.png" alt="" />
  26. <span>农事类型:</span>
  27. <span class="value">一梢营养</span>
  28. </div>
  29. <div class="text mb">
  30. <img src="@/assets/img/analysisDetails/round.png" alt="" />
  31. <span>药物处方</span>
  32. </div>
  33. <div class="card">
  34. <div class="header">
  35. <div class="icon"></div>
  36. <div class="name">
  37. <span class="blue">营养类-</span>
  38. <span>乙烯利 (药物配比 1:11)</span>
  39. </div>
  40. </div>
  41. <div class="desc">药物建议:禁用****</div>
  42. </div>
  43. <div class="card">
  44. <div class="header">
  45. <div class="icon"></div>
  46. <div class="name">
  47. <span class="blue">病虫害-</span>
  48. <span>多效挫 (药物配比 1:11)</span>
  49. </div>
  50. </div>
  51. <div class="desc">药物建议:禁用****</div>
  52. </div>
  53. <div class="text">
  54. <img src="@/assets/img/analysisDetails/round.png" alt="" />
  55. <span>复核时间: </span>
  56. <span class="value">2024.03.07</span>
  57. </div>
  58. </div>
  59. </div>
  60. <div class="map" ref="mapRef">
  61. <div class="map-title">执行区域</div>
  62. </div>
  63. </div>
  64. <div class="box-item border box-height">
  65. <div class="box-header">
  66. <div class="box-title">
  67. <span>农事复盘指标图</span>
  68. </div>
  69. <div class="select-group">
  70. <el-select
  71. v-model="selectValue"
  72. class="select yse-events"
  73. effect="dark"
  74. popper-class="v-select-popper-ns"
  75. >
  76. <el-option
  77. v-for="item in optionsList"
  78. :key="item.value"
  79. :label="item.label"
  80. :value="item.value"
  81. />
  82. </el-select>
  83. <el-select
  84. v-model="selectValueTwo"
  85. class="select yse-events"
  86. effect="dark"
  87. popper-class="v-select-popper-ns"
  88. >
  89. <el-option
  90. v-for="item in optionsListTwo"
  91. :key="item.value"
  92. :label="item.label"
  93. :value="item.value"
  94. />
  95. </el-select>
  96. </div>
  97. </div>
  98. <LineChart></LineChart>
  99. </div>
  100. <div class="box-item border">
  101. <div class="box-title">
  102. <span>时序照片</span>
  103. </div>
  104. <TreeImgList
  105. :selected="selected"
  106. :periodId="curPeriodId"
  107. :attrField="curAttrField"
  108. v-for="treeImg in treeImgList"
  109. :treeId="treeImg.id"
  110. :key="treeImg.id"
  111. :code="treeImg.code"
  112. :images="treeImg.images"
  113. @clickAction="imgListClick"
  114. @preview="preview"
  115. ></TreeImgList>
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. <PicturePreview
  122. :show="showViewer"
  123. :imageUrl="urls"
  124. :curIndex="urlsIndex"
  125. ></PicturePreview>
  126. </template>
  127. <script setup>
  128. import Bg from "../../Bg";
  129. import Title from "../../components/title";
  130. import Header from "@/views/components/Header.vue";
  131. import LineChart from "./lineChart.vue";
  132. import TreeImgList from "../../zhgl/com/tree_img_list/TreeImgList";
  133. import PicturePreview from "@/components/PicturePreview.vue";
  134. import analysisMap from "./analysisMap";
  135. import { ref, onMounted } from "vue";
  136. import { useStore } from "vuex";
  137. const store = useStore();
  138. const selectValue = ref("7");
  139. const optionsList = [
  140. {
  141. value: "7",
  142. label: "农事作用分区",
  143. },
  144. {
  145. value: "3",
  146. label: "3天",
  147. },
  148. ];
  149. const selectValueTwo = ref("7");
  150. const optionsListTwo = [
  151. {
  152. value: "7",
  153. label: "显示时间",
  154. },
  155. {
  156. value: "3",
  157. label: "3天",
  158. },
  159. ];
  160. const selected = ref([]);
  161. let curPeriodId = ref(null);
  162. let treeImgList = ref([]);
  163. let page = 0;
  164. let limit = 10;
  165. const miniMapRef = ref(null);
  166. const urls = ref([]);
  167. const urlsIndex = ref(0);
  168. const showViewer = ref(false);
  169. /**
  170. * 点击图片列表
  171. * @param key
  172. * @param treeId
  173. */
  174. function imgListClick(key, treeId) {
  175. switch (key) {
  176. case "treeImgList":
  177. selected.value = [treeId];
  178. break;
  179. case "dateImgList":
  180. selected.value = [treeId];
  181. break;
  182. }
  183. miniMapRef.value.setSelected(treeId);
  184. }
  185. /**
  186. * 预览照片
  187. * @param images
  188. */
  189. function preview(images, dataArr, index) {
  190. // datas.value = dataArr;
  191. urls.value = images;
  192. urlsIndex.value = index;
  193. showViewer.value = !showViewer.value;
  194. }
  195. // 地图初始化
  196. const mapRef = ref(null);
  197. const kmap = new analysisMap();
  198. const location = store.getters.userinfo.location;
  199. const curGardenId = ref(store.getters.userinfo.curGardenId);
  200. onMounted(() => {
  201. page = 0;
  202. limit = 10;
  203. // initTreeImgList(organId, areaId, page, limit);
  204. initTreeImgList(766, 2, 0, 10);
  205. kmap.initMap(location, mapRef.value);
  206. });
  207. /**
  208. * 初始化TreeImgList
  209. * */
  210. async function initTreeImgList(organId, areaId, pageNo) {
  211. if (pageNo) {
  212. page = pageNo;
  213. }
  214. if (!areaId) {
  215. areaId = -1;
  216. }
  217. let { code, data } = await VE_API.tree.page({ organId, areaId, page, limit });
  218. // if (data.length == 0) {
  219. // nomore.value = true;
  220. // }
  221. for (let item of data) {
  222. treeImgList.value.push(item);
  223. }
  224. }
  225. </script>
  226. <style lang="scss" scoped>
  227. .container2 {
  228. height: 100%;
  229. width: 100%;
  230. z-index: 2;
  231. position: absolute;
  232. }
  233. .mainDiv {
  234. position: absolute;
  235. top: 100px;
  236. bottom: 60px;
  237. left: 20px;
  238. right: 20px;
  239. .leftBox {
  240. float: left;
  241. width: 720px;
  242. height: calc(100%);
  243. border: 1px solid rgba(81, 233, 240, 0.6);
  244. box-sizing: border-box;
  245. }
  246. .title {
  247. width: 480px;
  248. }
  249. .rightBox {
  250. float: right;
  251. width: calc(100% - 720px - 12px);
  252. height: 100%;
  253. background: #032c3940;
  254. border: 1px solid rgba(81, 233, 240, 0.6);
  255. box-sizing: border-box;
  256. overflow: auto;
  257. color: #fff;
  258. .box-item {
  259. margin: 10px;
  260. width: 98%;
  261. height: 424px;
  262. box-sizing: border-box;
  263. margin-bottom: 20px;
  264. &.border {
  265. padding: 6px;
  266. border: 1px solid rgba(0, 255, 240, 0.12);
  267. }
  268. &.flex {
  269. display: flex;
  270. justify-content: space-between;
  271. }
  272. &.box-height {
  273. height: 400px;
  274. }
  275. .box-title {
  276. background: url("@/assets/img/analysisDetails/box_title.png") no-repeat
  277. center center / 100% 100%;
  278. width: 370px;
  279. display: flex;
  280. box-sizing: border-box;
  281. justify-content: space-between;
  282. padding: 5px 12px;
  283. font-size: 20px;
  284. margin-bottom: 20px;
  285. height: 40px;
  286. img {
  287. cursor: pointer;
  288. }
  289. }
  290. .basic-info {
  291. background: url("@/assets/img/analysisDetails/info_bg.png") no-repeat
  292. center center / 100% 100%;
  293. width: 370px;
  294. height: 100%;
  295. box-sizing: border-box;
  296. padding: 6px;
  297. border: 1px solid rgba(0, 255, 240, 0.12);
  298. .box-cont {
  299. .text {
  300. font-size: 16px;
  301. margin-top: 16px;
  302. img {
  303. margin-right: 9px;
  304. }
  305. .value {
  306. margin-left: 25px;
  307. color: #01f0e2;
  308. }
  309. }
  310. .mb {
  311. margin-bottom: 10px;
  312. }
  313. .card {
  314. width: auto;
  315. margin: 0 4px;
  316. background: rgba(9, 37, 40, 0.29);
  317. border: 1px solid rgba(1, 240, 226, 0.12);
  318. font-size: 16px;
  319. margin-bottom: 7px;
  320. .header {
  321. background: rgba(1, 240, 226, 0.05);
  322. font-weight: bold;
  323. color: #ff8840;
  324. display: flex;
  325. align-items: center;
  326. padding: 4px 10px;
  327. .icon {
  328. width: 7px;
  329. height: 7px;
  330. background: #05e5d9;
  331. transform: rotate(45deg);
  332. margin-right: 10px;
  333. }
  334. .blue {
  335. color: #01f0e2;
  336. }
  337. }
  338. .desc {
  339. padding: 9px 10px;
  340. color: #ff0000;
  341. opacity: 0.6;
  342. }
  343. }
  344. }
  345. }
  346. .map {
  347. width: calc(100% - 374px - 4px);
  348. height: 100%;
  349. border: 1px solid rgba(0, 255, 240, 0.12);
  350. position: relative;
  351. box-sizing: border-box;
  352. .map-title {
  353. position: absolute;
  354. top: 6px;
  355. left: 4px;
  356. background: url("@/assets/img/analysisDetails/map_title.png")
  357. no-repeat center center / 100% 100%;
  358. width: 322px;
  359. font-size: 20px;
  360. color: #00fff0;
  361. padding: 3px 10px;
  362. z-index: 9;
  363. }
  364. }
  365. .box-header {
  366. display: flex;
  367. justify-content: space-between;
  368. .select {
  369. width: 162px;
  370. margin-right: 10px;
  371. ::v-deep {
  372. .el-select__wrapper {
  373. background: transparent;
  374. border: 1px solid rgba(81, 233, 240, 0.6);
  375. box-shadow: none;
  376. .el-select__placeholder {
  377. color: #00fff0;
  378. }
  379. .el-select__caret {
  380. color: #00fff0;
  381. }
  382. }
  383. }
  384. }
  385. }
  386. }
  387. }
  388. }
  389. </style>