model.js 580 B

1234567891011121314151617181920212223242526272829303132333435
  1. import { getElementId } from "../../plugins/utils";
  2. const LINE_HORIZONTAL = {
  3. type: "LINE_HORIZONTAL",
  4. x: 0,
  5. y: 0,
  6. w: 300,
  7. h: 30,
  8. sign: "",
  9. bold: "1px",
  10. color: "#000000",
  11. style: "solid"
  12. };
  13. // 竖线
  14. const LINE_VERTICAL = {
  15. type: "LINE_VERTICAL",
  16. x: 0,
  17. y: 0,
  18. w: 30,
  19. h: 300,
  20. sign: "",
  21. bold: "1px",
  22. color: "#000000",
  23. style: "solid"
  24. };
  25. const getModel = type => {
  26. const model = type === "HORIZONTAL" ? LINE_HORIZONTAL : LINE_VERTICAL;
  27. return {
  28. id: getElementId(),
  29. ...model
  30. };
  31. };
  32. export { LINE_HORIZONTAL, LINE_VERTICAL, getModel };