123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- import { Request, Response } from 'express';
-
- const mouthList = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'];
- // chart1 销售额趋势
- const getSalesVolume = (req: Request, res: Response)=>{
- res.json({
- mouthList: mouthList,
- mouthData:[820, 932, 901, 934, 1290, 1330, 1320,820, 932, 1290, 1330, 1320]
- });
- }
-
- // chart2 国外销售额占比
- const getSalesRatio = (req: Request, res: Response)=>{
- res.json({
- data:[
- { value: 1048, name: '国内' },
- { value: 735, name: '国外' },
- ]
- });
- }
-
- // chart3 航司销售额统计(万/年)
- const getSalesStatistics = (req: Request, res: Response)=>{
- res.json({
- nameList: ['厦门航空','西藏航空', '四川航空','吉祥航空','东方航空'].reverse(), // 国内航空名称数据
- nameListAbroad: ['厦门航空','西藏航空', '四川航空','吉祥航空','东方航空'].reverse(), // 国外航空名称数据
- data: [2256, 1223, 1052, 656,456].reverse(), // 航空名称所对应的国内数据
- dataAbroad:[2056, 1023, 852, 456,256].reverse(), // 航空名称所对应的国外数据
- });
- }
-
- // chart4 客单价趋势
- const getUnitPriceTrend = (req: Request, res: Response)=>{
- res.json({
- mouthList: mouthList, // 月份名称数据
- data:[
- {name:'今年',data:[60, 60, 60, 70, 60, 100, 80, 80, 90, 120, 110, 100]},
- {name:'去年',data:[120, 120, 120, 120, 70, 120, 100, 110, 100, 120, 110, 110]},
- ]
- });
- }
-
- // chart5 国内外订单对比
- const getOrderComparison = (req: Request, res: Response)=>{
- res.json({
- data: [
- { value: 40, name: '国际' },
- { value: 60, name: '国内' },
- ]
- });
- }
-
- // chart6 机场排名(国内)
- const getAirportRankingDomestic = (req: Request, res: Response)=>{
- res.json({
- nameList:[ '双流机场', '萧山机场', '虹桥机场', '高崎机场','江北机场'],
- data: [456, 656, 1025, 1223,2256 ]
- });
- }
-
- // chart7 机场排名(国外)
- const getAirportRankingAbroad = (req: Request, res: Response)=>{
- res.json({
- nameList:[ '双流机场', '萧山机场', '虹桥机场', '高崎机场','江北机场'],
- data: [456, 656, 1025, 1223,2256 ]
- });
- }
-
- // chart8 服务类型
- const getServiceTypeData = (req: Request, res: Response)=>{
- res.json({
- data: [
- { value: 31282, name: '机票服务' },
- { value: 23236, name: '酒店服务' },
- { value: 12432, name: '火车票服务' },
- { value: 2645, name: '其他服务' },
- ]
- });
- }
-
- // chart9 用户画像
- const getUserProfile = (req: Request, res: Response)=>{
- res.json({
- mouthList:mouthList,
- data: [
- { data: [100, 302, 301, 334, 390, 330, 320,334, 390, 330, 320, 320], name: '青年' },
- { data: [320, 132, 101, 134, 90, 230, 210, 132, 101, 134, 90, 230, 210], name: '中年' },
- { data: [220, 182, 191, 234, 290, 330, 310, 182, 191, 234, 290, 330, 310], name: '老年' },
- ]
- });
- }
-
- // 大屏数值数据
- const getNumericalData = (req: Request, res: Response)=>{
- res.json({
- totalSalesAmount:24894,
- totalOrder:4404824,
- numberServicePersonnel:2583955,
- numberAirborneCustomers:658879,
- todaySalesVolume :1423253,
- yearSalesVolume :122342,
- todayOrder :1282,
- yearOrder :410240,
- });
- }
-
-
-
- export default {
- 'GET /api/getSalesVolume': getSalesVolume,
- 'GET /api/getSalesRatio': getSalesRatio,
- 'GET /api/getSalesStatistics': getSalesStatistics,
- 'GET /api/getUnitPriceTrend': getUnitPriceTrend,
- 'GET /api/getOrderComparison': getOrderComparison,
- 'GET /api/getAirportRankingDomestic': getAirportRankingDomestic,
- 'GET /api/getAirportRankingAbroad': getAirportRankingAbroad,
- 'GET /api/getServiceTypeData': getServiceTypeData,
- 'GET /api/getUserProfile': getUserProfile,
- 'GET /api/getNumericalData': getNumericalData,
- };
-
|