index.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. export interface ConfigExportReqVO {
  14. name?: string
  15. key?: string
  16. type?: number
  17. createTime?: Date[]
  18. }
  19. // 查询参数列表
  20. export const getConfigPage = (params: PageParam) => {
  21. return request.get({ url: '/infra/config/page', params })
  22. }
  23. // 查询参数详情
  24. export const getConfig = (id: number) => {
  25. return request.get({ url: '/infra/config/get?id=' + id })
  26. }
  27. // 根据参数键名查询参数值
  28. export const getConfigKeyApi = (configKey: string) => {
  29. return request.get({ url: '/infra/config/get-value-by-key?key=' + configKey })
  30. }
  31. // 新增参数
  32. export const createConfig = (data: ConfigVO) => {
  33. return request.post({ url: '/infra/config/create', data })
  34. }
  35. // 修改参数
  36. export const updateConfig = (data: ConfigVO) => {
  37. return request.put({ url: '/infra/config/update', data })
  38. }
  39. // 删除参数
  40. export const deleteConfigApi = (id: number) => {
  41. return request.delete({ url: '/infra/config/delete?id=' + id })
  42. }
  43. // 导出参数
  44. export const exportConfigApi = (params: ConfigExportReqVO) => {
  45. return request.download({ url: '/infra/config/export', params })
  46. }