dict.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. import request from '@/router/axios';
  2. export const getList = (current, size, params) => {
  3. return request({
  4. url: '/api/blade-system/dict/list',
  5. method: 'get',
  6. params: {
  7. ...params,
  8. current,
  9. size,
  10. }
  11. })
  12. }
  13. export const getParentList = (current, size, params) => {
  14. return request({
  15. url: '/api/blade-system/dict/parent-list',
  16. method: 'get',
  17. params: {
  18. ...params,
  19. current,
  20. size,
  21. }
  22. })
  23. }
  24. export const getChildList = (current, size, parentId, params) => {
  25. return request({
  26. url: '/api/blade-system/dict/child-list',
  27. method: 'get',
  28. params: {
  29. ...params,
  30. current,
  31. size,
  32. parentId: parentId,
  33. }
  34. })
  35. }
  36. export const remove = (ids) => {
  37. return request({
  38. url: '/api/blade-system/dict/remove',
  39. method: 'post',
  40. params: {
  41. ids,
  42. }
  43. })
  44. }
  45. export const add = (row) => {
  46. return request({
  47. url: '/api/blade-system/dict/submit',
  48. method: 'post',
  49. data: row
  50. })
  51. }
  52. export const update = (row) => {
  53. return request({
  54. url: '/api/blade-system/dict/submit',
  55. method: 'post',
  56. data: row
  57. })
  58. }
  59. export const getDict = (id) => {
  60. return request({
  61. url: '/api/blade-system/dict/detail',
  62. method: 'get',
  63. params: {
  64. id,
  65. }
  66. })
  67. }
  68. export const getDictTree = () => {
  69. return request({
  70. url: '/api/blade-system/dict/tree?code=DICT',
  71. method: 'get'
  72. })
  73. }
  74. export const getDictionary = (params) => {
  75. return request({
  76. url: '/api/blade-system/dict/dictionary',
  77. method: 'get',
  78. params,
  79. })
  80. }