roomInfo.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import request from '@/utils/request'
  2. import constant from '@/constant'
  3. function pageList(formData){
  4. return request.post(constant.serverUrl + "/base/roomInfo/pageList", formData);
  5. }
  6. function create(parentId){
  7. if(parentId==null){
  8. parentId = "";
  9. }
  10. return request.get(constant.serverUrl + `/base/roomInfo/create?parentId=${parentId}`);
  11. }
  12. function edit(id){
  13. return request.get(constant.serverUrl + "/base/roomInfo/edit/" + id);
  14. }
  15. function add(formModel){
  16. return request.post(constant.serverUrl + "/base/roomInfo/add", formModel,{
  17. headers: {
  18. "Content-Type": "application/json"
  19. }
  20. });
  21. }
  22. function update(formModel){
  23. return request.post(constant.serverUrl + "/base/roomInfo/update", formModel,{
  24. headers: {
  25. "Content-Type": "application/json"
  26. }
  27. });
  28. }
  29. function remove(id){
  30. return request.post(constant.serverUrl + "/base/roomInfo/delete/" + id);
  31. }
  32. function batchRemove(idList){
  33. return request.post(constant.serverUrl + "/base/roomInfo/batchDelete",idList,{
  34. headers: {
  35. "Content-Type": "application/json"
  36. }
  37. });
  38. }
  39. function query(formData) {
  40. return request.post(constant.serverUrl + "/base/roomInfo/query", formData);
  41. }
  42. function queryTree(formData) {
  43. return request.post(constant.serverUrl + "/base/roomInfo/queryTree", formData);
  44. }
  45. export default {
  46. pageList,create,edit,add,update,remove,batchRemove,query,queryTree
  47. }