(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-ff3c29de"],{"0687":function(t,e,i){"use strict";i.d(e,"c",(function(){return s})),i.d(e,"e",(function(){return l})),i.d(e,"a",(function(){return u})),i.d(e,"d",(function(){return c})),i.d(e,"b",(function(){return d}));var r=i("b775"),n=i("4328"),o=i.n(n),a="/api-cms";function s(t){return Object(r["a"])({url:a+"/news/list",method:"get",params:t})}function l(t){return Object(r["a"])({url:a+"/news/update",method:"post",data:o.a.stringify(t)})}function u(t){return Object(r["a"])({url:a+"/news/add",method:"post",data:o.a.stringify(t)})}function c(t){return Object(r["a"])({url:a+"/news/query",method:"get",params:t})}function d(t){return Object(r["a"])({url:a+"/news/del/"+t.id,method:"post",data:o.a.stringify(t)})}},"4d82":function(t,e,i){},"5a0c":function(t,e,i){!function(e,i){t.exports=i()}(0,(function(){"use strict";var t="millisecond",e="second",i="minute",r="hour",n="day",o="week",a="month",s="quarter",l="year",u="date",c=/^(\d{4})[-\/]?(\d{1,2})?[-\/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d+)?$/,d=/\[([^\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,f=function(t,e,i){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(i)+t},m={s:f,z:function(t){var e=-t.utcOffset(),i=Math.abs(e),r=Math.floor(i/60),n=i%60;return(e<=0?"+":"-")+f(r,2,"0")+":"+f(n,2,"0")},m:function t(e,i){if(e.date()-1?i?this.domNode.setAttribute(t,i):this.domNode.removeAttribute(t):Object(s["a"])(Object(a["a"])(e.prototype),"format",this).call(this,t,i)}},{key:"html",value:function(){var t=this.value(),e=t.video;return'').concat(e,"")}}],[{key:"create",value:function(t){var i=Object(s["a"])(Object(a["a"])(e),"create",this).call(this,t.url);return i.setAttribute("controls","controls"),i.setAttribute("type","video/mp4"),i.setAttribute("preload","auto"),i.setAttribute("src",this.sanitize(t.url)),i.setAttribute("poster",this.sanitize(t.poster)),i}},{key:"formats",value:function(t){return f.reduce((function(e,i){return t.hasAttribute(i)&&(e[i]=t.getAttribute(i)),e}),{})}},{key:"sanitize",value:function(t){return d.sanitize(t)}},{key:"value",value:function(t){return t.getAttribute("src")}}]),e}(c);m.blotName="video",m.className="ql-video",m.tagName="video",e["a"]=m},"95c6":function(t,e,i){"use strict";i.r(e);var r=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"m-container"},[i("h2",[i("el-page-header",{attrs:{content:("create"==t.pageType?"添加":"修改")+t.typeChange(t.type)},on:{back:t.onCancel}})],1),t._v(" "),i("div",{staticClass:"m-core"},[i("el-form",{ref:"form",staticStyle:{width:"100%"},attrs:{model:t.form,rules:t.rules,"label-width":"120px"}},[i("el-form-item",{attrs:{label:"标题",prop:"title"}},[i("el-input",{model:{value:t.form.title,callback:function(e){t.$set(t.form,"title","string"===typeof e?e.trim():e)},expression:"form.title"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"排序值"}},[i("el-input",{model:{value:t.form.order,callback:function(e){t.$set(t.form,"order","string"===typeof e?e.trim():e)},expression:"form.order"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"适用范围",prop:"tenantId"}},[i("el-select",{model:{value:t.form.tenantId,callback:function(e){t.$set(t.form,"tenantId",e)},expression:"form.tenantId"}},[i("el-option",{attrs:{label:"对内",value:"1"}}),t._v(" "),i("el-option",{attrs:{label:"对外",value:"2"}})],1)],1),t._v(" "),3==t.type||6==t.type?i("el-form-item",{attrs:{label:"版本号"}},[i("el-input",{model:{value:t.form.memo,callback:function(e){t.$set(t.form,"memo",e)},expression:"form.memo"}})],1):t._e(),t._v(" "),3==t.type||6==t.type?i("el-form-item",{attrs:{label:"链接地址"}},[i("el-input",{model:{value:t.form.linkUrl,callback:function(e){t.$set(t.form,"linkUrl","string"===typeof e?e.trim():e)},expression:"form.linkUrl"}})],1):i("el-form-item",{attrs:{label:"链接地址",prop:"linkUrl"}},[i("el-input",{model:{value:t.form.linkUrl,callback:function(e){t.$set(t.form,"linkUrl","string"===typeof e?e.trim():e)},expression:"form.linkUrl"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"封面图",prop:"coverImage"}},[i("el-upload",{staticClass:"avatar-uploader",attrs:{action:"/api-web/uploadFile",headers:t.headers,"show-file-list":!1,accept:".jpg, .jpeg, .png","on-success":t.handleAvatarSuccess,"before-upload":t.beforeAvatarUpload}},[t.form.coverImage?i("img",{staticClass:"avatar",attrs:{src:t.form.coverImage}}):i("i",{staticClass:"el-icon-plus avatar-uploader-icon"})]),t._v(" "),t.imageSize?i("p",{staticClass:"imageSize"},[t._v("上传图片尺寸为:"+t._s(t.imageSize))]):t._e()],1),t._v(" "),i("el-form-item",{attrs:{label:"内容",prop:"content"}},[i("quill-editor",{ref:"myQuillEditor",staticClass:"ql-editor",attrs:{options:t.editorOption},on:{change:function(e){return t.onEditorChange(e)}},model:{value:t.form.content,callback:function(e){t.$set(t.form,"content",e)},expression:"form.content"}}),t._v(" "),i("el-upload",{staticClass:"ivu-upload",attrs:{"show-upload-list":!1,headers:t.headers,"on-success":t.handleSuccess,accept:".jpg, .jpeg, .png","max-size":2048,multiple:"",action:"/api-web/uploadFile"}},[i("Button",{attrs:{icon:"ios-cloud-upload-outline"}})],1)],1),t._v(" "),i("el-form-item",[i("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.onSubmit("form")}}},[t._v("立即"+t._s("create"==t.pageType?"创建":"修改"))]),t._v(" "),i("el-button",{on:{click:function(e){return t.onReSet("form")}}},[t._v("重置")]),t._v(" "),i("el-button",{on:{click:t.onLook}},[t._v("预览")])],1)],1)],1),t._v(" "),i("el-dialog",{attrs:{title:"插入视屏",width:"500px",visible:t.dialogFormVisible},on:{"update:visible":function(e){t.dialogFormVisible=e}}},[i("el-form",{ref:"diologForm",attrs:{model:t.dialogForm,rules:t.dialogFormRules}},[i("el-form-item",{attrs:{label:"封面图","label-width":"90px"}},[i("el-input",{staticStyle:{width:"100%"},attrs:{autocomplete:"off"},model:{value:t.dialogForm.poster,callback:function(e){t.$set(t.dialogForm,"poster",e)},expression:"dialogForm.poster"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"视屏类型","label-width":"90px"}},[i("el-radio-group",{model:{value:t.formRadio,callback:function(e){t.formRadio=e},expression:"formRadio"}},[i("el-radio",{attrs:{label:1}},[t._v("外部连接")]),t._v(" "),i("el-radio",{attrs:{label:2}},[t._v("上传")])],1)],1),t._v(" "),1==t.formRadio?i("el-form-item",{attrs:{label:"视屏地址","label-width":"90px",prop:"url"}},[i("el-input",{staticStyle:{width:"100%"},attrs:{autocomplete:"off"},model:{value:t.dialogForm.url,callback:function(e){t.$set(t.dialogForm,"url",e)},expression:"dialogForm.url"}})],1):t._e(),t._v(" "),2==t.formRadio?i("el-form-item",{attrs:{label:"上传视屏","label-width":"90px",prop:"videoUrl"}},[i("el-upload",{directives:[{name:"loading",rawName:"v-loading",value:t.uploadLoading,expression:"uploadLoading"}],staticClass:"upload-demo",staticStyle:{display:"inline-block"},attrs:{action:"/api-web/uploadFile","before-upload":t.beforeUpload,"on-success":t.handleUploadSuccess,"on-error":t.handleUploadError,"show-file-list":!1,limit:1,accept:".mp4, .m4a","on-exceed":t.handleExceed}},[t.dialogForm.videoUrl?i("video",{staticStyle:{width:"120px",height:"120px"},attrs:{controls:"controls",type:"video/mp4",preload:"auto",src:t.dialogForm.videoUrl}}):i("i",{staticClass:"el-icon-plus avatar-uploader-icon"})]),t._v(" "),i("p",{staticClass:"imageSize"},[t._v("只能上传mp4/m4a文件, 且不超过100M")])],1):t._e()],1),t._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(e){t.dialogFormVisible=!1}}},[t._v("取 消")]),t._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.onVideoComfirm("diologForm")}}},[t._v("确 定")])],1)],1),t._v(" "),i("el-dialog",{attrs:{width:"375px",visible:t.lookVisible},on:{"update:visible":function(e){t.lookVisible=e}}},[i("div",{staticClass:"sd-container"},[i("h2",[t._v(t._s(t.dataInfo.title))]),t._v(" "),i("div",{staticClass:"titleInfo"},[i("p",[t._v(t._s(t.typeCheck(t.dataInfo.type)))]),t._v(" "),i("p",[t._v(t._s(t.dataInfo.updateTime))])]),t._v(" "),i("div",{staticClass:"msgWrap quill-editor ql-editor",domProps:{innerHTML:t._s(t.dataInfo.content)}})])])],1)},n=[],o=(i("6b54"),i("ac6a"),i("0687")),a=(i("4360"),i("5f87")),s=i("61f7"),l=(i("a753"),i("8096"),i("14e1"),i("9339")),u=i.n(l),c=i("953d"),d=i("7590"),f=i("5a0c"),m=i.n(f),p=[["bold","italic","underline","strike"],["blockquote","code-block"],[{header:1},{header:2}],[{list:"ordered"},{list:"bullet"}],[{script:"sub"},{script:"super"}],[{indent:"-1"},{indent:"+1"}],[{size:["small",!1,"large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],["clean"],["image","video"]],h={"ql-bold":"加粗","ql-color":"颜色","ql-font":"字体","ql-code":"插入代码","ql-italic":"斜体","ql-background":"背景颜色","ql-size":"字体大小","ql-strike":"删除线","ql-script":"上标/下标","ql-underline":"下划线","ql-blockquote":"引用","ql-header":"标题","ql-indent":"缩进","ql-list":"列表","ql-align":"文本对齐","ql-direction":"文本方向","ql-code-block":"代码块","ql-formula":"公式","ql-image":"图片","ql-video":"视频","ql-clean":"清除字体样式","ql-upload":"文件"};u.a.register(d["a"],!0);var g={name:"contentOperation",components:{quillEditor:c["quillEditor"]},data:function(){var t=this,e=this.$route.query,i=7==e.type?Object(s["d"])()+"/#/knowledge":Object(s["d"])()+"/#/specialdetail";return console.log(i),{categoryList:[],type:e.type,pageType:e.pageType,organId:null,headers:{Authorization:Object(a["a"])()},content:null,dialogFormVisible:!1,formRadio:1,lookVisible:!1,dataInfo:{title:"知识库13",type:e.type,updateTime:m()().format("YYYY-MM-DD HH:mm:ss"),content:null},editorIndex:0,editorOption:{placeholder:"请输入内容",modules:{toolbar:{container:p,handlers:{image:function(t){t?document.querySelector(".ivu-upload .el-upload").click():this.quill.format("image",!1)},video:function(e){if(e){t.dialogFormVisible=!0;var i=t.$refs.myQuillEditor.quill;t.editorIndex=i.getSelection().index}else this.quill.format("image",!1)}}}}},dialogForm:{poster:null,url:null,videoUrl:null},uploadLoading:!1,fileList:[],dialogFormRules:{url:[{required:!0,message:"请输入视屏地址",trigger:"blur"}],videoUrl:[{required:!0,message:"请上传视屏",trigger:"blur"}]},form:{title:null,order:null,coverImage:null,linkUrl:i,type:e.type,status:1,content:null,tenantId:null},rules:{title:[{required:!0,message:"请输入标题",trigger:"blur"},{min:2,max:30,message:"长度在 2 到 30 个字符",trigger:"blur"}],linkUrl:[{required:!0,message:"请输入连接地址",trigger:"blur"}],coverImage:[{required:!0,message:"请选择封面图",trigger:"blur"}],content:[{required:!0,message:"请编辑内容",trigger:"blur"}],tenantId:[{required:!0,message:"请选择适用范围",trigger:"blur"}]},imageSize:null}},created:function(){},mounted:function(){this.init()},activated:function(){var t=this.$route.query;"create"==t.pageType&&(this.form={title:null,order:null,coverImage:null,linkUrl:7==t.type?Object(s["d"])()+"/#/knowledge":Object(s["d"])()+"/#/specialdetail",type:t.type,status:1,content:null,tenantId:null},this.$refs["form"].resetFields()),this.type=t.type,this.pageType=t.pageType,this.init()},methods:{init:function(){this.getList(),this.addQuillTitle();var t={1:"468px * 552px",2:"456px * 288px",3:"686px * 140px",4:null};this.imageSize=t[this.form.type]},onVideoComfirm:function(t){var e=this;this.$refs[t].validate((function(t){if(!t)return!1;var i=e.dialogForm,r=e.editor,n={poster:i.poster,url:1==e.formRadio?i.url:i.videoUrl};r.insertEmbed(e.editorIndex,"video",n),r.setSelection(e.editorIndex+1),e.dialogFormVisible=!1,e.dialogForm={poster:null,url:null,videoUrl:null}}))},addQuillTitle:function(){var t=document.querySelector(".ql-toolbar"),e=t.querySelectorAll("button"),i=t.querySelectorAll("select");e.forEach((function(t){"ql-script"===t.className?"sub"===t.value?t.title="下标":t.title="上标":"ql-indent"===t.className?"+1"===t.value?t.title="向右缩进":t.title="向左缩进":t.title=h[t.classList[0]]})),i.forEach((function(t){t.parentNode.title=h[t.classList[0]]}))},onSubmit:function(t){var e=this;this.$refs[t].validate((function(t){if(!t)return!1;"create"==e.pageType?(e.form.id&&delete e.form.id,Object(o["a"])(e.form).then((function(t){e.messageTips("添加",t)}))):"update"==e.pageType&&Object(o["e"])(e.form).then((function(t){e.messageTips("修改",t)}))}))},messageTips:function(t,e){200==e.code?(this.$message.success(t+"成功"),this.$router.push({path:"/contentManager/contentManager",query:{type:this.typeIndex(this.type)}})):this.$message.error(e.msg)},onCancel:function(){this.$router.push({path:"/contentManager/contentManager",query:{type:this.typeIndex(this.type)}})},handleSuccess:function(t){var e=this.editor;if(t.code){var i=e.getSelection().index;e.insertEmbed(i,"image",t.data.url),e.setSelection(i+1)}else this.$message.error("图片插入失败")},onReSet:function(t){this.$refs[t].resetFields()},onLook:function(){var t=this.dataInfo;t.title=this.form.title,t.content=this.form.content,setTimeout((function(){var t=document.querySelectorAll(".msgWrap img");t.length>0&&t.forEach((function(t){t.style.width="100%"}));var e=document.querySelectorAll(".msgWrap .ql-video");e.length>0&&e.forEach((function(t){t.style.width="100%",t.style.height="195px"}))}),500),this.lookVisible=!0},getList:function(){var t=this;"create"!=this.pageType&&Object(o["d"])({id:this.$route.query.id}).then((function(e){if(200==e.code){var i=e.data;t.form;t.form={id:i.id,title:i.title,order:i.order,coverImage:i.coverImage,linkUrl:i.linkUrl,type:i.type,status:i.status,memo:i.memo,content:i.content,tenantId:i.tenantId.toString()}}}))},handleAvatarSuccess:function(t,e){this.form.coverImage=t.data.url},beforeAvatarUpload:function(t){var e={"image/png":!0,"image/jpeg":!0},i=e[t.type],r=t.size/1024/1024<2;return i||this.$message.error("只能上传图片格式!"),r||this.$message.error("上传头像图片大小不能超过 2MB!"),i&&r},typeChange:function(t){var e={1:"精彩活动",2:"热门资讯",4:"专项训练",5:"闪页管理",3:"BANNER管理",6:"APP按钮管理",7:"知识库管理"};return e[t]},typeCheck:function(t){var e={1:"精彩活动",2:"热门资讯",4:"专项训练",7:"知识库"};return e[t]?e[t]:"大雅乐盟"},typeIndex:function(t){var e={1:0,2:1,3:4,4:2,5:3,6:5};return e[t]},onEditorChange:function(t){t.quill;var e=t.html;t.text;this.form.content=e},beforeUpload:function(t){var e=t.size/1024/1024<100;return e||this.$message.error("上传视屏大小不能超过 100MB!"),this.uploadLoading=!0,e},handleUploadError:function(t){this.uploadLoading=!1,this.$message.error("上传视屏失败")},handleUploadSuccess:function(t,e){this.uploadLoading=!1,this.$message.success("上传视屏成功"),console.log(t,e),this.dialogForm.videoUrl=t.data.url},handleExceed:function(t,e){this.$message.error("您已上传过视屏")}},computed:{editor:function(){return this.$refs.myQuillEditor.quill}}},v=g,b=(i("a055"),i("2877")),y=Object(b["a"])(v,r,n,!1,null,"7a8cf6cc",null);e["default"]=y.exports},a055:function(t,e,i){"use strict";var r=i("4d82"),n=i.n(r);n.a}}]);