(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5938"],{"386d":function(t,e,a){a("214f")("search",1,function(t,e,a){return[function(a){"use strict";var i=t(this),s=void 0==a?void 0:a[e];return void 0!==s?s.call(a,i):new RegExp(a)[e](String(i))},a]})},"3ab3":function(t,e,a){},be7f:function(t,e,a){"use strict";var i=a("3ab3"),s=a.n(i);s.a},e2b2:function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"layout-categoryList"},[a("div",{staticClass:"layout-categoryList-search"},[a("Form",{attrs:{model:t.search,inline:""}},[a("FormItem",{attrs:{label:"分类名称:","label-width":70}},[a("Input",{staticStyle:{width:"200px"},attrs:{placeholder:"请输入分类名称..."},model:{value:t.search.name,callback:function(e){t.$set(t.search,"name",e)},expression:"search.name"}})],1),a("FormItem",[a("Button",{attrs:{type:"primary"},on:{click:function(e){t.query()}}},[t._v("搜索")])],1)],1)],1),a("div",{staticClass:"layout-categoryList-add"},[a("Button",{attrs:{type:"success"},on:{click:function(e){t.modalAdd=!0}}},[t._v("添加")]),a("Modal",{attrs:{title:"添加"},model:{value:t.modalAdd,callback:function(e){t.modalAdd=e},expression:"modalAdd"}},[a("div",{attrs:{slot:"footer"},slot:"footer"},[a("a",{staticClass:"span",on:{click:t.addCancel}},[t._v("取消")]),a("Button",{attrs:{type:"primary"},on:{click:t.addOk}},[t._v("确定")])],1),a("Form",{ref:"info",attrs:{model:t.info,"label-position":"right","label-width":100,rules:t.ruleValidate}},[a("FormItem",{attrs:{label:"分类名称:",prop:"name"}},[a("Input",{attrs:{placeholder:"请输入分类名称..."},model:{value:t.info.name,callback:function(e){t.$set(t.info,"name",e)},expression:"info.name"}})],1),a("FormItem",{attrs:{label:"描述:"}},[a("Input",{attrs:{type:"textarea",rows:4,placeholder:"请输入描述..."},model:{value:t.info.desc,callback:function(e){t.$set(t.info,"desc",e)},expression:"info.desc"}})],1)],1)],1)],1),a("div",{staticStyle:{clear:"both"}}),a("div",{staticClass:"layout-categoryList-table"},[a("Table",{attrs:{border:"",columns:t.columns1,data:t.data1}})],1),a("div",{staticClass:"layout-categoryList-page"},[a("Page",{attrs:{total:t.total,current:t.page,"page-size":t.pageSize,"show-elevator":""},on:{"on-change":t.changePage}})],1),a("div",{staticClass:"layout-categoryList-edit"},[a("Modal",{attrs:{title:"修改"},model:{value:t.modalEdit,callback:function(e){t.modalEdit=e},expression:"modalEdit"}},[a("div",{attrs:{slot:"footer"},slot:"footer"},[a("a",{staticClass:"span",on:{click:function(e){t.modalEdit=!1}}},[t._v("取消")]),a("Button",{attrs:{type:"primary"},on:{click:t.editOk}},[t._v("确定")])],1),a("Form",{ref:"edit",attrs:{model:t.edit,"label-position":"right","label-width":100,rules:t.ruleValidate}},[a("FormItem",{attrs:{label:"分类ID:"}},[a("Input",{attrs:{disabled:""},model:{value:t.edit.id,callback:function(e){t.$set(t.edit,"id",e)},expression:"edit.id"}})],1),a("FormItem",{attrs:{label:"分类名称:",prop:"name"}},[a("Input",{attrs:{placeholder:"请输入分类名称..."},model:{value:t.edit.name,callback:function(e){t.$set(t.edit,"name",e)},expression:"edit.name"}})],1),a("FormItem",{attrs:{label:"状态:"}},[a("Select",{model:{value:t.edit.status,callback:function(e){t.$set(t.edit,"status",e)},expression:"edit.status"}},[a("Option",{attrs:{value:1}},[t._v("上线")]),a("Option",{attrs:{value:2}},[t._v("删除")]),a("Option",{attrs:{value:3}},[t._v("下线")])],1)],1),a("FormItem",{attrs:{label:"创建时间:"}},[a("Input",{attrs:{disabled:""},model:{value:t.edit.Iscreate_time,callback:function(e){t.$set(t.edit,"Iscreate_time",e)},expression:"edit.Iscreate_time"}})],1),a("FormItem",{attrs:{label:"描述:"}},[a("Input",{attrs:{type:"textarea",rows:4,placeholder:"请输入描述..."},model:{value:t.edit.desc,callback:function(e){t.$set(t.edit,"desc",e)},expression:"edit.desc"}})],1)],1)],1)],1)])},s=[],o=(a("ac6a"),a("386d"),a("7f7f"),a("c1df")),n={data:function(){var t=this;return{search:{name:""},page:1,total:0,pageSize:30,info:{},modalAdd:!1,edit:{},modalEdit:!1,id:"",ruleValidate:{name:[{type:"string",required:!0,message:"请输入分类名称...",trigger:"blur"}]},columns1:[{title:"分类ID",key:"id",align:"center"},{title:"分类名称",key:"name",align:"center"},{title:"创建时间",key:"Iscreate_time",align:"center"},{title:"状态",key:"ISstatus",align:"center"},{title:"描述",key:"desc",align:"center"},{title:"操作",width:160,align:"center",render:function(e,a){return e("div",[e("Button",{props:{type:"primary",size:"small"},style:{marginRight:"5px"},on:{click:function(){t.modify(a.row)}}},"修改"),e("Poptip",{props:{confirm:!0,title:"确定要删除吗！",type:"error",size:"small",width:"150"},on:{"on-ok":function(){t.remove(a.row)}}},[e("Button",{props:{type:"error",size:"small"}},"删除")])])}}],data1:[]}},methods:{getTableList:function(){var t=this;t.$http(this.$config.BaseURL1+"/media/v2/category/list?name="+t.search.name+"&page="+this.page+"&pageSize="+t.pageSize).then(function(e){1e4==e.data.errno&&(console.log(e),t.data1=e.data.data.list,e.data.data.list.forEach(function(t){1==t.status?t.ISstatus="上线":2==t.status?t.ISstatus="删除":3==t.status&&(t.ISstatus="下线"),t.Iscreate_time=o(1e3*t.create_time).format("YYYY-MM-DD HH:mm:ss")}),t.total=e.data.data.total)},function(t){})},addOk:function(){var t=this,e=this,a=!0;e.$refs["info"].validate(function(e){0==e&&(t.$Message.error("表单输入有误,请检查!"),a=!1)}),0!=a&&e.$http.post(this.$config.BaseURL1+"/media/v2/category/modify",e.info).then(function(e){1e4==e.data.errno&&(t.info={},t.modalAdd=!1,t.getTableList(),t.$Message.success("添加成功！"))},function(t){})},addCancel:function(){this.info={},this.modalAdd=!1},modify:function(t){console.log(t),this.edit=t,this.id=t,t.Iscreate_time=o(1e3*t.create_time).format("YYYY-MM-DD HH:mm:ss"),this.modalEdit=!0},editOk:function(){var t=this,e=this,a=!0;e.$refs["edit"].validate(function(e){0==e&&(t.$Message.error("表单输入有误,请检查!"),a=!1)}),0!=a&&e.$http.post(this.$config.BaseURL1+"/media/v2/category/modify?id="+e.id,e.edit).then(function(e){1e4==e.data.errno&&(t.modalEdit=!1,t.getTableList(),t.$Message.success("修改成功！"))},function(t){})},remove:function(t){var e=this;console.log(t);var a=this;1!=t.status?a.$http.post(this.$config.BaseURL1+"/media/v2/category/delete",{id:t.id}).then(function(t){1e4==t.data.errno&&(e.getTableList(),e.$Message.success("删除成功！"))},function(t){}):this.$Message.warning("节目是上线的不能删除！")},query:function(){this.page=1,this.getTableList()},changePage:function(t){this.page=t,this.getTableList()}},mounted:function(){this.getTableList()}},l=n,r=(a("be7f"),a("2877")),c=Object(r["a"])(l,i,s,!1,null,null,null);c.options.__file="categoryList.vue";e["default"]=c.exports}}]);