model.js 753 B

123456789101112131415161718192021222324252627282930313233
  1. import { getElementId, randomCode, deepCopy } from "../../plugins/utils";
  2. const MODEL = {
  3. type: "CARD_HEAD",
  4. x: 0,
  5. y: 0,
  6. w: 0,
  7. h: 0,
  8. cardTitle: "",
  9. cardDesc: "",
  10. aOrB: false,
  11. paperType: "PRINT", // PRINT: "印刷",FILL: "填涂"
  12. examAbsent: true,
  13. writeSign: true,
  14. examNumberStyle: "PRINT", // PRINT:印刷条码, PASTE:粘贴条码, FILL:考号填涂
  15. businessParams: [],
  16. attention: [],
  17. objectiveAttention: [],
  18. subjectiveAttention: [],
  19. columnNumber: 2,
  20. isSimple: false, // 是否是简化形式
  21. sign: "head"
  22. };
  23. const getModel = cardConfig => {
  24. const model = Object.assign({}, deepCopy(MODEL), cardConfig);
  25. model.id = getElementId();
  26. model.key = randomCode();
  27. return model;
  28. };
  29. export { MODEL, getModel };