1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-a45f2d94","chunk-1604e400"],{"095c":function(t,e,o){"use strict";o.r(e);var i=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"editor"},[o("quill-editor",{ref:"myAlias",staticClass:"ql-editor",attrs:{options:t.editorOption},on:{blur:function(e){return t.onEditorBlur(e)},focus:function(e){return t.onEditorFocus(e)},change:function(e){return t.onEditorChange(e)}},model:{value:t.form,callback:function(e){t.form=e},expression:"form"}}),t._v(" "),o("el-upload",{ref:"ivuUpload",staticClass:"ivu-upload",attrs:{"show-file-list":!1,headers:t.headers,"on-success":t.handleSuccess,accept:".jpg, .jpeg, .png","max-size":2048,multiple:"",action:"/api-web/uploadFile"}},[o("Button",{attrs:{icon:"ios-cloud-upload-outline"}})],1),t._v(" "),o("el-dialog",{attrs:{title:"插入视频",width:"500px",visible:t.dialogFormVisible,"append-to-body":""},on:{"update:visible":function(e){t.dialogFormVisible=e}}},[o("el-form",{ref:"diologForm",attrs:{model:t.dialogForm,rules:t.dialogFormRules}},[o("el-form-item",{attrs:{label:"封面图地址","label-width":"90px"}},[o("el-upload",{directives:[{name:"loading",rawName:"v-loading",value:t.uploadImgLoading,expression:"uploadImgLoading"}],staticClass:"avatar-uploader",staticStyle:{"line-height":"0",display:"inline-block"},attrs:{action:"/api-web/uploadFile",headers:t.headers,"show-file-list":!1,accept:".jpg, .jpeg, .png","on-success":t.handleImgSuccess,"on-error":t.handleUploadImgError,"before-upload":t.beforeImgUpload}},[t.dialogForm.poster?o("img",{staticClass:"avatar",attrs:{width:"300px",src:t.dialogForm.poster}}):o("i",{staticClass:"el-icon-plus avatar-uploader-icon"})])],1),t._v(" "),o("el-form-item",{attrs:{label:"视频类型","label-width":"90px"}},[o("el-radio-group",{model:{value:t.formRadio,callback:function(e){t.formRadio=e},expression:"formRadio"}},[o("el-radio",{attrs:{label:1}},[t._v("外部链接")]),t._v(" "),o("el-radio",{attrs:{label:2}},[t._v("上传")])],1)],1),t._v(" "),1==t.formRadio?o("el-form-item",{attrs:{label:"视频地址","label-width":"90px",prop:"url"}},[o("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?o("el-form-item",{attrs:{label:"上传视频","label-width":"90px",prop:"videoUrl"}},[o("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,accept:".mp4","file-list":t.fileList,"on-exceed":t.handleExceed}},[t.dialogForm.videoUrl?o("video",{staticStyle:{width:"120px",height:"120px"},attrs:{type:"video/mp4",preload:"auto",src:t.dialogForm.videoUrl}}):o("i",{staticClass:"el-icon-plus avatar-uploader-icon"})]),t._v(" "),o("p",{staticClass:"imageSize"},[t._v("只能上传mp4文件, 且不超过100M")])],1):t._e()],1),t._v(" "),o("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(e){t.dialogFormVisible=!1}}},[t._v("取 消")]),t._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.onVideoComfirm("diologForm")}}},[t._v("确 定")])],1)],1)],1)},r=[],a=(o("ac6a"),o("5f87")),n=(o("a753"),o("8096"),o("14e1"),o("9339")),l=o.n(n),s=o("953d"),c=o("7590"),u=(o("5a0c"),[["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","middle","large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],["clean"],["link","image","video"]]),d={"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":"文件"};l.a.register(c["a"],!0);var p={props:{id:"",keyWord:{type:String,default:"content"},form:{type:String},alias:{type:String,default:"myQuillEditor"}},name:"editor",components:{quillEditor:s["quillEditor"]},data:function(){var t=this;return{content:null,headers:{Authorization:Object(a["b"])()},dialogFormVisible:!1,dialogForm:{poster:null,url:null,videoUrl:null},uploadLoading:!1,uploadImgLoading:!1,fileList:[],dialogFormRules:{url:[{required:!0,message:"请输入视频地址",trigger:"blur"}],videoUrl:[{required:!0,message:"请上传视频",trigger:"blur"}]},formRadio:1,editorOption:{placeholder:"请输入内容",modules:{toolbar:{container:u,handlers:{image:function(e){if(e){var o,i=t.editor;t.editorIndex=(null===(o=i.getSelection())||void 0===o?void 0:o.index)||0,t.$refs.ivuUpload.$children[0].$refs.input.click()}else t.quill.format("image",!1)},video:function(e){if(e){var o;t.dialogFormVisible=!0;var i=t.editor;t.editorIndex=(null===(o=i.getSelection())||void 0===o?void 0:o.index)||0}else t.quill.format("image",!1)}}}}},ActiveEditor:null}},created:function(){},mounted:function(){this},methods:{onEditorBlur:function(t){t.quill,t.html,t.text},onEditorFocus:function(t){console.log(t,this.id),this.ActiveEditor=t},onEditorChange:function(t){t.quill;var e=t.html;t.text;this.$emit("onEditorChange",e)},onVideoComfirm:function(t){var e=this;this.$refs[t].validate((function(t){if(!t)return!1;var o=e.dialogForm,i=e.editor;console.log(i,e.keyWord);var r={poster:o.poster,url:1==e.formRadio?o.url:o.videoUrl};i.insertEmbed(e.editorIndex,"video",r),i.setSelection(e.editorIndex+1,{preload:!1}),e.dialogFormVisible=!1,e.dialogForm={poster:null,url:null,videoUrl:null}}))},handleSuccess:function(t){var e=this.ActiveEditor;if(console.log(e,this.id),t.code){var o=e.getSelection().index||0;e.insertEmbed(o,"image",t.data.url),e.setSelection(o+1)}else this.$message.error("图片插入失败")},addQuillTitle:function(){var t=document.querySelector(".ql-toolbar"),e=t.querySelectorAll("button"),o=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=d[t.classList[0]]})),o.forEach((function(t){t.parentNode.title=d[t.classList[0]]}))},handleUploadImgError:function(t){this.uploadImgLoading=!1,this.$message.error("上传失败")},handleImgSuccess:function(t,e){this.uploadImgLoading=!1,this.dialogForm.poster=t.data.url},beforeImgUpload:function(t){var e={"image/png":!0,"image/jpeg":!0},o=e[t.type],i=t.size/1024/1024<2;return o||this.$message.error("只能上传图片格式!"),i||this.$message.error("上传图片大小不能超过 2MB!"),o&&i&&(this.uploadImgLoading=!0),o&&i},beforeAvatarUpload:function(t){var e={"image/png":!0,"image/jpeg":!0},o=e[t.type],i=t.size/1024/1024<2;return o||this.$message.error("只能上传图片格式!"),i||this.$message.error("上传图片大小不能超过 2M!"),o&&i},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("上传视频成功"),this.dialogForm.videoUrl=t.data.url},handleExceed:function(t,e){this.$message.error("您已上传过视频")}},computed:{editor:function(){return this.$refs.myAlias.quill},ActiveEditors:function(){return console.log(this.id),this.ActiveEditor}}},m=p,f=(o("96b0"),o("2877")),g=Object(f["a"])(m,i,r,!1,null,"b57e41da",null);e["default"]=g.exports},"09f4":function(t,e,o){"use strict";o.d(e,"a",(function(){return n})),Math.easeInOutQuad=function(t,e,o,i){return t/=i/2,t<1?o/2*t*t+e:(t--,-o/2*(t*(t-2)-1)+e)};var i=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();function r(t){document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}function a(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function n(t,e,o){var n=a(),l=t-n,s=20,c=0;e="undefined"===typeof e?500:e;var u=function t(){c+=s;var a=Math.easeInOutQuad(c,n,l,e);r(a),c<e?i(t):o&&"function"===typeof o&&o()};u()}},"2f54":function(t,e,o){},3607:function(t,e,o){"use strict";o.d(e,"h",(function(){return l})),o.d(e,"e",(function(){return s})),o.d(e,"g",(function(){return c})),o.d(e,"f",(function(){return u})),o.d(e,"j",(function(){return d})),o.d(e,"k",(function(){return p})),o.d(e,"i",(function(){return m})),o.d(e,"m",(function(){return f})),o.d(e,"n",(function(){return g})),o.d(e,"l",(function(){return h})),o.d(e,"p",(function(){return b})),o.d(e,"b",(function(){return v})),o.d(e,"a",(function(){return y})),o.d(e,"d",(function(){return I})),o.d(e,"o",(function(){return w})),o.d(e,"c",(function(){return q})),o.d(e,"q",(function(){return C}));var i=o("b775"),r=o("4328"),a=o.n(r),n="/api-web";function l(t){return Object(i["a"])({url:n+"/tenantEntryActivities/queryPage",method:"get",params:t})}function s(t){return Object(i["a"])({url:n+"/tenantEntryActivities/merge",method:"post",data:t})}function c(t){return Object(i["a"])({url:n+"/tenantEntryActivities/updateDelFlag",method:"post",data:a.a.stringify(t)})}function u(t){return Object(i["a"])({url:n+"/tenantEntryActivities/query",method:"get",params:t})}function d(t){return Object(i["a"])({url:"/api-cms/helpCenterCatalog/list",method:"get",params:t})}function p(t){return Object(i["a"])({url:"/api-cms/helpCenterCatalog/modify",method:"post",data:a.a.stringify(t)})}function m(t){return Object(i["a"])({url:"/api-cms/helpCenterCatalog/delete",method:"post",data:a.a.stringify(t)})}function f(t){return Object(i["a"])({url:"/api-cms/helpCenterContent/list",method:"get",params:t})}function g(t){return Object(i["a"])({url:"/api-cms/helpCenterContent/modify",method:"post",data:a.a.stringify(t)})}function h(t){return Object(i["a"])({url:"/api-cms/helpCenterContent/delete",method:"post",data:a.a.stringify(t)})}function b(t){return Object(i["a"])({url:"/api-web/sysSuggestion/queryPage",method:"get",params:t})}function v(t){return Object(i["a"])({method:"get",url:"/api-web/employeeInfo/queryPage",params:t})}function y(t){return Object(i["a"])({method:"post",url:"/api-web/employeeInfo/insert",data:t})}function I(t){return Object(i["a"])({method:"post",url:"/api-web/employeeInfo/update",data:t})}function w(t){return Object(i["a"])({method:"post",url:"/api-web/employeeInfo/insertVisit",data:t})}function q(t){return Object(i["a"])({method:"get",url:"/api-web/employeeInfo/queryDetail",params:t})}function C(t){return Object(i["a"])({method:"post",url:"/api-web/uploadFile",data:t})}},"68f6":function(t,e,o){"use strict";o.r(e);var i=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"m-container"},[t._m(0),t._v(" "),o("div",{staticClass:"m-core"},[o("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"helpCenterContent/modify",expression:"'helpCenterContent/modify'"}],staticStyle:{"margin-bottom":"20px"},attrs:{type:"primary"},on:{click:function(e){return t.openTypes("create")}}},[t._v("\n 添加\n ")]),t._v(" "),o("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"/helpCategory",expression:"'/helpCategory'"}],staticStyle:{"margin-bottom":"20px"},attrs:{type:"primary"},on:{click:function(e){return t.onToUrl()}}},[t._v("\n 分类管理\n ")]),t._v(" "),o("save-form",{staticClass:"searchForm",attrs:{inline:!0,model:t.searchForm},on:{submit:t.search}},[o("el-form-item",{attrs:{prop:"hasPracticeCourse"}},[o("el-cascader",{ref:"cascader",attrs:{"show-all-levels":!1,options:t.treeList,props:{checkStrictly:!0},clearable:""},model:{value:t.searchForm.catalogId,callback:function(e){t.$set(t.searchForm,"catalogId",e)},expression:"searchForm.catalogId"}})],1),t._v(" "),o("el-form-item",[o("el-button",{attrs:{"native-type":"submit",type:"danger"}},[t._v("搜索")])],1)],1),t._v(" "),o("div",{staticClass:"tableWrap"},[o("el-table",{attrs:{data:t.tableList,"header-cell-style":{background:"#EDEEF0",color:"#444"}}},[t._v(">\n "),o("el-table-column",{attrs:{width:"120px",align:"center",prop:"id",label:"编号"}}),t._v(" "),o("el-table-column",{attrs:{align:"center",prop:"title",label:"标题"}}),t._v(" "),o("el-table-column",{attrs:{align:"center",prop:"catalog.text",label:"分类名"}}),t._v(" "),o("el-table-column",{attrs:{align:"center",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[o("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"helpCenterContent/modify",expression:"'helpCenterContent/modify'"}],attrs:{type:"text"},on:{click:function(o){return t.openTypes("update",e.row)}}},[t._v("修改")]),t._v(" "),o("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"helpCenterContent/delete",expression:"'helpCenterContent/delete'"}],attrs:{type:"text"},on:{click:function(o){return t.onTypeDelOpeation(e.row)}}},[t._v("删除")])]}}])})],1),t._v(" "),o("pagination",{attrs:{sync:"",total:t.pageInfo.total,page:t.pageInfo.page,limit:t.pageInfo.limit,"page-sizes":t.pageInfo.page_size},on:{"update:total":function(e){return t.$set(t.pageInfo,"total",e)},"update:page":function(e){return t.$set(t.pageInfo,"page",e)},"update:limit":function(e){return t.$set(t.pageInfo,"limit",e)},pagination:t.getList}})],1)],1),t._v(" "),o("el-dialog",{attrs:{title:t.formTitle[t.formActionTitle],visible:t.typeStatus,width:"1000px"},on:{"update:visible":function(e){t.typeStatus=e},close:function(e){return t.onFormClose("ruleForm")}}},[o("el-form",{ref:"ruleForm",attrs:{model:t.form,rules:t.rules}},[o("el-form-item",{attrs:{label:"标题",prop:"title","label-width":t.formLabelWidth}},[o("el-input",{attrs:{autocomplete:"off",placeholder:"请输入标题"},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(" "),o("el-form-item",{attrs:{label:"分类",prop:"catalogId","label-width":t.formLabelWidth}},[t.typeStatus?o("el-cascader",{ref:"formCascader",staticStyle:{width:"100%"},attrs:{"show-all-levels":!1,options:t.treeList,props:{checkStrictly:!0},clearable:""},model:{value:t.form.catalogId,callback:function(e){t.$set(t.form,"catalogId",e)},expression:"form.catalogId"}}):t._e()],1),t._v(" "),o("el-form-item",{attrs:{label:"内容",prop:"content","label-width":t.formLabelWidth}},[o("Editor",{attrs:{form:t.form}})],1)],1),t._v(" "),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(e){t.typeStatus=!1}}},[t._v("取 消")]),t._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.onTypeSubmit("ruleForm")}}},[t._v("确 定")])],1)],1)],1)},r=[function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("h2",[o("div",{staticClass:"squrt"}),t._v("帮助中心\n ")])}],a=(o("ac6a"),o("333d")),n=o("a5b0"),l=o("095c"),s=o("3607"),c={components:{pagination:a["a"],Tooltip:n["a"],Editor:l["default"]},name:"helpCategory",data:function(){return{searchForm:{catalogId:null},treeList:[],tableList:[],formActionTitle:"create",formTitle:{create:"添加帮助中心",update:"修改帮助中心"},typeStatus:!1,formLabelWidth:"100px",form:{title:null,content:null,catalogId:null},rules:{title:[{required:!0,message:"请输入标题",trigger:"blur"}],content:[{required:!0,message:"请输入内容",trigger:"blur"}],catalogId:[{required:!0,message:"请输入选择分类",trigger:"blur"}]},pageInfo:{limit:10,page:1,total:0,page_size:[10,20,40,50]},tempTreeList:[]}},mounted:function(){this.getList(),this.getTreeList()},methods:{search:function(){this.pageInfo.page=1,this.getList()},onTypeDelOpeation:function(t){var e=this;this.$confirm("您是否删除该内容?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){Object(s["l"])({id:t.id}).then((function(t){e.messageTips("删除",t)}))})).catch((function(){}))},onTypeSubmit:function(t){var e=this;this.$refs[t].validate((function(t){if(!t)return!1;if("create"==e.formActionTitle){var o={title:e.form.title,content:e.form.content,catalogId:e.form.catalogId[e.form.catalogId.length-1]};Object(s["n"])(o).then((function(t){e.messageTips("添加",t)}))}else if("update"==e.formActionTitle){var i={id:e.form.id,title:e.form.title,content:e.form.content,catalogId:e.form.catalogId[e.form.catalogId.length-1]};Object(s["n"])(i).then((function(t){e.messageTips("修改",t)}))}}))},messageTips:function(t,e){200==e.code?(this.$message.success(t+"成功"),this.typeStatus=!1,this.getList()):this.$message.error(e.msg)},getList:function(){var t=this,e=this.searchForm.catalogId?this.searchForm.catalogId:null;e&&(e=e[e.length-1]);var o={catalogIds:e,page:this.pageInfo.page,rows:this.pageInfo.limit};Object(s["m"])(o).then((function(e){var o=e.data;200==e.code&&(t.tableList=o.rows,t.pageInfo.total=o.total)}))},getTreeList:function(){var t=this;Object(s["j"])({parentId:0}).then((function(e){var o=e.data;200==e.code&&(t.treeList=t.setTableData(o))}))},setTableData:function(t){var e=this,o=[];return o=t.map((function(t){var o={};return o={value:t.id,label:t.text,parentId:t.parentId},t.children&&t.children.length>0&&(o.children=e.setTableData(t.children)),o})),o},openTypes:function(t,e){this.typeStatus=!0,this.formActionTitle=t,"update"==t&&(this.form={id:e.id,title:e.title,content:e.content,catalogId:this.getAllIds(e)})},onToUrl:function(){this.$router.push("/contentManager/helpCategory")},getAllIds:function(t){var e=[];this.getIdAndParent(this.treeList,e);var o=[];return this.getId(t.catalogId,o,e),o.reverse()},getIdAndParent:function(t,e){var o=this;t.forEach((function(t){var i={id:t.value,parentId:t.parentId};e.push(i),t.children&&o.getIdAndParent(t.children,e)}))},getId:function(t,e,o){var i=this;o.forEach((function(r){r.id==t&&(e.push(t),-1!=r.parentId&&i.getId(r.parentId,e,o))}))},onFormClose:function(t){this.form={title:null,content:null,catalogId:[]},this.$refs.formCascader.handleClear(),this.$refs[t].resetFields()}}},u=c,d=(o("ee99"),o("2877")),p=Object(d["a"])(u,i,r,!1,null,"78b448c4",null);e["default"]=p.exports},7590:function(t,e,o){"use strict";var i=o("d4ec"),r=o("bee2"),a=o("45eb"),n=o("7e84"),l=o("262e"),s=o("2caf8"),c=o("953d"),u=c["Quill"].import("blots/block/embed"),d=c["Quill"].import("formats/link"),p=["height","width","src","poster"],m=function(t){Object(l["a"])(o,t);var e=Object(s["a"])(o);function o(){return Object(i["a"])(this,o),e.apply(this,arguments)}return Object(r["a"])(o,[{key:"format",value:function(t,e){p.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):Object(a["a"])(Object(n["a"])(o.prototype),"format",this).call(this,t,e)}},{key:"html",value:function(){var t=this.value(),e=t.video;return'<a href="'.concat(e,'">').concat(e,"</a>")}}],[{key:"create",value:function(t){var e=Object(a["a"])(Object(n["a"])(o),"create",this).call(this,t.url);return e.setAttribute("controls","controls"),e.setAttribute("type","video/mp4"),e.setAttribute("preload","auto"),e.setAttribute("autopaly","false"),e.setAttribute("src",this.sanitize(t.url)),e.setAttribute("poster",this.sanitize(t.poster)),e}},{key:"formats",value:function(t){return p.reduce((function(e,o){return t.hasAttribute(o)&&(e[o]=t.getAttribute(o)),e}),{})}},{key:"sanitize",value:function(t){return d.sanitize(t)}},{key:"value",value:function(t){return t.getAttribute("src")}}]),o}(u);m.blotName="video",m.className="ql-video",m.tagName="video",e["a"]=m},"96b0":function(t,e,o){"use strict";o("2f54")},be4b:function(t,e,o){},ee99:function(t,e,o){"use strict";o("be4b")}}]);
|