index.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. import request from '@/utils/request';
  2. import { AxiosPromise } from 'axios';
  3. import { AreaStationVO, AreaStationForm, AreaStationQuery, SysAreaStationTypeVo, SysAreaStationOnStoreVo } from '@/api/system/areaStation/types';
  4. /**
  5. * 查询区域站点列表
  6. * @param query
  7. * @returns {*}
  8. */
  9. export const listAreaStation = (query?: AreaStationQuery): AxiosPromise<AreaStationVO[]> => {
  10. return request({
  11. url: '/system/areaStation/list',
  12. method: 'get',
  13. params: query
  14. });
  15. };
  16. /**
  17. * 查询区域站点详细
  18. * @param id
  19. */
  20. export const getAreaStation = (id: string | number): AxiosPromise<AreaStationVO> => {
  21. return request({
  22. url: '/system/areaStation/' + id,
  23. method: 'get'
  24. });
  25. };
  26. /**
  27. * 新增区域站点
  28. * @param data
  29. */
  30. export const addAreaStation = (data: AreaStationForm) => {
  31. return request({
  32. url: '/system/areaStation',
  33. method: 'post',
  34. data: data
  35. });
  36. };
  37. /**
  38. * 修改区域站点
  39. * @param data
  40. */
  41. export const updateAreaStation = (data: AreaStationForm) => {
  42. return request({
  43. url: '/system/areaStation',
  44. method: 'put',
  45. data: data
  46. });
  47. };
  48. /**
  49. * 删除区域站点
  50. * @param id
  51. */
  52. export const delAreaStation = (id: string | number | Array<string | number>) => {
  53. return request({
  54. url: '/system/areaStation/' + id,
  55. method: 'delete'
  56. });
  57. };
  58. /**
  59. * 获取区域类型
  60. * @Author Huanyi
  61. */
  62. export const listType = (): AxiosPromise<SysAreaStationTypeVo[]> => {
  63. return request({
  64. url: '/system/areaStation/listType',
  65. method: 'GET'
  66. });
  67. };
  68. /**
  69. * 获取区域列表
  70. * @Author Huanyi
  71. */
  72. export const listOnStore = (): AxiosPromise<SysAreaStationOnStoreVo[]> => {
  73. return request({
  74. url: '/system/areaStation/listOnStore',
  75. method: 'GET'
  76. });
  77. };