analyse.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  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 areaCharts from './components/w-area-charts.vue'
  80. import pieCharts from './components/w-pie-charts.vue'
  81. export default {
  82. data() {
  83. return {
  84. pieData: {
  85. series: [{
  86. data: [{
  87. "name": "一班",
  88. "value": 50
  89. }, {
  90. "name": "二班",
  91. "value": 30
  92. }, {
  93. "name": "三班",
  94. "value": 20
  95. }]
  96. }]
  97. },
  98. areaData: {
  99. categories: ["2016", "2017", "2018", "2019", "2020", "2021"],
  100. series: [{
  101. name: "成交量A",
  102. data: [35, 8, 25, 37, 4, 20]
  103. },
  104. {
  105. name: "成交量B",
  106. data: [70, 40, 65, 100, 44, 68]
  107. }
  108. ]
  109. },
  110. // 日期列表
  111. periodList: [{
  112. url: '',
  113. title: '始见期',
  114. time: '2022-08-22',
  115. num: 536
  116. },
  117. {
  118. url: '',
  119. title: '高峰期',
  120. time: '2022-08-22',
  121. num: 132
  122. }, {
  123. url: '',
  124. title: '终见期',
  125. time: '2022-08-22',
  126. num: 0
  127. }
  128. ],
  129. range: ['2021-02-1', '2021-3-28'],
  130. tabs: [{
  131. text: '图像溯源',
  132. value: 1
  133. }, {
  134. text: '虫害基础数据',
  135. value: 2
  136. }, ]
  137. };
  138. },
  139. components: {
  140. areaCharts,
  141. pieCharts
  142. },
  143. methods: {
  144. maskClick(e) {
  145. console.log('----maskClick事件:', e);
  146. }
  147. }
  148. }
  149. </script>
  150. <style lang="scss">
  151. // 时期样式
  152. .period-navs {
  153. display: flex;
  154. justify-content: space-between;
  155. }
  156. .period-item {
  157. width: 206rpx;
  158. height: 264rpx;
  159. padding: 24rpx;
  160. background-color: #FCF8FF;
  161. .icon {
  162. width: 80rpx;
  163. height: 80rpx;
  164. margin-bottom: 18rpx;
  165. background-color: #95F9E7;
  166. border-radius: 100%;
  167. }
  168. .title {
  169. font-size: 32rpx;
  170. font-weight: normal;
  171. color: #333333;
  172. line-height: 44rpx;
  173. }
  174. .text {
  175. margin-top: 10rpx;
  176. font-size: 24rpx;
  177. font-weight: normal;
  178. color: #999999;
  179. line-height: 34rpx;
  180. }
  181. }
  182. .progress-item {
  183. display: flex;
  184. align-items: center;
  185. justify-content: space-between;
  186. .label,
  187. .percent {
  188. font-size: 24rpx;
  189. color: #333;
  190. }
  191. .label {
  192. width: 160rpx;
  193. }
  194. .percent {
  195. width: 80rpx;
  196. text-align: right;
  197. }
  198. .progress {
  199. flex: 1;
  200. height: 18rpx;
  201. overflow: hidden;
  202. border-radius: 30rpx;
  203. }
  204. }
  205. // 虫害表格数据
  206. .worm-table{
  207. padding: 10rpx 24rpx 30rpx;
  208. margin-bottom: 100rpx;
  209. border-radius: 0;
  210. }
  211. </style>