index.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import request from '@/config/axios'
  2. export interface ConfigVO {
  3. id: number | undefined
  4. category: string
  5. name: string
  6. key: string
  7. value: string
  8. type: number
  9. visible: boolean
  10. remark: string
  11. createTime: Date
  12. }
  13. // 查询参数列表
  14. export const getConfigPage = (params: PageParam) => {
  15. return request.get({ url: '/infra/config/page', params })
  16. }
  17. // 查询参数详情
  18. export const getConfig = (id: number) => {
  19. return request.get({ url: '/infra/config/get?id=' + id })
  20. }
  21. // 根据参数键名查询参数值
  22. export const getConfigKey = (configKey: string) => {
  23. return request.get({ url: '/infra/config/get-value-by-key?key=' + configKey })
  24. }
  25. // 新增参数
  26. export const createConfig = (data: ConfigVO) => {
  27. return request.post({ url: '/infra/config/create', data })
  28. }
  29. // 修改参数
  30. export const updateConfig = (data: ConfigVO) => {
  31. return request.put({ url: '/infra/config/update', data })
  32. }
  33. // 删除参数
  34. export const deleteConfig = (id: number) => {
  35. return request.delete({ url: '/infra/config/delete?id=' + id })
  36. }
  37. // 导出参数
  38. export const exportConfig = (params) => {
  39. return request.download({ url: '/infra/config/export', params })
  40. }