table.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. const { config } = require('./common')
  2. const { apiPrefix } = config;
  3. let database = {
  4. "items": [
  5. {
  6. "id": 1,
  7. "field-text": "文本1",
  8. "field-number": 10,
  9. "field-float": 11.11,
  10. "field-switch": "true",
  11. "field-dropdown": "1",
  12. "field-multi": "1,2",
  13. "field-cascader": "16",
  14. "field-img": "",
  15. "field-imgs": "",
  16. "field-file": "aa.doc",
  17. "field-files": "",
  18. "field-datetime": "2017-12-01 17:53:04",
  19. "field-richtext": "sss"
  20. },
  21. {
  22. "id": 2,
  23. "field-text": "文本2",
  24. "field-number": 20,
  25. "field-float": 22.22,
  26. "field-switch": "true",
  27. "field-dropdown": "2",
  28. "field-multi": "2,3",
  29. "field-cascader": "14",
  30. "field-img": "",
  31. "field-imgs": "",
  32. "field-file": "aa.docx",
  33. "field-files": "",
  34. "field-datetime": "2017-12-01 17:53:04",
  35. "field-richtext": "wwww"
  36. },
  37. {
  38. "id": 3,
  39. "field-text": "文本3",
  40. "field-number": 30,
  41. "field-float": 33.33,
  42. "field-switch": "false",
  43. "field-dropdown": "4",
  44. "field-multi": "1,2,4",
  45. "field-cascader": "21",
  46. "field-img": "",
  47. "field-imgs": "",
  48. "field-file": "aa.xls",
  49. "field-files": "",
  50. "field-datetime": "2017-12-01 17:53:04",
  51. "field-richtext": "33333"
  52. },
  53. {
  54. "id": 4,
  55. "field-text": "文本4",
  56. "field-number": 40,
  57. "field-float": 44.44,
  58. "field-switch": "false",
  59. "field-dropdown": "3",
  60. "field-multi": "1,2,3,4",
  61. "field-cascader": "13",
  62. "field-img": "",
  63. "field-imgs": "",
  64. "field-file": "aa.xlsx",
  65. "field-files": "",
  66. "field-datetime": "2017-12-01 17:53:04",
  67. "field-richtext": "44444"
  68. },
  69. {
  70. "id": 5,
  71. "field-text": "文本5",
  72. "field-number": 50,
  73. "field-float": 55.55,
  74. "field-switch": "true",
  75. "field-dropdown": "1",
  76. "field-multi": "2,3",
  77. "field-cascader": "15",
  78. "field-img": "",
  79. "field-imgs": "",
  80. "field-file": "aa.ppt",
  81. "field-files": "",
  82. "field-datetime": "2017-12-01 17:53:04",
  83. "field-richtext": "5555"
  84. },
  85. {
  86. "id": 6,
  87. "field-text": "文本6",
  88. "field-number": 60,
  89. "field-float": 66.66,
  90. "field-switch": "false",
  91. "field-dropdown": "3",
  92. "field-multi": "1,2,3,4",
  93. "field-cascader": "12",
  94. "field-img": "",
  95. "field-imgs": "",
  96. "field-file": "aa.pptx",
  97. "field-files": "",
  98. "field-datetime": "2017-12-01 17:53:04",
  99. "field-richtext": "6666"
  100. },
  101. {
  102. "id": 7,
  103. "field-text": "文本7",
  104. "field-number": 70,
  105. "field-float": 77.77,
  106. "field-switch": "true",
  107. "field-dropdown": "1",
  108. "field-multi": "1,2",
  109. "field-cascader": "17",
  110. "field-img": "",
  111. "field-imgs": "",
  112. "field-file": "aa.pdf",
  113. "field-files": "",
  114. "field-datetime": "2017-12-01 17:53:04",
  115. "field-richtext": "7777"
  116. },
  117. {
  118. "id": 8,
  119. "field-text": "文本8",
  120. "field-number": 80,
  121. "field-float": 88.88,
  122. "field-switch": "false",
  123. "field-dropdown": "1",
  124. "field-multi": "1,2,4",
  125. "field-cascader": "16",
  126. "field-img": "",
  127. "field-imgs": "",
  128. "field-file": "aa.txt",
  129. "field-files": "",
  130. "field-datetime": "2017-12-01 17:53:04",
  131. "field-richtext": "8888"
  132. },
  133. {
  134. "id": 9,
  135. "field-text": "文本9",
  136. "field-number": 90,
  137. "field-float": 99.99,
  138. "field-switch": "true",
  139. "field-dropdown": "1",
  140. "field-multi": "2,4",
  141. "field-cascader": "13",
  142. "field-img": "",
  143. "field-imgs": "",
  144. "field-file": "",
  145. "field-files": "",
  146. "field-datetime": "2017-12-01 17:53:04",
  147. "field-richtext": "9999"
  148. }
  149. ],
  150. "sum": {
  151. "field-number": 450,
  152. "field-float": 499.95
  153. },
  154. "totalCount": "9"
  155. };
  156. export default {
  157. [`POST ${apiPrefix}/table`](req, res) {
  158. res.status(200).json(database)
  159. },
  160. }