model.js 922 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import {
  2. getElementId,
  3. randomCode,
  4. deepCopy,
  5. } from "../../../card/plugins/utils";
  6. const MODEL = {
  7. type: "FIELD_TEXT",
  8. x: 0,
  9. y: 0,
  10. w: 200,
  11. h: 30,
  12. sign: "",
  13. textAlign: "left",
  14. fontWeight: 400,
  15. fontFamily: "宋体",
  16. fontSize: "14px",
  17. color: "#000",
  18. mode: "normal", // side:侧边模式,normal:正常模式
  19. field: "",
  20. fieldName: "",
  21. showLabel: false,
  22. showUnderline: false,
  23. content: "$样例内容",
  24. };
  25. const getModel = () => {
  26. return {
  27. id: getElementId(),
  28. key: randomCode(),
  29. ...deepCopy(MODEL),
  30. };
  31. };
  32. const FIELD_LIST = [
  33. {
  34. name: "试卷名称",
  35. field: "paperName",
  36. },
  37. {
  38. name: "课程名称",
  39. field: "courseName",
  40. },
  41. {
  42. name: "课程代码",
  43. field: "courseCode",
  44. },
  45. {
  46. name: "试卷总分",
  47. field: "totalScore",
  48. },
  49. {
  50. name: "学校名称",
  51. field: "rootOrgName",
  52. },
  53. ];
  54. export { MODEL, FIELD_LIST, getModel };