dictService.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. import request from "../../common/request"
  2. import { SYS_PATH as prefix } from "../AppPath";
  3. export default {
  4. queryById: function (id) {
  5. return request({
  6. url: prefix + "/sys/dict/queryById",
  7. method: "get",
  8. params: { id: id },
  9. });
  10. },
  11. save: function (inputForm) {
  12. return request({
  13. url: prefix + "/sys/dict/save",
  14. method: "post",
  15. data: inputForm,
  16. });
  17. },
  18. list: function (params) {
  19. return request({
  20. url: prefix + "/sys/dict/type/list",
  21. method: "get",
  22. params: params,
  23. });
  24. },
  25. delete: function (ids) {
  26. return request({
  27. url: prefix + "/sys/dict/delete",
  28. method: "delete",
  29. params: { ids: ids },
  30. });
  31. },
  32. queryDictValue: function (id) {
  33. return request({
  34. url: prefix + "/sys/dict/queryDictValue",
  35. method: "get",
  36. params: { dictValueId: id },
  37. loading: false,
  38. });
  39. },
  40. saveDictValue: function (inputForm) {
  41. return request({
  42. url: prefix + "/sys/dict/saveDictValue",
  43. method: "post",
  44. data: inputForm,
  45. });
  46. },
  47. getDictValue: function (dictTypeId) {
  48. return request({
  49. url: prefix + "/sys/dict/getDictValue",
  50. method: "get",
  51. params: {
  52. dictTypeId: dictTypeId,
  53. },
  54. });
  55. },
  56. getDictMap: function (dictTypeId) {
  57. return request({
  58. url: prefix + "/sys/dict/getDictMap",
  59. method: "get",
  60. params: {
  61. dictTypeId: dictTypeId,
  62. },
  63. });
  64. },
  65. deleteDictValue: function (ids) {
  66. return request({
  67. url: prefix + "/sys/dict/deleteDictValue",
  68. method: "delete",
  69. params: { ids: ids },
  70. });
  71. },
  72. };