(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-42ce9658"],{3879:function(t,e,r){"use strict";r.d(e,"a",(function(){return o})),r.d(e,"d",(function(){return s})),r.d(e,"c",(function(){return i})),r.d(e,"e",(function(){return n})),r.d(e,"b",(function(){return l})),r.d(e,"h",(function(){return p})),r.d(e,"g",(function(){return c})),r.d(e,"i",(function(){return d})),r.d(e,"f",(function(){return u}));var a=r("6b2d");const o=t=>a.a.post("/report.reportCategory/add",t),s=t=>a.a.get("/report.reportCategory/list",{params:t}),i=t=>a.a.get("/report.reportCategory/detail",{params:t}),n=t=>a.a.post("/report.reportCategory/update",t),l=t=>a.a.get("/report.reportCategory/del",{params:t}),p=t=>a.a.get("/report.report/list",{params:t}),c=t=>a.a.get("/report.report/detail",{params:t}),d=t=>a.a.post("/report.report/update",t),u=t=>a.a.get("/report.report/del",{params:t})},"68b8":function(t,e,r){"use strict";r.r(e);var a=r("3879"),o=r("b3ad"),s=(r("b6c4"),{data:()=>({form:{name:"",status:1,type:""},options:[],pid:"",type:"",types:[{type:"article",name:"文章"},{type:"circle",name:"圈子"},{type:"group",name:"群聊"},{type:"user",name:"用户"},{type:"shop",name:"自营商城"},{type:"twoshop",name:"闲置商城"}]}),components:{MaterialSelect:o.a},methods:{setType(t){this.form.type=t},submitForm(t){this.form.pid=this.pid,this.form.type=this.type,this.$refs[t].validate(t=>{if(!t)return!1;this.editCategory()})},addCategory(){this.form.pid=this.pid,Object(a.a)(this.form).then(t=>{1==t.code?(this.$message.success("新增成功!"),setTimeout(()=>this.$router.go(-1),500)):this.$message.error(t.msg)})},editCategory(){Object(a.e)(this.form).then(t=>{1==t.code?(this.$message.success("编辑成功!"),setTimeout(()=>this.$router.go(-1),500)):this.$message.error(t.msg)})},listAllCategory(){Object(a.d)().then(t=>{for(var e=[{description:"",id:0,pid:0,name:"无",status:1}],r=0;r<t.data.length;r++)0==t.data[r].pid&&e.push(t.data[r]);this.options=e})},getCategoryDetail(){Object(a.c)({id:this.form.id}).then(t=>{this.form=t.data,this.pid=this.form.pid,this.type=this.form.type})}},mounted(){this.listAllCategory(),this.getCategoryDetail()},created(){const t=this.$route.query;this.form.id=t.id}}),i=r("2877"),n=Object(i.a)(s,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("div",{staticClass:"ls-card"},[r("el-page-header",{attrs:{content:"编辑举报分类"},on:{back:function(e){return t.$router.go(-1)}}})],1),r("div",{staticClass:"ls-card m-t-16"},[r("div",{staticClass:"card-title"},[t._v("编辑举报分类")]),r("div",{staticClass:"card-content m-t-24"},[r("el-form",{ref:"form",attrs:{model:t.form,"label-width":"80px"}},[r("el-form-item",{attrs:{required:"",prop:"name",label:"分类名称"}},[r("el-input",{model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1),r("el-form-item",{attrs:{prop:"description",label:"分类描述"}},[r("el-input",{staticStyle:{width:"280px"},attrs:{type:"textarea",rows:"5"},model:{value:t.form.description,callback:function(e){t.$set(t.form,"description",e)},expression:"form.description"}})],1),r("el-form-item",{attrs:{prop:"pid",label:"父级ID"}},[r("el-select",{attrs:{placeholder:"请选择"},model:{value:t.pid,callback:function(e){t.pid=e},expression:"pid"}},t._l(t.options,(function(t){return r("el-option",{key:t.id,attrs:{value:t.id,label:t.name}})})),1)],1),r("el-form-item",{attrs:{required:"",prop:"type",label:"举报位置"}},[r("el-select",{attrs:{placeholder:"请选择"},on:{change:t.setType},model:{value:t.type,callback:function(e){t.type=e},expression:"type"}},t._l(t.types,(function(t){return r("el-option",{key:t.type,attrs:{value:t.type,label:t.name}})})),1)],1),r("el-form-item",{attrs:{prop:"status",label:"状态"}},[r("el-switch",{attrs:{"active-value":1,"inactive-value":0},model:{value:t.form.status,callback:function(e){t.$set(t.form,"status",e)},expression:"form.status"}})],1)],1)],1)]),r("div",{staticClass:"bg-white ls-fixed-footer"},[r("div",{staticClass:"row-center flex",staticStyle:{height:"100%"}},[r("el-button",{attrs:{size:"small"},on:{click:function(e){return t.$router.go(-1)}}},[t._v("取消")]),r("el-button",{attrs:{size:"small",type:"primary"},on:{click:function(e){return t.submitForm("form")}}},[t._v("编辑")])],1)])])}),[],!1,null,null,null);e.default=n.exports}}]);