export default {
  data() {
    var that = this;
    return {
      froalaConfig: {
        key: "BWC6D-16D3B2F3C2H1A6A7wdwgacxuB-33c1fB2twtfG3A7A6B6A3B3B2G3D2H2==",
        toolbarButtons: [
          "textColor",
          "bold",
          "italic",
          "underline",
          "strikeThrough",
          "fontFamily",
          "fontSize",
          "color",
          "paragraphStyle",
          "lineHeight",
          "paragraphFormat",
          "align",
          "insertHR",
          "undo",
          "redo",
        ],
        height: 450,
        fontSize: ["12", "14", "16", "18", "20", "24", "28", "32", "36", "40"],
        fontSizeDefaultSelection: "16",
        theme: "dark", //主题
        placeholderText: "请输入报告内容",
        language: "zh_cn", //国际化
        imageUploadURL: import.meta.env.VITE_APP_API_ROOT + "/report/uploadImg", //上传url
        videoUploadURL: import.meta.env.VITE_APP_API_ROOT + "/report/uploadImg", //上传url
        fileUploadURL: import.meta.env.VITE_APP_API_ROOT + "/report/uploadImg", //上传url 更多上传介绍 请访问https://www.froala.com/wysiwyg-editor/docs/options
        imageDefaultWidth: false,
        quickInsertButtons: ["image", "table", "ul", "ol", "hr"], //快速插入项
        toolbarVisibleWithoutSelection: true, //是否开启 不选中模式
        toolbarSticky: false, //操作栏是否自动吸顶
        saveInterval: 0,
        events: {
          initialized: function () {
            that.editor = this;
          },
          keyup: function (e, editor) {
            //添加事件，在每次按键按下时，都记录一下最后停留位置
            that.$nextTick(function () {
              that.lastEditRange = getSelection().getRangeAt(0);
            });
          },
          click: function (e, editor) {
            //添加事件，在每次鼠标点击时，都记录一下最后停留位置
            that.$nextTick(function () {
              that.lastEditRange = getSelection().getRangeAt(0);
            });
          },
        },
        charCounterCount: false,
        reportloadding: false,
        lastsavetime: "",
        isAddEnter: false, //是否已经添加过
        timer: null,
        ischange: false,
        isPublishloading: false,
      },
    };
  },
};
