a6236a1.js 3.3 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([[16],{472:function(t,e,r){},614:function(t,e,r){"use strict";r(472)},751:function(t,e,r){"use strict";r.r(e);r(71),r(18);var n=r(6),o=(r(30),r(722)),l=r(584),c={components:{category_create:o.default,category_type:l.a},data:function(){return{list:[],drawer:!1,direction:"rtl",menuDialog:!1,loading:!1,search:{page:0,pagesize:10,total:0,type:""},id:0,type:""}},mounted:function(){this.getList()},methods:{open_drawer:function(){this.drawer=!0},drawer_close:function(){this.$refs.drawer_close.closeDrawer()},add_:function(t,e){this.id=t,this.type=e,this.open_drawer()},page_event:function(t){this.search.page=t,this.getList()},getList:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.loading=!0,t.search.order="id desc",e.next=4,t.$post("/uapi/pub/list/admin/category/list",t.search);case 4:(r=e.sent)&&1===r.status&&(t.list=r.data.list||[],t.search.total=r.data.count),t.loading=!1;case 7:case"end":return e.stop()}}),e)})))()}}},d=(r(614),r(4)),component=Object(d.a)(c,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"content"},[e("div",{staticStyle:{"margin-top":"15px","margin-right":"30px",display:"flex"}},[e("category_type",{staticStyle:{"margin-right":"20px"},attrs:{type:t.search.type},model:{value:t.search.type,callback:function(e){t.$set(t.search,"type",e)},expression:"search.type"}}),t._v(" "),e("el-button",{staticStyle:{float:"right"},attrs:{type:"primary"},on:{click:t.getList}},[t._v("查看")]),t._v(" "),e("el-button",{staticStyle:{position:"absolute",right:"20px"},attrs:{type:"warning"},on:{click:function(e){return t.add_(0,0)}}},[t._v("添加分类")])],1),t._v(" "),e("div",{staticStyle:{clear:"both"}}),t._v(" "),e("div",{staticStyle:{"margin-bottom":"15px"}}),t._v(" "),e("div",[e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:t.list,border:""}},[e("el-table-column",{attrs:{prop:"uid",label:"分类名称"},scopedSlots:t._u([{key:"default",fn:function(r){return[r.row.parent_id>0?e("span",{staticClass:"lblue point",staticStyle:{"margin-left":"40px"},domProps:{innerHTML:t._s(r.row.name)}}):t._e(),t._v(" "),0==r.row.parent_id?e("span",{staticClass:"lblue point",domProps:{innerHTML:t._s(r.row.name)}}):t._e()]}}])}),t._v(" "),e("el-table-column",{attrs:{prop:"uid",label:"分类ID"},scopedSlots:t._u([{key:"default",fn:function(r){return[e("span",{staticClass:"lblue point"},[t._v(t._s(r.row.id))])]}}])}),t._v(" "),e("el-table-column",{attrs:{prop:"uid",label:"别名"},scopedSlots:t._u([{key:"default",fn:function(r){return[e("span",{staticClass:"lblue point"},[t._v(t._s(r.row.sub_title))])]}}])}),t._v(" "),e("el-table-column",{attrs:{prop:"uid",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(r){return[e("el-button",{attrs:{type:"text"},on:{click:function(e){return t.add_(r.row.id,r.row.type)}}},[t._v("编辑分类")])]}}])})],1)],1),t._v(" "),e("el-drawer",{ref:"drawer_close",attrs:{title:"添加分类",size:"50%","destroy-on-close":!0,visible:t.drawer,wrapperClosable:!1,direction:t.direction},on:{"update:visible":function(e){t.drawer=e}}},[e("category_create",{attrs:{id:t.id,category_type:t.type}})],1)],1)}),[],!1,null,"f6b68d1e",null);e.default=component.exports}}]);