js.tpl 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import request from '@/config/axios'
  2. // 查询{[.FunctionName]}列表
  3. export const get{[.ClassNameUpper]}Page = async (params: PageParam) => {
  4. return await request.get({ url: '/{[toLower .ModuleName]}/{[toLower .ClassNameLower]}/page', params })
  5. }
  6. export const get{[.ClassNameUpper]}List = async (params: PageParam) => {
  7. return await request.get({ url: '/{[toLower .ModuleName]}/{[toLower .ClassNameLower]}/list', params })
  8. }
  9. // 查询{[.FunctionName]}详情
  10. export const get{[.ClassNameUpper]} = async (id: number) => {
  11. const params={id:id}
  12. return await request.get({ url: '/{[toLower .ModuleName]}/{[toLower .ClassNameLower]}',params })
  13. }
  14. // 新增{[.FunctionName]}
  15. export const create{[.ClassNameUpper]} = async (data: any) => {
  16. return await request.post({ url: '/{[toLower .ModuleName]}/{[toLower .ClassNameLower]}', data })
  17. }
  18. // 修改{[.FunctionName]}
  19. export const update{[.ClassNameUpper]} = async (data: any) => {
  20. return await request.put({ url: '/{[toLower .ModuleName]}/{[toLower .ClassNameLower]}', data })
  21. }
  22. // 修改{[.FunctionName]}状态
  23. export const update{[.ClassNameUpper]}Status = async (data: any) => {
  24. return await request.put({ url: '/{[toLower .ModuleName]}/{[toLower .ClassNameLower]}/updateStatus', data })
  25. }
  26. // 删除{[.FunctionName]}
  27. export const delete{[.ClassNameUpper]} = async (ids: any) => {
  28. const data={ids:ids}
  29. return await request.delete({ url: '/{[toLower .ModuleName]}/{[toLower .ClassNameLower]}', data })
  30. }
  31. // 导出{[.FunctionName]}
  32. export const export{[.ClassNameUpper]} = (params) => {
  33. return request.download({
  34. url: '/{[toLower .ModuleName]}/{[toLower .ClassNameLower]}/excel',
  35. params
  36. })
  37. }