2 lines
13 KiB
JavaScript
2 lines
13 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-144e8b05"],{"04a9":function(t,e,n){},"333d":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"pagination-container",class:{hidden:t.hidden}},[n("el-pagination",t._b({attrs:{background:t.background,"current-page":t.currentPage,"page-size":t.pageSize,layout:t.layout,"page-sizes":t.pageSizes,total:t.total},on:{"update:currentPage":function(e){t.currentPage=e},"update:current-page":function(e){t.currentPage=e},"update:pageSize":function(e){t.pageSize=e},"update:page-size":function(e){t.pageSize=e},"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}},"el-pagination",t.$attrs,!1))],1)},a=[],o=n("d4ec"),i=n("bee2"),u=n("262e"),c=n("2caf"),s=n("9ab4"),l=n("1b40"),p=(n("4795"),function(t,e,n,r){return t/=r/2,t<1?n/2*t*t+e:(t--,-n/2*(t*(t-2)-1)+e)}),d=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}(),f=function(t){document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t},m=function(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop},h=function(t,e,n){var r=m(),a=t-r,o=20,i=0;e="undefined"===typeof e?500:e;var u=function t(){i+=o;var u=p(i,r,a,e);f(u),i<e?d(t):n&&"function"===typeof n&&n()};u()},b=function(t){Object(u["a"])(n,t);var e=Object(c["a"])(n);function n(){return Object(o["a"])(this,n),e.apply(this,arguments)}return Object(i["a"])(n,[{key:"currentPage",get:function(){return this.page},set:function(t){this.$emit("update:page",t)}},{key:"pageSize",get:function(){return this.limit},set:function(t){this.$emit("update:limit",t)}},{key:"handleSizeChange",value:function(t){this.$emit("pagination",{page:this.currentPage,limit:t}),this.autoScroll&&h(0,800)}},{key:"handleCurrentChange",value:function(t){this.$emit("pagination",{page:t,limit:this.pageSize}),this.autoScroll&&h(0,800)}}]),n}(l["c"]);Object(s["a"])([Object(l["b"])({required:!0})],b.prototype,"total",void 0),Object(s["a"])([Object(l["b"])({default:1})],b.prototype,"page",void 0),Object(s["a"])([Object(l["b"])({default:20})],b.prototype,"limit",void 0),Object(s["a"])([Object(l["b"])({default:function(){return[10,20,30,50]}})],b.prototype,"pageSizes",void 0),Object(s["a"])([Object(l["b"])({default:"total, sizes, prev, pager, next, jumper"})],b.prototype,"layout",void 0),Object(s["a"])([Object(l["b"])({default:!0})],b.prototype,"background",void 0),Object(s["a"])([Object(l["b"])({default:!0})],b.prototype,"autoScroll",void 0),Object(s["a"])([Object(l["b"])({default:!1})],b.prototype,"hidden",void 0),b=Object(s["a"])([Object(l["a"])({name:"Pagination"})],b);var g=b,v=g,y=(n("34cc"),n("0c7c")),_=Object(y["a"])(v,r,a,!1,null,"2f4afb68",null);e["a"]=_.exports},"34cc":function(t,e,n){"use strict";n("04a9")},"4c9b":function(t,e,n){"use strict";n.d(e,"k",(function(){return a})),n.d(e,"i",(function(){return o})),n.d(e,"a",(function(){return i})),n.d(e,"d",(function(){return u})),n.d(e,"e",(function(){return c})),n.d(e,"c",(function(){return s})),n.d(e,"g",(function(){return l})),n.d(e,"j",(function(){return p})),n.d(e,"h",(function(){return d})),n.d(e,"f",(function(){return f})),n.d(e,"b",(function(){return m}));var r=n("2b0e"),a=new r["default"],o="event_shop_puzzles_update",i="event_activity_update",u="event_exam_update",c="event_game_update",s="event_coupon_update",l="event_puzzle_update",p="event_shop_update",d="event_role_update",f="event_mail_update",m="event_announce_update"},8960:function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"d",(function(){return o})),n.d(e,"c",(function(){return i})),n.d(e,"e",(function(){return u})),n.d(e,"b",(function(){return c}));var r=n("b32d"),a={shop:"",name:"",content:"",total:0,count:0,limitOne:1},o=function(t){return Object(r["a"])({url:"/api/coupons",method:"post",params:t})},i=function(t,e){return Object(r["a"])({url:"/api/coupon/".concat(t),method:"get",params:e})},u=function(t){return Object(r["a"])({url:"/api/coupon/save",method:"post",data:t})},c=function(t){return Object(r["a"])({url:"/api/coupon/".concat(t,"/delete"),method:"post"})}},db85:function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"k",(function(){return o})),n.d(e,"e",(function(){return i})),n.d(e,"d",(function(){return u})),n.d(e,"m",(function(){return c})),n.d(e,"b",(function(){return s})),n.d(e,"n",(function(){return l})),n.d(e,"f",(function(){return p})),n.d(e,"g",(function(){return d})),n.d(e,"q",(function(){return f})),n.d(e,"p",(function(){return m})),n.d(e,"c",(function(){return h})),n.d(e,"l",(function(){return b})),n.d(e,"h",(function(){return g})),n.d(e,"o",(function(){return v})),n.d(e,"i",(function(){return y})),n.d(e,"r",(function(){return _})),n.d(e,"j",(function(){return j}));var r=n("b32d"),a={name:"",address:"",logo:"",local:0,qtypes:[]},o=function(t){return Object(r["a"])({url:"/api/shops",method:"post",params:t})},i=function(t,e){return Object(r["a"])({url:"/api/shop/".concat(t),method:"get",params:e})},u=function(){return Object(r["a"])({url:"/api/myshop",method:"get"})},c=function(t){return Object(r["a"])({url:"/api/shop/save",method:"post",data:t})},s=function(t){return Object(r["a"])({url:"/api/shop/".concat(t,"/delete"),method:"post"})},l=function(t){return Object(r["a"])({url:"/api/shop/gameinfo/save",method:"post",data:t})},p=function(t){return Object(r["a"])({url:"/api/shop/gameinfo",method:"post",data:t})},d=function(t){return Object(r["a"])({url:"/api/shop/gameqr",method:"post",data:t})},f=function(t){return Object(r["a"])({url:"/api/shop/save_qtype",method:"post",data:t})},m=function(t){return Object(r["a"])({url:"/api/shop/publish",method:"post",data:t})},h=function(t){return Object(r["a"])({url:"/api/shop/gametheme",method:"post",data:t})},b=function(t){return Object(r["a"])({url:"/api/shop/gametheme/save",method:"post",data:t})},g=function(t){return Object(r["a"])({url:"/api/shop/lottery",method:"post",data:t})},v=function(t){return Object(r["a"])({url:"/api/shop/lottery_update",method:"post",data:t})},y=function(t){return Object(r["a"])({url:"/api/shop/share",method:"post",data:t})},_=function(t){return Object(r["a"])({url:"/api/shop/share_update",method:"post",data:t})},j=function(t){return Object(r["a"])({url:"/api/shop/game_users",method:"post",data:t})}},f08f:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"app-container"},[n("el-form",{ref:"filterForm",staticClass:"filter",attrs:{inline:!0,model:t.filterForm}},[n("el-form-item",{attrs:{label:"关键字",prop:"key"}},[n("el-input",{attrs:{placeholder:"关键字"},model:{value:t.filterForm.key,callback:function(e){t.$set(t.filterForm,"key",e)},expression:"filterForm.key"}})],1),1===t.userLevel?n("el-form-item",{attrs:{label:t.$t("main.shop")}},[n("el-select",{staticClass:"w100",attrs:{placeholder:"所有"},model:{value:t.filterForm.department,callback:function(e){t.$set(t.filterForm,"department",e)},expression:"filterForm.department"}},[n("el-option",{attrs:{value:""}},[t._v("所有")]),t._l(t.allDepts,(function(t){return n("el-option",{key:t._id,attrs:{label:t.name,value:t._id}})}))],2)],1):t._e(),n("el-form-item",[n("el-button",{attrs:{type:"primary"},on:{click:t.search}},[t._v("查询")]),n("el-button",{on:{click:t.resetFilterForm}},[t._v("重置")])],1)],1),n("router-link",{attrs:{to:"/marketing/edit_coupon"}},[n("el-button",{attrs:{type:"primary",icon:"el-icon-edit"}},[t._v(" 添加 ")])],1),n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],staticStyle:{width:"100%","margin-top":"30px"},attrs:{data:t.list,border:"",fit:"",stripe:"","highlight-current-row":""}},[n("el-table-column",{attrs:{width:"180px",align:"center",label:"添加时间"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;return[n("span",[t._v(t._s(t._f("parseTime")(r.createdAt)))])]}}])}),1===t.userLevel?n("el-table-column",{attrs:{label:t.$t("main.shop"),prop:"shop",formatter:t.formatDept}}):t._e(),n("el-table-column",{attrs:{"min-width":"200px",label:"名称"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;return[n("router-link",{staticClass:"link-type",attrs:{to:"/marketing/edit_coupon/"+r._id}},[n("span",[t._v(t._s(r.name))])])]}}])}),n("el-table-column",{attrs:{label:"有效期"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;return[n("span",[t._v(t._s(t._f("parseDate")(r.validBegin)))]),t._v(" 至 "),n("span",[t._v(t._s(t._f("parseDate")(r.validEnd)))])]}}])}),n("el-table-column",{attrs:{label:"库存"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;return[n("el-tag",[t._v(t._s(t._f("formatCount")(r.count)))]),t._v(" / "),n("el-tag",[t._v(t._s(t._f("formatCount")(r.total)))])]}}])}),n("el-table-column",{attrs:{align:"center",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("router-link",{attrs:{to:"/marketing/edit_coupon/"+e.row._id}},[n("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-edit"}},[t._v(" 编辑 ")])],1),n("el-button",{staticStyle:{"margin-left":"10px"},attrs:{type:"danger",size:"small"},on:{click:function(n){return t.handleDelete(e)}}},[t._v(" "+t._s(t.$t("permission.delete"))+" ")])]}}])})],1),n("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)},a=[],o=n("b85c"),i=n("1da1"),u=n("d4ec"),c=n("bee2"),s=n("262e"),l=n("2caf"),p=(n("a434"),n("b0c0"),n("96cf"),n("9ab4")),d=n("1b40"),f=n("333d"),m=n("db85"),h=n("d257"),b=n("8960"),g=n("9dba"),v=n("4c9b"),y=function(t){Object(s["a"])(n,t);var e=Object(l["a"])(n);function n(){var t;return Object(u["a"])(this,n),t=e.apply(this,arguments),t.total=0,t.list=[],t.listLoading=!0,t.allDepts=[],t.listQuery={page:1,limit:20,key:"",shop:""},t.filterForm={key:"",department:""},t}return Object(c["a"])(n,[{key:"userLevel",get:function(){return g["a"].level}},{key:"created",value:function(){var t=Object(i["a"])(regeneratorRuntime.mark((function t(){var e=this;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(1!==g["a"].level){t.next=6;break}return t.next=3,this.getRemoteDeptList();case 3:v["k"].$on(v["j"],(function(){e.getRemoteDeptList()})),t.next=8;break;case 6:this.filterForm.department=g["a"].department,this.listQuery.shop=g["a"].department;case 8:return t.next=10,this.getList();case 10:v["k"].$on(v["c"],(function(){e.getList()}));case 11:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"getList",value:function(){var t=Object(i["a"])(regeneratorRuntime.mark((function t(){var e,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.listLoading=!0,console.log(this.listQuery),t.next=4,Object(b["d"])(this.listQuery);case 4:e=t.sent,n=e.data,this.listLoading=!1,this.list=n.records,this.total=n.total;case 9:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"beforeDestory",value:function(){v["k"].$off(v["c"]),1===g["a"].level&&v["k"].$off(v["j"])}},{key:"handleDelete",value:function(){var t=Object(i["a"])(regeneratorRuntime.mark((function t(e){var n,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=e.$index,r=e.row,t.next=3,this.$confirm("确认删除该优惠券?","Warning",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"});case 3:return t.next=5,Object(b["b"])(r._id);case 5:this.list.splice(n,1),this.$message({type:"success",message:"删除成功!"});case 7:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}()},{key:"search",value:function(){this.filterData()}},{key:"filterData",value:function(){this.listQuery.key=this.filterForm.key,this.listQuery.shop=this.filterForm.department,this.listQuery.page=1,this.getList()}},{key:"resetFilterForm",value:function(){this.$refs.filterForm.resetFields()}},{key:"formatDept",value:function(t,e,n,r){var a,i="未指定",u=Object(o["a"])(this.allDepts);try{for(u.s();!(a=u.n()).done;){var c=a.value;if(c._id===n){i=c.name;break}}}catch(s){u.e(s)}finally{u.f()}return i}},{key:"getRemoteDeptList",value:function(){var t=Object(i["a"])(regeneratorRuntime.mark((function t(e){var n,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(m["k"])({key:e});case 2:if(n=t.sent,r=n.data,r.records){t.next=6;break}return t.abrupt("return");case 6:this.allDepts=r.records;case 7:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}()}]),n}(d["c"]);y=Object(p["a"])([Object(d["a"])({name:"CouponList",components:{Pagination:f["a"]},filters:{parseTime:function(t){return Object(h["d"])(t)},parseDate:function(t){return t?Object(h["d"])(t,"{y}-{m}-{d}"):"-"},formatCount:function(t){return t||0}}})],y);var _=y,j=_,k=n("0c7c"),O=Object(k["a"])(j,r,a,!1,null,null,null);e["default"]=O.exports}}]);
|
|
//# sourceMappingURL=chunk-144e8b05.6e1770a1.js.map
|