(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-909b0120"],{"03fa":function(t,e,n){"use strict";var i=n("4b55"),o=n.n(i);o.a},"4b55":function(t,e,n){},"7e41":function(t,e,n){},d509:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"cl-editor-quill"},[n("div",{staticClass:"editor",style:t.style}),n("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}},[n("el-button",{attrs:{id:"quill-upload-btn"}})],1)],1)},o=[],r=(n("3546"),n("0e8d"),n("fdc1"),n("1528"),n("a94a"),n("639b"),n("4f5b"),n("b287"),n("9d37")),l=n("6c81"),c=n.n(l),s=(n("7e41"),n("8bc2")),a=n("5880");function u(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function d(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?u(Object(n),!0).forEach((function(e){Object(r["a"])(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var h={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:d({},Object(a["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(s["deepMerge"])(this.options2,this.options);this.quill=new c.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(),n=e.index;this.quill.insertEmbed(n||0,"image",t.data,c.a.sources.USER)},setContent:function(t){this.quill.root.innerHTML=t||""}}},p=h,b=(n("03fa"),n("5511")),f=Object(b["a"])(p,i,o,!1,null,null,null);e["default"]=f.exports}}]);