history.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <!-- 虫情历史数据 -->
  3. <view>
  4. <!-- 统计图 -->
  5. <view class="ui-card history-chart">
  6. <!-- 按钮组合 -->
  7. <view class="time-btn-group">
  8. <block v-for="(time,index) in timeList" :key="index">
  9. <view class="row-center time-btn">{{time.text}}</view>
  10. </block>
  11. </view>
  12. </view>
  13. <!-- 统计图end -->
  14. <!-- 历史数据列表 -->
  15. <view class="ui-card history-panel">
  16. <view class="row-between mb">
  17. <view class="">数据列表</view>
  18. </view>
  19. <!-- 历史数据表格 -->
  20. <uni-table class="table-style" ref="table" :loading="loading" border emptyText="暂无更多数据">
  21. <uni-tr>
  22. <uni-th width="150" align="center">日期</uni-th>
  23. <uni-th width="150" align="center">姓名</uni-th>
  24. <uni-th align="center">地址</uni-th>
  25. <uni-th width="204" align="center">设置</uni-th>
  26. </uni-tr>
  27. <uni-tr v-for="(item, index) in tableData" :key="index">
  28. <uni-td>{{ item.date }}</uni-td>
  29. <uni-td>{{ item.date }}</uni-td>
  30. <uni-td>
  31. <view class="name">{{ item.name }}</view>
  32. </uni-td>
  33. <uni-td align="center">{{ item.address }}</uni-td>
  34. </uni-tr>
  35. </uni-table>
  36. <!-- 页码 -->
  37. <uni-pagination :total="50" title="标题文字" />
  38. <!-- 页码end -->
  39. </view>
  40. <!-- 历史数据列表end -->
  41. </view>
  42. </template>
  43. <script>
  44. import {
  45. getWormLampList
  46. } from '@/api/worm.js'
  47. import areaCharts from './components/w-area-charts.vue'
  48. export default {
  49. data() {
  50. return {
  51. areaData: {
  52. categories: ["2016", "2017", "2018", "2019", "2020", "2021"],
  53. series: [{
  54. name: "成交量A",
  55. data: [35, 8, 25, 37, 4, 20]
  56. },
  57. {
  58. name: "成交量B",
  59. data: [70, 40, 65, 100, 44, 68]
  60. },
  61. {
  62. name: "成交量C",
  63. data: [100, 80, 95, 150, 112, 132]
  64. }
  65. ]
  66. },
  67. // 时间列表
  68. timeList: [{
  69. text: '24小时',
  70. value: 1,
  71. },
  72. {
  73. text: '近一个月',
  74. value: 2,
  75. }, {
  76. text: '近半年',
  77. value: 3,
  78. }, {
  79. text: '近一年',
  80. value: 4,
  81. }
  82. ],
  83. range: ['2021-02-1', '2021-3-28'],
  84. loading: false, // 表格加载状态
  85. tableData: [{
  86. "date": "2020-09-01",
  87. "name": "Dcloud1",
  88. "address": "上海市普陀区金沙江路 1518 弄"
  89. }, {
  90. "date": "2020-09-02",
  91. "name": "Dcloud2",
  92. "address": "上海市普陀区金沙江路 1517 弄"
  93. }, {
  94. "date": "2020-09-03",
  95. "name": "Dcloud3",
  96. "address": "上海市普陀区金沙江路 1519 弄"
  97. }, {
  98. "date": "2020-09-04",
  99. "name": "Dcloud4",
  100. "address": "上海市普陀区金沙江路 1516 弄"
  101. }],
  102. };
  103. },
  104. components: {
  105. areaCharts
  106. },
  107. methods: {
  108. maskClick(e) {
  109. console.log('----maskClick事件:', e);
  110. }
  111. }
  112. }
  113. </script>
  114. <style lang="scss">
  115. .history-chart {
  116. padding: 32rpx 24rpx;
  117. }
  118. .time-btn-group {
  119. display: flex;
  120. justify-content: center;
  121. margin-bottom: 24rpx;
  122. .time-btn {
  123. width: 125rpx;
  124. height: 55rpx;
  125. font-size: 24rpx;
  126. color: #999;
  127. border-radius: 8rpx;
  128. border: 1rpx solid #DDDDDD;
  129. }
  130. }
  131. .history-panel {
  132. padding: 24rpx 26rpx;
  133. margin-bottom: 56rpx;
  134. }
  135. .table-style {
  136. margin-bottom: 42rpx;
  137. .uni-table-th,
  138. .uni-table-td {
  139. color: #333333;
  140. font-weight: normal;
  141. font-size: 24rpx;
  142. color: #333333;
  143. line-height: 34rpx;
  144. text-align: center;
  145. }
  146. .uni-table-th {
  147. background-color: #F9F9F9;
  148. padding: 10rpx 20rpx;
  149. }
  150. .uni-table-td {
  151. padding: 12rpx 20rpx;
  152. }
  153. }
  154. </style>