// ==UserScript==
// @name IOA easy
// @namespace *://lanhuapp.com/*
// @version 0.1
// @description 一键申请调休加班
// @author Bajn
// @match *://tcsk.17usoft.com/*
// @icon https://tse4-mm.cn.bing.net/th/id/OIP-C.Ut7sgxuBD4rvF9vqWv1fsAHaHa?pid=ImgDet&rs=1
// @grant none
// @license MIT
// ==/UserScript==
(function() {
'use strict';
/*! For license information please see bundle.js.LICENSE.txt */
(()=>{"use strict";var t={736:(t,e,n)=>{n.d(e,{Z:()=>c});var r=n(81),o=n.n(r),a=n(645),i=n.n(a)()(o());i.push([t.id,".oa-fixed-btn {\n width: 40px;\n height: 40px;\n position: fixed;\n bottom: 40px;\n right: 40px;\n border-radius: 50%;\n background-color: #0055ff;\n color: #fff;\n text-align: center;\n line-height: 40px;\n z-index: 999;\n cursor: pointer;\n}\n\n.easy-oa-list {\n display: none;\n list-style: none;\n margin: 0;\n padding: 0;\n position: absolute;\n top: 50px;\n left: 150px;\n z-index: 999;\n background-color: #fff;\n padding: 10px;\n box-shadow: 3px 3px 13px 2px rgba(0, 0, 0, 0.4);\n min-width: 300px;\n min-height: 400px;\n}\n\n.easy-mask {\n display: none;\n position: absolute;\n inset: 0;\n background-color: rgba(0, 0, 0, 0.7);\n\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n}\n\n.easy-oa-list .select-all-label {\n display: inline-block;\n margin-bottom: 10px;\n}\n.easy-oa-list #selectAll {\n vertical-align: middle;\n margin-right: 5px;\n}\n\n.easeOA-item {\n margin-bottom: 15px;\n}\n\n.easeOA-checkbox {\n margin-right: 10px;\n vertical-align: middle;\n}\n\n.easeOA-label {\n display: inline-block;\n vertical-align: middle;\n}\n\n.button-container {\n text-align: center;\n margin-top: 20px;\n}\n\n#confirmBtn {\n background-color: #007bff;\n color: #fff;\n border-radius: 5px;\n border: none;\n cursor: pointer;\n transition: all 0.3s ease-in-out;\n}\n\n#confirmBtn:hover {\n background-color: #0062cc;\n}\n\n.easy-tabs {\n padding: 10px;\n border-bottom: 1px solid #c4c4c4;\n display: flex;\n}\n.easy-tab-item {\n padding: 0 20px;\n font-size: 18px;\n cursor: pointer;\n}\n.easy-tab-item.easy-tab-active {\n color: #05f;\n}\n\n#easeOAList {\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n padding: 10px;\n min-height: 350px;\n}\n",""]);const c=i},645:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",r=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),r&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),r&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,r,o,a){"string"==typeof t&&(t=[[null,t,void 0]]);var i={};if(r)for(var c=0;c<this.length;c++){var s=this[c][0];null!=s&&(i[s]=!0)}for(var u=0;u<t.length;u++){var l=[].concat(t[u]);r&&i[l[0]]||(void 0!==a&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=a),n&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=n):l[2]=n),o&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=o):l[4]="".concat(o)),e.push(l))}},e}},81:t=>{t.exports=function(t){return t[1]}},379:t=>{var e=[];function n(t){for(var n=-1,r=0;r<e.length;r++)if(e[r].identifier===t){n=r;break}return n}function r(t,r){for(var a={},i=[],c=0;c<t.length;c++){var s=t[c],u=r.base?s[0]+r.base:s[0],l=a[u]||0,f="".concat(u," ").concat(l);a[u]=l+1;var p=n(f),h={css:s[1],media:s[2],sourceMap:s[3],supports:s[4],layer:s[5]};if(-1!==p)e[p].references++,e[p].updater(h);else{var d=o(h,r);r.byIndex=c,e.splice(c,0,{identifier:f,updater:d,references:1})}i.push(f)}return i}function o(t,e){var n=e.domAPI(e);return n.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,o){var a=r(t=t||[],o=o||{});return function(t){t=t||[];for(var i=0;i<a.length;i++){var c=n(a[i]);e[c].references--}for(var s=r(t,o),u=0;u<a.length;u++){var l=n(a[u]);0===e[l].references&&(e[l].updater(),e.splice(l,1))}a=s}}},569:t=>{var e={};t.exports=function(t,n){var r=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},216:t=>{t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},565:(t,e,n)=>{t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},795:t=>{t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleTagTransform(r,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},589:t=>{t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var a=e[r]={id:r,exports:{}};return t[r](a,a.exports,n),a.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.nc=void 0,(()=>{var t={overtime:"overtime",leave:"leave"},e=n(379),r=n.n(e),o=n(795),a=n.n(o),i=n(569),c=n.n(i),s=n(565),u=n.n(s),l=n(216),f=n.n(l),p=n(589),h=n.n(p),d=n(736),v={};function y(t,e){var n=new Date(t),r=new Date(e);return n.getTime()>r.getTime()?1:n.getTime()<r.getTime()?-1:0}function m(t,e){var n=new Date(t),r=(new Date(e).getTime()-n.getTime())/18e5;return Math.ceil(r)/2}function g(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new Date(t);n.setMilliseconds(0),n.setSeconds(0);var r=e?1:0,o=n.getMinutes(),a=30*(Math.ceil(o/30)-r);return n.setMinutes(a),n.toLocaleDateString().replace(/\//g,"-")+" "+n.toLocaleTimeString()}function b(t){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b(t)}function w(){w=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function u(t,e,n,o){var a=e&&e.prototype instanceof p?e:p,i=Object.create(a.prototype),c=new T(o||[]);return r(i,"_invoke",{value:L(t,n,c)}),i}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function p(){}function h(){}function d(){}var v={};s(v,a,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(S([])));m&&m!==e&&n.call(m,a)&&(v=m);var g=d.prototype=p.prototype=Object.create(v);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function o(r,a,i,c){var s=l(t[r],t,a);if("throw"!==s.type){var u=s.arg,f=u.value;return f&&"object"==b(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,i,c)}),(function(t){o("throw",t,i,c)})):e.resolve(f).then((function(t){u.value=t,i(u)}),(function(t){return o("throw",t,i,c)}))}c(s.arg)}var a;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return a=a?a.then(r,r):r()}})}function L(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return{value:void 0,done:!0}}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=j(i,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=l(t,e,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}function j(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,j(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=l(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var a=o.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function S(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:D}}function D(){return{value:void 0,done:!0}}return h.prototype=d,r(g,"constructor",{value:d,configurable:!0}),r(d,"constructor",{value:h,configurable:!0}),h.displayName=s(d,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},x(O.prototype),s(O.prototype,i,(function(){return this})),t.AsyncIterator=O,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new O(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},x(g),s(g,c,"Generator"),s(g,a,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=S,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return i.type="throw",i.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,f):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),E(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;E(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function x(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function O(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?x(Object(n),!0).forEach((function(e){L(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function L(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==b(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==b(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===b(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function j(t,e,n,r,o,a,i){try{var c=t[a](i),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,o)}function k(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var a=t.apply(e,n);function i(t){j(a,r,o,i,c,"next",t)}function c(t){j(a,r,o,i,c,"throw",t)}i(void 0)}))}}function E(t){return T.apply(this,arguments)}function T(){return(T=k(w().mark((function t(e){return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,$.ajax({url:location.origin+"/Attendance/Vacation/VacationCheck",type:"POST",contentType:"application/json",data:JSON.stringify(O({vacationTypeID:15,childNum:"",pregnantMonths:""},e))});case 2:t.sent;case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function S(t){return D.apply(this,arguments)}function D(){return(D=k(w().mark((function t(e){var n,r,o,a;return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.startTime,r=e.endTime,o=e.totalHours,a=e.reason,console.log(e),t.next=4,$.ajax({url:location.origin+"/Attendance/Vacation/ApplyStage",type:"POST",contentType:"application/json",data:JSON.stringify({OperationType:2,FVacationPeriod:3,FVacationTypeID:15,FVacationStartTime:n,FVacationEndTime:r,FTotalHours:o,FVacationReason:a||"调休"})});case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function P(t){return A.apply(this,arguments)}function A(){return(A=k(w().mark((function t(e){return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,$.ajax({url:location.origin+"/Attendance/OverTime/ApplyStage",type:"POST",contentType:"application/json",data:JSON.stringify(e.map((function(t,e){return O({FStatisticsType:4,FIsFieldwork:0,FOverTimeTypeID:"2",FNum:e+1},t)})))});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function F(t){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},F(t)}function _(){_=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function u(t,e,n,o){var a=e&&e.prototype instanceof p?e:p,i=Object.create(a.prototype),c=new k(o||[]);return r(i,"_invoke",{value:x(t,n,c)}),i}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function p(){}function h(){}function d(){}var v={};s(v,a,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(E([])));m&&m!==e&&n.call(m,a)&&(v=m);var g=d.prototype=p.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(r,a,i,c){var s=l(t[r],t,a);if("throw"!==s.type){var u=s.arg,f=u.value;return f&&"object"==F(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,i,c)}),(function(t){o("throw",t,i,c)})):e.resolve(f).then((function(t){u.value=t,i(u)}),(function(t){return o("throw",t,i,c)}))}c(s.arg)}var a;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return a=a?a.then(r,r):r()}})}function x(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return{value:void 0,done:!0}}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=O(i,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=l(t,e,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}function O(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,O(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=l(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var a=o.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function E(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:T}}function T(){return{value:void 0,done:!0}}return h.prototype=d,r(g,"constructor",{value:d,configurable:!0}),r(d,"constructor",{value:h,configurable:!0}),h.displayName=s(d,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),s(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new w(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},b(g),s(g,c,"Generator"),s(g,a,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=E,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(j),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return i.type="throw",i.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,f):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:E(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function N(t,e,n,r,o,a,i){try{var c=t[a](i),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,o)}function C(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var a=t.apply(e,n);function i(t){N(a,r,o,i,c,"next",t)}function c(t){N(a,r,o,i,c,"throw",t)}i(void 0)}))}}function M(e,n){$("#easeOAList").html("");var r=(n||{}).type,o=void 0===r?t.overtime:r,a=o===t.overtime?"加班":"调休";e.length&&$("#easeOAList").append('<label class="select-all-label">\n <input type="checkbox" checked=\'true\' id="selectAll"> 全选\n </label>'),console.log(e,"ssssss"),$.each(e,(function(t,e){var n=$("<li>").addClass("easeOA-item"),r=$("<input>").attr({type:"checkbox",name:"leave",checked:!0,value:t}).addClass("easeOA-checkbox"),o=$("<label>").html(a+"时间段:"+(e.startTime||e.FOverTimeStart)+" > "+(e.endTime||e.FOverTimeEnd)+",总时长:"+(e.totalHours||e.FHours)).addClass("easeOA-label");n.append(r).append(o),$("#easeOAList").append(n)})),$("#easeOAList").append('<div class="button-container">'.concat(e.length?"":"<div style='height:150px;line-height:150px;'>暂无可操作数据~</div>",'\n <button id="confirmBtn">确认</button>\n</div>')),$("#selectAll").on("click",(function(){$("input[name=leave]").prop("checked",this.checked)})),$(".checkbox").on("click",(function(){var t=$("input[name=leave]:checked").length;$("#selectAll").prop("checked",t===e.length)})),$("#confirmBtn").on("click",C(_().mark((function t(){var n=this;return _().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return $(this).attr("disabled",!0),t.next=3,G(e,o);case 3:setTimeout((function(){$(n).removeAttr("disabled")}),3e3);case 4:case"end":return t.stop()}}),t,this)})))),$(".oa-fixed-btn").click((function(){$(".easy-oa-list").is(":hidden")?$(".easy-oa-list").show():$(".easy-oa-list").hide()}))}v.styleTagTransform=h(),v.setAttributes=u(),v.insert=c().bind(null,"head"),v.domAPI=a(),v.insertStyleElement=f(),r()(d.Z,v),d.Z&&d.Z.locals&&d.Z.locals;var G=function(){var e=C(_().mark((function e(n,r){var o,a,i;return _().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=$(".easeOA-checkbox[name=leave]:checked"),a=[],o.each((function(){var t=$(this).val();a.push(n[t])})),r!==t.overtime){e.next=8;break}return e.next=6,P(a);case 6:e.next=19;break;case 8:i=0;case 9:if(!(i<a.length)){e.next=19;break}return e.next=12,E(a[i]);case 12:return e.next=14,S(a[i]);case 14:return e.next=16,I(1e3);case 16:i++,e.next=9;break;case 19:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function I(t){return new Promise((function(e){return setTimeout(e,t)}))}function V(t){console.log(t);var e=new Date(t||new Date).getFullYear()+"-"+(new Date(t||new Date).getMonth()+1),n=function(t){var e=new Date(t||new Date),n=e.getFullYear(),r=e.getMonth()+1;return n+"/"+r+"/"+new Date(n,r,0).getDate()}(t),r=[],o=[];return $(".easy-mask").show(),$.get("/platform/EmployeeBase/GetAttendanceByDate?selectDate="+n).then((function(t){t.ReturnValue.map((function(t){if(t.CreditCardData&&t.Day){var n=function(t){return new Date(t||new Date).toLocaleDateString().replace(/\//g,"-")}(e+"-"+t.Day.replace("日","")),a=n+" "+(t.CreditCardData||"").split("-").shift(),i=n+" "+(t.CreditCardData||"").split("-").pop(),c=function(t,e){var n=new Date(t).toLocaleDateString().replace(/\//g,"-");return e.AttendanceData?{start:n+" 09:00:00",end:n+" 18:00:00"}:{start:n+" 09:00:00",end:n+" 20:00:00"}}(n,t),s=!t.AttendanceData;if(a&&y(a,c.start)>0&&!t.LeaveTheData&&!s){var u=g(a),l=m(c.start,u);o.push({startTime:c.start,endTime:u,totalHours:l,reason:"调休"})}if(i&&y(i,c.end),!t.OvertimeData){var f="",p="",h="",d=0,v=g(i,!0);if(s?(f="2",p=a,h=i,d=m(g(a),v),console.log(d,v,a,p)):(f="1",h=i,d=m(p=c.end.replace(/\//g,"-"),v)),d<.5&&s||d<2&&!s)return;r.push({FOverTimeTypeID:f,FOverTimeStart:p,FOverTimeEnd:h,FHours:d,FOverTimeReason:"加班"})}}})),console.log(o,r)})).fail((function(t){console.log(t)})).then((function(){return{overtime:r,late:o}})).always((function(){$(".easy-mask").hide()}))}function H(){!function(){var e,n,r,o;function a(e,n,r){r===t.overtime?(M(n,{type:t.overtime}),$("#easeOAList").data("type",t.overtime)):(M(e,{type:"leave"}),$("#easeOAList").data("type",t.leave))}$("body").append('<div class="oa-fixed-btn">Easy</div><div class="easy-oa-list">\n <div class="easy-tabs">\n <div class="easy-tab-item easy-tab-item-leave easy-tab-active" data-type="leave">调休</div>\n <div class="easy-tab-item easy-tab-item-overtime" data-type="'.concat(t.overtime,'">加班</div>\n <input type="date" id="date-input" value="').concat((n=(e=new Date).getFullYear(),r=("0"+(e.getMonth()+1)).slice(-2),o=("0"+e.getDate()).slice(-2),"".concat(n,"-").concat(r,"-").concat(o)),'" />\n\n </div>\n <div id="easeOAList"></div>\n <div class="easy-mask">加载中...</div>\n </div>')),V().then((function(t){console.log("ssssssss"),M(t.late)})),$(".easy-tab-item").click((function(){var t=this,e=V($("#date-input").val()).then((function(e){var n="easy-tab-active";$(t).hasClass(n)||($(t).addClass(n),$(t).siblings().removeClass(n),a(e.late,e.overtime,$(t).data("type")),console.log(e,"sssss"))}));e.late,e.overtime})),$("#date-input").on("change",(function(){V(this.value).then((function(t){a(t.late,t.overtime,$("#easeOAList").data("type"))}))}))}(),$.ajaxSetup({error:function(t,e,n){switch(t.status){case 500:layer.alert("服务器系统内部错误",{icon:2});break;case 401:layer.alert("未登录",{icon:2});break;case 403:layer.alert("无权限执行此操作",{icon:2});break;case 408:layer.alert("请求超时",{icon:2});break;default:layer.alert("未知错误,请联系管理员",{icon:2})}},success:function(t){t.Message&&alert(t.Message)},cache:!1})}"undefined"==typeof jQuery?("https://cdn.bootcdn.net/ajax/libs/jquery/3.6.3/jquery.js",new Promise((function(t,e){var n=document.createElement("script");n.type="text/javascript",n.src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.3/jquery.js",n.async=!0,n.onload=t,n.onerror=e,document.head.appendChild(n)}))).then((function(){H()})):H()})()})();
})();