config.ts 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import { ConfigVO } from '@/api/interface/system/config'
  2. import http from '@/api'
  3. /**
  4. * @name 根据参数键名查询参数值
  5. * @param ossConfigId ossConfigId
  6. * @returns returns
  7. */
  8. export const getConfigKeyApi = (configKey: string) => {
  9. return http.get<ConfigVO>(`/system/config/configKey/${configKey}`)
  10. }
  11. /**
  12. * @name 查询参数配置列表
  13. * @param query 参数
  14. * @returns 返回列表
  15. */
  16. export const listConfigApi = (query: any) => {
  17. return http.get<any>('/system/config/list', query, { loading: true })
  18. }
  19. /**
  20. * @name 查询参数配置详细
  21. * @param configId configId
  22. * @returns returns
  23. */
  24. export const getConfigApi = (configId: any) => {
  25. return http.get<any>(`/system/config/${configId}`)
  26. }
  27. /**
  28. * @name 新增参数配置
  29. * @param data data
  30. * @returns returns
  31. */
  32. export const addConfigApi = (data: any) => {
  33. return http.post<any>('/system/config', data, { loading: false })
  34. }
  35. /**
  36. * @name 修改参数配置
  37. * @param data data
  38. * @returns returns
  39. */
  40. export const updateConfigApi = (data: any) => {
  41. return http.put<any>('/system/config', data, { loading: false })
  42. }
  43. /**
  44. * @name 修改参数配置
  45. * @param data data
  46. * @returns returns
  47. */
  48. export const updateConfigByKeyApi = (data: any) => {
  49. return http.put<any>('/system/config/updateByKey', data, { loading: false })
  50. }
  51. /**
  52. * @name 删除参数配置
  53. * @param configId configId
  54. * @returns returns
  55. */
  56. export const delConfigApi = (configId: any) => {
  57. return http.delete<any>(`/system/config/${configId}`)
  58. }
  59. /**
  60. * @name 下载模板
  61. * @returns returns
  62. */
  63. export const importTemplateApi = () => {
  64. return http.downloadPost('/system/config/importTemplate', {})
  65. }
  66. /**
  67. * @name 导入数据
  68. * @returns returns
  69. */
  70. export const importConfigDataApi = (data: any) => {
  71. return http.post('/system/config/importData', data)
  72. }
  73. /**
  74. * @name 导出数据
  75. * @returns returns
  76. */
  77. export const exportConfigApi = (data: any) => {
  78. return http.downloadPost('/system/config/export', data)
  79. }