homePage.vue 7.9 KB

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