import { httpUrl } from '../task/fetch';

export const editorConfig = {
  placeholder: '请输入',
  uploadImgServer: httpUrl + '/busiAttachments/upload',
  uploadFileName: 'file',
  uploadImgHeaders: {
    'X-Requested-With': 'XMLHttpRequest'
  },
  excludeMenus: [
    'list',
    'todo',
    'emoticon',
    'video'
  ],
  uploadImgHooks: {
    // 图片上传并返回了结果，想要自己把图片插入到编辑器中
    customInsert: function (insertImgFn, result) {
      // insertImgFn 可把图片插入到编辑器，传入图片 src ，执行函数即可
      if (result && result.data && result.data.id) {
        insertImgFn(`${httpUrl}/busiAttachments/view/${result.data.id}`);
      }
    }
  },
}