model.js 422 B

123456789101112131415161718192021222324252627
  1. import { getElementId, randomCode, deepCopy } from "../../plugins/utils";
  2. const MODEL = {
  3. type: "BARCODE",
  4. x: 0,
  5. y: 0,
  6. w: 300,
  7. h: 60,
  8. sign: "",
  9. rotation: 0,
  10. bold: "1px",
  11. color: "#ffffff",
  12. bgColor: "#ffffff",
  13. style: "solid",
  14. fields: [],
  15. content: ""
  16. };
  17. const getModel = () => {
  18. return {
  19. id: getElementId(),
  20. key: randomCode(),
  21. ...deepCopy(MODEL)
  22. };
  23. };
  24. export { MODEL, getModel };