table.js 567 B

12345678910111213141516171819202122232425262728293031
  1. const Mock = require('mockjs')
  2. const data = Mock.mock({
  3. 'items|30': [
  4. {
  5. id: '@id',
  6. title: '@sentence(10, 20)',
  7. 'status|1': ['published', 'draft', 'deleted'],
  8. author: 'name',
  9. display_time: '@datetime',
  10. pageviews: '@integer(300, 5000)'
  11. }
  12. ]
  13. })
  14. module.exports = [
  15. {
  16. url: '/vue-admin-template/table/list',
  17. type: 'get',
  18. response: config => {
  19. const items = data.items
  20. return {
  21. code: 20000,
  22. data: {
  23. total: items.length,
  24. items: items
  25. }
  26. }
  27. }
  28. }
  29. ]