(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-60ef7e14"],{"23ba":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("div",{staticClass:"filter-item"},[i("el-input",{staticStyle:{width:"350px"},attrs:{placeholder:"商品名称","prefix-icon":"el-icon-search"},model:{value:t.listQuery.keyword,callback:function(e){t.$set(t.listQuery,"keyword",e)},expression:"listQuery.keyword"}})],1),i("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search"},on:{click:t.search}},[t._v("搜索")]),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 add ",staticStyle:{margin:"0"},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("div",{staticClass:"padding-bottom"},[i("el-button",{attrs:{type:"danger",size:"mini"},on:{click:t.batchDel}},[t._v("批量删除")])],1),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":""},on:{"selection-change":t.handleSelectionChange}},[i("el-table-column",{attrs:{type:"selection",width:"55"}}),i("el-table-column",{attrs:{label:"ID",sortable:"custom",align:"center",width:"80"},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:"name",align:"center"}}),i("el-table-column",{attrs:{label:"活动开始时间",property:"starttime",align:"center"}}),i("el-table-column",{attrs:{label:"活动结束时间",property:"endtime",align:"center"}}),i("el-table-column",{attrs:{label:"状态",property:"statusTpl",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){var s=e.row,a=e.$index;return[i("el-switch",{attrs:{value:1==s.status,"active-color":"#13ce66","inactive-color":"#DCDFE6"},on:{change:function(e){return t.setStatus(e,a)}}})]}}])}),i("el-table-column",{attrs:{label:"创建时间",property:"createtime",align:"center",width:"200"}}),i("el-table-column",{attrs:{label:"操作",align:"left",width:"240","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){var s=e.row,a=e.$index;return[i("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"编辑",placement:"top"}},[i("el-button",{attrs:{type:"primary",size:"mini",icon:"el-icon-edit"},on:{click:function(e){return t.edit(s)}}})],1),i("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"删除",placement:"top"}},[i("el-button",{attrs:{type:"danger",size:"mini",icon:"el-icon-delete"},on:{click:function(e){return t.del(s.id,a)}}})],1)]}}])})],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),i("copyright")],1)},a=[],l=(i("d778"),i("e8d6"),i("baf6"),i("333d")),n={name:"Goods",components:{Pagination:l["a"]},data:function(){return{list:null,total:0,listLoading:!0,listQuery:{page:1,keyword:"",limit:10,status:"",category_id:""},checked_ids:[]}},created:function(){this.getList()},methods:{refresh:function(){this.getList()},add:function(){this.$util.jump("./post")},edit:function(t){this.$util.jump("./post?id=".concat(t.id))},search:function(){this.listQuery.page=1,this.getList()},getList:function(){var t=this;this.listLoading=!0,this.api.get("seckill/index/getList",this.listQuery).then((function(e){t.listLoading=!1,1==e.code?(t.total=parseInt(e.data.total),t.list=e.data.list):(t.list=[],t.$util.error(e.message||e.msg||"数据异常"))}))},handleSelectionChange:function(t){for(var e=[],i=0;i<t.length;i++){var s=t[i].id;e.push(s)}this.checked_ids=e},batchDel:function(){if(0==this.checked_ids.length)return this.$util.error("请选择需要删除的数据");var t=this.checked_ids.join(",");this.del(t,-1)},del:function(t,e){var i=this;if(!t)return!1;this.$util.confirm("此操作将永久删除该数据, 是否继续?",(function(s){s&&i.api.get("seckill/index/delete",{id:t}).then((function(t){1==t.code?(i.checked_ids=[],-1==e?i.refresh():i.list.splice(e,1),i.$util.success(t.message)):i.$util.error(t.message)}))}))},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("seckill/index/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)}))}}},r=n,c=(i("8391"),i("3d7a")),o=Object(c["a"])(r,s,a,!1,null,null,null);e["default"]=o.exports},8391:function(t,e,i){"use strict";i("a56b")},a56b:function(t,e,i){}}]);