cc1-js 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cc1-js.js +1 -1
- package/dist/index.d.ts +261 -32
- package/package.json +1 -1
package/dist/cc1-js.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";class t{}t.swapArray=(t,e,r)=>(t[e]=t.splice(r,1,t[e])[0],t),t.zIndexUp=(e,r)=>{0!=r&&t.swapArray(e,r,r-1)},t.zIndexDown=(e,r)=>{r+1!=e.length&&t.swapArray(e,r,r+1)},t.zIndexTop=(e,r)=>{if(0!=r)for(var n=r-0,o=0;o<n;o++)t.swapArray(e,r,r-1),r--},t.zIndexBottom=(e,r)=>{if(r+1!=e.length)for(var n=e.length-1-r,o=0;o<n;o++)t.swapArray(e,r,r+1),r++},t.diff=(t,e)=>t.filter(t=>-1===e.indexOf(t));class e{static doCheck(t){var e;if("string"!=typeof t||!t)return!1;const r=t.replace(/[\r\n\s]/g,"");if(r.length%4!=0)return!1;if(!/^[A-Za-z0-9+/]*={0,2}$/.test(r))return!1;const n=(null===(e=r.match(/=+$/))||void 0===e?void 0:e[0].length)||0;return!(n>2)&&!(n>0&&!new RegExp(`^[A-Za-z0-9+/]+={${n}}$`).test(r))}}e._keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",e.encode=t=>{let r,n,o,s,a,i,l,c="",d=0;for(t=e._utf8_encode(t);d<t.length;)r=t.charCodeAt(d++),n=t.charCodeAt(d++),o=t.charCodeAt(d++),s=r>>2,a=(3&r)<<4|n>>4,i=(15&n)<<2|o>>6,l=63&o,isNaN(n)?i=l=64:isNaN(o)&&(l=64),c=c+e._keyStr.charAt(s)+e._keyStr.charAt(a)+e._keyStr.charAt(i)+e._keyStr.charAt(l);return c},e.decode=t=>{let r,n,o,s,a,i,l,c="",d=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");d<t.length;)s=e._keyStr.indexOf(t.charAt(d++)),a=e._keyStr.indexOf(t.charAt(d++)),i=e._keyStr.indexOf(t.charAt(d++)),l=e._keyStr.indexOf(t.charAt(d++)),r=s<<2|a>>4,n=(15&a)<<4|i>>2,o=(3&i)<<6|l,c+=String.fromCharCode(r),64!=i&&(c+=String.fromCharCode(n)),64!=l&&(c+=String.fromCharCode(o));return c=e._utf8_decode(c),c},e._utf8_encode=t=>{t=t.replace(/\r\n/g,"\n");let e="";for(let r=0;r<t.length;r++){let n=t.charCodeAt(r);n<128?e+=String.fromCharCode(n):n>127&&n<2048?(e+=String.fromCharCode(n>>6|192),e+=String.fromCharCode(63&n|128)):(e+=String.fromCharCode(n>>12|224),e+=String.fromCharCode(n>>6&63|128),e+=String.fromCharCode(63&n|128))}return e},e._utf8_decode=t=>{let e="",r=0,n=0,o=0;for(;r<t.length;)if(n=t.charCodeAt(r),n<128)e+=String.fromCharCode(n),r++;else if(n>191&&n<224)o=t.charCodeAt(r+1),e+=String.fromCharCode((31&n)<<6|63&o),r+=2;else{o=t.charCodeAt(r+1);let s=t.charCodeAt(r+2);e+=String.fromCharCode((15&n)<<12|(63&o)<<6|63&s),r+=3}return e};class r{static uint8ArrayToString(t){for(var e="",r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e}static stringToUint8Array(t){for(var e=[],r=0;r<t.length;r++)e.push(t.charCodeAt(r));return new Uint8Array(e)}}r.byteToString=t=>{if("string"==typeof t)return t;for(var e="",r=t,n=0;n<r.length;n++){var o=r[n].toString(2),s=o.match(/^1+?(?=0)/);if(s&&8==o.length){for(var a=s[0].length,i=r[n].toString(2).slice(7-a),l=1;l<a;l++)i+=r[l+n].toString(2).slice(2);e+=String.fromCharCode(parseInt(i,2)),n+=a-1}else e+=String.fromCharCode(r[n])}return e},r.stringToByte=t=>{var e,r,n=new Array;e=t.length;for(var o=0;o<e;o++)(r=t.charCodeAt(o))>=65536&&r<=1114111?(n.push(r>>18&7|240),n.push(r>>12&63|128),n.push(r>>6&63|128),n.push(63&r|128)):r>=2048&&r<=65535?(n.push(r>>12&15|224),n.push(r>>6&63|128),n.push(63&r|128)):r>=128&&r<=2047?(n.push(r>>6&31|192),n.push(63&r|128)):n.push(255&r);return n};class n{}n.id=1e3,n.getId=()=>"_CEvent_"+n.id++,n.map={},n.add=t=>{n.map[t.id]=t},n.remove=(...t)=>{const e=n;t.forEach(t=>{e.map[t]&&(e.map[t].clear(),e.map[t]=null,delete e.map[t])})};class o{constructor(){this.vm=()=>()=>!0,this.eventMap=new Map,this.id=n.getId(),this.tag="__CEventBean__",this.on=(t,e,r)=>{let o=this;if(!r){const t=o.vm();r=()=>t()}let s=o.tag+n.getId(),a=o.eventMap.get(t);return a||(a=[]),a.push({callback:e,vm:r,uid:s,key:t}),o.eventMap.set(t,a),s},this.once=(t,e,r)=>{let n=this,o="";return o=n.on(t,t=>{e(t),n.off(o)},r),o},this.emit=(t,e={},r=!0)=>{let o=this;r?Object.keys(n.map).forEach(r=>{n.map[r].emit(t,e,!1)}):o.eventMap.forEach(r=>{r.forEach(r=>{if(r.key===t){const t=r.vm();if(![1,0,!0,!1].includes(t))return;t?r.callback(e):(o.off(r.uid),n.remove(o.id))}})})},this.off=(...t)=>{let e=this;if(2===t.length){const r=t[0],n=t[1];if("function"==typeof n){const t=e.eventMap.get(r);if(t){let o=t.filter(t=>t.callback!==n);0==o.length?e.eventMap.delete(r):e.eventMap.set(r,o)}return}}let r=[],n=[];t.forEach(t=>{-1!==t.indexOf(e.tag)?r.push(t):n.push(t)}),r.length>0&&e.eventMap.forEach((t,n)=>{let o=t.filter(t=>!r.includes(t.uid));0==o.length?e.eventMap.delete(n):e.eventMap.set(n,o)}),n.forEach(t=>{e.eventMap.delete(t)})},this.clear=()=>{this.eventMap=new Map},n.add(this)}}class s{static on(t,e,r){return s.eventbean.on(t,e,r)}static once(t,e,r){return s.eventbean.once(t,e,r)}static emit(t,e={},r=!0){return s.eventbean.emit(t,e,r)}static off(...t){return s.eventbean.off(...t)}static clear(){return s.eventbean.clear()}}s.eventbean=new o;class a{}a.setValue=t=>{if(t&&"string"!=typeof t)try{t=JSON.stringify(t)}catch(t){}return t},a.getValue=t=>{if("string"==typeof t)if(t.startsWith("{")||t.startsWith("["))try{return JSON.parse(t)}catch(t){}else if(!isNaN(Number(t)))return Number(t);return t};class i{static set(t,e,r){var n,o;e=a.setValue(e),null===(n=i.localStorage)||void 0===n||n.setItem(t,e),(r=r||{}).expire||(r.expire=24*i.expire*60*60);const s=Date.now()+r.expire*this.expireUnit;null===(o=i.localStorage)||void 0===o||o.setItem(t+"_expire",s+"")}static get(t){var e,r;const n=null===(e=i.localStorage)||void 0===e?void 0:e.getItem(t+"_expire");if(n&&Date.now()>Number(n))return this.remove(t),this.remove(t+"_expire"),null;let o=null===(r=i.localStorage)||void 0===r?void 0:r.getItem(t);return o=a.getValue(o),o}static remove(t){var e;null===(e=i.localStorage)||void 0===e||e.removeItem(t)}static clear(){i.localStorage.clear()}}i.localStorage=localStorage,i.expire=3600,i.expireUnit=1e3;class l{static set(t,e,r){e=a.setValue(e);let n=t+"="+encodeURIComponent(e);if(n+="; path="+((null==r?void 0:r.path)?null==r?void 0:r.path:"/"),!(null==r?void 0:r.session)){let t="";if(null==r?void 0:r.expire)t=new Date(Date.now()+r.expire*this.expireUnit).toUTCString();else{let e=new Date;e.setDate(e.getDate()+this.expire),t=e.toUTCString()}n+="; expires="+t}r&&r.domain&&(n+="; domain="+r.domain),document.cookie=n}static get(t){const e=t+"=",r=document.cookie.split(";");for(const t of r){const r=t.trim();if(0===r.indexOf(e)){let t=decodeURIComponent(r.substring(e.length,r.length));return t=a.getValue(t),t}}return null}static remove(t,e){this.set(t,"",{domain:e,expire:-1})}static clear(t=["/"],e=""){document.cookie.split(";").forEach(r=>{const n=r.indexOf("="),o=n>-1?r.substr(0,n):r;t.forEach(t=>{const r=e?`;domain=${e}`:"";document.cookie=`${o}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=${t}${r}`})})}}l.expire=3600,l.expireUnit=1e3;class c{static moveDiv(t,e){const r=(t,e)=>{let r=parseFloat(t.split("px")[0]);return void 0!==e&&(r=parseFloat(r.toFixed(e))),r};t.style.position="absolute",t.style.width=t.offsetWidth+"px",t.style.height=t.offsetHeight+"px",t.style.left=t.offsetLeft+"px",t.style.top=t.offsetTop+"px";const n={start:!1,x:0,y:0};t.onmousedown=e=>{if(0===e.button){if("none"===t.style.pointerEvents)return;n.start=!0,n.x=e.x,n.y=e.y,document.onmousemove=e=>{if(n.start){const o=t.getBoundingClientRect().width/t.offsetWidth;let s=e.x-n.x,a=e.y-n.y;s/=o,a/=o;const i=r(t.style.top)+a,l=r(t.style.left)+s;t.style.top=i+"px",t.style.left=l+"px",n.x=e.x,n.y=e.y}}}},t.onmousemove=()=>{t.style.cursor="move"},t.onmouseup=o=>{const s=r(t.style.top,0),a=r(t.style.left,0),i=r(t.style.width,0),l=r(t.style.height,0);t.style.top=s+"px",t.style.left=a+"px",t.style.width=i+"px",t.style.height=l+"px",n.start=!1,n.x=0,n.y=0,document.onmousemove=null,e&&e({left:a,top:s})}}static getScrollbarWidth(){const t=document.createElement("div");t.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(t);const e=t.offsetWidth-t.clientWidth;return document.body.removeChild(t),e}}c.listenerVm=t=>{},c.listener=(t,e,r)=>{t.addEventListener(e,r);const n=()=>t.removeEventListener(e,r);return c.listenerVm(n),{remove:n}},c.useTouch=()=>{const t={startX:-1,startY:-1,deltaX:0,deltaY:0,offsetX:0,offsetY:0,direction:"",startTime:0,endTime:0,moveX:0,moveOffsetX:0,moveY:0,moveOffsetY:0};const e=()=>{t.startX=-1,t.startY=-1,t.deltaX=0,t.deltaY=0,t.offsetX=0,t.offsetY=0,t.direction="",t.endTime=(new Date).getTime()-t.startTime},r=e=>{const r=e,n=void 0!==r.clientX?r.clientX:r.touches[0].clientX,o=void 0!==r.clientY?r.clientY:r.touches[0].clientY;return t.moveOffsetX=n-t.moveX,t.moveOffsetY=o-t.moveY,t.moveX=n,t.moveY=o,{x:n,y:o}};return{getXY:r,move:e=>{const n=r(e);t.deltaX=(n.x<0?0:n.x)-t.startX,t.deltaY=n.y-t.startY,t.offsetX=Math.abs(t.deltaX),t.offsetY=Math.abs(t.deltaY);var o,s;(!t.direction||t.offsetX<10&&t.offsetY<10)&&(t.direction=(o=t.offsetX,s=t.offsetY,o>s?"horizontal":s>o?"vertical":""))},start:n=>{e(),t.startTime=(new Date).getTime();const o=r(n);t.startX=o.x,t.startY=o.y},reset:e,isVertical:()=>"vertical"===t.direction,isHorizontal:()=>"horizontal"===t.direction,conf:t}},c.isTextOverflow=t=>{const e=document.createElement("div"),r=window.getComputedStyle(t);if("nowrap"!==r.whiteSpace)return!1;e.style.cssText=r.cssText,e.style.fontSize=r.fontSize,e.style.padding=r.padding,e.style.position="absolute",e.style.visibility="hidden",e.style.whiteSpace="nowrap",e.style.width="auto",e.style.maxWidth="none",e.style.overflow="visible",e.textContent=t.textContent,document.body.appendChild(e);const n=e.offsetWidth>t.offsetWidth;return document.body.removeChild(e),n};class d{remove(t){const e=this;for(let r=e.length-1;r>=0;r--)"function"==typeof t?t(e[r])&&e.splice(r,1):e[r]===t&&e.splice(r,1)}toSet(t){return void 0===t&&(t=(t,e)=>t===e),this.filter((e,r,n)=>n.findIndex(r=>t(e,r))===r)}randSort(){const t=this;for(var e=0,r=t.length;e<r;e++){var n=parseInt(Math.random()*r+""),o=t[n];t[n]=t[e],t[e]=o}}sum(t){return this.reduce((e,r)=>e+=t?r[t]:r,0)}}class u{static Format(t,e){return Date.Format(this,t,e)}static FormatDiff(t){return Date.FormatDiff(this,t)}static getTimeDiff(){return Date.timeDiff+this.getTime()}}class h{static contains(t,e){const r=this;return r.left<t&&r.top<e&&t<r.left+r.width&&e<r.top+r.height}static containX(t){const e=this;return e.left<t&&t<e.left+e.width}static containY(t){const e=this;return e.top<t&&t<e.top+e.height}}class p{static args(){let t=this.toString();return t=t.substring(t.indexOf("(")+1,t.indexOf("{")).replace(/\s+/g,""),t.substring(0,t.indexOf(")")).split(",").filter(t=>t.length>0)}}class f{static toJson(){const t=this;let e={};for(const r of t)e[r[0]]=r[1];return JSON.stringify(e)}}class m{static init(){Date.formatFail="",Date.Format=(t,e,r)=>{if(!(t instanceof Date)){if(String(t).length<10)return r||Date.formatFail;t=new Date(t)}const n=new Date(t.getTime());e||(e="yyyy-MM-dd hh:mm:ss");var o={"M+":n.getMonth()+1,"d+":n.getDate(),"h+":n.getHours(),"m+":n.getMinutes(),"s+":n.getSeconds(),"q+":Math.floor((n.getMonth()+3)/3),S:n.getMilliseconds()};for(var s in/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(n.getFullYear()+"").substring(4-RegExp.$1.length))),o)new RegExp("("+s+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?o[s]:("00"+o[s]).substring((""+o[s]).length)));return e},Date.FormatDiff=(t,e)=>(t instanceof Date||(t=new Date(t)),Date.Format(t.getTime()+Date.timeDiff,e)),Date.timeDiff=0}}class g{static getClassNames(t){const e={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0,constructor:!0};let r=[],n=Object.getOwnPropertyNames(t);for(let o=0;o<n.length;++o){const s=n[o];e[s]||"function"!=typeof t[s]||r.push(s)}return r}}g.getFunction=t=>{const e=t.name,r=t+"",n=r.indexOf("{"),o=-1!=r.substring(0,n).indexOf("*")?"*":"";return-1!=r.substring(0,n).indexOf("=>")?new Function(`return function${o} ${e} ${r.substring(0,r.indexOf(")")+1)+r.substring(n)}`)():new Function(`return function${o} ${e}${r.substring(r.indexOf("("))}`)()},g.setPrototype=(t,e,r)=>{r=g.getFunction(r),Object.defineProperty(t.prototype,e,{writable:!0,enumerable:!1,value:r})},g.classSetToProperty=(t,e)=>{g.getClassNames(t).forEach(r=>{g.setPrototype(window[e],r,t[r])})},g.iterator=function(){let t=this,e=Object.keys(t),r=0;return"_Vue3ToolIterator"===this._Vue3ToolIterator&&(e=this.keys,t=this.obj),new class{constructor(){return this._Vue3ToolIterator="_Vue3ToolIterator",this.obj=t,this.keys=e,this.next=()=>(r++,{value:r>e.length?null:t[e[r-1]],done:r>this.keys.length}),this}}};class y{static init(){g.classSetToProperty(d.prototype,"Array"),m.init(),g.classSetToProperty(u,"Date"),g.classSetToProperty(p,"Function"),g.classSetToProperty(h,"DOMRect"),g.classSetToProperty(f,"Map")}static setLang(t){this.langObj=t}}var x,v,b;y.langObj={HttpUtil:{0:"请求中断",404:"请求地址不存在",405:"请求方法不允许",500:"请求异常",504:"请求超时",OtherException:"其他异常"},TimeUtil:{Today:"今天",Yesterday:"昨天",ThisWeek:"本周",LastWeek:"上周",ThisMonth:"本月",JustNow:"刚刚"}};class w{}x=w,w.arrToHex=t=>{let e="";return t.forEach(t=>e+=(2^t).toString(16)+"u"),e.substring(0,e.length-1)},w.hexToArr=t=>{let e=[];return t.split("u").forEach(t=>{e.push(2^parseInt((t=>{for(var e,r=t.length,n=new Array(r),o=0;o<r;o++)48<=(e=t.charCodeAt(o))&&e<58?e-=48:e=(223&e)-65+10,n[o]=e;return n.reduce(function(t,e){return 16*t+e},0)})(t)))}),e},w.encode=t=>x.arrToHex(r.stringToByte(t)),w.decode=t=>r.byteToString(x.hexToArr(t));class T{}v=T,T.httpBean=null,T.getFileFun=t=>{const e=v;null==e.httpBean&&(e.httpBean=httpBean());let r={base:"/",outtime:3e4,responseType:"text"};t&&(r=Object.assign(r,t));return t=>(t.startsWith("http")||(t=r.base+t),new Promise(n=>{e.httpBean.get({url:t,timeout:r.outtime,responseType:r.responseType}).then(t=>{n(t)}).catch(()=>{n(void 0)})}))},T.getFile=(t,e)=>v.getFileFun(e)(t);class C{}C.id=0,C.getId=()=>"_Timer_"+C.id++,C.map={},C.add=(t,e,r,n)=>{const o=C,s=o.getId(),a=r?setInterval:setTimeout,i=r?clearInterval:clearTimeout,l=()=>{o.map[s]&&i(c),o.map[s]=void 0,delete o.map[s]},c=a(()=>{const e=n();r&&![1,0,!0,!1].includes(e)||(e?(t(),r||l()):l())},e);return o.map[s]={fun:t,vm:n,id:s,remove:l},o.map[s]},C.remove=(...t)=>{const e=C;t.forEach(t=>{e.map[t]&&e.map[t].remove()})},C.removeAll=()=>{const t=C;t.remove(...Object.keys(t.map))};class M{constructor(){this.map={},this.vm=()=>()=>!0,this.createVM=t=>{if(!t){const e=this.vm();t=()=>e()}return t},this.once=(t,e=0,r)=>{const n=C.add(t,e,!1,this.createVM(r));return this.map[n.id]=n,n.id},this.clear=()=>{const t=this,e=Object.keys(t.map);for(let r=0;r<e.length;r++){const n=e[r],o=t.map[n];o&&o.remove(),t.map[n]=void 0,delete t.map[n]}},this.delayUnit=1,this.delay=(t=0,e=this.delayUnit)=>{const r=this;return new Promise(n=>{r.once(()=>n(),t*e)})},this.on=(t,e,r=!1,n)=>{r&&t();const o=C.add(t,e,!0,this.createVM(n));return this.map[o.id]=o,o.id},this.un=(...t)=>{const e=this;t.forEach(t=>{const r=e.map[t];r&&r.remove(),e.map[t]=void 0,delete e.map[t]})}}}class S{static once(t,e=0,r){return this.timerBean.once(t,e,r)}static async delay(t=0,e=this.delayUnit){await this.timerBean.delay(t,e)}static on(t,e,r=!1,n){return this.timerBean.on(t,e,r,n)}}S.timerBean=new M,S.clear=()=>{C.removeAll()},S.delayUnit=1,S.un=(...t)=>{C.remove(...t)};const O=t=>{let e=t.toString().trim();return e.length>50&&(e=e.substring(0,22)+e.substring(e.length-22,e.length-1)),e};class k{}b=k,k.timer=S,k.debounceMap={},k.debounce=(t,e=500)=>{const r=b,n=O(t);r.debounceMap[n]&&r.timer.un(r.debounceMap[n]),r.debounceMap[n]=r.timer.once(()=>{t(),delete r.debounceMap[n]},e)},k.throttleMap={},k.throttle=(t,e=500,r=b.throttleTip)=>{const n=b,o=O(t);n.throttleMap[o]?r():(t(),n.throttleMap[o]=n.timer.once(()=>{delete n.throttleMap[o]},e))},k.throttleTip=()=>{},k.lockMap={},k.lock=async t=>{const e=b,r=O(t);return e.lockMap[r]||(e.lockMap[r]=new Promise(async(n,o)=>{try{n(await t())}catch(t){o(t)}delete e.lockMap[r]})),await e.lockMap[r]};class j{static rem(){const t=j;let e=document.getElementsByTagName("head")[0].getAttribute("design-width");e||(e=t.remWidth),t.remWidth=e,t.refresh(),window.addEventListener("resize",()=>{t.refresh()});const r=document.createElement("style");r.innerHTML="@media screen and (min-width:"+t.remWidth+"px){.design-box{width:"+t.remWidth+"px !important;position:relative;}",document.getElementsByTagName("head")[0].appendChild(r)}static refresh(){const t=j;let e=t.getDeviceWidth();document.documentElement.style.fontSize=e/(t.remWidth/t.remFontSize)+"px"}static getDeviceWidth(){const t=j;let e=document.documentElement.clientWidth;const r="function"==typeof t.maxWidth?t.maxWidth():t.maxWidth;return e>=r&&(e=r),e}static rem2px(t){const e=j;return t*(e.getDeviceWidth()/e.remWidth)}static px2rem(t){const e=j;let r=e.getDeviceWidth();return t*(e.remWidth/r)}static getMaxBox(){const t=this.remWidth,e=this.remHeight,r=window.innerWidth,n=window.innerHeight,o=e/t,s=n/r;return o>s?{height:n,width:n/o}:this.maxRatio&&s>this.maxRatio?{height:r*this.maxRatio,width:r}:{height:n,width:r}}static getMaxHeight(){return this.getMaxBox().height}static getMaxWidth(){return this.getMaxBox().width}}var D,E;j.remWidth=750,j.maxWidth=500,j.remFontSize=1,j.maxRatio=2.221,j.remHeight=1334;class A{static deepAssign(t,e){const r=D;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return t;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&("object"==typeof e[n]&&null!==e[n]&&"object"==typeof t[n]&&null!==t[n]?r.deepAssign(t[n],e[n]):t[n]=e[n]);return t}static setPathVal(t,e,r,n){null==n&&(e=e.split("."),n=0),n===e.length-1?t[e[n]]=r:(t[e[n]]=t[e[n]]||{},D.setPathVal(t[e[n]],e,r,n+1))}}D=A,A.objectToString=Object.prototype.toString,A.toTypeString=t=>D.objectToString.call(t),A.isArray=Array.isArray,A.isMap=t=>"[object Map]"===D.toTypeString(t),A.isSet=t=>"[object Set]"===D.toTypeString(t),A.isDate=t=>"[object Date]"===D.toTypeString(t),A.isFunction=t=>"function"==typeof t,A.isString=t=>"string"==typeof t,A.isSymbol=t=>"symbol"==typeof t,A.isObject=t=>null!==t&&"object"==typeof t,A.isPromise=t=>D.isObject(t)&&D.isFunction(t.then)&&D.isFunction(t.catch),A.getObject=(t,e)=>{const r=D;let n=!1;if(r.isArray(t))for(let r=0;r<t.length&&(n=D.getObject(t[r],e),!n);r++);else if(r.isObject(t)){const o=Object.keys(t);for(let s=0;s<o.length;s++){const a=o[s],i=t[a];if(n=e(a,i,t),n)break;if((r.isArray(i)||r.isObject(i))&&(n=r.getObject(i,e)),n)break}}return n},A.getObjectByChildren=(t,e,r=["children"])=>{if(Array.isArray(t))for(let n=0;n<t.length;n++)D.getObjectByChildren(t[n],e,r);else if(D.isObject(t)){e(t);for(let n=0;n<r.length;n++)t[r[n]]&&D.getObjectByChildren(t[r[n]],e,r)}},A.deepMerge=(t,e)=>{const r=D,n=Object.assign({},t);for(const o in e)e.hasOwnProperty(o)&&("object"==typeof e[o]&&t.hasOwnProperty(o)&&"object"==typeof t[o]?n[o]=r.deepMerge(t[o],e[o]):n[o]=e[o]);return n},A.getPathValue=(t,e,r)=>{if("object"!=typeof t)return r;const n=e.split(".");let o=t;for(let t=0;t<n.length;t++)try{o=o[n[t]]}catch(t){return r}return o};class F{static uuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})}static isNull(t){return Array.isArray(t)?0==t.length:t+""=="null"||t+""=="undefined"||""===t||t+""=="NaN"}static clearBlank(t){return t?t.replace(/\s+|\t|\r|\n/g,""):""}static isNumber(t){return/^[0-9]+$/.test(t)}static getParam(t){const e=t.match(/[?&]([^=#]+)=([^&#]*)/g);return e?e.reduce((t,e)=>{const[r,n]=e.substring(1).split("=");return t[r]=decodeURIComponent(n),t},{}):{}}static copyText(t){return new Promise(e=>{if(navigator.clipboard)navigator.clipboard.writeText(t).then(()=>{e(!0)}).catch(t=>{e(!1)});else{const r=document.createElement("textarea");r.value=t,document.body.appendChild(r),r.select(),document.execCommand("copy"),document.body.removeChild(r),e(!0)}})}}E=F,F.id=1e3,F.getId=()=>(E.id++,E.id+"");class W{static init(){const t=(t,e,r)=>{if(e){e.onreadystatechange=null,e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null;try{e.onprogress=null}catch(t){}try{e.upload.onprogress=null,e.upload.onload=null,e.upload.onerror=null,e.upload.onabort=null,e.upload.ontimeout=null,e.upload.onloadend=null,e.upload.onloadstart=null}catch(t){}e=void 0}r&&(t.xhr[r]=void 0,delete t.xhr[r])},e=e=>{const r={dataCache:{},xhr:{},get:(e,n)=>{n||(n={}),"string"==typeof e?e={url:e,method:"GET"}:(e.method=e.method||"GET",e.method=e.method.toUpperCase());const o=e;return new Promise(async(s,a)=>{const i=F.getId(),l=r.config,c=l.base,d=l.before,u=l.after,h=l.error,p={headers:l.headers,data:n,param:o,stop:()=>{f&&(f.abort(),t(r,f,i))}};let f=new XMLHttpRequest;d&&await d(p,f);let m=c+o.url;o.url.startsWith("http")&&(m=o.url),m.startsWith("//")&&(m=m.replace(/(\/{2,})/g,"/"));const g=(t=>{const e={};return Object.keys(t).forEach(r=>{"function"!=typeof t[r]&&(e[r]=t[r])}),e})(p.data);if("GET"===o.method){const t=Object.keys(g).map(t=>`${t}=${encodeURIComponent(g[t])}`).join("&");m=t?`${m}?${t}`:m}const x=m+JSON.stringify(g);0!==o.expire&&void 0!==o.expire||delete r.dataCache[x];let v=r.dataCache[x];if(v){if(v.expire>Date.now())return await u({data:v.data,responseType:o.responseType||l.responseType,status:200,xhr:null},p),void s(v.data);delete r.dataCache[x]}f.open(o.method,m,!0),o.headers&&(p.headers=Object.assign(Object.assign({},p.headers),o.headers)),Object.keys(p.headers).forEach(t=>{const e=p.headers[t];e&&!e.startsWith("multipart/form-data")&&f.setRequestHeader(t,e)}),f.timeout=o.timeout||l.timeout,f.responseType=o.responseType||l.responseType;try{f.withCredentials=o.withCredentials||l.withCredentials}catch(t){}const b=y.langObj.HttpUtil,w=(e,n)=>{var o;h(e,p,n),t(r,f,i),a({status:e,message:null!==(o=b[e+""])&&void 0!==o?o:b.OtherException})};f.ontimeout=function(){w(504)},f.onerror=function(t){w(500)},f.onabort=function(){w(0)};const T=e;if(f.upload&&T.onProgress&&(f.upload.onprogress=function(t){if(t.lengthComputable&&t.total>0){const e=parseInt(t.loaded/t.total*100);T.onProgress(e,t.loaded,t.total)}}),f.onreadystatechange=async function(){if(4===f.readyState){const e={data:f.response,responseType:f.responseType,status:f.status,xhr:f};if(0!==f.status){const t=f.getResponseHeader("Content-Type");if(t&&t.includes("application/json")&&"string"==typeof f.response)try{e.data=JSON.parse(f.response)}catch(t){}}if(200===f.status){if(o.expire){let t=o.expire;t<0&&(t=l.expireMaxTime),r.dataCache[x]={data:e.data,expire:Date.now()+1e3*t}}await u(e,p),200!==e.status?w(e.status):t(r,f,i),s(e.data)}else 0!==f.status&&w(f.status,e)}},"GET"===o.method)f.send();else{const t=p.headers["Content-Type"];if("multipart/form-data"==t){const t=new FormData;let e=0;for(let r in g)g[r]instanceof File?(t.append(r,g[r],g[r].name||r),e+=g[r].size):t.append(r,g[r]);T.onProgress&&T.onProgress(0,0,e),f.send(t)}else"application/x-www-form-urlencoded"==t?f.send(Object.keys(g).map(t=>`${t}=${encodeURIComponent(g[t])}`).join("&")):"application/json"==t?f.send(JSON.stringify(g)):f.send(g)}r.xhr[i]=f})},post:(t,e)=>("string"==typeof t?t={url:t,method:"POST"}:t.method=t.method||"POST",r.get(t,e)),stop:()=>{Object.keys(r.xhr).forEach(e=>{r.xhr[e].abort(),t(r,r.xhr[e])}),r.xhr={}},config:{base:"",timeout:3e4,withCredentials:!1,responseType:"text",expireMaxTime:86400,headers:{Accept:"*","Content-Type":"application/json"},before:()=>{},after:()=>{},error:()=>{}},setConfig:t=>{r.dataCache={},t&&"object"==typeof t&&(r.config=A.deepMerge(r.config,t))}};return r.setConfig(e),r};window.httpBean=e,window.http=e()}static ping(t,e=6e3){return new Promise(r=>{t.endsWith("/")||(t+="/");let n=new Image,o=Date.now();const s=setTimeout(()=>{r(e)},e);n.onerror=function(){clearTimeout(s),r(Date.now()-o)},n.src=t+o})}}class U{}U.sendMessage=(t,e)=>{var r,n;if(e){const n=document.getElementById(e);null===(r=null==n?void 0:n.contentWindow)||void 0===r||r.postMessage(t,"*")}else null===(n=window.parent)||void 0===n||n.postMessage(t)},U.onMassage=t=>{window.addEventListener("message",t)},U.offMassage=t=>{window.removeEventListener("message",t)};class N{static handleSrc(t){const e=Element.prototype.setAttribute;Element.prototype.setAttribute=function(t,r){return"IMG"===this.tagName&&"src"===t.toLowerCase()&&(r=o(r)),e.call(this,t,r)};const r=HTMLImageElement.prototype,n=Object.getOwnPropertyDescriptor(r,"src");function o(e){return t(e)}Object.defineProperty(r,"src",{set(t){return t=o(t),n.set.call(this,t)},get(){return n.get.call(this)},configurable:!0})}}N.loadImage=t=>{if(!(t.extensions||[".png",".jpg",".jpeg",".webp",".gif",".svg"]).some(e=>t.url.endsWith(e)))return;let e=new Image;e.crossOrigin="Anonymous",e.src=t.url;let r=!1;return e.onload=function(){var n;if(r)return;r=!0;const o={dataBase64:"",dataArray:null};if(t.base64||t.arrayBuffer){let r=document.createElement("canvas");const n=r.getContext("2d");r.height=e.height,r.width=e.width,n.drawImage(e,0,0,e.width,e.height);const s=t.url.split(".").pop();t.arrayBuffer&&(o.dataArray=n.getImageData(0,0,e.width,e.height)),t.base64&&(o.dataBase64="gif"===s||"svg"===s?r.toDataURL(`image/${s}`):r.toDataURL(`image/${s}`,t.base64Quality)),r=null}null===(n=t.load)||void 0===n||n.call(t,e,o),e=null},e.onerror=function(){var e;r||(r=!0,null===(e=t.error)||void 0===e||e.call(t))},{img:e,abort:()=>{if(!r){r=!0;try{e.src="",e=null}catch(t){}}}}};class I{static cp(t){try{return JSON.parse(JSON.stringify(t))}catch(t){return null}}static deepClone(t,e=new WeakMap){let r=t;if(null===r)return r;if(r instanceof Date)return new Date(r);if(r instanceof RegExp)return new RegExp(r);if("object"!=typeof r)return r;if(e.get(r))return e.get(r);try{let t=new r.constructor;e.set(r,t);for(let n in r)r.hasOwnProperty(n)&&(t[n]=this.deepClone(r[n],e));return t}catch(t){return r}}}I.strToObject=t=>{Array.isArray(t)?t.forEach(t=>{I.strToObject(t)}):"object"==typeof t&&t&&Object.keys(t).forEach(e=>{const r=t[e];"string"==typeof r&&(r.startsWith("{")||r.startsWith("["))&&(t[e]=JSON.parse(r)),I.strToObject(t[e])})};class B{}function P(t,e=15){return+parseFloat(Number(t).toPrecision(e))}function _(t){const e=t.toString().split(/[eE]/),r=(e[0].split(".")[1]||"").length-+(e[1]||0);return r>0?r:0}function Y(t){if(-1===t.toString().indexOf("e"))return Number(t.toString().replace(".",""));const e=_(t);return e>0?P(Number(t)*Math.pow(10,e)):Number(t)}function L(t){return(...e)=>{const[r,...n]=e;return n.reduce((e,r)=>t(e,r),r)}}B.groupKey=(t,e)=>{let r={};const n={ctrl:"control",esc:"escape"};t=t.map(t=>(t=t.toLocaleLowerCase(),n[t]&&(t=n[t]),t));const o=function(n){if(!n.key)return;const o=n.key.toLocaleLowerCase();if(r[o])return;r[o]=!0;const s=t[t.length-1]===o;let a=!0;for(let e=0;e<t.length-1;e++)if(!r[t[e]]){a=!1;break}s&&a&&e()},s=function(t){if(!t.key)return;const e=t.key.toLocaleLowerCase();r[e]=!1};return document.addEventListener("keydown",o),document.addEventListener("keyup",s),()=>{document.removeEventListener("keydown",o),document.removeEventListener("keyup",s)}};const $=L((t,e)=>{const r=Y(t),n=Y(e),o=_(t)+_(e);return r*n/Math.pow(10,o)}),R=L((t,e)=>{const r=Math.pow(10,Math.max(_(t),_(e)));return($(t,r)+$(e,r))/r}),X=L((t,e)=>{const r=Math.pow(10,Math.max(_(t),_(e)));return($(t,r)-$(e,r))/r}),H=L((t,e)=>{const r=Y(t),n=Y(e);return $(r/n,P(Math.pow(10,_(e)-_(t))))});class V{static getNumber(t,e){let r=parseFloat(t);return r=F.isNull(r)?0:r,e?parseFloat(r.toFixed(e)):r}static getRandomInt(t,e,r,n){const o=(t,e)=>(t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t),s=o(t,e);if(void 0===r||void 0===n)return s;const a=o(r,n);return Number(s+"."+a)}}V.strip=P,V.plus=R,V.minus=X,V.times=$,V.divide=H,V.round=function(t,e){const r=Math.pow(10,e);let n=H(Math.round(Math.abs($(t,r))),r);return t<0&&0!==n&&(n=$(n,-1)),n},V.digitLength=_,V.float2Fixed=Y;class z{static getDateOptions(){const t=y.langObj.TimeUtil,e=[];e.push({label:t.Today,value:z.somedayse(),key:"today"}),e.push({label:t.Yesterday,value:z.somedayse(-1),key:"yesterday"});const r=new Date,n=z.somedayse,o=r.getDay(),s=n(1-o)[0],a=n(7-o)[1],i={label:t.ThisWeek,value:[s,a],key:"thisWeek"};e.push(i);const l=n(1-o-7)[0],c=n(7-o-7)[1],d={label:t.LastWeek,value:[l,c],key:"lastWeek"};e.push(d);const u=new Date;u.setDate(1);const h=n(0,u);u.setMonth(u.getMonth()+1),u.setDate(1),u.setDate(u.getDate()-1);const p=n(0,u),f={label:t.ThisMonth,value:[h[0],p[1]],key:"thisMonth"};return e.push(f),e}}z.countdown=t=>{const e=t=>t<10?`0${t}`:`${t}`;let r=Math.floor(t/1e3);if(r<0)return["00","00","00",0];const n=Math.floor(r/60/60/24),o=Math.floor(r/60/60%24),s=Math.floor(r/60%60),a=r%60;return[e(n),e(o),e(s),e(a),r]},z.somedayse=(t=0,e=new Date)=>{t*=864e5,e.setHours(0,0,0,0);const r=e.getTime()+t;e.setHours(23,59,59,999);return[r,e.getTime()+t]},z.getTimeTip=t=>{const e=y.langObj.TimeUtil,r=new Date,n=new Date(t),o=r.getTime()-t;if(o<6e4)return e.JustNow;if(o<864e5){if(r.Format("dd")==n.Format("dd"))return n.Format("hh:mm")}if(o<1728e5){if(new Date(z.somedayse(-1)[0]).Format("dd")==n.Format("dd"))return e.Yesterday}return r.getFullYear()==n.getFullYear()?n.Format("MM/dd"):n.Format("MM/dd/yyyy")};const J={ArrayUtil:t,Base64Util:e,ByteUtil:r,CEvent:s,CEventBean:o,JSONUtil:I,KeyUtil:B,MathUtil:V,DomUtil:c,EnUtil:w,IFrameUtil:U,StrUtil:F,ScriptUtil:class{static scriptLoad(t){const e=t=>{t.parentNode&&t.parentNode.removeChild(t),t.onload=null,t.onerror=null,t=null},r=document.getElementsByTagName("script")[0]||document.head;let n=document.createElement("script");return n.src=t,r.parentNode.insertBefore(n,r),new Promise(t=>{n.onload=function(){t(!0),e(n)},n.onerror=function(){t(!1),e(n)}})}},TimerBean:M,Timer:S,HttpUtil:W,CookieVal:a,Cookie:i,CookieC:l,FileUtil:T,H5Util:j,ObjectUtil:A,TimeUtil:z,FunUtil:k,ESUtil:y,ImgUtil:N};try{if(!window.CookieL){const t=Object.keys(J);for(let e=0;e<t.length;e++){const r=t[e];window[r]=J[r]}y.init(),W.init(),window.isNull=F.isNull}}catch(t){console.error(t)}}();
|
|
1
|
+
!function(){"use strict";class e{}e.swapArray=(e,t,r)=>(e[t]=e.splice(r,1,e[t])[0],e),e.zIndexUp=(t,r)=>{0!=r&&e.swapArray(t,r,r-1)},e.zIndexDown=(t,r)=>{r+1!=t.length&&e.swapArray(t,r,r+1)},e.zIndexTop=(t,r)=>{if(0!=r)for(var o=r-0,n=0;n<o;n++)e.swapArray(t,r,r-1),r--},e.zIndexBottom=(t,r)=>{if(r+1!=t.length)for(var o=t.length-1-r,n=0;n<o;n++)e.swapArray(t,r,r+1),r++},e.diff=(e,t)=>e.filter(e=>-1===t.indexOf(e));class t{static doCheck(e){var t;if("string"!=typeof e||!e)return!1;const r=e.replace(/[\r\n\s]/g,"");if(r.length%4!=0)return!1;if(!/^[A-Za-z0-9+/]*={0,2}$/.test(r))return!1;const o=(null===(t=r.match(/=+$/))||void 0===t?void 0:t[0].length)||0;return!(o>2)&&!(o>0&&!new RegExp(`^[A-Za-z0-9+/]+={${o}}$`).test(r))}}t._keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",t.encode=e=>{let r,o,n,s,a,i,l,c="",d=0;for(e=t._utf8_encode(e);d<e.length;)r=e.charCodeAt(d++),o=e.charCodeAt(d++),n=e.charCodeAt(d++),s=r>>2,a=(3&r)<<4|o>>4,i=(15&o)<<2|n>>6,l=63&n,isNaN(o)?i=l=64:isNaN(n)&&(l=64),c=c+t._keyStr.charAt(s)+t._keyStr.charAt(a)+t._keyStr.charAt(i)+t._keyStr.charAt(l);return c},t.decode=e=>{let r,o,n,s,a,i,l,c="",d=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");d<e.length;)s=t._keyStr.indexOf(e.charAt(d++)),a=t._keyStr.indexOf(e.charAt(d++)),i=t._keyStr.indexOf(e.charAt(d++)),l=t._keyStr.indexOf(e.charAt(d++)),r=s<<2|a>>4,o=(15&a)<<4|i>>2,n=(3&i)<<6|l,c+=String.fromCharCode(r),64!=i&&(c+=String.fromCharCode(o)),64!=l&&(c+=String.fromCharCode(n));return c=t._utf8_decode(c),c},t._utf8_encode=e=>{e=e.replace(/\r\n/g,"\n");let t="";for(let r=0;r<e.length;r++){let o=e.charCodeAt(r);o<128?t+=String.fromCharCode(o):o>127&&o<2048?(t+=String.fromCharCode(o>>6|192),t+=String.fromCharCode(63&o|128)):(t+=String.fromCharCode(o>>12|224),t+=String.fromCharCode(o>>6&63|128),t+=String.fromCharCode(63&o|128))}return t},t._utf8_decode=e=>{let t="",r=0,o=0,n=0;for(;r<e.length;)if(o=e.charCodeAt(r),o<128)t+=String.fromCharCode(o),r++;else if(o>191&&o<224)n=e.charCodeAt(r+1),t+=String.fromCharCode((31&o)<<6|63&n),r+=2;else{n=e.charCodeAt(r+1);let s=e.charCodeAt(r+2);t+=String.fromCharCode((15&o)<<12|(63&n)<<6|63&s),r+=3}return t};class r{static uint8ArrayToString(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t}static stringToUint8Array(e){for(var t=[],r=0;r<e.length;r++)t.push(e.charCodeAt(r));return new Uint8Array(t)}}r.byteToString=e=>{if("string"==typeof e)return e;for(var t="",r=e,o=0;o<r.length;o++){var n=r[o].toString(2),s=n.match(/^1+?(?=0)/);if(s&&8==n.length){for(var a=s[0].length,i=r[o].toString(2).slice(7-a),l=1;l<a;l++)i+=r[l+o].toString(2).slice(2);t+=String.fromCharCode(parseInt(i,2)),o+=a-1}else t+=String.fromCharCode(r[o])}return t},r.stringToByte=e=>{var t,r,o=new Array;t=e.length;for(var n=0;n<t;n++)(r=e.charCodeAt(n))>=65536&&r<=1114111?(o.push(r>>18&7|240),o.push(r>>12&63|128),o.push(r>>6&63|128),o.push(63&r|128)):r>=2048&&r<=65535?(o.push(r>>12&15|224),o.push(r>>6&63|128),o.push(63&r|128)):r>=128&&r<=2047?(o.push(r>>6&31|192),o.push(63&r|128)):o.push(255&r);return o};class o{}o.id=1e3,o.getId=()=>"_CEvent_"+o.id++,o.map={},o.add=e=>{o.map[e.id]=e},o.remove=(...e)=>{const t=o;e.forEach(e=>{t.map[e]&&(t.map[e].clear(),t.map[e]=null,delete t.map[e])})};class n{constructor(){this.vm=()=>()=>!0,this.eventMap=new Map,this.id=o.getId(),this.tag="__CEventBean__",this.on=(e,t,r)=>{let n=this;if(!r){const e=n.vm();r=()=>e()}let s=n.tag+o.getId(),a=n.eventMap.get(e);return a||(a=[]),a.push({callback:t,vm:r,uid:s,key:e}),n.eventMap.set(e,a),s},this.once=(e,t,r)=>{let o=this,n="";return n=o.on(e,e=>{t(e),o.off(n)},r),n},this.emit=(e,t={},r=!0)=>{let n=this;r?Object.keys(o.map).forEach(r=>{o.map[r].emit(e,t,!1)}):n.eventMap.forEach(r=>{r.forEach(r=>{if(r.key===e){const e=r.vm();if(![1,0,!0,!1].includes(e))return;e?r.callback(t):(n.off(r.uid),o.remove(n.id))}})})},this.off=(...e)=>{let t=this;if(2===e.length){const r=e[0],o=e[1];if("function"==typeof o){const e=t.eventMap.get(r);if(e){let n=e.filter(e=>e.callback!==o);0==n.length?t.eventMap.delete(r):t.eventMap.set(r,n)}return}}let r=[],o=[];e.forEach(e=>{-1!==e.indexOf(t.tag)?r.push(e):o.push(e)}),r.length>0&&t.eventMap.forEach((e,o)=>{let n=e.filter(e=>!r.includes(e.uid));0==n.length?t.eventMap.delete(o):t.eventMap.set(o,n)}),o.forEach(e=>{t.eventMap.delete(e)})},this.clear=()=>{this.eventMap=new Map},o.add(this)}}class s{static on(e,t,r){return s.eventbean.on(e,t,r)}static once(e,t,r){return s.eventbean.once(e,t,r)}static emit(e,t={},r=!0){return s.eventbean.emit(e,t,r)}static off(...e){return s.eventbean.off(...e)}static clear(){return s.eventbean.clear()}}var a,i,l,c;s.eventbean=new n;class d{}a=d,d.expire=36e3,d.expireUnit=864e5,d.CookieBean={},d.defaultKey="localStorage",d.keyMap={cookie:"cookie",indexedDB:"indexedDB",localStorage:"localStorage"},d.CookieObj={},d.init=(e,t)=>{a.CookieObj[e]=t},d.setCookieBean=e=>{a.CookieBean=e},d.getCookieBean=(e=a.defaultKey)=>a.CookieObj[e];class u{}u.setValue=e=>{if(e&&"string"!=typeof e)try{e=JSON.stringify(e)}catch(e){}return e},u.getValue=e=>{if("string"==typeof e)if(e.startsWith("{")||e.startsWith("["))try{return JSON.parse(e)}catch(e){}else if(!isNaN(Number(e)))return Number(e);return e};class h{static set(e,t,r){t=u.setValue(t);let o=e+"="+encodeURIComponent(t);if(o+="; path="+((null==r?void 0:r.path)?null==r?void 0:r.path:"/"),!(null==r?void 0:r.session)){let e="";if(null==r?void 0:r.expire)e=new Date(Date.now()+r.expire*d.expireUnit).toUTCString();else{let t=new Date;t.setTime(t.getTime()+d.expire*d.expireUnit),e=t.toUTCString()}o+="; expires="+e}r&&r.domain&&(o+="; domain="+r.domain),document.cookie=o}static get(e){const t=e+"=",r=document.cookie.split(";");for(const e of r){const r=e.trim();if(0===r.indexOf(t)){let e=decodeURIComponent(r.substring(t.length,r.length));return e=u.getValue(e),e}}return null}static remove(e,t){this.set(e,"",{domain:t,expire:-1})}static clear(e){var t;const r=(null===(t=null==e?void 0:e.paths)||void 0===t?void 0:t.length)?e.paths:["/"],o=null==e?void 0:e.domain,n=new Set((null==e?void 0:e.excludeList)||[]),s=document.cookie?document.cookie.split(";"):[];for(const e of s){const t=e.indexOf("="),s=t>-1?e.slice(0,t).trim():e.trim();if(s&&!n.has(s))for(const e of r)this.set(s,"",{domain:o,expire:-1,path:e})}}}class p{static set(e,t,r){t=u.setValue(t),localStorage.setItem(e,t),(r=r||{}).expire||(r.expire=d.expire);const o=Date.now()+r.expire*d.expireUnit;localStorage.setItem(e+"_expire",o+"")}static get(e){const t=localStorage.getItem(e+"_expire");if(t&&Date.now()>Number(t))return this.remove(e),this.remove(e+"_expire"),null;let r=localStorage.getItem(e);return r=u.getValue(r),r}static remove(e){localStorage.removeItem(e)}static clear(e){if((null==e?void 0:e.excludeList)&&0!==e.excludeList.length){const t=new Set(e.excludeList),r=[];for(let e=0;e<localStorage.length;e++){const o=localStorage.key(e);o&&!t.has(o)&&r.push(o)}for(const e of r)localStorage.removeItem(e)}else localStorage.clear()}}class m{static openDB(){return this.dbPromise||(this.dbPromise=new Promise((e,t)=>{const r=window.indexedDB.open(this.dbName,1);r.onerror=()=>{this.dbPromise=null,t(r.error)},r.onupgradeneeded=()=>{const e=r.result;e.objectStoreNames.contains(this.storeName)||e.createObjectStore(this.storeName,{keyPath:"key"})},r.onsuccess=()=>{const t=r.result;t.onversionchange=()=>{t.close(),this.dbPromise=null},e(t)}})),this.dbPromise}static async set(e,t,r){t=u.setValue(t),(r=r||{}).expire||(r.expire=d.expire);const o=Date.now()+r.expire*d.expireUnit,n=(await this.openDB()).transaction(this.storeName,"readwrite");return n.objectStore(this.storeName).put({key:e,value:t,_expire:o}),new Promise((e,t)=>{n.oncomplete=()=>e(),n.onerror=()=>t(n.error)})}static async get(e){const t=(await this.openDB()).transaction(this.storeName,"readonly").objectStore(this.storeName).get(e);return new Promise((r,o)=>{t.onsuccess=async()=>{const o=t.result;if(!o)return r(null);if(o._expire&&Date.now()>Number(o._expire))return await this.remove(e),r(null);let n=u.getValue(o.value);r(n)},t.onerror=()=>{o(t.error)}})}static async remove(e){const t=(await this.openDB()).transaction(this.storeName,"readwrite");return t.objectStore(this.storeName).delete(e),new Promise((e,r)=>{t.oncomplete=()=>e(),t.onerror=()=>r(t.error)})}static async clear(e){const t=(await this.openDB()).transaction(this.storeName,"readwrite"),r=t.objectStore(this.storeName);if((null==e?void 0:e.excludeList)&&0!==e.excludeList.length){const o=new Set(e.excludeList),n=r.openCursor();return new Promise((e,r)=>{n.onsuccess=e=>{const t=e.target.result;t&&(o.has(t.key)||t.delete(),t.continue())},n.onerror=()=>{r(n.error)},t.oncomplete=()=>e(),t.onerror=()=>r(t.error)})}return r.clear(),new Promise((e,r)=>{t.oncomplete=()=>e(),t.onerror=()=>r(t.error)})}}m.dbPromise=null,m.dbName="CookieIDB",m.storeName="CookieStore";class f{static moveDiv(e,t){const r=(e,t)=>{let r=parseFloat(e.split("px")[0]);return void 0!==t&&(r=parseFloat(r.toFixed(t))),r};e.style.position="absolute",e.style.width=e.offsetWidth+"px",e.style.height=e.offsetHeight+"px",e.style.left=e.offsetLeft+"px",e.style.top=e.offsetTop+"px";const o={start:!1,x:0,y:0};e.onmousedown=t=>{if(0===t.button){if("none"===e.style.pointerEvents)return;o.start=!0,o.x=t.x,o.y=t.y,document.onmousemove=t=>{if(o.start){const n=e.getBoundingClientRect().width/e.offsetWidth;let s=t.x-o.x,a=t.y-o.y;s/=n,a/=n;const i=r(e.style.top)+a,l=r(e.style.left)+s;e.style.top=i+"px",e.style.left=l+"px",o.x=t.x,o.y=t.y}}}},e.onmousemove=()=>{e.style.cursor="move"},e.onmouseup=n=>{const s=r(e.style.top,0),a=r(e.style.left,0),i=r(e.style.width,0),l=r(e.style.height,0);e.style.top=s+"px",e.style.left=a+"px",e.style.width=i+"px",e.style.height=l+"px",o.start=!1,o.x=0,o.y=0,document.onmousemove=null,t&&t({left:a,top:s})}}static getScrollbarWidth(){const e=document.createElement("div");e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e);const t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}}f.listenerVm=e=>{},f.listener=(e,t,r)=>{e.addEventListener(t,r);const o=()=>e.removeEventListener(t,r);return f.listenerVm(o),{remove:o}},f.useTouch=()=>{const e={startX:-1,startY:-1,deltaX:0,deltaY:0,offsetX:0,offsetY:0,direction:"",startTime:0,endTime:0,moveX:0,moveOffsetX:0,moveY:0,moveOffsetY:0};const t=()=>{e.startX=-1,e.startY=-1,e.deltaX=0,e.deltaY=0,e.offsetX=0,e.offsetY=0,e.direction="",e.endTime=(new Date).getTime()-e.startTime},r=t=>{const r=t,o=void 0!==r.clientX?r.clientX:r.touches[0].clientX,n=void 0!==r.clientY?r.clientY:r.touches[0].clientY;return e.moveOffsetX=o-e.moveX,e.moveOffsetY=n-e.moveY,e.moveX=o,e.moveY=n,{x:o,y:n}};return{getXY:r,move:t=>{const o=r(t);e.deltaX=(o.x<0?0:o.x)-e.startX,e.deltaY=o.y-e.startY,e.offsetX=Math.abs(e.deltaX),e.offsetY=Math.abs(e.deltaY);var n,s;(!e.direction||e.offsetX<10&&e.offsetY<10)&&(e.direction=(n=e.offsetX,s=e.offsetY,n>s?"horizontal":s>n?"vertical":""))},start:o=>{t(),e.startTime=(new Date).getTime();const n=r(o);e.startX=n.x,e.startY=n.y},reset:t,isVertical:()=>"vertical"===e.direction,isHorizontal:()=>"horizontal"===e.direction,conf:e}},f.isTextOverflow=e=>{const t=document.createElement("div"),r=window.getComputedStyle(e);if("nowrap"!==r.whiteSpace)return!1;t.style.cssText=r.cssText,t.style.fontSize=r.fontSize,t.style.padding=r.padding,t.style.position="absolute",t.style.visibility="hidden",t.style.whiteSpace="nowrap",t.style.width="auto",t.style.maxWidth="none",t.style.overflow="visible",t.textContent=e.textContent,document.body.appendChild(t);const o=t.offsetWidth>e.offsetWidth;return document.body.removeChild(t),o};class g{remove(e){const t=this;for(let r=t.length-1;r>=0;r--)"function"==typeof e?e(t[r])&&t.splice(r,1):t[r]===e&&t.splice(r,1)}toSet(e){return void 0===e&&(e=(e,t)=>e===t),this.filter((t,r,o)=>o.findIndex(r=>e(t,r))===r)}randSort(){const e=this;for(var t=0,r=e.length;t<r;t++){var o=parseInt(Math.random()*r+""),n=e[o];e[o]=e[t],e[t]=n}}sum(e){return this.reduce((t,r)=>t+=e?r[e]:r,0)}}class y{static Format(e,t){return Date.Format(this,e,t)}static FormatDiff(e){return Date.FormatDiff(this,e)}static getTimeDiff(){return Date.timeDiff+this.getTime()}}class x{static contains(e,t){const r=this;return r.left<e&&r.top<t&&e<r.left+r.width&&t<r.top+r.height}static containX(e){const t=this;return t.left<e&&e<t.left+t.width}static containY(e){const t=this;return t.top<e&&e<t.top+t.height}}class v{static args(){let e=this.toString();return e=e.substring(e.indexOf("(")+1,e.indexOf("{")).replace(/\s+/g,""),e.substring(0,e.indexOf(")")).split(",").filter(e=>e.length>0)}}class w{static toJson(){const e=this;let t={};for(const r of e)t[r[0]]=r[1];return JSON.stringify(t)}}class b{static init(){Date.formatFail="",Date.Format=(e,t,r)=>{if(!(e instanceof Date)){if(String(e).length<10)return r||Date.formatFail;e=new Date(e)}const o=new Date(e.getTime());t||(t="yyyy-MM-dd hh:mm:ss");var n={"M+":o.getMonth()+1,"d+":o.getDate(),"h+":o.getHours(),"m+":o.getMinutes(),"s+":o.getSeconds(),"q+":Math.floor((o.getMonth()+3)/3),S:o.getMilliseconds()};for(var s in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(o.getFullYear()+"").substring(4-RegExp.$1.length))),n)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?n[s]:("00"+n[s]).substring((""+n[s]).length)));return t},Date.FormatDiff=(e,t)=>(e instanceof Date||(e=new Date(e)),Date.Format(e.getTime()+Date.timeDiff,t)),Date.timeDiff=0}}class C{static getClassNames(e){const t={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0,constructor:!0};let r=[],o=Object.getOwnPropertyNames(e);for(let n=0;n<o.length;++n){const s=o[n];t[s]||"function"!=typeof e[s]||r.push(s)}return r}}C.getFunction=e=>{const t=e.name,r=e+"",o=r.indexOf("{"),n=-1!=r.substring(0,o).indexOf("*")?"*":"";return-1!=r.substring(0,o).indexOf("=>")?new Function(`return function${n} ${t} ${r.substring(0,r.indexOf(")")+1)+r.substring(o)}`)():new Function(`return function${n} ${t}${r.substring(r.indexOf("("))}`)()},C.setPrototype=(e,t,r)=>{r=C.getFunction(r),Object.defineProperty(e.prototype,t,{writable:!0,enumerable:!1,value:r})},C.classSetToProperty=(e,t)=>{C.getClassNames(e).forEach(r=>{C.setPrototype(window[t],r,e[r])})},C.iterator=function(){let e=this,t=Object.keys(e),r=0;return"_Vue3ToolIterator"===this._Vue3ToolIterator&&(t=this.keys,e=this.obj),new class{constructor(){return this._Vue3ToolIterator="_Vue3ToolIterator",this.obj=e,this.keys=t,this.next=()=>(r++,{value:r>t.length?null:e[t[r-1]],done:r>this.keys.length}),this}}};class S{static init(){C.classSetToProperty(g.prototype,"Array"),b.init(),C.classSetToProperty(y,"Date"),C.classSetToProperty(v,"Function"),C.classSetToProperty(x,"DOMRect"),C.classSetToProperty(w,"Map")}static setLang(e){this.langObj=e}}S.langObj={HttpUtil:{0:"请求中断",404:"请求地址不存在",405:"请求方法不允许",500:"请求异常",504:"请求超时",OtherException:"其他异常"},TimeUtil:{Today:"今天",Yesterday:"昨天",ThisWeek:"本周",LastWeek:"上周",ThisMonth:"本月",JustNow:"刚刚"}};class T{}i=T,T.arrToHex=e=>{let t="";return e.forEach(e=>t+=(2^e).toString(16)+"u"),t.substring(0,t.length-1)},T.hexToArr=e=>{let t=[];return e.split("u").forEach(e=>{t.push(2^parseInt((e=>{for(var t,r=e.length,o=new Array(r),n=0;n<r;n++)48<=(t=e.charCodeAt(n))&&t<58?t-=48:t=(223&t)-65+10,o[n]=t;return o.reduce(function(e,t){return 16*e+t},0)})(e)))}),t},T.encode=e=>i.arrToHex(r.stringToByte(e)),T.decode=e=>r.byteToString(i.hexToArr(e));class M{}l=M,M.httpBean=null,M.getFileFun=e=>{const t=l;null==t.httpBean&&(t.httpBean=httpBean());let r={base:"/",outtime:3e4,responseType:"text"};e&&(r=Object.assign(r,e));return e=>(e.startsWith("http")||(e=r.base+e),new Promise(o=>{t.httpBean.get({url:e,timeout:r.outtime,responseType:r.responseType}).then(e=>{o(e)}).catch(()=>{o(void 0)})}))},M.getFile=(e,t)=>l.getFileFun(t)(e);class k{}k.id=0,k.getId=()=>"_Timer_"+k.id++,k.map={},k.add=(e,t,r,o)=>{const n=k,s=n.getId(),a=r?setInterval:setTimeout,i=r?clearInterval:clearTimeout,l=()=>{n.map[s]&&i(c),n.map[s]=void 0,delete n.map[s]},c=a(()=>{const t=o();r&&![1,0,!0,!1].includes(t)||(t?(e(),r||l()):l())},t);return n.map[s]={fun:e,vm:o,id:s,remove:l},n.map[s]},k.remove=(...e)=>{const t=k;e.forEach(e=>{t.map[e]&&t.map[e].remove()})},k.removeAll=()=>{const e=k;e.remove(...Object.keys(e.map))};class O{constructor(){this.map={},this.vm=()=>()=>!0,this.createVM=e=>{if(!e){const t=this.vm();e=()=>t()}return e},this.once=(e,t=0,r)=>{const o=k.add(e,t,!1,this.createVM(r));return this.map[o.id]=o,o.id},this.clear=()=>{const e=this,t=Object.keys(e.map);for(let r=0;r<t.length;r++){const o=t[r],n=e.map[o];n&&n.remove(),e.map[o]=void 0,delete e.map[o]}},this.delayUnit=1,this.delay=(e=0,t=this.delayUnit)=>{const r=this;return new Promise(o=>{r.once(()=>o(),e*t)})},this.on=(e,t,r=!1,o)=>{const n=k.add(e,t,!0,this.createVM(o));return this.map[n.id]=n,r&&e(),n.id},this.un=(...e)=>{const t=this;e.forEach(e=>{const r=t.map[e];r&&r.remove(),t.map[e]=void 0,delete t.map[e]})}}}const D=new Set,j=setTimeout;window.setTimeout=function(e,t,...r){const o=j(()=>{e(...r),D.delete(o)},t);return D.add(o),o};const E=setInterval;window.setInterval=function(e,t,...r){const o=E(e,t);return D.add(o),o};class N{static once(e,t=0,r){return this.timerBean.once(e,t,r)}static async delay(e=0,t=this.delayUnit){await this.timerBean.delay(e,t)}static on(e,t,r=!1,o){return this.timerBean.on(e,t,r,o)}}var A;c=N,N.timerBean=new O,N.clear=()=>{k.removeAll()},N.delayUnit=1,N.un=(...e)=>{k.remove(...e)},N.clearAll=()=>{c.clear(),D.forEach(e=>{clearTimeout(e),clearInterval(e)}),D.clear()};const B=e=>{let t=e.toString().trim();return t.length>50&&(t=t.substring(0,22)+t.substring(t.length-22,t.length-1)),t};class I{}A=I,I.timer=N,I.debounceMap={},I.debounce=(e,t=500)=>{const r=A,o=B(e);r.debounceMap[o]&&r.timer.un(r.debounceMap[o]),r.debounceMap[o]=r.timer.once(()=>{e(),delete r.debounceMap[o]},t)},I.throttleMap={},I.throttle=(e,t=500,r=A.throttleTip)=>{const o=A,n=B(e);o.throttleMap[n]?r():(e(),o.throttleMap[n]=o.timer.once(()=>{delete o.throttleMap[n]},t))},I.throttleTip=()=>{},I.lockMap={},I.lock=async e=>{const t=A,r=B(e);return t.lockMap[r]||(t.lockMap[r]=new Promise(async(o,n)=>{try{o(await e())}catch(e){n(e)}delete t.lockMap[r]})),await t.lockMap[r]};class F{static rem(){const e=F;let t=document.getElementsByTagName("head")[0].getAttribute("design-width");t||(t=e.remWidth),e.remWidth=t,e.refresh(),window.addEventListener("resize",()=>{e.refresh()});const r=document.createElement("style");r.innerHTML="@media screen and (min-width:"+e.remWidth+"px){.design-box{width:"+e.remWidth+"px !important;position:relative;}",document.getElementsByTagName("head")[0].appendChild(r)}static refresh(){const e=F;let t=e.getDeviceWidth();document.documentElement.style.fontSize=t/(e.remWidth/e.remFontSize)+"px"}static getDeviceWidth(){const e=F;let t=document.documentElement.clientWidth;const r="function"==typeof e.maxWidth?e.maxWidth():e.maxWidth;return t>=r&&(t=r),t}static rem2px(e){const t=F;return e*(t.getDeviceWidth()/t.remWidth)}static px2rem(e){const t=F;let r=t.getDeviceWidth();return e*(t.remWidth/r)}static getMaxBox(){const e=this.remWidth,t=this.remHeight,r=window.innerWidth,o=window.innerHeight,n=t/e,s=o/r;return n>s?{height:o,width:o/n}:this.maxRatio&&s>this.maxRatio?{height:r*this.maxRatio,width:r}:{height:o,width:r}}static getMaxHeight(){return this.getMaxBox().height}static getMaxWidth(){return this.getMaxBox().width}}var P,U;F.remWidth=750,F.maxWidth=500,F.remFontSize=1,F.maxRatio=2.221,F.remHeight=1334;class W{static deepAssign(e,t){const r=P;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return e;for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&("object"==typeof t[o]&&null!==t[o]&&"object"==typeof e[o]&&null!==e[o]?r.deepAssign(e[o],t[o]):e[o]=t[o]);return e}static setPathVal(e,t,r,o){null==o&&(t=t.split("."),o=0),o===t.length-1?e[t[o]]=r:(e[t[o]]=e[t[o]]||{},P.setPathVal(e[t[o]],t,r,o+1))}}P=W,W.objectToString=Object.prototype.toString,W.toTypeString=e=>P.objectToString.call(e),W.isArray=Array.isArray,W.isMap=e=>"[object Map]"===P.toTypeString(e),W.isSet=e=>"[object Set]"===P.toTypeString(e),W.isDate=e=>"[object Date]"===P.toTypeString(e),W.isFunction=e=>"function"==typeof e,W.isString=e=>"string"==typeof e,W.isSymbol=e=>"symbol"==typeof e,W.isObject=e=>null!==e&&"object"==typeof e,W.isPromise=e=>P.isObject(e)&&P.isFunction(e.then)&&P.isFunction(e.catch),W.getObject=(e,t)=>{const r=P;let o=!1;if(r.isArray(e))for(let r=0;r<e.length&&(o=P.getObject(e[r],t),!o);r++);else if(r.isObject(e)){const n=Object.keys(e);for(let s=0;s<n.length;s++){const a=n[s],i=e[a];if(o=t(a,i,e),o)break;if((r.isArray(i)||r.isObject(i))&&(o=r.getObject(i,t)),o)break}}return o},W.getObjectByChildren=(e,t,r=["children"])=>{if(Array.isArray(e))for(let o=0;o<e.length;o++)P.getObjectByChildren(e[o],t,r);else if(P.isObject(e)){t(e);for(let o=0;o<r.length;o++)e[r[o]]&&P.getObjectByChildren(e[r[o]],t,r)}},W.deepMerge=(e,t)=>{const r=P,o=Object.assign({},e);for(const n in t)t.hasOwnProperty(n)&&("object"==typeof t[n]&&e.hasOwnProperty(n)&&"object"==typeof e[n]?o[n]=r.deepMerge(e[n],t[n]):o[n]=t[n]);return o},W.getPathValue=(e,t,r)=>{if("object"!=typeof e)return r;const o=t.split(".");let n=e;for(let e=0;e<o.length;e++)try{n=n[o[e]]}catch(e){return r}return n};class L{static uuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})}static isNull(e){return Array.isArray(e)?0==e.length:e+""=="null"||e+""=="undefined"||""===e||e+""=="NaN"}static clearBlank(e){return e?e.replace(/\s+|\t|\r|\n/g,""):""}static isNumber(e){return/^[0-9]+$/.test(e)}static getParam(e){const t=e.match(/[?&]([^=#]+)=([^&#]*)/g);return t?t.reduce((e,t)=>{const[r,o]=t.substring(1).split("=");return e[r]=decodeURIComponent(o),e},{}):{}}static copyText(e){return new Promise(t=>{if(navigator.clipboard)navigator.clipboard.writeText(e).then(()=>{t(!0)}).catch(e=>{t(!1)});else{const r=document.createElement("textarea");r.value=e,document.body.appendChild(r),r.select(),document.execCommand("copy"),document.body.removeChild(r),t(!0)}})}}U=L,L.id=1e3,L.getId=()=>(U.id++,U.id+"");class _{static init(){const e=(e,t,r)=>{if(t){t.onreadystatechange=null,t.onload=null,t.onerror=null,t.onabort=null,t.ontimeout=null;try{t.onprogress=null}catch(e){}try{t.upload.onprogress=null,t.upload.onload=null,t.upload.onerror=null,t.upload.onabort=null,t.upload.ontimeout=null,t.upload.onloadend=null,t.upload.onloadstart=null}catch(e){}t=void 0}r&&(e.xhr[r]=void 0,delete e.xhr[r])},t=t=>{const r={dataCache:{},xhr:{},get:(t,o)=>{o||(o={}),"string"==typeof t?t={url:t,method:"GET"}:(t.method=t.method||"GET",t.method=t.method.toUpperCase());const n=t;return new Promise(async(s,a)=>{const i=L.getId(),l=r.config,c=l.base,d=l.before,u=l.after,h=l.error,p={headers:l.headers,data:o,param:n,stop:()=>{m&&(m.abort(),e(r,m,i))}};let m=new XMLHttpRequest;d&&await d(p,m);let f=c+n.url;n.url.startsWith("http")&&(f=n.url),f.startsWith("//")&&(f=f.replace(/(\/{2,})/g,"/"));const g=(e=>{const t={};return Object.keys(e).forEach(r=>{"function"!=typeof e[r]&&(t[r]=e[r])}),t})(p.data);if("GET"===n.method){const e=Object.keys(g).map(e=>`${e}=${encodeURIComponent(g[e])}`).join("&");f=e?`${f}?${e}`:f}const y=f+JSON.stringify(g);0!==n.expire&&void 0!==n.expire||delete r.dataCache[y];let x=r.dataCache[y];if(x){if(x.expire>Date.now())return await u({data:x.data,responseType:n.responseType||l.responseType,status:200,xhr:null},p),void s(x.data);delete r.dataCache[y]}m.open(n.method,f,!0),n.headers&&(p.headers=Object.assign(Object.assign({},p.headers),n.headers)),Object.keys(p.headers).forEach(e=>{const t=p.headers[e];t&&!t.startsWith("multipart/form-data")&&m.setRequestHeader(e,t)}),m.timeout=n.timeout||l.timeout,m.responseType=n.responseType||l.responseType;try{m.withCredentials=n.withCredentials||l.withCredentials}catch(e){}const v=S.langObj.HttpUtil,w=(t,o)=>{var n;h(t,p,o),e(r,m,i),a({status:t,message:null!==(n=v[t+""])&&void 0!==n?n:v.OtherException})};m.ontimeout=function(){w(504)},m.onerror=function(e){w(500)},m.onabort=function(){w(0)};const b=t;if(m.upload&&b.onProgress&&(m.upload.onprogress=function(e){if(e.lengthComputable&&e.total>0){const t=parseInt(e.loaded/e.total*100);b.onProgress(t,e.loaded,e.total)}}),m.onreadystatechange=async function(){if(4===m.readyState){const t={data:m.response,responseType:m.responseType,status:m.status,xhr:m};if(0!==m.status){const e=m.getResponseHeader("Content-Type");if(e&&e.includes("application/json")&&"string"==typeof m.response)try{t.data=JSON.parse(m.response)}catch(e){}}if(200===m.status){if(n.expire){let e=n.expire;e<0&&(e=l.expireMaxTime),r.dataCache[y]={data:t.data,expire:Date.now()+1e3*e}}await u(t,p),200!==t.status?w(t.status):e(r,m,i),s(t.data)}else 0!==m.status&&w(m.status,t)}},"GET"===n.method)m.send();else{const e=p.headers["Content-Type"];if("multipart/form-data"==e){const e=new FormData;let t=0;for(let r in g)g[r]instanceof File?(e.append(r,g[r],g[r].name||r),t+=g[r].size):e.append(r,g[r]);b.onProgress&&b.onProgress(0,0,t),m.send(e)}else"application/x-www-form-urlencoded"==e?m.send(Object.keys(g).map(e=>`${e}=${encodeURIComponent(g[e])}`).join("&")):"application/json"==e?m.send(JSON.stringify(g)):m.send(g)}r.xhr[i]=m})},post:(e,t)=>("string"==typeof e?e={url:e,method:"POST"}:e.method=e.method||"POST",r.get(e,t)),stop:()=>{Object.keys(r.xhr).forEach(t=>{r.xhr[t].abort(),e(r,r.xhr[t])}),r.xhr={}},config:{base:"",timeout:3e4,withCredentials:!1,responseType:"text",expireMaxTime:86400,headers:{Accept:"*","Content-Type":"application/json"},before:()=>{},after:()=>{},error:()=>{}},setConfig:e=>{r.dataCache={},e&&"object"==typeof e&&(r.config=W.deepMerge(r.config,e))}};return r.setConfig(t),r};window.httpBean=t,window.http=t()}static ping(e,t=6e3){return new Promise(r=>{e.endsWith("/")||(e+="/");let o=new Image,n=Date.now();const s=setTimeout(()=>{r(t)},t);o.onerror=function(){clearTimeout(s),r(Date.now()-n)},o.src=e+n})}}class Y{}Y.sendMessage=(e,t)=>{var r,o;if(t){const o=document.getElementById(t);null===(r=null==o?void 0:o.contentWindow)||void 0===r||r.postMessage(e,"*")}else null===(o=window.parent)||void 0===o||o.postMessage(e)},Y.onMassage=e=>{window.addEventListener("message",e)},Y.offMassage=e=>{window.removeEventListener("message",e)};class R{static handleSrc(e){const t=Element.prototype.setAttribute;Element.prototype.setAttribute=function(e,r){return"IMG"===this.tagName&&"src"===e.toLowerCase()&&(r=n(r)),t.call(this,e,r)};const r=HTMLImageElement.prototype,o=Object.getOwnPropertyDescriptor(r,"src");function n(t){return e(t)}Object.defineProperty(r,"src",{set(e){return e=n(e),o.set.call(this,e)},get(){return o.get.call(this)},configurable:!0})}}R.loadImage=e=>{if(!(e.extensions||[".png",".jpg",".jpeg",".webp",".gif",".svg"]).some(t=>e.url.endsWith(t)))return;let t=new Image;t.crossOrigin="Anonymous",t.src=e.url;let r=!1;return t.onload=function(){var o;if(r)return;r=!0;const n={dataBase64:"",dataArray:null};if(e.base64||e.arrayBuffer){let r=document.createElement("canvas");const o=r.getContext("2d");r.height=t.height,r.width=t.width,o.drawImage(t,0,0,t.width,t.height);const s=e.url.split(".").pop();e.arrayBuffer&&(n.dataArray=o.getImageData(0,0,t.width,t.height)),e.base64&&(n.dataBase64="gif"===s||"svg"===s?r.toDataURL(`image/${s}`):r.toDataURL(`image/${s}`,e.base64Quality)),r=null}null===(o=e.load)||void 0===o||o.call(e,t,n),t=null},t.onerror=function(){var t;r||(r=!0,null===(t=e.error)||void 0===t||t.call(e))},{img:t,abort:()=>{if(!r){r=!0;try{t.src="",t=null}catch(e){}}}}};class X{static cp(e){try{return JSON.parse(JSON.stringify(e))}catch(e){return null}}static deepClone(e,t=new WeakMap){let r=e;if(null===r)return r;if(r instanceof Date)return new Date(r);if(r instanceof RegExp)return new RegExp(r);if("object"!=typeof r)return r;if(t.get(r))return t.get(r);try{let e=new r.constructor;t.set(r,e);for(let o in r)r.hasOwnProperty(o)&&(e[o]=this.deepClone(r[o],t));return e}catch(e){return r}}}X.strToObject=e=>{Array.isArray(e)?e.forEach(e=>{X.strToObject(e)}):"object"==typeof e&&e&&Object.keys(e).forEach(t=>{const r=e[t];"string"==typeof r&&(r.startsWith("{")||r.startsWith("["))&&(e[t]=JSON.parse(r)),X.strToObject(e[t])})};class ${}function V(e,t=15){return+parseFloat(Number(e).toPrecision(t))}function H(e){const t=e.toString().split(/[eE]/),r=(t[0].split(".")[1]||"").length-+(t[1]||0);return r>0?r:0}function z(e){if(-1===e.toString().indexOf("e"))return Number(e.toString().replace(".",""));const t=H(e);return t>0?V(Number(e)*Math.pow(10,t)):Number(e)}function J(e){return(...t)=>{const[r,...o]=t;return o.reduce((t,r)=>e(t,r),r)}}$.groupKey=(e,t)=>{let r={};const o={ctrl:"control",esc:"escape"};e=e.map(e=>(e=e.toLocaleLowerCase(),o[e]&&(e=o[e]),e));const n=function(o){if(!o.key)return;const n=o.key.toLocaleLowerCase();if(r[n])return;r[n]=!0;const s=e[e.length-1]===n;let a=!0;for(let t=0;t<e.length-1;t++)if(!r[e[t]]){a=!1;break}s&&a&&t()},s=function(e){if(!e.key)return;const t=e.key.toLocaleLowerCase();r[t]=!1};return document.addEventListener("keydown",n),document.addEventListener("keyup",s),()=>{document.removeEventListener("keydown",n),document.removeEventListener("keyup",s)}};const G=J((e,t)=>{const r=z(e),o=z(t),n=H(e)+H(t);return r*o/Math.pow(10,n)}),K=J((e,t)=>{const r=Math.pow(10,Math.max(H(e),H(t)));return(G(e,r)+G(t,r))/r}),q=J((e,t)=>{const r=Math.pow(10,Math.max(H(e),H(t)));return(G(e,r)-G(t,r))/r}),Z=J((e,t)=>{const r=z(e),o=z(t);return G(r/o,V(Math.pow(10,H(t)-H(e))))});class Q{static getNumber(e,t){let r=parseFloat(e);return r=L.isNull(r)?0:r,t?parseFloat(r.toFixed(t)):r}static getRandomInt(e,t,r,o){const n=(e,t)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e),s=n(e,t);if(void 0===r||void 0===o)return s;const a=n(r,o);return Number(s+"."+a)}}Q.format=e=>Intl.NumberFormat(window.TimeUtil.locale).format(e),Q.strip=V,Q.plus=K,Q.minus=q,Q.times=G,Q.divide=Z,Q.round=function(e,t){const r=Math.pow(10,t);let o=Z(Math.round(Math.abs(G(e,r))),r);return e<0&&0!==o&&(o=G(o,-1)),o},Q.digitLength=H,Q.float2Fixed=z;var ee;const te=(e="zh-CN")=>Intl.DateTimeFormat().resolvedOptions().locale||e;class re{static getDateOptions(){const e=S.langObj.TimeUtil,t=[];t.push({label:e.Today,value:ee.somedayse(),key:"today"}),t.push({label:e.Yesterday,value:ee.somedayse(-1),key:"yesterday"});const r=new Date,o=ee.somedayse,n=r.getDay(),s=o(1-n)[0],a=o(7-n)[1],i={label:e.ThisWeek,value:[s,a],key:"thisWeek"};t.push(i);const l=o(1-n-7)[0],c=o(7-n-7)[1],d={label:e.LastWeek,value:[l,c],key:"lastWeek"};t.push(d);const u=new Date;u.setDate(1);const h=o(0,u);u.setMonth(u.getMonth()+1),u.setDate(1),u.setDate(u.getDate()-1);const p=o(0,u),m={label:e.ThisMonth,value:[h[0],p[1]],key:"thisMonth"};return t.push(m),t}}ee=re,re.locale=te(),re.getLocale=te,re.setLocale=e=>{ee.locale=e},re.countdown=e=>{const t=e=>e<10?`0${e}`:`${e}`;let r=Math.floor(e/1e3);if(r<0)return["00","00","00",0];const o=Math.floor(r/60/60/24),n=Math.floor(r/60/60%24),s=Math.floor(r/60%60),a=r%60;return[t(o),t(n),t(s),t(a),r]},re.somedayse=(e=0,t=new Date)=>{e*=864e5,t.setHours(0,0,0,0);const r=t.getTime()+e;t.setHours(23,59,59,999);return[r,t.getTime()+e]},re.getTimeTip=e=>{const t=S.langObj.TimeUtil,r=new Date,o=new Date(e),n=r.getTime()-e;if(n<6e4)return t.JustNow;if(n<864e5){if(r.Format("dd")==o.Format("dd"))return o.Format("hh:mm")}if(n<1728e5){if(new Date(ee.somedayse(-1)[0]).Format("dd")==o.Format("dd"))return t.Yesterday}return r.getFullYear()==o.getFullYear()?o.Format("MM/dd"):o.Format("MM/dd/yyyy")};const oe={ArrayUtil:e,Base64Util:t,ByteUtil:r,CEvent:s,CEventBean:n,JSONUtil:X,KeyUtil:$,MathUtil:Q,DomUtil:f,EnUtil:T,IFrameUtil:Y,StrUtil:L,ScriptUtil:class{static scriptLoad(e){const t=e=>{e.parentNode&&e.parentNode.removeChild(e),e.onload=null,e.onerror=null,e=null},r=document.getElementsByTagName("script")[0]||document.head;let o=document.createElement("script");return o.src=e,r.parentNode.insertBefore(o,r),new Promise(e=>{o.onload=function(){e(!0),t(o)},o.onerror=function(){e(!1),t(o)}})}},TimerBean:O,Timer:N,HttpUtil:_,CookieVal:u,Cookie:class{static async set(e,t,r){await d.getCookieBean(null==r?void 0:r.type).set(e,t,r)}static get(e,t){return d.getCookieBean(t).get(e)}static async remove(e,t){await d.getCookieBean(t).remove(e)}static async clear(e,t){await d.getCookieBean(t).clear(e)}},CookieC:h,CookieL:p,CookieI:m,CookieManager:d,FileUtil:M,H5Util:F,ObjectUtil:W,TimeUtil:re,FunUtil:I,ESUtil:S,ImgUtil:R};try{if(!window.CookieL){const e=Object.keys(oe);for(let t=0;t<e.length;t++){const r=e[t];window[r]=oe[r]}S.init(),_.init(),d.init(d.keyMap.cookie,h),d.init(d.keyMap.indexedDB,m),d.init(d.keyMap.localStorage,p),window.isNull=L.isNull,window.NumberFormat=Q.format}}catch(e){console.error(e)}}();
|
package/dist/index.d.ts
CHANGED
|
@@ -210,58 +210,95 @@ interface CEventCoreInter {
|
|
|
210
210
|
}
|
|
211
211
|
declare var CEventCore: CEventCoreInter;
|
|
212
212
|
/**
|
|
213
|
-
*
|
|
214
|
-
*
|
|
213
|
+
* 缓存工具,支持多种存储类型(cookie、localStorage、indexedDB)
|
|
214
|
+
* 默认使用localStorage
|
|
215
|
+
* 如需修改,结构需要符合window.localStorage存在setItem、getItem、removeItem、clear方法
|
|
216
|
+
*
|
|
217
|
+
* @example
|
|
218
|
+
*
|
|
219
|
+
//设置默认有效时间为1,单位为毫秒
|
|
220
|
+
CookieManager.expire = 1
|
|
221
|
+
CookieManager.expireUnit = 1000
|
|
222
|
+
|
|
223
|
+
//cookie方式1
|
|
224
|
+
CookieManager.defaultKey = CookieManager.keyMap.cookie
|
|
225
|
+
Cookie.set('test', 'test')
|
|
226
|
+
console.log('cookie1-get-test:',Cookie.get('test'))
|
|
227
|
+
await Timer.delay(2000)
|
|
228
|
+
console.log('cookie1-get-test-2000:',Cookie.get('test'))
|
|
229
|
+
|
|
230
|
+
//localStorage
|
|
231
|
+
CookieManager.defaultKey = CookieManager.keyMap.localStorage
|
|
232
|
+
Cookie.set('test', 'test')
|
|
233
|
+
console.log('localStorage-get-test:',Cookie.get('test'))
|
|
234
|
+
await Timer.delay(2000)
|
|
235
|
+
console.log('localStorage-get-test-2000:',Cookie.get('test'))
|
|
236
|
+
|
|
237
|
+
//indexedDB
|
|
238
|
+
CookieManager.defaultKey = CookieManager.keyMap.indexedDB
|
|
239
|
+
await Cookie.set('test', 'test')
|
|
240
|
+
console.log('indexedDB-get-test:',await Cookie.get('test'))
|
|
241
|
+
await Timer.delay(2000)
|
|
242
|
+
console.log('indexedDB-get-test-2000:',await Cookie.get('test'))
|
|
243
|
+
|
|
244
|
+
//type使用方式-cookie,其他方式类似
|
|
245
|
+
Cookie.set('test', 'test',{type: CookieManager.keyMap.cookie})
|
|
246
|
+
console.log('cookie2-get-test:',Cookie.get('test',CookieManager.keyMap.cookie))
|
|
247
|
+
await Timer.delay(2000)
|
|
248
|
+
console.log('cookie2-get-test-2000:',Cookie.get('test',CookieManager.keyMap.cookie))
|
|
215
249
|
*/
|
|
216
250
|
interface CookieInter {
|
|
217
|
-
/**
|
|
218
|
-
* 默认使用localStorage
|
|
219
|
-
* 如需修改,结构需要符合window.localStorage存在setItem、getItem、removeItem、clear方法
|
|
220
|
-
*/
|
|
221
|
-
localStorage: Storage;
|
|
222
|
-
/**
|
|
223
|
-
* 默认添加有效时间 3600天
|
|
224
|
-
*/
|
|
225
|
-
expire: number;
|
|
226
|
-
/**
|
|
227
|
-
* 默认添加有效单位 秒
|
|
228
|
-
*/
|
|
229
|
-
expireUnit: number;
|
|
230
251
|
/**
|
|
231
252
|
* 设置
|
|
253
|
+
* @param key
|
|
254
|
+
* @param value
|
|
255
|
+
* @param config
|
|
256
|
+
* @returns
|
|
232
257
|
*/
|
|
233
258
|
set(key: string, value: any, config?: {
|
|
234
259
|
/**
|
|
235
260
|
* 有效时间-秒
|
|
236
261
|
*/
|
|
237
262
|
expire?: number;
|
|
238
|
-
|
|
263
|
+
/**
|
|
264
|
+
* 存储类型-默认localStorage
|
|
265
|
+
*/
|
|
266
|
+
type?: string;
|
|
267
|
+
}): Promise<void>;
|
|
239
268
|
/**
|
|
240
269
|
* 获取指定值
|
|
270
|
+
* @param key
|
|
271
|
+
* @param type - 存储类型-默认localStorage
|
|
272
|
+
* @returns
|
|
241
273
|
*/
|
|
242
|
-
get(key: string): any;
|
|
274
|
+
get(key: string, type?: string): any;
|
|
243
275
|
/**
|
|
244
276
|
* 移除指定值
|
|
277
|
+
* @param key
|
|
278
|
+
* @param type - 存储类型-默认localStorage
|
|
279
|
+
* @returns
|
|
245
280
|
*/
|
|
246
|
-
remove(key: string): void
|
|
281
|
+
remove(key: string, type?: string): Promise<void>;
|
|
247
282
|
/**
|
|
248
283
|
* 清空所有key和值
|
|
284
|
+
* @param config
|
|
285
|
+
* @param type - 存储类型-默认localStorage
|
|
286
|
+
* @returns
|
|
249
287
|
*/
|
|
250
|
-
clear(
|
|
288
|
+
clear(config?: {
|
|
289
|
+
/**
|
|
290
|
+
* 排除的key列表,不进行清空
|
|
291
|
+
*/
|
|
292
|
+
excludeList?: string[];
|
|
293
|
+
paths?: string[];
|
|
294
|
+
domain?: string;
|
|
295
|
+
}, type?: string): Promise<void>;
|
|
251
296
|
}
|
|
252
297
|
declare var Cookie: CookieInter;
|
|
253
298
|
/**
|
|
254
|
-
* Cookie
|
|
299
|
+
* Cookie 缓存工具
|
|
255
300
|
*/
|
|
256
301
|
interface CookieCInter {
|
|
257
|
-
/**
|
|
258
|
-
* 默认添加有效时间 3600天
|
|
259
|
-
*/
|
|
260
|
-
expire: number;
|
|
261
|
-
/**
|
|
262
|
-
* 默认添加有效单位 秒
|
|
263
|
-
*/
|
|
264
|
-
expireUnit: number;
|
|
265
302
|
/**
|
|
266
303
|
* 设置cookie
|
|
267
304
|
* @param name
|
|
@@ -299,11 +336,174 @@ interface CookieCInter {
|
|
|
299
336
|
*/
|
|
300
337
|
remove(name: string, domain?: string): void;
|
|
301
338
|
/**
|
|
302
|
-
* 清空所有
|
|
339
|
+
* 清空所有cookie(支持排除、多个路径和自定义域名)
|
|
340
|
+
* @param config
|
|
303
341
|
*/
|
|
304
|
-
clear(
|
|
342
|
+
clear(config?: {
|
|
343
|
+
excludeList?: string[];
|
|
344
|
+
paths?: string[];
|
|
345
|
+
domain?: string;
|
|
346
|
+
}): void;
|
|
305
347
|
}
|
|
306
348
|
declare var CookieC: CookieCInter;
|
|
349
|
+
/**
|
|
350
|
+
* IndexedDB 缓存工具
|
|
351
|
+
*/
|
|
352
|
+
interface CookieIInter {
|
|
353
|
+
/**
|
|
354
|
+
* 复用单例连接,避免频繁 open/close 的开销
|
|
355
|
+
*/
|
|
356
|
+
/**
|
|
357
|
+
* 默认数据库名
|
|
358
|
+
*/
|
|
359
|
+
dbName: string;
|
|
360
|
+
/**
|
|
361
|
+
* 默认对象仓库名
|
|
362
|
+
*/
|
|
363
|
+
storeName: string;
|
|
364
|
+
/**
|
|
365
|
+
* 打开数据库
|
|
366
|
+
*/
|
|
367
|
+
/**
|
|
368
|
+
* 设置
|
|
369
|
+
*/
|
|
370
|
+
set(key: string, value: any, config?: {
|
|
371
|
+
/**
|
|
372
|
+
* 有效时间-秒
|
|
373
|
+
*/
|
|
374
|
+
expire?: number;
|
|
375
|
+
}): Promise<void>;
|
|
376
|
+
/**
|
|
377
|
+
* 获取指定值
|
|
378
|
+
*/
|
|
379
|
+
get(key: string): Promise<any>;
|
|
380
|
+
/**
|
|
381
|
+
* 移除指定值
|
|
382
|
+
*/
|
|
383
|
+
remove(key: string): Promise<void>;
|
|
384
|
+
/**
|
|
385
|
+
* 清空所有key和值
|
|
386
|
+
* @param config 可选,若含有excludeList,则只删除未包含的key
|
|
387
|
+
*/
|
|
388
|
+
clear(config?: {
|
|
389
|
+
excludeList?: string[];
|
|
390
|
+
}): Promise<void>;
|
|
391
|
+
}
|
|
392
|
+
declare var CookieI: CookieIInter;
|
|
393
|
+
/**
|
|
394
|
+
* localStorage 缓存工具
|
|
395
|
+
*/
|
|
396
|
+
interface CookieLInter {
|
|
397
|
+
/**
|
|
398
|
+
* 设置
|
|
399
|
+
*/
|
|
400
|
+
set(key: string, value: any, config?: {
|
|
401
|
+
/**
|
|
402
|
+
* 有效时间-秒
|
|
403
|
+
*/
|
|
404
|
+
expire?: number;
|
|
405
|
+
}): void;
|
|
406
|
+
/**
|
|
407
|
+
* 获取指定值
|
|
408
|
+
*/
|
|
409
|
+
get(key: string): any;
|
|
410
|
+
/**
|
|
411
|
+
* 移除指定值
|
|
412
|
+
*/
|
|
413
|
+
remove(key: string): void;
|
|
414
|
+
/**
|
|
415
|
+
* 清空所有key和值
|
|
416
|
+
* @param config 可选,若含有excludeList,则只删除未包含的key
|
|
417
|
+
*/
|
|
418
|
+
clear(config?: {
|
|
419
|
+
excludeList?: string[];
|
|
420
|
+
}): void;
|
|
421
|
+
}
|
|
422
|
+
declare var CookieL: CookieLInter;
|
|
423
|
+
/**
|
|
424
|
+
* 缓存管理器
|
|
425
|
+
* @param 说明 -对localStorage、Cookie、IndexedDB的数据处理
|
|
426
|
+
*/
|
|
427
|
+
interface CookieManagerInter {
|
|
428
|
+
/**
|
|
429
|
+
* 默认添加有效时间 36000天 - 100年
|
|
430
|
+
*/
|
|
431
|
+
expire: number;
|
|
432
|
+
/**
|
|
433
|
+
* 默认添加有效单位 天
|
|
434
|
+
*/
|
|
435
|
+
expireUnit: number;
|
|
436
|
+
CookieBean: CookieBean;
|
|
437
|
+
defaultKey: string;
|
|
438
|
+
keyMap: {
|
|
439
|
+
cookie: string;
|
|
440
|
+
indexedDB: string;
|
|
441
|
+
localStorage: string;
|
|
442
|
+
};
|
|
443
|
+
CookieObj: {
|
|
444
|
+
[key: string]: CookieBean;
|
|
445
|
+
};
|
|
446
|
+
/**
|
|
447
|
+
* 初始化支持的存储类型
|
|
448
|
+
* @param key
|
|
449
|
+
* @param val
|
|
450
|
+
*/
|
|
451
|
+
init: (key: string, val: CookieBean) => void;
|
|
452
|
+
setCookieBean: (cookieBean: CookieBean) => void;
|
|
453
|
+
getCookieBean: (key?: string) => CookieBean;
|
|
454
|
+
}
|
|
455
|
+
type CookieBean = {
|
|
456
|
+
/**
|
|
457
|
+
* 设置缓存
|
|
458
|
+
* @param key
|
|
459
|
+
* @returns 返回值-如果是indexedDB,则返回Promise,否则无返回值
|
|
460
|
+
*/
|
|
461
|
+
get: (key: string) => any;
|
|
462
|
+
/**
|
|
463
|
+
* 设置缓存
|
|
464
|
+
* @param key
|
|
465
|
+
* @param value
|
|
466
|
+
* @param config
|
|
467
|
+
* @returns 返回值-如果是indexedDB,则返回Promise,否则直接返回
|
|
468
|
+
*/
|
|
469
|
+
set: (key: string, value: any, config?: {
|
|
470
|
+
/**
|
|
471
|
+
* path-/
|
|
472
|
+
*/
|
|
473
|
+
path?: string;
|
|
474
|
+
/**
|
|
475
|
+
* 有效时间-秒
|
|
476
|
+
*/
|
|
477
|
+
expire?: number;
|
|
478
|
+
/**
|
|
479
|
+
* 域名
|
|
480
|
+
*/
|
|
481
|
+
domain?: string;
|
|
482
|
+
/**
|
|
483
|
+
* 活动有效
|
|
484
|
+
*/
|
|
485
|
+
session?: boolean;
|
|
486
|
+
}) => any;
|
|
487
|
+
/**
|
|
488
|
+
* 移除缓存
|
|
489
|
+
* @param key
|
|
490
|
+
*/
|
|
491
|
+
remove: (key: string) => any;
|
|
492
|
+
/**
|
|
493
|
+
* 清空所有缓存
|
|
494
|
+
* @param config
|
|
495
|
+
* @returns
|
|
496
|
+
*/
|
|
497
|
+
clear: (config?: {
|
|
498
|
+
/**
|
|
499
|
+
* 排除的key列表,不进行清空
|
|
500
|
+
*/
|
|
501
|
+
excludeList?: string[];
|
|
502
|
+
paths?: string[];
|
|
503
|
+
domain?: string;
|
|
504
|
+
}) => any;
|
|
505
|
+
};
|
|
506
|
+
declare var CookieManager: CookieManagerInter;
|
|
307
507
|
/**
|
|
308
508
|
* 缓存处理
|
|
309
509
|
* @param 说明 -对localStorage(CookieL)和cookie(Cookie)的数据处理
|
|
@@ -910,6 +1110,12 @@ interface MathUtilInter {
|
|
|
910
1110
|
* 获取两个整数之间的随机数,可传入随机小数点后的随机值
|
|
911
1111
|
*/
|
|
912
1112
|
getRandomInt(min: number, max: number, fixedMin?: number, fixedMax?: number): number;
|
|
1113
|
+
/**
|
|
1114
|
+
* 按千分位格式化数字
|
|
1115
|
+
* @param num 数字
|
|
1116
|
+
* @returns 格式化后的数字
|
|
1117
|
+
*/
|
|
1118
|
+
format: (num: number) => string;
|
|
913
1119
|
/**
|
|
914
1120
|
* 将给定的数字更正为指定有效数字。
|
|
915
1121
|
* @param num — 数字
|
|
@@ -1060,6 +1266,21 @@ interface StrUtilInter {
|
|
|
1060
1266
|
}
|
|
1061
1267
|
declare var StrUtil: StrUtilInter;
|
|
1062
1268
|
interface TimeUtilInter {
|
|
1269
|
+
/**
|
|
1270
|
+
* 当前语言-作用于数字格式化,如要修改直接赋值即可
|
|
1271
|
+
*/
|
|
1272
|
+
locale: string;
|
|
1273
|
+
/**
|
|
1274
|
+
* 获取当前系统环境语言
|
|
1275
|
+
* @param defaultLocale 默认语言
|
|
1276
|
+
* @returns 当前语言 如:zh-CN、en-US、ja-JP等
|
|
1277
|
+
*/
|
|
1278
|
+
getLocale: (defaultLocale?: string) => string;
|
|
1279
|
+
/**
|
|
1280
|
+
* 指定当前语言
|
|
1281
|
+
* @param locale 语言 如:zh-CN、en-US、ja-JP等
|
|
1282
|
+
*/
|
|
1283
|
+
setLocale: (locale: string) => void;
|
|
1063
1284
|
/**
|
|
1064
1285
|
* 获取倒计时
|
|
1065
1286
|
* @param time 时间间隔(比如60000)
|
|
@@ -1106,7 +1327,7 @@ interface TimerInter {
|
|
|
1106
1327
|
*/
|
|
1107
1328
|
once(fun: () => void, timeGap?: number, vm?: any): any;
|
|
1108
1329
|
/**
|
|
1109
|
-
*
|
|
1330
|
+
* 清理Timer中所有任务
|
|
1110
1331
|
*/
|
|
1111
1332
|
clear: () => void;
|
|
1112
1333
|
/**
|
|
@@ -1131,6 +1352,10 @@ interface TimerInter {
|
|
|
1131
1352
|
* 注销循环-Unload
|
|
1132
1353
|
*/
|
|
1133
1354
|
un: (...ids: any[]) => void;
|
|
1355
|
+
/**
|
|
1356
|
+
* 清空所有定时器来源,包括非Timer中的定时器
|
|
1357
|
+
*/
|
|
1358
|
+
clearAll: () => void;
|
|
1134
1359
|
}
|
|
1135
1360
|
declare var Timer: TimerInter;
|
|
1136
1361
|
/**
|
|
@@ -1475,4 +1700,8 @@ interface Window {
|
|
|
1475
1700
|
/**
|
|
1476
1701
|
* 字符串、数组、数字判空
|
|
1477
1702
|
*/
|
|
1478
|
-
declare var isNull: (str: any)=> boolean;
|
|
1703
|
+
declare var isNull: (str: any)=> boolean;
|
|
1704
|
+
/**
|
|
1705
|
+
* 千分位格式化数字
|
|
1706
|
+
*/
|
|
1707
|
+
declare var NumberFormat: (number: number)=> string;
|