model.js 431 B

123456789101112131415161718192021222324252627
  1. import { getElementId, randomCode, deepCopy } from "../../plugins/utils";
  2. const MODEL = {
  3. type: "FILL_TABLE",
  4. x: 0,
  5. y: 0,
  6. w: 300,
  7. h: 120,
  8. sign: "",
  9. colCount: 3,
  10. rowCount: 3,
  11. padding: [5, 5],
  12. lineStyle: "solid",
  13. fontSize: "14px",
  14. lineHeight: 30,
  15. content: {}
  16. };
  17. const getModel = () => {
  18. return {
  19. id: getElementId(),
  20. key: randomCode(),
  21. ...deepCopy(MODEL)
  22. };
  23. };
  24. export { MODEL, getModel };