mockData.js 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. const mockDataList = {
  2. // 获取个人中心数据
  3. '/personCenter/getPersonCards': {
  4. method: 'get',
  5. params: {
  6. userId: '',
  7. },
  8. url: '/prod-api/crm/personCenter/getPersonCards',
  9. delay: 300,
  10. response: {
  11. code: 200,
  12. msg: 'success',
  13. data: {
  14. todayConsume: 1234.56,//今日消耗
  15. todayPerformance: 56789.01,//今日业绩
  16. countTypeA: 25,//条数统计A类
  17. countTypeB: 12,//条数统计B类
  18. countTypeC: 8,//条数统计C类
  19. visitCount: 15,//上门
  20. visitRate: 85.5,//上门率
  21. dealRate: 42.3,//成交率
  22. roi: 3.25,//投产比
  23. beatRate: 78.9,//击败率
  24. level: '高级',//等级
  25. score: 'A'//评分
  26. }
  27. }
  28. },
  29. // 个人中心-获取最新线索
  30. '/personCenter/getPersonLatestClue': {
  31. method: 'get',
  32. params: {
  33. userId: '',
  34. },
  35. url: '/prod-api/crm/personCenter/getPersonLatestClue',
  36. delay: 300,
  37. response: {
  38. code: 200,
  39. msg: 'success',
  40. data: [
  41. {
  42. id:1,
  43. name:'张三',//客户名称
  44. star:3,//客户等级
  45. prodTitle:'LV 发财桶',//产品名称
  46. desc:'客户说价格有点低'//客户描述
  47. },
  48. {
  49. id:2,
  50. name:'李四',//客户名称
  51. star:3,//客户等级
  52. prodTitle:'LV 发财桶',//产品名称
  53. desc:'客户说价格有点低'//客户描述
  54. },
  55. {
  56. id:3,
  57. name:'张三',//客户名称
  58. star:3,//客户等级
  59. prodTitle:'LV 发财桶',//产品名称
  60. desc:'客户说价格有点低'//客户描述
  61. },
  62. ]
  63. }
  64. },
  65. // 个人中心-近七天排名折线图
  66. '/personCenter/getPersonRanking': {
  67. method: 'get',
  68. params: {
  69. userId: '',
  70. },
  71. url: '/prod-api/crm/personCenter/getPersonRanking',
  72. delay: 300,
  73. response: {
  74. code: 200,
  75. msg: 'success',
  76. data: [
  77. {
  78. x: '2026-1-1',//x轴日期
  79. y: 80,//y轴value
  80. },
  81. {
  82. x: '2026-1-2',
  83. y: 12,
  84. },
  85. {
  86. x: '2026-1-3',
  87. y: 33,
  88. },
  89. {
  90. x: '2026-1-4',//日期
  91. y: 94,
  92. },
  93. {
  94. x: '2026-1-5',//日期
  95. y: 45,
  96. },
  97. ]
  98. }
  99. },
  100. // 仓库模块-卡片数据
  101. '/warehouse/getWareHouseCard': {
  102. method: 'get',
  103. params: {
  104. userId: '',
  105. },
  106. url: '/prod-api/crm/warehouse/getWareHouseCard',
  107. delay: 300,
  108. response: {
  109. code: 200,
  110. msg: 'success',
  111. data: {
  112. totalCost: 12456.5,//总资产成本
  113. uploadCostToday: 5678,//今日上传
  114. outStockToday: 12,//今日出库
  115. totalNum: 1235,//总条数
  116. }
  117. }
  118. },
  119. // 询价-新增
  120. '/inquiryCenter/addInquiry': {
  121. method: 'post',
  122. data: {
  123. clueId:'',//线索公海id
  124. dictValue:'',//品牌id
  125. dictLabel:'',//品牌名称
  126. model:'',//型号
  127. code:'',//编码
  128. id:'',//询价id,新增为'',编辑传值
  129. price:'',//询价价格,新增为'',编辑传值
  130. imgsUrl:[]//询价图片数组,比如
  131. // [
  132. // "https://xiaohulu-crm.oss-cn-shanghai.aliyuncs.com/crm/2026/01/06/1767677335839-1767677330379.jpg",
  133. // "https://xiaohulu-crm.oss-cn-shanghai.aliyuncs.com/crm/2026/01/06/1767677342956-1767677338014.jpg"
  134. // ]
  135. },
  136. url: '/prod-api/crm/inquiryCenter/addInquiry',
  137. delay: 300,
  138. response: {
  139. code: 200,
  140. msg: 'success'
  141. }
  142. },
  143. // 询价-核价-列表
  144. '/inquiryCenter/inquiryVerificationList': {
  145. method: 'post',
  146. params: {
  147. pageSize:'',//每页条数
  148. pageNum:'',//当前页
  149. },
  150. data:{
  151. type:1,//1-询价列表 2-核价列表
  152. },
  153. url: '/prod-api/crm/inquiryCenter/inquiryVerificationList',
  154. delay: 300,
  155. response: {
  156. code: 200,
  157. msg: 'success',
  158. rows: [
  159. {
  160. clueId:'',//线索公海id
  161. id:'',//询价id
  162. dictValue:'2',//品牌id
  163. dictLabel:'Rolex',//品牌名称
  164. model:'Submariner Date 126610LN',//型号
  165. code:'123',//编码
  166. price:'12345',//询价价格
  167. desc:'意向',
  168. date:'2026-2-1 10:00:00',//询价日期
  169. status:'1',//询价列表:1-待询价 2-询价完成; 核价列表:1-待核价 2-核价完成
  170. imgsUrl:['https://xiaohulu-crm.oss-cn-shanghai.aliyuncs.com/crm/2026/01/06/1767677335839-1767677330379.jpg','https://xiaohulu-crm.oss-cn-shanghai.aliyuncs.com/crm/2026/01/06/1767677335839-1767677330379.jpg']//询价图片数组
  171. },
  172. {
  173. clueId:'',//线索公海id
  174. id:'',//询价id
  175. dictValue:'2',//品牌id
  176. dictLabel:'Rolex',//品牌名称
  177. model:'Submariner Date 126610LN',//型号
  178. code:'123',//编码
  179. price:'12345',//询价价格
  180. desc:'意向',
  181. date:'2026-2-1 10:00:00',//询价日期
  182. status:'1',//询价列表:1-待询价 2-询价完成; 核价列表:1-待核价 2-核价完成
  183. imgsUrl:['https://xiaohulu-crm.oss-cn-shanghai.aliyuncs.com/crm/2026/01/06/1767677335839-1767677330379.jpg','https://xiaohulu-crm.oss-cn-shanghai.aliyuncs.com/crm/2026/01/06/1767677335839-1767677330379.jpg']//询价图片数组
  184. },
  185. {
  186. clueId:'',//线索公海id
  187. id:'',//询价id
  188. dictValue:'2',//品牌id
  189. dictLabel:'Rolex',//品牌名称
  190. model:'Submariner Date 126610LN',//型号
  191. code:'123',//编码
  192. price:'12345',//询价价格
  193. desc:'意向',
  194. date:'2026-2-1 10:00:00',//询价日期
  195. status:'1',//询价列表:1-待询价 2-询价完成; 核价列表:1-待核价 2-核价完成
  196. imgsUrl:['https://xiaohulu-crm.oss-cn-shanghai.aliyuncs.com/crm/2026/01/06/1767677335839-1767677330379.jpg','https://xiaohulu-crm.oss-cn-shanghai.aliyuncs.com/crm/2026/01/06/1767677335839-1767677330379.jpg']//询价图片数组
  197. },
  198. {
  199. clueId:'',//线索公海id
  200. id:'',//询价id
  201. dictValue:'2',//品牌id
  202. dictLabel:'Rolex',//品牌名称
  203. model:'Submariner Date 126610LN',//型号
  204. code:'123',//编码
  205. price:'12345',//询价价格
  206. desc:'意向',
  207. date:'2026-2-1 10:00:00',//询价日期
  208. status:'1',//询价列表:1-待询价 2-询价完成; 核价列表:1-待核价 2-核价完成
  209. imgsUrl:['https://xiaohulu-crm.oss-cn-shanghai.aliyuncs.com/crm/2026/01/06/1767677335839-1767677330379.jpg','https://xiaohulu-crm.oss-cn-shanghai.aliyuncs.com/crm/2026/01/06/1767677335839-1767677330379.jpg']//询价图片数组
  210. },
  211. {
  212. clueId:'',//线索公海id
  213. id:'',//询价id
  214. dictValue:'2',//品牌id
  215. dictLabel:'Rolex',//品牌名称
  216. model:'Submariner Date 126610LN',//型号
  217. code:'123',//编码
  218. price:'12345',//询价价格
  219. desc:'意向',
  220. date:'2026-2-1 10:00:00',//询价日期
  221. status:'1',//询价列表:1-待询价 2-询价完成; 核价列表:1-待核价 2-核价完成
  222. imgsUrl:['https://xiaohulu-crm.oss-cn-shanghai.aliyuncs.com/crm/2026/01/06/1767677335839-1767677330379.jpg','https://xiaohulu-crm.oss-cn-shanghai.aliyuncs.com/crm/2026/01/06/1767677335839-1767677330379.jpg']//询价图片数组
  223. },
  224. {
  225. clueId:'',//线索公海id
  226. id:'',//询价id
  227. dictValue:'2',//品牌id
  228. dictLabel:'Rolex',//品牌名称
  229. model:'Submariner Date 126610LN',//型号
  230. code:'123',//编码
  231. price:'12345',//询价价格
  232. desc:'意向',
  233. date:'2026-2-1 10:00:00',//询价日期
  234. status:'1',//询价列表:1-待询价 2-询价完成; 核价列表:1-待核价 2-核价完成
  235. imgsUrl:['https://xiaohulu-crm.oss-cn-shanghai.aliyuncs.com/crm/2026/01/06/1767677335839-1767677330379.jpg','https://xiaohulu-crm.oss-cn-shanghai.aliyuncs.com/crm/2026/01/06/1767677335839-1767677330379.jpg']//询价图片数组
  236. },
  237. {
  238. clueId:'',//线索公海id
  239. id:'',//询价id
  240. dictValue:'2',//品牌id
  241. dictLabel:'Rolex',//品牌名称
  242. model:'Submariner Date 126610LN',//型号
  243. code:'123',//编码
  244. price:'12345',//询价价格
  245. desc:'意向',
  246. date:'2026-2-1 10:00:00',//询价日期
  247. status:'1',//询价列表:1-待询价 2-询价完成; 核价列表:1-待核价 2-核价完成
  248. imgsUrl:['https://xiaohulu-crm.oss-cn-shanghai.aliyuncs.com/crm/2026/01/06/1767677335839-1767677330379.jpg','https://xiaohulu-crm.oss-cn-shanghai.aliyuncs.com/crm/2026/01/06/1767677335839-1767677330379.jpg']//询价图片数组
  249. },
  250. ],
  251. total: 14,//总条数
  252. }
  253. }
  254. };
  255. function getMockDataList() {
  256. return mockDataList;
  257. }
  258. function addMockData(key, config) {
  259. mockDataList[key] = config;
  260. console.log(`[Mock] 新增Mock接口: ${key}`);
  261. return true;
  262. }
  263. function removeMockData(key) {
  264. if (mockDataList[key]) {
  265. delete mockDataList[key];
  266. console.log(`[Mock] 删除Mock接口: ${key}`);
  267. return true;
  268. }
  269. return false;
  270. }
  271. function getMockData(key) {
  272. return mockDataList[key] || null;
  273. }
  274. module.exports = {
  275. getMockDataList,
  276. addMockData,
  277. removeMockData,
  278. getMockData,
  279. mockDataList
  280. };