CehicleOperation.vue 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505
  1. <template>
  2. <Layout>
  3. <template #left>
  4. <div class="left">
  5. <Box
  6. :width="560"
  7. :height="1224"
  8. :name="'线路基本情况'"
  9. class="left-left"
  10. >
  11. <div class="linebase">
  12. <div class="car">
  13. <div class="top">
  14. <Icon
  15. name="1-1"
  16. :size="80"
  17. style="margin-right: 20px;"
  18. />
  19. <div class="name bold">
  20. 1
  21. </div>
  22. <div class="road">
  23. </div>
  24. </div>
  25. <div class="current">
  26. 当前线路
  27. </div>
  28. </div>
  29. <div class="info">
  30. <div>
  31. <div class="label">
  32. 线路类型:
  33. </div> <div class="val">
  34. {{ typeMap[busLineData?.type??0] }}
  35. </div>
  36. </div>
  37. <div>
  38. <div class="label">
  39. 车辆总数:
  40. </div> <div class="val">
  41. {{ busLineData?.totalCar }}辆
  42. </div>
  43. </div>
  44. <div>
  45. <div class="label">
  46. 运 营 中:
  47. </div> <div class="val">
  48. {{ busLineData?.operateNum }}辆
  49. </div>
  50. </div>
  51. <div>
  52. <div class="label">
  53. 非 运 营:
  54. </div> <div class="val">
  55. {{ busLineData?.nonOperateNum }}辆
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. <div class="header">
  61. <div>
  62. <Icon
  63. name="1-2"
  64. :size="30"
  65. />
  66. 起讫点
  67. </div>
  68. <div>
  69. <Icon
  70. name="1-3"
  71. :size="30"
  72. />
  73. 运营时间
  74. </div>
  75. </div>
  76. <div class="detail">
  77. <div>
  78. <div class="row">
  79. <div class="type orange">
  80. 上行
  81. </div>
  82. <div class="name">
  83. {{ busLineData?.upStartStation }} → {{ busLineData?.upEndStation }}
  84. </div>
  85. <div class="value">
  86. {{ busLineData?.upStartTime }}~{{ busLineData?.upEndTime }}
  87. </div>
  88. </div>
  89. <div class="row">
  90. <div class="type">
  91. 下行
  92. </div>
  93. <div class="name">
  94. {{ busLineData?.downStartStation }} → {{ busLineData?.downEndStation }}
  95. </div>
  96. <div class="value">
  97. {{ busLineData?.downStartTime }}~{{ busLineData?.downEndTime }}
  98. </div>
  99. </div>
  100. </div>
  101. <div>
  102. <div class="row">
  103. <div class="type orange">
  104. </div>
  105. <div class="name">
  106. 线路上行里程
  107. </div>
  108. <div class="value">
  109. {{ busLineData?.upMileage }}km
  110. </div>
  111. </div>
  112. <div class="row">
  113. <div class="type">
  114. </div>
  115. <div class="name">
  116. 线路下行里程
  117. </div>
  118. <div class="value">
  119. {{ busLineData?.downMileage }}km
  120. </div>
  121. </div>
  122. <div class="row">
  123. <Icon
  124. name="1-4"
  125. :size="38"
  126. />
  127. <div class="name">
  128. 票价
  129. </div>
  130. <div class="value">
  131. {{ busLineData?.fare }}元
  132. </div>
  133. </div>
  134. </div>
  135. <div>
  136. <div class="title">
  137. <div class="flex">
  138. <Icon
  139. name="1-5"
  140. :size="30"
  141. />
  142. <div class="name">
  143. 驾驶员数量
  144. </div>
  145. </div>
  146. <div class="value">
  147. <div
  148. class="bold"
  149. style="font-size: 40px"
  150. >
  151. {{ driverTotal }}
  152. </div>
  153. <div class="">
  154. </div>
  155. </div>
  156. </div>
  157. <div class="starlist">
  158. <div
  159. v-for="item in starlist"
  160. :key="item.label"
  161. class="star"
  162. >
  163. <div>{{ item.label }}</div>
  164. <div class="flex">
  165. <span class="num bold">{{ item.value }}</span>人
  166. </div>
  167. </div>
  168. </div>
  169. </div>
  170. <div style="border: 0;">
  171. <div class="title">
  172. <div class="flex">
  173. <Icon
  174. name="1-1"
  175. :size="30"
  176. />
  177. <div class="name">
  178. 车辆数占比
  179. </div>
  180. </div>
  181. <div class="value">
  182. <div
  183. class="bold"
  184. style="font-size: 40px"
  185. >
  186. {{ carTotal }}
  187. </div>
  188. </div>
  189. </div>
  190. <Echart
  191. style="width: 560px;height:318px"
  192. :option="leftContent.leftOp"
  193. />
  194. </div>
  195. </div>
  196. </Box>
  197. <Box
  198. :width="560"
  199. :height="1224"
  200. :name="'线路发班情况'"
  201. class="left-right"
  202. >
  203. <div class="filter">
  204. <div class="name bold">
  205. 筛选
  206. </div>
  207. <div class="odds">
  208. <div
  209. v-for="item in odds"
  210. :key="item.label"
  211. class="odd"
  212. >
  213. {{ item.label }} {{ item.value }}
  214. </div>
  215. </div>
  216. </div>
  217. <div class="frequency">
  218. <div class="title bold">
  219. 上行
  220. </div>
  221. <div class="content">
  222. <div
  223. v-for="item in upData"
  224. :key="item.id"
  225. class="bus"
  226. >
  227. <img
  228. src="../../../../assets/img/1-1.png"
  229. alt="bus"
  230. >
  231. <div
  232. :class="item.type"
  233. class="status"
  234. >
  235. {{ findlabel(odds,item.type) }}
  236. </div>
  237. <div class="info">
  238. <div>
  239. <div class="bold">
  240. 1路
  241. </div>
  242. <div class="busNum">
  243. {{ item.licensePlate }}
  244. </div>
  245. </div>
  246. <div>司机:{{ item.driver }} </div>
  247. <div>电量:{{ item.electricity }} </div>
  248. </div>
  249. <div class="table">
  250. <div>
  251. <div class="label">
  252. 调度时间
  253. </div>
  254. <div class="value">
  255. {{ item.dispatchTime }}
  256. </div>
  257. </div>
  258. <div>
  259. <div class="label">
  260. 实际发车时间
  261. </div>
  262. <div class="value">
  263. {{ item.realityTime }}
  264. </div>
  265. </div>
  266. <div>
  267. <div class="label">
  268. 发车间隔
  269. </div>
  270. <div class="value">
  271. {{ item.intervalTime }}分钟
  272. </div>
  273. </div>
  274. </div>
  275. </div>
  276. </div>
  277. <div class="page">
  278. <n-pagination
  279. v-model:page="upOption.page"
  280. :page-size="upOption.pageSize"
  281. :item-count="upBusLineOperate.length"
  282. >
  283. <template #prefix="{ itemCount }">
  284. 总共 {{ itemCount }} 个项目
  285. </template>
  286. </n-pagination>
  287. </div>
  288. </div>
  289. <div class="frequency">
  290. <div class="title bold">
  291. 下行
  292. </div>
  293. <div class="content">
  294. <div
  295. v-for="item in downData"
  296. :key="item.id"
  297. class="bus"
  298. >
  299. <img
  300. src="../../../../assets/img/1-1.png"
  301. alt="bus"
  302. >
  303. <div
  304. :class="item"
  305. class="status"
  306. >
  307. {{ findlabel(odds,item.type) }}
  308. </div>
  309. <div class="info">
  310. <div>
  311. <div class="bold">
  312. 1路
  313. </div>
  314. <div class="busNum">
  315. {{ item.licensePlate }}
  316. </div>
  317. </div>
  318. <div>司机:{{ item.driver }} </div>
  319. <div>电量:{{ item.electricity }} </div>
  320. </div>
  321. <div class="table">
  322. <div>
  323. <div class="label">
  324. 调度时间
  325. </div>
  326. <div class="value">
  327. {{ item.dispatchTime }}
  328. </div>
  329. </div>
  330. <div>
  331. <div class="label">
  332. 实际发车时间
  333. </div>
  334. <div class="value">
  335. {{ item.realityTime }}
  336. </div>
  337. </div>
  338. <div>
  339. <div class="label">
  340. 发车间隔
  341. </div>
  342. <div class="value">
  343. {{ item.intervalTime }}分钟
  344. </div>
  345. </div>
  346. </div>
  347. </div>
  348. </div>
  349. <div class="page">
  350. <n-pagination :item-count="downBusLineOperate.length">
  351. <template #prefix="{ itemCount }">
  352. 总共 {{ itemCount }} 个项目
  353. </template>
  354. </n-pagination>
  355. </div>
  356. </div>
  357. </Box>
  358. </div>
  359. </template>
  360. <template #right>
  361. <div class="right">
  362. <div class="right-top">
  363. <Box
  364. v-for="(item, index) in rightContent?.top"
  365. :key="index"
  366. :width="438"
  367. :height="570"
  368. :name="item.name"
  369. >
  370. <Echart :option="item.option" />
  371. </Box>
  372. </div>
  373. <div class="right-bottom">
  374. <Box
  375. :width="663"
  376. :height="570"
  377. :name="'车辆监控'"
  378. >
  379. <div class="carmonitor">
  380. <div class="control">
  381. <div class="item">
  382. <div class="label">
  383. 状态:
  384. </div>
  385. <n-select
  386. v-model:value="statusVal"
  387. :on-update:value="statusChange"
  388. :bordered="false"
  389. size="large"
  390. :options=" [
  391. { label: '全部', value: '' },
  392. { label: '运营中', value: 1 },
  393. { label: '非运营', value: 2 }
  394. ]"
  395. />
  396. </div>
  397. <div class="item">
  398. <div class="label">
  399. 情景:
  400. </div>
  401. <n-select
  402. v-model:value="sceneVal"
  403. :bordered="false"
  404. size="large"
  405. :on-update:value="sceneChange"
  406. :options=" [
  407. { label: '全部', value: '' },
  408. { label: '行驶中', value: 1 },
  409. { label: '维保', value: 2 },
  410. { label: '固定包车', value: 3 },
  411. { label: '临时包车', value: 4 },
  412. { label: '充电', value: 5 },
  413. { label: '公务', value: 6 },
  414. ]"
  415. />
  416. </div>
  417. </div>
  418. <n-table
  419. striped
  420. size="large"
  421. :bordered="false"
  422. single-column
  423. :bottom-bordered="false"
  424. class="table"
  425. >
  426. <thead>
  427. <tr>
  428. <th> 状态 </th>
  429. <th> 车牌号 </th>
  430. <th> 驾驶员 </th>
  431. <th> 拥挤度 </th>
  432. <th> 情景 </th>
  433. </tr>
  434. </thead>
  435. <tbody>
  436. <tr
  437. v-for="item,index in vehicleMonitorData"
  438. :key="item"
  439. :class="{ no: index === 0 }"
  440. >
  441. <td>
  442. <div class="index" /> {{ findlabel(vehicleStatus,item.carStatus) }}
  443. </td>
  444. <td> {{ item?.licensePlate }} </td>
  445. <td> {{ item?.driver }}</td>
  446. <td> {{ item.congestion }} </td>
  447. <td>{{ findlabel(passengerOption,item.carScene) }} </td>
  448. </tr>
  449. </tbody>
  450. </n-table>
  451. </div>
  452. </Box>
  453. <Box
  454. :width="663"
  455. :height="570"
  456. :name="'车辆状态'"
  457. >
  458. <div class="carstatus">
  459. <div
  460. v-for="item,index in vehicleStatusData"
  461. :key="index+1000"
  462. :class="item.direction===1 ? 'up' :'down'"
  463. >
  464. <div class="title">
  465. {{ item.direction===1?'上行' :'下行' }}
  466. </div>
  467. <div class="content">
  468. <template v-for="value,key in item">
  469. <div
  470. v-if="!['id','direction'].includes(key+'')"
  471. :key="key"
  472. >
  473. <div class="label">
  474. {{ carstatusMap[key] }}
  475. </div>
  476. <div class="value">
  477. {{ value }}
  478. </div>
  479. </div>
  480. </template>
  481. </div>
  482. </div>
  483. <div class="line" />
  484. </div>
  485. </Box>
  486. </div>
  487. </div>
  488. </template>
  489. </Layout>
  490. </template>
  491. <script setup lang='ts'>
  492. import Layout from '@/components/layout.vue'
  493. import Box from '@/components/box.vue'
  494. import Echart from '@/components/chart.vue'
  495. import { computed, ref } from 'vue'
  496. import { graphic } from 'echarts'
  497. import CehicleOperationService from '../services/cehicleOperation.service'
  498. const cehicleOperationService = new CehicleOperationService()
  499. const typeMap :any = {
  500. 0: '干线公交',
  501. 1: '主线公交'
  502. }
  503. /* 线路类型:干线公交 车辆总数: 运 营 中:9 辆 非 运 营:1 辆 */
  504. const starlist:any = ref([
  505. { label: '五星', value: '1' },
  506. { label: '四星', value: '2' },
  507. { label: '三星', value: '3' },
  508. { label: '二星', value: '4' },
  509. { label: '一星', value: '5' }
  510. ])
  511. const odds = ref([
  512. { label: '全部', value: '' },
  513. { label: '已完成', value: 1 },
  514. { label: '执行中', value: 2 },
  515. { label: '已处理', value: 3 },
  516. { label: '已下发', value: 4 },
  517. { label: '待发', value: 5 },
  518. { label: '调停', value: 6 },
  519. { label: '非运营', value: 7 }
  520. ])
  521. function findlabel(arr: any[], val: any) {
  522. return arr.find((item: { value: any }) => item.value === val)?.label
  523. }
  524. // 1已完成2执行中3已处理4已下发5待发6调停7非运营
  525. const status = [ 'success', 'warning', 'error' ]
  526. const upBusLineOperate = ref([] as any[])
  527. const upOption = ref({
  528. pageSize: 3,
  529. page: 1
  530. })
  531. const upData = computed(() => upBusLineOperate.value.slice((upOption.value.page - 1) * upOption.value.pageSize, upOption.value.page * upOption.value.pageSize))
  532. const downBusLineOperate = ref([] as any[])
  533. const downOption = ref({
  534. pageSize: 3,
  535. page: 1
  536. })
  537. const downData = computed(() => downBusLineOperate.value.slice((downOption.value.page - 1) * downOption.value.pageSize, downOption.value.page * downOption.value.pageSize))
  538. const carstatusMap:any = {
  539. avgSpacing: '平均间距',
  540. minSpacing: '最小间距',
  541. averageTime: '平峰平均时间',
  542. singleAvgTime: '单程平均时间',
  543. maxSpacing: '最大间距',
  544. peakAvgTime: '高峰平均时间',
  545. maxSpeed: '最大车速',
  546. minSpeed: '最小车速',
  547. avgSpeed: '平均车速'
  548. }
  549. const leftContent = ref({
  550. leftOp: {
  551. grid: {
  552. containLabel: true
  553. },
  554. // 图表图例
  555. legend: {
  556. show: true,
  557. type: 'scroll',
  558. orient: 'horizontal', // 图例排列方向
  559. icon: 'circle', // 图例样式为圆形
  560. itemWidth: 10, // 图例图形的宽度
  561. itemHeight: 16, // 图例图形的高度
  562. itemGap: 10, // 图例项之间的间隔
  563. left: 'center', // 图例距离容器右侧的距离
  564. bottom: 0, // 图例垂直居中
  565. textStyle: {
  566. color: 'white', // 图例文字颜色
  567. fontSize: 16
  568. }
  569. },
  570. // color: [ '#6386e0', '#fb9a55', '#6bd98d', '#8dfd15', '#6bd98d', '#fff' ],
  571. series: [
  572. {
  573. type: 'pie', // 图表类型为饼图
  574. radius: '60%', // 控制内外圆环的半径,30%代表内圆,60%代表外圆
  575. avoidLabelOverlap: true, // 是否启用防止标签重叠策略
  576. showEmptyCircle: true, // 是否在无数据的时候显示一个占位圆
  577. label: {
  578. show: true,
  579. fontSize: 16,
  580. formatter: '{b}: {c}条',
  581. color: 'white'
  582. },
  583. data: [
  584. { name: '2023', value: 0 },
  585. { name: '2022', value: 0 },
  586. { name: '2021', value: 0 },
  587. { name: '2020', value: 0 },
  588. { name: '2019', value: 0 }
  589. ]
  590. }
  591. ]
  592. }
  593. })
  594. const rightContent = ref({
  595. top: [
  596. {
  597. name: '乘客类型',
  598. option: {
  599. title: {
  600. text: '总', // 图标内容文本
  601. subtext: '196000',
  602. left: 'center', // 图标内容水平居中
  603. top: 'center', // 图标内容垂直居中
  604. // 文本样式
  605. textStyle: {
  606. color: '#fff', // 图标内容文字颜色
  607. fontSize: '16px', // 图标内容文字大小
  608. fontWeight: 'normal'
  609. },
  610. subtextStyle: {
  611. color: '#fff', // 图标内容文字颜色
  612. fontSize: '20px', // 图标内容文字大小
  613. fontWeight: 'normal'
  614. }
  615. },
  616. grid: {
  617. containLabel: true
  618. },
  619. // 图表图例
  620. legend: {
  621. show: true,
  622. type: 'scroll',
  623. orient: 'horizontal', // 图例排列方向
  624. icon: 'circle', // 图例样式为圆形
  625. itemWidth: 10, // 图例图形的宽度
  626. itemHeight: 16, // 图例图形的高度
  627. itemGap: 40, // 图例项之间的间隔
  628. left: 'center', // 图例距离容器右侧的距离
  629. bottom: 0, // 图例垂直居中
  630. textStyle: {
  631. color: 'white', // 图例文字颜色
  632. fontSize: 20
  633. }
  634. },
  635. // color: [ '#6386e0', '#fb9a55', '#6bd98d', '#8dfd15', '#6bd98d', '#fff' ],
  636. series: [
  637. {
  638. type: 'pie', // 图表类型为饼图
  639. radius: [ '55%', '75%' ], // 控制内外圆环的半径,30%代表内圆,60%代表外圆
  640. avoidLabelOverlap: true, // 是否启用防止标签重叠策略
  641. showEmptyCircle: true, // 是否在无数据的时候显示一个占位圆
  642. label: {
  643. show: true,
  644. formatter: '{d}%',
  645. color: 'white'
  646. },
  647. data: [
  648. { key: 2, name: '老年卡', value: 180 },
  649. { key: 2, name: '电子钱包', value: 50 },
  650. { key: 2, name: '现金', value: 30 },
  651. { key: 2, name: '学生卡', value: 20 },
  652. { key: 2, name: '成人次卡', value: 10 },
  653. { key: 2, name: '其他', value: 10 },
  654. { key: 2, name: '免费人次', value: 10 }
  655. ]
  656. }
  657. ]
  658. }
  659. },
  660. {
  661. name: '客流情况',
  662. option: {
  663. grid: {
  664. containLabel: true,
  665. right: 30,
  666. left: 50
  667. },
  668. legend: {
  669. show: true,
  670. left: 'center',
  671. top: '10',
  672. icon: 'stack',
  673. itemWidth: 15,
  674. itemHeight: 10,
  675. textStyle: {
  676. color: '#646464',
  677. fontSize: 18
  678. }
  679. },
  680. xAxis: [ {
  681. type: 'category',
  682. axisLine: {
  683. show: false
  684. },
  685. axisLabel: {
  686. color: '#fff',
  687. fontSize: 18
  688. // formatter: (value: number) => format( 1'时')
  689. },
  690. splitLine: {
  691. show: false
  692. },
  693. axisTick: {
  694. show: false
  695. },
  696. data: [ '1时', '2时', '3时', '4时', '5时', '6时', '7时', '8时', '9时', '10时', '11时', '12时' ]
  697. } ],
  698. yAxis: [ {
  699. name: '客流量/人次',
  700. nameLocation: 'center',
  701. nameGap: 50,
  702. nameTextStyle: {
  703. color: '#fff',
  704. fontSize: 18
  705. },
  706. padding: 5,
  707. // max: 1000,
  708. splitLine: {
  709. show: true,
  710. lineStyle: {
  711. color: '#A1A7B3'
  712. // type: 'dashed'
  713. }
  714. },
  715. axisLine: {
  716. show: false
  717. },
  718. axisLabel: {
  719. show: true,
  720. margin: 10,
  721. textStyle: {
  722. color: '#fff'
  723. }
  724. },
  725. axisTick: {
  726. show: false
  727. }
  728. }
  729. ],
  730. series: [ {
  731. name: '客流量',
  732. type: 'line',
  733. smooth: true,
  734. symbolSize: 0,
  735. itemStyle: {
  736. normal: {
  737. // color: '#FFD35D',
  738. lineStyle: {
  739. color: new graphic.LinearGradient(0, 0, 0, 1, [
  740. {
  741. offset: 0,
  742. color: '#FFD35D66'
  743. },
  744. {
  745. offset: 0.5,
  746. color: '#7ec2f366'
  747. },
  748. {
  749. offset: 1,
  750. color: '#1890ff'
  751. }
  752. ], false),
  753. width: 1
  754. }
  755. }
  756. },
  757. areaStyle: {
  758. normal: {
  759. color: new graphic.LinearGradient(0, 0, 0, 1, [
  760. {
  761. offset: 0,
  762. color: '#FFD35D66'
  763. },
  764. {
  765. offset: 0.5,
  766. color: '#7ec2f366'
  767. },
  768. {
  769. offset: 1,
  770. color: '#1890ff'
  771. }
  772. ], false)
  773. }
  774. },
  775. data: [ 120, 132, 101, 134, 90, 230, 210, 182, 191, 234, 290, 330 ]
  776. } ],
  777. dataZoom: {}
  778. }
  779. },
  780. {
  781. name: '里程情况',
  782. option: {
  783. grid: {
  784. containLabel: true,
  785. right: 30,
  786. left: 50
  787. },
  788. legend: {
  789. show: true,
  790. left: 'center',
  791. top: '10',
  792. icon: 'stack',
  793. itemWidth: 15,
  794. itemHeight: 10,
  795. textStyle: {
  796. color: '#646464',
  797. fontSize: 18
  798. }
  799. },
  800. xAxis: [ {
  801. type: 'category',
  802. axisLine: {
  803. show: false
  804. },
  805. axisLabel: {
  806. color: '#fff',
  807. fontSize: 18
  808. // formatter: (value: number) => format( 1'时')
  809. },
  810. splitLine: {
  811. show: false
  812. },
  813. axisTick: {
  814. show: false
  815. },
  816. data: [ '1时', '2时', '3时', '4时', '5时', '6时', '7时', '8时', '9时', '10时', '11时', '12时' ]
  817. } ],
  818. yAxis: [ {
  819. name: '里程/km',
  820. nameLocation: 'center',
  821. nameGap: 50,
  822. nameTextStyle: {
  823. color: '#fff',
  824. fontSize: 18
  825. },
  826. padding: 5,
  827. // max: 1000,
  828. splitLine: {
  829. show: true,
  830. lineStyle: {
  831. color: '#A1A7B3'
  832. // type: 'dashed'
  833. }
  834. },
  835. axisLine: {
  836. show: false
  837. },
  838. axisLabel: {
  839. show: true,
  840. margin: 10,
  841. textStyle: {
  842. color: '#fff'
  843. }
  844. },
  845. axisTick: {
  846. show: false
  847. }
  848. }
  849. ],
  850. series: [ {
  851. name: '里程',
  852. type: 'line',
  853. smooth: true,
  854. symbolSize: 0,
  855. itemStyle: {
  856. normal: {
  857. // color: '#4293FD',
  858. lineStyle: {
  859. // color: '#FFD35D',
  860. width: 1,
  861. color: new graphic.LinearGradient(0, 0, 0, 1, [
  862. {
  863. offset: 0,
  864. color: '#6A5BF066'
  865. },
  866. {
  867. offset: 0.5,
  868. color: '#7ec2f366'
  869. },
  870. {
  871. offset: 1,
  872. color: '#1890ff'
  873. }
  874. ], false)
  875. }
  876. }
  877. },
  878. areaStyle: {
  879. normal: {
  880. color: new graphic.LinearGradient(0, 0, 0, 1, [
  881. {
  882. offset: 0,
  883. color: '#6A5BF066'
  884. },
  885. {
  886. offset: 0.5,
  887. color: '#7ec2f366'
  888. },
  889. {
  890. offset: 1,
  891. color: '#1890ff'
  892. }
  893. ], false)
  894. }
  895. },
  896. data: [ 120, 132, 101, 134, 90, 230, 210, 182, 191, 234, 290, 330 ]
  897. } ],
  898. dataZoom: {}
  899. }
  900. }
  901. ],
  902. bottom: {
  903. }
  904. })
  905. const lineID = '2168405945795840107'
  906. const busLineData = ref({
  907. type: '0', // 线路类型
  908. totalCar: 0, // 车辆总数
  909. operateNum: 0, // 运营数量
  910. nonOperateNum: 0, // 非运营数量
  911. upStartStation: '', // 上行起点站
  912. downStartStation: '', // 下行起点站
  913. upEndStation: '', // 上行终点站
  914. downEndStation: '', // 下行结束时间
  915. upStartTime: '00:00', // 上行开始时间
  916. upEndTime: '00:00', // 上行结束时间
  917. downStartTime: '00:00', // 下行开始始时间
  918. downEndTime: '00:00', // 下行结束时间
  919. upMileage: 0, // 上行里程
  920. downMileage: 0, // 下行里程
  921. fare: 0 // 票价
  922. })
  923. const driverTotal = ref(0)
  924. const carTotal = ref(0)
  925. async function getBusLineDetail() {
  926. busLineData.value = await cehicleOperationService.getBusLineDetail(lineID)
  927. }
  928. getBusLineDetail()
  929. async function getBusLineDriver() {
  930. const driverArr = await cehicleOperationService.getBusLineDriver(lineID)
  931. let total = 0
  932. driverArr.forEach((item: { total: string | number; starType: number }) => {
  933. total += +item.total
  934. starlist.value.at(-item.starType).value = +item.total
  935. })
  936. driverTotal.value = total
  937. }
  938. getBusLineDriver()
  939. async function getBusLineCar() {
  940. const carArr = await cehicleOperationService.getBusLineCar(lineID)
  941. let total = 0
  942. carArr.forEach((item: { total: string | number; starType: number }) => {
  943. total += +item.total
  944. })
  945. leftContent.value.leftOp.series[0].data = carArr.map((item:any) => ({
  946. name: item.year, value: item.total
  947. }))
  948. carTotal.value = total
  949. }
  950. getBusLineCar()
  951. async function getBusLineOperate() {
  952. const carArr = await cehicleOperationService.getBusLineOperate(lineID)
  953. upBusLineOperate.value = carArr.filter((item: { direction: number }) => item.direction === 1)
  954. downBusLineOperate.value = carArr.filter((item: { direction: number }) => item.direction === 2)
  955. console.log(carArr, 'carArr')
  956. }
  957. getBusLineOperate()
  958. const nameMap:any = {
  959. 1: '老年卡',
  960. 2: '学生卡',
  961. 3: '电子钱包',
  962. 4: '现金',
  963. 5: '其他'
  964. }
  965. async function getPassengerPercent() {
  966. const res = await cehicleOperationService.getPassengerPercent()
  967. rightContent.value.top[0].option.series[0].data = res.map((item:any) => ({
  968. name: nameMap[item.passengerType], value: item.percent
  969. }))
  970. rightContent.value.top[0].option.title!.subtext = res.reduce((prev: any, item: { percent: number }) => {
  971. prev += item.percent
  972. return prev
  973. }, 0)
  974. }
  975. getPassengerPercent()
  976. const passengerOption = [
  977. { value: 1, label: '行驶中' },
  978. { value: 2, label: '维保' },
  979. { value: 3, label: '固定包车' },
  980. { value: 4, label: '临时包车' },
  981. { value: 5, label: '充电' },
  982. { value: 6, label: '公务' }
  983. ]
  984. // 状态下拉框
  985. const vehicleStatus = [
  986. { value: 1, label: '运营' },
  987. { value: 2, label: '非运营' }
  988. ]
  989. const statusVal = ref('' as any)
  990. const sceneVal = ref('' as any)
  991. const vehicleMonitorData = ref([] as any[])
  992. function sceneChange(val: number) {
  993. sceneVal.value = val
  994. getVehicleMonitorService()
  995. }
  996. function statusChange(val: number) {
  997. statusVal.value = val
  998. getVehicleMonitorService()
  999. }
  1000. async function getVehicleMonitorService() {
  1001. const params = {
  1002. carStatus: statusVal.value,
  1003. carScene: sceneVal.value
  1004. }
  1005. vehicleMonitorData.value = await cehicleOperationService.getVehicleMonitorService(params)
  1006. }
  1007. getVehicleMonitorService()
  1008. const vehicleStatusData = ref([] as any[])
  1009. async function getVehicleStatusService() {
  1010. vehicleStatusData.value = await cehicleOperationService.getVehicleStatusService()
  1011. }
  1012. getVehicleStatusService()
  1013. </script>
  1014. <style lang="scss" scoped>
  1015. .left {
  1016. display: flex;
  1017. justify-content: space-between;
  1018. gap: 10px;
  1019. color: #fff;
  1020. font-size: 18px;
  1021. &-left {
  1022. .linebase {
  1023. height: 216px;
  1024. padding: 20px 60px 35px 60px;
  1025. display: flex;
  1026. align-items: center;
  1027. gap: 70px;
  1028. .car {
  1029. .top {
  1030. display: flex;
  1031. position: relative;
  1032. font-size: 18px;
  1033. .name {
  1034. width: 63px;
  1035. height: 74px;
  1036. line-height: 74px;
  1037. text-align: center;
  1038. border: 2px solid #2185E8;
  1039. font-size: 50px;
  1040. border-radius: 10px;
  1041. background: rgba(33, 133, 232, 0.298);
  1042. }
  1043. .road {
  1044. position: absolute;
  1045. bottom: 0;
  1046. right: -25px;
  1047. }
  1048. }
  1049. .current {
  1050. text-align: center;
  1051. text-shadow: 1px 1px 10px rgba(0, 255, 255, 0.698);
  1052. margin-top: 10px;
  1053. }
  1054. }
  1055. .info {
  1056. width: 100%;
  1057. >div {
  1058. display: flex;
  1059. gap: 10px;
  1060. margin: 15.2px 0;
  1061. .label {
  1062. color: #80FFFF
  1063. }
  1064. }
  1065. }
  1066. }
  1067. .header {
  1068. height: 50px;
  1069. background: rgba(33, 133, 232, 0.298);
  1070. display: flex;
  1071. >div {
  1072. width: 50%;
  1073. display: flex;
  1074. align-items: center;
  1075. justify-content: center;
  1076. gap: 10px;
  1077. }
  1078. }
  1079. .detail {
  1080. padding: 0 20px 0 30px;
  1081. >div {
  1082. border-bottom: 1px solid rgba(128, 255, 255, 0.298);
  1083. padding-bottom: 30px;
  1084. padding-top: 16px;
  1085. .value {
  1086. color: #80FFFF;
  1087. width: 200px;
  1088. text-align: center;
  1089. }
  1090. .row {
  1091. height: 50px;
  1092. display: flex;
  1093. align-items: center;
  1094. .type {
  1095. border: 1px solid #80FFFF;
  1096. background: rgba(128, 255, 255, 0.098);
  1097. border-radius: 5px;
  1098. color: #80FFFF;
  1099. padding: 5px 9px;
  1100. &.orange {
  1101. border: 1px solid #FAAD0E;
  1102. background: rgba(250, 173, 14, 0.098);
  1103. color: #FAAD0E;
  1104. }
  1105. }
  1106. .name {
  1107. flex: 1;
  1108. margin-left: 10px;
  1109. }
  1110. }
  1111. .title {
  1112. display: flex;
  1113. justify-content: space-between;
  1114. align-items: center;
  1115. .name {
  1116. font-size: 24px;
  1117. margin-left: 10px;
  1118. }
  1119. .value {
  1120. display: flex;
  1121. justify-content: center;
  1122. align-items: flex-end;
  1123. gap: 10px;
  1124. }
  1125. }
  1126. .starlist {
  1127. display: flex;
  1128. justify-content: space-around;
  1129. margin-top: 17px;
  1130. .star {
  1131. color: #80FFFF;
  1132. .num {
  1133. font-size: 24px;
  1134. }
  1135. }
  1136. }
  1137. }
  1138. }
  1139. }
  1140. &-right {
  1141. flex: 1;
  1142. font-size: 18px;
  1143. .filter {
  1144. display: flex;
  1145. align-items: center;
  1146. padding: 20px 40px;
  1147. .name {
  1148. width: 120px;
  1149. }
  1150. .odds {
  1151. display: flex;
  1152. gap: 10px;
  1153. flex-wrap: wrap;
  1154. .odd {
  1155. border-radius: 5px;
  1156. border: 1px solid #2185E8;
  1157. background: rgba(0, 191, 191, 0);
  1158. padding: 2px 8px;
  1159. min-width: 90px;
  1160. text-align: center;
  1161. &.checkd {
  1162. background: #2185E8;
  1163. }
  1164. }
  1165. }
  1166. }
  1167. .frequency {
  1168. margin-top: 15px;
  1169. .title {
  1170. background: rgba(24, 145, 255, 0.498);
  1171. height: 40px;
  1172. line-height: 40px;
  1173. font-size: 20px;
  1174. text-align: center;
  1175. text-shadow: 1px 1px 10px rgba(0, 255, 255, 0.698);
  1176. }
  1177. .content {
  1178. display: flex;
  1179. justify-content: flex-start;
  1180. gap: 10px;
  1181. padding: 10px 13px;
  1182. min-height: 421px;
  1183. .bus {
  1184. width: 236px;
  1185. height: 401px;
  1186. border: 1px solid #1891FF;
  1187. background: rgba(27, 175, 255, 0.098);
  1188. overflow: hidden;
  1189. position: relative;
  1190. .status {
  1191. position: absolute;
  1192. height: 31px;
  1193. line-height: 31px;
  1194. text-align: right;
  1195. width: 100%;
  1196. top: 119px;
  1197. padding-right: 10px;
  1198. background: linear-gradient(90deg, rgba(0, 0, 0, 0) 1%, #333333 100%);
  1199. &.success {
  1200. background: linear-gradient(90deg, rgba(0, 238, 200, 0) 4%, #00EEC8 100%);
  1201. }
  1202. &.warning {
  1203. background: linear-gradient(90deg, rgba(250, 173, 14, 0) 1%, #FAAD0E 100%);
  1204. }
  1205. &.error {
  1206. background: linear-gradient(90deg, rgba(231, 61, 65, 0) 1%, #E73D41 100%);
  1207. }
  1208. }
  1209. img {
  1210. height: 150px;
  1211. width: 100%;
  1212. }
  1213. .info {
  1214. padding: 10px;
  1215. >div {
  1216. display: flex;
  1217. height: 35px;
  1218. align-items: center;
  1219. .bold {
  1220. font-size: 24px;
  1221. }
  1222. .busNum {
  1223. border: 2px solid #FFFFFF;
  1224. border-radius: 3px;
  1225. background: #1891FF;
  1226. padding: 2px 5px;
  1227. margin-left: 10px;
  1228. }
  1229. }
  1230. }
  1231. .table {
  1232. >div {
  1233. display: flex;
  1234. height: 40px;
  1235. align-items: center;
  1236. .label {
  1237. width: 135px;
  1238. height: 40px;
  1239. line-height: 40px;
  1240. background: rgba(33, 133, 232, 0.298);
  1241. color: #80FFFF;
  1242. text-align: right;
  1243. padding-right: 10px;
  1244. }
  1245. .value {
  1246. text-align: center;
  1247. flex: 1;
  1248. }
  1249. }
  1250. }
  1251. }
  1252. }
  1253. .page {
  1254. display: flex;
  1255. justify-content: flex-end;
  1256. margin-top: 25px;
  1257. }
  1258. }
  1259. }
  1260. .flex {
  1261. display: flex;
  1262. gap: 10px;
  1263. align-items: center;
  1264. }
  1265. .bold {
  1266. color: #fff;
  1267. font-weight: bold;
  1268. font-family: Impact Normal;
  1269. }
  1270. }
  1271. .right {
  1272. &-top {
  1273. color: #fff;
  1274. display: flex;
  1275. gap: 10px;
  1276. justify-content: space-between;
  1277. }
  1278. &-bottom {
  1279. color: #fff;
  1280. gap: 10px;
  1281. display: flex;
  1282. justify-content: space-between;
  1283. .carmonitor {
  1284. padding: 10px;
  1285. .control {
  1286. display: flex;
  1287. font-size: 20px;
  1288. gap: 20px;
  1289. :deep(.n-select){
  1290. .n-base-selection{
  1291. height: 40px;
  1292. }
  1293. }
  1294. .item {
  1295. display: flex;
  1296. width: 33%;
  1297. align-items: center;
  1298. gap: 20px;
  1299. .label {
  1300. min-width: 60px;
  1301. }
  1302. }
  1303. }
  1304. .table {
  1305. margin-top: 20px;
  1306. text-align: center;
  1307. th {
  1308. border: 0;
  1309. background: rgba(33, 133, 232, 0.6);
  1310. text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.6471);
  1311. font-weight: bold;
  1312. }
  1313. tr {
  1314. td {
  1315. color: #fff;
  1316. }
  1317. .index {
  1318. width: 14px;
  1319. height: 14px;
  1320. line-height: 14px;
  1321. background: #8DFF53;
  1322. border-radius: 50%;
  1323. display: inline-block;
  1324. color: #333333;
  1325. }
  1326. &.no {
  1327. td {
  1328. background: linear-gradient(180deg, #00A8F0 0%, #02B3B3 100%);
  1329. }
  1330. .index {
  1331. background: #D7D7D7;
  1332. }
  1333. }
  1334. }
  1335. }
  1336. }
  1337. .carstatus {
  1338. display: flex;
  1339. align-items: center;
  1340. justify-content: center;
  1341. position: relative;
  1342. .line{
  1343. position: absolute;
  1344. width: 1px;
  1345. height: 397px;
  1346. background-color: rgba(128, 255, 255, 0.298);
  1347. left: 50%;
  1348. top: 120px;
  1349. }
  1350. >div {
  1351. flex: 1;
  1352. display: flex;
  1353. flex-wrap: wrap;
  1354. justify-content: center;
  1355. >div{
  1356. width: 100%;
  1357. }
  1358. .title {
  1359. width: 136px;
  1360. height: 59px;
  1361. line-height: 59px;
  1362. border-radius: 5px;
  1363. text-align: center;
  1364. font-size: 24px;
  1365. text-shadow: 1px 1px 5px rgba(0, 255, 255, 0.6471);
  1366. margin: 30px 0 ;
  1367. }
  1368. }
  1369. .up .title {
  1370. background: rgba(27, 175, 255, 0.298);
  1371. border: 1px solid #81D3F8;
  1372. box-shadow: 5px 5px 5px 0px rgba(0, 0, 0, 0.349), inset 0px 0px 30px 1px rgba(24, 145, 255, 0.9961);
  1373. }
  1374. .down .title {
  1375. background: rgba(231, 61, 65, 0.298);
  1376. border: 1px solid #F9A15A;
  1377. box-shadow: 5px 5px 5px 0px rgba(0, 0, 0, 0.349), inset 0px 0px 30px 1px rgba(231, 61, 65, 0.9882);
  1378. }
  1379. .content{
  1380. display: flex;
  1381. flex-wrap: wrap;
  1382. justify-content: center;
  1383. gap: 20px;
  1384. >div{
  1385. width: 100%;
  1386. display: flex;
  1387. justify-content: center;
  1388. align-items: center;
  1389. gap: 20px;
  1390. >div{
  1391. flex: 1;
  1392. }
  1393. .label{
  1394. font-size: 18px;
  1395. color: #81D3F8;
  1396. text-align: right;
  1397. text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.6471);
  1398. }
  1399. .value{
  1400. font-size: 24px;
  1401. text-shadow: 1px 1px 5px rgba(0, 255, 255, 0.6471);
  1402. }
  1403. }
  1404. }
  1405. }
  1406. }
  1407. }
  1408. </style>