import {
  getElementId,
  randomCode,
  deepCopy,
} from "../../../card/plugins/utils";

const MODEL = {
  type: "FIELD_TEXT",
  x: 0,
  y: 0,
  w: 200,
  h: 30,
  sign: "",
  textAlign: "left",
  fontWeight: 400,
  fontFamily: "宋体",
  fontSize: "14px",
  color: "#000",
  mode: "normal", // side:侧边模式,normal:正常模式
  field: "",
  fieldName: "",
  content: "$样例内容",
};

const getModel = () => {
  return {
    id: getElementId(),
    key: randomCode(),
    ...deepCopy(MODEL),
  };
};

const FIELD_LIST = [
  {
    name: "试卷名称",
    field: "paperName",
  },
  {
    name: "科目名称",
    field: "courseName",
  },
  {
    name: "试卷总分",
    field: "totalScore",
  },
  {
    name: "学校名称",
    field: "rootOrgName",
  },
];

export { MODEL, FIELD_LIST, getModel };
