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.
haoliang-net/frontend/mock/log.ts

22 lines
1.7 KiB
TypeScript

import type { MockMethod } from './types'
const adjustments = [
{ id: 1, createdAt: '2026-04-25T15:30:00', targetTable: 'daily_production', targetId: 3, oldValue: 310, newValue: 320, reason: '传感器计数偏差,手工校准', operatorIp: '192.168.1.5' },
{ id: 2, createdAt: '2026-04-24T10:15:00', targetTable: 'worker_daily_summary', targetId: 12, oldValue: 850, newValue: 900, reason: '漏计补录,夜班产量未计入', operatorIp: '192.168.1.5' },
]
const systemLogs = [
{ id: 1, createdAt: '2026-04-25T17:36:38', logLevel: 'INFO', source: 'CncCollector', message: '采集完成: 32台成功, 0台失败', stackTrace: null, extraData: null },
{ id: 2, createdAt: '2026-04-25T17:35:38', logLevel: 'WARN', source: 'CncCollector', message: '采集失败: 1台超时(fanake_2.5)', stackTrace: null, extraData: null },
{ id: 3, createdAt: '2026-04-25T17:00:00', logLevel: 'ERROR', source: 'CncCollector', message: '连接拒绝: 10.1.2.5', stackTrace: 'System.Net.Http.HttpRequestException: Connection refused', extraData: null },
{ id: 4, createdAt: '2026-04-25T01:00:00', logLevel: 'INFO', source: 'Scheduler', message: '日终汇总完成: 160台, 耗时12秒', stackTrace: null, extraData: null },
]
const mock: MockMethod[] = [
{ url: '/mock-api/admin/log/adjustment', method: 'get', response: () => ({ code: 0, data: { items: adjustments, total: 80, page: 1, pageSize: 20 } }) },
{ url: '/mock-api/admin/log/adjustment/export', method: 'get', response: () => ({ code: 0, data: null }) },
{ url: '/mock-api/admin/log/system', method: 'get', response: () => ({ code: 0, data: { items: systemLogs, total: 5600, page: 1, pageSize: 20 } }) },
]
export default mock