| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357 |
- <template>
- <Layout>
- <template #left>
- <div class="left">
- <Box
- :width="1370"
- :height="406"
- :name="'区域流量'"
- class="left-top"
- >
- <Echart
- v-for="(item, index) in leftContent.tCharts"
- :key="index"
- :option="item.option"
- />
- </Box>
- <div class="left-bottom">
- <template
- v-for="(item, index) in leftContent.bCharts"
- :key="index"
- >
- <Box
- :width="438"
- :height="400"
- :name="item.name"
- >
- <Echart
- v-if="!item.isList"
- :option="item.option"
- />
- <div
- v-else
- class="lineList"
- >
- <div
- v-for="line, i in item.list"
- :key="i"
- class="line"
- >
- <div
- :class="'index' + i"
- class="index"
- >
- {{ i + 1 }}
- </div>
- <div class="name">
- {{ line.name }}
- </div>
- <div class="content">
- {{ line.startStation }} → {{ line.endStation }}
- </div>
- </div>
- </div>
- </Box>
- </template>
- </div>
- </div>
- </template>
- <template #right>
- <div class="right">
- <div class="right-top">
- <Box
- :width="460"
- :height="406"
- :name="'客运量排名'"
- >
- <Echart :option="rightContent.top1" />
- </Box>
- <Box
- :width="900"
- :height="406"
- :name="'运能分析'"
- >
- <Echart :option="rightContent.top2" />
- </Box>
- </div>
- <Box
- class="right-center"
- :width="1370"
- :height="406"
- :name="'今日客流'"
- >
- <Echart :option="rightContent.center" />
- </Box>
- <Box
- class="right-bottom"
- :width="1370"
- :height="406"
- :name="'本月客流'"
- >
- <Echart :option="rightContent.bottom" />
- </Box>
- </div>
- </template>
- </Layout>
- </template>
- <script setup lang='ts'>
- import Layout from '@/components/layout.vue'
- import Box from '@/components/box.vue'
- import Echart from '@/components/chart.vue'
- import { ref } from 'vue'
- import { graphic } from 'echarts'
- import PassengerFlowService from '../services/passengerFlow.service'
- const leftContent = ref({
- tCharts: [
- {
- name: '客流线路分布',
- option: {
- title: {
- text: '客流总数/万人', // 图标内容文本
- subtext: '10',
- left: 'center', // 图标内容水平居中
- top: 'center', // 图标内容垂直居中
- // 文本样式
- textStyle: {
- color: '#fff', // 图标内容文字颜色
- fontSize: '18px', // 图标内容文字大小
- fontWeight: 'normal'
- },
- subtextStyle: {
- color: '#fff', // 图标内容文字颜色
- fontSize: '18px', // 图标内容文字大小
- fontWeight: 'normal'
- }
- },
- grid: {
- containLabel: true
- },
- tooltip: {
- show: true,
- formatter: '{b}: {c}万人 , 占比: {d}%'
- },
- // 图表图例
- legend: {
- show: true,
- type: 'scroll',
- orient: 'vertical', // 图例排列方向
- icon: 'circle', // 图例样式为圆形
- itemWidth: 10, // 图例图形的宽度
- itemHeight: 16, // 图例图形的高度
- itemGap: 10, // 图例项之间的间隔
- left: 10, // 图例距离容器右侧的距离
- top: 'center', // 图例垂直居中
- textStyle: {
- color: 'white', // 图例文字颜色
- fontSize: 16
- }
- },
- // color: [ '#6386e0', '#fb9a55', '#6bd98d', '#8dfd15', '#6bd98d', '#fff' ],
- series: [
- {
- type: 'pie', // 图表类型为饼图
- radius: [ '45%', '60%' ], // 控制内外圆环的半径,30%代表内圆,60%代表外圆
- avoidLabelOverlap: true, // 是否启用防止标签重叠策略
- showEmptyCircle: true, // 是否在无数据的日候显示一个占位圆
- label: {
- show: true,
- formatter: '{d}%',
- color: 'white'
- },
- data: [
- { name: '雨城区', value: 30619 },
- { name: '芦山县', value: 5921 },
- { name: '名山县', value: 1153 },
- { name: '天全县', value: 266 },
- { name: '宝兴县', value: 87 },
- { name: '汉源县', value: 999 },
- { name: '石棉县', value: 5921 }
- ]
- }
- ]
- }
- },
- {
- name: '客流线路分布',
- option: {
- grid: {
- containLabel: true
- },
- tooltip: {
- trigger: 'axis',
- formatter: '{b}<br /> {a0}:{c0}万人',
- axisPointer: {
- type: 'shadow'
- }
- },
- legend: {
- top: 10,
- right: '40%',
- itemWidth: 18,
- itemHeight: 18,
- itemGap: 30,
- textStyle: {
- fontSize: 18,
- color: '#C9D2FA'
- }
- },
- xAxis: {
- // name: "班级",
- triggerEvent: true,
- data: [
- '雨城区',
- '芦山县',
- '名山县',
- '天全县',
- '宝兴县',
- '汉源县'
- ],
- axisLabel: {
- interval: 0,
- show: true,
- fontSize: 18,
- color: '#C9D2FA'
- },
- axisLine: {
- show: false,
- lineStyle: {
- show: false,
- color: '#F3F3F3',
- width: 2
- }
- },
- axisTick: {
- show: false
- }
- },
- yAxis: [
- {
- name: '人数/万人',
- nameLocation: 'center',
- nameGap: 50,
- nameTextStyle: {
- color: '#fff',
- fontSize: 18
- },
- splitNumber: 2,
- axisLabel: {
- show: true,
- fontSize: 18,
- color: '#C9D2FA'
- },
- axisLine: {
- show: false
- },
- axisTick: {
- show: false
- },
- splitLine: {
- lineStyle: {
- type: 'dashed',
- color: '#3E4A82'
- }
- }
- }
- ],
- series: [
- {
- name: '客流量',
- type: 'bar',
- silent: true,
- itemStyle: {
- normal: {
- color: new graphic.LinearGradient(
- 0,
- 0,
- 0,
- 1,
- [ {
- offset: 0,
- color: '#00fdff'// 0% 处的颜色
- },
- {
- offset: 1,
- color: '#00aaff08' // 100% 处的颜色
- }
- ],
- false
- )
- }
- },
- barWidth: 30,
- data: [ 200, 108, 200, 40, 210, 100 ]
- }
- ],
- dataZoom: {}
- }
- }
- ],
- bCharts: [
- {
- name: '客流线路分布',
- option: {
- grid: {
- containLabel: true
- },
- tooltip: {
- show: true,
- formatter: '{b}: {c}条 , 占比: {d}%'
- },
- // 图表图例
- legend: {
- show: true,
- type: 'scroll',
- orient: 'horizontal', // 图例排列方向
- icon: 'circle', // 图例样式为圆形
- itemWidth: 10, // 图例图形的宽度
- itemHeight: 16, // 图例图形的高度
- itemGap: 10, // 图例项之间的间隔
- left: 'center', // 图例距离容器右侧的距离
- bottom: 0, // 图例垂直居中
- textStyle: {
- color: 'white', // 图例文字颜色
- fontSize: 16
- }
- },
- // color: [ '#6386e0', '#fb9a55', '#6bd98d', '#8dfd15', '#6bd98d', '#fff' ],
- series: [
- {
- type: 'pie', // 图表类型为饼图
- radius: '60%', // 控制内外圆环的半径,30%代表内圆,60%代表外圆
- avoidLabelOverlap: true, // 是否启用防止标签重叠策略
- showEmptyCircle: true, // 是否在无数据的时候显示一个占位圆
- label: {
- show: true,
- formatter: '{b}: {c}条',
- color: 'white'
- },
- data: [
- { name: '常规', value: 130 },
- { name: '快线', value: 50 },
- { name: '特色线路', value: 50 }
- ]
- }
- ]
- }
- },
- {
- name: '消费类型',
- option: {
- title: {
- text: '客流总数/万人', // 图标内容文本
- subtext: '10',
- left: 'center', // 图标内容水平居中
- top: 'center', // 图标内容垂直居中
- // 文本样式
- textStyle: {
- color: '#fff', // 图标内容文字颜色
- fontSize: '18px', // 图标内容文字大小
- fontWeight: 'normal'
- },
- subtextStyle: {
- color: '#fff', // 图标内容文字颜色
- fontSize: '18px', // 图标内容文字大小
- fontWeight: 'normal'
- }
- },
- grid: {
- containLabel: true
- },
- tooltip: {
- show: true,
- formatter: '{b}: {c}万人 , 占比: {d}%'
- },
- // 图表图例
- legend: {
- show: true,
- type: 'scroll',
- orient: 'horizontal', // 图例排列方向
- icon: 'circle', // 图例样式为圆形
- itemWidth: 10, // 图例图形的宽度
- itemHeight: 16, // 图例图形的高度
- itemGap: 10, // 图例项之间的间隔
- left: 'center', // 图例距离容器右侧的距离
- bottom: 0, // 图例垂直居中
- textStyle: {
- color: 'white', // 图例文字颜色
- fontSize: 16
- }
- },
- // color: [ '#6386e0', '#fb9a55', '#6bd98d', '#8dfd15', '#6bd98d', '#fff' ],
- series: [
- {
- type: 'pie', // 图表类型为饼图
- radius: [ '45%', '60%' ], // 控制内外圆环的半径,30%代表内圆,60%代表外圆
- avoidLabelOverlap: true, // 是否启用防止标签重叠策略
- showEmptyCircle: true, // 是否在无数据的时候显示一个占位圆
- label: {
- show: true,
- formatter: '{d}%',
- color: 'white'
- },
- data: [
- { name: '老年卡', value: 180 },
- { name: '电子钱包', value: 50 },
- { name: '现金', value: 30 },
- { name: '学生卡', value: 20 },
- { name: '免费', value: 10 }
- ]
- }
- ]
- }
- },
- {
- name: '乘距分布',
- option: {
- grid: {
- containLabel: true
- },
- tooltip: {
- show: true,
- formatter: '{b}: {c}万人次 , 占比: {d}%'
- },
- // 图表图例
- legend: {
- show: true,
- type: 'scroll',
- orient: 'horizontal', // 图例排列方向
- icon: 'circle', // 图例样式为圆形
- itemWidth: 10, // 图例图形的宽度
- itemHeight: 16, // 图例图形的高度
- itemGap: 10, // 图例项之间的间隔
- left: 'center', // 图例距离容器右侧的距离
- bottom: 0, // 图例垂直居中
- textStyle: {
- color: 'white', // 图例文字颜色
- fontSize: 16
- }
- },
- series: [
- {
- type: 'pie', // 图表类型为饼图
- radius: '60%', // 控制内外圆环的半径,30%代表内圆,60%代表外圆
- avoidLabelOverlap: true, // 是否启用防止标签重叠策略
- showEmptyCircle: true, // 是否在无数据的时候显示一个占位圆
- label: {
- show: true,
- formatter: '{b}: {c}万人次',
- color: 'white'
- },
- data: [
- { name: '2km', value: 5 },
- { name: '2-5km', value: 3 },
- { name: '5-10km', value: 2 },
- { name: '>10km', value: 1 }
- ]
- }
- ]
- }
- },
- {
- name: '通勤时间占比',
- option: {
- grid: {
- containLabel: true
- },
- tooltip: {
- show: true,
- formatter: '{b}: {c}万人次 , 占比: {d}%'
- },
- // 图表图例
- legend: {
- show: true,
- type: 'scroll',
- orient: 'horizontal', // 图例排列方向
- icon: 'circle', // 图例样式为圆形
- itemWidth: 10, // 图例图形的宽度
- itemHeight: 16, // 图例图形的高度
- itemGap: 10, // 图例项之间的间隔
- left: 'center', // 图例距离容器右侧的距离
- bottom: 0, // 图例垂直居中
- textStyle: {
- color: 'white', // 图例文字颜色
- fontSize: 16
- }
- },
- series: [
- {
- type: 'pie', // 图表类型为饼图
- radius: '60%', // 控制内外圆环的半径,30%代表内圆,60%代表外圆
- avoidLabelOverlap: true, // 是否启用防止标签重叠策略
- showEmptyCircle: true, // 是否在无数据的时候显示一个占位圆
- label: {
- show: true,
- formatter: '{b}: {c}条',
- color: 'white'
- },
- data: [
- { name: '<30分钟', value: 130 },
- { name: '30-60分钟', value: 50 },
- { name: '60-70分钟', value: 50 },
- { name: '>90分钟', value: 50 }
- ]
- }
- ]
- }
- },
- {
- name: '换乘次数占比',
- option: {
- grid: {
- containLabel: true
- },
- tooltip: {
- show: true,
- formatter: '{b}: {c}万人次 , 占比: {d}%'
- },
- // 图表图例
- legend: {
- show: true,
- type: 'scroll',
- orient: 'horizontal', // 图例排列方向
- icon: 'circle', // 图例样式为圆形
- itemWidth: 10, // 图例图形的宽度
- itemHeight: 16, // 图例图形的高度
- itemGap: 10, // 图例项之间的间隔
- left: 'center', // 图例距离容器右侧的距离
- bottom: 0, // 图例垂直居中
- textStyle: {
- color: 'white', // 图例文字颜色
- fontSize: 16
- }
- },
- series: [
- {
- type: 'pie', // 图表类型为饼图
- radius: '60%', // 控制内外圆环的半径,30%代表内圆,60%代表外圆
- avoidLabelOverlap: true, // 是否启用防止标签重叠策略
- showEmptyCircle: true, // 是否在无数据的时候显示一个占位圆
- label: {
- show: true,
- formatter: '{b}: {c}人次',
- color: 'white'
- },
- data: [
- { name: '0次', value: 130 },
- { name: '1次', value: 30 },
- { name: '2次', value: 20 },
- { name: '3次以上', value: 10 }
- ]
- }
- ]
- }
- },
- {
- name: '热门出行线路排名',
- isList: true,
- list: [
- {
- name: '1号',
- startStation: '北京',
- endStation: '上海'
- },
- {
- name: '2号',
- startStation: '北京',
- endStation: '上海'
- },
- {
- name: '3号',
- startStation: '北京',
- endStation: '上海'
- },
- {
- name: '4号',
- startStation: '北京',
- endStation: '上海'
- },
- {
- name: '5号',
- startStation: '北京',
- endStation: '上海'
- }
- ]
- }
- ]
- })
- const rightContent = ref({
- top1: {
- grid: {
- containLabel: true,
- bottom: '0'
- },
- tooltip: {
- trigger: 'axis',
- formatter: '{b}<br /> {a0}:{c0}辆',
- axisPointer: {
- type: 'shadow'
- }
- },
- legend: {
- top: 10,
- right: '40%',
- itemWidth: 18,
- itemHeight: 18,
- itemGap: 30,
- textStyle: {
- fontSize: 18,
- color: '#C9D2FA'
- }
- },
- xAxis: {
- type: 'value',
- splitLine: {
- show: true,
- lineStyle: {
- color: '#232e32'
- }
- },
- axisLine: {
- show: false
- },
- axisLabel: {
- show: true,
- textStyle: {
- color: '#fff',
- fontSize: 16
- }
- },
- axisTick: {
- show: false
- }
- },
- yAxis: [ {
- type: 'category',
- inverse: true,
- data: [ '1路', '2路', '3路', '4路', '5路' ],
- axisLine: {
- show: false
- },
- axisTick: {
- show: false
- },
- axisLabel: {
- // "margin": 10,
- textStyle: {
- color: '#fff',
- fontSize: 16
- }
- }
- } ],
- series: [ { // 内
- type: 'bar',
- barWidth: 30,
- barGap: 0.5,
- name: '客流量',
- label: {
- show: true,
- position: 'right',
- textStyle: {
- color: '#fff',
- fontSize: 16,
- padding: [ 0, 10 ],
- rich: {
- a: {
- color: '#fff',
- fontSize: 36
- }
- }
- }
- },
- legendHoverLink: false,
- silent: true,
- itemStyle: {
- color: new graphic.LinearGradient(
- 0,
- 0,
- 1,
- 1,
- [ {
- offset: 0,
- color: '#0f224066'// 0% 处的颜色
- },
- {
- offset: 1,
- color: '#625fdf' // 100% 处的颜色
- }
- ],
- false
- )
- },
- data: [ '80', '70', '60', '50', '40' ]
- }
- ]
- },
- top2: {
- grid: {
- containLabel: true,
- right: 30,
- left: 50
- },
- tooltip: {
- trigger: 'axis',
- formatter: '今日{b}<br /> {a0}:{c0}人<br /> {a1}:{c1}人',
- axisPointer: {
- type: 'shadow'
- }
- },
- legend: {
- show: true,
- left: 'center',
- top: '10',
- icon: 'stack',
- itemWidth: 15,
- itemHeight: 10,
- textStyle: {
- color: '#646464',
- fontSize: 18
- }
- },
- xAxis: [ {
- type: 'category',
- axisLine: {
- show: false
- },
- axisLabel: {
- color: '#fff',
- fontSize: 18
- // formatter: (value: number) => format( 1'时')
- },
- splitLine: {
- show: false
- },
- axisTick: {
- show: false
- },
- data: [ '1时', '2时', '3时', '4时', '5时', '6时', '7时', '8时', '9时', '10时', '11时', '12时' ]
- } ],
- yAxis: [ {
- name: '人数/人',
- nameLocation: 'center',
- nameGap: 50,
- nameTextStyle: {
- color: '#fff',
- fontSize: 18
- },
- padding: 5,
- // max: 1000,
- splitLine: {
- show: true,
- lineStyle: {
- color: '#A1A7B3'
- // type: 'dashed'
- }
- },
- axisLine: {
- show: false
- },
- axisLabel: {
- show: true,
- margin: 10,
- textStyle: {
- color: '#fff'
- }
- },
- axisTick: {
- show: false
- }
- }
- ],
- series: [ {
- name: '客流',
- type: 'line',
- smooth: true,
- symbolSize: 0,
- itemStyle: {
- normal: {
- // color: '#4293FD',
- lineStyle: {
- // color: '#FFD35D',
- width: 1
- }
- }
- },
- areaStyle: {
- normal: {
- color: new graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#FFD35D66'
- },
- {
- offset: 0.5,
- color: '#7ec2f366'
- },
- {
- offset: 1,
- color: '#189066'
- }
- ], false)
- }
- },
- data: [ 120, 132, 101, 134, 90, 230, 210, 182, 191, 234, 290, 330 ]
- },
- {
- name: '运能',
- type: 'line',
- smooth: true,
- symbolSize: 0,
- itemStyle: {
- normal: {
- // color: '#23D0C4',
- lineStyle: {
- // color: '#23D0C4',
- width: 1
- }
- }
- },
- areaStyle: {
- normal: {
- color: new graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#6A5BF066'
- },
- {
- offset: 0.5,
- color: '#7ec2f366'
- },
- {
- offset: 1,
- color: '#1890ff66'
- }
- ], false)
- }
- },
- data: [ 220, 182, 191, 234, 290, 330, 310, 201, 154, 190, 330, 410 ]
- }
- ],
- dataZoom: {}
- },
- center: {
- grid: {
- containLabel: true,
- right: 30,
- left: 50
- },
- tooltip: {
- trigger: 'axis',
- formatter: '今日{b}<br /> {a0}:{c0}人 <br /> {a1}:{c1}人 <br /> {a2}:{c2}人',
- axisPointer: {
- type: 'shadow'
- }
- },
- legend: {
- show: true,
- left: 'center',
- top: '10',
- icon: 'stack',
- itemWidth: 15,
- itemHeight: 10,
- textStyle: {
- color: '#646464',
- fontSize: 18
- }
- },
- xAxis: [ {
- type: 'category',
- axisLine: {
- show: false
- },
- axisLabel: {
- color: '#fff',
- fontSize: 18
- // formatter: (value: number) => format( 1'时')
- },
- splitLine: {
- show: false
- },
- axisTick: {
- show: false
- },
- data: [ '1时', '2时', '3时', '4时', '5时', '6时', '7时', '8时', '9时', '10时', '11时', '12时' ]
- } ],
- yAxis: [ {
- name: '人数/人',
- nameLocation: 'center',
- nameGap: 50,
- nameTextStyle: {
- color: '#fff',
- fontSize: 18
- },
- padding: 5,
- // max: 1000,
- splitLine: {
- show: true,
- lineStyle: {
- color: '#A1A7B3'
- // type: 'dashed'
- }
- },
- axisLine: {
- show: false
- },
- axisLabel: {
- show: true,
- margin: 10,
- textStyle: {
- color: '#fff'
- }
- },
- axisTick: {
- show: false
- }
- }
- ],
- series: [ {
- name: '当前',
- type: 'line',
- smooth: true,
- symbolSize: 0,
- itemStyle: {
- normal: {
- // color: '#4293FD',
- lineStyle: {
- // color: '#4293FD',
- width: 1
- }
- }
- },
- areaStyle: {
- normal: {
- color: new graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#FFD35D66'
- },
- {
- offset: 0.5,
- color: '#7ec2f366'
- },
- {
- offset: 1,
- color: '#189066'
- }
- ], false)
- }
- },
- data: [ 120, 132, 101, 134, 90, 230, 210, 182, 191, 234, 290, 330 ]
- },
- {
- name: '环比',
- type: 'line',
- smooth: true,
- symbolSize: 0,
- itemStyle: {
- normal: {
- // color: '#23D0C4',
- lineStyle: {
- // color: '#23D0C4',
- width: 1
- }
- }
- },
- areaStyle: {
- normal: {
- color: new graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#6A5BF066'
- },
- {
- offset: 0.5,
- color: '#7ec2f366'
- },
- {
- offset: 1,
- color: '#1890ff66'
- }
- ], false)
- }
- },
- data: [ 220, 182, 191, 234, 290, 330, 310, 201, 154, 190, 330, 410 ]
- },
- {
- name: '同比',
- type: 'line',
- smooth: true,
- symbolSize: 0,
- itemStyle: {
- normal: {
- // color: '#23D0C4',
- lineStyle: {
- // color: '#23D0C4',
- width: 1
- }
- }
- },
- areaStyle: {
- normal: {
- color: new graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#2ECC7166'
- },
- {
- offset: 0.5,
- color: '#7ec2f366'
- },
- {
- offset: 1,
- color: '#1890ff66'
- }
- ], false)
- }
- },
- data: [ 220, 182, 191, 234, 290, 330, 310, 201, 154, 190, 330, 410 ]
- }
- ],
- dataZoom: {}
- },
- bottom: {
- grid: {
- containLabel: true,
- right: 30,
- left: 50
- },
- tooltip: {
- trigger: 'axis',
- formatter: '今日{b}<br /> {a0}:{c0}人<br /> {a1}:{c1}人',
- axisPointer: {
- type: 'shadow'
- }
- },
- legend: {
- show: true,
- left: 'center',
- top: '10',
- icon: 'stack',
- itemWidth: 15,
- itemHeight: 10,
- textStyle: {
- color: '#646464',
- fontSize: 18
- }
- },
- xAxis: [ {
- type: 'category',
- axisLine: {
- show: false
- },
- axisLabel: {
- color: '#fff',
- fontSize: 18
- // formatter: (value: number) => format( 1'时')
- },
- splitLine: {
- show: false
- },
- axisTick: {
- show: false
- },
- data: [ '1日', '2日', '3日', '4日', '5日', '6日', '7日', '8日', '9日', '10日', '11日', '12日' ]
- } ],
- yAxis: [ {
- name: '人数/人',
- nameLocation: 'center',
- nameGap: 50,
- nameTextStyle: {
- color: '#fff',
- fontSize: 18
- },
- padding: 5,
- // max: 1000,
- splitLine: {
- show: true,
- lineStyle: {
- color: '#A1A7B3'
- // type: 'dashed'
- }
- },
- axisLine: {
- show: false
- },
- axisLabel: {
- show: true,
- margin: 10,
- textStyle: {
- color: '#fff'
- }
- },
- axisTick: {
- show: false
- }
- }
- ],
- series: [ {
- name: '当前',
- type: 'line',
- smooth: true,
- symbolSize: 0,
- itemStyle: {
- normal: {
- // color: '#4293FD',
- lineStyle: {
- // color: '#4293FD',
- width: 1
- }
- }
- },
- areaStyle: {
- normal: {
- color: new graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#FFD35D66'
- },
- {
- offset: 0.5,
- color: '#7ec2f366'
- },
- {
- offset: 1,
- color: '#189066'
- }
- ], false)
- }
- },
- data: [ 120, 132, 101, 134, 90, 230, 210, 182, 191, 234, 290, 330 ]
- },
- {
- name: '环比',
- type: 'line',
- smooth: true,
- symbolSize: 0,
- itemStyle: {
- normal: {
- // color: '#23D0C4',
- lineStyle: {
- // color: '#23D0C4',
- width: 1
- }
- }
- },
- areaStyle: {
- normal: {
- color: new graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#6A5BF066'
- },
- {
- offset: 0.5,
- color: '#7ec2f366'
- },
- {
- offset: 1,
- color: '#1890ff66'
- }
- ], false)
- }
- },
- data: [ 220, 182, 191, 234, 290, 330, 310, 201, 154, 190, 330, 410 ]
- },
- {
- name: '同比',
- type: 'line',
- smooth: true,
- symbolSize: 0,
- itemStyle: {
- normal: {
- // color: '#23D0C4',
- lineStyle: {
- // color: '#23D0C4',
- width: 1
- }
- }
- },
- areaStyle: {
- normal: {
- color: new graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#2ECC7166'
- },
- {
- offset: 0.5,
- color: '#7ec2f366'
- },
- {
- offset: 1,
- color: '#1890ff66'
- }
- ], false)
- }
- },
- data: [ 220, 182, 191, 234, 290, 330, 310, 201, 154, 190, 330, 410 ]
- }
- ],
- dataZoom: {}
- }
- })
- const passengerFlowService = new PassengerFlowService()
- async function getTrafficAreaFlow() {
- const res = await passengerFlowService.getTrafficAreaFlow()
- leftContent.value.tCharts[0].option!.series[0].data = res.map((item: any) => ({
- name: item.area, value: item.total
- }))
- leftContent.value.tCharts[0].option.title!.subtext = res.reduce((prev: any, item: { total: number }) => {
- prev += item.total
- return prev
- }, 0)
- leftContent.value.tCharts[1].option!.xAxis!.data = res.map((item: any) => (item.area))
- leftContent.value.tCharts[1].option!.series[0]!.data = res.map((item: any) => (item.total))
- }
- getTrafficAreaFlow()
- async function getTrafficRidingDistance() {
- const res = await passengerFlowService.getTrafficRidingDistance()
- leftContent.value.bCharts[2].option!.series[0].data = res.map((item: { ridingDistance: any; number: any }) => ({
- name: item.ridingDistance, value: item.number
- }))
- }
- getTrafficRidingDistance()
- async function getTrafficTransferProportion() {
- const res = await passengerFlowService.getTrafficTransferProportion()
- leftContent.value.bCharts[4].option!.series[0].data = res.map((item: { transferType: any; number: any }) => ({
- name: item.transferType, value: item.number
- }))
- }
- getTrafficTransferProportion()
- async function getTrafficTypeNumber() {
- const res = await passengerFlowService.getTrafficTypeNumber()
- leftContent.value.bCharts[0].option!.series[0].data = res.map((item: any) => ({
- name: item.lineType, value: item.number
- }))
- }
- getTrafficTypeNumber()
- async function getTrafficCommutingTime() {
- const res = await passengerFlowService.getTrafficCommutingTime()
- leftContent.value.bCharts[3].option!.series[0].data = res.map((item: any) => ({
- name: item.commutingType, value: item.number
- }))
- }
- getTrafficCommutingTime()
- async function getTrafficConsumeType() {
- const res = await passengerFlowService.getTrafficConsumeType()
- leftContent.value.bCharts[1].option!.series[0].data = res.map((item: any) => ({
- name: item.consumeType, value: item.number
- }))
- leftContent.value.bCharts[1].option!.title!.subtext = res.reduce((prev: any, item: { number: number }) => {
- prev += item.number
- return prev
- }, 0)
- }
- getTrafficConsumeType()
- async function getTrafficFlowRank() {
- const res = await passengerFlowService.getTrafficFlowRank()
- const yAxisData = res.map((item: any) => item.lineName)
- const seriesData = res.map((item: any) => item.trafficVolume)
- rightContent.value.top1!.yAxis[0].data = yAxisData
- rightContent.value.top1!.series[0].data = seriesData
- }
- getTrafficFlowRank()
- </script>
- <style lang="scss" scoped>
- .left {
- &-top {
- :deep(.box-content) {
- display: flex;
- justify-content: space-between;
- }
- }
- &-bottom {
- display: flex;
- justify-content: space-between;
- flex-wrap: wrap;
- gap: 10px;
- :deep(.box-content) {
- position: relative;
- }
- .lineList {
- padding: 25px;
- display: flex;
- flex-wrap: wrap;
- gap: 15px;
- height: 335px;
- overflow: hidden;
- .line {
- width: 100%;
- display: flex;
- align-items: center;
- font-size: 24px;
- color: #fff;
- .index {
- width: 45px;
- height: 45px;
- line-height: 45px;
- text-align: center;
- border-radius: 50%;
- border: 1px solid #00FFFF;
- background-color: rgba(0, 191, 191, 0.3);
- &.index0 {
- border: 1px solid #FFFF00;
- background-color: rgba(255, 255, 0, 0.3);
- }
- &.index1 {
- border: 1px solid #F2F2F2;
- background: rgba(242, 242, 242, 0.298);
- }
- &.index2 {
- border: 1px solid #FAAD0E;
- background: rgba(250, 173, 14, 0.298);
- }
- }
- .name {
- margin: 0 50px 0 15px;
- text-shadow: 1px 1px 5px rgba(0, 255, 255, 0.8);
- }
- .content {
- color: #80FFFF;
- font-size: 20px;
- }
- }
- }
- }
- }
- .right {
- &-top {
- display: flex;
- gap: 10px;
- // justify-content: space-between;
- }
- }
- </style>
|