welcome.ts 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * @Author:
  3. * @Date: 2023-09-27 14:33:29
  4. * @LastEditors: Please set LastEditors
  5. * @LastEditTime: 2024-01-03 17:28:27
  6. * @Description: tel files
  7. * @filePath:
  8. */
  9. // 根据角色动态生成路由
  10. import { MockMethod } from "vite-plugin-mock";
  11. export default [
  12. {
  13. url: "/pie",
  14. method: "get",
  15. response: () => {
  16. return {
  17. status: '1',
  18. message: '',
  19. data: [
  20. {
  21. name: '数据1',
  22. value: 100
  23. },
  24. {
  25. name: '数据2',
  26. value: 125
  27. },
  28. {
  29. name: '数据3',
  30. value: 635
  31. },
  32. ]
  33. };
  34. }
  35. },
  36. {
  37. url: "/line",
  38. method: "get",
  39. response: () => {
  40. return {
  41. status: '1',
  42. message: '',
  43. data: [
  44. {
  45. name: '数据1',
  46. data: [
  47. 509, 917, 2455, 2610, 2719, 3033, 3044, 3085, 2708, 2809, 2117, 2000, 1455, 1210, 719, 733, 944, 2285, 2208, 3372, 3936, 3693, 2962, 2810, 3519, 2455, 2610, 2719, 2484, 2078]
  48. },
  49. {
  50. name: '数据2',
  51. data: [
  52. 2136, 3693, 2962, 3810, 3519, 3484, 3915, 3823, 3455, 4310, 4019, 3433, 3544, 3885, 4208, 3372, 3484, 3915, 3748, 3675, 4009, 4433, 3544, 3285, 4208, 3372, 3484, 3915, 3823, 4265, 4298
  53. ]
  54. },
  55. {
  56. name: '数据3',
  57. data: [
  58. 1361, 2693, 5962, 3810, 3519, 3484, 3915, 3823, 3455, 4310, 4019, 4332, 3544, 3885, 4208, 3372, 3484, 3915, 3748, 3675, 4009, 4433, 3544, 3283, 4208, 3372, 3484, 3915, 3823, 4265, 4298
  59. ]
  60. }
  61. ]
  62. };
  63. }
  64. },
  65. {
  66. url: "/bar",
  67. method: "get",
  68. response: () => {
  69. return {
  70. status: '1',
  71. message: '',
  72. data: [
  73. { name: '数据1', data: [100, 500, 1000], date: ["2021", "2022", "2023"] },
  74. { name: '数据2', data: [10, 50, 100], date: ["2021", "2022", "2023"] },
  75. { name: '数据3', data: [80, 130, 600], date: ["2021", "2022", "2023"] },
  76. ]
  77. };
  78. }
  79. },
  80. {
  81. url: "/list",
  82. method: "get",
  83. response: () => {
  84. return {
  85. status: '1',
  86. message: '',
  87. data: [
  88. { content: '这是第一条', date: '2024/01/01 00:00:15' },
  89. { content: '这是第二条', date: '2024/01/02 10:30:57' },
  90. { content: '这是第三条', date: '2024/01/03 11:08:29' },
  91. ]
  92. };
  93. }
  94. },
  95. ] as MockMethod[];