index.33f2da56.js 7.4 KB

1
  1. import{bb as p,u as e,d as D,T as f,j as s,M as h,aR as y,z as m,B as u,F as Z}from"./index.e6d6174e.js";import"./index.bcc8eff6.js";import{C as Y}from"./index.cdab6a82.js";import{I as k}from"./index.67c54471.js";import{T as g}from"./index.05f2b7dd.js";const b="_calendar_1oek0_1",v="_subtitle_1oek0_4",S="_right_1oek0_15",T="_disabled_1oek0_18",J="_calenderPopup_1oek0_71",B="_popup_1oek0_76",C="_title_1oek0_80",M="_container_1oek0_90",x="_noDay_1oek0_100",F="_clock_1oek0_107",q="_tag_1oek0_116",_="_active_1oek0_123",j="_dayBtn_1oek0_128";var o={calendar:b,subtitle:v,right:S,disabled:T,calenderPopup:J,popup:B,title:C,container:M,noDay:x,clock:F,tag:q,active:_,dayBtn:j},d="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAMAAADW3miqAAAAAXNSR0IArs4c6QAAAKJQTFRFAAAAqv//3///2/Pz4P/34fjw4fj04vn23/jz4vjz4vj14fj14ff04Pfz4ff04fj04Pfz4Pj04ffz4Pj04Pfz4fj0LceqNMmtNsmtOcquO8qvPsuxRc2zSc61TM+2UtC5VdG6W9O8ZdbAcdnFctnGftzLjeDRjuDRrunfr+nfuOziwO7myPDpzPHrzvLr0vPt1PTu1/Tv2/Xx3fby3/fy4PfzO48SQAAAABZ0Uk5TAAMIFSEiRFhoaGiYpMTKzdfX6/j+/uKmZyQAAAD0SURBVDjLjZTXDsIwDEXd0tJCJx1m771n/v/XoAiQk5TK983WkRKvC0BkuX6UpGkS+a4FpTKcIBM/ZYFj6Ew9ForiuoKYXi405Z5JmVooShXWCNMSf9T6UWYo/ir8vuiJCnmfuvIqKH/XaMSiUnHRL0dLrzoLGjovKFCQxxKxRxMBgJ3JzH2O2N7STGZBQ2ZuM8TuTs654EvxdYrY3ysf8CGi4XmMODiohUSQkOg4RBydtGoTSEk0Qpxc9E6lPIj1HOvjrBawmlk6lo0yFtaAS1Zlra8Ka+lY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YOwvQTSQPADck8hEyDfTUyEPIkbwDM3TzuhwAkdQagJwGE9h9v5tARLlNSTAzPX1BWDkO2QUkRwmiFsg1IYgYlCVhWKTOi6FagLATLIhXf0GXMoAy2NBX6W7itUQFbmqrPcDulArY0Vb/hEm9SAVuaqmYcjixVsKXp4RMcBapgS9PDdziOqIItTQ/HcPyhCrbx9IvF1Qo7buGoUQXJ6AXb/sJhUgXZPNue4DCpCkEyzLZ/cNSoSkCSYFsNjjuqipAU2XYPxxE9FBMhdIQSRXacwLHLgezDkeVAluGINzmISbiccgDXcFvjANbh9sZgYM9xdNljYAfoFjMY0PMUJJsMaBuycJmB3I5AkdQZQH0GHjIN9tVchqcc+9qAj1yDPbXy8JXR2UN9GT0ky/R1O4OewpsGPT1vj6Cf2J5BxfPBFIIY/3rWpNv1ehyBvcv++FWpmY3a/cnP5Ul4+w80tbiPt9JlfAAAAABJRU5ErkJggg==",A={exports:{}};(function(t,n){(function(a,i){t.exports=i()})(p,function(){return function(a,i,l){i.prototype.isToday=function(){var r="YYYY-MM-DD",c=l();return this.format(r)===c.format(r)}}})})(A);var w=A.exports;e.extend(w);var U=D({name:"calendar",props:{calendarDate:{type:Date,default:()=>new Date},selectList:{type:Array,default:[]},list:{type:Object,default:{}},maxDays:{type:[Number,String],default:0},onSelect:{type:Function,default:t=>{}},prevMonth:{type:Function,default:t=>{}},nextMonth:{type:Function,default:t=>{}},selectDay:{type:Function,default:t=>{}},isSkipHolidays:{type:Boolean,default:!1}},data(){return{minDate:new Date,maxDate:new Date,currentDate:e().add(1,"day").toDate(),subtitle:"",show:!1,dayList:[],selectDays:[]}},computed:{arrowStatus(){return!e().add(1,"day").isBefore(e(this.currentDate),"month")},selectDayTitle(){return e(this.currentDate).format("YYYY-MM-DD")},isPrevDay(){return e(this.currentDate).subtract(1,"day").isBefore(e(this.minDate),"day")},isNextDay(){return e(this.currentDate).add(1,"day").isAfter(e(this.maxDate),"day")}},mounted(){this.subtitle=e().add(1,"day").format("YYYY\u5E74MM\u6708"),this.maxDate=e().add(1,"day").endOf("month").toDate(),this.minDate=e().add(1,"day").toDate()},methods:{formatter(t){var i;const n=e(t.date).format("YYYY-MM-DD"),a=this.list[n];return t.type="",a&&e().subtract(1,"day").isBefore(e(t.date))?(a.fullCourse||!(a!=null&&a.courseTime)||((i=a==null?void 0:a.courseTime)==null?void 0:i.length)<=0)&&(t.bottomInfo="\u6EE1",t.className="full",t.type="disabled"):t.type="disabled",this.$route.name=="liveCreate"&&e(t.date).isToday()&&(t.type="disabled"),a&&this.isSkipHolidays&&a.holiday&&(t.type="disabled"),t},onPrevMonth(){if(this.arrowStatus)return;const t=e(this.currentDate).subtract(1,"month");this._monthChange(t),this.prevMonth&&this.prevMonth(this.minDate)},onNextMonth(){const t=e(this.currentDate).add(1,"month");this._monthChange(t),this.nextMonth&&this.nextMonth(this.minDate)},_monthChange(t){const n=e().add(1,"day").toDate(),a=t.startOf("month").toDate();this.minDate=e(n).isAfter(a)?n:a,this.maxDate=t.endOf("month").toDate(),this.currentDate=t.toDate(),this.$emit("update:calendarDate",t.toDate()),this.subtitle=t.format("YYYY\u5E74MM\u6708")},onSelectDay(t){const n=this.selectDays.findIndex(a=>a.startTime===t.startTime);if(this.selectDays.length<this.maxDays||n!==-1){const a=this.selectDays.findIndex(i=>i.startTime===t.startTime);t.checked=!t.checked,a===-1?this.selectDays.push({...t}):this.selectDays.splice(a,1)}else f("\u6700\u591A\u9009\u62E9"+this.maxDays+"\u4E2A\u65F6\u95F4\u6BB5")},onPrevDay(){const t=e(this.currentDate).subtract(1,"day");this._dayChange(t.toDate())},onNextDay(){const t=e(this.currentDate).add(1,"day");this._dayChange(t.toDate())},onDateSelect(t){this.selectDays=[...this.selectList],this._dayChange(t),this.onSelect&&this.onSelect(t)},_dayChange(t){const n=e(t).format("YYYY-MM-DD");let a=[];this.list[n]&&Array.isArray(this.list[n].courseTime)&&(a=[...this.list[n].courseTime].filter(i=>e().isBefore(e(i.startTime)))),a.forEach(i=>{var r;i.start=e(i.startTime).format("HH:mm"),i.end=e(i.endTime).format("HH:mm");const l=(r=this.selectDays)==null?void 0:r.some(c=>c.startTime===i.startTime);i.checked=l}),this.dayList=a,this.currentDate=t,this.$emit("update:calendarDate",t),this.show=!0}},render(){return s(Z,null,[s(Y,{class:o.calendar,showTitle:!1,poppable:!1,showConfirm:!1,showMark:!1,firstDayOfWeek:1,rowHeight:56,minDate:this.minDate,maxDate:this.maxDate,color:"var(--van-primary)",formatter:this.formatter,onSelect:this.onDateSelect},{subtitle:()=>s("div",{class:o.subtitle},[s(h,{name:d,size:22,class:this.arrowStatus&&o.disabled,onClick:this.onPrevMonth},null),s("span",null,[this.subtitle]),s(h,{name:d,size:22,class:o.right,onClick:this.onNextMonth},null)])}),s(y,{show:this.show,class:o.calenderPopup},{default:()=>[s("div",{class:o.popup},[s("div",{class:o.title},[s("span",null,[this.selectDayTitle])]),s("div",{class:o.container},[this.dayList.map(t=>s("div",null,[s(g,{round:!0,class:[o.tag,t.checked?o.active:""],size:"large",plain:!0,onClick:()=>this.onSelectDay(t)},{default:()=>[t.start,m("\uFF5E"),t.end]})])),this.dayList.length<=0&&s("div",{class:o.noDay},[s(k,{src:Q,class:o.clock,fit:"cover"},null),s("span",null,[m("\u4ECA\u65E5\u5DF2\u7EA6\u6EE1")])])]),s("div",{class:o.dayBtn},[s(u,{round:!0,plain:!0,block:!0,style:{marginRight:"10px"},onClick:()=>{this.show=!1,this.selectDays=[]}},{default:()=>[m("\u53D6\u6D88")]}),s(u,{type:"primary",block:!0,round:!0,disabled:!(this.selectDays.length>0),onClick:()=>{this.selectDay&&this.selectDay(this.selectDays),this.show=!1}},{default:()=>[m("\u786E\u8BA4")]})])])]})])}});export{U as C};