(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-045f9cf4"],{4197:function(t,e,a){"use strict";a.r(e);var s=function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",{staticClass:"flex-row"},[t.timeSwitch.label?e("span",{staticClass:"label"},[t._v(t._s(t.timeSwitch.label)+" ")]):t._e(),e("div",{staticClass:"quick-date-box"},t._l(t.quickDateOptions.dateList,(function(a,s){return e("span",{key:s,staticClass:"pointer",class:["date-item",t.quickDateOptions.activeId===a.dateId?"active":""],on:{click:function(e){return t.select(a)}}},[t._v(t._s(a.dateStr))])})),0),e("div",{directives:[{name:"show",rawName:"v-show",value:t.dateSelectShow,expression:"dateSelectShow"}],staticClass:"date-conponents"},[e("el-date-picker",{attrs:{"value-format":"yyyy-MM-dd",type:"date",placeholder:"选择开始时间"},on:{change:function(e){return t.selectDate("start")}},model:{value:t.start_date,callback:function(e){t.start_date=e},expression:"start_date"}}),e("span",[t._v("  至  ")]),e("el-date-picker",{attrs:{"value-format":"yyyy-MM-dd",type:"date",placeholder:"选择结束时间"},on:{change:function(e){return t.selectDate("end")}},model:{value:t.end_date,callback:function(e){t.end_date=e},expression:"end_date"}})],1)])},d=[],i=(a("e9f5"),a("7d54"),a("9ab4")),r=a("60a3");let n=class extends r["f"]{constructor(){super(...arguments),this.option={dateList:[{dateId:0,dateStr:"今日",dateTag:"today"},{dateId:1,dateStr:"昨日",dateTag:"yesterday"},{dateId:2,dateStr:"上周",dateTag:"lastWeek"},{dateId:3,dateStr:"上月",dateTag:"lastMonth"},{dateId:4,dateStr:"最近7天",dateTag:"severalDays",dayNum:7},{dateId:5,dateStr:"最近30天",dateTag:"severalDays",dayNum:30},{dateId:6,dateStr:"其他",dateTag:"others"},{dateId:7,dateStr:"本周",dateTag:"week"},{dateId:8,dateStr:"本月",dateTag:"month"}],activeId:0},this.dateSelectShow=!1,this.start_date="",this.end_date=""}mounted(){this.quickDateOptions.dateList.forEach(t=>{t.dateId===this.quickDateOptions.activeId&&this.select(t)})}select(t){this.quickDateOptions.activeId=t.dateId,"others"!==t.dateTag?(this.dateSelectShow=!1,this.getDateRange(t)):this.dateSelectShow=!0}selectDate(t){switch(t){case"start":this.$emit("getDateRange",this.start_date,this.end_date);break;case"end":this.$emit("getDateRange",this.start_date,this.end_date);break}}formatByTimeStamp(t){const e=new Date(t);return this.formatByDate(e)}formatByDate(t){const e=t.getFullYear(),a=t.getMonth()+1,s=a<10?"0"+a:a,d=t.getDate()<10?"0"+t.getDate():t.getDate();return e+"-"+s+"-"+d}getDateRange(t){const e=new Date,a=e.getDay(),s=e.getFullYear(),d=e.getMonth(),i=e.getDate(),r=864e5;switch(t.dateTag){case"today":this.start_date=this.formatByDate(e),this.end_date=this.start_date;break;case"yesterday":this.start_date=this.formatByTimeStamp(e.getTime()-r),this.end_date=this.start_date;break;case"severalDays":if(t.dayNum){const a=e.getTime()-(t.dayNum-1)*r;this.start_date=this.formatByTimeStamp(a),this.end_date=this.formatByDate(e)}break;case"week":this.start_date=this.formatByTimeStamp(e.getTime()-(a-1)*r),this.end_date=this.formatByDate(e);break;case"lastWeek":{const t=e.getTime()-(i-a-1)*r;this.start_date=this.formatByTimeStamp(t-6*r),this.end_date=this.formatByTimeStamp(t);break}case"lastMonth":{let t=new Date;t=0===d?new Date(s-1,11,1):new Date(s,d-1,1),this.start_date=this.formatByDate(t),this.end_date=this.formatByDate(new Date(s,d,0));break}case"month":this.start_date=this.formatByTimeStamp(e.getTime()-(i-1)*r),this.end_date=this.formatByDate(e);break}this.$emit("getDateRange",this.start_date,this.end_date)}};Object(i["a"])([Object(r["c"])({type:Object,required:!1,default:{}})],n.prototype,"quickDateOptions",void 0),Object(i["a"])([Object(r["c"])({type:Object,required:!1,default:{}})],n.prototype,"timeSwitch",void 0),n=Object(i["a"])([Object(r["a"])({name:"QuickDateSelect"})],n);var c=n,o=c,h=(a("db3a"),a("2877")),l=Object(h["a"])(o,s,d,!1,null,"109ba8e7",null);e["default"]=l.exports},"99d6":function(t,e,a){},db3a:function(t,e,a){"use strict";a("99d6")}}]);
//# sourceMappingURL=chunk-045f9cf4.085a783f.js.map