11 lines
5.7 KiB
JavaScript
11 lines
5.7 KiB
JavaScript
|
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/zzx-calendar/zzx-calendar"],{"1c1c":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n("2851"),a={props:{duration:{type:Number,default:500},dotList:{type:Array,default:function(){return[]}},showBack:{type:Boolean,default:!1},todayClass:{type:String,default:"is-today"},checkedClass:{type:String,default:"is-checked"},dotStyle:{type:Object,default:function(){return{background:"#c6c6c6"}}},defaultDate:{type:String,default:""}},watch:{dotList:function(t){var e=this.days.slice(0);t.forEach((function(t){var n=e.findIndex((function(e){return e.fullDate===t.date}));n>0&&(e[n].info=t)})),this.days=e}},computed:{sheight:function(){var t="70rpx";if(!this.weekMode){var e=new Date(this.currentYear,this.currentMonth,0),n=e.getDate(),r=new Date(e.setDate(1)).getDay();0===r&&(r=7);var a=8-r,i=Math.ceil((n-a)/7)+1;t=70*i+"rpx"}return t},timeStr:function(){var t,e=new Date(this.currentYear,this.currentMonth-1,this.currentDate),n=e.getFullYear(),r=e.getMonth()+1<=9?"0".concat(e.getMonth()+1):e.getMonth()+1;return t="".concat(n,"年").concat(r,"月"),t},predays:function(){var t=[];if(this.weekMode){var e=new Date(this.currentYear,this.currentMonth-1,this.currentDate);e.setDate(e.getDate()-7),t=(0,r.gegerateDates)(e,"week")}else{var n=new Date(this.currentYear,this.currentMonth-2,1);t=(0,r.gegerateDates)(n,"month")}return t},nextdays:function(){var t=[];if(this.weekMode){var e=new Date(this.currentYear,this.currentMonth-1,this.currentDate);e.setDate(e.getDate()+7),t=(0,r.gegerateDates)(e,"week")}else{var n=new Date(this.currentYear,this.currentMonth,1);t=(0,r.gegerateDates)(n,"month")}return t}},data:function(){return{weeks:["一","二","三","四","五","六","日"],current:1,currentYear:"",currentMonth:"",currentDate:"",days:[],weekMode:!0,swiper:[0,1,2],selectedDate:""}},methods:{changeSwp:function(t){var e=this.current,n=t.target.current;this.current=n,n-e===1||n-e===-2?this.daysNext():this.daysPre()},initDate:function(t){var e=this,n="";n=t?new Date(t):new Date,this.currentDate=n.getDate(),this.currentYear=n.getFullYear(),this.currentMonth=n.getMonth()+1,this.currentWeek=0===n.getDay()?7:n.getDay();(new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate(),(new Date).getDay();this.days=[];var a=[];a=this.weekMode?(0,r.gegerateDates)(n,"week"):(0,r.gegerateDates)(n,"month"),a.forEach((function(t){var n=e.dotList.find((function(e){return(0,r.dateEqual)(e.date,t.fullDate)}));n&&(t.info=n)})),this.days=a;var i={start:"",end:""};if(this.weekMode)i.start=this.days[0].time,i.end=this.days[6].time;else{var c=new Date(this.currentYear,this.currentMonth-1,1),s=new Date(this.currentYear,this.currentMonth,0);i.start=c,i.end=s}this.$emit("days-change",i)},daysPre:function(){if(this.weekMode){var t=new Date(this.currentYear,this.currentMonth-1,this.currentDate);t.setDate(t.getDate()-7),this.initDate(t)}else{var e=new Date(this.currentYear,this.currentMonth-2,1);this.initDate(e)}},daysNext:function(){if(this.weekMode){var t=new Date(this.currentYear,this.currentMonth-1,this.currentDate);t.setDate(t.getDate()+7),this.initDate(t)}else{var e=new Date(this.currentYear,this.currentMonth,1);this.initDate(e)}},changeMode:function(){var t=this,e=this.weekMode,n=!1;e&&(n=!!this.days.find((function(e){return e.fullDate===t.selectedDate}))),this.weekMode=!this.weekMode;var r=new Date(this.currentYear,this.currentMonth-1,this.currentDate),a=new Date(this.selectedDate.replace("-","/").replace("-","/")),i=a.getFullYear()===this.currentYear&&a.getMonth()+1===this.currentMonth;(this.selectedDate&&i||n)&&(r=new Date(this.selectedDate.replace("-","/").replace("-","/"))),this.initDate(r)},clickItem:function(t){this.selectedDate=t.fullDate,this.$emit("selected-change",t)},goback:function(){var t=new Date;this.initDate(t)},lookMonth:function(){this.$emit("lookMonth")},init:function(t){console.log(t,"======================"),t&&(this.initDate(),this.selectedDate=t)}},created:function(){},mounted:function(){}};e.default=a},"5feb":function(t,e,n
|
||
|
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
|
||
|
'components/zzx-calendar/zzx-calendar-create-component',
|
||
|
{
|
||
|
'components/zzx-calendar/zzx-calendar-create-component':(function(module, exports, __webpack_require__){
|
||
|
__webpack_require__('543d')['createComponent'](__webpack_require__("5feb"))
|
||
|
})
|
||
|
},
|
||
|
[['components/zzx-calendar/zzx-calendar-create-component']]
|
||
|
]);
|