vehicle.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. <template>
  2. <div>
  3. <el-card>
  4. <template #header>
  5. <el-text size="large">车辆统计</el-text>
  6. </template>
  7. <div style="height: 730px">
  8. <div>
  9. <el-form :inline="true">
  10. <el-form-item label="编号:">
  11. <el-input
  12. v-model="condition.code"
  13. placeholder="请输入布防点编号"
  14. />
  15. </el-form-item>
  16. <el-form-item label="日期:">
  17. <el-date-picker
  18. v-model="condition.date"
  19. type="date"
  20. placeholder="请选择日期"
  21. />
  22. </el-form-item>
  23. <el-form-item label="车牌号:">
  24. <el-input
  25. v-model="condition.licensePlate"
  26. placeholder="请输入车牌号"
  27. />
  28. </el-form-item>
  29. <el-form-item label="车牌类型:">
  30. <el-select
  31. v-model="typeLabel"
  32. placeholder="请选择车辆类型"
  33. @change="changeType"
  34. >
  35. <el-option
  36. v-for="item in typeList"
  37. :label="item.label"
  38. :value="item.label"
  39. />
  40. </el-select>
  41. </el-form-item>
  42. <el-form-item>
  43. <el-button
  44. type="primary"
  45. :icon="Search"
  46. >
  47. 查询
  48. </el-button>
  49. </el-form-item>
  50. <el-form-item>
  51. <el-button
  52. type="primary"
  53. :icon="Notebook"
  54. @click="chartShow = true"
  55. >
  56. 统计列表
  57. </el-button>
  58. </el-form-item>
  59. </el-form>
  60. </div>
  61. <div>
  62. <el-table
  63. :data="vehicleList"
  64. height="605px"
  65. >
  66. <el-table-column
  67. label="ID"
  68. prop="id"
  69. width="180"
  70. align="center"
  71. />
  72. <el-table-column
  73. label="布防点编号"
  74. prop="deploy"
  75. width="240"
  76. align="center"
  77. />
  78. <el-table-column
  79. label="日期"
  80. prop="date"
  81. width="240"
  82. align="center"
  83. />
  84. <el-table-column
  85. label="车牌号"
  86. prop="licensePlate"
  87. width="180"
  88. align="center"
  89. />
  90. <el-table-column
  91. label="车辆类型"
  92. prop="vehicleType"
  93. width="180"
  94. align="center"
  95. />
  96. <el-table-column
  97. label="操作"
  98. width="300"
  99. align="center"
  100. >
  101. <template #default="scope">
  102. <el-button
  103. text
  104. type="primary"
  105. :icon="Monitor"
  106. @click="openPreview(scope.row)"
  107. >
  108. 预览
  109. </el-button>
  110. </template>
  111. </el-table-column>
  112. </el-table>
  113. </div>
  114. <div style="width: 1400px; display: flex; justify-content: end">
  115. <el-pagination
  116. :page-size="10"
  117. background
  118. layout="prev, pager, next"
  119. :total="fileTotal"
  120. @change="changePage"
  121. />
  122. </div>
  123. </div>
  124. </el-card>
  125. <el-dialog
  126. v-model="chartShow"
  127. style="width: 1300px"
  128. >
  129. <Chart />
  130. </el-dialog>
  131. <el-dialog v-model="imageShow" title="抓拍预览">
  132. <div style="height: 20px">
  133. </div>
  134. <el-image
  135. :src="filePath"
  136. alt="Preview"
  137. />
  138. </el-dialog>
  139. </div>
  140. </template>
  141. <script setup>
  142. import { Search, Monitor, Notebook } from '@element-plus/icons-vue'
  143. import { reactive, ref, onMounted } from 'vue'
  144. import Chart from '@/view/vehicle/component/chart.vue'
  145. import { getSnapshotList } from '@/api/vehicle'
  146. import image1 from '@/assets/preview/绿湘AA29059.jpg'
  147. import image2 from '@/assets/preview/绿湘FF18509.jpg'
  148. import image3 from '@/assets/preview/绿湘FFA6608.jpg'
  149. import image4 from '@/assets/preview/蓝湘F7UV77.jpg'
  150. import image5 from '@/assets/preview/蓝湘F92UPI.jpg'
  151. import image6 from '@/assets/preview/蓝湘FFV575.jpg'
  152. import image7 from '@/assets/preview/蓝湘FLQ698.jpg'
  153. const chartShow = ref(false)
  154. const vehicleList = reactive([
  155. {
  156. id: 0,
  157. deploy: 662156166622,
  158. date: '2025-11-26',
  159. licensePlate: '绿湘FFA6608',
  160. vehicleType: '机动车'
  161. },
  162. {
  163. id: 1,
  164. deploy: 662156166623,
  165. date: '2025-11-26',
  166. licensePlate: '蓝湘FFV575',
  167. vehicleType: '机动车'
  168. },
  169. {
  170. id: 2,
  171. deploy: 662156166622,
  172. date: '2025-11-26',
  173. licensePlate: '蓝湘F92UPI',
  174. vehicleType: '机动车'
  175. },
  176. {
  177. id: 3,
  178. deploy: 662156166622,
  179. date: '2025-11-26',
  180. licensePlate: '蓝湘F7UV77',
  181. vehicleType: '机动车'
  182. },
  183. {
  184. id: 4,
  185. deploy: 662156166622,
  186. date: '2025-11-26',
  187. licensePlate: '蓝湘FLQ698',
  188. vehicleType: '机动车'
  189. },
  190. {
  191. id: 5,
  192. deploy: 662156166622,
  193. date: '2025-11-26',
  194. licensePlate: '绿湘FF18509',
  195. vehicleType: '机动车'
  196. },
  197. {
  198. id: 6,
  199. deploy: 662156166622,
  200. date: '2025-11-26',
  201. licensePlate: '绿湘AA29059',
  202. vehicleType: '小轿车'
  203. }
  204. ])
  205. const fileTotal = ref(10)
  206. const filePath = ref('')
  207. const condition = reactive({
  208. code: '',
  209. date: '',
  210. licensePlate: '',
  211. vehicleType: ''
  212. })
  213. const imageShow = ref(false)
  214. const imageList = [
  215. { label: '绿湘AA29059', value: image1 },
  216. { label: '绿湘FF18509', value: image2 },
  217. { label: '绿湘FFA6608', value: image3 },
  218. { label: '蓝湘F7UV77', value: image4 },
  219. { label: '蓝湘F92UPI', value: image5 },
  220. { label: '蓝湘FFV575', value: image6 },
  221. { label: '蓝湘FLQ698', value: image7 }
  222. ]
  223. const openPreview = (val) => {
  224. console.log(val.licensePlate)
  225. imageShow.value = true
  226. imageList.forEach(item => {
  227. if (item.label === val.licensePlate) {
  228. filePath.value = item.value
  229. }
  230. })
  231. }
  232. const changePage = (page) => {
  233. console.log(page)
  234. }
  235. const typeList = reactive([
  236. { id: 0, label: '客车' },
  237. { id: 1, label: '货车' },
  238. { id: 2, label: '轿车' },
  239. { id: 3, label: '工程车' },
  240. { id: 4, label: '卡车' },
  241. { id: 5, label: '拖车' }
  242. ])
  243. const typeLabel = ref('')
  244. const changeType = (e) => {
  245. typeList.forEach(item => {
  246. if (item.label === e) {
  247. condition.vehicleType = item.id
  248. }
  249. })
  250. }
  251. onMounted(() => {
  252. const data = {
  253. page: 1,
  254. pageSize: 10
  255. }
  256. getSnapshotList(data).then(res => {
  257. if (res.code === 0) {
  258. console.log(res.data)
  259. }
  260. })
  261. })
  262. </script>
  263. <style scoped lang="scss">
  264. </style>