webpackJsonp([102],{g7Gv:function(e,t){},txlD:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("Xxa5"),i=a.n(r),s=a("exGp"),n=a.n(s),o=a("PJh5"),l=a.n(o),c={components:{},data:function(){return{loading:!1,storeList:[],searchForm:{page:1,limit:10},tableData:[],total:0,showDialog:!1,subForm:{id:"",title:""},subFormRules:{title:{required:!0,validator:this.$reg.isNotNull,text:"类目名称",reg_type:2,trigger:"blur"}}}},created:function(){var e=this;return n()(i.a.mark(function t(){return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e.getTableDataList();case 1:case"end":return t.stop()}},t,e)}))()},methods:{handleSizeChange:function(e){this.searchForm.limit=e,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.searchForm.page=e,this.getTableDataList()},getTableDataList:function(e){var t=this;e&&(this.searchForm.page=1),this.loading=!0,this.$api.channel.cateList(this.searchForm).then(function(e){t.loading=!1,200===e.code&&(t.tableData=e.data.data,t.total=e.data.total)})},confirmDel:function(e){var t=this;this.$confirm(this.$t("tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){t.updateItem(e,-1)})},updateItem:function(e,t){var a=this;return n()(i.a.mark(function r(){return i.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:a.$api.channel.cateUpdate({id:e,status:t}).then(function(e){if(200===e.code){if(a.$message.success(a.$t(-1===t?"tips.successDel":"tips.successOper")),-1!==t)return;a.searchForm.page=a.searchForm.page0&&void 0!==arguments[0]?arguments[0]:{};return n()(i.a.mark(function a(){var r;return i.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:for(r in e.subForm)e.subForm[r]=t[r];e.showDialog=!e.showDialog;case 2:case"end":return a.stop()}},a,e)}))()},submitFormInfo:function(){var e=this;return n()(i.a.mark(function t(){var a,r,s;return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a=!0,e.$refs.subForm.validate(function(e){e||(a=!1)}),!a){t.next=13;break}return r=e.subForm.id?"cateUpdate":"cateAdd",t.next=6,e.$api.channel[r](e.subForm);case 6:if(s=t.sent,200===s.code){t.next=10;break}return t.abrupt("return");case 10:e.$message.success(e.$t(e.subForm.id?"tips.successRev":"tips.successSub")),e.showDialog=!1,e.getTableDataList();case 13:case"end":return t.stop()}},t,e)}))()}},filters:{handleTime:function(e,t){return 1===t?l()(1e3*e).format("YYYY-MM-DD"):2===t?l()(1e3*e).format("HH:mm:ss"):l()(1e3*e).format("YYYY-MM-DD HH:mm:ss")}}},u={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"lb-appclass-classroom-list"},[a("top-nav"),e._v(" "),a("div",{staticClass:"page-main"},[a("el-row",{staticClass:"page-top-operate"},[a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-add",expression:"`${$route.name}-add`"}],attrs:{size:"medium",type:"primary",icon:"el-icon-plus"},on:{click:e.toShowDialog}},[e._v(e._s(e.$t("menu.ChannelClassifyAdd")))])],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:e.tableData,"header-cell-style":{background:"#f5f7fa",color:"#606266"},"tooltip-effect":"dark"}},[a("el-table-column",{attrs:{prop:"title",label:"类目名称"}}),e._v(" "),a("el-table-column",{attrs:{prop:"status",label:"是否上架"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-switch",{attrs:{disabled:!e.$route.meta.pagePermission[0].auth.includes("edit"),"active-value":1,"inactive-value":0},on:{change:function(a){return e.updateItem(t.row.id,t.row.status)}},model:{value:t.row.status,callback:function(a){e.$set(t.row,"status",a)},expression:"scope.row.status"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"create_time",label:"创建时间"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("p",[e._v(e._s(e._f("handleTime")(t.row.create_time,1)))]),e._v(" "),a("p",[e._v(e._s(e._f("handleTime")(t.row.create_time,2)))])]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"table-operate"},[a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-edit",expression:"`${$route.name}-edit`"}],attrs:{size:"mini",plain:"",type:"primary"},on:{click:function(a){return e.toShowDialog(t.row)}}},[e._v(e._s(e.$t("action.edit")))]),e._v(" "),a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:e.$route.name+"-delete",expression:"`${$route.name}-delete`"}],attrs:{size:"mini",plain:"",type:"danger"},on:{click:function(a){return e.confirmDel(t.row.id)}}},[e._v(e._s(e.$t("action.delete")))])],1)]}}])})],1),e._v(" "),a("lb-page",{attrs:{batch:!1,page:e.searchForm.page,pageSize:e.searchForm.limit,total:e.total},on:{handleSizeChange:e.handleSizeChange,handleCurrentChange:e.handleCurrentChange}}),e._v(" "),a("el-dialog",{attrs:{title:e.$t(e.subForm.id?"menu.ChannelClassifyEdit":"menu.ChannelClassifyAdd"),visible:e.showDialog,width:"550px",center:""},on:{"update:visible":function(t){e.showDialog=t}}},[a("el-form",{ref:"subForm",staticClass:"dialog-form",attrs:{model:e.subForm,rules:e.subFormRules,"label-width":"120px"}},[a("el-form-item",{attrs:{label:"类目名称",prop:"title"}},[a("el-input",{attrs:{maxlength:"10","show-word-limit":"",placeholder:"请输入类目名称"},model:{value:e.subForm.title,callback:function(t){e.$set(e.subForm,"title",t)},expression:"subForm.title"}})],1)],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.showDialog=!1}}},[e._v("取 消")]),e._v(" "),a("el-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick"}],attrs:{type:"primary"},on:{click:e.submitFormInfo}},[e._v("确 定")])],1)],1)],1)],1)},staticRenderFns:[]};var m=a("VU/8")(c,u,!1,function(e){a("g7Gv")},"data-v-117597b6",null);t.default=m.exports}});