Files
cattleTransportation/pc-cattle-transportation/src/api/datav.js

36 lines
1.4 KiB
JavaScript
Raw Normal View History

2025-12-08 15:24:43 +08:00
import request from '@/utils/axios.ts';
/**
* 获取大屏数据
* @returns {Promise}
*/
export function getDatavData() {
// 模拟API响应
return new Promise((resolve) => {
setTimeout(() => {
resolve({
code: 200,
msg: 'success',
data: {
// 运输路线数据:[起点经度, 起点纬度, 终点经度, 终点纬度, 路线名称]
routes: [
{ from: [116.4074, 39.9042], to: [121.4737, 31.2304], name: '北京 -> 上海' },
{ from: [113.2644, 23.1291], to: [116.4074, 39.9042], name: '广州 -> 北京' },
{ from: [87.6168, 43.8256], to: [121.4737, 31.2304], name: '乌鲁木齐 -> 上海' },
{ from: [104.0665, 30.5728], to: [114.3055, 30.5928], name: '成都 -> 武汉' },
{ from: [108.9402, 34.3416], to: [113.6253, 34.7466], name: '西安 -> 郑州' },
{ from: [126.53, 45.80], to: [116.4074, 39.9042], name: '哈尔滨 -> 北京' }
],
// 统计数据
stats: {
totalTransport: 12580,
activeVehicles: 342,
totalDistance: 892300
}
}
});
}, 500);
});
}