1 |
- require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/admin/statistics/index"],{"1df5":function(e,t,i){"use strict";i.r(t);var a=i("b75e"),n=i("2fe2");for(var s in n)["default"].indexOf(s)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(s);i("3738");var r=i("f0c5"),o=Object(r["a"])(n["default"],a["b"],a["c"],!1,null,null,null,!1,a["a"],void 0);t["default"]=o.exports},"2fe2":function(e,t,i){"use strict";i.r(t);var a=i("4ebe"),n=i.n(a);for(var s in a)["default"].indexOf(s)<0&&function(e){i.d(t,e,(function(){return a[e]}))}(s);t["default"]=n.a},3738:function(e,t,i){"use strict";var a=i("8a27"),n=i.n(a);n.a},"4ebe":function(e,t,i){"use strict";(function(e){var a=i("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a(i("ee4f")),s=i("a82c"),r=null,o=(new Date).getFullYear(),h=(new Date).getMonth()+1,c=(new Date).getDate(),l={name:"Statistics",components:{uniCalendar:function(){Promise.all([i.e("common/vendor"),i.e("components/uni-calendar/uni-calendar")]).then(function(){return resolve(i("d209"))}.bind(null,i)).catch(i.oe)}},props:{},data:function(){return{value:[[o,h,c-1],[o,h,c]],isrange:!0,weekSwitch:!1,ismulti:!1,monFirst:!0,clean:!1,lunar:!1,renderValues:[],monthRange:[],current:!1,where:{start:"",stop:"",type:""},types:"",time:"",title:"",growth_rate:"",increase_time:"",increase_time_status:"",time_price:"",loaded:!1,loading:!1,filter:{page:1,limit:10,start:"",stop:""},list:[],cWidth:"",cHeight:"",pixelRatio:1,textarea:"",LineA:{categories:["2012","2013","2014","2015","2016","2017"],series:[{data:[35,8,25,37,4,20]}]},info:{startDate:"",endDate:"",lunar:!1,range:!0,insert:!1,selected:[],showMonth:!1},type:"",before:"",after:""}},watch:{"$route.params":function(e){void 0!=e&&(this.setType(e.type),this.setTime(e.time),this.getIndex())}},onLoad:function(t){this.type=t.type,t.before&&(this.before=t.before),t.after&&(this.after=t.after),this.setType(t.type),this.setTime(t.time),this.cWidth=e.upx2px(690),this.cHeight=e.upx2px(500),this.getInfo()},computed:{monthRangeText:function(){return this.monthRange.length?"固定":"指定范围"}},methods:{getIndex:function(){var e=[],t=[],i=this;(0,s.getStatisticsTime)(i.where).then((function(a){var n=a.data.chart,s=[],r=[];n.forEach((function(e){s.push(e.time),r.push(e.num)})),i.growth_rate=a.data.growth_rate,i.increase_time=a.data.increase_time,i.increase_time_status=a.data.increase_time_status,i.time_price=a.data.time,a.data.chart.forEach((function(i,a){e.push(i.time),t.push(i.num)})),i.LineA.categories=e,i.LineA.series[0].data=t,i.showLineA("canvasLineA",i.LineA)}),(function(e){i.$util.Tips({title:e})}))},setTime:function(e){this.time=e;var t=(new Date).getFullYear(),i=(new Date).getMonth()+1,a=(new Date).getDate();switch(this.list=[],this.filter.page=1,this.loaded=!1,this.loading=!1,e){case"today":this.where.start=new Date(Date.parse(t+"/"+i+"/"+a)).getTime()/1e3,this.where.stop=new Date(Date.parse(t+"/"+i+"/"+a)).getTime()/1e3+86400-1,this.title="今日",this.getIndex(),this.getInfo();break;case"yesterday":this.where.start=new Date(Date.parse(t+"/"+i+"/"+a)).getTime()/1e3-86400,this.where.stop=new Date(Date.parse(t+"/"+i+"/"+a)).getTime()/1e3-1,this.title="昨日",this.getIndex(),this.getInfo();break;case"month":this.where.start=new Date(t,(new Date).getMonth(),1).getTime()/1e3,this.where.stop=new Date(t,i,1).getTime()/1e3-1,this.title="本月",this.getIndex(),this.getInfo();break;case"seven":this.where.start=new Date(Date.parse(t+"/"+i+"/"+a)).getTime()/1e3+86400-604800,this.where.stop=new Date(Date.parse(t+"/"+i+"/"+a)).getTime()/1e3+86400-1,this.title="七日",this.getIndex(),this.getInfo();break;case"date":var n=new Date(this.before).getTime()/1e3,s=new Date(this.after).getTime()/1e3;this.where.start=n,this.where.stop=s,Promise.all([this.getIndex(),this.getInfo()]);break}},setType:function(e){switch(e){case"price":this.where.type=1;break;case"order":this.where.type=2;break}},dateTitle:function(){e.navigateTo({url:"/pages/admin/custom_date/index?type="+this.type})},close:function(){this.current=!1},getInfo:function(){var e=this;e.loading||e.loaded||(e.loading=!0,e.filter.start=e.where.start,e.filter.stop=e.where.stop,(0,s.getStatisticsMonth)(e.filter).then((function(t){e.loading=!1,e.loaded=t.data.length<e.filter.limit,e.list.push.apply(e.list,t.data),e.filter.page=e.filter.page+1}),(function(t){e.$util.Tips({title:t})})))},showLineA:function(e,t){r=new n.default({$this:this,canvasId:e,type:"line",fontSize:11,padding:[15,15,0,15],legend:{show:!1,padding:5,lineHeight:11,margin:5},dataLabel:!0,dataPointShape:!0,dataPointShapeType:"hollow",background:"#FFFFFF",pixelRatio:this.pixelRatio,categories:t.categories,series:t.series,animation:!0,enableScroll:!0,xAxis:{disableGrid:!1,type:"grid",gridType:"dash",itemCount:4,scrollShow:!0,scrollAlign:"left"},yAxis:{gridType:"dash",splitNumber:8,min:0,max:30,format:function(e){return e.toFixed(0)}},width:this.cWidth*this.pixelRatio,height:this.cHeight*this.pixelRatio,extra:{line:{type:"straight"}}})},touchLineA:function(e){r.scrollStart(e)},moveLineA:function(e){r.scroll(e)},touchEndLineA:function(e){r.scrollEnd(e)},confirm:function(e){if(e.range.after&&e.range.before){var t=new Date(e.range.before+" 00:00:00").getTime()/1e3,i=new Date(e.range.after+" 23:59:59").getTime()/1e3;this.where.start=t,this.where.stop=i,this.list=[],this.filter.page=1,this.loaded=!1,this.loading=!1,Promise.all([this.getIndex(),this.getInfo()])}}},onReachBottom:function(){this.getInfo()}};t.default=l}).call(this,i("543d")["default"])},"8a27":function(e,t,i){},b75e:function(e,t,i){"use strict";i.d(t,"b",(function(){return a})),i.d(t,"c",(function(){return n})),i.d(t,"a",(function(){}));var a=function(){var e=this.$createElement;this._self._c},n=[]},fd53:function(e,t,i){"use strict";(function(e,t){var a=i("4ea4");i("59a4");a(i("66fd"));var n=a(i("1df5"));e.__webpack_require_UNI_MP_PLUGIN__=i,t(n.default)}).call(this,i("bc2e")["default"],i("543d")["createPage"])}},[["fd53","common/runtime","common/vendor","pages/admin/common/vendor"]]]);
|