index.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import request from '@/config/axios'
  2. export type ConfigVO = {
  3. id: number
  4. group: string
  5. name: string
  6. key: string
  7. value: string
  8. type: string
  9. visible: boolean
  10. remark: string
  11. createTime: string
  12. }
  13. export interface ConfigPageReqVO extends PageParam {
  14. name?: string
  15. type?: number
  16. createTime?: string[]
  17. }
  18. export interface ConfigExportReqVO {
  19. name?: string
  20. type?: number
  21. createTime?: string[]
  22. }
  23. // 查询参数列表
  24. export const getConfigPageApi = (params: ConfigPageReqVO) => {
  25. return request.get({ url: '/infra/config/page', params })
  26. }
  27. // 查询参数详情
  28. export const getConfigApi = (id: number) => {
  29. return request.get({ url: '/infra/config/get?id=' + id })
  30. }
  31. // 根据参数键名查询参数值
  32. export const getConfigKeyApi = (configKey: string) => {
  33. return request.get({ url: '/infra/config/get-value-by-key?key=' + configKey })
  34. }
  35. // 新增参数
  36. export const createConfigApi = (data: ConfigVO) => {
  37. return request.post({ url: '/infra/config/create', data })
  38. }
  39. // 修改参数
  40. export const updateConfigApi = (data: ConfigVO) => {
  41. return request.put({ url: '/infra/config/update', data })
  42. }
  43. // 删除参数
  44. export const deleteConfigApi = (id: number) => {
  45. return request.delete({ url: '/infra/config/delete?id=' + id })
  46. }
  47. // 导出参数
  48. export const exportConfigApi = (params: ConfigExportReqVO) => {
  49. return request.download({ url: '/infra/config/export', params })
  50. }