(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1464de19"],{c4a6:function(e,t,a){"use strict";var n=a("db0a"),r=a.n(n);r.a},cc81:function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"outmain ba_f"},[e._m(0),a("el-button",{attrs:{type:"primary",size:"medium"},on:{click:e.handleEdit}},[e._v("新增标签")]),a("div",{staticClass:"tabledata mar_t20"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{"element-loading-text":e.elementLoadingText,data:e.list,stripe:""},on:{"selection-change":e.setSelectRows}},[a("el-table-column",{attrs:{type:"selection",width:"55"}}),a("el-table-column",{attrs:{prop:"sort",label:"排序"}}),a("el-table-column",{attrs:{prop:"name",label:"标签名称"}}),a("el-table-column",{attrs:{prop:"display",label:"显示状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{},[a("el-switch",{attrs:{"active-value":"1","inactive-value":"2"},on:{change:function(a){return e.changeSwitch(t.row)}},model:{value:t.row.display,callback:function(a){e.$set(t.row,"display",a)},expression:"scope.row.display"}})],1)]}}])}),a("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"flex"},[a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.handleEdit(t.row)}}},[e._v("编辑")]),a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.handleDelete(t.row)}}},[e._v("删除")])],1)]}}])})],1),a("el-pagination",{attrs:{background:"",layout:"prev, pager, next",total:e.page.total,"page-size":e.page.pagesize,"current-page":e.page.currentPage},on:{"update:currentPage":function(t){return e.$set(e.page,"currentPage",t)},"update:current-page":function(t){return e.$set(e.page,"currentPage",t)},"current-change":e.handleCurrentChange}}),a("edit",{ref:"edit",on:{fetchData:e.fetchData}})],1)],1)},r=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"shuju_title mar_b20"},[a("div",{staticClass:"shuju_title_text"},[a("span",[e._v("门店标签")])])])}],s=(a("d81d"),a("96cf"),a("1da1")),i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{},[a("el-dialog",{attrs:{title:e.title,visible:e.dialogFormVisible,width:"600px"},on:{"update:visible":function(t){e.dialogFormVisible=t},close:e.close}},[a("el-form",{ref:"form",attrs:{model:e.form,"label-width":"120px"}},[a("el-form-item",{attrs:{label:"排序",prop:"sort"}},[a("el-input",{attrs:{autocomplete:"off"},model:{value:e.form.sort,callback:function(t){e.$set(e.form,"sort","string"===typeof t?t.trim():t)},expression:"form.sort"}})],1),a("el-form-item",{attrs:{label:"标签名称",prop:"name"}},[a("el-input",{attrs:{autocomplete:"off"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name","string"===typeof t?t.trim():t)},expression:"form.name"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"medium"},on:{click:e.close}},[e._v("取 消")]),a("el-button",{attrs:{size:"medium",type:"primary"},on:{click:e.save}},[e._v("确 定")])],1)],1)],1)},o=[],c=(a("b0c0"),a("e692")),l={name:"goodlistedit",created:function(){},data:function(){return{form:{id:"",name:"",sort:"",item:"3"},data:{},title:"",dialogFormVisible:!1}},components:{},methods:{showEdit:function(e){e?(this.title="编辑",this.form=Object.assign({},e)):this.title="添加",this.dialogFormVisible=!0},close:function(){this.$refs["form"].resetFields(),this.form=this.$options.data().form,this.dialogFormVisible=!1},save:function(){var e=this;this.$refs["form"].validate(function(){var t=Object(s["a"])(regeneratorRuntime.mark((function t(a){var n,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!a){t.next=15;break}return e.form2=Object.assign({},e.data),e.form2.id=e.form.id,e.form2.item=e.form.item,e.form2.sort=e.form.sort,e.form2.name=e.form.name,t.next=8,Object(c["x"])(e.form2);case 8:n=t.sent,r=n.msg,e.$baseMessage(r,"success"),e.$emit("fetchData"),e.close(),t.next=16;break;case 15:return t.abrupt("return",!1);case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}}},u=l,f=a("2877"),d=Object(f["a"])(u,i,o,!1,null,null,null),m=d.exports,p={components:{Edit:m},created:function(){this.fetchData()},data:function(){return{list:[],listLoading:!0,selectRows:"",elementLoadingText:"正在加载...",page:{total:0,size:10,currentPage:1}}},methods:{fetchData:function(){var e=this;return Object(s["a"])(regeneratorRuntime.mark((function t(){var a,n,r,s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.listLoading=!0,a={page:e.page.currentPage,item:3},t.next=4,Object(c["y"])(a);case 4:n=t.sent,r=n.data,s=n.count,e.list=r,e.page.total=s,setTimeout((function(){e.listLoading=!1}),100);case 10:case"end":return t.stop()}}),t)})))()},handleEdit:function(e){e.id?this.$refs["edit"].showEdit(e):this.$refs["edit"].showEdit()},setSelectRows:function(e){this.selectRows=e},handleCurrentChange:function(e){this.page.currentPage=e,this.fetchData()},changeSwitch:function(e){var t=this;return Object(s["a"])(regeneratorRuntime.mark((function a(){var n,r;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,Object(c["l"])({id:e.id,type:1,display:e.display});case 2:n=a.sent,r=n.msg,t.$baseMessage(r,"success"),t.fetchData();case 6:case"end":return a.stop()}}),a)})))()},handleDelete:function(e){var t=this;if(e.id)this.$baseConfirm("你确定要删除当前项吗",null,Object(s["a"])(regeneratorRuntime.mark((function a(){var n,r;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,Object(c["l"])({id:e.id,type:2});case 2:n=a.sent,r=n.msg,t.$baseMessage(r,"success"),t.fetchData();case 6:case"end":return a.stop()}}),a)}))));else{if(!(this.selectRows.length>0))return this.$baseMessage("未选中任何行","error"),!1;var a=this.selectRows.map((function(e){return e.id}));this.$baseConfirm("你确定要删除选中项吗",null,Object(s["a"])(regeneratorRuntime.mark((function e(){var n,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(c["l"])({id:a,type:2});case 2:n=e.sent,r=n.msg,t.$baseMessage(r,"success"),t.fetchData();case 6:case"end":return e.stop()}}),e)}))))}}}},h=p,g=(a("c4a6"),Object(f["a"])(h,n,r,!1,null,null,null));t["default"]=g.exports},db0a:function(e,t,a){}}]);