plm前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
1.4 KiB

2 years ago
  1. import Mock from 'mockjs'
  2. // 生成数据列表
  3. var dataList = []
  4. for (let i = 0; i < Math.floor(Math.random() * 10 + 1); i++) {
  5. dataList.push(Mock.mock({
  6. 'id': '@increment',
  7. 'paramKey': '@first',
  8. 'paramValue': '@last',
  9. 'remark': '@csentence'
  10. }))
  11. }
  12. // 获取参数列表
  13. export function list () {
  14. return {
  15. // isOpen: false,
  16. url: '/sys/config/list',
  17. type: 'get',
  18. data: {
  19. 'msg': 'success',
  20. 'code': 0,
  21. 'page': {
  22. 'totalCount': dataList.length,
  23. 'pageSize': 20,
  24. 'totalPage': 1,
  25. 'currPage': 1,
  26. 'list': dataList
  27. }
  28. }
  29. }
  30. }
  31. // 获取参数信息
  32. export function info () {
  33. return {
  34. // isOpen: false,
  35. url: '/sys/config/info',
  36. type: 'get',
  37. data: {
  38. 'msg': 'success',
  39. 'code': 0,
  40. 'config': dataList[0]
  41. }
  42. }
  43. }
  44. // 添加参数
  45. export function add () {
  46. return {
  47. // isOpen: false,
  48. url: '/sys/config/save',
  49. type: 'post',
  50. data: {
  51. 'msg': 'success',
  52. 'code': 0
  53. }
  54. }
  55. }
  56. // 修改参数
  57. export function update () {
  58. return {
  59. // isOpen: false,
  60. url: '/sys/config/update',
  61. type: 'post',
  62. data: {
  63. 'msg': 'success',
  64. 'code': 0
  65. }
  66. }
  67. }
  68. // 删除参数
  69. export function del () {
  70. return {
  71. // isOpen: false,
  72. url: '/sys/config/delete',
  73. type: 'post',
  74. data: {
  75. 'msg': 'success',
  76. 'code': 0
  77. }
  78. }
  79. }