index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. <template>
  2. <div class="base-container no-events">
  3. <fnHeader></fnHeader>
  4. <div class="content">
  5. <!-- <div class="top"></div> -->
  6. <div class="left yes-events">
  7. <div class="chart-list">
  8. <div class="chart-item">
  9. <chart-box name="光照效能" arrow="left">
  10. <!-- <template #title-right>
  11. <div>
  12. <el-select
  13. v-model="topographicValue"
  14. placeholder="请选择"
  15. style="width: 86px"
  16. size="small"
  17. >
  18. <el-option
  19. v-for="item in topographicOptions"
  20. :key="item.value"
  21. :label="item.label"
  22. :value="item.value"
  23. />
  24. </el-select>
  25. </div>
  26. </template> -->
  27. <div class="topographic-content">
  28. <bar-chart
  29. styleName="styleName1"
  30. :xData="evaluateXData"
  31. :yData="evaluateYData"
  32. ></bar-chart>
  33. <!-- <div class="text-list box-bg">
  34. <div class="text-item" v-for="item in 3" :key="item">
  35. <div class="circle"></div>
  36. <div class="txt">
  37. 高温Ⅰ级<span>26</span>棵
  38. </div>
  39. </div>
  40. </div> -->
  41. </div>
  42. </chart-box>
  43. </div>
  44. <div class="chart-item">
  45. <chart-box name="气象预警" arrow="left">
  46. <div class="topographic-content">
  47. <bar-chart
  48. styleName="styleName1"
  49. :xData="evaluateXData"
  50. :yData="evaluateYData"
  51. ></bar-chart>
  52. <div class="text-list box-bg">
  53. <div class="text-item" v-for="item in 3" :key="item">
  54. <div class="circle"></div>
  55. <div class="txt">桂味<span>15626</span>棵(树龄3.5年)</div>
  56. </div>
  57. </div>
  58. </div>
  59. </chart-box>
  60. </div>
  61. <div class="chart-item">
  62. <chart-box name="气象预警" arrow="left"></chart-box>
  63. </div>
  64. <div class="chart-item">
  65. <chart-box name="气象预警" arrow="left"></chart-box>
  66. </div>
  67. </div>
  68. </div>
  69. <div class="home-bottom">
  70. <div class="file-box yes-events">
  71. <chart-box name="果园档案">
  72. <template #title-right>
  73. <el-icon class="arrow-icon cursor-pointer" color="#141414"
  74. ><DArrowLeft
  75. /></el-icon>
  76. <div class="edit-btn cursor-pointer" @click="goBack">返回</div>
  77. </template>
  78. <file-bar>
  79. <div class="btn-list">
  80. <div class="btn-item">新增</div>
  81. <div class="btn-item">筛选</div>
  82. <div class="btn-item">撤销</div>
  83. <div class="btn-item">保存</div>
  84. </div>
  85. </file-bar>
  86. </chart-box>
  87. </div>
  88. </div>
  89. <div class="right yes-events">
  90. <div class="chart-list">
  91. <div class="chart-item">
  92. <chart-box name="病害历史" arrow="arrow-left">
  93. <template #title-right>
  94. <el-select
  95. v-model="pestHistoryValue"
  96. placeholder="请选择"
  97. size="small"
  98. class="common-select"
  99. popper-class="common-select-popper"
  100. >
  101. <el-option
  102. v-for="item in pestHistoryOptions"
  103. :key="item.value"
  104. :label="item.label"
  105. :value="item.value"
  106. />
  107. </el-select>
  108. </template>
  109. <div class="pest-history">
  110. <bar-chart
  111. styleName="styleName1"
  112. :xData="evaluateXData"
  113. :yData="evaluateYData"
  114. ></bar-chart>
  115. </div>
  116. </chart-box>
  117. </div>
  118. <div class="chart-item">
  119. <chart-box name="虫害历史" arrow="arrow-left">
  120. <template #title-right>
  121. <el-select
  122. v-model="pestHistoryValue"
  123. placeholder="请选择"
  124. size="small"
  125. class="common-select"
  126. popper-class="common-select-popper"
  127. >
  128. <el-option
  129. v-for="item in pestHistoryOptions"
  130. :key="item.value"
  131. :label="item.label"
  132. :value="item.value"
  133. />
  134. </el-select>
  135. </template>
  136. <div class="topographic-content">
  137. <bar-chart
  138. styleName="styleName1"
  139. :xData="evaluateXData"
  140. :yData="evaluateYData"
  141. ></bar-chart>
  142. <div class="text-list box-bg">
  143. <div class="text-item" v-for="item in 3" :key="item">
  144. <div class="circle"></div>
  145. <div class="txt">桂味<span>15626</span>棵(树龄3.5年)</div>
  146. </div>
  147. </div>
  148. </div>
  149. </chart-box>
  150. </div>
  151. <div class="chart-item">
  152. <chart-box name="气象预警" arrow="arrow-left"></chart-box>
  153. </div>
  154. <div class="chart-item">
  155. <chart-box name="气象预警" arrow="arrow-left"></chart-box>
  156. </div>
  157. </div>
  158. </div>
  159. </div>
  160. </div>
  161. <div ref="mapRef" class="bottom-map"></div>
  162. </template>
  163. <script setup>
  164. import { onMounted, ref } from "vue";
  165. import fnHeader from "@/components/fnHeader.vue";
  166. import chartBox from "@/components/chartBox.vue";
  167. import fileBar from "@/components/fileBar.vue";
  168. import barChart from "@/components/charts/barChart.vue";
  169. import FileMap from "./fileMap";
  170. import router from "@/router";
  171. let fileMap = new FileMap();
  172. const mapRef = ref();
  173. const topographicValue = ref("高温风险");
  174. const topographicOptions = ref([
  175. { label: "高温风险", value: "高温风险" },
  176. { label: "病害风险", value: "病害风险" },
  177. { label: "虫害风险", value: "虫害风险" },
  178. { label: "阴雨寡照", value: "阴雨寡照" },
  179. ]);
  180. // 右1-病害历史
  181. const pestHistoryValue = ref("品种");
  182. const pestHistoryOptions = ref([
  183. { label: "品种", value: "品种" },
  184. { label: "品种1", value: "品种1" },
  185. { label: "品种2", value: "品种2" },
  186. { label: "品种3", value: "品种3" },
  187. ]);
  188. // 地形风险
  189. const evaluateXData = ["区域1", "区域2", "区域3"];
  190. const evaluateYData = [33, 41, 43];
  191. onMounted(() => {
  192. let location = "POINT (113.78049350268851 23.419886891845312)";
  193. fileMap.initMap(location, mapRef.value);
  194. });
  195. // 返回
  196. const goBack = () => {
  197. router.replace("/home");
  198. };
  199. </script>
  200. <style lang="scss" scoped>
  201. .base-container {
  202. width: 100%;
  203. height: 100vh;
  204. color: #fff;
  205. position: absolute;
  206. box-sizing: border-box;
  207. z-index: 1;
  208. .content {
  209. width: 100%;
  210. height: calc(100% - 74px - 48px);
  211. display: flex;
  212. justify-content: space-between;
  213. box-sizing: border-box;
  214. .left,
  215. .right {
  216. width: 375px;
  217. height: 100%;
  218. padding-top: 10px;
  219. box-sizing: border-box;
  220. display: flex;
  221. .chart-list {
  222. width: 100%;
  223. height: 100%;
  224. display: flex;
  225. flex-direction: column;
  226. justify-content: space-between;
  227. .chart-item {
  228. width: 100%;
  229. height: calc(100% / 4);
  230. box-sizing: border-box;
  231. margin-bottom: 10px;
  232. &.chart-item:last-child {
  233. margin: 0;
  234. }
  235. }
  236. }
  237. .topographic-content {
  238. width: 100%;
  239. height: calc(100% - 10px);
  240. display: flex;
  241. align-items: center;
  242. justify-content: space-between;
  243. margin-bottom: 10px;
  244. .text {
  245. font-weight: 400;
  246. padding: 8px 0 4px 5px;
  247. text-indent: 2em;
  248. margin-left: 8px;
  249. span {
  250. color: #69bdff;
  251. }
  252. }
  253. .box-bg {
  254. border-radius: 2px 2px 0 0;
  255. font-size: 12px;
  256. padding: 8px 6px;
  257. box-sizing: border-box;
  258. background: linear-gradient(
  259. 180deg,
  260. rgb(85, 85, 85, 0.4) 0%,
  261. rgb(35, 35, 35, 1) 100%
  262. );
  263. }
  264. }
  265. .text-list {
  266. flex: none;
  267. margin: 0 16px;
  268. .text-item {
  269. display: flex;
  270. align-items: center;
  271. margin-bottom: 5px;
  272. .circle {
  273. width: 4px;
  274. height: 4px;
  275. background: rgba(255, 255, 255, 0.44);
  276. border-radius: 50%;
  277. margin-right: 6px;
  278. }
  279. .txt {
  280. font-size: 12px;
  281. span {
  282. margin: 0 2px 0 6px;
  283. color: #e8ba52;
  284. }
  285. }
  286. }
  287. }
  288. }
  289. .left {
  290. padding-left: 20px;
  291. }
  292. .right {
  293. padding-right: 20px;
  294. .list {
  295. width: 100%;
  296. height: 100%;
  297. }
  298. .pest-history {
  299. width: 100%;
  300. height: 100%;
  301. padding: 6px 8px 20px 20px;
  302. box-sizing: border-box;
  303. }
  304. }
  305. .home-bottom {
  306. display: flex;
  307. align-items: flex-end;
  308. width: calc(100% - 375px - 375px - 72px);
  309. height: 100%;
  310. justify-content: flex-end;
  311. .file-box {
  312. height: 25%;
  313. min-height: 210px;
  314. width: 422px;
  315. position: relative;
  316. box-shadow: 0 0 3px 3px #2199f8;
  317. .arrow-icon {
  318. top: -32px;
  319. left: 50%;
  320. position: absolute;
  321. background: #fff;
  322. width: 16px;
  323. height: 80px;
  324. line-height: 80px;
  325. border-radius: 5px 0 0 5px;
  326. text-align: center;
  327. transform: translateX(-50%) rotate(270deg);
  328. }
  329. .edit-btn {
  330. padding: 2px 24px;
  331. background: #2199f8;
  332. border-radius: 4px;
  333. }
  334. .btn-list {
  335. position: absolute;
  336. right: 4px;
  337. .btn-item {
  338. background: #4f4f4f;
  339. border-radius: 4px;
  340. padding: 2px 24px;
  341. margin-bottom: 16px;
  342. &:last-child {
  343. margin-bottom: 0;
  344. }
  345. }
  346. }
  347. }
  348. }
  349. }
  350. }
  351. .bottom-map {
  352. width: 100%;
  353. height: 100vh;
  354. position: absolute;
  355. z-index: 0;
  356. }
  357. </style>