model.js 526 B

1234567891011121314151617181920212223242526272829303132
  1. import {
  2. getElementId,
  3. randomCode,
  4. deepCopy,
  5. objAssign,
  6. } from "../../../card/plugins/utils";
  7. const MODEL = {
  8. type: "PAPER_STRUCT",
  9. x: 0,
  10. y: 0,
  11. w: 200,
  12. h: 50,
  13. textAlign: "left",
  14. paddingLeft: 0,
  15. structs: [
  16. {
  17. detailName: "选择题",
  18. questionCount: 10,
  19. totalScore: 20,
  20. },
  21. ],
  22. };
  23. const getModel = (presetData) => {
  24. const model = objAssign(deepCopy(MODEL), presetData);
  25. model.id = getElementId();
  26. model.key = randomCode();
  27. return model;
  28. };
  29. export { MODEL, getModel };