chunk-5e7f60e6.7758b57e.js 11 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-5e7f60e6"],{5964:function(t,e,r){},"5a93":function(t,e,r){"use strict";var n=r("5964");r.n(n).a},"61f7":function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function a(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(r,!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(r).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function s(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length)));var r={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds()};for(var n in r)if(new RegExp("(".concat(n,")")).test(e)){var a=r[n]+"";e=e.replace(RegExp.$1,1===RegExp.$1.length?a:o(a))}return e}function o(t){return("00"+t).substr(t.length)}r.d(e,"a",(function(){return i})),r.d(e,"c",(function(){return u})),r.d(e,"b",(function(){return m}));var c={min:"%s最小长度为:min",max:"%s最大长度为:max",length:"%s长度必须为:length",range:"%s长度为:range",pattern:"$s格式错误"},l=function(t,e){t.message=function(t){return e.replace("%s",t||"")}};function u(t){return a({required:!0,message:t,type:"string"},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}function m(t){return p.pattern(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,t)}l(u,"请输入%s"),l(m,"%s格式不正确");var p=Object.keys(c).reduce((function(t,e){return t[e]=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i="range"===e?{min:t[0],max:t[1]}:s({},e,t);return a({message:r.replace(":".concat(e),"range"===e?"".concat(t[0],"-").concat(t[1]):t),type:"string"},i,{},n)},l(t[e],c[e]),t}),{})},c2b3:function(t,e,r){"use strict";r.r(e);var n=r("a34a"),a=r.n(n),s=r("2f62"),i=r("b7be"),o=r("61f7"),c=r("2e83"),l=r("d708");function u(t,e,r,n,a,s,i){try{var o=t[s](i),c=o.value}catch(t){return void r(t)}o.done?e(c):Promise.resolve(c).then(n,a)}function m(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var s=t.apply(e,r);function i(t){u(s,n,a,i,o,"next",t)}function o(t){u(s,n,a,i,o,"throw",t)}i(void 0)}))}}function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function f(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var d={name:"storeSeckill",filters:{formatDate:function(t){if(0!==t){var e=new Date(1e3*t);return Object(o.a)(e,"yyyy-MM-dd")}}},data:function(){return{roterPre:l.a.roterPre,loading:!1,columns1:[{title:"ID",key:"id",width:80},{title:"活动名称",key:"name",minWidth:150},{title:"活动日期",slot:"days",minWidth:150},{title:"秒杀场次",slot:"times",minWidth:100},{title:"参与商品",key:"product_count",minWidth:100},{title:"活动状态",slot:"start_name",minWidth:100},{title:"是否开启",slot:"status",minWidth:100},{title:"创建时间",key:"add_time",minWidth:130},{title:"操作",slot:"action",fixed:"right",width:140}],tableList:[],grid:{xl:7,lg:10,md:12,sm:24,xs:24},tableFrom:{start_status:"",status:"",store_name:"",page:1,limit:15},total:0}},computed:function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(r,!0).forEach((function(e){f(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(r).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},Object(s.e)("admin/layout",["isMobile"]),{labelWidth:function(){return this.isMobile?void 0:96},labelPosition:function(){return this.isMobile?"top":"right"}}),created:function(){this.getList()},methods:{add:function(){this.$router.push({path:this.roterPre+"/marketing/store_seckill/create"})},exports:function(){var t=m(a.a.mark((function t(){var e,r,n,s,i,o,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=[],r=[],n=[],s="",(i=JSON.parse(JSON.stringify(this.tableFrom))).page=1,o=0;case 4:if(!(o<i.page+1)){t.next=21;break}return t.next=7,this.getExcelData(i);case 7:if(l=t.sent,s||(s=l.filename),r.length||(r=l.filekey),e.length||(e=l.header),!l.export.length){t.next=16;break}n=n.concat(l.export),i.page++,t.next=18;break;case 16:return Object(c.a)(e,r,s,n),t.abrupt("return");case 18:o++,t.next=4;break;case 21:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),getExcelData:function(t){return new Promise((function(e,r){Object(i.Db)(t).then((function(t){return e(t.data)}))}))},edit:function(t){this.$router.push({path:this.roterPre+"/marketing/store_seckill/create/"+t.id+"/0"})},copy:function(t){this.$router.push({path:this.roterPre+"/marketing/store_seckill/create/"+t.id+"/1"})},del:function(t,e,r){var n=this,a={title:e,num:r,url:"marketing/seckill/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(a).then((function(t){n.$Message.success(t.msg),n.tableList.splice(r,1),n.tableList.length||(n.tableFrom.page=1==n.tableFrom.page?1:n.tableFrom.page-1),n.getList()})).catch((function(t){n.$Message.error(t.msg)}))},viewInfo:function(t){this.$router.push({path:this.roterPre+"/marketing/store_seckill/statistics/"+t.id})},getList:function(){var t=this;this.loading=!0,this.tableFrom.start_status=this.tableFrom.start_status||"",this.tableFrom.status=this.tableFrom.status||"",Object(i.tb)(this.tableFrom).then(function(){var e=m(a.a.mark((function e(r){var n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=r.data,t.tableList=n.list,t.total=r.data.count,t.loading=!1;case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.loading=!1,t.$Message.error(e.msg)}))},pageChange:function(t){this.tableFrom.page=t,this.getList()},userSearchs:function(){this.tableFrom.page=1,this.getList()},onchangeIsShow:function(t){var e=this,r={id:t.id,status:t.status};Object(i.xb)(r).then(function(){var t=m(a.a.mark((function t(r){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.$Message.success(r.msg),e.getList();case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.$Message.error(t.msg)}))}}},h=(r("5a93"),r("2877")),g=Object(h.a)(d,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":"",padding:0}},[r("div",{staticClass:"new_card_pd"},[r("Form",{ref:"tableFrom",attrs:{model:t.tableFrom,"label-width":t.labelWidth,"label-position":t.labelPosition,inline:""},nativeOn:{submit:function(t){t.preventDefault()}}},[r("FormItem",{attrs:{label:"活动状态:",clearable:""}},[r("Select",{staticClass:"input-add",attrs:{placeholder:"请选择",clearable:""},on:{"on-change":function(e){return t.userSearchs()}},model:{value:t.tableFrom.start_status,callback:function(e){t.$set(t.tableFrom,"start_status",e)},expression:"tableFrom.start_status"}},[r("Option",{attrs:{value:"0"}},[t._v("未开始")]),r("Option",{attrs:{value:1}},[t._v("进行中")]),r("Option",{attrs:{value:-1}},[t._v("已结束")])],1)],1),r("FormItem",{attrs:{label:"是否开启:"}},[r("Select",{staticClass:"input-add",attrs:{placeholder:"请选择",clearable:""},on:{"on-change":t.userSearchs},model:{value:t.tableFrom.status,callback:function(e){t.$set(t.tableFrom,"status",e)},expression:"tableFrom.status"}},[r("Option",{attrs:{value:"1"}},[t._v("开启")]),r("Option",{attrs:{value:"0"}},[t._v("关闭")])],1)],1),r("FormItem",{attrs:{label:"商品搜索:","label-for":"store_name"}},[r("Input",{staticClass:"input-add mr14",attrs:{placeholder:"请输入秒杀名称,ID"},on:{"on-search":t.userSearchs},model:{value:t.tableFrom.store_name,callback:function(e){t.$set(t.tableFrom,"store_name",e)},expression:"tableFrom.store_name"}}),r("Button",{staticClass:"mr14",attrs:{type:"primary"},on:{click:function(e){return t.userSearchs()}}},[t._v("查询")])],1)],1)],1)]),r("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[r("Button",{directives:[{name:"auth",rawName:"v-auth",value:["marketing-store_seckill-create"],expression:"['marketing-store_seckill-create']"}],staticClass:"mr10",attrs:{type:"primary"},on:{click:t.add}},[t._v("添加秒杀活动")]),r("Table",{staticClass:"ivu-mt",attrs:{columns:t.columns1,data:t.tableList,loading:t.loading,"highlight-row":"","no-userFrom-text":"暂无数据","no-filtered-userFrom-text":"暂无筛选结果"},scopedSlots:t._u([{key:"days",fn:function(e){var n=e.row;return[r("div",[t._v(t._s(n.start_day)+" - "+t._s(n.end_day))])]}},{key:"times",fn:function(e){var n=e.row;return[r("div",t._l(n.time_list,(function(e){return r("div",{staticClass:"time"},[t._v(t._s(e.start_time)+" - "+t._s(e.end_time)+";")])})),0)]}},{key:"info",fn:function(e){var n=e.row;return[r("Tooltip",{attrs:{"max-width":"200",placement:"bottom"}},[r("span",{staticClass:"line2"},[t._v(t._s(n.info))]),r("p",{attrs:{slot:"content"},slot:"content"},[t._v(t._s(n.info))])])]}},{key:"start_name",fn:function(e){var n=e.row;return[r("Tag",{directives:[{name:"show",rawName:"v-show",value:"未开始"===n.start_name,expression:"row.start_name === '未开始'"}],attrs:{color:"orange",size:"medium"}},[t._v(t._s(n.start_name))]),r("Tag",{directives:[{name:"show",rawName:"v-show",value:"进行中"===n.start_name,expression:"row.start_name === '进行中'"}],attrs:{color:"green",size:"medium"}},[t._v(t._s(n.start_name))]),r("Tag",{directives:[{name:"show",rawName:"v-show",value:"已结束"===n.start_name,expression:"row.start_name === '已结束'"}],attrs:{color:"default",size:"medium"}},[t._v(t._s(n.start_name))])]}},{key:"stop_time",fn:function(e){var n=e.row;return[r("span",[t._v(" "+t._s(n._stop_time))])]}},{key:"status",fn:function(e){var n=e.row;return[r("i-switch",{attrs:{value:n.status,"true-value":1,"false-value":0,size:"large"},on:{"on-change":function(e){return t.onchangeIsShow(n)}},model:{value:n.status,callback:function(e){t.$set(n,"status",e)},expression:"row.status"}},[r("span",{attrs:{slot:"open"},slot:"open"},[t._v("开启")]),r("span",{attrs:{slot:"close"},slot:"close"},[t._v("关闭")])])]}},{key:"action",fn:function(e){var n=e.row,a=e.index;return[r("a",{on:{click:function(e){return t.edit(n)}}},[t._v("编辑")]),r("Divider",{attrs:{type:"vertical"}}),r("a",{on:{click:function(e){return t.copy(n)}}},[t._v("复制")]),r("Divider",{attrs:{type:"vertical"}}),r("a",{on:{click:function(e){return t.del(n,"删除秒杀商品",a)}}},[t._v("删除")])]}}])}),r("div",{staticClass:"acea-row row-right page"},[r("Page",{attrs:{total:t.total,current:t.tableFrom.page,"show-elevator":"","show-total":"","page-size":t.tableFrom.limit},on:{"on-change":t.pageChange}})],1)],1)],1)}),[],!1,null,"49cf85ea",null);e.default=g.exports}}]);