export const usePointObject = () => {
  function getPointObject(record) {
    const { imgUrl } = record;
    // TODO: 获取点位对象
    return JSON.stringify({
      version: "5.3.0",
      objects: [
        {
          type: "rect",
          version: "5.3.0",
          originX: "left",
          originY: "top",
          left: 0,
          top: 0,
          width: 947,
          height: 610,
          fill: "rgba(255,35,255,1)",
          stroke: null,
          strokeWidth: 0,
          strokeDashArray: null,
          strokeLineCap: "butt",
          strokeDashOffset: 0,
          strokeLineJoin: "miter",
          strokeUniform: false,
          strokeMiterLimit: 4,
          scaleX: 1,
          scaleY: 1,
          angle: 0,
          flipX: false,
          flipY: false,
          opacity: 1,
          shadow: null,
          visible: true,
          backgroundColor: "",
          fillRule: "nonzero",
          paintFirst: "fill",
          globalCompositeOperation: "source-over",
          skewX: 0,
          skewY: 0,
          rx: 0,
          ry: 0,
          id: "workspace",
          selectable: false,
          hasControls: false
        },
        {
          type: "image",
          version: "5.3.0",
          originX: "left",
          originY: "top",
          width: 947,
          height: 610,
          fill: "rgb(0,0,0)",
          stroke: null,
          strokeWidth: 0,
          strokeDashArray: null,
          strokeLineCap: "butt",
          strokeDashOffset: 0,
          strokeLineJoin: "miter",
          strokeUniform: false,
          strokeMiterLimit: 4,
          scaleX: 1,
          scaleY: 1,
          angle: 0,
          flipX: false,
          flipY: false,
          opacity: 1,
          shadow: null,
          visible: true,
          backgroundColor: "",
          fillRule: "nonzero",
          paintFirst: "fill",
          globalCompositeOperation: "source-over",
          skewX: 0,
          skewY: 0,
          cropX: 0,
          cropY: 0,
          id: "a3ab29c6-7008-49fe-abf3-edc9a47cd460",
          selectable: false,
          hasControls: false,
          evented: false,
          crossOrigin: null,
          src: imgUrl,
          filters: []
        }
      ]
    });
  }

  return {
    getPointObject
  };
};