Violation.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <template>
  2. <view>
  3. <view class="top">
  4. <image src="./icon/top.png" mode="widthFix"></image>
  5. </view>
  6. <view class="total">
  7. <view class="title">今日车辆违章</view>
  8. <view class="num">
  9. <text>{{total}}</text>个
  10. </view>
  11. </view>
  12. <view class="section section_1">
  13. <view class="title">
  14. <view class="line"></view>
  15. <view class="text">车辆违章统计</view>
  16. </view>
  17. <view class="charts-box">
  18. <qiun-data-charts type="column" :opts="opts_1" :chartData="chartData_1" />
  19. </view>
  20. </view>
  21. <view class="section">
  22. <view class="title">
  23. <view class="line"></view>
  24. <view class="text">一周内车辆违章趋势</view>
  25. </view>
  26. <view class="charts-box">
  27. <qiun-data-charts type="column" :opts="opts_2" :chartData="chartData_2" />
  28. </view>
  29. </view>
  30. <view class="section section_3">
  31. <view class="title">
  32. <view class="line"></view>
  33. <view class="text">今日车辆违章</view>
  34. </view>
  35. <view class="example-body">
  36. <uni-datetime-picker type="date" :clear-icon="false" v-model="single" />
  37. <view class="btn" @click="getServerData">查询</view>
  38. </view>
  39. <view class="table">
  40. <uni-table emptyText="暂无更多数据">
  41. <uni-tr>
  42. <uni-th align="center">车牌</uni-th>
  43. <uni-th align="center" width="80">违章类型</uni-th>
  44. <uni-th align="center">区队</uni-th>
  45. <uni-th align="center" width="100">时间</uni-th>
  46. <uni-th align="center">位置/速度</uni-th>
  47. </uni-tr>
  48. <uni-tr v-for="(item,index) in table" :key="index">
  49. <uni-td style="text-align: center;vertical-align: middle;">{{item.car_number}}</uni-td>
  50. <uni-td style="text-align: center;vertical-align: middle;">{{item.type}}</uni-td>
  51. <uni-td style="text-align: center;vertical-align: middle;">{{item.speed}}</uni-td>
  52. <uni-td style="text-align: center;vertical-align: middle;">{{item.time}}</uni-td>
  53. <uni-td style="text-align: center;vertical-align: middle;">{{item.place}}</uni-td>
  54. </uni-tr>
  55. </uni-table>
  56. </view>
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. import "@/common/time.js"
  62. export default {
  63. data() {
  64. return {
  65. total: 0,
  66. single: "",
  67. chartData_1: {},
  68. chartData_2: {},
  69. table: [],
  70. opts_1: {
  71. color: ["#FF7C7C", "#FCC524"],
  72. legend: {},
  73. extra: {
  74. column: {
  75. width: 15,
  76. }
  77. }
  78. },
  79. opts_2: {
  80. color: ["#00A1E9"],
  81. legend: {
  82. show: false
  83. },
  84. extra: {
  85. column: {
  86. width: 25,
  87. }
  88. }
  89. }
  90. };
  91. },
  92. onLoad() {
  93. console.log()
  94. // 获取今天的日期
  95. this.single = new Date().format("yyyy-MM-dd");
  96. this.getServerData()
  97. },
  98. methods: {
  99. getServerData() {
  100. setTimeout(() => {
  101. uni.showLoading({
  102. mask: true
  103. })
  104. this.$api.getCarDownIllegalAllList({
  105. mine_code: "zaoquan",
  106. date: this.single
  107. }).then((res) => {
  108. uni.hideLoading()
  109. this.total = res.data.total
  110. this.chartData_1 = res.data.speeding_con
  111. this.chartData_2 = res.data.speeding_week
  112. this.table = res.data.detail_list
  113. })
  114. }, 10);
  115. },
  116. }
  117. }
  118. </script>
  119. <style lang="scss">
  120. page {
  121. background-color: #F5F6F8;
  122. }
  123. .top {
  124. margin-top: -60rpx;
  125. image {
  126. width: 750rpx;
  127. }
  128. }
  129. .total {
  130. position: relative;
  131. z-index: 1;
  132. margin: -200rpx auto 60rpx;
  133. width: 440rpx;
  134. height: 80rpx;
  135. background: rgba(0, 161, 233, 0.3);
  136. border: 2rpx solid #FFFFFF;
  137. border-radius: 40px;
  138. display: flex;
  139. align-items: center;
  140. justify-content: center;
  141. font-weight: 700;
  142. color: #fff;
  143. .title {
  144. margin-right: 20rpx;
  145. }
  146. .num {
  147. text {
  148. font-size: 42rpx;
  149. }
  150. }
  151. }
  152. .section_1 {
  153. position: relative;
  154. z-index: 1;
  155. }
  156. .section_3 {
  157. .title {
  158. margin: -20rpx -20rpx 0;
  159. padding: 20rpx;
  160. background-image: url("./icon/title.png");
  161. background-size: 100%;
  162. }
  163. }
  164. .section {
  165. margin: 0 auto 30rpx;
  166. width: 680rpx;
  167. min-height: 400rpx;
  168. background: #FFFFFF;
  169. border-radius: 30rpx;
  170. box-sizing: border-box;
  171. padding: 20rpx;
  172. box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
  173. .title {
  174. height: 60rpx;
  175. line-height: 60rpx;
  176. font-size: 30rpx;
  177. font-weight: 700;
  178. display: flex;
  179. align-items: center;
  180. .line {
  181. width: 8rpx;
  182. height: 30rpx;
  183. background-color: #00A1E9;
  184. border-radius: 20rpx;
  185. margin-right: 10rpx;
  186. }
  187. .text {}
  188. }
  189. .charts-box {
  190. width: 100%;
  191. min-height: 400rpx;
  192. padding: 20rpx 0;
  193. }
  194. .example-body {
  195. margin-top: 30rpx;
  196. display: flex;
  197. align-items: center;
  198. justify-content: space-between;
  199. .btn {
  200. width: 160rpx;
  201. line-height: 80rpx;
  202. background: #00A1E9;
  203. border-radius: 30px;
  204. text-align: center;
  205. color: #fff;
  206. font-size: 28rpx;
  207. }
  208. /deep/.uni-date {
  209. width: 460rpx;
  210. }
  211. /deep/.uni-date-editor--x {
  212. border-radius: 60rpx;
  213. overflow: hidden;
  214. }
  215. /deep/.uni-icons.uniui-calendar {
  216. display: none;
  217. }
  218. }
  219. .table {
  220. margin: 20rpx 0;
  221. /deep/.uni-table-tr {
  222. background-color: #F2FAFE;
  223. }
  224. /deep/.uni-table-th {
  225. border: none;
  226. background-color: #fff;
  227. }
  228. /deep/.uni-table-td {
  229. color: #000;
  230. font-size: 28rpx;
  231. font-weight: 700;
  232. padding: 30rpx 0;
  233. border-bottom: 8rpx solid #fff;
  234. }
  235. /deep/.table--border {
  236. border: none;
  237. }
  238. }
  239. }
  240. </style>