(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-033e28cf"],{"03fa5":function(t,e,i){"use strict";var n=i("d72c"),l=i.n(n);l.a},"7e41":function(t,e,i){},d509:function(t,e,i){"use strict";i.r(e);var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"cl-editor-quill"},[i("div",{staticClass:"editor",style:t.style}),i("el-upload",{attrs:{"show-file-list":!1,action:t.uploadURL,headers:Object.assign({},{Authorization:t.token},t.headers),accept:t.accept,"on-success":t.upSuccess}},[i("el-button",{attrs:{id:"quill-upload-btn"}})],1)],1)},l=[],o=(i("f4a0"),i("b54b")),s=i("6c81"),a=i.n(s),c=(i("7e41"),i("8bc2")),u=i("5880"),r={name:"cl-editor-quill",props:{options:Object,value:null,action:String,headers:Object,accept:String,height:[String,Number],width:[String,Number]},data:function(){return{uploadURL:"",content:"",quill:null,options2:{theme:"snow",placeholder:"输入内容",modules:{toolbar:[["bold","italic","underline","strike"],["blockquote","code-block"],[{header:1},{header:2}],[{list:"ordered"},{list:"bullet"}],[{script:"sub"},{script:"super"}],[{indent:"-1"},{indent:"+1"}],[{direction:"rtl"}],[{size:["small",!1,"large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],["clean"],["link","image","video"]]}}}},computed:Object(o["a"])({},Object(u["mapGetters"])(["token"]),{style:function(){var t=this.height,e=this.width;return isNaN(Number(t))||(t+="px"),isNaN(Number(e))||(t+="px"),{height:t,width:e}}}),watch:{value:function(t){t?t!==this.content&&this.setContent(t):this.setContent("")},content:function(t){this.$emit("input",t)}},created:function(){var t=this.$service.common.upload(),e=t.url;this.uploadURL=this.action||e},mounted:function(){var t=this,e=Object(c["deepMerge"])(this.options2,this.options);this.quill=new a.a(this.$el.querySelector(".editor"),e),this.quill.getModule("toolbar").addHandler("image",this.uploadImageHandler),this.quill.on("text-change",(function(){t.content=t.quill.root.innerHTML})),this.setContent(this.value),this.$emit("load",this.quill)},methods:{uploadImageHandler:function(){document.getElementById("quill-upload-btn").click()},upSuccess:function(t){var e=this.quill.getSelection(),i=e.index;this.quill.insertEmbed(i||0,"image",t.data,a.a.sources.USER)},setContent:function(t){this.quill.root.innerHTML=t||""}}},d=r,h=(i("03fa5"),i("623f")),p=Object(h["a"])(d,n,l,!1,null,null,null);e["default"]=p.exports},d72c:function(t,e,i){}}]);