11 lines
4.7 KiB
JavaScript
11 lines
4.7 KiB
JavaScript
|
require('./common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["packageA/ren-calendar"],{"1f87":function(t,e,a){"use strict";a.r(e);var n=a("39e8"),o=a("596c");for(var i in o)["default"].indexOf(i)<0&&function(t){a.d(e,t,(function(){return o[t]}))}(i);a("9617");var r=a("828b"),s=Object(r["a"])(o["default"],n["b"],n["c"],!1,null,"86787ab2",null,!1,n["a"],void 0);e["default"]=s.exports},"39e8":function(t,e,a){"use strict";a.d(e,"b",(function(){return n})),a.d(e,"c",(function(){return o})),a.d(e,"a",(function(){}));var n=function(){var t=this,e=t.$createElement,a=(t._self._c,t.headerBar?t.formatNum(t.m):null),n=t.__map(t.dates,(function(e,a){var n=t.__get_orig(e),o=t.isToday(e.year,e.month,e.date),i=t.isWorkDay(e.year,e.month,e.date),r=Number(e.date),s=t.isMarkDay(e.year,e.month,e.date)&&e.isCurM;return{$orig:n,m1:o,m2:i,m3:r,m4:s}}));t.$mp.data=Object.assign({},{$root:{m0:a,l0:n}})},o=[]},"57c5":function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={name:"ren-calendar",props:{weekstart:{type:Number,default:0},markDays:{type:Array,default:function(){return[]}},headerBar:{type:Boolean,default:!0},open:{type:Boolean,default:!0},collapsible:{type:Boolean,default:!0},disabledAfter:{type:Boolean,default:!1}},data:function(){return{weektext:["日","一","二","三","四","五","六"],y:(new Date).getFullYear(),m:(new Date).getMonth()+1,dates:[],positionTop:0,monthOpen:!0,choose:""}},created:function(){this.dates=this.monthDay(this.y,this.m),!this.open&&this.toggle()},mounted:function(){this.choose=this.getToday().date},computed:{weekDay:function(){return this.weektext.slice(this.weekstart).concat(this.weektext.slice(0,this.weekstart))},height:function(){return this.dates.length/7*80+"rpx"}},methods:{formatNum:function(t){var e=Number(t);return e<10?"0"+e:e},getToday:function(){var t=new Date,e=t.getFullYear(),a=t.getMonth(),n=t.getDate(),o=(new Date).getDay(),i="星期"+["日","一","二","三","四","五","六"][o],r={date:e+"-"+this.formatNum(a+1)+"-"+this.formatNum(n),week:i};return r},monthDay:function(t,e){for(var a=[],n=Number(e),o=new Date(t,n-1,1).getDay(),i=new Date(t,n,0).getDate(),r=new Date(t,n-2,0).getDate(),s=7==this.weekstart?0:this.weekstart,u=function(){return o==s?0:o>s?o-s:7-s+o}(),c=7-(u+i)%7,h=1;h<=u;h++)a.push({date:this.formatNum(r-u+h),day:s+h-1||7,month:n-1>=0?this.formatNum(n-1):12,year:n-1>=0?t:t-1});for(var f=1;f<=i;f++)a.push({date:this.formatNum(f),day:f%7+o-1||7,month:this.formatNum(n),year:t,isCurM:!0});for(var m=1;m<=c;m++)a.push({date:this.formatNum(m),day:(i+u+s+m-1)%7||7,month:n+1<=11?this.formatNum(n+1):0,year:n+1<=11?t:t+1});return a},isWorkDay:function(t,e,a){var n="".concat(t,"/").concat(e,"/").concat(a),o=new Date(n.replace(/-/g,"/")),i=o.getDay();return 0!=i&&6!=i},isFutureDay:function(t,e,a){var n="".concat(t,"/").concat(e,"/").concat(a),o=new Date(n.replace(/-/g,"/")),i=o.getTime(),r=(new Date).getTime();return i>r},isMarkDay:function(t,e,a){for(var n=!1,o=0;o<this.markDays.length;o++){var i="".concat(t,"-").concat(e,"-").concat(a);if(this.markDays[o]==i){n=!0;break}}return n},isToday:function(t,e,a){var n=t+"-"+e+"-"+a,o=this.getToday().date;return n==o},toggle:function(){var t=this;if(this.monthOpen=!this.monthOpen,this.monthOpen)this.positionTop=0;else{var e=-1;this.dates.forEach((function(a,n){t.isToday(a.year,a.month,a.date)&&(e=n)})),this.positionTop=80*-((Math.ceil((e+1)/7)||1)-1)}},selectOne:function(t,e){var a="".concat(t.year,"-").concat(t.month,"-").concat(t.date),n=new Date(a).getTime(),o=(new Date).getTime(),i=new Date(a).getDay(),r="星期"+["日","一","二","三","四","五","六"][i],s={date:a,week:r};if(!t.isCurM)return!1;if(n>o){if(this.disabledAfter)return console.log("未来日期不可选"),!1;this.choose=a,this.$emit("onDayClick",s)}else this.choose=a,this.$emit("onDayClick",s);console.log(s)},changYearMonth:function(t,e){this.dates=this.monthDay(t,e),this.y=t,this.m=e},changeMonth:function(t){"pre"==t?this.m+1==2?(this.m=12,this.y=this.y-1):this.m=this.m-1:this.m+1==13?(this.m=1,this.y=this
|
||
|
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
|
||
|
'packageA/ren-calendar-create-component',
|
||
|
{
|
||
|
'packageA/ren-calendar-create-component':(function(module, exports, __webpack_require__){
|
||
|
__webpack_require__('df3c')['createComponent'](__webpack_require__("1f87"))
|
||
|
})
|
||
|
},
|
||
|
[['packageA/ren-calendar-create-component']]
|
||
|
]);
|