timer-legacy.783858f4.js 15 KB

1
  1. !function(){function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function t(t){for(var n=1;n<arguments.length;n++){var a=null!=arguments[n]?arguments[n]:{};n%2?e(Object(a),!0).forEach((function(e){r(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 r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t,r,n,a,i,o){try{var u=e[i](o),s=u.value}catch(c){return void r(c)}u.done?t(s):Promise.resolve(s).then(n,a)}function a(e){return function(){var t=this,r=arguments;return new Promise((function(a,i){var o=e.apply(t,r);function u(e){n(o,a,i,u,s,"next",e)}function s(e){n(o,a,i,u,s,"throw",e)}u(void 0)}))}}var i=document.createElement("style");i.innerHTML="._timer_udyla_1{background:#f6f8f9;min-height:100vh;overflow:hidden;padding:0 .37333rem}._timer_udyla_1 .van-button{font-size:.48rem;color:#fff}._tips_udyla_11{margin:.32rem 0;padding:.4rem .32rem;background:#ffffff;border-radius:.26667rem}._tips_udyla_11 ._tipsTitle_udyla_17{font-size:.48rem;font-weight:500;color:#000;line-height:.66667rem}._tips_udyla_11 ._tipsTime_udyla_23{padding-top:.10667rem;font-size:.37333rem;color:#ff9e5a;line-height:.58667rem}._tips_udyla_11 ._tipsTime_udyla_23 span{font-weight:600}._radio-group_udyla_32,._checkbox-group_udyla_33{display:flex;flex-wrap:wrap;margin-top:.37333rem}._radio-group_udyla_32 ._radio_udyla_32:first-child .van-radio__label,._checkbox-group_udyla_33 ._radio_udyla_32:first-child .van-radio__label,._radio-group_udyla_32 ._checkbox_udyla_33:first-child .van-checked__label,._checkbox-group_udyla_33 ._checkbox_udyla_33:first-child .van-checked__label{margin-left:0}._radio_udyla_32 .van-radio__icon{display:none}._colField_udyla_49{margin:.32rem 0;padding:.37333rem .32rem;background-color:#fff;border-radius:.26667rem}._colField_udyla_49 ._radio-group_udyla_32 .van-tag--large{width:2.50667rem;height:.8rem;font-size:.42667rem;text-align:center;display:flex;align-items:center;justify-content:center}._colField_udyla_49 ._radio-group_udyla_32 .van-tag{box-sizing:border-box}._colField_udyla_49 ._radio-group_udyla_32 .van-tag--default{color:var(--van-tag-text-default-color)}._colField_udyla_49 ._radio-group_udyla_32 .van-tag--primary{background-color:var(--tag-bg-color)}._colField_udyla_49 ._title_udyla_73{display:flex;align-items:center}._colField_udyla_49 ._title_udyla_73 img{width:.48rem;height:.48rem;margin-right:.10667rem}._timerContainer_udyla_82{background:#ffffff;border-radius:.26667rem;padding:.37333rem .13333rem .24rem}._timerContainer_udyla_82 .van-col{margin-bottom:.13333rem}._tag_udyla_90{height:.74667rem;background:#eff6f5;border-radius:.10667rem;font-size:.37333rem;font-weight:500;color:#2dc7aa;display:flex;align-items:center;justify-content:center}._active_udyla_101{background:#2dc7aa;color:#fff}._select_udyla_105{color:#fff!important;background:#ffb752}._btnGroupTimer_udyla_109{padding-top:.53333rem;background:#F6F8F9}\n",document.head.appendChild(i),System.register(["./ResizeObserver.es-legacy.a3d44ddf.js","./index-legacy.9388a023.js","./index-legacy.e4bfa7b6.js","./index-legacy.641cf68b.js","./index-legacy.ea1c5233.js","./index-legacy.8378b272.js","./index-legacy.79df9085.js","./index-legacy.58de274c.js","./index-legacy.af24b797.js"],(function(e){"use strict";var r,n,i,o,u,s,c,d,l,f,m,p,h,y,_,g,v;return{setters:[function(e){e.b6,r=e.d,n=e.w,i=e.y,o=e.T,u=e.n,s=e.j,c=e.A,d=e.B,l=e.$},function(e){f=e.R,m=e.C},function(e){p=e.R,h=e.a},function(){},function(e){y=e.T},function(e){_=e.C},function(e){g=e.T},function(e){v=e.C},function(){}],execute:function(){var b="_timer_udyla_1",w="_radio-group_udyla_32",x="_radio_udyla_32",S="_colField_udyla_49",M="_title_udyla_73",H="_timerContainer_udyla_82",k="_tag_udyla_90",A="_active_udyla_101",O="_select_udyla_105",T="_btnGroupTimer_udyla_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,r=/\d\d/,n=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,i={},o=function(e){return(e=+e)+(e>68?1900:2e3)},u=function(e){return function(t){this[e]=+t}},s=[/[+-]\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),r=60*t[1]+(+t[2]||0);return 0===r?0:"+"===t[0]?-r:r}(e)}],c=function(e){var t=i[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var r,n=i.meridiem;if(n){for(var a=1;a<=24;a+=1)if(e.indexOf(n(a,0,t))>-1){r=a>12;break}}else r=e===(t?"pm":"PM");return r},l={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:[r,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[n,u("seconds")],ss:[n,u("seconds")],m:[n,u("minutes")],mm:[n,u("minutes")],H:[n,u("hours")],h:[n,u("hours")],HH:[n,u("hours")],hh:[n,u("hours")],D:[n,u("day")],DD:[r,u("day")],Do:[a,function(e){var t=i.ordinal,r=e.match(/\d+/);if(this.day=r[0],t)for(var n=1;n<=31;n+=1)t(n).replace(/\[|\]/g,"")===e&&(this.day=n)}],M:[n,u("month")],MM:[r,u("month")],MMM:[a,function(e){var t=c("months"),r=(c("monthsShort")||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(r<1)throw new Error;this.month=r%12||r}],MMMM:[a,function(e){var t=c("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,u("year")],YY:[r,function(e){this.year=o(e)}],YYYY:[/\d{4}/,u("year")],Z:s,ZZ:s};function f(r){var n,a;n=r,a=i&&i.formats;for(var o=(r=n.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,r,n){var i=n&&n.toUpperCase();return r||a[n]||e[n]||a[i].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,r){return t||r.slice(1)}))}))).match(t),u=o.length,s=0;s<u;s+=1){var c=o[s],d=l[c],f=d&&d[0],m=d&&d[1];o[s]=m?{regex:f,parser:m}:c.replace(/^\[|\]$/g,"")}return function(e){for(var t={},r=0,n=0;r<u;r+=1){var a=o[r];if("string"==typeof a)n+=a.length;else{var i=a.regex,s=a.parser,c=e.slice(n),d=i.exec(c)[0];s.call(t,d),e=e.replace(d,"")}}return function(e){var t=e.afternoon;if(void 0!==t){var r=e.hours;t?r<12&&(e.hours+=12):12===r&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,r){r.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(o=e.parseTwoDigitYear);var n=t.prototype,a=n.parse;n.parse=function(e){var t=e.date,n=e.utc,o=e.args;this.$u=n;var u=o[1];if("string"==typeof u){var s=!0===o[2],c=!0===o[3],d=s||c,l=o[2];c&&(l=o[2]),i=this.$locale(),!s&&l&&(i=r.Ls[l]),this.$d=function(e,t,r){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var n=f(t)(e),a=n.year,i=n.month,o=n.day,u=n.hours,s=n.minutes,c=n.seconds,d=n.milliseconds,l=n.zone,m=new Date,p=o||(a||i?1:m.getDate()),h=a||m.getFullYear(),y=0;a&&!i||(y=i>0?i-1:m.getMonth());var _=u||0,g=s||0,v=c||0,b=d||0;return l?new Date(Date.UTC(h,y,p,_,g,v,b+60*l.offset*1e3)):r?new Date(Date.UTC(h,y,p,_,g,v,b)):new Date(h,y,p,_,g,v,b)}catch(e){return new Date("")}}(t,u,n),this.init(),l&&!0!==l&&(this.$L=this.locale(l).$L),d&&t!=this.format(u)&&(this.$d=new Date("")),i={}}else if(u instanceof Array)for(var m=u.length,p=1;p<=m;p+=1){o[1]=u[p-1];var h=r.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;n.extend(Y),n.extend(D);e("default",r({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 r,n,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 r=t.sent,n=r.data,e.startSetting=n.startTime?n.startTime:e.startSetting,e.endSetting=n.endTime?n.endTime:e.endSetting,e.courseMinutes=n.intervalTime?n.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,r,a){for(var i=n(e,"HH:mm"),o=n(r,"HH:mm"),u=[];i.add(a,"minute").isSameOrBefore(n(o));){var s={startTime:i.format("HH:mm"),endTime:i.add(a,"minute").format("HH:mm"),status:!1};u.push(s),i=i.add(a,"minute")}var c=[];return u.forEach((function(e){for(var r=[],n=0;n<7;n++)r.push(t({},e));c.push(r)})),this._initData(c)},_initData:function(e){var t=this.weekType,r=this.timerObject;return e.forEach((function(e){e.forEach((function(e,a){var i=r[t[a]],o=n(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,r){"row"===t&&this.list.forEach((function(t,n){var a=!r;t[e].status=a})),"col"==t&&this.list[e].forEach((function(e,t){var n=!r;e.status=n}))},onSubmit:function(){var e=this;return a(regeneratorRuntime.mark((function r(){var a,s,c;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return a=e.list,s={monday:[],tuesday:[],wednesday:[],thursday:[],friday:[],saturday:[],sunday:[]},c=e.weekType,a.forEach((function(e,t){e.forEach((function(e,t){e.status&&s[c[t]].push({startTime:n(e.startTime,"HH:mm").format("HH:mm:ss"),endTime:n(e.endTime,"HH:mm").format("HH:mm:ss")})}))})),r.next=6,i.post("/api-teacher/teacherFreeTime/upSet",{data:t(t({},s),{},{skipHolidayFlag:e.skipHolidayFlag})});case 6:setTimeout((function(){o("设置成功")}),100),setTimeout((function(){u({api:"back",content:{}})}),500);case 8:case"end":return r.stop()}}),r)})))()}},render:function(){var e=this;return s("div",{class:b},[s(v,null,null),s(_,{border:!1,class:S},{title:function(){return s("div",{class:M},[s("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,r;return s(p,{class:w,modelValue:e.skipHolidayFlag,"onUpdate:modelValue":function(t){return e.skipHolidayFlag=t}},"function"==typeof(r=t=["1","0"].map((function(t){var r=Number(t)===Number(e.skipHolidayFlag),n=r?"primary":"default";return s(h,{class:x,name:t},{default:function(){return[s(y,{size:"large",plain:r,type:n},{default:function(){return[e.chargeTypeArr[t]]}})]}})})))||"[object Object]"===Object.prototype.toString.call(r)&&!l(r)?t:{default:function(){return[t]}})}}),s("div",{class:[H,"mb12"]},[s(f,{gutter:5},{default:function(){return[s(m,{span:3},null),e.weekList.map((function(e){return s(m,{span:3},{default:function(){return[s("span",{class:k},[e])]}})}))]}}),s(f,{gutter:5},{default:function(){return[s(m,{span:3},null),e.weekList.map((function(t,r){return s(m,{span:3},{default:function(){return[s("span",{class:[k,e.btnStatus(r,"row")&&A],onClick:function(){return e.choice(r,"row",e.btnStatus(r,"row"))},title:t},[c("全选")])]}})}))]}}),this.list.map((function(t,r){return s(f,{gutter:5},{default:function(){return[s(m,{span:3},{default:function(){return[s("span",{class:[k,e.btnStatus(r,"col")&&A],onClick:function(){return e.choice(r,"col",e.btnStatus(r,"col"))}},[c("全选")])]}}),t.map((function(e){return s(m,{span:3},{default:function(){return[s("span",{class:[k,e.status&&O],title:e,style:{color:"#333333"},onClick:function(){return e.status=!e.status}},[e.startTime])]}})}))]}})}))]),s(g,{position:"bottom"},{default:function(){return[s("div",{class:["btnGroup",T]},[s(d,{block:!0,round:!0,type:"primary",onClick:e.onSubmit},{default:function(){return[c("确定")]}})])]}})])}}))}}}))}();