(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d221e23"],{cbf4:function(t,e,i){"use strict";i.r(e);var s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"app-container"},[i("div",{staticClass:"filter-container"},[i("el-button",{staticClass:"filter-item",attrs:{type:"success",icon:"el-icon-refresh"},on:{click:t.refresh}},[t._v("刷新")]),i("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-circle-plus-outline"},on:{click:t.add}},[t._v("添加分类")])],1),i("div",{staticClass:"padding-lg margin-top back-white"},[i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{"header-cell-style":{background:"#eef1f6",color:"#606266"},data:t.list,border:"",fit:"","highlight-current-row":""}},[i("el-table-column",{attrs:{label:"ID",property:"id",align:"center",width:"50"},scopedSlots:t._u([{key:"default",fn:function(e){var s=e.row;return[i("span",[t._v(t._s(s.id))])]}}])}),i("el-table-column",{attrs:{label:"分类名称",property:"title",align:"center"}}),i("el-table-column",{attrs:{label:"类型",property:"status",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){var s=e.row;return[1==s.type?i("el-tag",{attrs:{type:"warning"}},[t._v("文章")]):t._e(),2==s.type?i("el-tag",{attrs:{type:"success"}},[t._v("视频")]):t._e()]}}])}),i("el-table-column",{attrs:{label:"状态",property:"status",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){var s=e.row;return[i("el-switch",{attrs:{value:1==s.status,"active-color":"#13ce66","inactive-color":"#DCDFE6"},on:{change:function(e){return t.setStatus(e,t.$index)}}})]}}])}),i("el-table-column",{attrs:{label:"排序",property:"sort",align:"center"}}),i("el-table-column",{attrs:{label:"操作",align:"center",width:"300","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){var s=e.row,a=e.$index;return[i("el-button",{attrs:{type:"primary",size:"mini",icon:"el-icon-edit"},on:{click:function(e){return t.edit(s)}}},[t._v("编辑")]),i("el-button",{attrs:{type:"danger",size:"mini",icon:"el-icon-delete"},on:{click:function(e){return t.del(s.id,a)}}})]}}])})],1),i("pagination",{directives:[{name:"show",rawName:"v-show",value:t.total>0,expression:"total>0"}],attrs:{total:t.total,page:t.listQuery.page,limit:t.listQuery.limit},on:{"update:page":function(e){return t.$set(t.listQuery,"page",e)},"update:limit":function(e){return t.$set(t.listQuery,"limit",e)},pagination:t.getList}})],1)])},a=[],n=i("7f70"),l=(i("baf6"),i("8327")),r=i("333d"),o={name:"Category",components:{Pagination:r["a"]},data:function(){return{list:[],total:0,listLoading:!1,listQuery:{page:1,limit:10}}},computed:Object(n["a"])({},Object(l["b"])(["config"])),created:function(){this.getList()},methods:{getList:function(){var t=this;this.listLoading=!0,this.api.get("news/category/getList",this.listQuery).then((function(e){t.listLoading=!1,1==e.code?(t.total=parseInt(e.data.total),t.list=e.data.list):t.$util.error(e.message||e.msg||"数据异常")}))},setStatus:function(t,e){var i=this;t?this.$set(this.list[e],"status",1):this.$set(this.list[e],"status",0),this.api.post("news/category/status",{id:this.list[e].id,status:this.list[e].status}).then((function(t){1==t.code?i.$util.success(t.message):i.$util.error(t.message)}))},add:function(){this.$util.jump("./categoryPost")},edit:function(t){this.$util.jump("./categoryPost?id="+t.id)},refresh:function(){this.getList()},del:function(t,e){var i=this;if(!t)return!1;this.$util.confirm("此操作将永久删除该数据, 是否继续?",(function(s){s&&i.api.get("news/category/delete",{id:t}).then((function(t){1==t.code?(i.list.splice(e,1),i.$util.success(t.message)):i.$util.error(t.message)}))}))}}},c=o,u=i("3d7a"),d=Object(u["a"])(c,s,a,!1,null,null,null);e["default"]=d.exports}}]);