You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
2.5 KiB
TypeScript
71 lines
2.5 KiB
TypeScript
import type { MockMethod } from './types'
|
|
|
|
const mock: MockMethod[] = [
|
|
{
|
|
url: '/mock-api/admin/dashboard/summary',
|
|
method: 'get',
|
|
response: {
|
|
code: 0,
|
|
data: {
|
|
onlineCount: 142,
|
|
totalMachines: 160,
|
|
todayProduction: 2847,
|
|
activeAlerts: 3,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
url: '/mock-api/admin/collector/status',
|
|
method: 'get',
|
|
response: {
|
|
code: 0,
|
|
data: {
|
|
status: 'running',
|
|
uptimeSeconds: 316800,
|
|
lastCollectTime: '2026-04-25T17:36:38',
|
|
successCount: 1280,
|
|
failCount: 5,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
url: '/mock-api/admin/dashboard/machine-rank',
|
|
method: 'get',
|
|
response: {
|
|
code: 0,
|
|
data: {
|
|
items: [
|
|
{ rank: 1, machineId: 1, machineName: '西-1.8', program: '1566.NC', quantity: 580, status: 1 },
|
|
{ rank: 2, machineId: 2, machineName: '西-1.10', program: 'O123.NC', quantity: 420, status: 1 },
|
|
{ rank: 3, machineId: 3, machineName: '东-2.0', program: 'A456.NC', quantity: 380, status: 1 },
|
|
{ rank: 4, machineId: 4, machineName: '东-2.5', program: 'B789.NC', quantity: 310, status: 0 },
|
|
{ rank: 5, machineId: 5, machineName: '南-3.1', program: 'C012.NC', quantity: 290, status: 1 },
|
|
{ rank: 6, machineId: 6, machineName: '南-3.2', program: 'D345.NC', quantity: 240, status: 1 },
|
|
{ rank: 7, machineId: 7, machineName: '北-4.0', program: 'E678.NC', quantity: 210, status: 1 },
|
|
{ rank: 8, machineId: 8, machineName: '北-4.1', program: 'F901.NC', quantity: 180, status: 0 },
|
|
{ rank: 9, machineId: 9, machineName: '西-1.5', program: 'G234.NC', quantity: 150, status: 1 },
|
|
{ rank: 10, machineId: 10, machineName: '东-2.8', program: 'H567.NC', quantity: 87, status: 1 },
|
|
],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
url: '/mock-api/admin/dashboard/worker-rank',
|
|
method: 'get',
|
|
response: {
|
|
code: 0,
|
|
data: {
|
|
items: [
|
|
{ rank: 1, workerId: 1, workerName: '张三', machineCount: 3, totalQuantity: 1240 },
|
|
{ rank: 2, workerId: 2, workerName: '李四', machineCount: 2, totalQuantity: 980 },
|
|
{ rank: 3, workerId: 3, workerName: '王五', machineCount: 4, totalQuantity: 870 },
|
|
{ rank: 4, workerId: 4, workerName: '赵六', machineCount: 2, totalQuantity: 650 },
|
|
{ rank: 5, workerId: 5, workerName: '孙七', machineCount: 3, totalQuantity: 520 },
|
|
],
|
|
},
|
|
},
|
|
},
|
|
]
|
|
|
|
export default mock
|