PassengerFlow.vue 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433
  1. <template>
  2. <Layout>
  3. <template #left>
  4. <div class="left">
  5. <Box
  6. :width="1370"
  7. :height="406"
  8. :name="'区域流量'"
  9. class="left-top"
  10. >
  11. <Echart
  12. v-for="(item, index) in leftContent.tCharts"
  13. :key="index"
  14. :option="item.option"
  15. />
  16. </Box>
  17. <div class="left-bottom">
  18. <template
  19. v-for="(item, index) in leftContent.bCharts"
  20. :key="index"
  21. >
  22. <Box
  23. :width="438"
  24. :height="400"
  25. :name="item.name"
  26. >
  27. <Echart
  28. v-if="!item.isList"
  29. :option="item.option"
  30. />
  31. <div
  32. v-else
  33. class="lineList"
  34. >
  35. <div
  36. v-for="line, i in item.list"
  37. :key="i"
  38. class="line"
  39. >
  40. <div
  41. :class="'index' + i"
  42. class="index"
  43. >
  44. {{ i + 1 }}
  45. </div>
  46. <div class="name">
  47. {{ line.name }}
  48. </div>
  49. <div class="content">
  50. {{ line.startStation }} → {{ line.endStation }}
  51. </div>
  52. </div>
  53. </div>
  54. </Box>
  55. </template>
  56. </div>
  57. </div>
  58. </template>
  59. <template #right>
  60. <div class="right">
  61. <div class="right-top">
  62. <Box
  63. :width="460"
  64. :height="406"
  65. :name="'客运量排名'"
  66. >
  67. <Echart :option="rightContent.top1" />
  68. </Box>
  69. <Box
  70. :width="900"
  71. :height="406"
  72. :name="'运能分析'"
  73. >
  74. <Echart :option="rightContent.top2" />
  75. </Box>
  76. </div>
  77. <Box
  78. class="right-center"
  79. :width="1370"
  80. :height="406"
  81. :name="'今日客流'"
  82. >
  83. <Echart :option="rightContent.center" />
  84. </Box>
  85. <Box
  86. class="right-bottom"
  87. :width="1370"
  88. :height="406"
  89. :name="'本月客流'"
  90. >
  91. <Echart :option="rightContent.bottom" />
  92. </Box>
  93. </div>
  94. </template>
  95. </Layout>
  96. </template>
  97. <script setup lang='ts'>
  98. import Layout from '@/components/layout.vue'
  99. import Box from '@/components/box.vue'
  100. import Echart from '@/components/chart.vue'
  101. import { onUnmounted, ref } from 'vue'
  102. import { graphic } from 'echarts'
  103. import PassengerFlowService from '../services/passengerFlow.service'
  104. const leftContent = ref({
  105. tCharts: [
  106. {
  107. name: '客流线路分布',
  108. option: {
  109. title: {
  110. text: '客流总数/万人', // 图标内容文本
  111. subtext: '10',
  112. left: 'center', // 图标内容水平居中
  113. top: 'center', // 图标内容垂直居中
  114. // 文本样式
  115. textStyle: {
  116. color: '#fff', // 图标内容文字颜色
  117. fontSize: '18px', // 图标内容文字大小
  118. fontWeight: 'normal'
  119. },
  120. subtextStyle: {
  121. color: '#fff', // 图标内容文字颜色
  122. fontSize: '18px', // 图标内容文字大小
  123. fontWeight: 'normal'
  124. }
  125. },
  126. grid: {
  127. containLabel: true
  128. },
  129. tooltip: {
  130. show: true,
  131. formatter: '{b}: {c}万人 , 占比: {d}%'
  132. },
  133. // 图表图例
  134. legend: {
  135. show: true,
  136. type: 'scroll',
  137. orient: 'vertical', // 图例排列方向
  138. icon: 'circle', // 图例样式为圆形
  139. itemWidth: 10, // 图例图形的宽度
  140. itemHeight: 16, // 图例图形的高度
  141. itemGap: 10, // 图例项之间的间隔
  142. left: 10, // 图例距离容器右侧的距离
  143. top: 'center', // 图例垂直居中
  144. textStyle: {
  145. color: 'white', // 图例文字颜色
  146. fontSize: 16
  147. }
  148. },
  149. // color: [ '#6386e0', '#fb9a55', '#6bd98d', '#8dfd15', '#6bd98d', '#fff' ],
  150. series: [
  151. {
  152. type: 'pie', // 图表类型为饼图
  153. radius: [ '45%', '60%' ], // 控制内外圆环的半径,30%代表内圆,60%代表外圆
  154. avoidLabelOverlap: true, // 是否启用防止标签重叠策略
  155. showEmptyCircle: true, // 是否在无数据的日候显示一个占位圆
  156. label: {
  157. show: true,
  158. formatter: '{d}%',
  159. color: 'white'
  160. },
  161. data: [
  162. { name: '雨城区', value: 30619 },
  163. { name: '芦山县', value: 5921 },
  164. { name: '名山县', value: 1153 },
  165. { name: '天全县', value: 266 },
  166. { name: '宝兴县', value: 87 },
  167. { name: '汉源县', value: 999 },
  168. { name: '石棉县', value: 5921 }
  169. ]
  170. }
  171. ]
  172. }
  173. },
  174. {
  175. name: '客流线路分布',
  176. option: {
  177. grid: {
  178. containLabel: true
  179. },
  180. tooltip: {
  181. trigger: 'axis',
  182. formatter: '{b}<br /> {a0}:{c0}万人',
  183. axisPointer: {
  184. type: 'shadow'
  185. }
  186. },
  187. legend: {
  188. top: 10,
  189. right: '40%',
  190. itemWidth: 18,
  191. itemHeight: 18,
  192. itemGap: 30,
  193. textStyle: {
  194. fontSize: 18,
  195. color: '#C9D2FA'
  196. }
  197. },
  198. xAxis: {
  199. // name: "班级",
  200. triggerEvent: true,
  201. data: [
  202. '雨城区',
  203. '芦山县',
  204. '名山县',
  205. '天全县',
  206. '宝兴县',
  207. '汉源县'
  208. ],
  209. axisLabel: {
  210. interval: 0,
  211. show: true,
  212. fontSize: 18,
  213. color: '#C9D2FA'
  214. },
  215. axisLine: {
  216. show: false,
  217. lineStyle: {
  218. show: false,
  219. color: '#F3F3F3',
  220. width: 2
  221. }
  222. },
  223. axisTick: {
  224. show: false
  225. }
  226. },
  227. yAxis: [
  228. {
  229. name: '人数/万人',
  230. nameLocation: 'center',
  231. nameGap: 50,
  232. nameTextStyle: {
  233. color: '#fff',
  234. fontSize: 18
  235. },
  236. splitNumber: 2,
  237. axisLabel: {
  238. show: true,
  239. fontSize: 18,
  240. color: '#C9D2FA'
  241. },
  242. axisLine: {
  243. show: false
  244. },
  245. axisTick: {
  246. show: false
  247. },
  248. splitLine: {
  249. lineStyle: {
  250. type: 'dashed',
  251. color: '#3E4A82'
  252. }
  253. }
  254. }
  255. ],
  256. series: [
  257. {
  258. name: '客流量',
  259. type: 'bar',
  260. silent: true,
  261. itemStyle: {
  262. normal: {
  263. color: new graphic.LinearGradient(
  264. 0,
  265. 0,
  266. 0,
  267. 1,
  268. [ {
  269. offset: 0,
  270. color: '#00fdff'// 0% 处的颜色
  271. },
  272. {
  273. offset: 1,
  274. color: '#00aaff08' // 100% 处的颜色
  275. }
  276. ],
  277. false
  278. )
  279. }
  280. },
  281. barMaxWidth: 30,
  282. data: [ 200, 108, 200, 40, 210, 100 ]
  283. }
  284. ],
  285. dataZoom: {
  286. type: 'slider',
  287. height: 20,
  288. bottom: 8,
  289. handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
  290. handleSize: '140%',
  291. handleStyle: {
  292. color: '#fff'
  293. },
  294. moveHandleSize: 0,
  295. textStyle: {
  296. color: '#666'
  297. },
  298. fillerColor: 'rgba(24,38,73,.3)',
  299. borderColor: 'none'
  300. }
  301. }
  302. }
  303. ],
  304. bCharts: [
  305. {
  306. name: '客流线路分布',
  307. option: {
  308. grid: {
  309. containLabel: true
  310. },
  311. tooltip: {
  312. show: true,
  313. formatter: '{b}: {c}条 , 占比: {d}%'
  314. },
  315. // 图表图例
  316. legend: {
  317. show: true,
  318. type: 'scroll',
  319. orient: 'horizontal', // 图例排列方向
  320. icon: 'circle', // 图例样式为圆形
  321. itemWidth: 10, // 图例图形的宽度
  322. itemHeight: 16, // 图例图形的高度
  323. itemGap: 10, // 图例项之间的间隔
  324. left: 'center', // 图例距离容器右侧的距离
  325. bottom: 0, // 图例垂直居中
  326. textStyle: {
  327. color: 'white', // 图例文字颜色
  328. fontSize: 16
  329. }
  330. },
  331. // color: [ '#6386e0', '#fb9a55', '#6bd98d', '#8dfd15', '#6bd98d', '#fff' ],
  332. series: [
  333. {
  334. type: 'pie', // 图表类型为饼图
  335. radius: '60%', // 控制内外圆环的半径,30%代表内圆,60%代表外圆
  336. avoidLabelOverlap: true, // 是否启用防止标签重叠策略
  337. showEmptyCircle: true, // 是否在无数据的时候显示一个占位圆
  338. label: {
  339. show: true,
  340. formatter: '{b}: {c}条',
  341. color: 'white'
  342. },
  343. data: [
  344. { name: '常规', value: 130 },
  345. { name: '快线', value: 50 },
  346. { name: '特色线路', value: 50 }
  347. ]
  348. }
  349. ]
  350. }
  351. },
  352. {
  353. name: '消费类型',
  354. option: {
  355. title: {
  356. text: '客流总数/万人', // 图标内容文本
  357. subtext: '10',
  358. left: 'center', // 图标内容水平居中
  359. top: 'center', // 图标内容垂直居中
  360. // 文本样式
  361. textStyle: {
  362. color: '#fff', // 图标内容文字颜色
  363. fontSize: '18px', // 图标内容文字大小
  364. fontWeight: 'normal'
  365. },
  366. subtextStyle: {
  367. color: '#fff', // 图标内容文字颜色
  368. fontSize: '18px', // 图标内容文字大小
  369. fontWeight: 'normal'
  370. }
  371. },
  372. grid: {
  373. containLabel: true
  374. },
  375. tooltip: {
  376. show: true,
  377. formatter: '{b}: {c}万人 , 占比: {d}%'
  378. },
  379. // 图表图例
  380. legend: {
  381. show: true,
  382. type: 'scroll',
  383. orient: 'horizontal', // 图例排列方向
  384. icon: 'circle', // 图例样式为圆形
  385. itemWidth: 10, // 图例图形的宽度
  386. itemHeight: 16, // 图例图形的高度
  387. itemGap: 10, // 图例项之间的间隔
  388. left: 'center', // 图例距离容器右侧的距离
  389. bottom: 0, // 图例垂直居中
  390. textStyle: {
  391. color: 'white', // 图例文字颜色
  392. fontSize: 16
  393. }
  394. },
  395. // color: [ '#6386e0', '#fb9a55', '#6bd98d', '#8dfd15', '#6bd98d', '#fff' ],
  396. series: [
  397. {
  398. type: 'pie', // 图表类型为饼图
  399. radius: [ '45%', '60%' ], // 控制内外圆环的半径,30%代表内圆,60%代表外圆
  400. avoidLabelOverlap: true, // 是否启用防止标签重叠策略
  401. showEmptyCircle: true, // 是否在无数据的时候显示一个占位圆
  402. label: {
  403. show: true,
  404. formatter: '{d}%',
  405. color: 'white'
  406. },
  407. data: [
  408. { name: '老年卡', value: 180 },
  409. { name: '电子钱包', value: 50 },
  410. { name: '现金', value: 30 },
  411. { name: '学生卡', value: 20 },
  412. { name: '免费', value: 10 }
  413. ]
  414. }
  415. ]
  416. }
  417. },
  418. {
  419. name: '乘距分布',
  420. option: {
  421. grid: {
  422. containLabel: true
  423. },
  424. tooltip: {
  425. show: true,
  426. formatter: '{b}: {c}万人次 , 占比: {d}%'
  427. },
  428. // 图表图例
  429. legend: {
  430. show: true,
  431. type: 'scroll',
  432. orient: 'horizontal', // 图例排列方向
  433. icon: 'circle', // 图例样式为圆形
  434. itemWidth: 10, // 图例图形的宽度
  435. itemHeight: 16, // 图例图形的高度
  436. itemGap: 10, // 图例项之间的间隔
  437. left: 'center', // 图例距离容器右侧的距离
  438. bottom: 0, // 图例垂直居中
  439. textStyle: {
  440. color: 'white', // 图例文字颜色
  441. fontSize: 16
  442. }
  443. },
  444. series: [
  445. {
  446. type: 'pie', // 图表类型为饼图
  447. radius: '60%', // 控制内外圆环的半径,30%代表内圆,60%代表外圆
  448. avoidLabelOverlap: true, // 是否启用防止标签重叠策略
  449. showEmptyCircle: true, // 是否在无数据的时候显示一个占位圆
  450. label: {
  451. show: true,
  452. formatter: '{b}: {c}万人次',
  453. color: 'white'
  454. },
  455. data: [
  456. { name: '2km', value: 5 },
  457. { name: '2-5km', value: 3 },
  458. { name: '5-10km', value: 2 },
  459. { name: '>10km', value: 1 }
  460. ]
  461. }
  462. ]
  463. }
  464. },
  465. {
  466. name: '通勤时间占比',
  467. option: {
  468. grid: {
  469. containLabel: true
  470. },
  471. tooltip: {
  472. show: true,
  473. formatter: '{b}: {c}万人次 , 占比: {d}%'
  474. },
  475. // 图表图例
  476. legend: {
  477. show: true,
  478. type: 'scroll',
  479. orient: 'horizontal', // 图例排列方向
  480. icon: 'circle', // 图例样式为圆形
  481. itemWidth: 10, // 图例图形的宽度
  482. itemHeight: 16, // 图例图形的高度
  483. itemGap: 10, // 图例项之间的间隔
  484. left: 'center', // 图例距离容器右侧的距离
  485. bottom: 0, // 图例垂直居中
  486. textStyle: {
  487. color: 'white', // 图例文字颜色
  488. fontSize: 16
  489. }
  490. },
  491. series: [
  492. {
  493. type: 'pie', // 图表类型为饼图
  494. radius: '60%', // 控制内外圆环的半径,30%代表内圆,60%代表外圆
  495. avoidLabelOverlap: true, // 是否启用防止标签重叠策略
  496. showEmptyCircle: true, // 是否在无数据的时候显示一个占位圆
  497. label: {
  498. show: true,
  499. formatter: '{b}: {c}条',
  500. color: 'white'
  501. },
  502. data: [
  503. { name: '<30分钟', value: 130 },
  504. { name: '30-60分钟', value: 50 },
  505. { name: '60-70分钟', value: 50 },
  506. { name: '>90分钟', value: 50 }
  507. ]
  508. }
  509. ]
  510. }
  511. },
  512. {
  513. name: '换乘次数占比',
  514. option: {
  515. grid: {
  516. containLabel: true
  517. },
  518. tooltip: {
  519. show: true,
  520. formatter: '{b}: {c}万人次 , 占比: {d}%'
  521. },
  522. // 图表图例
  523. legend: {
  524. show: true,
  525. type: 'scroll',
  526. orient: 'horizontal', // 图例排列方向
  527. icon: 'circle', // 图例样式为圆形
  528. itemWidth: 10, // 图例图形的宽度
  529. itemHeight: 16, // 图例图形的高度
  530. itemGap: 10, // 图例项之间的间隔
  531. left: 'center', // 图例距离容器右侧的距离
  532. bottom: 0, // 图例垂直居中
  533. textStyle: {
  534. color: 'white', // 图例文字颜色
  535. fontSize: 16
  536. }
  537. },
  538. series: [
  539. {
  540. type: 'pie', // 图表类型为饼图
  541. radius: '60%', // 控制内外圆环的半径,30%代表内圆,60%代表外圆
  542. avoidLabelOverlap: true, // 是否启用防止标签重叠策略
  543. showEmptyCircle: true, // 是否在无数据的时候显示一个占位圆
  544. label: {
  545. show: true,
  546. formatter: '{b}: {c}人次',
  547. color: 'white'
  548. },
  549. data: [
  550. { name: '0次', value: 130 },
  551. { name: '1次', value: 30 },
  552. { name: '2次', value: 20 },
  553. { name: '3次以上', value: 10 }
  554. ]
  555. }
  556. ]
  557. }
  558. },
  559. {
  560. name: '热门出行线路排名',
  561. isList: true,
  562. list: [
  563. {
  564. name: '1号',
  565. startStation: '北京',
  566. endStation: '上海'
  567. },
  568. {
  569. name: '2号',
  570. startStation: '北京',
  571. endStation: '上海'
  572. },
  573. {
  574. name: '3号',
  575. startStation: '北京',
  576. endStation: '上海'
  577. },
  578. {
  579. name: '4号',
  580. startStation: '北京',
  581. endStation: '上海'
  582. },
  583. {
  584. name: '5号',
  585. startStation: '北京',
  586. endStation: '上海'
  587. }
  588. ]
  589. }
  590. ]
  591. })
  592. const rightContent = ref({
  593. top1: {
  594. grid: {
  595. containLabel: true,
  596. bottom: '0'
  597. },
  598. tooltip: {
  599. trigger: 'axis',
  600. formatter: '{b}<br /> {a0}:{c0}辆',
  601. axisPointer: {
  602. type: 'shadow'
  603. }
  604. },
  605. legend: {
  606. top: 10,
  607. right: '40%',
  608. itemWidth: 18,
  609. itemHeight: 18,
  610. itemGap: 30,
  611. textStyle: {
  612. fontSize: 18,
  613. color: '#C9D2FA'
  614. }
  615. },
  616. xAxis: {
  617. type: 'value',
  618. splitLine: {
  619. show: true,
  620. lineStyle: {
  621. color: '#232e32'
  622. }
  623. },
  624. axisLine: {
  625. show: false
  626. },
  627. axisLabel: {
  628. show: true,
  629. textStyle: {
  630. color: '#fff',
  631. fontSize: 16
  632. }
  633. },
  634. axisTick: {
  635. show: false
  636. }
  637. },
  638. yAxis: [ {
  639. type: 'category',
  640. inverse: true,
  641. data: [ '1路', '2路', '3路', '4路', '5路' ],
  642. axisLine: {
  643. show: false
  644. },
  645. axisTick: {
  646. show: false
  647. },
  648. axisLabel: {
  649. // "margin": 10,
  650. textStyle: {
  651. color: '#fff',
  652. fontSize: 16
  653. }
  654. }
  655. } ],
  656. series: [ { // 内
  657. type: 'bar',
  658. barMaxWidth: 30,
  659. barGap: 0.5,
  660. name: '客流量',
  661. label: {
  662. show: true,
  663. position: 'right',
  664. textStyle: {
  665. color: '#fff',
  666. fontSize: 16,
  667. padding: [ 0, 10 ],
  668. rich: {
  669. a: {
  670. color: '#fff',
  671. fontSize: 36
  672. }
  673. }
  674. }
  675. },
  676. legendHoverLink: false,
  677. silent: true,
  678. itemStyle: {
  679. color: new graphic.LinearGradient(
  680. 0,
  681. 0,
  682. 1,
  683. 1,
  684. [ {
  685. offset: 0,
  686. color: '#0f224066'// 0% 处的颜色
  687. },
  688. {
  689. offset: 1,
  690. color: '#625fdf' // 100% 处的颜色
  691. }
  692. ],
  693. false
  694. )
  695. },
  696. data: [ '80', '70', '60', '50', '40' ]
  697. }
  698. ]
  699. },
  700. top2: {
  701. grid: {
  702. containLabel: true,
  703. right: 30,
  704. left: 50
  705. },
  706. tooltip: {
  707. trigger: 'axis',
  708. formatter: '今日{b}<br /> {a0}:{c0}人<br /> {a1}:{c1}人',
  709. axisPointer: {
  710. type: 'shadow'
  711. }
  712. },
  713. legend: {
  714. show: true,
  715. left: 'center',
  716. top: '10',
  717. icon: 'stack',
  718. itemWidth: 15,
  719. itemHeight: 10,
  720. textStyle: {
  721. color: '#646464',
  722. fontSize: 18
  723. }
  724. },
  725. xAxis: [ {
  726. type: 'category',
  727. axisLine: {
  728. show: false
  729. },
  730. axisLabel: {
  731. color: '#fff',
  732. fontSize: 18
  733. // formatter: (value: number) => format( 1'时')
  734. },
  735. splitLine: {
  736. show: false
  737. },
  738. axisTick: {
  739. show: false
  740. },
  741. data: [ '1时', '2时', '3时', '4时', '5时', '6时', '7时', '8时', '9时', '10时', '11时', '12时' ]
  742. } ],
  743. yAxis: [ {
  744. name: '人数/人',
  745. nameLocation: 'center',
  746. nameGap: 50,
  747. nameTextStyle: {
  748. color: '#fff',
  749. fontSize: 18
  750. },
  751. padding: 5,
  752. // max: 1000,
  753. splitLine: {
  754. show: true,
  755. lineStyle: {
  756. color: '#A1A7B3'
  757. // type: 'dashed'
  758. }
  759. },
  760. axisLine: {
  761. show: false
  762. },
  763. axisLabel: {
  764. show: true,
  765. margin: 10,
  766. textStyle: {
  767. color: '#fff'
  768. }
  769. },
  770. axisTick: {
  771. show: false
  772. }
  773. }
  774. ],
  775. series: [ {
  776. name: '客流',
  777. type: 'line',
  778. smooth: true,
  779. symbolSize: 0,
  780. itemStyle: {
  781. normal: {
  782. // color: '#4293FD',
  783. lineStyle: {
  784. // color: '#FFD35D',
  785. width: 1
  786. }
  787. }
  788. },
  789. areaStyle: {
  790. normal: {
  791. color: new graphic.LinearGradient(0, 0, 0, 1, [
  792. {
  793. offset: 0,
  794. color: '#FFD35D66'
  795. },
  796. {
  797. offset: 0.5,
  798. color: '#7ec2f366'
  799. },
  800. {
  801. offset: 1,
  802. color: '#189066'
  803. }
  804. ], false)
  805. }
  806. },
  807. data: [ 120, 132, 101, 134, 90, 230, 210, 182, 191, 234, 290, 330 ]
  808. },
  809. {
  810. name: '运能',
  811. type: 'line',
  812. smooth: true,
  813. symbolSize: 0,
  814. itemStyle: {
  815. normal: {
  816. // color: '#23D0C4',
  817. lineStyle: {
  818. // color: '#23D0C4',
  819. width: 1
  820. }
  821. }
  822. },
  823. areaStyle: {
  824. normal: {
  825. color: new graphic.LinearGradient(0, 0, 0, 1, [
  826. {
  827. offset: 0,
  828. color: '#6A5BF066'
  829. },
  830. {
  831. offset: 0.5,
  832. color: '#7ec2f366'
  833. },
  834. {
  835. offset: 1,
  836. color: '#1890ff66'
  837. }
  838. ], false)
  839. }
  840. },
  841. data: [ 220, 182, 191, 234, 290, 330, 310, 201, 154, 190, 330, 410 ]
  842. }
  843. ],
  844. dataZoom: {
  845. type: 'slider',
  846. height: 20,
  847. bottom: 8,
  848. handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
  849. handleSize: '140%',
  850. handleStyle: {
  851. color: '#fff'
  852. },
  853. moveHandleSize: 0,
  854. textStyle: {
  855. color: '#666'
  856. },
  857. fillerColor: 'rgba(24,38,73,.3)',
  858. borderColor: 'none'
  859. }
  860. },
  861. center: {
  862. grid: {
  863. containLabel: true,
  864. right: 30,
  865. left: 50
  866. },
  867. tooltip: {
  868. trigger: 'axis',
  869. formatter: '今日{b}<br /> {a0}:{c0}人 <br /> {a1}:{c1}人 <br /> {a2}:{c2}人',
  870. axisPointer: {
  871. type: 'shadow'
  872. }
  873. },
  874. legend: {
  875. show: true,
  876. left: 'center',
  877. top: '10',
  878. icon: 'stack',
  879. itemWidth: 15,
  880. itemHeight: 10,
  881. textStyle: {
  882. color: '#646464',
  883. fontSize: 18
  884. }
  885. },
  886. xAxis: [ {
  887. type: 'category',
  888. axisLine: {
  889. show: false
  890. },
  891. axisLabel: {
  892. color: '#fff',
  893. fontSize: 18
  894. // formatter: (value: number) => format( 1'时')
  895. },
  896. splitLine: {
  897. show: false
  898. },
  899. axisTick: {
  900. show: false
  901. },
  902. data: [ '1时', '2时', '3时', '4时', '5时', '6时', '7时', '8时', '9时', '10时', '11时', '12时' ]
  903. } ],
  904. yAxis: [ {
  905. name: '人数/人',
  906. nameLocation: 'center',
  907. nameGap: 50,
  908. nameTextStyle: {
  909. color: '#fff',
  910. fontSize: 18
  911. },
  912. padding: 5,
  913. // max: 1000,
  914. splitLine: {
  915. show: true,
  916. lineStyle: {
  917. color: '#A1A7B3'
  918. // type: 'dashed'
  919. }
  920. },
  921. axisLine: {
  922. show: false
  923. },
  924. axisLabel: {
  925. show: true,
  926. margin: 10,
  927. textStyle: {
  928. color: '#fff'
  929. }
  930. },
  931. axisTick: {
  932. show: false
  933. }
  934. }
  935. ],
  936. series: [ {
  937. name: '当前',
  938. type: 'line',
  939. smooth: true,
  940. symbolSize: 0,
  941. itemStyle: {
  942. normal: {
  943. // color: '#4293FD',
  944. lineStyle: {
  945. // color: '#4293FD',
  946. width: 1
  947. }
  948. }
  949. },
  950. areaStyle: {
  951. normal: {
  952. color: new graphic.LinearGradient(0, 0, 0, 1, [
  953. {
  954. offset: 0,
  955. color: '#FFD35D66'
  956. },
  957. {
  958. offset: 0.5,
  959. color: '#7ec2f366'
  960. },
  961. {
  962. offset: 1,
  963. color: '#189066'
  964. }
  965. ], false)
  966. }
  967. },
  968. data: [ 120, 132, 101, 134, 90, 230, 210, 182, 191, 234, 290, 330 ]
  969. },
  970. {
  971. name: '环比',
  972. type: 'line',
  973. smooth: true,
  974. symbolSize: 0,
  975. itemStyle: {
  976. normal: {
  977. // color: '#23D0C4',
  978. lineStyle: {
  979. // color: '#23D0C4',
  980. width: 1
  981. }
  982. }
  983. },
  984. areaStyle: {
  985. normal: {
  986. color: new graphic.LinearGradient(0, 0, 0, 1, [
  987. {
  988. offset: 0,
  989. color: '#6A5BF066'
  990. },
  991. {
  992. offset: 0.5,
  993. color: '#7ec2f366'
  994. },
  995. {
  996. offset: 1,
  997. color: '#1890ff66'
  998. }
  999. ], false)
  1000. }
  1001. },
  1002. data: [ 220, 182, 191, 234, 290, 330, 310, 201, 154, 190, 330, 410 ]
  1003. },
  1004. {
  1005. name: '同比',
  1006. type: 'line',
  1007. smooth: true,
  1008. symbolSize: 0,
  1009. itemStyle: {
  1010. normal: {
  1011. // color: '#23D0C4',
  1012. lineStyle: {
  1013. // color: '#23D0C4',
  1014. width: 1
  1015. }
  1016. }
  1017. },
  1018. areaStyle: {
  1019. normal: {
  1020. color: new graphic.LinearGradient(0, 0, 0, 1, [
  1021. {
  1022. offset: 0,
  1023. color: '#2ECC7166'
  1024. },
  1025. {
  1026. offset: 0.5,
  1027. color: '#7ec2f366'
  1028. },
  1029. {
  1030. offset: 1,
  1031. color: '#1890ff66'
  1032. }
  1033. ], false)
  1034. }
  1035. },
  1036. data: [ 220, 182, 191, 234, 290, 330, 310, 201, 154, 190, 330, 410 ]
  1037. }
  1038. ],
  1039. dataZoom: {
  1040. type: 'slider',
  1041. height: 20,
  1042. bottom: 8,
  1043. handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
  1044. handleSize: '140%',
  1045. handleStyle: {
  1046. color: '#fff'
  1047. },
  1048. moveHandleSize: 0,
  1049. textStyle: {
  1050. color: '#666'
  1051. },
  1052. fillerColor: 'rgba(24,38,73,.3)',
  1053. borderColor: 'none'
  1054. }
  1055. },
  1056. bottom: {
  1057. grid: {
  1058. containLabel: true,
  1059. right: 30,
  1060. left: 50
  1061. },
  1062. tooltip: {
  1063. trigger: 'axis',
  1064. formatter: '今日{b}<br /> {a0}:{c0}人<br /> {a1}:{c1}人',
  1065. axisPointer: {
  1066. type: 'shadow'
  1067. }
  1068. },
  1069. legend: {
  1070. show: true,
  1071. left: 'center',
  1072. top: '10',
  1073. icon: 'stack',
  1074. itemWidth: 15,
  1075. itemHeight: 10,
  1076. textStyle: {
  1077. color: '#646464',
  1078. fontSize: 18
  1079. }
  1080. },
  1081. xAxis: [ {
  1082. type: 'category',
  1083. axisLine: {
  1084. show: false
  1085. },
  1086. axisLabel: {
  1087. color: '#fff',
  1088. fontSize: 18
  1089. // formatter: (value: number) => format( 1'时')
  1090. },
  1091. splitLine: {
  1092. show: false
  1093. },
  1094. axisTick: {
  1095. show: false
  1096. },
  1097. data: [ '1日', '2日', '3日', '4日', '5日', '6日', '7日', '8日', '9日', '10日', '11日', '12日' ]
  1098. } ],
  1099. yAxis: [ {
  1100. name: '人数/人',
  1101. nameLocation: 'center',
  1102. nameGap: 50,
  1103. nameTextStyle: {
  1104. color: '#fff',
  1105. fontSize: 18
  1106. },
  1107. padding: 5,
  1108. // max: 1000,
  1109. splitLine: {
  1110. show: true,
  1111. lineStyle: {
  1112. color: '#A1A7B3'
  1113. // type: 'dashed'
  1114. }
  1115. },
  1116. axisLine: {
  1117. show: false
  1118. },
  1119. axisLabel: {
  1120. show: true,
  1121. margin: 10,
  1122. textStyle: {
  1123. color: '#fff'
  1124. }
  1125. },
  1126. axisTick: {
  1127. show: false
  1128. }
  1129. }
  1130. ],
  1131. series: [ {
  1132. name: '当前',
  1133. type: 'line',
  1134. smooth: true,
  1135. symbolSize: 0,
  1136. itemStyle: {
  1137. normal: {
  1138. // color: '#4293FD',
  1139. lineStyle: {
  1140. // color: '#4293FD',
  1141. width: 1
  1142. }
  1143. }
  1144. },
  1145. areaStyle: {
  1146. normal: {
  1147. color: new graphic.LinearGradient(0, 0, 0, 1, [
  1148. {
  1149. offset: 0,
  1150. color: '#FFD35D66'
  1151. },
  1152. {
  1153. offset: 0.5,
  1154. color: '#7ec2f366'
  1155. },
  1156. {
  1157. offset: 1,
  1158. color: '#189066'
  1159. }
  1160. ], false)
  1161. }
  1162. },
  1163. data: [ 120, 132, 101, 134, 90, 230, 210, 182, 191, 234, 290, 330 ]
  1164. },
  1165. {
  1166. name: '环比',
  1167. type: 'line',
  1168. smooth: true,
  1169. symbolSize: 0,
  1170. itemStyle: {
  1171. normal: {
  1172. // color: '#23D0C4',
  1173. lineStyle: {
  1174. // color: '#23D0C4',
  1175. width: 1
  1176. }
  1177. }
  1178. },
  1179. areaStyle: {
  1180. normal: {
  1181. color: new graphic.LinearGradient(0, 0, 0, 1, [
  1182. {
  1183. offset: 0,
  1184. color: '#6A5BF066'
  1185. },
  1186. {
  1187. offset: 0.5,
  1188. color: '#7ec2f366'
  1189. },
  1190. {
  1191. offset: 1,
  1192. color: '#1890ff66'
  1193. }
  1194. ], false)
  1195. }
  1196. },
  1197. data: [ 220, 182, 191, 234, 290, 330, 310, 201, 154, 190, 330, 410 ]
  1198. },
  1199. {
  1200. name: '同比',
  1201. type: 'line',
  1202. smooth: true,
  1203. symbolSize: 0,
  1204. itemStyle: {
  1205. normal: {
  1206. // color: '#23D0C4',
  1207. lineStyle: {
  1208. // color: '#23D0C4',
  1209. width: 1
  1210. }
  1211. }
  1212. },
  1213. areaStyle: {
  1214. normal: {
  1215. color: new graphic.LinearGradient(0, 0, 0, 1, [
  1216. {
  1217. offset: 0,
  1218. color: '#2ECC7166'
  1219. },
  1220. {
  1221. offset: 0.5,
  1222. color: '#7ec2f366'
  1223. },
  1224. {
  1225. offset: 1,
  1226. color: '#1890ff66'
  1227. }
  1228. ], false)
  1229. }
  1230. },
  1231. data: [ 220, 182, 191, 234, 290, 330, 310, 201, 154, 190, 330, 410 ]
  1232. }
  1233. ],
  1234. dataZoom: {
  1235. type: 'slider',
  1236. height: 20,
  1237. bottom: 8,
  1238. handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
  1239. handleSize: '140%',
  1240. handleStyle: {
  1241. color: '#fff'
  1242. },
  1243. moveHandleSize: 0,
  1244. textStyle: {
  1245. color: '#666'
  1246. },
  1247. fillerColor: 'rgba(24,38,73,.3)',
  1248. borderColor: 'none'
  1249. }
  1250. }
  1251. })
  1252. const passengerFlowService = new PassengerFlowService()
  1253. async function getTrafficAreaFlow() {
  1254. const res = await passengerFlowService.getTrafficAreaFlow()
  1255. leftContent.value.tCharts[0].option!.series[0].data = res.map((item: any) => ({
  1256. name: item.area, value: item.total
  1257. }))
  1258. leftContent.value.tCharts[0].option.title!.subtext = res.reduce((prev: any, item: { total: number }) => {
  1259. prev += item.total
  1260. return prev
  1261. }, 0)
  1262. leftContent.value.tCharts[1].option!.xAxis!.data = res.map((item: any) => (item.area))
  1263. leftContent.value.tCharts[1].option!.series[0]!.data = res.map((item: any) => (item.total))
  1264. }
  1265. getTrafficAreaFlow()
  1266. async function getTrafficRidingDistance() {
  1267. const res = await passengerFlowService.getTrafficRidingDistance()
  1268. leftContent.value.bCharts[2].option!.series[0].data = res.map((item: { ridingDistance: any; number: any }) => ({
  1269. name: item.ridingDistance, value: item.number
  1270. }))
  1271. }
  1272. getTrafficRidingDistance()
  1273. async function getTrafficTransferProportion() {
  1274. const res = await passengerFlowService.getTrafficTransferProportion()
  1275. leftContent.value.bCharts[4].option!.series[0].data = res.map((item: { transferType: any; number: any }) => ({
  1276. name: item.transferType, value: item.number
  1277. }))
  1278. }
  1279. getTrafficTransferProportion()
  1280. async function getTrafficTypeNumber() {
  1281. const res = await passengerFlowService.getTrafficTypeNumber()
  1282. leftContent.value.bCharts[0].option!.series[0].data = res.map((item: any) => ({
  1283. name: item.lineType, value: item.number
  1284. }))
  1285. }
  1286. getTrafficTypeNumber()
  1287. async function getTrafficCommutingTime() {
  1288. const res = await passengerFlowService.getTrafficCommutingTime()
  1289. leftContent.value.bCharts[3].option!.series[0].data = res.map((item: any) => ({
  1290. name: item.commutingType, value: item.number
  1291. }))
  1292. }
  1293. getTrafficCommutingTime()
  1294. async function getTrafficConsumeType() {
  1295. const res = await passengerFlowService.getTrafficConsumeType()
  1296. leftContent.value.bCharts[1].option!.series[0].data = res.map((item: any) => ({
  1297. name: item.consumeType, value: item.number
  1298. }))
  1299. leftContent.value.bCharts[1].option!.title!.subtext = res.reduce((prev: any, item: { number: number }) => {
  1300. prev += item.number
  1301. return prev
  1302. }, 0)
  1303. }
  1304. getTrafficConsumeType()
  1305. async function getTrafficFlowRank() {
  1306. const res = await passengerFlowService.getTrafficFlowRank()
  1307. const yAxisData = res.map((item: any) => item.lineName)
  1308. const seriesData = res.map((item: any) => item.trafficVolume)
  1309. rightContent.value.top1!.yAxis[0].data = yAxisData
  1310. rightContent.value.top1!.series[0].data = seriesData
  1311. }
  1312. getTrafficFlowRank()
  1313. const timer = setInterval(() => {
  1314. getTrafficAreaFlow()
  1315. getTrafficRidingDistance()
  1316. getTrafficTransferProportion()
  1317. getTrafficTypeNumber()
  1318. getTrafficCommutingTime()
  1319. getTrafficConsumeType()
  1320. getTrafficFlowRank()
  1321. }, 5 * 1000)
  1322. onUnmounted(() => {
  1323. clearInterval(timer)
  1324. })
  1325. </script>
  1326. <style lang="scss" scoped>
  1327. .left {
  1328. &-top {
  1329. :deep(.box-content) {
  1330. display: flex;
  1331. justify-content: space-between;
  1332. }
  1333. }
  1334. &-bottom {
  1335. display: flex;
  1336. justify-content: space-between;
  1337. flex-wrap: wrap;
  1338. gap: 10px;
  1339. :deep(.box-content) {
  1340. position: relative;
  1341. }
  1342. .lineList {
  1343. padding: 25px;
  1344. display: flex;
  1345. flex-wrap: wrap;
  1346. gap: 15px;
  1347. height: 335px;
  1348. overflow: hidden;
  1349. .line {
  1350. width: 100%;
  1351. display: flex;
  1352. align-items: center;
  1353. font-size: 24px;
  1354. color: #fff;
  1355. .index {
  1356. width: 45px;
  1357. height: 45px;
  1358. line-height: 45px;
  1359. text-align: center;
  1360. border-radius: 50%;
  1361. border: 1px solid #00FFFF;
  1362. background-color: rgba(0, 191, 191, 0.3);
  1363. &.index0 {
  1364. border: 1px solid #FFFF00;
  1365. background-color: rgba(255, 255, 0, 0.3);
  1366. }
  1367. &.index1 {
  1368. border: 1px solid #F2F2F2;
  1369. background: rgba(242, 242, 242, 0.298);
  1370. }
  1371. &.index2 {
  1372. border: 1px solid #FAAD0E;
  1373. background: rgba(250, 173, 14, 0.298);
  1374. }
  1375. }
  1376. .name {
  1377. margin: 0 50px 0 15px;
  1378. text-shadow: 1px 1px 5px rgba(0, 255, 255, 0.8);
  1379. }
  1380. .content {
  1381. color: #80FFFF;
  1382. font-size: 20px;
  1383. }
  1384. }
  1385. }
  1386. }
  1387. }
  1388. .right {
  1389. &-top {
  1390. display: flex;
  1391. gap: 10px;
  1392. // justify-content: space-between;
  1393. }
  1394. }
  1395. </style>