companyInfo.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import request from '@/utils/request'
  2. import constant from '@/constant'
  3. function list() {
  4. return request.post(constant.serverUrl + "/base/companyInfo/list");
  5. }
  6. function pageList(formData) {
  7. return request.post(constant.serverUrl + "/base/companyInfo/pageList", formData);
  8. }
  9. function create() {
  10. return request.get(constant.serverUrl + "/base/companyInfo/create");
  11. }
  12. function edit(id) {
  13. return request.get(constant.serverUrl + "/base/companyInfo/edit/" + id);
  14. }
  15. function add(formModel) {
  16. return request.post(constant.serverUrl + "/base/companyInfo/add", formModel, {
  17. headers: {
  18. "Content-Type": "application/json"
  19. }
  20. });
  21. }
  22. function update(formModel) {
  23. return request.post(constant.serverUrl + "/base/companyInfo/update", formModel, {
  24. headers: {
  25. "Content-Type": "application/json"
  26. }
  27. });
  28. }
  29. function remove(id) {
  30. return request.post(constant.serverUrl + "/base/companyInfo/delete/" + id);
  31. }
  32. function batchRemove(idList) {
  33. return request.post(constant.serverUrl + "/base/companyInfo/batchDelete", idList, {
  34. headers: {
  35. "Content-Type": "application/json"
  36. }
  37. });
  38. }
  39. function queryBindDeviceList(formData) {
  40. var objData = {};
  41. formData.forEach((value, key) => objData[key] = value);
  42. return request.get(constant.serverUrl + "/base/companyInfo/queryBindDeviceList", {
  43. params: objData,
  44. headers: {
  45. "Content-Type": "application/json"
  46. }
  47. });
  48. }
  49. function bindDevice(formData) {
  50. return request.post(constant.serverUrl + "/base/companyInfo/bindDevice", formData);
  51. }
  52. function unbindDevice(formData) {
  53. return request.post(constant.serverUrl + "/base/companyInfo/unbindDevice", formData);
  54. }
  55. export default {
  56. list, create, edit, add, update, remove, batchRemove, pageList, queryBindDeviceList,
  57. bindDevice, unbindDevice
  58. }