timer-legacy.983c0925.js 15 KB

1
  1. !function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{};r%2?e(Object(a),!0).forEach((function(e){n(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):e(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t,n,r,a,i,o){try{var s=e[i](o),u=s.value}catch(c){return void n(c)}s.done?t(u):Promise.resolve(u).then(r,a)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(a,i){var o=e.apply(t,n);function s(e){r(o,a,i,s,u,"next",e)}function u(e){r(o,a,i,s,u,"throw",e)}s(void 0)}))}}var i=document.createElement("style");i.innerHTML="._timer_ans88_1{background:#f6f8f9;min-height:100vh;overflow:hidden;padding:0 .37333rem}._timer_ans88_1 .van-button{font-size:.48rem;color:#fff}._tips_ans88_11{margin:.32rem 0;padding:.4rem .32rem;background:#ffffff;border-radius:.26667rem}._tips_ans88_11 ._tipsTitle_ans88_17{font-size:.48rem;font-weight:500;color:#000;line-height:.66667rem}._tips_ans88_11 ._tipsTime_ans88_23{padding-top:.10667rem;font-size:.37333rem;color:#ff9e5a;line-height:.58667rem}._tips_ans88_11 ._tipsTime_ans88_23 span{font-weight:600}._radio-group_ans88_32,._checkbox-group_ans88_33{display:flex;flex-wrap:wrap;margin-top:.37333rem}._radio-group_ans88_32 ._radio_ans88_32:first-child .van-radio__label,._checkbox-group_ans88_33 ._radio_ans88_32:first-child .van-radio__label,._radio-group_ans88_32 ._checkbox_ans88_33:first-child .van-checked__label,._checkbox-group_ans88_33 ._checkbox_ans88_33:first-child .van-checked__label{margin-left:0}._radio_ans88_32 .van-radio__icon{display:none}._colField_ans88_49{margin:.32rem 0;padding:.37333rem .32rem;background-color:#fff;border-radius:.26667rem}._colField_ans88_49 ._radio-group_ans88_32 .van-tag--large{width:2.50667rem;height:.8rem;font-size:.4rem;text-align:center;display:flex;align-items:center;justify-content:center}._colField_ans88_49 ._radio-group_ans88_32 .van-tag{box-sizing:border-box}._colField_ans88_49 ._radio-group_ans88_32 .van-tag--default{color:var(--van-tag-text-default-color)}._colField_ans88_49 ._radio-group_ans88_32 .van-tag--primary{background-color:var(--tag-bg-color)}._colField_ans88_49 ._title_ans88_73{display:flex;align-items:center}._colField_ans88_49 ._title_ans88_73 img{width:.48rem;height:.48rem;margin-right:.10667rem}._timerContainer_ans88_82{background:#ffffff;border-radius:.26667rem;padding:.37333rem .13333rem .24rem}._timerContainer_ans88_82 .van-col{margin-bottom:.13333rem}._tag_ans88_90{height:.74667rem;background:#eff6f5;border-radius:.10667rem;font-size:.32rem;font-weight:500;color:#2dc7aa;display:flex;align-items:center;justify-content:center}._active_ans88_101{background:#2dc7aa;color:#fff}._select_ans88_105{color:#fff!important;background:#ffb752}._btnGroupTimer_ans88_109{padding-top:.53333rem;background:#F6F8F9;padding-bottom:.8rem}\n",document.head.appendChild(i),System.register(["./ResizeObserver.es-legacy.8d60aee1.js","./index-legacy.f8f0c467.js","./index-legacy.df0bf034.js","./index-legacy.4e5c868b.js","./index-legacy.a85d660d.js","./index-legacy.2a290207.js","./index-legacy.4f8bc5f4.js","./index-legacy.87bcd48f.js","./index-legacy.bbc2b10e.js"],(function(e){"use strict";var n,r,i,o,s,u,c,d,f,l,m,p,h,_,g,y,v;return{setters:[function(e){e.b6,n=e.d,r=e.w,i=e.y,o=e.T,s=e.n,u=e.j,c=e.A,d=e.B,f=e.$},function(e){l=e.R,m=e.C},function(e){p=e.R,h=e.a},function(){},function(e){_=e.T},function(e){g=e.C},function(e){y=e.T},function(e){v=e.C},function(){}],execute:function(){var b="_timer_ans88_1",w="_radio-group_ans88_32",x="_radio_ans88_32",S="_colField_ans88_49",M="_title_ans88_73",H="_timerContainer_ans88_82",k="_tag_ans88_90",A="_active_ans88_101",O="_select_ans88_105",T="_btnGroupTimer_ans88_109",F={exports:{}};F.exports=function(e,t){t.prototype.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)}};var D=F.exports,j={exports:{}};!function(e,t){e.exports=function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d\d/,r=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,i={},o=function(e){return(e=+e)+(e>68?1900:2e3)},s=function(e){return function(t){this[e]=+t}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:"+"===t[0]?-n:n}(e)}],c=function(e){var t=i[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=i.meridiem;if(r){for(var a=1;a<=24;a+=1)if(e.indexOf(r(a,0,t))>-1){n=a>12;break}}else n=e===(t?"pm":"PM");return n},f={A:[a,function(e){this.afternoon=d(e,!1)}],a:[a,function(e){this.afternoon=d(e,!0)}],S:[/\d/,function(e){this.milliseconds=100*+e}],SS:[n,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[r,s("seconds")],ss:[r,s("seconds")],m:[r,s("minutes")],mm:[r,s("minutes")],H:[r,s("hours")],h:[r,s("hours")],HH:[r,s("hours")],hh:[r,s("hours")],D:[r,s("day")],DD:[n,s("day")],Do:[a,function(e){var t=i.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,"")===e&&(this.day=r)}],M:[r,s("month")],MM:[n,s("month")],MMM:[a,function(e){var t=c("months"),n=(c("monthsShort")||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[a,function(e){var t=c("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,s("year")],YY:[n,function(e){this.year=o(e)}],YYYY:[/\d{4}/,s("year")],Z:u,ZZ:u};function l(n){var r,a;r=n,a=i&&i.formats;for(var o=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var i=r&&r.toUpperCase();return n||a[r]||e[r]||a[i].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=o.length,u=0;u<s;u+=1){var c=o[u],d=f[c],l=d&&d[0],m=d&&d[1];o[u]=m?{regex:l,parser:m}:c.replace(/^\[|\]$/g,"")}return function(e){for(var t={},n=0,r=0;n<s;n+=1){var a=o[n];if("string"==typeof a)r+=a.length;else{var i=a.regex,u=a.parser,c=e.slice(r),d=i.exec(c)[0];u.call(t,d),e=e.replace(d,"")}}return function(e){var t=e.afternoon;if(void 0!==t){var n=e.hours;t?n<12&&(e.hours+=12):12===n&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(o=e.parseTwoDigitYear);var r=t.prototype,a=r.parse;r.parse=function(e){var t=e.date,r=e.utc,o=e.args;this.$u=r;var s=o[1];if("string"==typeof s){var u=!0===o[2],c=!0===o[3],d=u||c,f=o[2];c&&(f=o[2]),i=this.$locale(),!u&&f&&(i=n.Ls[f]),this.$d=function(e,t,n){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var r=l(t)(e),a=r.year,i=r.month,o=r.day,s=r.hours,u=r.minutes,c=r.seconds,d=r.milliseconds,f=r.zone,m=new Date,p=o||(a||i?1:m.getDate()),h=a||m.getFullYear(),_=0;a&&!i||(_=i>0?i-1:m.getMonth());var g=s||0,y=u||0,v=c||0,b=d||0;return f?new Date(Date.UTC(h,_,p,g,y,v,b+60*f.offset*1e3)):n?new Date(Date.UTC(h,_,p,g,y,v,b)):new Date(h,_,p,g,y,v,b)}catch(e){return new Date("")}}(t,s,r),this.init(),f&&!0!==f&&(this.$L=this.locale(f).$L),d&&t!=this.format(s)&&(this.$d=new Date("")),i={}}else if(s instanceof Array)for(var m=s.length,p=1;p<=m;p+=1){o[1]=s[p-1];var h=n.apply(this,o);if(h.isValid()){this.$d=h.$d,this.$L=h.$L,this.init();break}p===m&&(this.$d=new Date(""))}else a.call(this,e)}}}()}(j);var Y=j.exports;r.extend(Y),r.extend(D);e("default",n({name:"timer",data:function(){return{startSetting:"08:00",endSetting:"18:00",courseMinutes:30,timerObject:{},chargeTypeArr:{0:"否",1:"是"},timerList:[],skipHolidayFlag:1,list:[],weekList:["周一","周二","周三","周四","周五","周六","周日"],weekType:["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]}},mounted:function(){var e=this;return a(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e._initFetch();case 2:e.list=e.timerInit(e.startSetting,e.endSetting,e.courseMinutes||30);case 3:case"end":return t.stop()}}),t)})))()},methods:{_initFetch:function(){var e=this;return a(regeneratorRuntime.mark((function t(){var n,r,a,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,i.get("/api-teacher/teacher/queryTeacherTime");case 3:return n=t.sent,r=n.data,e.startSetting=r.startTime?r.startTime:e.startSetting,e.endSetting=r.endTime?r.endTime:e.endSetting,e.courseMinutes=r.intervalTime?r.intervalTime:e.courseMinutes,t.next=10,i.get("/api-teacher/teacherFreeTime/get");case 10:a=t.sent,(o=a.data)&&(e.timerObject={monday:o.monday?JSON.parse(o.monday):[],tuesday:o.tuesday?JSON.parse(o.tuesday):[],wednesday:o.wednesday?JSON.parse(o.wednesday):[],thursday:o.thursday?JSON.parse(o.thursday):[],friday:o.friday?JSON.parse(o.friday):[],saturday:o.saturday?JSON.parse(o.saturday):[],sunday:o.sunday?JSON.parse(o.sunday):[]},e.skipHolidayFlag=o.skipHolidayFlag?1:0),t.next=17;break;case 15:t.prev=15,t.t0=t.catch(0);case 17:case"end":return t.stop()}}),t,null,[[0,15]])})))()},timerInit:function(e,n,a){for(var i=r(e,"HH:mm"),o=r(n,"HH:mm"),s=[];i.add(a,"minute").isSameOrBefore(r(o));){var u={startTime:i.format("HH:mm"),endTime:i.add(a,"minute").format("HH:mm"),status:!1};s.push(u),i=i.add(a,"minute")}var c=[];return s.forEach((function(e){for(var n=[],r=0;r<7;r++)n.push(t({},e));c.push(n)})),this._initData(c)},_initData:function(e){var t=this.weekType,n=this.timerObject;return e.forEach((function(e){e.forEach((function(e,a){var i=n[t[a]],o=r(e.startTime,"HH:mm").format("HH:mm:ss");(null==i?void 0:i.some((function(e){return e.startTime===o})))&&(e.status=!0)}))})),e},btnStatus:function(e,t){return"row"===t?this.list.every((function(t){return t[e].status})):"col"==t?this.list[e].every((function(e){return e.status})):void 0},choice:function(e,t,n){"row"===t&&this.list.forEach((function(t,r){var a=!n;t[e].status=a})),"col"==t&&this.list[e].forEach((function(e,t){var r=!n;e.status=r}))},onSubmit:function(){var e=this;return a(regeneratorRuntime.mark((function n(){var a,u,c;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=e.list,u={monday:[],tuesday:[],wednesday:[],thursday:[],friday:[],saturday:[],sunday:[]},c=e.weekType,a.forEach((function(e,t){e.forEach((function(e,t){e.status&&u[c[t]].push({startTime:r(e.startTime,"HH:mm").format("HH:mm:ss"),endTime:r(e.endTime,"HH:mm").format("HH:mm:ss")})}))})),n.next=6,i.post("/api-teacher/teacherFreeTime/upSet",{data:t(t({},u),{},{skipHolidayFlag:e.skipHolidayFlag})});case 6:setTimeout((function(){o("设置成功")}),100),setTimeout((function(){s({api:"back",content:{}})}),500);case 8:case"end":return n.stop()}}),n)})))()}},render:function(){var e=this;return u("div",{class:b},[u(v,null,null),u(g,{border:!1,class:S},{title:function(){return u("div",{class:M},[u("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADYAAAA2CAYAAACMRWrdAAAAAXNSR0IArs4c6QAABQlJREFUaEPtmmtoHFUUgL8zm2AMDWxqfaGWQkEEtVXS0JdayyYpakURXLVC6w8pGGp3tVYEEQZECJaaTVuq1B/agq9URFGxNokxLWkriWjVH0VUpEWtD5pAQ5O4O3N0ZpPQpJvMZGbWkrX337L33jnfPeeee865VyjRJiXKxQWwmabZomhMe81KTvVfS0yuQa0rsaWKmFS4i2PpEIaeRmK/YekJZse/l0XmmagXLjIwbW2NcemRWmx7LTa3glYjVAIVKOWgsbzwYiFkgSGUMyB9GBzEMPbw54keSe61ooAMBaamabD05BxiFbeBPo1KDagRTDCxEf0S5EWsoQMcvuIvMU072FwEdx4j5pZEeAR0GThaiaRlQQ6hvM7seGtQMw2kMW3bOBeMnaArgFmR4Jw7yQBIF9iNUr/t+HS/MS0wVRU60jei4kAtn+7HgvWXbkQbSWS+FRH1O4dvMO1dX87pWfeRs0zgOr8fiKjfMcpiJlUD78miXY7j8Wy+wFxNfb4piWW1oFzuOWsxOgi/E4uluH1rqx/N+QNrTy1AeSeQphTHvf+AyBHQSpTFKFcjBPGexxAekLqWb7zWzhNsxFG8GWJP7cOwN5DY/hOmKdzSVwPyGqrXewlX+H/pBnuNl0OZEsx16X39raB3BRMC51irlYbm3tHxqght6UZEdwSeE/mY6nhyqqNgUjD38F3WvxbR7cFduvxNXXPFxD2hn22qwcqNwQYAHEDlcQ7F90x2iE8O9ulTl2HkHG05Z1XAJoNSn3HCqnFN83v2aMBJR4ZJF/ZQUla98keheSYH60jdj80b4SKKYoKRxeBhSbTs9Q3mBrSzuw+j1IZc1SJqzImn6eHUr0sLBc4FNaadTy4hZ3cHD2hHl6OoGnPIbMqM5bLypSMTFVAYrCO9E1sfC6ctZ3SxwQBDXpZEptETbMTFfwF6w4wAQ76jOr54ous/R2O6P30Toh8BV80MMH5BZbU0ZL4+W95zwTqeuBu1d6NUzwgwoQ8x1kmi+cOpwdo3rgfJoFw8Q8AGQdNSt23X1GD7U5sQmoCyGQEGOZRnpKFlq4cppp/Ftp8H8QyQvcH/A6+IKobxnCQyL/xPwaI0RZFBqSsQKx5ILWA4bKw4ph+fphip81BluPISWd3Ud7aZaFtqFbDP25R99BB8Oo9I3b0bfTRSFn9VVpo555d2mhVY/dtRfdSH2N5dfLv7SA9oV66TqNFETA+CXYFt3Am6EajyltpXD58HdD5rjiikGhNsEHDM0Slzx4GLfInsq5PPkMo1l8iCYF+ShevkNwjO74Oo0hY3Z3KKnI655DNm0YVuHOrUPkK36aYtkSWaDogcRthAVn52Ocp1HsoOVJeG55pmopk3xwhKAyKnkfKbJbHlx3HuvmPzfDT7FaphHEgWkTVSl3m30AIVu5jzgdRn7i30YW1Lvw96T3CtBS3mRFF+E96WupaHCoK1p95CeTAgWPDym2uOYQumIseJsVBWZvrHmWJnOo7FUVTnBgMLUTAd/WDoErfKbixMuSPjOg/9JD3v39PMRHRdQKjwJe4xuDCXEk6+JOI4j9HK7yJU5wfM96K7lHBXuVSvkfL7rQQv/sZMshSvasd5tVK7XB8Hl399U1rPIcZM033AMjCHsuwKlM2RPGARtpAb7jpvD1gmnkHRPDla0iPJ5Pl/cjTZAVtSj8SCRRHFGxVBslc84cLMfAEszOqdj7H/AKqYqVULVER1AAAAAElFTkSuQmCC"},null),c("是否跳过节假日")])},default:function(){var t,n;return u(p,{class:w,modelValue:e.skipHolidayFlag,"onUpdate:modelValue":function(t){return e.skipHolidayFlag=t}},"function"==typeof(n=t=["1","0"].map((function(t){var n=Number(t)===Number(e.skipHolidayFlag),r=n?"primary":"default";return u(h,{class:x,name:t},{default:function(){return[u(_,{size:"large",plain:n,type:r},{default:function(){return[e.chargeTypeArr[t]]}})]}})})))||"[object Object]"===Object.prototype.toString.call(n)&&!f(n)?t:{default:function(){return[t]}})}}),u("div",{class:[H,"mb12"]},[u(l,{gutter:5},{default:function(){return[u(m,{span:3},null),e.weekList.map((function(e){return u(m,{span:3},{default:function(){return[u("span",{class:k},[e])]}})}))]}}),u(l,{gutter:5},{default:function(){return[u(m,{span:3},null),e.weekList.map((function(t,n){return u(m,{span:3},{default:function(){return[u("span",{class:[k,e.btnStatus(n,"row")&&A],onClick:function(){return e.choice(n,"row",e.btnStatus(n,"row"))},title:t},[c("全选")])]}})}))]}}),this.list.map((function(t,n){return u(l,{gutter:5},{default:function(){return[u(m,{span:3},{default:function(){return[u("span",{class:[k,e.btnStatus(n,"col")&&A],onClick:function(){return e.choice(n,"col",e.btnStatus(n,"col"))}},[c("全选")])]}}),t.map((function(e){return u(m,{span:3},{default:function(){return[u("span",{class:[k,e.status&&O],title:e,style:{color:"#333333"},onClick:function(){return e.status=!e.status}},[e.startTime])]}})}))]}})}))]),u(y,{position:"bottom"},{default:function(){return[u("div",{class:["btnGroup",T]},[u(d,{block:!0,round:!0,type:"primary",onClick:e.onSubmit},{default:function(){return[c("确认")]}})])]}})])}}))}}}))}();