chunk-627bff1d.d3ea63bd.js 5.6 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-627bff1d"],{"09f4":function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),Math.easeInOutQuad=function(t,e,n,o){return t/=o/2,t<1?n/2*t*t+e:(t--,-n/2*(t*(t-2)-1)+e)};var o=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();function i(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 a(t,e,n){var a=r(),s=t-a,l=20,c=0;e="undefined"===typeof e?500:e;var u=function t(){c+=l;var r=Math.easeInOutQuad(c,a,s,e);i(r),c<e?o(t):n&&"function"===typeof n&&n()};u()}},"7d73":function(t,e,n){"use strict";n("d9ec")},bba5:function(t,e,n){"use strict";n.r(e);var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"m-container"},[n("h2",[n("el-page-header",{attrs:{content:"帮助中心分类"},on:{back:t.onCancel}})],1),t._v(" "),n("div",{staticClass:"m-core"},[n("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"helpCenterCatalog/modify",expression:"'helpCenterCatalog/modify'"}],staticStyle:{"margin-bottom":"20px"},attrs:{type:"primary",icon:"el-icon-plus"},on:{click:function(e){return t.openTypes("create")}}},[t._v("添加")]),t._v(" "),n("div",{staticClass:"tableWrap"},[n("el-table",{attrs:{data:t.tableList,"header-cell-style":{background:"#EDEEF0",color:"#444"},"row-key":"id","tree-props":{children:"children",hasChildren:"hasChildren"}}},[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:"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:"helpCenterCatalog/modify",expression:"'helpCenterCatalog/modify'"}],attrs:{type:"text"},on:{click:function(n){return t.openTypes("add",e.row)}}},[t._v("添加")]),t._v(" "),n("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"helpCenterCatalog/modify",expression:"'helpCenterCatalog/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:"helpCenterCatalog/delete",expression:"'helpCenterCatalog/delete'"}],attrs:{type:"text"},on:{click:function(n){return t.onTypeDelOpeation(e.row)}}},[t._v("删除")])]}}])})],1)],1)],1),t._v(" "),n("el-dialog",{attrs:{title:t.formTitle[t.formActionTitle],visible:t.typeStatus,width:"500px"},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:"text","label-width":t.formLabelWidth}},[n("el-input",{attrs:{autocomplete:"off"},model:{value:t.form.text,callback:function(e){t.$set(t.form,"text","string"===typeof e?e.trim():e)},expression:"form.text"}})],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)},i=[],r=n("333d"),a=n("3607"),s={components:{pagination:r["a"]},name:"helpCategory",data:function(){return{tableList:[],subjectList:[],formActionTitle:"create",formTitle:{create:"添加帮助中心分类",add:"添加帮助中心分类",update:"修改帮助中心分类"},typeStatus:!1,formLabelWidth:"120px",form:{text:null,parentId:0},rules:{text:[{required:!0,message:"请输入类型名称",trigger:"blur"}]},pageInfo:{limit:10,page:1,total:0,page_size:[10,20,40,50]}}},mounted:function(){this.getList()},methods:{onTypeDelOpeation:function(t){var e=this;this.$confirm("您是否删除该分类?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){Object(a["i"])({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;"create"==e.formActionTitle||"add"==e.formActionTitle?(e.form.id&&delete e.form.id,Object(a["k"])(e.form).then((function(t){e.messageTips("添加",t)}))):"update"==e.formActionTitle&&Object(a["k"])(e.form).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;Object(a["j"])({parentId:0}).then((function(e){var n=e.data;200==e.code&&(t.tableList=t.setTableData(n))}))},setTableData:function(t){var e=this,n=[];return n=t.map((function(t){var n={};return n={id:t.id,text:t.text},t.children&&t.children.length>0&&(n.children=e.setTableData(t.children)),n})),n},openTypes:function(t,e){this.typeStatus=!0,this.formActionTitle=t,"create"==t?this.form.parentId=0:"update"==t?this.form={id:e.id,text:e.text,parentId:0}:"add"==t&&(this.form.parentId=e.id)},onCancel:function(){this.$store.dispatch("delVisitedViews",this.$route),this.$router.push({path:"/contentManager/helpContent"})},onFormClose:function(t){this.form={name:null,subjectIds:[]},this.$refs[t].resetFields()}}},l=s,c=(n("7d73"),n("2877")),u=Object(c["a"])(l,o,i,!1,null,"ae2af84c",null);e["default"]=u.exports},d9ec:function(t,e,n){}}]);