index.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import { Dict_Imgs } from "@/dict";
  2. import { createAttrsForm } from "../../defines/createAttrsForm";
  3. import { createCompHooks } from "../../defines/createCompHooks";
  4. import { ImagePicker } from "../../formItems/ImagePicker";
  5. export { Component } from "./component";
  6. export const options = {
  7. name: "3D",
  8. thumbnail: require("@/modules/editor/assets/icons/3d.svg"),
  9. };
  10. export const { createComp, useCompData } = createCompHooks({
  11. value: {
  12. url: "https://www.sku3d.com/share.html?id=6478676ca494a3ea15a6fa82",
  13. inline: true,
  14. poster: Dict_Imgs.Default,
  15. ratio: 1,
  16. },
  17. layout: {
  18. size: [750, 750],
  19. },
  20. });
  21. export const Form = createAttrsForm([
  22. {
  23. label: "3D链接",
  24. dataIndex: "value.url",
  25. component: "Input",
  26. },
  27. {
  28. label: "封面",
  29. dataIndex: "value.poster",
  30. component: ImagePicker,
  31. },
  32. {
  33. label: "场景比例",
  34. dataIndex: "value.ratio",
  35. component: "Select",
  36. props: {
  37. options: [
  38. { label: "1:1", value: 1 },
  39. { label: "4:3", value: 4 / 3 },
  40. { label: "3:4", value: 3 / 4 },
  41. { label: "16:9", value: 16 / 9 },
  42. { label: "9:16", value: 9 / 16 },
  43. ],
  44. },
  45. },
  46. {
  47. label: "是否内嵌3D",
  48. dataIndex: "value.inline",
  49. component: "Switch",
  50. },
  51. ]);