system.ts 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. import { MockMethod } from "vite-plugin-mock";
  2. export default [
  3. // 角色
  4. {
  5. url: "/role",
  6. method: "post",
  7. response: () => {
  8. return {
  9. success: true,
  10. data: {
  11. list: [
  12. {
  13. createTime: 1605456000000,
  14. updateTime: 1645477701000,
  15. creator: "admin",
  16. updater: "",
  17. deleted: false,
  18. tenantId: 1,
  19. id: 1,
  20. name: "超级管理员",
  21. code: "super_admin",
  22. sort: 1,
  23. status: 0,
  24. type: 1,
  25. remark: "超级管理员",
  26. dataScope: 1,
  27. dataScopeDeptIds: null
  28. },
  29. {
  30. createTime: 1605456000000,
  31. updateTime: 1645477700000,
  32. creator: "admin",
  33. updater: "",
  34. deleted: false,
  35. tenantId: 1,
  36. id: 2,
  37. name: "普通角色",
  38. code: "common",
  39. sort: 2,
  40. status: 0,
  41. type: 1,
  42. remark: "普通角色",
  43. dataScope: 2,
  44. dataScopeDeptIds: null
  45. },
  46. {
  47. createTime: 1605456000000,
  48. updateTime: 1647698441000,
  49. creator: "",
  50. updater: "1",
  51. deleted: false,
  52. tenantId: 1,
  53. id: 101,
  54. name: "测试账号",
  55. code: "test",
  56. sort: 0,
  57. status: 0,
  58. type: 2,
  59. remark: "132",
  60. dataScope: 1,
  61. dataScopeDeptIds: []
  62. }
  63. ],
  64. total: 3
  65. }
  66. };
  67. }
  68. },
  69. // 部门
  70. {
  71. url: "/dept",
  72. method: "post",
  73. response: () => {
  74. return {
  75. success: true,
  76. data: [
  77. {
  78. name: "杭州总公司",
  79. parentId: 0,
  80. id: 100,
  81. sort: 0,
  82. phone: "15888888888",
  83. principal: "@cname()",
  84. email: "@email",
  85. status: 1,
  86. type: 1, // 1 公司 2 分公司 3 部门
  87. createTime: 1605456000000,
  88. remark: "@cparagraph(1, 3)"
  89. },
  90. {
  91. name: "郑州分公司",
  92. parentId: 100,
  93. id: 101,
  94. sort: 1,
  95. phone: "15888888888",
  96. principal: "@cname()",
  97. email: "@email",
  98. status: 1,
  99. type: 2,
  100. createTime: 1605456000000,
  101. remark: "@cparagraph(1, 3)"
  102. },
  103. {
  104. name: "研发部门",
  105. parentId: 101,
  106. id: 103,
  107. sort: 1,
  108. phone: "15888888888",
  109. principal: "@cname()",
  110. email: "@email",
  111. status: 1,
  112. type: 3,
  113. createTime: 1605456000000,
  114. remark: "@cparagraph(1, 3)"
  115. },
  116. {
  117. name: "市场部门",
  118. parentId: 102,
  119. id: 108,
  120. sort: 1,
  121. phone: "15888888888",
  122. principal: "@cname()",
  123. email: "@email",
  124. status: 1,
  125. type: 3,
  126. createTime: 1605456000000,
  127. remark: "@cparagraph(1, 3)"
  128. },
  129. {
  130. name: "深圳分公司",
  131. parentId: 100,
  132. id: 102,
  133. sort: 2,
  134. phone: "15888888888",
  135. principal: "@cname()",
  136. email: "@email",
  137. status: 1,
  138. type: 2,
  139. createTime: 1605456000000,
  140. remark: "@cparagraph(1, 3)"
  141. },
  142. {
  143. name: "市场部门",
  144. parentId: 101,
  145. id: 104,
  146. sort: 2,
  147. phone: "15888888888",
  148. principal: "@cname()",
  149. email: "@email",
  150. status: 1,
  151. type: 3,
  152. createTime: 1605456000000,
  153. remark: "@cparagraph(1, 3)"
  154. },
  155. {
  156. name: "财务部门",
  157. parentId: 102,
  158. id: 109,
  159. sort: 2,
  160. phone: "15888888888",
  161. principal: "@cname()",
  162. email: "@email",
  163. status: 1,
  164. type: 3,
  165. createTime: 1605456000000,
  166. remark: "@cparagraph(1, 3)"
  167. },
  168. {
  169. name: "测试部门",
  170. parentId: 101,
  171. id: 105,
  172. sort: 3,
  173. phone: "15888888888",
  174. principal: "@cname()",
  175. email: "@email",
  176. status: 0,
  177. type: 3,
  178. createTime: 1605456000000,
  179. remark: "@cparagraph(1, 3)"
  180. },
  181. {
  182. name: "财务部门",
  183. parentId: 101,
  184. id: 106,
  185. sort: 4,
  186. phone: "15888888888",
  187. principal: "@cname()",
  188. email: "@email",
  189. status: 1,
  190. type: 3,
  191. createTime: 1605456000000,
  192. remark: "@cparagraph(1, 3)"
  193. },
  194. {
  195. name: "运维部门",
  196. parentId: 101,
  197. id: 107,
  198. sort: 5,
  199. phone: "15888888888",
  200. principal: "@cname()",
  201. email: "@email",
  202. status: 0,
  203. type: 3,
  204. createTime: 1605456000000,
  205. remark: "@cparagraph(1, 3)"
  206. }
  207. ]
  208. };
  209. }
  210. },
  211. // 用户
  212. {
  213. url: "/user",
  214. method: "post",
  215. response: () => {
  216. return {
  217. success: true,
  218. data: {
  219. list: [
  220. {
  221. username: "admin",
  222. nickname: "admin",
  223. remark: "管理员",
  224. deptId: 103,
  225. postIds: [1],
  226. mobile: "15888888888",
  227. sex: 0,
  228. id: 1,
  229. status: 0,
  230. createTime: 1605456000000,
  231. dept: {
  232. id: 103,
  233. name: "研发部门"
  234. }
  235. },
  236. {
  237. username: "pure",
  238. nickname: "pure",
  239. remark: "不要吓我",
  240. deptId: 104,
  241. postIds: [1],
  242. mobile: "15888888888",
  243. sex: 0,
  244. id: 100,
  245. status: 1,
  246. createTime: 1605456000000,
  247. dept: {
  248. id: 104,
  249. name: "市场部门"
  250. }
  251. },
  252. {
  253. username: "小姐姐",
  254. nickname: "girl",
  255. remark: null,
  256. deptId: 106,
  257. postIds: null,
  258. mobile: "15888888888",
  259. sex: 1,
  260. id: 103,
  261. status: 1,
  262. createTime: 1605456000000,
  263. dept: {
  264. id: 106,
  265. name: "财务部门"
  266. }
  267. },
  268. {
  269. username: "小哥哥",
  270. nickname: "boy",
  271. remark: null,
  272. deptId: 107,
  273. postIds: [],
  274. mobile: "15888888888",
  275. sex: 0,
  276. id: 104,
  277. status: 0,
  278. createTime: 1605456000000,
  279. dept: {
  280. id: 107,
  281. name: "运维部门"
  282. }
  283. }
  284. ],
  285. total: 4
  286. }
  287. };
  288. }
  289. }
  290. ] as MockMethod[];