chunk-326f8bf1.352af865.js 9.6 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-326f8bf1","chunk-2d0d6f6b"],{"09f4":function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),Math.easeInOutQuad=function(t,e,n,a){return t/=a/2,t<1?n/2*t*t+e:(t--,-n/2*(t*(t-2)-1)+e)};var a=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();function o(t){document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}function r(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function i(t,e,n){var i=r(),l=t-i,s=20,c=0;e="undefined"===typeof e?500:e;var u=function t(){c+=s;var r=Math.easeInOutQuad(c,i,l,e);o(r),c<e?a(t):n&&"function"===typeof n&&n()};u()}},"26a4":function(t,e,n){},"68f6":function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"m-container"},[t._m(0),t._v(" "),n("div",{staticClass:"m-core"},[n("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(" "),n("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(" "),n("save-form",{staticClass:"searchForm",attrs:{inline:!0,model:t.searchForm},on:{submit:t.search}},[n("el-form-item",{attrs:{prop:"hasPracticeCourse"}},[n("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(" "),n("el-form-item",[n("el-button",{attrs:{"native-type":"submit",type:"danger"}},[t._v("搜索")])],1)],1),t._v(" "),n("div",{staticClass:"tableWrap"},[n("el-table",{attrs:{data:t.tableList,"header-cell-style":{background:"#EDEEF0",color:"#444"}}},[t._v(">\n "),n("el-table-column",{attrs:{width:"120px",align:"center",prop:"id",label:"编号"}}),t._v(" "),n("el-table-column",{attrs:{align:"center",prop:"title",label:"标题"}}),t._v(" "),n("el-table-column",{attrs:{align:"center",prop:"catalog.text",label:"分类名"}}),t._v(" "),n("el-table-column",{attrs:{align:"center",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"helpCenterContent/modify",expression:"'helpCenterContent/modify'"}],attrs:{type:"text"},on:{click:function(n){return t.openTypes("update",e.row)}}},[t._v("修改")]),t._v(" "),n("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"helpCenterContent/delete",expression:"'helpCenterContent/delete'"}],attrs:{type:"text"},on:{click:function(n){return t.onTypeDelOpeation(e.row)}}},[t._v("删除")])]}}])})],1),t._v(" "),n("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(" "),n("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")}}},[n("el-form",{ref:"ruleForm",attrs:{model:t.form,rules:t.rules}},[n("el-form-item",{attrs:{label:"标题",prop:"title","label-width":t.formLabelWidth}},[n("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(" "),n("el-form-item",{attrs:{label:"分类",prop:"catalogId","label-width":t.formLabelWidth}},[t.typeStatus?n("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(" "),n("el-form-item",{attrs:{label:"内容",prop:"content","label-width":t.formLabelWidth}},[n("Editor",{attrs:{form:t.form.content},on:{onEditorChange:t.onEditorChange}})],1)],1),t._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(e){t.typeStatus=!1}}},[t._v("取 消")]),t._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.onTypeSubmit("ruleForm")}}},[t._v("确 定")])],1)],1)],1)},o=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("h2",[n("div",{staticClass:"squrt"}),t._v("\n 帮助中心\n ")])}],r=(n("ac6a"),n("333d")),i=n("a5b0"),l=n("095c"),s=n("3607"),c={components:{pagination:r["a"],Tooltip:i["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:"change"}],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()},onEditorChange:function(t){this.form.content=t},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 n={title:e.form.title,content:e.form.content,catalogId:e.form.catalogId[e.form.catalogId.length-1]};Object(s["n"])(n).then((function(t){e.messageTips("添加",t)}))}else if("update"==e.formActionTitle){var a={id:e.form.id,title:e.form.title,content:e.form.content,catalogId:e.form.catalogId[e.form.catalogId.length-1]};Object(s["n"])(a).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 n={catalogIds:e,page:this.pageInfo.page,rows:this.pageInfo.limit};Object(s["m"])(n).then((function(e){var n=e.data;200==e.code&&(t.tableList=n.rows,t.pageInfo.total=n.total)}))},getTreeList:function(){var t=this;Object(s["j"])({parentId:0}).then((function(e){var n=e.data;200==e.code&&(t.treeList=t.setTableData(n))}))},setTableData:function(t){var e=this,n=[];return n=t.map((function(t){var n={};return n={value:t.id,label:t.text,parentId:t.parentId},t.children&&t.children.length>0&&(n.children=e.setTableData(t.children)),n})),n},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 n=[];return this.getId(t.catalogId,n,e),n.reverse()},getIdAndParent:function(t,e){var n=this;t.forEach((function(t){var a={id:t.value,parentId:t.parentId};e.push(a),t.children&&n.getIdAndParent(t.children,e)}))},getId:function(t,e,n){var a=this;n.forEach((function(o){o.id==t&&(e.push(t),-1!=o.parentId&&a.getId(o.parentId,e,n))}))},onFormClose:function(t){this.form={title:null,content:null,catalogId:[]},this.$refs.formCascader.handleClear(),this.$refs[t].resetFields()}}},u=c,d=(n("da24"),n("2877")),p=Object(d["a"])(u,a,o,!1,null,"c736510e",null);e["default"]=p.exports},7590:function(t,e,n){"use strict";var a=n("d225"),o=n("b0b4"),r=n("2a88"),i=n("6bb5"),l=n("4e2b"),s=n("c603"),c=n("953d"),u=c["Quill"].import("blots/block/embed"),d=c["Quill"].import("formats/link"),p=["height","width","src","poster"],f=function(t){Object(l["a"])(n,t);var e=Object(s["a"])(n);function n(){return Object(a["a"])(this,n),e.apply(this,arguments)}return Object(o["a"])(n,[{key:"format",value:function(t,e){p.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):Object(r["a"])(Object(i["a"])(n.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(r["a"])(Object(i["a"])(n),"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,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e}),{})}},{key:"sanitize",value:function(t){return d.sanitize(t)}},{key:"value",value:function(t){return t.getAttribute("src")}}]),n}(u);f.blotName="video",f.className="ql-video",f.tagName="video",e["a"]=f},da24:function(t,e,n){"use strict";n("26a4")}}]);