homePage.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <template>
  2. <div class="chart-list">
  3. <div class="chart-item">
  4. <chart-box name="气象预警" arrow="left">
  5. <div class="base-wrap">
  6. <!-- <div class="base-item">111</div> -->
  7. <img src="@/assets/images/home/base.png" alt="">
  8. </div>
  9. <one-line-chart class="line-chart"></one-line-chart>
  10. </chart-box>
  11. </div>
  12. <div class="chart-item phenology">
  13. <chart-box name="物候调节" arrow="left">
  14. <template #title-left>
  15. <span class="title-left"> - 花芽萌动期</span>
  16. </template>
  17. <bar-chart class="bar-chart" styleName="styleName3" :xData="phenologyXData" :yData="phenologyYData"></bar-chart>
  18. <div class="time-line">
  19. <!-- <time-line></time-line> -->
  20. <!-- <div class="line">
  21. <img class="time-img" src="@/assets/images/home/time-line.png" alt="">
  22. </div> -->
  23. <div class="tips box-bg">
  24. 物候进程:预计 <span>12天</span> 后进入花蕾抽出期
  25. </div>
  26. </div>
  27. </chart-box>
  28. </div>
  29. <div class="chart-item phenology">
  30. <chart-box name="病虫测报" arrow="left">
  31. <!-- <template #title-right>
  32. <div class="btn-group">
  33. <div :class="['btn-item',{active:active===index}]" @click="handleActive(index)" v-for="(item,index) in diseasesBtnGroup" :key="index">{{item}}</div>
  34. </div>
  35. </template> -->
  36. <bar-chart class="bar-chart" styleName="styleName2" :xData="phenologyXData1" :yData="phenologyYData1"></bar-chart>
  37. <div class="time-line">
  38. <!-- <div class="line">
  39. <img class="time-img" src="@/assets/images/home/time-line.png" alt="">
  40. </div> -->
  41. <div class="tips box-bg">
  42. 所有区域中,<span>6</span> %区域出现毛毡病需要 <span>打药</span>
  43. </div>
  44. </div>
  45. <!-- <pie-chart class="pie-chart" styleName="styleName1"></pie-chart> -->
  46. </chart-box>
  47. </div>
  48. <div class="chart-item evaluate">
  49. <chart-box name="营养评估" arrow="left">
  50. <template #title-left>
  51. <span class="title-left"> - 肥效比</span>
  52. </template>
  53. <div class="content">
  54. <bar-chart styleName="styleName1" :xData="evaluateXData" :yData="evaluateYData"></bar-chart>
  55. <div class="box-bg text">
  56. 目前果园跨度异常比例达到<span>12%</span>,需要提供 <span>叶面肥</span>补充营养
  57. </div>
  58. </div>
  59. <!-- <div class="text-list box-bg">
  60. <div class="text-item">
  61. <div class="circle"></div>
  62. <div class="txt">
  63. 肥效比 低<span>**棵树</span>
  64. </div>
  65. </div>
  66. <div class="text-item">
  67. <div class="circle"></div>
  68. <div class="txt">
  69. 肥效比 中<span>**棵树</span>
  70. </div>
  71. </div>
  72. <div class="text-item">
  73. <div class="circle"></div>
  74. <div class="txt">
  75. 肥效比 高<span>**棵树</span>
  76. </div>
  77. </div>
  78. </div> -->
  79. </chart-box>
  80. </div>
  81. </div>
  82. </template>
  83. <script setup>
  84. import {ref} from 'vue'
  85. import chartBox from "@/components/chartBox.vue";
  86. import timeLine from "@/components/timeLine.vue";
  87. import barChart from "@/components/charts/barChart.vue";
  88. import pieChart from "@/components/charts/pieChart.vue";
  89. import oneLineChart from "@/components/charts/oneLineChart.vue";
  90. // 物候调节
  91. const phenologyXData = ["新梢褪绿", "花芽萌动","花蕾抽出","花穗伸长"]
  92. const phenologyYData = [{
  93. startNum:0,
  94. endNum:1,
  95. startColor:"#c6ab6b",
  96. endColor:"#4e442e"
  97. },{
  98. startNum:8,
  99. endNum:8,
  100. startColor:"#c6ab6b",
  101. endColor:"#4e442e"
  102. },{
  103. startNum:0,
  104. endNum:16,
  105. startColor:"#c6ab6b",
  106. endColor:"#4e442e"
  107. },{
  108. startNum:0,
  109. endNum:16,
  110. startColor:"#c6ab6b",
  111. endColor:"#4e442e"
  112. }]
  113. // 病虫测报
  114. const diseasesBtnGroup = ["病害1","病害2","病害3"]
  115. const active = ref(0)
  116. const handleActive = (i) =>{
  117. active.value = i
  118. }
  119. const phenologyXData1 = ["炭疽病", "啃食虫害","叶瘿蚊","毛毡病"]
  120. const phenologyYData1 = [{
  121. startNum:0,
  122. endNum:0,
  123. startColor:"#c6ab6b",
  124. endColor:"#4e442e"
  125. },{
  126. startNum:0,
  127. endNum:0,
  128. startColor:"#c6ab6b",
  129. endColor:"#4e442e"
  130. },{
  131. startNum:0,
  132. endNum:0,
  133. startColor:"#c6ab6b",
  134. endColor:"#4e442e"
  135. },{
  136. startNum:0,
  137. endNum:1,
  138. startColor:"#c6ab6b",
  139. endColor:"#4e442e"
  140. }]
  141. // 营养评估
  142. const evaluateXData = ["低", "中", "高"]
  143. const evaluateYData = [2, 8, 6]
  144. </script>
  145. <style lang="scss" scoped>
  146. .chart-list {
  147. width: calc(100% - 54px - 10px);
  148. height: 100%;
  149. display: flex;
  150. flex-direction: column;
  151. justify-content: space-between;
  152. .chart-item {
  153. width: 100%;
  154. height: calc(100% / 4);
  155. box-sizing: border-box;
  156. margin-bottom: 10px;
  157. &.chart-item:last-child {
  158. margin: 0;
  159. }
  160. .base-wrap{
  161. width: 100%;
  162. height: 65px;
  163. margin: 5px 0;
  164. img{
  165. width: 100%;
  166. height: 100%;
  167. }
  168. }
  169. .line-chart{
  170. height: calc(100% - 55px);
  171. }
  172. .box-bg{
  173. border-radius: 2px 2px 0 0;
  174. font-size: 12px;
  175. padding: 3px 6px;
  176. box-sizing: border-box;
  177. font-family: Arial, Helvetica, sans-serif;
  178. background: linear-gradient(180deg, rgb(85, 85, 85,0.4) 0%, rgb(35, 35, 35,1) 100%);
  179. span{
  180. color: #FFD489;
  181. }
  182. }
  183. .title-left{
  184. color: rgba(255,255,255,0.7);
  185. font-family: 'SOURCEHANTIFINE';
  186. }
  187. &.phenology{
  188. .bar-chart{
  189. width: 100%;
  190. height: calc(100% - 44px);
  191. }
  192. .time-line{
  193. width: 100%;
  194. // height: calc(45px + 10px);
  195. .line{
  196. width: 100%;
  197. height: calc(100% - 34px - 10px);
  198. margin: 4px 0 6px 0;
  199. .time-img{
  200. width: 100%;
  201. height: 100%;
  202. }
  203. }
  204. .tips{
  205. margin-top: 10px;
  206. width: 100%;
  207. height: 34px;
  208. line-height: 28px;
  209. }
  210. }
  211. }
  212. &.diseases{
  213. .btn-group{
  214. font-size: 11px;
  215. display: flex;
  216. align-items: center;
  217. .btn-item{
  218. border-radius: 2px;
  219. padding: 2px 4px;
  220. margin-left: 8px;
  221. cursor: pointer;
  222. &.active{
  223. background: #4F4F4F;
  224. }
  225. }
  226. }
  227. .pie-chart{
  228. width: 100%;
  229. height: calc(100% - 57px - 10px);
  230. margin-bottom: 10px;
  231. }
  232. }
  233. &.evaluate {
  234. .content {
  235. width: 100%;
  236. height: calc(100% - 10px);
  237. display: flex;
  238. align-items: center;
  239. justify-content: space-between;
  240. margin-bottom: 10px;
  241. .text{
  242. font-weight: 400;
  243. padding: 8px 0 4px 5px;
  244. text-indent: 2em;
  245. margin-left: 8px;
  246. span{
  247. color: #FFD489;
  248. }
  249. }
  250. }
  251. .text-list {
  252. width: 100%;
  253. height: 33px;
  254. display: flex;
  255. align-items: flex-start;
  256. justify-content: space-between;
  257. .text-item{
  258. display: flex;
  259. align-items: center;
  260. .circle{
  261. width: 4px;
  262. height: 4px;
  263. background: rgba(255,255,255,0.44);
  264. border-radius: 50%;
  265. margin-right: 6px;
  266. }
  267. .txt{
  268. font-size: 12px;
  269. span{
  270. color: #FFD489;
  271. }
  272. }
  273. }
  274. }
  275. }
  276. }
  277. }
  278. </style>