mockData.ts 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. export function tableSchema(ds: string): any {
  2. const data = [
  3. {
  4. field: '字段1',
  5. type: 'string',
  6. length: 120
  7. },
  8. {
  9. field: '字段2',
  10. type: 'string',
  11. length: 120
  12. },
  13. {
  14. field: '字段3',
  15. type: 'string',
  16. length: 120
  17. },
  18. {
  19. field: '字段4',
  20. type: 'string',
  21. length: 120
  22. },
  23. {
  24. field: '字段5',
  25. type: 'string',
  26. length: 120
  27. },
  28. {
  29. field: '字段6',
  30. type: 'int',
  31. length: 120
  32. },
  33. {
  34. field: '字段7',
  35. type: 'string',
  36. length: 120
  37. },
  38. {
  39. field: '字段8',
  40. type: 'date',
  41. length: 120
  42. }
  43. ];
  44. if (ds === 'mysql') {
  45. return data.slice(0, data.length - 2);
  46. } else {
  47. return data;
  48. }
  49. }
  50. export function tableNames(ds: string): string[] {
  51. const data = ['表1', '表2', '表3', '表4', '表5'];
  52. if (ds === 'mysql') {
  53. return data.slice(0, data.length - 2);
  54. } else {
  55. return data;
  56. }
  57. }