food.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // 查询列表接口
  2. const getDishPage = (params) => {
  3. return $axios({
  4. url: '/dish/page',
  5. method: 'get',
  6. params
  7. })
  8. }
  9. // 删除接口
  10. const deleteDish = (ids) => {
  11. return $axios({
  12. url: '/dish',
  13. method: 'delete',
  14. params: { ids }
  15. })
  16. }
  17. // 修改接口
  18. const editDish = (params) => {
  19. return $axios({
  20. url: '/dish',
  21. method: 'put',
  22. data: { ...params }
  23. })
  24. }
  25. // 新增接口
  26. const addDish = (params) => {
  27. return $axios({
  28. url: '/dish',
  29. method: 'post',
  30. data: { ...params }
  31. })
  32. }
  33. // 查询详情
  34. const queryDishById = (id) => {
  35. return $axios({
  36. url: `/dish/${id}`,
  37. method: 'get'
  38. })
  39. }
  40. // 获取菜品分类列表
  41. const getCategoryList = (params) => {
  42. return $axios({
  43. url: '/category/list',
  44. method: 'get',
  45. params
  46. })
  47. }
  48. // 查菜品列表的接口
  49. const queryDishList = (params) => {
  50. return $axios({
  51. url: '/dish/list',
  52. method: 'get',
  53. params
  54. })
  55. }
  56. // 文件down预览
  57. const commonDownload = (params) => {
  58. return $axios({
  59. headers: {
  60. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  61. },
  62. url: '/common/download',
  63. method: 'get',
  64. params
  65. })
  66. }
  67. // 起售停售---批量起售停售接口
  68. const dishStatusByStatus = (params) => {
  69. return $axios({
  70. url: `/dish/status/${params.status}`,
  71. method: 'post',
  72. params: { ids: params.id }
  73. })
  74. }