map.ts 776 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import { MockMethod } from "vite-plugin-mock";
  2. type mapType = {
  3. plateNumber: string;
  4. driver: string;
  5. "orientation|1-360": number;
  6. "lng|113-114.1-10": number;
  7. "lat|34-35.1-10": number;
  8. };
  9. // http://mockjs.com/examples.html#Object
  10. const mapList = (): Array<mapType> => {
  11. const result: Array<mapType> = [];
  12. for (let index = 0; index < 200; index++) {
  13. result.push({
  14. plateNumber: "豫A@natural(11111, 99999)@character('upper')",
  15. driver: "@cname()",
  16. "orientation|1-360": 100,
  17. "lng|113-114.1-10": 1,
  18. "lat|34-35.1-10": 1
  19. });
  20. }
  21. return result;
  22. };
  23. export default [
  24. {
  25. url: "/getMapInfo",
  26. method: "get",
  27. response: () => {
  28. return {
  29. code: 0,
  30. info: mapList()
  31. };
  32. }
  33. }
  34. ] as MockMethod[];