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