index.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import { EditorModule } from "..";
  2. import { DesignTemp } from "../../objects/DesignTemp";
  3. export const https = EditorModule.http({
  4. getDesignDetail(id: string, params?: { isSys: boolean }) {
  5. return this.request("/h5/detail/" + id, {
  6. method: "GET",
  7. params: {
  8. ...params,
  9. clientId: this.helper.getClientId(),
  10. },
  11. });
  12. },
  13. getCompDetail(id: string, isSys = false) {
  14. const params:any = {};
  15. if (isSys) params.isSys = true;
  16. return this.request("/frame/detail/" + id, {
  17. method: "GET",
  18. params
  19. });
  20. },
  21. saveDesign(data: Partial<DesignTemp>) {
  22. return this.request("/h5/update", {
  23. method: "POST",
  24. data,
  25. });
  26. },
  27. saveComp(data: Partial<DesignTemp>) {
  28. return this.request("/frame/update", {
  29. method: "POST",
  30. data,
  31. });
  32. },
  33. createComp(data: any) {
  34. return this.request("/frame/create", { method: "POST", data });
  35. },
  36. getWkDesignDetail(id: string) {
  37. return this.request(`/wk/h5/detail/${id}`, {
  38. method: "GET",
  39. params: {
  40. clientId: this.helper.getClientId(),
  41. },
  42. });
  43. },
  44. saveWkDesign(data: Partial<DesignTemp>) {
  45. return this.request("/wk/h5/update", {
  46. method: "POST",
  47. data,
  48. });
  49. },
  50. });