提交 134f5918 authored 作者: supj's avatar supj

1、将外部库迁移初始化。已不维护

上级 8c636bfc
function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t(e,t){return e(t={exports:{}},t.exports),t.exports}var n=e(t((function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0}))),r=e(t((function(e){function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0}))),o=e(t((function(e){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0}))),u=e(t((function(e){function t(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=t=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),t(n)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0})));function i(e,t){if(!e||e.length<1)return!1;for(var n=0,r=e.length;n<r;n++)if(a(e[n],t))return!0;return!1}function a(e,t){var n=u(e);if(n!==u(t))return!1;if("string"===n||"number"===n||"undefined"===n||"boolean"===n)return e===t;if("object"===n){if(n instanceof Array)return e.length==e.length&&(!!e.every((function(e){return i(t,e)}))&&!!t.every((function(t){return i(e,t)})));var r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;if(o.filter((function(e){return r.includes(e)})).length!==r.length)return!1;for(var s=0,f=r.length;s<f;s++){if(!a(e[r[s]],t[r[s]]))return!1}return!0}return!1}function s(e,t){var n={};if(e&&e.length>0&&t&&"object"===u(t))for(var r=0,o=e.length;r<o;r++){var i=e[r];i&&(n[i]=t[i])}return n}var f={getObjectByObject:function(e,t){return e&&t&&"object"===u(e)&&"object"===u(t)?s(Object.keys(e),t):{}},getObjectByList:s,getValueFromObject:function e(t,n){if("object"===u(t)&&n&&"string"==typeof n){if(t[n])return t[n];if(n.indexOf(".")<0)return t[n];var r=n.split(".");if(t[r[0]]&&t[r[0]]instanceof Object){var o=r.slice(1).join(".");return e(t[r[0]],o)}}return""},deepEqual:a,containObject:i,cloneObject:function e(t){if(t instanceof Array){for(var n=[],r=0,o=t.length;r<o;r++)n.push(e(t[r]));return n}if(t instanceof Object){var u={};for(var i in t)u[i]=e(t[i]);return u}return t},extendObject:function e(t,n){return n&&"object"===u(n)?(t&&"object"===u(n)&&Object.keys(n).forEach((function(r){void 0===t[r]?t[r]=n[r]:"object"===u(t[r])&&e(t[r],n[r])})),t):t},setWatcher:function(e,t){Object.keys(t).forEach((function(n){!function e(t,n,r){if(t&&"object"===u(t)){var o=t[n];if(o)Object.defineProperty(t,n,{configurable:!0,enumerable:!0,set:function(e){var t=o;o=e,r(e,t)},get:function(){return o}});else{var i=n.indexOf(".");if(i>0){var a=n.substring(0,i),s=n.substr(i+1);e(t[a],s,r)}}}}(e,n,t[n])}))}};var l={getQueryMapFromUrl:function(e){var t=new Map;if(e&&e.indexOf("?")>0){var n=e.substr(e.indexOf("?")+1).split("&");n&&n.length>0&&n.forEach((function(e){var n=e.split("=");n&&n.length>1&&t.set(n[0],n[1])}))}return t},getQueryUrl:function(e,t){var n=-1!==e.indexOf("?");if(t instanceof Object){var r=e;for(var o in t)void 0!==t[o]&&(r.endsWith("?")?r="".concat(r).concat(o,"=").concat(t[o]):(r="".concat(r).concat(n?"&":"?").concat(o,"=").concat(t[o]),n||(n=!0)));return r}return e}},c={dayMillis:864e5,hourMillis:36e5,minuteMillis:6e4,secondMillis:1e3};function h(e){return e>9?e:"0"+e}function g(e){if(e instanceof Date)return e;if("string"==typeof e&&e.indexOf("-")>0){var t=new RegExp("-","g");e=e.replace(t,"/")}return new Date(e)}function v(e){return e%400==0||e%4==0&&e%100!=0}function y(e,t){if(2===t||"2"===t)return v(e)?29:28;return[1,3,5,7,8,10,12].includes(t)?31:30}function p(e,t,n){if("number"==typeof e&&"number"==typeof t){var r=t-e;return Math.floor(r/n*100)/100}}function d(e,t){var n=Math.min(e,t),r=Math.max(e,t),o=g(n),u=g(r),i=u.getFullYear()-o.getFullYear(),a=o.getMonth()+1,s=u.getMonth()+1;return s<a&&(i-=1,s+=12),Number.parseInt((12*i+s-a).toFixed(0))}var b=[{symbolList:["yyyy","YYYY"],getValue:function(e){return h(e.getFullYear())}},{symbolList:["MM"],getValue:function(e){return h(e.getMonth()+1)}},{symbolList:["DD","dd"],getValue:function(e){return h(e.getDate())}},{symbolList:["HH","hh"],getValue:function(e){return h(e.getHours())}},{symbolList:["mm"],getValue:function(e){return h(e.getMinutes())}},{symbolList:["SS","ss"],getValue:function(e){return h(e.getSeconds())}}];var m={getDateInstance:g,isToday:function(e){var t=new Date,n=g(e);return t.getFullYear()===n.getFullYear()&&n.getMonth()===t.getMonth()&&n.getDate()===t.getDate()},formatNumber:h,formatDateString:function(e,t){var n=String(t);if(t){var r=g(e);b.forEach((function(e){for(var t=0,o=e.symbolList.length;t<o;t++)if(n.indexOf(e.symbolList[t])>=0){n=n.replace(e.symbolList[t],e.getValue(r));break}}))}return n},getCurrentFormatDate:function(){return e=new Date,(t=g(e)).getFullYear()+"-"+h(t.getMonth()+1)+"-"+h(t.getDate());var e,t},getDaysInMonth:function(e){var t=g(e);return y(t.getFullYear(),t.getMonth()+1)},getMonthDays:y,getWeekName:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=g(e),r=n.getDay();return 0===r?t?"Sunday":"周日":1===r?t?"Monday":"周一":2===r?t?"Tuesday":"周二":3===r?t?"Wednesday":"周三":4===r?t?"Thursday":"周四":5===r?t?"Friday":"周五":6===r?t?"Saturday":"周六":""},isLeapYear:v,getLastMonthInfo:function(e,t){return{year:1==t?e-1:e,month:1==t?12:t-1}},getNextMonthInfo:function(e,t){return{year:12==t?e+1:e,month:12==t?1:t+1}},diffYears:function(e,t){var n=d(e,t);return Math.floor(n/12*100)/100},diffMonths:d,diffDays:function(e,t){return p(e,t,c.dayMillis)},diffHours:function(e,t){return p(e,t,c.hourMillis)},diffMinutes:function(e,t){return p(e,t,c.minuteMillis)},diffSeconds:function(e,t){return p(e,t,c.secondMillis)}},D=function(){function e(t,r){n(this,e),this.millisInFuture=t,this.mInterval=r,this.onFinishListener=void 0,this.onCountDownListener=void 0,this.timer=void 0}return r(e,[{key:"addCountDownListener",value:function(e){e&&"function"==typeof e&&(this.onCountDownListener=e)}},{key:"addFinishListener",value:function(e){e&&"function"==typeof e&&(this.onFinishListener=e)}},{key:"start",value:function(){if(!this.timer&&this.onCountDownListener&&"function"==typeof this.onCountDownListener){var t=this;this.timer=setInterval((function(){t.millisInFuture=t.millisInFuture-t.mInterval,t.millisInFuture>0?t.onCountDownListener(e.getTimeInfo(t.millisInFuture)):(t.cancel(),t.onFinishListener&&"function"==typeof t.onFinishListener&&t.onFinishListener())}),t.mInterval)}}},{key:"cancel",value:function(){this.timer&&(clearInterval(this.timer),this.timer=void 0)}}],[{key:"getTimeInfo",value:function(e){var t=e%c.dayMillis,n=e%c.hourMillis,r=e%c.minuteMillis;return{time:e,day:Math.floor(e/c.dayMillis),hour:Math.floor(t/c.hourMillis),minute:Math.floor(n/c.minuteMillis),second:Math.floor(r/c.secondMillis),format:function(e){return e>=10?e:"0"+e}}}}]),e}(),k=t((function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.default=e.exports,e.exports.__esModule=!0}));e(k);var x=t((function(e){e.exports=function(e){if(Array.isArray(e))return k(e)},e.exports.default=e.exports,e.exports.__esModule=!0}));e(x);var M=t((function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0}));e(M);var L=t((function(e){e.exports=function(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0}));e(L);var w=t((function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0}));e(w);var j=e(t((function(e){e.exports=function(e){return x(e)||M(e)||L(e)||w()},e.exports.default=e.exports,e.exports.__esModule=!0})));var F={groupingList:function(e,t){if(e&&t>0){for(var n=[],r=e.length,o=0,u=t;o<r;)n.push(e.slice(o,u)),o+=t,u+=t;return n}return e},makeUpGroupList:function(e,t){if(e&&e.length>0){var n=j(e);if(t<2)return n;var r=n.length%t;if(r>0)for(var o=0,u=t-r;o<u;o++)n.push({});return n}return e}},I=function(){function e(){n(this,e)}return r(e,null,[{key:"getCurrentFormatDateString",value:function(){var e=new Date;return e.getFullYear()+"-"+O.getFullNumber(e.getMonth()+1)+"-"+O.getFullNumber(e.getDate())}},{key:"getCalendarData",value:function(e,t){var n=[],r=new S(e,t),o=O.getWeekDay(e,t);if(o>0)for(var u=O.getLastMonthInfo(e,t),i=O.getMonthDays(u.year,u.month),a=0;a<o;a++){var s=i-o+1+a,f=new T(u.year,u.month,s);f.setSupplementDay(!0),n.push(f)}var l=7-(n=n.concat(r.dayItems)).length%7;if(l<7)for(var c=O.getNextMonthInfo(e,t),h=0;h<l;h++){var g=new T(c.year,c.month,h+1);g.setSupplementDay(!0),n.push(g)}return r.dayItems=n,r}},{key:"getLastMonthData",value:function(t,n){var r=O.getLastMonthInfo(t,n);return e.getCalendarData(r.year,r.month)}},{key:"getNextMonthData",value:function(t,n){var r=O.getNextMonthInfo(t,n);return e.getCalendarData(r.year,r.month)}},{key:"getCurrentMonthData",value:function(){var t=new Date;return e.getCalendarData(t.getFullYear(),t.getMonth()+1)}},{key:"getCalendarDataList",value:function(t){var n=[],r=e.getCurrentMonthData();n.push(r);for(var o=1;o<t;o++)r=e.getNextMonthData(r.year,r.month),n.push(r);return n}}]),e}(),S=function(){function e(t,r){n(this,e),this.titleName=r,this.year=t,this.month=r,this.dayItems=this.getDayItems()}return r(e,[{key:"getDayItems",value:function(){for(var e=O.getMonthDays(this.year,this.month),t=[],n=1;n<=e;n++){var r=new T(this.year,this.month,n);t.push(r)}return t}},{key:"toString",value:function(){return"year= "+this.year+" month= "+this.month}}]),e}(),T=function(){function e(t,r,o){n(this,e),this.year=t,this.month=r,this.day=o,this.isSupplementDay=!1,this.titleName=o,this.formatDay=this.getFormatDayString();var u=new Date(this.formatDay);u.setHours(0,0,0,0),this.time=u.getTime()}return r(e,[{key:"setSupplementDay",value:function(e){this.isSupplementDay=e}},{key:"getFormatDayString",value:function(){var e=O.getFullNumber(this.month),t=O.getFullNumber(this.day);return this.year+"-"+e+"-"+t}},{key:"equal",value:function(t){return!!(t&&t instanceof e)&&(this.year===t.currentYear&&this.month===t.currentMonth&&this.day===t.currentDay)}},{key:"toString",value:function(){return"currentYear= "+this.year+" currentMonth= "+this.month+" currentDay= "+this.day}}]),e}(),O=function(){function e(){n(this,e)}return r(e,null,[{key:"getFullNumber",value:function(e){return e>=10?e:"0"+e}},{key:"isLeapYear",value:function(e){return e%400==0||e%4==0&&e%100!=0}},{key:"getMonthDays",value:function(t,n){return 2==n?e.isLeapYear(t)?29:28:1==n||3==n||5==n||7==n||8==n||10==n||12==n?31:30}},{key:"getNextMonthInfo",value:function(e,t){return{year:12==t?e+1:e,month:12==t?1:t+1}}},{key:"getLastMonthInfo",value:function(e,t){return{year:1==t?e-1:e,month:1==t?12:t-1}}},{key:"getWeekDay",value:function(e,t){return new Date(e,t-1,1).getDay()}}]),e}(),_=I,C={11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",21:"辽宁",22:"吉林",23:"黑龙江",31:"上海",32:"江苏",33:"浙江",34:"安徽",35:"福建",36:"江西",37:"山东",41:"河南",42:"湖北",43:"湖南",44:"广东",45:"广西",46:"海南",50:"重庆",51:"四川",52:"贵州",53:"云南",54:"西藏",61:"陕西",62:"甘肃",63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门",91:"国外"};function A(e,t,n,r){var o=(new Date).getFullYear();if(r.getFullYear()==e&&r.getMonth()+1==t&&r.getDate()==n){var u=o-e;return u>=0&&u<=130}return!1}var E={checkCard:function(e){return!1!==function(e){if(!1===/(^\d{15}$)|(^\d{17}(\d|X)$)/.test(e))return!1;return!0}(e)&&(!1!==function(e){var t=e.substr(0,2);if(null==C[t])return!1;return!0}(e)&&(!1!==function(e){var t=e.length;if("15"==t){var n=e.match(/^(\d{6})(\d{2})(\d{2})(\d{2})(\d{3})$/),r=n[2],o=n[3],u=n[4],i=new Date("19"+r+"/"+o+"/"+u);return A("19"+r,o,u,i)}if("18"==t){var a=e.match(/^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})([0-9]|X)$/),s=a[2],f=a[3],l=a[4],c=new Date(s+"/"+f+"/"+l);return A(s,f,l,c)}return!1}(e)&&!1!==function(e){if("18"==(e=function(e){if("15"==e.length){var t,n=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2],r=0;for(e=e.substr(0,6)+"19"+e.substr(6,e.length-6),t=0;t<17;t++)r+=e.substr(t,1)*n[t];return e+=["1","0","X","9","8","7","6","5","4","3","2"][r%11]}return e}(e)).length){var t,n=new Array(7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2),r=new Array("1","0","X","9","8","7","6","5","4","3","2"),o=0;for(t=0;t<17;t++)o+=e.substr(t,1)*n[t];return r[o%11]==e.substr(17,1)}return!1}(e)))}},Y=function(){function e(){n(this,e)}return r(e,null,[{key:"replaceAll",value:function(e,t,n){var r=new RegExp(t,"g");return e.replace(r,n)}},{key:"isIDCard",value:function(e){return E.checkCard(e)}},{key:"isEmpty",value:function(e){return!e||e.trim().length<1}},{key:"isPhoneNumber",value:function(e){var t=String(e);return!!/^1[38][0-9]{9}$/.test(t)||(!!/^14[56789][0-9]{8}$/.test(t)||(!!/^15[012356789][0-9]{8}$/.test(t)||(!!/^16[567][0-9]{8}$/.test(t)||(!!/^17[012345678][0-9]{8}$/.test(t)||!!/^19[1589][0-9]{8}$/.test(t)))))}},{key:"isEmail",value:function(e){if(e){return/^[a-zA-Z0-9]+([-_.][a-zA-Z0-9]+)*@[a-zA-Z0-9]+([-_.][a-zA-Z0-9]+)*\.[a-z]{2,}$/.test(e)}return!1}},{key:"getImageListFromRichText",value:function(e){var t=[],n=e.match(/<img[^>]*>/g);if(n&&n.length>0){var r=/http\S*((.jpg)|(.jpeg)|(.png))/g;n.forEach((function(e){var n=e.match(r);n&&n.length>0&&!t.includes(n[0])&&t.push(n[0])}))}return t}},{key:"colorRbgToHex",value:function(e){var t=e.toLowerCase();if(/^(rgb|RGB)/.test(t)){for(var n=t.replace(/(?:\(|\)|rgb|RGB)*/g,"").split(","),r="#",o=0;o<n.length;o++){var u=Number(n[o]).toString(16);"0"===u&&(u+=u),r+=u}return 7!==r.length&&(r=t),r}if(/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t)){var i=t.replace(/#/,"").split("");if(6===i.length)return t;if(3===i.length){for(var a="#",s=0;s<i.length;s+=1)a+=i[s]+i[s];return a}}return t}},{key:"colorHexToRgb",value:function(e){var t=e.toLowerCase();if(t&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t)){if(4===t.length){for(var n="#",r=1;r<4;r+=1)n+=t.slice(r,r+1).concat(t.slice(r,r+1));t=n}for(var o=[],u=1;u<7;u+=2)o.push(parseInt("0x"+t.slice(u,u+2)));return"rgb("+o.join(",")+")"}return t}},{key:"formatNumber",value:function(e){return e?e.toString().replace(/(\d)(?=(?:\d{3})+$)/g,"$1,"):"0"}}]),e}(),N={observerList:[],stickyEvents:[]};function $(e){return e||"defaultType"}var H=function(){function e(){n(this,e)}return r(e,null,[{key:"postSticky",value:function(t,n){var r=$(n),o=N.stickyEvents.findIndex((function(e){return e.eventType===r}));o>=0?N.stickyEvents[o].msg=t:N.stickyEvents.push({eventType:r,msg:t}),e.post(t,r)}},{key:"post",value:function(e,t){var n=$(t);N.observerList.forEach((function(t){n===t.eventType&&t.subscriber&&"function"==typeof t.subscriber&&t.subscriber({eventType:t.eventType,msg:e})}))}},{key:"register",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"defaultType",r=arguments.length>3?arguments[3]:void 0;if(r){var o=$(n),u=N.observerList.findIndex((function(t){return t.observer===e&&t.eventType===n}));if(u<0){if(t){var i=N.stickyEvents.find((function(e){return e.eventType===o}));i&&r&&"function"==typeof r&&r(i)}N.observerList.push({observer:e,subscriber:r,eventType:o})}}}},{key:"unregister",value:function(e){N.observerList=N.observerList.filter((function(t){return t.observer!==e}))}},{key:"destroy",value:function(){N.stickyEvents=[],N.observerList=[]}}]),e}(),W=function(){function e(t){n(this,e),this.enableDebug=t}return r(e,[{key:"getTag",value:function(e){return e+"===================="}},{key:"setEnableDebug",value:function(e){this.enableDebug=e}},{key:"debug",value:function(e){this.enableDebug&&console.debug(e)}},{key:"debugWithTag",value:function(e,t){this.enableDebug&&console.debug(this.getTag(e),t)}},{key:"info",value:function(e){this.enableDebug&&console.info(e)}},{key:"infoWithTag",value:function(e,t){this.enableDebug&&console.info(this.getTag(e),t)}},{key:"log",value:function(e){this.enableDebug&&console.log(e)}},{key:"logWithTag",value:function(e,t){this.enableDebug&&console.log(this.getTag(e),t)}},{key:"error",value:function(e){this.enableDebug&&console.error(e)}},{key:"errorWithTag",value:function(e,t){this.enableDebug&&console.error(this.getTag(e),t)}},{key:"warn",value:function(e){this.enableDebug&&console.warn(e)}},{key:"warnWithTag",value:function(e,t){this.enableDebug&&console.warn(this.getTag(e),t)}}]),e}(),V=void 0,R=void 0,U=void 0,z=void 0,B=void 0,P=void 0,X=void 0;var Z=function(){function e(){n(this,e)}return r(e,null,[{key:"getObjectHelper",value:function(){return void 0===R&&(R=f),R}},{key:"getUrlHelper",value:function(){return void 0===V&&(V=l),V}},{key:"getDateHelper",value:function(){return void 0===U&&(U=m),U}},{key:"getCountDownTimer",value:function(e,t){return function(e,t){return new D(e,t)}(e,t)}},{key:"getArrayHelper",value:function(){return void 0===z&&(z=F),z}},{key:"getStringHelper",value:function(){return void 0===X&&(X=Y),X}},{key:"getCalendarHelper",value:function(){return void 0===B&&(B=_),B}},{key:"getEventBus",value:function(){return void 0===P&&(P=H),P}}]),e}();o(Z,"dateConstants",c),o(Z,"LogUtils",W);var G=Z;export{G as default};
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论