PassengerFlow.vue 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357
  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 { 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. barWidth: 30,
  282. data: [ 200, 108, 200, 40, 210, 100 ]
  283. }
  284. ],
  285. dataZoom: {}
  286. }
  287. }
  288. ],
  289. bCharts: [
  290. {
  291. name: '客流线路分布',
  292. option: {
  293. grid: {
  294. containLabel: true
  295. },
  296. tooltip: {
  297. show: true,
  298. formatter: '{b}: {c}条 , 占比: {d}%'
  299. },
  300. // 图表图例
  301. legend: {
  302. show: true,
  303. type: 'scroll',
  304. orient: 'horizontal', // 图例排列方向
  305. icon: 'circle', // 图例样式为圆形
  306. itemWidth: 10, // 图例图形的宽度
  307. itemHeight: 16, // 图例图形的高度
  308. itemGap: 10, // 图例项之间的间隔
  309. left: 'center', // 图例距离容器右侧的距离
  310. bottom: 0, // 图例垂直居中
  311. textStyle: {
  312. color: 'white', // 图例文字颜色
  313. fontSize: 16
  314. }
  315. },
  316. // color: [ '#6386e0', '#fb9a55', '#6bd98d', '#8dfd15', '#6bd98d', '#fff' ],
  317. series: [
  318. {
  319. type: 'pie', // 图表类型为饼图
  320. radius: '60%', // 控制内外圆环的半径,30%代表内圆,60%代表外圆
  321. avoidLabelOverlap: true, // 是否启用防止标签重叠策略
  322. showEmptyCircle: true, // 是否在无数据的时候显示一个占位圆
  323. label: {
  324. show: true,
  325. formatter: '{b}: {c}条',
  326. color: 'white'
  327. },
  328. data: [
  329. { name: '常规', value: 130 },
  330. { name: '快线', value: 50 },
  331. { name: '特色线路', value: 50 }
  332. ]
  333. }
  334. ]
  335. }
  336. },
  337. {
  338. name: '消费类型',
  339. option: {
  340. title: {
  341. text: '客流总数/万人', // 图标内容文本
  342. subtext: '10',
  343. left: 'center', // 图标内容水平居中
  344. top: 'center', // 图标内容垂直居中
  345. // 文本样式
  346. textStyle: {
  347. color: '#fff', // 图标内容文字颜色
  348. fontSize: '18px', // 图标内容文字大小
  349. fontWeight: 'normal'
  350. },
  351. subtextStyle: {
  352. color: '#fff', // 图标内容文字颜色
  353. fontSize: '18px', // 图标内容文字大小
  354. fontWeight: 'normal'
  355. }
  356. },
  357. grid: {
  358. containLabel: true
  359. },
  360. tooltip: {
  361. show: true,
  362. formatter: '{b}: {c}万人 , 占比: {d}%'
  363. },
  364. // 图表图例
  365. legend: {
  366. show: true,
  367. type: 'scroll',
  368. orient: 'horizontal', // 图例排列方向
  369. icon: 'circle', // 图例样式为圆形
  370. itemWidth: 10, // 图例图形的宽度
  371. itemHeight: 16, // 图例图形的高度
  372. itemGap: 10, // 图例项之间的间隔
  373. left: 'center', // 图例距离容器右侧的距离
  374. bottom: 0, // 图例垂直居中
  375. textStyle: {
  376. color: 'white', // 图例文字颜色
  377. fontSize: 16
  378. }
  379. },
  380. // color: [ '#6386e0', '#fb9a55', '#6bd98d', '#8dfd15', '#6bd98d', '#fff' ],
  381. series: [
  382. {
  383. type: 'pie', // 图表类型为饼图
  384. radius: [ '45%', '60%' ], // 控制内外圆环的半径,30%代表内圆,60%代表外圆
  385. avoidLabelOverlap: true, // 是否启用防止标签重叠策略
  386. showEmptyCircle: true, // 是否在无数据的时候显示一个占位圆
  387. label: {
  388. show: true,
  389. formatter: '{d}%',
  390. color: 'white'
  391. },
  392. data: [
  393. { name: '老年卡', value: 180 },
  394. { name: '电子钱包', value: 50 },
  395. { name: '现金', value: 30 },
  396. { name: '学生卡', value: 20 },
  397. { name: '免费', value: 10 }
  398. ]
  399. }
  400. ]
  401. }
  402. },
  403. {
  404. name: '乘距分布',
  405. option: {
  406. grid: {
  407. containLabel: true
  408. },
  409. tooltip: {
  410. show: true,
  411. formatter: '{b}: {c}万人次 , 占比: {d}%'
  412. },
  413. // 图表图例
  414. legend: {
  415. show: true,
  416. type: 'scroll',
  417. orient: 'horizontal', // 图例排列方向
  418. icon: 'circle', // 图例样式为圆形
  419. itemWidth: 10, // 图例图形的宽度
  420. itemHeight: 16, // 图例图形的高度
  421. itemGap: 10, // 图例项之间的间隔
  422. left: 'center', // 图例距离容器右侧的距离
  423. bottom: 0, // 图例垂直居中
  424. textStyle: {
  425. color: 'white', // 图例文字颜色
  426. fontSize: 16
  427. }
  428. },
  429. series: [
  430. {
  431. type: 'pie', // 图表类型为饼图
  432. radius: '60%', // 控制内外圆环的半径,30%代表内圆,60%代表外圆
  433. avoidLabelOverlap: true, // 是否启用防止标签重叠策略
  434. showEmptyCircle: true, // 是否在无数据的时候显示一个占位圆
  435. label: {
  436. show: true,
  437. formatter: '{b}: {c}万人次',
  438. color: 'white'
  439. },
  440. data: [
  441. { name: '2km', value: 5 },
  442. { name: '2-5km', value: 3 },
  443. { name: '5-10km', value: 2 },
  444. { name: '>10km', value: 1 }
  445. ]
  446. }
  447. ]
  448. }
  449. },
  450. {
  451. name: '通勤时间占比',
  452. option: {
  453. grid: {
  454. containLabel: true
  455. },
  456. tooltip: {
  457. show: true,
  458. formatter: '{b}: {c}万人次 , 占比: {d}%'
  459. },
  460. // 图表图例
  461. legend: {
  462. show: true,
  463. type: 'scroll',
  464. orient: 'horizontal', // 图例排列方向
  465. icon: 'circle', // 图例样式为圆形
  466. itemWidth: 10, // 图例图形的宽度
  467. itemHeight: 16, // 图例图形的高度
  468. itemGap: 10, // 图例项之间的间隔
  469. left: 'center', // 图例距离容器右侧的距离
  470. bottom: 0, // 图例垂直居中
  471. textStyle: {
  472. color: 'white', // 图例文字颜色
  473. fontSize: 16
  474. }
  475. },
  476. series: [
  477. {
  478. type: 'pie', // 图表类型为饼图
  479. radius: '60%', // 控制内外圆环的半径,30%代表内圆,60%代表外圆
  480. avoidLabelOverlap: true, // 是否启用防止标签重叠策略
  481. showEmptyCircle: true, // 是否在无数据的时候显示一个占位圆
  482. label: {
  483. show: true,
  484. formatter: '{b}: {c}条',
  485. color: 'white'
  486. },
  487. data: [
  488. { name: '<30分钟', value: 130 },
  489. { name: '30-60分钟', value: 50 },
  490. { name: '60-70分钟', value: 50 },
  491. { name: '>90分钟', value: 50 }
  492. ]
  493. }
  494. ]
  495. }
  496. },
  497. {
  498. name: '换乘次数占比',
  499. option: {
  500. grid: {
  501. containLabel: true
  502. },
  503. tooltip: {
  504. show: true,
  505. formatter: '{b}: {c}万人次 , 占比: {d}%'
  506. },
  507. // 图表图例
  508. legend: {
  509. show: true,
  510. type: 'scroll',
  511. orient: 'horizontal', // 图例排列方向
  512. icon: 'circle', // 图例样式为圆形
  513. itemWidth: 10, // 图例图形的宽度
  514. itemHeight: 16, // 图例图形的高度
  515. itemGap: 10, // 图例项之间的间隔
  516. left: 'center', // 图例距离容器右侧的距离
  517. bottom: 0, // 图例垂直居中
  518. textStyle: {
  519. color: 'white', // 图例文字颜色
  520. fontSize: 16
  521. }
  522. },
  523. series: [
  524. {
  525. type: 'pie', // 图表类型为饼图
  526. radius: '60%', // 控制内外圆环的半径,30%代表内圆,60%代表外圆
  527. avoidLabelOverlap: true, // 是否启用防止标签重叠策略
  528. showEmptyCircle: true, // 是否在无数据的时候显示一个占位圆
  529. label: {
  530. show: true,
  531. formatter: '{b}: {c}人次',
  532. color: 'white'
  533. },
  534. data: [
  535. { name: '0次', value: 130 },
  536. { name: '1次', value: 30 },
  537. { name: '2次', value: 20 },
  538. { name: '3次以上', value: 10 }
  539. ]
  540. }
  541. ]
  542. }
  543. },
  544. {
  545. name: '热门出行线路排名',
  546. isList: true,
  547. list: [
  548. {
  549. name: '1号',
  550. startStation: '北京',
  551. endStation: '上海'
  552. },
  553. {
  554. name: '2号',
  555. startStation: '北京',
  556. endStation: '上海'
  557. },
  558. {
  559. name: '3号',
  560. startStation: '北京',
  561. endStation: '上海'
  562. },
  563. {
  564. name: '4号',
  565. startStation: '北京',
  566. endStation: '上海'
  567. },
  568. {
  569. name: '5号',
  570. startStation: '北京',
  571. endStation: '上海'
  572. }
  573. ]
  574. }
  575. ]
  576. })
  577. const rightContent = ref({
  578. top1: {
  579. grid: {
  580. containLabel: true,
  581. bottom: '0'
  582. },
  583. tooltip: {
  584. trigger: 'axis',
  585. formatter: '{b}<br /> {a0}:{c0}辆',
  586. axisPointer: {
  587. type: 'shadow'
  588. }
  589. },
  590. legend: {
  591. top: 10,
  592. right: '40%',
  593. itemWidth: 18,
  594. itemHeight: 18,
  595. itemGap: 30,
  596. textStyle: {
  597. fontSize: 18,
  598. color: '#C9D2FA'
  599. }
  600. },
  601. xAxis: {
  602. type: 'value',
  603. splitLine: {
  604. show: true,
  605. lineStyle: {
  606. color: '#232e32'
  607. }
  608. },
  609. axisLine: {
  610. show: false
  611. },
  612. axisLabel: {
  613. show: true,
  614. textStyle: {
  615. color: '#fff',
  616. fontSize: 16
  617. }
  618. },
  619. axisTick: {
  620. show: false
  621. }
  622. },
  623. yAxis: [ {
  624. type: 'category',
  625. inverse: true,
  626. data: [ '1路', '2路', '3路', '4路', '5路' ],
  627. axisLine: {
  628. show: false
  629. },
  630. axisTick: {
  631. show: false
  632. },
  633. axisLabel: {
  634. // "margin": 10,
  635. textStyle: {
  636. color: '#fff',
  637. fontSize: 16
  638. }
  639. }
  640. } ],
  641. series: [ { // 内
  642. type: 'bar',
  643. barWidth: 30,
  644. barGap: 0.5,
  645. name: '客流量',
  646. label: {
  647. show: true,
  648. position: 'right',
  649. textStyle: {
  650. color: '#fff',
  651. fontSize: 16,
  652. padding: [ 0, 10 ],
  653. rich: {
  654. a: {
  655. color: '#fff',
  656. fontSize: 36
  657. }
  658. }
  659. }
  660. },
  661. legendHoverLink: false,
  662. silent: true,
  663. itemStyle: {
  664. color: new graphic.LinearGradient(
  665. 0,
  666. 0,
  667. 1,
  668. 1,
  669. [ {
  670. offset: 0,
  671. color: '#0f224066'// 0% 处的颜色
  672. },
  673. {
  674. offset: 1,
  675. color: '#625fdf' // 100% 处的颜色
  676. }
  677. ],
  678. false
  679. )
  680. },
  681. data: [ '80', '70', '60', '50', '40' ]
  682. }
  683. ]
  684. },
  685. top2: {
  686. grid: {
  687. containLabel: true,
  688. right: 30,
  689. left: 50
  690. },
  691. tooltip: {
  692. trigger: 'axis',
  693. formatter: '今日{b}<br /> {a0}:{c0}人<br /> {a1}:{c1}人',
  694. axisPointer: {
  695. type: 'shadow'
  696. }
  697. },
  698. legend: {
  699. show: true,
  700. left: 'center',
  701. top: '10',
  702. icon: 'stack',
  703. itemWidth: 15,
  704. itemHeight: 10,
  705. textStyle: {
  706. color: '#646464',
  707. fontSize: 18
  708. }
  709. },
  710. xAxis: [ {
  711. type: 'category',
  712. axisLine: {
  713. show: false
  714. },
  715. axisLabel: {
  716. color: '#fff',
  717. fontSize: 18
  718. // formatter: (value: number) => format( 1'时')
  719. },
  720. splitLine: {
  721. show: false
  722. },
  723. axisTick: {
  724. show: false
  725. },
  726. data: [ '1时', '2时', '3时', '4时', '5时', '6时', '7时', '8时', '9时', '10时', '11时', '12时' ]
  727. } ],
  728. yAxis: [ {
  729. name: '人数/人',
  730. nameLocation: 'center',
  731. nameGap: 50,
  732. nameTextStyle: {
  733. color: '#fff',
  734. fontSize: 18
  735. },
  736. padding: 5,
  737. // max: 1000,
  738. splitLine: {
  739. show: true,
  740. lineStyle: {
  741. color: '#A1A7B3'
  742. // type: 'dashed'
  743. }
  744. },
  745. axisLine: {
  746. show: false
  747. },
  748. axisLabel: {
  749. show: true,
  750. margin: 10,
  751. textStyle: {
  752. color: '#fff'
  753. }
  754. },
  755. axisTick: {
  756. show: false
  757. }
  758. }
  759. ],
  760. series: [ {
  761. name: '客流',
  762. type: 'line',
  763. smooth: true,
  764. symbolSize: 0,
  765. itemStyle: {
  766. normal: {
  767. // color: '#4293FD',
  768. lineStyle: {
  769. // color: '#FFD35D',
  770. width: 1
  771. }
  772. }
  773. },
  774. areaStyle: {
  775. normal: {
  776. color: new graphic.LinearGradient(0, 0, 0, 1, [
  777. {
  778. offset: 0,
  779. color: '#FFD35D66'
  780. },
  781. {
  782. offset: 0.5,
  783. color: '#7ec2f366'
  784. },
  785. {
  786. offset: 1,
  787. color: '#189066'
  788. }
  789. ], false)
  790. }
  791. },
  792. data: [ 120, 132, 101, 134, 90, 230, 210, 182, 191, 234, 290, 330 ]
  793. },
  794. {
  795. name: '运能',
  796. type: 'line',
  797. smooth: true,
  798. symbolSize: 0,
  799. itemStyle: {
  800. normal: {
  801. // color: '#23D0C4',
  802. lineStyle: {
  803. // color: '#23D0C4',
  804. width: 1
  805. }
  806. }
  807. },
  808. areaStyle: {
  809. normal: {
  810. color: new graphic.LinearGradient(0, 0, 0, 1, [
  811. {
  812. offset: 0,
  813. color: '#6A5BF066'
  814. },
  815. {
  816. offset: 0.5,
  817. color: '#7ec2f366'
  818. },
  819. {
  820. offset: 1,
  821. color: '#1890ff66'
  822. }
  823. ], false)
  824. }
  825. },
  826. data: [ 220, 182, 191, 234, 290, 330, 310, 201, 154, 190, 330, 410 ]
  827. }
  828. ],
  829. dataZoom: {}
  830. },
  831. center: {
  832. grid: {
  833. containLabel: true,
  834. right: 30,
  835. left: 50
  836. },
  837. tooltip: {
  838. trigger: 'axis',
  839. formatter: '今日{b}<br /> {a0}:{c0}人 <br /> {a1}:{c1}人 <br /> {a2}:{c2}人',
  840. axisPointer: {
  841. type: 'shadow'
  842. }
  843. },
  844. legend: {
  845. show: true,
  846. left: 'center',
  847. top: '10',
  848. icon: 'stack',
  849. itemWidth: 15,
  850. itemHeight: 10,
  851. textStyle: {
  852. color: '#646464',
  853. fontSize: 18
  854. }
  855. },
  856. xAxis: [ {
  857. type: 'category',
  858. axisLine: {
  859. show: false
  860. },
  861. axisLabel: {
  862. color: '#fff',
  863. fontSize: 18
  864. // formatter: (value: number) => format( 1'时')
  865. },
  866. splitLine: {
  867. show: false
  868. },
  869. axisTick: {
  870. show: false
  871. },
  872. data: [ '1时', '2时', '3时', '4时', '5时', '6时', '7时', '8时', '9时', '10时', '11时', '12时' ]
  873. } ],
  874. yAxis: [ {
  875. name: '人数/人',
  876. nameLocation: 'center',
  877. nameGap: 50,
  878. nameTextStyle: {
  879. color: '#fff',
  880. fontSize: 18
  881. },
  882. padding: 5,
  883. // max: 1000,
  884. splitLine: {
  885. show: true,
  886. lineStyle: {
  887. color: '#A1A7B3'
  888. // type: 'dashed'
  889. }
  890. },
  891. axisLine: {
  892. show: false
  893. },
  894. axisLabel: {
  895. show: true,
  896. margin: 10,
  897. textStyle: {
  898. color: '#fff'
  899. }
  900. },
  901. axisTick: {
  902. show: false
  903. }
  904. }
  905. ],
  906. series: [ {
  907. name: '当前',
  908. type: 'line',
  909. smooth: true,
  910. symbolSize: 0,
  911. itemStyle: {
  912. normal: {
  913. // color: '#4293FD',
  914. lineStyle: {
  915. // color: '#4293FD',
  916. width: 1
  917. }
  918. }
  919. },
  920. areaStyle: {
  921. normal: {
  922. color: new graphic.LinearGradient(0, 0, 0, 1, [
  923. {
  924. offset: 0,
  925. color: '#FFD35D66'
  926. },
  927. {
  928. offset: 0.5,
  929. color: '#7ec2f366'
  930. },
  931. {
  932. offset: 1,
  933. color: '#189066'
  934. }
  935. ], false)
  936. }
  937. },
  938. data: [ 120, 132, 101, 134, 90, 230, 210, 182, 191, 234, 290, 330 ]
  939. },
  940. {
  941. name: '环比',
  942. type: 'line',
  943. smooth: true,
  944. symbolSize: 0,
  945. itemStyle: {
  946. normal: {
  947. // color: '#23D0C4',
  948. lineStyle: {
  949. // color: '#23D0C4',
  950. width: 1
  951. }
  952. }
  953. },
  954. areaStyle: {
  955. normal: {
  956. color: new graphic.LinearGradient(0, 0, 0, 1, [
  957. {
  958. offset: 0,
  959. color: '#6A5BF066'
  960. },
  961. {
  962. offset: 0.5,
  963. color: '#7ec2f366'
  964. },
  965. {
  966. offset: 1,
  967. color: '#1890ff66'
  968. }
  969. ], false)
  970. }
  971. },
  972. data: [ 220, 182, 191, 234, 290, 330, 310, 201, 154, 190, 330, 410 ]
  973. },
  974. {
  975. name: '同比',
  976. type: 'line',
  977. smooth: true,
  978. symbolSize: 0,
  979. itemStyle: {
  980. normal: {
  981. // color: '#23D0C4',
  982. lineStyle: {
  983. // color: '#23D0C4',
  984. width: 1
  985. }
  986. }
  987. },
  988. areaStyle: {
  989. normal: {
  990. color: new graphic.LinearGradient(0, 0, 0, 1, [
  991. {
  992. offset: 0,
  993. color: '#2ECC7166'
  994. },
  995. {
  996. offset: 0.5,
  997. color: '#7ec2f366'
  998. },
  999. {
  1000. offset: 1,
  1001. color: '#1890ff66'
  1002. }
  1003. ], false)
  1004. }
  1005. },
  1006. data: [ 220, 182, 191, 234, 290, 330, 310, 201, 154, 190, 330, 410 ]
  1007. }
  1008. ],
  1009. dataZoom: {}
  1010. },
  1011. bottom: {
  1012. grid: {
  1013. containLabel: true,
  1014. right: 30,
  1015. left: 50
  1016. },
  1017. tooltip: {
  1018. trigger: 'axis',
  1019. formatter: '今日{b}<br /> {a0}:{c0}人<br /> {a1}:{c1}人',
  1020. axisPointer: {
  1021. type: 'shadow'
  1022. }
  1023. },
  1024. legend: {
  1025. show: true,
  1026. left: 'center',
  1027. top: '10',
  1028. icon: 'stack',
  1029. itemWidth: 15,
  1030. itemHeight: 10,
  1031. textStyle: {
  1032. color: '#646464',
  1033. fontSize: 18
  1034. }
  1035. },
  1036. xAxis: [ {
  1037. type: 'category',
  1038. axisLine: {
  1039. show: false
  1040. },
  1041. axisLabel: {
  1042. color: '#fff',
  1043. fontSize: 18
  1044. // formatter: (value: number) => format( 1'时')
  1045. },
  1046. splitLine: {
  1047. show: false
  1048. },
  1049. axisTick: {
  1050. show: false
  1051. },
  1052. data: [ '1日', '2日', '3日', '4日', '5日', '6日', '7日', '8日', '9日', '10日', '11日', '12日' ]
  1053. } ],
  1054. yAxis: [ {
  1055. name: '人数/人',
  1056. nameLocation: 'center',
  1057. nameGap: 50,
  1058. nameTextStyle: {
  1059. color: '#fff',
  1060. fontSize: 18
  1061. },
  1062. padding: 5,
  1063. // max: 1000,
  1064. splitLine: {
  1065. show: true,
  1066. lineStyle: {
  1067. color: '#A1A7B3'
  1068. // type: 'dashed'
  1069. }
  1070. },
  1071. axisLine: {
  1072. show: false
  1073. },
  1074. axisLabel: {
  1075. show: true,
  1076. margin: 10,
  1077. textStyle: {
  1078. color: '#fff'
  1079. }
  1080. },
  1081. axisTick: {
  1082. show: false
  1083. }
  1084. }
  1085. ],
  1086. series: [ {
  1087. name: '当前',
  1088. type: 'line',
  1089. smooth: true,
  1090. symbolSize: 0,
  1091. itemStyle: {
  1092. normal: {
  1093. // color: '#4293FD',
  1094. lineStyle: {
  1095. // color: '#4293FD',
  1096. width: 1
  1097. }
  1098. }
  1099. },
  1100. areaStyle: {
  1101. normal: {
  1102. color: new graphic.LinearGradient(0, 0, 0, 1, [
  1103. {
  1104. offset: 0,
  1105. color: '#FFD35D66'
  1106. },
  1107. {
  1108. offset: 0.5,
  1109. color: '#7ec2f366'
  1110. },
  1111. {
  1112. offset: 1,
  1113. color: '#189066'
  1114. }
  1115. ], false)
  1116. }
  1117. },
  1118. data: [ 120, 132, 101, 134, 90, 230, 210, 182, 191, 234, 290, 330 ]
  1119. },
  1120. {
  1121. name: '环比',
  1122. type: 'line',
  1123. smooth: true,
  1124. symbolSize: 0,
  1125. itemStyle: {
  1126. normal: {
  1127. // color: '#23D0C4',
  1128. lineStyle: {
  1129. // color: '#23D0C4',
  1130. width: 1
  1131. }
  1132. }
  1133. },
  1134. areaStyle: {
  1135. normal: {
  1136. color: new graphic.LinearGradient(0, 0, 0, 1, [
  1137. {
  1138. offset: 0,
  1139. color: '#6A5BF066'
  1140. },
  1141. {
  1142. offset: 0.5,
  1143. color: '#7ec2f366'
  1144. },
  1145. {
  1146. offset: 1,
  1147. color: '#1890ff66'
  1148. }
  1149. ], false)
  1150. }
  1151. },
  1152. data: [ 220, 182, 191, 234, 290, 330, 310, 201, 154, 190, 330, 410 ]
  1153. },
  1154. {
  1155. name: '同比',
  1156. type: 'line',
  1157. smooth: true,
  1158. symbolSize: 0,
  1159. itemStyle: {
  1160. normal: {
  1161. // color: '#23D0C4',
  1162. lineStyle: {
  1163. // color: '#23D0C4',
  1164. width: 1
  1165. }
  1166. }
  1167. },
  1168. areaStyle: {
  1169. normal: {
  1170. color: new graphic.LinearGradient(0, 0, 0, 1, [
  1171. {
  1172. offset: 0,
  1173. color: '#2ECC7166'
  1174. },
  1175. {
  1176. offset: 0.5,
  1177. color: '#7ec2f366'
  1178. },
  1179. {
  1180. offset: 1,
  1181. color: '#1890ff66'
  1182. }
  1183. ], false)
  1184. }
  1185. },
  1186. data: [ 220, 182, 191, 234, 290, 330, 310, 201, 154, 190, 330, 410 ]
  1187. }
  1188. ],
  1189. dataZoom: {}
  1190. }
  1191. })
  1192. const passengerFlowService = new PassengerFlowService()
  1193. async function getTrafficAreaFlow() {
  1194. const res = await passengerFlowService.getTrafficAreaFlow()
  1195. leftContent.value.tCharts[0].option!.series[0].data = res.map((item: any) => ({
  1196. name: item.area, value: item.total
  1197. }))
  1198. leftContent.value.tCharts[0].option.title!.subtext = res.reduce((prev: any, item: { total: number }) => {
  1199. prev += item.total
  1200. return prev
  1201. }, 0)
  1202. leftContent.value.tCharts[1].option!.xAxis!.data = res.map((item: any) => (item.area))
  1203. leftContent.value.tCharts[1].option!.series[0]!.data = res.map((item: any) => (item.total))
  1204. }
  1205. getTrafficAreaFlow()
  1206. async function getTrafficRidingDistance() {
  1207. const res = await passengerFlowService.getTrafficRidingDistance()
  1208. leftContent.value.bCharts[2].option!.series[0].data = res.map((item: { ridingDistance: any; number: any }) => ({
  1209. name: item.ridingDistance, value: item.number
  1210. }))
  1211. }
  1212. getTrafficRidingDistance()
  1213. async function getTrafficTransferProportion() {
  1214. const res = await passengerFlowService.getTrafficTransferProportion()
  1215. leftContent.value.bCharts[4].option!.series[0].data = res.map((item: { transferType: any; number: any }) => ({
  1216. name: item.transferType, value: item.number
  1217. }))
  1218. }
  1219. getTrafficTransferProportion()
  1220. async function getTrafficTypeNumber() {
  1221. const res = await passengerFlowService.getTrafficTypeNumber()
  1222. leftContent.value.bCharts[0].option!.series[0].data = res.map((item: any) => ({
  1223. name: item.lineType, value: item.number
  1224. }))
  1225. }
  1226. getTrafficTypeNumber()
  1227. async function getTrafficCommutingTime() {
  1228. const res = await passengerFlowService.getTrafficCommutingTime()
  1229. leftContent.value.bCharts[3].option!.series[0].data = res.map((item: any) => ({
  1230. name: item.commutingType, value: item.number
  1231. }))
  1232. }
  1233. getTrafficCommutingTime()
  1234. async function getTrafficConsumeType() {
  1235. const res = await passengerFlowService.getTrafficConsumeType()
  1236. leftContent.value.bCharts[1].option!.series[0].data = res.map((item: any) => ({
  1237. name: item.consumeType, value: item.number
  1238. }))
  1239. leftContent.value.bCharts[1].option!.title!.subtext = res.reduce((prev: any, item: { number: number }) => {
  1240. prev += item.number
  1241. return prev
  1242. }, 0)
  1243. }
  1244. getTrafficConsumeType()
  1245. async function getTrafficFlowRank() {
  1246. const res = await passengerFlowService.getTrafficFlowRank()
  1247. const yAxisData = res.map((item: any) => item.lineName)
  1248. const seriesData = res.map((item: any) => item.trafficVolume)
  1249. rightContent.value.top1!.yAxis[0].data = yAxisData
  1250. rightContent.value.top1!.series[0].data = seriesData
  1251. }
  1252. getTrafficFlowRank()
  1253. </script>
  1254. <style lang="scss" scoped>
  1255. .left {
  1256. &-top {
  1257. :deep(.box-content) {
  1258. display: flex;
  1259. justify-content: space-between;
  1260. }
  1261. }
  1262. &-bottom {
  1263. display: flex;
  1264. justify-content: space-between;
  1265. flex-wrap: wrap;
  1266. gap: 10px;
  1267. :deep(.box-content) {
  1268. position: relative;
  1269. }
  1270. .lineList {
  1271. padding: 25px;
  1272. display: flex;
  1273. flex-wrap: wrap;
  1274. gap: 15px;
  1275. height: 335px;
  1276. overflow: hidden;
  1277. .line {
  1278. width: 100%;
  1279. display: flex;
  1280. align-items: center;
  1281. font-size: 24px;
  1282. color: #fff;
  1283. .index {
  1284. width: 45px;
  1285. height: 45px;
  1286. line-height: 45px;
  1287. text-align: center;
  1288. border-radius: 50%;
  1289. border: 1px solid #00FFFF;
  1290. background-color: rgba(0, 191, 191, 0.3);
  1291. &.index0 {
  1292. border: 1px solid #FFFF00;
  1293. background-color: rgba(255, 255, 0, 0.3);
  1294. }
  1295. &.index1 {
  1296. border: 1px solid #F2F2F2;
  1297. background: rgba(242, 242, 242, 0.298);
  1298. }
  1299. &.index2 {
  1300. border: 1px solid #FAAD0E;
  1301. background: rgba(250, 173, 14, 0.298);
  1302. }
  1303. }
  1304. .name {
  1305. margin: 0 50px 0 15px;
  1306. text-shadow: 1px 1px 5px rgba(0, 255, 255, 0.8);
  1307. }
  1308. .content {
  1309. color: #80FFFF;
  1310. font-size: 20px;
  1311. }
  1312. }
  1313. }
  1314. }
  1315. }
  1316. .right {
  1317. &-top {
  1318. display: flex;
  1319. gap: 10px;
  1320. // justify-content: space-between;
  1321. }
  1322. }
  1323. </style>