const mockDataList = { // 获取个人中心数据 'getPersonCards': { method: 'get', url: '/prod-api/crm/getPersonCards', delay: 300, response: { code: 200, msg: 'success', data: { todayConsume: 1234.56,//今日消耗 todayPerformance: 56789.01,//今日业绩 countTypeA: 25,//条数统计A类 countTypeB: 12,//条数统计B类 countTypeC: 8,//条数统计C类 visitCount: 15,//上门 visitRate: 85.5,//上门率 dealRate: 42.3,//成交率 roi: 3.25,//投产比 beatRate: 78.9,//击败率 level: '高级',//等级 score: 'A'//评分 } } }, // 个人中心-获取最新线索 'getPersonLatestClue': { method: 'get', url: '/prod-api/crm/getPersonLatestClue', delay: 300, response: { code: 200, msg: 'success', data: [ { id:1, name:'张三',//客户名称 star:3,//客户等级 prodTitle:'LV 发财桶',//产品名称 desc:'客户说价格有点低'//客户描述 }, { id:2, name:'李四',//客户名称 star:3,//客户等级 prodTitle:'LV 发财桶',//产品名称 desc:'客户说价格有点低'//客户描述 }, { id:3, name:'张三',//客户名称 star:3,//客户等级 prodTitle:'LV 发财桶',//产品名称 desc:'客户说价格有点低'//客户描述 }, ] } }, // 个人中心-近七天排名折线图 'getPersonRanking': { method: 'get', url: '/prod-api/crm/getPersonRanking', delay: 300, response: { code: 200, msg: 'success', data: [ { x: '2026-1-1',//x轴日期 y: 80,//y轴value }, { x: '2026-1-2', y: 12, }, { x: '2026-1-3', y: 33, }, { x: '2026-1-4',//日期 y: 94, }, { x: '2026-1-5',//日期 y: 45, }, ] } }, // 个人中心-仓库卡片数据 'getWareHouseCard': { method: 'get', url: '/prod-api/crm/getWareHouseCard', delay: 300, response: { code: 200, msg: 'success', data: { totalCost: 12456.5,//总资产成本 uploadCostToday: 5678,//今日上传 outStockToday: 12,//今日出库 totalNum: 1235,//总条数 } } }, }; function getMockDataList() { return mockDataList; } function addMockData(key, config) { mockDataList[key] = config; console.log(`[Mock] 新增Mock接口: ${key}`); return true; } function removeMockData(key) { if (mockDataList[key]) { delete mockDataList[key]; console.log(`[Mock] 删除Mock接口: ${key}`); return true; } return false; } function getMockData(key) { return mockDataList[key] || null; } module.exports = { getMockDataList, addMockData, removeMockData, getMockData, mockDataList };