analyse.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <template>
  2. <!-- 虫害分析 -->
  3. <view>
  4. <!-- 时期卡片 -->
  5. <view class="ui-card px-13">
  6. <!-- 选项框 -->
  7. <view class="row-end mb">
  8. <picker class="picker mr">
  9. <view class="picker-wrapper">
  10. 2022年
  11. <uni-icons type="bottom" :size="12" color="#DDDDDD"></uni-icons>
  12. </view>
  13. </picker>
  14. <picker class="picker">
  15. <view class="picker-wrapper">
  16. 步甲
  17. <uni-icons type="bottom" :size="12" color="#DDDDDD"></uni-icons>
  18. </view>
  19. </picker>
  20. </view>
  21. <!-- 时期列表 -->
  22. <view class="period-navs">
  23. <view class="period-item" v-for="(period,index) in periodList" :key="index">
  24. <view class="icon"></view>
  25. <view class="title">{{period.title}}</view>
  26. <view class="text">{{period.time}}</view>
  27. <view class="text">数量:{{period.num}}</view>
  28. </view>
  29. </view>
  30. </view>
  31. <!-- 虫害统计图 -->
  32. <view class="ui-card px-13">
  33. <!-- 选择时间范围 -->
  34. <view class="mb">
  35. <uni-datetime-picker v-model="range" type="daterange" rangeSeparator="至" @maskClick="maskClick" />
  36. </view>
  37. <!-- 区域统计图 -->
  38. <area-charts :chartData="areaData"></area-charts>
  39. <view style="height: 20rpx;"></view>
  40. <!-- 环形统计图 -->
  41. <pie-charts :chartData="pieData"></pie-charts>
  42. <!-- 统计列表 -->
  43. <view class="mt-12">
  44. <view class="progress-item">
  45. <view class="label">1、贪夜蛾</view>
  46. <view class="progress">
  47. <progress :percent="10" backgroundColor="#F3F5F9" activeColor="#10AEFF" :stroke-width="9" />
  48. </view>
  49. <view class="percent">52%</view>
  50. </view>
  51. </view>
  52. </view>
  53. <!-- 虫害表格数据 -->
  54. <view class="ui-card worm-table">
  55. <ui-tabs :list="tabs" :active="1"></ui-tabs>
  56. <uni-table class="table-style mt-12" ref="table" :loading="loading" border emptyText="暂无更多数据">
  57. <uni-tr>
  58. <uni-th width="150" align="center">日期</uni-th>
  59. <uni-th width="150" align="center">姓名</uni-th>
  60. <uni-th align="center">地址</uni-th>
  61. <uni-th width="204" align="center">设置</uni-th>
  62. </uni-tr>
  63. <uni-tr v-for="(item, index) in tableData" :key="index">
  64. <uni-td>{{ item.date }}</uni-td>
  65. <uni-td>{{ item.date }}</uni-td>
  66. <uni-td>
  67. <view class="name">{{ item.name }}</view>
  68. </uni-td>
  69. <uni-td align="center">{{ item.address }}</uni-td>
  70. </uni-tr>
  71. </uni-table>
  72. <!-- 页码 -->
  73. <uni-pagination :total="50" title="标题文字" />
  74. <!-- 页码end -->
  75. </view>
  76. </view>
  77. </template>
  78. <script>
  79. import {
  80. getWormLampList
  81. } from '@/api/worm.js'
  82. import areaCharts from './components/w-area-charts.vue'
  83. import pieCharts from './components/w-pie-charts.vue'
  84. export default {
  85. data() {
  86. return {
  87. pieData: {
  88. series: [{
  89. data: [{
  90. "name": "一班",
  91. "value": 50
  92. }, {
  93. "name": "二班",
  94. "value": 30
  95. }, {
  96. "name": "三班",
  97. "value": 20
  98. }]
  99. }]
  100. },
  101. areaData: {
  102. categories: ["2016", "2017", "2018", "2019", "2020", "2021"],
  103. series: [{
  104. name: "成交量A",
  105. data: [35, 8, 25, 37, 4, 20]
  106. },
  107. {
  108. name: "成交量B",
  109. data: [70, 40, 65, 100, 44, 68]
  110. }
  111. ]
  112. },
  113. // 日期列表
  114. periodList: [{
  115. url: '',
  116. title: '始见期',
  117. time: '2022-08-22',
  118. num: 536
  119. },
  120. {
  121. url: '',
  122. title: '高峰期',
  123. time: '2022-08-22',
  124. num: 132
  125. }, {
  126. url: '',
  127. title: '终见期',
  128. time: '2022-08-22',
  129. num: 0
  130. }
  131. ],
  132. range: ['2021-02-1', '2021-3-28'],
  133. tabs: [{
  134. text: '图像溯源',
  135. value: 1
  136. }, {
  137. text: '虫害基础数据',
  138. value: 2
  139. }, ]
  140. };
  141. },
  142. components: {
  143. areaCharts,
  144. pieCharts
  145. },
  146. methods: {
  147. maskClick(e) {
  148. console.log('----maskClick事件:', e);
  149. }
  150. }
  151. }
  152. </script>
  153. <style lang="scss">
  154. // 时期样式
  155. .period-navs {
  156. display: flex;
  157. justify-content: space-between;
  158. }
  159. .period-item {
  160. width: 206rpx;
  161. height: 264rpx;
  162. padding: 24rpx;
  163. background-color: #FCF8FF;
  164. .icon {
  165. width: 80rpx;
  166. height: 80rpx;
  167. margin-bottom: 18rpx;
  168. background-color: #95F9E7;
  169. border-radius: 100%;
  170. }
  171. .title {
  172. font-size: 32rpx;
  173. font-weight: normal;
  174. color: #333333;
  175. line-height: 44rpx;
  176. }
  177. .text {
  178. margin-top: 10rpx;
  179. font-size: 24rpx;
  180. font-weight: normal;
  181. color: #999999;
  182. line-height: 34rpx;
  183. }
  184. }
  185. .progress-item {
  186. display: flex;
  187. align-items: center;
  188. justify-content: space-between;
  189. .label,
  190. .percent {
  191. font-size: 24rpx;
  192. color: #333;
  193. }
  194. .label {
  195. width: 160rpx;
  196. }
  197. .percent {
  198. width: 80rpx;
  199. text-align: right;
  200. }
  201. .progress {
  202. flex: 1;
  203. height: 18rpx;
  204. overflow: hidden;
  205. border-radius: 30rpx;
  206. }
  207. }
  208. // 虫害表格数据
  209. .worm-table{
  210. padding: 10rpx 24rpx 30rpx;
  211. margin-bottom: 100rpx;
  212. border-radius: 0;
  213. }
  214. </style>