jinbi-utils 1.0.26 → 1.0.28
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/chunk-optimizer.cjs +89 -33
- package/dist/index.esm.js +2081 -244
- package/dist/index.esm.min.js +2 -2
- package/dist/index.umd.js +5020 -3146
- package/dist/index.umd.min.js +1 -16
- package/package.json +10 -3
- package/types/chinaArea.d.ts +22 -0
- package/types/fieldCatalogParser.d.ts +121 -0
- package/types/index.d.ts +10 -0
- package/types/input.d.ts +51 -0
- package/types/middleware/requestLoggerUnified.d.ts +12 -0
- package/types/mitt.d.ts +31 -0
- package/types/money/constants.d.ts +38 -0
- package/types/money/helpers.d.ts +134 -0
- package/types/money/helpers.test.d.ts +1 -0
- package/types/money/index.d.ts +260 -0
- package/types/money/index.test.d.ts +1 -0
- package/types/money/types.d.ts +22 -0
- package/types/sm3.d.ts +30 -0
- package/types/tree/index.d.ts +55 -0
- package/types/uploadSpeed.d.ts +85 -0
- package/types/uploadValidation.d.ts +53 -0
package/dist/index.umd.min.js
CHANGED
|
@@ -1,16 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("axios"),require("child_process"),require("pinia")):"function"==typeof define&&define.amd?define(["exports","axios","child_process","pinia"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["jinbi-utils"]={},t.axios,t.child_process,t.pinia)}(this,(function(t,e,r,n){"use strict";function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var i={isWxWork:"wecom",isWeixin:"wechat",isMobile:"mobile",isMobileAny:"mobile"};function s(t){return null===t||""===t||void 0===t}var a=function(){var t=navigator.userAgent.toLowerCase(),e=/wxwork/.test(t),r=/micromessenger/.test(t)&&!e,n=window.innerWidth<=768;return{isWxWork:e,isWeixin:r,isMobileScreen:n,isMobileAny:e||r||n}},u=function(t){var e="wecom";for(var r in t){if(t[r]){e=i[r];break}}return e};var c=function(t,e){var r=t.toLowerCase();return"localstorage"===r?localStorage.getItem("token")||"":"sessionstorage"===r?sessionStorage.getItem("token")||"":localStorage.getItem("token")||sessionStorage.getItem("token")||""},l=function(t,e){var r=t.toLowerCase();"localstorage"===r?localStorage.removeItem("token"):"sessionstorage"===r?sessionStorage.removeItem("token"):(localStorage.removeItem("token"),sessionStorage.getItem("token"))};function f(t){return"string"==typeof t?t.replace(/-/g,"/"):t}function d(t,e){void 0===t&&(t=Date.now()),void 0===e&&(e="yyyy-MM-dd HH:mm:ss"),t=f(t);var r={"M+":(t=new Date(t)).getMonth()+1,"d+":t.getDate(),"h+":t.getHours()%12==0?12:t.getHours()%12,"H+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),S:t.getMilliseconds()};return/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(""+t.getFullYear()).substr(4-RegExp.$1.length))),Object.keys(r).forEach((function(t){new RegExp("("+t+")").test(e)&&(e=e.replace(RegExp.$1,1===RegExp.$1.length?r[t]:("00"+r[t]).substr((""+r[t]).length)))})),e}
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */
|
|
16
|
-
var p=function(t,e){return(p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)};function h(t,e){function r(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var v=function(){return(v=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function g(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))}function m(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function y(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,o++)n[o]=i[s];return n}var w={operation:"divide",factor:100,precision:2,formatAsCurrency:!1,currencySymbol:"¥"};function b(t,e){if(void 0===e&&(e="-"),s(t))return e;var r=t.toString();return r.includes(".")||(r+="."),r.replace(/\d(?=(\d{3})+\.)/g,(function(t){return t+","})).replace(/\.$/,"")}function S(t,e){if(void 0===e&&(e=0),s(t))return t;var r=Math.pow(10,e),n=Number(t)*r;return Math.ceil(n)/r}function M(t,e){var r=A(t,e),n=v(v({},w),e);if(n.formatter)return n.formatter(r);if(n.formatAsCurrency){var o=r.toFixed(n.precision),i=r>=1e3?b(o):o;return""+n.currencySymbol+i}return r.toFixed(n.precision)}function A(t,e){var r,n,o=v(v({},w),e);if(null==t||""===t)return 0;if("string"==typeof t){var i=t.replace(/[^\d.-]/g,"");r=i?parseFloat(i):0}else r=t;if(isNaN(r))return 0;if(n="multiply"===o.operation?r*o.factor:0!==o.factor?r/o.factor:0,void 0!==o.precision){var s=Math.pow(10,o.precision);n=Math.round(n*s)/s}return n}function C(t,e){void 0===e&&(e="B");var r=["B","KB","MB","GB","TB"],n=r.indexOf(e.toUpperCase());for(n=-1===n?0:n;t>=1024&&n<r.length;)t/=1024,n+=1;return{size:t,unit:r[n]}}function x(t){for(var e=t.match(/:(.*?);/)[1],r=window.atob(t.split(",")[1]),n=new ArrayBuffer(r.length),o=new Uint8Array(n),i=0;i<r.length;i+=1)o[i]=r.charCodeAt(i);return new Blob([n],{type:e})}function k(t){return new Promise((function(e,r){var n=new FileReader;n.onload=function(t){t&&t.target?e(t.target.result):r(t)},n.onerror=function(t){r(t)},n.readAsDataURL(t)}))}function E(t,e,r,n,o){if(void 0===o&&(o=[]),o.push(t),t[r]===e)throw"GOT IT!";if(t[n]&&t[n].length>0)for(var i=0;i<t[n].length;i++)E(t[n][i],e,r,n,o);o.pop()}var T={HTTP_STATUS:{TEMP_RESPOND:{Continue:100,SwitchingProtocal:101},SUCCESS:{Ok:200,Created:201,Accepted:202,NoAuthoritativeInformation:203,NoContent:204,ResetContent:205,ParticalContent:206},REDIRECT:{MultipleChoice:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,TemporaryRedirect:307,PermanentRedirect:308},REQUEST_ERROR:{BadRequest:400,UnAuthorized:401,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAccepted:406,ProxyAuthorizationRequired:407,RequestTimeout:408,UpgradeRequired:426,TokenUnAuthorized:499},SERVER_ERROR:{InternalServerError:500,BadGateway:502,ServiceUnavailable:503,GateTimeout:504,HttpVersionNotSupported:505}},CODES:{Success:"00000",UnAuthorized:"00099",UnAuthorizedPhone:"11001",UnAuthorizedWecom:"11000",UnAuthorizedHavePhone:"11002"},ERR_CODE_WHITE_LIST:[]},I=o(e).default.create({timeout:15e3,headers:{"Content-Type":"application/json"}}),O=function(){function t(t){this.fieldCatalog=t,this.params=t?{field_catalog:t}:{}}return t.prototype.build=function(){return this.params},t}(),B=function(){function t(t){this.fieldCatalog=t}return t.prototype.query=function(){return new j(this.fieldCatalog)},t.prototype.insert=function(){return new R(this.fieldCatalog)},t.prototype.update=function(){return new q(this.fieldCatalog)},t.query=function(t){return new j(t)},t.insert=function(t){return new R(t)},t.update=function(t){return new q(t)},t}(),N=function(){function t(t,e){this.parent=e,this.nestedFilters={logic:t,filters:[]}}return t.prototype.where=function(t,e,r){var n=this;return"object"==typeof t?(Object.entries(t).forEach((function(t){var e=t[0],r=t[1];n.nestedFilters.filters.push({field:e,op:"=",value:r})})),this):void 0===r?(this.nestedFilters.filters.push({field:t,op:"=",value:e}),this):(this.nestedFilters.filters.push({field:t,op:e,value:r}),this)},t.prototype.group=function(e){return void 0===e&&(e="and"),new t(e,this)},t.prototype.endGroup=function(){return this.parent instanceof t?(this.parent.addNestedFilters(this.nestedFilters),this.parent):(this.parent.whereNested(this.nestedFilters),this.parent)},t.prototype.addNestedFilters=function(t){this.nestedFilters.filters.push(t)},t.prototype.build=function(){return this.nestedFilters},t}(),j=function(t){function e(e){var r=t.call(this,e)||this;return r.params=v(v({},r.params),{filters:{logic:"and",filters:[]},order_by:[],limit:100,offset:0}),r}return h(e,t),e.prototype.where=function(t,e,r){var n=this;return"object"==typeof t?(Object.entries(t).forEach((function(t){var e=t[0],r=t[1];n.params.filters.filters.push({field:e,op:"=",value:r})})),this):void 0===r?(this.params.filters.filters.push({field:t,op:"=",value:e}),this):(this.params.filters.filters.push({field:t,op:e,value:r}),this)},e.prototype.whereNested=function(t){return this.params.filters.filters.push(t),this},e.prototype.group=function(t){return void 0===t&&(t="and"),new N(t,this)},e.prototype.orWhere=function(t,e,r){var n,o={logic:"or",filters:[]};if("object"==typeof t?Object.entries(t).forEach((function(t){var e=t[0],r=t[1];o.filters.push({field:e,op:"=",value:r})})):void 0===r?o.filters.push({field:t,op:"=",value:e}):o.filters.push({field:t,op:e,value:r}),0===this.params.filters.filters.length||"or"===this.params.filters.logic)(n=this.params.filters.filters).push.apply(n,o.filters),this.params.filters.logic="or";else{var i={logic:"and",filters:y(this.params.filters.filters)};this.params.filters.filters=[i,o],this.params.filters.logic="and"}return this},e.prototype.whereIn=function(t,e){return this.params.filters.filters.push({field:t,op:"in",value:e}),this},e.prototype.whereNotIn=function(t,e){return this.params.filters.filters.push({field:t,op:"not in",value:e}),this},e.prototype.whereLike=function(t,e){return this.params.filters.filters.push({field:t,op:"like",value:e}),this},e.prototype.whereBetween=function(t,e,r){return this.params.filters.filters.push({field:t,op:"between",value:[e,r]}),this},e.prototype.whereNull=function(t){return this.params.filters.filters.push({field:t,op:"is null",value:null}),this},e.prototype.whereNotNull=function(t){return this.params.filters.filters.push({field:t,op:"is not null",value:null}),this},e.prototype.logic=function(t){return this.params.filters.logic=t,this},e.prototype.orderBy=function(t,e){return void 0===e&&(e="asc"),this.params.order_by.push({field:t,direction:e}),this},e.prototype.limit=function(t){return this.params.limit=t,this},e.prototype.offset=function(t){return this.params.offset=t,this},e.prototype.paginate=function(t,e){return void 0===e&&(e=0),this.params.limit=t,this.params.offset=e,this},e}(O),R=function(t){function e(e){var r=t.call(this,e)||this;return r.params=v(v({},r.params),{insert:[]}),r}return h(e,t),e.prototype.add=function(t){return this.params.insert.push(t),this},e.prototype.addBatch=function(t){var e;return(e=this.params.insert).push.apply(e,t),this},e}(O),q=function(t){function e(e){var r=t.call(this,e)||this;return r.currentUpdate=null,r.params=v(v({},r.params),{update:[]}),r}return h(e,t),e.prototype.set=function(t){return this.currentUpdate={set:t,where:{}},this},e.prototype.where=function(t,e){if(!this.currentUpdate)throw new Error("必须先调用 set() 方法");return"object"==typeof t?this.currentUpdate.where=v(v({},this.currentUpdate.where),t):this.currentUpdate.where[t]=e,this},e.prototype.and=function(){return this.currentUpdate&&(this.params.update.push(this.currentUpdate),this.currentUpdate=null),this},e.prototype.setBatch=function(t){var e;return(e=this.params.update).push.apply(e,t),this},e.prototype.build=function(){return this.currentUpdate&&(this.params.update.push(this.currentUpdate),this.currentUpdate=null),this.params},e}(O);var D=new(function(){function t(){}return t.prototype.request=function(t){return g(this,void 0,void 0,(function(){var e,n;return m(this,(function(o){switch(o.label){case 0:return e=function(t){var e=["-sS","-i"],r=(t.method||"GET").toUpperCase();"GET"!==r&&e.push("-X",r);var n=v({},t.headers||{}),o=Object.keys(n).some((function(t){return"content-type"===t.toLowerCase()})),i=void 0!==t.data&&null!==t.data;i&&!o&&(n["Content-Type"]="application/json");for(var s=0,a=Object.keys(n);s<a.length;s++){var u=a[s];e.push("-H",u+": "+n[u])}if(i){var c=void 0;c=Buffer.isBuffer(t.data)?t.data.toString():"string"==typeof t.data?t.data:JSON.stringify(t.data),e.push("--data",c)}!1!==t.followRedirects&&e.push("-L");var l="number"==typeof t.timeoutMs&&t.timeoutMs>0?t.timeoutMs:15e3;return e.push("--max-time",String(Math.ceil(l/1e3))),e.push(t.url),e}(t),n="win32"===process.platform?"curl.exe":"curl",[4,new Promise((function(t,o){var i=r.spawn(n,e,{stdio:["ignore","pipe","pipe"]}),s="",a="";i.stdout.on("data",(function(t){s+=t.toString()})),i.stderr.on("data",(function(t){a+=t.toString()})),i.on("error",(function(t){return o(t)})),i.on("close",(function(e){if(0!==e&&!s)return o(new Error(a||"curl exit "+e));try{t(function(t){var e,r=t.indexOf("\r\n\r\n")>=0?t.indexOf("\r\n\r\n"):t.indexOf("\n\n"),n=r>=0?t.substring(0,r):"",o=r>=0?t.substring(r+("\r\n\r\n"===t.substr(r,4)?4:2)):t,i=function(t){for(var e={},r=0,n=t.split(/\r?\n/);r<n.length;r++){var o=n[r],i=o.indexOf(":");if(i>0){var s=o.substring(0,i).trim(),a=o.substring(i+1).trim();s&&(e[s.toLowerCase()]=a)}}return e}(n),s=200,a=(n.split(/\r?\n/)[0]||"").match(/HTTP\/[0-9.]+\s+(\d{3})/);if(a&&(s=parseInt(a[1],10)),(i["content-type"]||"").includes("application/json"))try{e=JSON.parse(o)}catch(t){}return{status:s,headers:i,body:o,json:e}}(s))}catch(t){o(t)}}))}))];case 1:return[2,o.sent()]}}))}))},t.prototype.get=function(t,e){return g(this,void 0,void 0,(function(){return m(this,(function(r){return[2,this.request(v(v({},e||{}),{url:t,method:"GET"}))]}))}))},t.prototype.post=function(t,e,r){return g(this,void 0,void 0,(function(){return m(this,(function(n){return[2,this.request(v(v({},r||{}),{url:t,method:"POST",data:e}))]}))}))},t}());function U(){var t=new Date;return String(t.getFullYear())+"年"+String(t.getMonth()+1)+"月"+String(t.getDate())+"日"+String(t.getHours())+":"+String(t.getMinutes())}function F(t){return g(this,void 0,void 0,(function(){var e,r;return m(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),"https://fe-log-producer.jinbizhihui.com",[4,D.post("https://fe-log-producer.jinbizhihui.com/log/save",t)];case 1:return e=n.sent(),console.log("[RequestLogger] 远程日志发送成功, result",e),[3,3];case 2:return r=n.sent(),console.error("[RequestLogger] 远程日志发送失败:",(null==r?void 0:r.message)||r),[3,3];case 3:return[2]}}))}))}function P(t){return g(this,void 0,void 0,(function(){var e,r,n;return m(this,(function(o){switch(o.label){case 0:e=t.req.header("content-type")||"",o.label=1;case 1:return o.trys.push([1,4,,5]),(r=t.req.raw)&&"function"==typeof r.clone?[4,r.clone().text()]:[3,3];case 2:if(!(n=o.sent()))return[2,void 0];if(e.includes("application/json"))try{return[2,JSON.parse(n)]}catch(t){return[2,n]}return[2,n];case 3:return[3,5];case 4:return o.sent(),[3,5];case 5:return[2,void 0]}}))}))}function L(t){var e={};try{t.res.headers.forEach((function(t,r){e[r]=t}))}catch(t){}return e}function H(t,e,r){return g(this,void 0,void 0,(function(){var n,o,i,s,a,u,c,l,f,d;return m(this,(function(p){switch(p.label){case 0:return n=t.req.header("x-forwarded-for")||t.req.header("x-real-ip")||"unknown",o=t.req.method,i=t.req.url,s=t.req.query(),a=function(t){var e={};try{var r=t.req.raw,n=null==r?void 0:r.headers;n&&n.forEach((function(t,r){e[r]=t}))}catch(t){}return e}(t),[4,P(t)];case 1:return u=p.sent(),c=U(),l=Date.now(),[4,e()];case 2:return p.sent(),f=Date.now()-l,d={status:t.res.status,headers:L(t),duration:f},[4,F({system:r,ip:n,path:i,method:o,time:c,params:{method:o,url:i,query:s,body:u},headers:a,result:d})];case 3:return p.sent(),[2]}}))}))}function z(t){var e,r={};try{for(var n=(null===(e=t.response)||void 0===e?void 0:e.headers)||{},o=0,i=Object.entries(n);o<i.length;o++){var s=i[o],a=s[0],u=s[1];r[a]=String(u)}}catch(t){}return r}function _(t,e,r){var n,o,i,s,a,u;return g(this,void 0,void 0,(function(){var c,l,f,d,p,h,v,g,y,w,b;return m(this,(function(m){switch(m.label){case 0:return c=t.ip||(null===(n=t.request)||void 0===n?void 0:n.ip)||"unknown",l=t.path||(null===(o=t.request)||void 0===o?void 0:o.path)||"",f=t.method||(null===(i=t.request)||void 0===i?void 0:i.method)||"",d=t.url||(null===(s=t.request)||void 0===s?void 0:s.url)||"",p=t.query||(null===(a=t.request)||void 0===a?void 0:a.query)||{},h=(null===(u=t.request)||void 0===u?void 0:u.body)||{},v=function(t){var e,r={};try{for(var n=t.headers||(null===(e=t.request)||void 0===e?void 0:e.headers)||{},o=0,i=Object.entries(n);o<i.length;o++){var s=i[o],a=s[0],u=s[1];r[a]=String(u)}}catch(t){}return r}(t),g=U(),y=Date.now(),[4,e()];case 1:return m.sent(),w=Date.now()-y,b={status:t.status,body:t.body,headers:z(t),duration:w},[4,F({system:r,ip:c,path:l,method:f,time:g,params:{method:f,url:d,query:p,body:h},headers:v,result:b})];case 2:return m.sent(),[2]}}))}))}function W(t){var e,r={};try{for(var n=(null===(e=t.getHeaders)||void 0===e?void 0:e.call(t))||{},o=0,i=Object.entries(n);o<i.length;o++){var s=i[o],a=s[0],u=s[1];void 0!==u&&(r[a]=String(u))}}catch(t){}return r}function $(t,e,r){return g(this,void 0,void 0,(function(){var n,o,i,s,a,u,c,l,f,d;return m(this,(function(p){switch(p.label){case 0:return n=t.headers["x-forwarded-for"]||t.headers["x-real-ip"]||t.ip||"unknown",o=t.url||"",i=t.method||"",s=t.query||{},a=t.body||{},u=function(t){var e={};try{for(var r=t.headers||{},n=0,o=Object.entries(r);n<o.length;n++){var i=o[n],s=i[0],a=i[1];e[s]=String(a)}}catch(t){}return e}(t),c=U(),l=Date.now(),f=Date.now()-l,d={status:e.statusCode,headers:W(e),duration:f},[4,F({system:r,ip:n,path:o,method:i,time:c,params:{method:i,url:o,query:s,body:a},headers:u,result:d})];case 1:return p.sent(),[2]}}))}))}function G(t){var e=t.replace("#","").match(/../g);return e?e.map((function(t){return parseInt(t,16)})):[0,0,0]}function Y(t,e,r){var n=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e};return"#"+n(t)+n(e)+n(r)}function J(t,e){return!("undefined"==typeof window||!t)&&!!t.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}var Q=function(){function t(t){this.ws=null,this.reconnectAttempts=0,this.heartbeatTimer=null,this.listeners=new Map,this.opts={url:t.url,reconnectAttemptsLimit:t.reconnectAttemptsLimit||5,reconnectInterval:t.reconnectInterval||5e3,heartbeatInterval:t.heartbeatInterval||3e4,registerMessage:t.registerMessage}}return Object.defineProperty(t.prototype,"url",{get:function(){return this.opts.url},enumerable:!1,configurable:!0}),t.prototype.on=function(t,e){this.listeners.has(t)||this.listeners.set(t,new Set);var r=this.listeners.get(t);return r.add(e),function(){return r.delete(e)}},t.prototype.emit=function(t,e){var r=this.listeners.get(t);r&&r.forEach((function(t){try{t(e)}catch(t){}}))},t.prototype.connect=function(){try{this.ws=new WebSocket(this.opts.url),this.setupEventListeners()}catch(t){this.emit("error",{message:"WebSocket create failed"})}},t.prototype.setupEventListeners=function(){var t=this;this.ws&&(this.ws.onopen=function(){t.reconnectAttempts=0,t.opts.registerMessage&&t.send(t.opts.registerMessage),t.startHeartbeat(),t.emit("connected",!0)},this.ws.onmessage=function(e){try{var r=JSON.parse(e.data);t.emit("message",r)}catch(e){t.emit("error",{message:"Message parse failed"})}},this.ws.onclose=function(){t.stopHeartbeat(),t.emit("connected",!1),t.emit("closed",void 0),t.reconnect()},this.ws.onerror=function(){t.emit("error",{message:"WebSocket error"})})},t.prototype.send=function(t){if(this.ws&&1===this.ws.readyState)try{this.ws.send(JSON.stringify(t))}catch(t){}},t.prototype.startHeartbeat=function(){var t=this;this.stopHeartbeat(),this.heartbeatTimer=setInterval((function(){t.send({type:"ping"})}),this.opts.heartbeatInterval)},t.prototype.stopHeartbeat=function(){null!=this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)},t.prototype.reconnect=function(){var t=this;this.reconnectAttempts<this.opts.reconnectAttemptsLimit&&(this.reconnectAttempts++,setTimeout((function(){t.connect()}),this.opts.reconnectInterval))},t.prototype.disconnect=function(){if(this.stopHeartbeat(),this.ws)try{this.ws.close()}catch(t){}this.ws=null},Object.defineProperty(t.prototype,"isConnected",{get:function(){return!!this.ws&&1===this.ws.readyState},enumerable:!1,configurable:!0}),t}(),Z=function(){function t(){this.initialized=!1,this.manager=null}return t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t.prototype.init=function(t){return g(this,void 0,void 0,(function(){return m(this,(function(e){return this.initialized||(this.manager=new Q(t),this.manager.connect(),this.initialized=!0),[2]}))}))},t.prototype.destroy=function(){this.manager&&this.manager.disconnect(),this.manager=null,this.initialized=!1},t.prototype.getManager=function(){return this.manager},t}().getInstance(),V=new(function(){function t(){this.listeners=new Map}return t.prototype.on=function(t,e){this.listeners.has(t)||this.listeners.set(t,new Set);var r=this.listeners.get(t);return r.add(e),function(){return r.delete(e)}},t.prototype.off=function(t,e){var r=this.listeners.get(t);r&&r.delete(e)},t.prototype.emit=function(t,e){var r=this.listeners.get(t);r&&r.forEach((function(t){try{t(e)}catch(t){}}))},t}());t.ApiBuilder=B,t.InsertBuilder=R,t.QueryBuilder=j,t.UpdateBuilder=q,t.WebsocketManager=Q,t.addClass=function(t,e){"undefined"!=typeof window&&t&&(J(t,e)||(t.className+=" "+e))},t.addDays=function(t,e,r){if(void 0===e&&(e=0),void 0===r&&(r="yyyy-MM-dd"),s(t))return"-";t=f(t);var n=new Date(t);return n.setDate(n.getDate()+Number(e)),d(n,r)},t.base64ToBlob=function(t){for(var e=t.split(","),r=e[0].match(/:(.\*?);/)[1],n=atob(e[1]),o=n.length,i=new Uint8Array(o);o--;)i[o]=n.charCodeAt(o);return new Blob([i],{type:r})},t.base64ToFile=function(t,e){for(var r=t.split(","),n=r[0].match(/:(.*);/)[1],o=atob(r[1]),i=o.length,s=new Uint8Array(i);i--;)s[i]=o.charCodeAt(i);return new File([s],e,{type:n})},t.blobToDataURL=k,t.buildUUID=function(){for(var t=[],e=0;e<=15;e++)t[e]=e.toString(16);var r="";for(e=1;e<=36;e++)r+=9===e||14===e||19===e||24===e?"-":15===e?4:20===e?t[4*Math.random()|8]:t[16*Math.random()|0];return r.replace(/-/g,"")},t.calcFileSize=C,t.ceil=S,t.clearLoginData=function(){localStorage.removeItem("wecom_userinfo"),localStorage.removeItem("wecom_token"),localStorage.removeItem("projectActive"),localStorage.removeItem("loginTime"),localStorage.removeItem("projectInfo")},t.compatibleDate=f,t.compressImg=function(t,e,r){return new Promise((function(n,o){var i=parseFloat((t.size/1024/1024).toString()),s=new FileReader;s.onload=function(s){var a=new Image;a.onload=function(){var o=a.width,s=a.height,u=document.createElement("canvas"),c=u.getContext("2d"),l=e?e(o,s):1;(Number.isNaN(l)||"number"!=typeof l)&&(l=1);var f=r?r(i,l,o,s):1;if((Number.isNaN(f)||"number"!=typeof f)&&(f=1),c){var d=parseInt((o*l).toString(),10),p=parseInt((s*l).toString(),10);u.setAttribute("width",d.toString()),u.setAttribute("height",p.toString()),c.drawImage(a,0,0,d,p)}var h=u.toDataURL(t.type,f);n(x(h))},a.onerror=function(t){o(t)},s.target&&(a.src=s.target.result)},s.onerror=function(t){o(t)},s.readAsDataURL(t)}))},t.computeMoney=A,t.convertBase64UrlToBlob=function(t){for(var e=window.atob(t.split(",")[1]),r=new ArrayBuffer(e.length),n=new Uint8Array(r),o=0;o<e.length;o++)n[o]=e.charCodeAt(o);return new Blob([r],{type:"image/png"})},t.convertCurrency=function(t){if(void 0===t&&(t=""),s(t))return"";if(Number(t)>=1e15)return t;var e,r,n,o=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],i=["","拾","佰","仟"],a=["","万","亿","兆"],u=["角","分","毫","厘"],c="";if("0"===(t=parseFloat(t).toString()))return c=o[0]+"元整";if(-1===(t=t.toString()).indexOf(".")?(e=t,r=""):(e=(n=t.split("."))[0],r=n[1].substr(0,4)),parseInt(e,10)>0){for(var l=0,f=e.length,d=0;d<f;d+=1){var p=e.substr(d,1),h=f-d-1,v=h/4,g=h%4;"0"===p?l+=1:(l>0&&(c+=o[0]),l=0,c+=o[parseInt(p,10)]+i[g]),0===g&&l<4&&(c+=a[v])}c+="元"}if(""!==r){var m=r.length;for(d=0;d<m;d+=1){var y=r.substr(d,1);"0"!==y&&(c+=o[Number(y)]+u[d])}}return""===c?c+=o[0]+"元整":""===r&&(c+="整"),c},t.copyTextToClipboard=function(t){if("undefined"==typeof window||"undefined"==typeof document)return!1;var e=document.createElement("textarea"),r=document.activeElement;e.value=t,e.setAttribute("readonly",""),e.style.position="absolute",e.style.left="-9999px",e.style.fontSize="12pt",e.style.border="0",e.style.padding="0",e.style.margin="0";var n=document.getSelection(),o=null;n&&n.rangeCount>0&&(o=n.getRangeAt(0)),document.body.appendChild(e),e.select(),e.selectionStart=0,e.selectionEnd=t.length;var i=!1;try{i=document.execCommand("copy")}catch(t){console.error("复制失败:",t)}return e.remove(),o&&n&&(n.removeAllRanges(),n.addRange(o)),r&&r.focus(),i},t.createWebSocketStore=function(t){return void 0===t&&(t="websocket"),n.defineStore(t,{state:function(){return{isConnected:!1,wsManager:null,messages:[],connectionError:null}},getters:{connectionStatus:function(t){return t.isConnected?"已连接":"未连接"},lastMessage:function(t){return t.messages[t.messages.length-1]||null}},actions:{connect:function(t){var e;return g(this,void 0,void 0,(function(){return m(this,(function(r){return(null===(e=this.wsManager)||void 0===e?void 0:e.isConnected)||(this.wsManager=new Q(t),this.setupEventListeners(),this.wsManager.connect()),[2]}))}))},setupEventListeners:function(){var t=this;this.wsManager&&(this.wsManager.on("connected",(function(e){t.isConnected=e,e&&(t.connectionError=null),V.emit("websocket-connected",e)})),this.wsManager.on("message",(function(e){t.addMessage(e),V.emit("websocket-message",e)})),this.wsManager.on("error",(function(e){t.connectionError=(null==e?void 0:e.message)||"WebSocket error",V.emit("websocket-error",{message:t.connectionError})})),this.wsManager.on("closed",(function(){t.isConnected=!1,V.emit("websocket-closed",void 0)})))},sendMessage:function(t){var e;null===(e=this.wsManager)||void 0===e||e.send(t)},addMessage:function(t){var e=v(v({},t),{timestamp:Date.now(),id:Math.random().toString(36).substring(2,11)});this.messages.push(e),this.messages.length>100&&this.messages.shift()},clearMessages:function(){this.messages=[]},disconnect:function(){var t;null===(t=this.wsManager)||void 0===t||t.disconnect(),this.wsManager=null,this.isConnected=!1,this.connectionError=null},reset:function(){this.disconnect(),this.clearMessages()}}})},t.darken=function(t,e){var r=G(t).map((function(t){return Math.floor(t*(1-e))}));return Y(r[0],r[1],r[2])},t.dataURLtoBlob=x,t.deepEqual=function t(e,r){var n=Object.keys,o=typeof e;return e&&r&&"object"===o&&o===typeof r?n(e).length===n(r).length&&n(e).every((function(n){return t(e[n],r[n])})):e===r},t.delay=function(t){return new Promise((function(e){return setTimeout(e,t)}))},t.deviceDetection=function(){if("undefined"==typeof window)return!1;var t=navigator.userAgent.toLowerCase(),e=/midp/i.test(t),r=/ucweb/i.test(t),n=/android/i.test(t),o=/iphone os/i.test(t),i=/windows ce/i.test(t),s=/windows mobile/i.test(t),a=/rv:1.2.3.4/i.test(t);return e||r||n||o||i||s||a},t.emitter=V,t.fileSizeFormat=function(t,e,r){if(void 0===e&&(e="B"),void 0===r&&(r="-"),s(t))return r;var n=C(parseFloat(t.toString()),e);return""+S(n.size,2)+n.unit},t.filterRepeat=function(t,e){var r=new Set;return t.filter((function(t){var n=t[e];return!r.has(n)&&(r.add(n),!0)}))},t.findNodePath=function(t,e,r,n){var o=[];try{for(var i=0;i<r.length;i++)E(r[i],t,e,n,o)}catch(t){return o}},t.floor=function(t,e){if(void 0===e&&(e=0),s(t))return t;var r=Math.pow(10,e),n=Number(t)*r;return Math.floor(n)/r},t.formatBank=function(t,e){return void 0===e&&(e=""),s(t)?e:t.toString().replace(/\s/g,"").replace(/(.{4})/g,"$1 ")},t.formatBytes=function(t,e){if(void 0===e&&(e=2),0===t)return"0 Bytes";var r=e<0?0:e,n=Math.floor(Math.log(t)/Math.log(1024));return parseFloat((t/Math.pow(1024,n)).toFixed(r))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][n]},t.formatCentsToYuan=function(t,e){return M(t,v({operation:"divide",factor:100,formatAsCurrency:!0},e))},t.formatEmptyValue=function(t,e){return void 0===e&&(e="-"),s(t)?e:t},t.formatFloat=function(t,e){void 0===e&&(e=2);var r=parseFloat(String(t));if(Number.isNaN(r))return"";var n=(r=Math.round(Number(t)*Math.pow(10,e))/Math.pow(10,e)).toString(),o=n.indexOf(".");for(o<0&&(o=n.length,n+=".");n.length<=o+e;)n+="0";return n},t.formatMoney=M,t.formatPhone=function(t,e,r){if(void 0===e&&(e=" "),void 0===r&&(r="-"),s(t))return r;if(11!==t.toString().length)return t;var n=t.toString().replace(/[^\d]/g,"").split(""),o="";return n.forEach((function(t,r){3!==r&&7!==r||(o+=e),o+=t})),o},t.formatPhoneHide=function(t,e){if(void 0===e&&(e=""),s(t))return e;if(11!==t.toString().length)return t;var r=t.toString();return r.substr(0,3)+"****"+r.substr(7,11)},t.formatTime=d,t.formateTimestamp=function(t,e){if(void 0===e&&(e="YYYY年MM月DD日 hh:mm:ss"),!t)return"-";var r=new Date(t),n=r.getFullYear()+"",o=r.getMonth()+1,i=r.getDate(),s=r.getHours()>9?r.getHours():"0"+r.getHours(),a=r.getMinutes()>9?r.getMinutes():"0"+r.getMinutes(),u=r.getSeconds()>9?r.getSeconds():"0"+r.getSeconds();return e.replace("YYYY",n+"").replace("MM",o+"").replace("DD",i+"").replace("hh",s+"").replace("mm",a+"").replace("ss",u+"")},t.fromNow=function(t,e,r){if(void 0===e&&(e="yyyy年MM月dd日 HH时mm分ss秒"),void 0===r&&(r="-"),s(t))return r;t=f(t);var n=new Date(t),o=(Date.now()-n.getTime())/1e3;return o<0?t:o<30?"刚刚":o<3600?Math.ceil(o/60)+"分钟前":o<86400?Math.floor(o/3600)+"小时前":o<172800?"1天前":d(t,e)},t.genExportByBlob=function(t){var e=t.axiosRequest,r=t.notWithCredentials,n=void 0===r?[]:r;return function(t){var r=this,o=t.filename,i=t.url,s=t.data,a=void 0===s?{}:s,u=t.params,c=void 0===u?{}:u,l=t.method,f=void 0===l?"post":l;return new Promise((function(t,s){e({method:f,url:i,data:a,params:c,responseType:"blob",config:{withCredentials:n.some((function(t){return!i.includes(t)}))}}).then((function(e){return g(r,void 0,void 0,(function(){var r,n,i,a,u,c,l,f,d,p;return m(this,(function(h){switch(h.label){case 0:return"application/json"!==(r=null==e?void 0:e.data).type?[3,1]:((n=new FileReader).readAsText(r,"utf-8"),n.onload=function(){var t={};try{t=JSON.parse(n.result)}catch(e){t=r}s(t)},[3,3]);case 1:try{i=e.headers,a=i["content-disposition"],u=decodeURIComponent(a.split(";")[1].split("filename=")[1]),o&&!o.includes(".")?(c=u.split("."),l=c[c.length-1],o+="."+l):o||(o=u)}catch(t){o||(o="download.xlsx")}return f=new Blob([e.data]),d=document.createElement("a"),[4,k(f)];case 2:p=h.sent(),d.href=p,d.download=o,document.body.appendChild(d),d.click(),document.body.removeChild(d),t(e),h.label=3;case 3:return[2]}}))}))})).catch((function(t){s(t)}))}))}},t.generateEnglishLetters=function(){for(var t=[],e=65;e<91;e+=1)t.push(String.fromCharCode(e));return t},t.getCookie=function(t){for(var e="",r=document.cookie.split("; "),n=0;n<r.length;n++){var o=r[n].split("=");if(o[0]===t){e=o[1];break}}return e},t.getDeviceType=a,t.getEnvironment=function(){var t=window.navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i),e=/micromessenger/i.test(navigator.userAgent),r=/wxwork/i.test(navigator.userAgent);return r&&t?"com-wx-mobile":r&&!t?"com-wx-pc":e&&t?"wx-mobile":e&&!t?"wx-pc":"other"},t.getFileData=function(t){var e=t.split(","),r=e[0],n=void 0===r?"":r,o=e[1],i=void 0===o?"":o;return{name:decodeURIComponent(n),url:decodeURIComponent(i)}},t.getFromType=u,t.getIsComWx=function(){return/wxwork/i.test(navigator.userAgent)},t.getIsDevelopment=function(){var t=!1;return"uat2-h5-wecom.hengdayun.com"!==location.origin&&"127.0.0.1:8081"!==location.origin&&"localhost:8081"!==location.origin||(t=!0),t},t.getKeyList=function(t,e){if(!Array.isArray(t))return[];for(var r=[],n=0,o=t;n<o.length;n++){var i=o[n];i&&void 0!==i[e]&&null!==i[e]&&r.push(i[e])}return r},t.getQueryMap=function(t){if(!/^(?:(https?|ftp|rtsp|mms|ws|wss):\/\/)?/i.test(t))return console.error(t+"不符合超链接规范"),{};var e=t.indexOf("?");if(-1===e)return{};for(var r={},n=0,o=t.slice(e+1).split("&");n<o.length;n++){var i=o[n].split("="),s=i[0],a=i[1];s&&(r[s]=a||"")}return r},t.getQueryString=function(t,e){var r=new RegExp("&{1}"+e+"\\=[a-zA-Z0-9_-]+","g"),n=t.replace(/\?/g,"&").match(r)[0];return n.substr(n.indexOf("=")+1)},t.getQueryVariable=function(t){for(var e=window.location.search.substring(1).split("&"),r=0;r<e.length;r++){var n=e[r].split("=");if(n[0]===t)return n[1]}return!1},t.getSvgInfo=function(t){if("undefined"==typeof window||"undefined"==typeof DOMParser)return t;try{var e=(new DOMParser).parseFromString(t,"image/svg+xml").querySelector("svg");if(!e)return t;var r=e.getAttribute("viewBox");if(!r)throw new Error("Invalid SVG string: Missing viewBox attribute.");var n=r.split(" ");return{width:parseInt(n[2],10),height:parseInt(n[3],10),body:Array.from(e.querySelectorAll("path")).map((function(t){return t.outerHTML})).join(" ")}}catch(e){return console.error("解析 SVG 失败:",e),t}},t.getTicket=function(){return localStorage.getItem("jsapiTicket")},t.getToken=c,t.getWecomToken=function(){return localStorage.getItem("wecom_token")},t.handleFlatStr=function(t,e){void 0===t&&(t="state");var r=function(t,e){void 0===e&&(e="state");for(var r,n=t;"string"==typeof n;)try{r=n,n=decodeURIComponent(n),n=JSON.parse(n)}catch(t){n=r;break}for(;n&&"object"==typeof n&&e in n&&("string"==typeof n[e]||"object"==typeof n[e]);)if("string"==typeof(n=n[e]))try{n=decodeURIComponent(n),n=JSON.parse(n)}catch(t){break}return n}(e,t);return"object"==typeof r?JSON.stringify(r):String(r)},t.hasClass=J,t.hexToRgb=G,t.hideTextAtIndex=function(t,e,r){void 0===r&&(r="*"),"number"==typeof t&&(t=t.toString()),Array.isArray(e)||(e=[e]);for(var n=t.split(""),o=0,i=e;o<i.length;o++){var s=i[o];if("object"!=typeof s||Array.isArray(s))"number"==typeof s&&Number.isInteger(s)&&s>=0&&s<n.length&&(n[s]=r);else{var a=s.start,u=s.end;a>=0&&a<u&&u<n.length&&n.fill(r,a,u+1)}}return n.join("")},t.http=function(t){var e=t.cacheType,r=t.currentMode,n=t.errorCb,o=t.getTokenCb;return t.tokenKey,I.interceptors.request.use((function(t){return g(void 0,void 0,void 0,(function(){var r,n;return m(this,(function(o){return r=c(e),n=a(),t.headers.Authorization=r,t.headers.token=r,t.headers.FrontType=u(n),[2,t]}))}))}),(function(t){return Promise.reject(t)})),I.interceptors.response.use((function(t){return g(void 0,void 0,void 0,(function(){var n,i,s;return m(this,(function(a){return n=t.data,i=n.code||t.status,n instanceof Blob||i===T.CODES.Success?[2,n]:i===T.CODES.UnAuthorized?("local"!==r&&"dev"!==r&&"development"!==r&&(l(e),o&&"function"==typeof o&&o()),[2,Promise.reject(new Error("token过期!"))]):(s=n.message||n.msg,[2,Promise.reject(new Error(s||"Error"))])}))}))}),(function(t){return g(void 0,void 0,void 0,(function(){return m(this,(function(e){return n&&"function"==typeof n&&n(t),[2,Promise.reject(t)]}))}))})),I},t.httpEnum=T,t.humpTurnDashed=function(t){return void 0===t&&(t=""),t.replace(/\B([A-Z])/g,"-$1").toLowerCase()},t.intersection=function(t,e){return Array.isArray(t)&&Array.isArray(e)?t.filter((function(t){return e.includes(t)})):[]},t.isAllEmpty=function(t){return null==t||("string"==typeof t?0===t.trim().length:Array.isArray(t)?0===t.length:"object"==typeof t&&0===Object.keys(t).length)},t.isEmail=function(t){return/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(t)},t.isEmpty=s,t.isExternal=function(t){return/^(https?:|mailto:|tel:)/.test(t)},t.isImage=function(t){return/^image\//i.test(t)},t.isIncludeAllChildren=function(t,e,r){if(!Array.isArray(t)||!Array.isArray(e))return!1;var n=r||function(t,e){return JSON.stringify(t)===JSON.stringify(e)};return e.every((function(e){return t.some((function(t){return n(t,e)}))}))},t.isMobile=function(t){return/^0?(13[0-9]|14[5-9]|15[012356789]|166|17[0-8]|18[0-9]|19[8-9])[0-9]{8}$/.test(t.toString())},t.isMobileSimple=function(t){return t=t.toString(),/^1/.test(t)&&11===t.length},t.isPhone=function(t){return/^[1](([3][0-9])|([4][0,1,4-9])|([5][0-3,5-9])|([6][2,5,6,7])|([7][0-8])|([8][0-9])|([9][0-3,5-9]))[0-9]{8}$/.test(t)},t.isQQ=function(t){return/^[1-9][0-9]{4,9}$/gim.test(String(t))},t.isTelephone=function(t){return/^0[1-9][0-9]{1,2}-[2-8][0-9]{6,7}$/.test(String(t))},t.isUrl=function(t){return new RegExp("^(?:(https?|ftp|rtsp|mms|ws|wss):\\/\\/)?(?:\\S+(?::\\S*)?@)?(?:(?:localhost)|(?:[1-9]\\d{0,2}(?:\\.\\d{1,3}){3})|(?:$[0-9a-fA-F:]+$)|(?:(?:[a-zA-Z0-9-_]+\\.)+[a-zA-Z]{2,63}))(?::\\d{1,5})?(?:[/?#]\\S*)?$","i").test(t)},t.lighten=function(t,e){var r=G(t).map((function(t){return Math.floor((255-t)*e+t)}));return Y(r[0],r[1],r[2])},t.newDate=function(t){return t?new Date(f(t)):new Date},t.openLink=function(t,e){if(void 0===e&&(e="_blank"),"undefined"!=typeof window){var r=document.createElement("a");r.setAttribute("href",t),r.setAttribute("target",e),r.setAttribute("rel","noreferrer noopener"),r.setAttribute("id","external");var n=document.getElementById("external");n&&document.body.removeChild(n),document.body.appendChild(r),r.click(),r.remove()}},t.randomString=function(t){t=t||32;for(var e="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678",r=e.length,n="",o=0;o<t;o++)n+=e.charAt(Math.floor(Math.random()*r));return n},t.recordLogMiddleware=function(t){var e=this;return function(r,n){return g(e,void 0,void 0,(function(){return m(this,(function(e){switch(function(t,e){var r;return function(t){var e,r;return t&&"string"==typeof t.method&&"string"==typeof t.url&&t.headers&&(void 0!==t.routerPath||void 0!==t.routeOptions||"function"==typeof t.getValidationFunction||"IncomingMessage"===(null===(r=null===(e=t.raw)||void 0===e?void 0:e.constructor)||void 0===r?void 0:r.name))}(t)&&void 0!==(null==e?void 0:e.statusCode)?"fastify":t&&t.req&&"function"==typeof t.req.header&&"function"==typeof t.req.query&&void 0!==t.req.raw?"hono":t&&t.request&&t.response&&"function"==typeof t.throw?t.requestContext||(null===(r=t.app)||void 0===r?void 0:r.getApplicationContext)?"midway":"koa":"unknown"}(r,n)){case"hono":return[2,H(r,n,t)];case"fastify":return[2,$(r,n,t)];case"koa":case"midway":return[2,_(r,n,t)];default:return console.warn("[requestLoggerUnified] Unknown framework detected, falling back to Koa-style handling"),[2,_(r,n,t)]}return[2]}))}))}},t.recordLogMiddlewareFastify=function(t){var e=this;return function(r,n){return g(e,void 0,void 0,(function(){return m(this,(function(e){return[2,$(r,n,t)]}))}))}},t.recordLogMiddlewareHono=function(t){var e=this;return function(r,n){return g(e,void 0,void 0,(function(){return m(this,(function(e){return[2,H(r,n,t)]}))}))}},t.recordLogMiddlewareKoa=function(t){var e=this;return function(r,n){return g(e,void 0,void 0,(function(){return m(this,(function(e){return[2,_(r,n,t)]}))}))}},t.recordLogMiddlewareMidway=function(t){var e=this;return function(r,n){return g(e,void 0,void 0,(function(){return m(this,(function(e){return[2,_(r,n,t)]}))}))}},t.removeClass=function(t,e){if("undefined"!=typeof window&&t&&J(t,e)){var r=new RegExp("(\\s|^)"+e+"(\\s|$)");t.className=t.className.replace(r," ").trim()}},t.removeTicket=function(){return localStorage.removeItem("jsapiTicket")},t.removeToken=l,t.rgbToHex=Y,t.sendLog=F,t.setTicket=function(t){return localStorage.setItem("jsapiTicket",t)},t.subBefore=function(t,e){return t&&"string"==typeof e?t.substring(0,t.indexOf(e)):""},t.sum=function(t){return Array.isArray(t)&&t.length>0?t.reduce((function(t,e){return t+e}),0):0},t.toThousands=b,t.toggleClass=function(t,e,r){if("undefined"!=typeof window){var n=r||document.body,o=n.className;o=o.replace(e,"").trim(),n.className=t?(o+" "+e).trim():o}},t.trimVal=function(t){return t?t.replace(/^\s+|\s+$/g,""):t},t.uuid=function(t,e){var r,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),o=[];if(e=e||n.length,t)for(r=0;r<t;r++)o[r]=n[0|Math.random()*e];else{var i=void 0;for(o[8]=o[13]=o[18]=o[23]="-",o[14]="4",r=0;r<36;r++)o[r]||(i=0|16*Math.random(),o[r]=n[19==r?3&i|8:i])}return o.join("")},t.validateTwoDecimal=function(t){return!t||""===t||/^(\d+)(\.\d{1,2})?$/.test(t.toString())},t.websocketService=Z,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("axios"),require("pinia"),require("decimal.js"),require("china-area-data"),require("lodash-es"),require("mitt"),require("sm-crypto")):"function"==typeof define&&define.amd?define(["exports","axios","pinia","decimal.js","china-area-data","lodash-es","mitt","sm-crypto"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["jinbi-utils"]={},e.axios,e.pinia,e.Decimal,e.REGION_DATA,e.lodashEs,e.mitt,e.smCrypto)}(this,(function(e,t,r,n,o,i,a,u){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(t),c=s(n),f=s(o),d=s(a),h=function(e,t){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function p(e,t){function r(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var v=function(){return(v=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function y(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{s(n.next(e))}catch(e){i(e)}}function u(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,u)}s((n=n.apply(e,t||[])).next())}))}function g(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function m(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function w(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function b(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(w(arguments[t]));return e}var S={isWxWork:"wecom",isWeixin:"wechat",isMobile:"mobile",isMobileAny:"mobile"};function A(e){return null===e||""===e||void 0===e}var E=function(){var e=navigator.userAgent.toLowerCase(),t=/wxwork/.test(e),r=/micromessenger/.test(e)&&!t,n=window.innerWidth<=768;return{isWxWork:t,isWeixin:r,isMobileScreen:n,isMobileAny:t||r||n}},C=function(e){var t="wecom";for(var r in e){if(e[r]){t=S[r];break}}return t};var M=function(e,t){var r=e.toLowerCase();return"localstorage"===r?localStorage.getItem("token")||"":"sessionstorage"===r?sessionStorage.getItem("token")||"":localStorage.getItem("token")||sessionStorage.getItem("token")||""},T=function(e,t){var r=e.toLowerCase();"localstorage"===r?localStorage.removeItem("token"):"sessionstorage"===r?sessionStorage.removeItem("token"):(localStorage.removeItem("token"),sessionStorage.getItem("token"))};function D(e){return"string"==typeof e?e.replace(/-/g,"/"):e}function O(e,t){void 0===e&&(e=Date.now()),void 0===t&&(t="yyyy-MM-dd HH:mm:ss"),e=D(e);var r={"M+":(e=new Date(e)).getMonth()+1,"d+":e.getDate(),"h+":e.getHours()%12==0?12:e.getHours()%12,"H+":e.getHours(),"m+":e.getMinutes(),"s+":e.getSeconds(),"q+":Math.floor((e.getMonth()+3)/3),S:e.getMilliseconds()};return/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(""+e.getFullYear()).substr(4-RegExp.$1.length))),Object.keys(r).forEach((function(e){new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1===RegExp.$1.length?r[e]:("00"+r[e]).substr((""+r[e]).length)))})),t}var x={operation:"divide",factor:100,precision:2,formatAsCurrency:!1,currencySymbol:"¥"};function L(e,t){if(void 0===t&&(t="-"),A(e))return t;var r=e.toString();return r.includes(".")||(r+="."),r.replace(/\d(?=(\d{3})+\.)/g,(function(e){return e+","})).replace(/\.$/,"")}function N(e,t){if(void 0===t&&(t=0),A(e))return e;var r=Math.pow(10,t),n=Number(e)*r;return Math.ceil(n)/r}function R(e,t){var r=B(e,t),n=v(v({},x),t);if(n.formatter)return n.formatter(r);if(n.formatAsCurrency){var o=r.toFixed(n.precision),i=r>=1e3?L(o):o;return""+n.currencySymbol+i}return r.toFixed(n.precision)}function B(e,t){var r,n,o=v(v({},x),t);if(null==e||""===e)return 0;if("string"==typeof e){var i=e.replace(/[^\d.-]/g,"");r=i?parseFloat(i):0}else r=e;if(isNaN(r))return 0;if(n="multiply"===o.operation?r*o.factor:0!==o.factor?r/o.factor:0,void 0!==o.precision){var a=Math.pow(10,o.precision);n=Math.round(n*a)/a}return n}function I(e,t){void 0===t&&(t="B");var r=["B","KB","MB","GB","TB"],n=r.indexOf(t.toUpperCase());for(n=-1===n?0:n;e>=1024&&n<r.length;)e/=1024,n+=1;return{size:e,unit:r[n]}}function P(e){for(var t=e.match(/:(.*?);/)[1],r=window.atob(e.split(",")[1]),n=new ArrayBuffer(r.length),o=new Uint8Array(n),i=0;i<r.length;i+=1)o[i]=r.charCodeAt(i);return new Blob([n],{type:t})}function F(e){return new Promise((function(t,r){var n=new FileReader;n.onload=function(e){e&&e.target?t(e.target.result):r(e)},n.onerror=function(e){r(e)},n.readAsDataURL(e)}))}function U(e,t,r,n,o){if(void 0===o&&(o=[]),o.push(e),e[r]===t)throw"GOT IT!";if(e[n]&&e[n].length>0)for(var i=0;i<e[n].length;i++)U(e[n][i],t,r,n,o);o.pop()}var _={HTTP_STATUS:{TEMP_RESPOND:{Continue:100,SwitchingProtocal:101},SUCCESS:{Ok:200,Created:201,Accepted:202,NoAuthoritativeInformation:203,NoContent:204,ResetContent:205,ParticalContent:206},REDIRECT:{MultipleChoice:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,TemporaryRedirect:307,PermanentRedirect:308},REQUEST_ERROR:{BadRequest:400,UnAuthorized:401,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAccepted:406,ProxyAuthorizationRequired:407,RequestTimeout:408,UpgradeRequired:426,TokenUnAuthorized:499},SERVER_ERROR:{InternalServerError:500,BadGateway:502,ServiceUnavailable:503,GateTimeout:504,HttpVersionNotSupported:505}},CODES:{Success:"00000",UnAuthorized:"00099",UnAuthorizedPhone:"11001",UnAuthorizedWecom:"11000",UnAuthorizedHavePhone:"11002"},ERR_CODE_WHITE_LIST:[]},k=l.default.create({timeout:15e3,headers:{"Content-Type":"application/json"}}),j=function(){function e(e){this.fieldCatalog=e,this.params=e?{field_catalog:e}:{}}return e.prototype.build=function(){return this.params},e}(),q=function(){function e(e){this.fieldCatalog=e}return e.prototype.query=function(){return new H(this.fieldCatalog)},e.prototype.insert=function(){return new W(this.fieldCatalog)},e.prototype.update=function(){return new G(this.fieldCatalog)},e.query=function(e){return new H(e)},e.insert=function(e){return new W(e)},e.update=function(e){return new G(e)},e}(),z=function(){function e(e,t){this.parent=t,this.nestedFilters={logic:e,filters:[]}}return e.prototype.where=function(e,t,r){var n=this;return"object"==typeof e?(Object.entries(e).forEach((function(e){var t=w(e,2),r=t[0],o=t[1];n.nestedFilters.filters.push({field:r,op:"=",value:o})})),this):void 0===r?(this.nestedFilters.filters.push({field:e,op:"=",value:t}),this):(this.nestedFilters.filters.push({field:e,op:t,value:r}),this)},e.prototype.group=function(t){return void 0===t&&(t="and"),new e(t,this)},e.prototype.endGroup=function(){return this.parent instanceof e?(this.parent.addNestedFilters(this.nestedFilters),this.parent):(this.parent.whereNested(this.nestedFilters),this.parent)},e.prototype.addNestedFilters=function(e){this.nestedFilters.filters.push(e)},e.prototype.build=function(){return this.nestedFilters},e}(),H=function(e){function t(t){var r=e.call(this,t)||this;return r.params=v(v({},r.params),{filters:{logic:"and",filters:[]},order_by:[],limit:100,offset:0}),r}return p(t,e),t.prototype.where=function(e,t,r){var n=this;return"object"==typeof e?(Object.entries(e).forEach((function(e){var t=w(e,2),r=t[0],o=t[1];n.params.filters.filters.push({field:r,op:"=",value:o})})),this):void 0===r?(this.params.filters.filters.push({field:e,op:"=",value:t}),this):(this.params.filters.filters.push({field:e,op:t,value:r}),this)},t.prototype.whereNested=function(e){return this.params.filters.filters.push(e),this},t.prototype.group=function(e){return void 0===e&&(e="and"),new z(e,this)},t.prototype.orWhere=function(e,t,r){var n,o={logic:"or",filters:[]};if("object"==typeof e?Object.entries(e).forEach((function(e){var t=w(e,2),r=t[0],n=t[1];o.filters.push({field:r,op:"=",value:n})})):void 0===r?o.filters.push({field:e,op:"=",value:t}):o.filters.push({field:e,op:t,value:r}),0===this.params.filters.filters.length||"or"===this.params.filters.logic)(n=this.params.filters.filters).push.apply(n,b(o.filters)),this.params.filters.logic="or";else{var i={logic:"and",filters:b(this.params.filters.filters)};this.params.filters.filters=[i,o],this.params.filters.logic="and"}return this},t.prototype.whereIn=function(e,t){return this.params.filters.filters.push({field:e,op:"in",value:t}),this},t.prototype.whereNotIn=function(e,t){return this.params.filters.filters.push({field:e,op:"not in",value:t}),this},t.prototype.whereLike=function(e,t){return this.params.filters.filters.push({field:e,op:"like",value:t}),this},t.prototype.whereBetween=function(e,t,r){return this.params.filters.filters.push({field:e,op:"between",value:[t,r]}),this},t.prototype.whereNull=function(e){return this.params.filters.filters.push({field:e,op:"is null",value:null}),this},t.prototype.whereNotNull=function(e){return this.params.filters.filters.push({field:e,op:"is not null",value:null}),this},t.prototype.logic=function(e){return this.params.filters.logic=e,this},t.prototype.orderBy=function(e,t){return void 0===t&&(t="asc"),this.params.order_by.push({field:e,direction:t}),this},t.prototype.limit=function(e){return this.params.limit=e,this},t.prototype.offset=function(e){return this.params.offset=e,this},t.prototype.paginate=function(e,t){return void 0===t&&(t=0),this.params.limit=e,this.params.offset=t,this},t}(j),W=function(e){function t(t){var r=e.call(this,t)||this;return r.params=v(v({},r.params),{insert:[]}),r}return p(t,e),t.prototype.add=function(e){return this.params.insert.push(e),this},t.prototype.addBatch=function(e){var t;return(t=this.params.insert).push.apply(t,b(e)),this},t}(j),G=function(e){function t(t){var r=e.call(this,t)||this;return r.currentUpdate=null,r.params=v(v({},r.params),{update:[]}),r}return p(t,e),t.prototype.set=function(e){return this.currentUpdate={set:e,where:{}},this},t.prototype.where=function(e,t){if(!this.currentUpdate)throw new Error("必须先调用 set() 方法");return"object"==typeof e?this.currentUpdate.where=v(v({},this.currentUpdate.where),e):this.currentUpdate.where[e]=t,this},t.prototype.and=function(){return this.currentUpdate&&(this.params.update.push(this.currentUpdate),this.currentUpdate=null),this},t.prototype.setBatch=function(e){var t;return(t=this.params.update).push.apply(t,b(e)),this},t.prototype.build=function(){return this.currentUpdate&&(this.params.update.push(this.currentUpdate),this.currentUpdate=null),this.params},t}(j);function V(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}}function Y(e){return v({},e||{})}function $(e,t){var r=t.toLowerCase();return Object.keys(e).some((function(e){return e.toLowerCase()===r}))}function J(e){try{return JSON.parse(e)}catch(e){return}}function Q(e){return y(this,void 0,void 0,(function(){var t,r,n,o,i,a,u,s,l,c,f,d,h;return g(this,(function(p){switch(p.label){case 0:t=V(),r=(e.method||"GET").toUpperCase(),n="number"==typeof e.timeoutMs&&e.timeoutMs>0?e.timeoutMs:15e3,o=Y(e.headers),i=void 0!==e.data&&null!==e.data,a=void 0,i&&("string"==typeof e.data||void 0!==t.FormData&&e.data instanceof t.FormData||void 0!==t.Blob&&e.data instanceof t.Blob||void 0!==t.ArrayBuffer&&e.data instanceof t.ArrayBuffer?a=e.data:($(o,"content-type")||(o["Content-Type"]="application/json"),a=JSON.stringify(e.data))),u=void 0!==t.AbortController?new t.AbortController:null,s=u?setTimeout((function(){return u.abort()}),n):null,p.label=1;case 1:return p.trys.push([1,,4,5]),[4,t.fetch(e.url,{method:r,headers:o,body:a,redirect:!1===e.followRedirects?"manual":"follow",signal:u?u.signal:void 0})];case 2:return[4,(l=p.sent()).text()];case 3:c=p.sent(),f={};try{l.headers.forEach((function(e,t){f[t.toLowerCase()]=e}))}catch(e){}return d=f["content-type"]||"",h=d.includes("application/json")?J(c):void 0,[2,{status:l.status,headers:f,body:c,json:h}];case 4:return s&&clearTimeout(s),[7];case 5:return[2]}}))}))}function K(e,t){var r,n={http:(r=(0,eval)("require"))("http"),https:r("https")},o=n.http,i=n.https,a=V(),u=a.URL,s="function"==typeof u?new u(e.url):null,l=(s?"https:"===s.protocol:String(e.url).startsWith("https://"))?i:o,c=(e.method||"GET").toUpperCase(),f="number"==typeof e.timeoutMs&&e.timeoutMs>0?e.timeoutMs:15e3,d=Y(e.headers),h=void 0!==e.data&&null!==e.data,p=void 0;if(h&&(void 0!==a.Buffer&&a.Buffer&&"function"==typeof a.Buffer.isBuffer&&a.Buffer.isBuffer(e.data)||"string"==typeof e.data?p=e.data:($(d,"content-type")||(d["Content-Type"]="application/json"),p=JSON.stringify(e.data)),null!=p&&!$(d,"content-length")))try{var y="string"==typeof p?a.Buffer.byteLength(p):p.length;d["Content-Length"]=String(y)}catch(e){}return new Promise((function(r,n){var o=l.request(e.url,{method:c,headers:d},(function(o){var i=Number(o.statusCode||0),u=function(e){var t,r,n={};try{for(var o=m(Object.entries(e||{})),i=o.next();!i.done;i=o.next()){var a=w(i.value,2),u=a[0],s=a[1];null!=s&&(n[String(u).toLowerCase()]=Array.isArray(s)?String(s.join(",")):String(s))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n}(o.headers||{}),s=!1!==e.followRedirects,l=301===i||302===i||303===i||307===i||308===i,f=u.location;if(s&&l&&f&&t<5){o.resume();var d=function(e,t){var r=V().URL;return"function"==typeof r?new r(t,e).toString():t}(e.url,f),h=303===i?"GET":c,p=v(v({},e),{url:d,method:h});return 303===i&&(p.data=void 0),void K(p,t+1).then(r,n)}var y=[];o.on("data",(function(e){return y.push(e)})),o.on("end",(function(){var e=void 0!==a.Buffer&&a.Buffer&&"function"==typeof a.Buffer.concat?a.Buffer.concat(y):y.join?y.join(""):"",t="string"==typeof e?e:e.toString("utf8"),n=(u["content-type"]||"").includes("application/json")?J(t):void 0;r({status:i,headers:u,body:t,json:n})}))}));o.on("error",(function(e){return n(e)})),o.setTimeout(f,(function(){return o.destroy(new Error("Request timeout"))})),null!=p&&o.write(p),o.end()}))}var Z=new(function(){function e(){}return e.prototype.request=function(e){return y(this,void 0,void 0,(function(){return g(this,(function(t){if("function"==typeof V().fetch)return[2,Q(e)];if(r=V(),(n=r&&r.process)&&n.versions&&n.versions.node)return[2,K(e,0)];var r,n;throw new Error("No fetch available in current runtime")}))}))},e.prototype.get=function(e,t){return y(this,void 0,void 0,(function(){return g(this,(function(r){return[2,this.request(v(v({},t||{}),{url:e,method:"GET"}))]}))}))},e.prototype.post=function(e,t,r){return y(this,void 0,void 0,(function(){return g(this,(function(n){return[2,this.request(v(v({},r||{}),{url:e,method:"POST",data:t}))]}))}))},e}());function X(){var e=new Date;return String(e.getFullYear())+"年"+String(e.getMonth()+1)+"月"+String(e.getDate())+"日"+String(e.getHours())+":"+String(e.getMinutes())}function ee(e){return y(this,void 0,void 0,(function(){var t,r;return g(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),"https://fe-log-producer.jinbizhihui.com",[4,Z.post("https://fe-log-producer.jinbizhihui.com/log/save",e)];case 1:return t=n.sent(),console.log("[RequestLogger] 远程日志发送成功, result",t),[3,3];case 2:return r=n.sent(),console.error("[RequestLogger] 远程日志发送失败:",(null==r?void 0:r.message)||r),[3,3];case 3:return[2]}}))}))}function te(e){return y(this,void 0,void 0,(function(){var t,r,n;return g(this,(function(o){switch(o.label){case 0:t=e.req.header("content-type")||"",o.label=1;case 1:return o.trys.push([1,4,,5]),(r=e.req.raw)&&"function"==typeof r.clone?[4,r.clone().text()]:[3,3];case 2:if(!(n=o.sent()))return[2,void 0];if(t.includes("application/json"))try{return[2,JSON.parse(n)]}catch(e){return[2,n]}return[2,n];case 3:return[3,5];case 4:return o.sent(),[3,5];case 5:return[2,void 0]}}))}))}function re(e){var t={};try{e.res.headers.forEach((function(e,r){t[r]=e}))}catch(e){}return t}function ne(e,t,r){return y(this,void 0,void 0,(function(){var n,o,i,a,u,s,l,c,f,d;return g(this,(function(h){switch(h.label){case 0:return n=e.req.header("x-forwarded-for")||e.req.header("x-real-ip")||"unknown",o=e.req.method,i=e.req.url,a=e.req.query(),u=function(e){var t={};try{var r=e.req.raw,n=null==r?void 0:r.headers;n&&n.forEach((function(e,r){t[r]=e}))}catch(e){}return t}(e),[4,te(e)];case 1:return s=h.sent(),l=X(),c=Date.now(),[4,t()];case 2:return h.sent(),f=Date.now()-c,d={status:e.res.status,headers:re(e),duration:f},[4,ee({system:r,ip:n,path:i,method:o,time:l,params:{method:o,url:i,query:a,body:s},headers:u,result:d})];case 3:return h.sent(),[2]}}))}))}function oe(e){var t,r,n,o={};try{var i=(null===(n=e.response)||void 0===n?void 0:n.headers)||{};try{for(var a=m(Object.entries(i)),u=a.next();!u.done;u=a.next()){var s=w(u.value,2),l=s[0],c=s[1];o[l]=String(c)}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}}catch(e){}return o}function ie(e,t,r){var n,o,i,a,u,s;return y(this,void 0,void 0,(function(){var l,c,f,d,h,p,v,y,b,S,A;return g(this,(function(g){switch(g.label){case 0:return l=e.ip||(null===(n=e.request)||void 0===n?void 0:n.ip)||"unknown",c=e.path||(null===(o=e.request)||void 0===o?void 0:o.path)||"",f=e.method||(null===(i=e.request)||void 0===i?void 0:i.method)||"",d=e.url||(null===(a=e.request)||void 0===a?void 0:a.url)||"",h=e.query||(null===(u=e.request)||void 0===u?void 0:u.query)||{},p=(null===(s=e.request)||void 0===s?void 0:s.body)||{},v=function(e){var t,r,n,o={};try{var i=e.headers||(null===(n=e.request)||void 0===n?void 0:n.headers)||{};try{for(var a=m(Object.entries(i)),u=a.next();!u.done;u=a.next()){var s=w(u.value,2),l=s[0],c=s[1];o[l]=String(c)}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}}catch(e){}return o}(e),y=X(),b=Date.now(),[4,t()];case 1:return g.sent(),S=Date.now()-b,A={status:e.status,body:e.body,headers:oe(e),duration:S},[4,ee({system:r,ip:l,path:c,method:f,time:y,params:{method:f,url:d,query:h,body:p},headers:v,result:A})];case 2:return g.sent(),[2]}}))}))}function ae(e){var t,r,n,o={};try{var i=(null===(n=e.getHeaders)||void 0===n?void 0:n.call(e))||{};try{for(var a=m(Object.entries(i)),u=a.next();!u.done;u=a.next()){var s=w(u.value,2),l=s[0],c=s[1];void 0!==c&&(o[l]=String(c))}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}}catch(e){}return o}function ue(e,t,r){return y(this,void 0,void 0,(function(){var n,o,i,a,u,s,l,c,f,d;return g(this,(function(h){switch(h.label){case 0:return n=e.headers["x-forwarded-for"]||e.headers["x-real-ip"]||e.ip||"unknown",o=e.url||"",i=e.method||"",a=e.query||{},u=e.body||{},s=function(e){var t,r,n={};try{var o=e.headers||{};try{for(var i=m(Object.entries(o)),a=i.next();!a.done;a=i.next()){var u=w(a.value,2),s=u[0],l=u[1];n[s]=String(l)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}}catch(e){}return n}(e),l=X(),c=Date.now(),f=Date.now()-c,d={status:t.statusCode,headers:ae(t),duration:f},[4,ee({system:r,ip:n,path:o,method:i,time:l,params:{method:i,url:o,query:a,body:u},headers:s,result:d})];case 1:return h.sent(),[2]}}))}))}function se(e){var t=e.replace("#","").match(/../g);return t?t.map((function(e){return parseInt(e,16)})):[0,0,0]}function le(e,t,r){var n=function(e){var t=e.toString(16);return 1===t.length?"0"+t:t};return"#"+n(e)+n(t)+n(r)}function ce(e,t){return!("undefined"==typeof window||!e)&&!!e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}var fe,de=function(){function e(e){this.ws=null,this.reconnectAttempts=0,this.heartbeatTimer=null,this.listeners=new Map,this.opts={url:e.url,reconnectAttemptsLimit:e.reconnectAttemptsLimit||5,reconnectInterval:e.reconnectInterval||5e3,heartbeatInterval:e.heartbeatInterval||3e4,registerMessage:e.registerMessage}}return Object.defineProperty(e.prototype,"url",{get:function(){return this.opts.url},enumerable:!1,configurable:!0}),e.prototype.on=function(e,t){this.listeners.has(e)||this.listeners.set(e,new Set);var r=this.listeners.get(e);return r.add(t),function(){return r.delete(t)}},e.prototype.emit=function(e,t){var r=this.listeners.get(e);r&&r.forEach((function(e){try{e(t)}catch(e){}}))},e.prototype.connect=function(){try{this.ws=new WebSocket(this.opts.url),this.setupEventListeners()}catch(e){this.emit("error",{message:"WebSocket create failed"})}},e.prototype.setupEventListeners=function(){var e=this;this.ws&&(this.ws.onopen=function(){e.reconnectAttempts=0,e.opts.registerMessage&&e.send(e.opts.registerMessage),e.startHeartbeat(),e.emit("connected",!0)},this.ws.onmessage=function(t){try{var r=JSON.parse(t.data);e.emit("message",r)}catch(t){e.emit("error",{message:"Message parse failed"})}},this.ws.onclose=function(){e.stopHeartbeat(),e.emit("connected",!1),e.emit("closed",void 0),e.reconnect()},this.ws.onerror=function(){e.emit("error",{message:"WebSocket error"})})},e.prototype.send=function(e){if(this.ws&&1===this.ws.readyState)try{this.ws.send(JSON.stringify(e))}catch(e){}},e.prototype.startHeartbeat=function(){var e=this;this.stopHeartbeat(),this.heartbeatTimer=setInterval((function(){e.send({type:"ping"})}),this.opts.heartbeatInterval)},e.prototype.stopHeartbeat=function(){null!=this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)},e.prototype.reconnect=function(){var e=this;this.reconnectAttempts<this.opts.reconnectAttemptsLimit&&(this.reconnectAttempts++,setTimeout((function(){e.connect()}),this.opts.reconnectInterval))},e.prototype.disconnect=function(){if(this.stopHeartbeat(),this.ws)try{this.ws.close()}catch(e){}this.ws=null},Object.defineProperty(e.prototype,"isConnected",{get:function(){return!!this.ws&&1===this.ws.readyState},enumerable:!1,configurable:!0}),e}(),he=function(){function e(){this.initialized=!1,this.manager=null}return e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e.prototype.init=function(e){return y(this,void 0,void 0,(function(){return g(this,(function(t){return this.initialized||(this.manager=new de(e),this.manager.connect(),this.initialized=!0),[2]}))}))},e.prototype.destroy=function(){this.manager&&this.manager.disconnect(),this.manager=null,this.initialized=!1},e.prototype.getManager=function(){return this.manager},e}().getInstance(),pe=new(function(){function e(){this.listeners=new Map}return e.prototype.on=function(e,t){this.listeners.has(e)||this.listeners.set(e,new Set);var r=this.listeners.get(e);return r.add(t),function(){return r.delete(t)}},e.prototype.off=function(e,t){var r=this.listeners.get(e);r&&r.delete(t)},e.prototype.emit=function(e,t){var r=this.listeners.get(e);r&&r.forEach((function(e){try{e(t)}catch(e){}}))},e}()),ve={UP:c.default.ROUND_UP,DOWN:c.default.ROUND_DOWN,CEIL:c.default.ROUND_CEIL,FLOOR:c.default.ROUND_FLOOR,HALF_UP:c.default.ROUND_HALF_UP,HALF_DOWN:c.default.ROUND_HALF_DOWN,HALF_EVEN:c.default.ROUND_HALF_EVEN,HALF_CEIL:c.default.ROUND_HALF_CEIL,HALF_FLOOR:c.default.ROUND_HALF_FLOOR},ye={DECIMAL_PLACES:2,CURRENCY_SYMBOL:"¥",THOUSANDS_SEPARATOR:",",DECIMAL_SEPARATOR:".",ROUNDING_MODE:c.default.ROUND_HALF_UP},ge=function(){function e(e){e instanceof c.default?this.value=e:this.value=new c.default(String(e))}return e.prototype.add=function(t){var r=this.toDecimalValue(t);return new e(this.value.plus(r))},e.prototype.subtract=function(t){var r=this.toDecimalValue(t);return new e(this.value.minus(r))},e.prototype.multiply=function(t){return new e(this.value.times(String(t)))},e.prototype.divide=function(t){return new e(this.value.dividedBy(String(t)))},e.prototype.mod=function(t){return new e(this.value.modulo(String(t)))},e.prototype.abs=function(){return new e(this.value.abs())},e.prototype.negate=function(){return new e(this.value.negated())},e.prototype.round=function(t,r){return void 0===t&&(t=ye.DECIMAL_PLACES),void 0===r&&(r=ye.ROUNDING_MODE),new e(this.value.toDecimalPlaces(t,r))},e.prototype.ceil=function(t){return void 0===t&&(t=ye.DECIMAL_PLACES),new e(this.value.toDecimalPlaces(t,c.default.ROUND_UP))},e.prototype.floor=function(t){return void 0===t&&(t=ye.DECIMAL_PLACES),new e(this.value.toDecimalPlaces(t,c.default.ROUND_DOWN))},e.prototype.truncate=function(t){return void 0===t&&(t=ye.DECIMAL_PLACES),new e(this.value.toDecimalPlaces(t,c.default.ROUND_DOWN))},e.prototype.isGreaterThan=function(e){var t=this.toDecimalValue(e);return this.value.greaterThan(t)},e.prototype.isGreaterThanOrEqualTo=function(e){var t=this.toDecimalValue(e);return this.value.greaterThanOrEqualTo(t)},e.prototype.isLessThan=function(e){var t=this.toDecimalValue(e);return this.value.lessThan(t)},e.prototype.isLessThanOrEqualTo=function(e){var t=this.toDecimalValue(e);return this.value.lessThanOrEqualTo(t)},e.prototype.equals=function(e){var t=this.toDecimalValue(e);return this.value.equals(t)},e.prototype.isZero=function(){return this.value.isZero()},e.prototype.isPositive=function(){return this.value.isPositive()},e.prototype.isNegative=function(){return this.value.isNegative()},e.prototype.toString=function(){return this.value.toString()},e.prototype.toFixedString=function(e,t){return void 0===e&&(e=ye.DECIMAL_PLACES),void 0===t&&(t=ye.ROUNDING_MODE),this.value.toDecimalPlaces(e,t).toFixed(e)},e.prototype.toNumber=function(){return this.value.toNumber()},e.prototype.toDecimal=function(){return this.value},e.prototype.format=function(e){var t=e||{},r=t.symbol,n=void 0===r?ye.CURRENCY_SYMBOL:r,o=t.decimalPlaces,i=void 0===o?ye.DECIMAL_PLACES:o,a=t.thousandsSeparator,u=void 0===a?ye.THOUSANDS_SEPARATOR:a,s=t.decimalSeparator,l=void 0===s?ye.DECIMAL_SEPARATOR:s,c=t.symbolPosition,f=void 0===c?"prefix":c,d=t.roundingMode,h=void 0===d?ye.ROUNDING_MODE:d,p=w(this.value.toDecimalPlaces(i,h).toFixed(i).split("."),2),v=p[0],y=p[1],g=void 0===y?"":y,m=u?v.replace(/\B(?=(\d{3})+(?!\d))/g,u):v,b=i>0?""+m+l+g:m;return"prefix"===f?""+n+b:""+b+n},e.prototype.allocate=function(t){if(0===t.length)throw new Error("分配比例数组不能为空");if(t.some((function(e){return e<0})))throw new Error("分配比例不能为负数");var r=t.reduce((function(e,t){return e+t}),0);if(0===r)throw new Error("分配比例总和不能为零");for(var n=[],o=this.value,i=0;i<t.length-1;i++){var a=new c.default(t[i]),u=this.value.times(a).dividedBy(r).toDecimalPlaces(ye.DECIMAL_PLACES,c.default.ROUND_DOWN);n.push(new e(u)),o=o.minus(u)}return n.push(new e(o)),n},e.prototype.percentage=function(t,r){return void 0===r&&(r=ye.DECIMAL_PLACES),new e(this.value.times(String(t)).dividedBy(100).toDecimalPlaces(r,c.default.ROUND_HALF_UP))},e.prototype.applyDiscount=function(t,r,n){var o;return void 0===r&&(r=!1),void 0===n&&(n=ye.DECIMAL_PLACES),o=r?new c.default(100).minus(String(t)).dividedBy(100):new c.default(String(t)),new e(this.value.times(o).toDecimalPlaces(n,c.default.ROUND_HALF_UP))},e.prototype.toDecimalValue=function(t){return t instanceof e?t.value:new c.default(String(t))},e}(),me=function(e){var t,r;if(!Array.isArray(e))return console.warn("tree must be an array"),[];if(!e||0===e.length)return[];var n=[];try{for(var o=m(e),i=o.next();!i.done;i=o.next()){var a=i.value;a.children&&a.children.length>0&&me(a.children),void 0!==a.uniqueId&&n.push(a.uniqueId)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n},we=function(e,t){if(void 0===t&&(t=[]),!Array.isArray(e))return console.warn("menuTree must be an array"),[];if(!e||0===e.length)return[];for(var r=0;r<e.length;r++){var n=e[r];n.children&&1===n.children.length&&delete n.children,n.id=r,n.parentId=t.length?t[t.length-1]:null,n.pathList=b(t,[n.id]),n.uniqueId=n.pathList.length>1?n.pathList.join("-"):n.pathList[0],n.children&&n.children.length>0&&we(n.children,n.pathList)}return e},be=function(e,t){if(void 0===t&&(t=[]),!Array.isArray(e))return console.warn("tree must be an array"),[];if(!e||0===e.length)return[];for(var r=0;r<e.length;r++){var n=e[r];n.id=r,n.parentId=t.length?t[t.length-1]:null,n.pathList=b(t,[n.id]),n.children&&n.children.length>0&&be(n.children,n.pathList)}return e},Se=function(e,t){if(Array.isArray(e)){if(e&&0!==e.length){var r=e.find((function(e){return e.uniqueId===t}));if(r)return r;var n=e.filter((function(e){return e.children})).map((function(e){return e.children})).flat(1);return Se(n,t)}}else console.warn("menuTree must be an array")},Ae=function(e,t,r){var n,o;if(!Array.isArray(e))return console.warn("menuTree must be an array"),[];if(!e||0===e.length)return[];try{for(var i=m(e),a=i.next();!a.done;a=i.next()){var u=a.value,s=u.children&&u.children.length>0;u.uniqueId===t&&"[object Object]"===Object.prototype.toString.call(r)&&Object.assign(u,r),s&&u.children&&Ae(u.children,t,r)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return e},Ee={},Ce={},Me=null!==(fe=f.default[86])&&void 0!==fe?fe:{},Te=[];e.provinceAndCityData=[];Ee[""]="全部",Object.keys(Me).forEach((function(e){var t=Me[e];Te.push({value:e,label:t}),Ee[e]=t,Ce[t]={code:e},Ce[t]["全部"]={code:""}})),Te.forEach((function(e){var t,r=e.value,n=e.label,o=[],i=null!==(t=f.default[r])&&void 0!==t?t:{};Object.keys(i).forEach((function(e){o.push({value:e,label:i[e]}),Ee[e]=i[e];var t=Ce[n];t[i[e]]={code:e},t[i[e]]["全部"]={code:""}})),o.length&&(e.children=o)})),e.provinceAndCityData=i.cloneDeep(Te),Te.forEach((function(e){var t=e.children,r=e.label;t&&t.forEach((function(e){var t,n=e.value,o=e.label,i=[],a=null!==(t=f.default[n])&&void 0!==t?t:{};Object.keys(a).forEach((function(e){i.push({value:e,label:a[e]}),Ee[e]=a[e];var t=Ce[r],n=null==t?void 0:t[o];n&&(n[a[e]]={code:e})})),i.length&&(e.children=i)}))}));var De=i.cloneDeep(e.provinceAndCityData);De.unshift({value:"",label:"全部"}),De.forEach((function(e){var t=e.children;(null==t?void 0:t.length)&&(t.unshift({value:"",label:"全部"}),t.forEach((function(e){var t=e.children;(null==t?void 0:t.length)&&t.unshift({value:"",label:"全部"})})))}));var Oe=i.cloneDeep(Te);function xe(e){if(!e)return null;var t=e.indexOf("#");return-1!==t?e.substring(t+1):e}function Le(e){if(!e)return null;var t=e.indexOf("#");if(-1!==t){var r=e.substring(t+1);return r.startsWith("/saas/")?null:r}return null}Oe.unshift({value:"",label:"全部"}),Oe.forEach((function(e){var t=e.children;(null==t?void 0:t.length)&&(t.unshift({value:"",label:"全部"}),t.forEach((function(e){var t=e.children;(null==t?void 0:t.length)&&t.unshift({value:"",label:"全部"})})))}));var Ne=d.default();var Re={maxFileSize:524288e3,maxTotalSize:5368709120,allowedTypes:[],maxFilesCount:100,checkNetwork:!0,checkQuota:!1};function Be(e,t){if(void 0===t&&(t=Re.maxFileSize),e.size>t){var r=Math.round(t/1024/1024),n=Math.round(e.size/1024/1024);return{valid:!1,code:"FILE_SIZE_EXCEEDED",error:'文件 "'+e.name+'" 大小 '+n+"MB 超过限制 "+r+"MB"}}return{valid:!0}}function Ie(e,t){void 0===t&&(t=Re.maxTotalSize);var r=e.reduce((function(e,t){return e+t.size}),0);if(r>t){var n=(t/1024/1024/1024).toFixed(2);return{valid:!1,code:"TOTAL_SIZE_EXCEEDED",error:"总文件大小 "+(r/1024/1024/1024).toFixed(2)+"GB 超过限制 "+n+"GB"}}return{valid:!0}}function Pe(e,t){var r;if(void 0===t&&(t=[]),0===t.length)return{valid:!0};var n=e.type.toLowerCase(),o=null===(r=e.name.split(".").pop())||void 0===r?void 0:r.toLowerCase();return t.some((function(e){return e.toLowerCase()===n||e.toLowerCase()==="."+o||e.toLowerCase()===o}))?{valid:!0}:{valid:!1,code:"FILE_TYPE_NOT_ALLOWED",error:'文件 "'+e.name+'" 类型不支持。允许的类型: '+t.join(", ")}}function Fe(e,t,r){void 0===r&&(r=Re.maxFilesCount);var n=e+t;return n>r?{valid:!1,code:"FILES_COUNT_EXCEEDED",error:"文件数量超过限制(当前 "+e+" + 新增 "+t+" = "+n+",最大 "+r+")"}:{valid:!0}}function Ue(){var e;if(!navigator.onLine)return{valid:!1,code:"NETWORK_OFFLINE",error:"网络连接已断开,请检查网络后重试"};var t=navigator,r=t.connection||t.mozConnection||t.webkitConnection;if(r){var n=null!==(e=r.effectiveType)&&void 0!==e?e:"";if(["slow-2g","2g"].includes(n))return{valid:!0,code:"NETWORK_SLOW",error:"当前网络速度较慢,上传可能需要较长时间"}}return{valid:!0}}function _e(e){return y(this,void 0,void 0,(function(){var t,r,n,o;return g(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,new Promise((function(e){return setTimeout(e,100)}))];case 1:return i.sent(),e>(t={used:1073741824,total:10737418240,available:9663676416}).available?(r=(e/1024/1024/1024).toFixed(2),n=(t.available/1024/1024/1024).toFixed(2),[2,{valid:!1,code:"QUOTA_EXCEEDED",error:"存储空间不足。需要 "+r+"GB,剩余 "+n+"GB"}]):[2,{valid:!0}];case 2:return o=i.sent(),console.error("检查配额失败:",o),[2,{valid:!0,code:"QUOTA_CHECK_FAILED",error:"无法检查存储配额,将继续上传"}];case 3:return[2]}}))}))}var ke=function(){function e(e,t){void 0===e&&(e=10),void 0===t&&(t=3),this.speedPoints=[],this.startTime=0,this.totalBytes=0,this.windowSize=e,this.minPoints=t}return e.prototype.start=function(e){this.startTime=Date.now(),this.totalBytes=e,this.speedPoints=[],this.addPoint(0)},e.prototype.addPoint=function(e){var t=Date.now();this.speedPoints.push({timestamp:t,uploadedBytes:e});var r=1e3*this.windowSize;this.speedPoints=this.speedPoints.filter((function(e){return t-e.timestamp<=r}))},e.prototype.getCurrentSpeed=function(){if(this.speedPoints.length<this.minPoints)return 0;var e=this.speedPoints[0],t=this.speedPoints[this.speedPoints.length-1],r=(t.timestamp-e.timestamp)/1e3,n=t.uploadedBytes-e.uploadedBytes;return 0===r?0:n/r},e.prototype.getAverageSpeed=function(){if(0===this.startTime||0===this.speedPoints.length)return 0;var e=(Date.now()-this.startTime)/1e3,t=this.speedPoints[this.speedPoints.length-1].uploadedBytes;return 0===e?0:t/e},e.prototype.getRemainingTime=function(e){var t=this.getCurrentSpeed();return 0===t?-1:(this.totalBytes-e)/t},e.formatSpeed=function(e){if(0===e)return"0 B/s";var t=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,t)).toFixed(2))+" "+["B/s","KB/s","MB/s","GB/s"][t]},e.formatRemainingTime=function(e){if(e<0||!isFinite(e))return"计算中...";if(e<60)return Math.ceil(e)+" 秒";var t=Math.floor(e/60);if(t<60)return t+" 分钟";var r=Math.floor(t/60),n=t%60;if(r<24)return n>0?r+" 小时 "+n+" 分钟":r+" 小时";var o=Math.floor(r/24),i=r%24;return i>0?o+" 天 "+i+" 小时":o+" 天"},e.prototype.getProgress=function(e){return 0===this.totalBytes?0:Math.min(100,e/this.totalBytes*100)},e.prototype.reset=function(){this.speedPoints=[],this.startTime=0,this.totalBytes=0},e}(),je=function(){function e(){this.calculators=new Map}return e.prototype.getCalculator=function(e){return this.calculators.has(e)||this.calculators.set(e,new ke),this.calculators.get(e)},e.prototype.removeCalculator=function(e){this.calculators.delete(e)},e.prototype.clear=function(){this.calculators.clear()},e.prototype.getTotalSpeed=function(){var e,t,r=0;try{for(var n=m(this.calculators.values()),o=n.next();!o.done;o=n.next()){r+=o.value.getCurrentSpeed()}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return r},e}(),qe=new je;Object.defineProperty(e,"Decimal",{enumerable:!0,get:function(){return c.default}}),e.ApiBuilder=q,e.CodeToText=Ee,e.InsertBuilder=W,e.Money=ge,e.QueryBuilder=H,e.RoundingMode=ve,e.SpeedCalculatorManager=je,e.TextToCode=Ce,e.UpdateBuilder=G,e.UploadSpeedCalculator=ke,e.WebsocketManager=de,e.addClass=function(e,t){"undefined"!=typeof window&&e&&(ce(e,t)||(e.className+=" "+t))},e.addDays=function(e,t,r){if(void 0===t&&(t=0),void 0===r&&(r="yyyy-MM-dd"),A(e))return"-";e=D(e);var n=new Date(e);return n.setDate(n.getDate()+Number(t)),O(n,r)},e.appendFieldByUniqueId=Ae,e.base64ToBlob=function(e){for(var t=e.split(","),r=t[0].match(/:(.\*?);/)[1],n=atob(t[1]),o=n.length,i=new Uint8Array(o);o--;)i[o]=n.charCodeAt(o);return new Blob([i],{type:r})},e.base64ToFile=function(e,t){for(var r=e.split(","),n=r[0].match(/:(.*);/)[1],o=atob(r[1]),i=o.length,a=new Uint8Array(i);i--;)a[i]=o.charCodeAt(i);return new File([a],t,{type:n})},e.blobToDataURL=F,e.buildHierarchyTree=be,e.buildUUID=function(){for(var e=[],t=0;t<=15;t++)e[t]=t.toString(16);var r="";for(t=1;t<=36;t++)r+=9===t||14===t||19===t||24===t?"-":15===t?4:20===t?e[4*Math.random()|8]:e[16*Math.random()|0];return r.replace(/-/g,"")},e.calcFileSize=I,e.ceil=N,e.checkNetworkStatus=Ue,e.checkStorageQuota=_e,e.clearLoginData=function(){localStorage.removeItem("wecom_userinfo"),localStorage.removeItem("wecom_token"),localStorage.removeItem("projectActive"),localStorage.removeItem("loginTime"),localStorage.removeItem("projectInfo")},e.compatibleDate=D,e.compressImg=function(e,t,r){return new Promise((function(n,o){var i=parseFloat((e.size/1024/1024).toString()),a=new FileReader;a.onload=function(a){var u=new Image;u.onload=function(){var o=u.width,a=u.height,s=document.createElement("canvas"),l=s.getContext("2d"),c=t?t(o,a):1;(Number.isNaN(c)||"number"!=typeof c)&&(c=1);var f=r?r(i,c,o,a):1;if((Number.isNaN(f)||"number"!=typeof f)&&(f=1),l){var d=parseInt((o*c).toString(),10),h=parseInt((a*c).toString(),10);s.setAttribute("width",d.toString()),s.setAttribute("height",h.toString()),l.drawImage(u,0,0,d,h)}var p=s.toDataURL(e.type,f);n(P(p))},u.onerror=function(e){o(e)},a.target&&(u.src=a.target.result)},a.onerror=function(e){o(e)},a.readAsDataURL(e)}))},e.computeMoney=B,e.convertBase64UrlToBlob=function(e){for(var t=window.atob(e.split(",")[1]),r=new ArrayBuffer(t.length),n=new Uint8Array(r),o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return new Blob([r],{type:"image/png"})},e.convertCurrency=function(e){if(void 0===e&&(e=""),A(e))return"";if(Number(e)>=1e15)return e;var t,r,n,o=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],i=["","拾","佰","仟"],a=["","万","亿","兆"],u=["角","分","毫","厘"],s="";if("0"===(e=parseFloat(e).toString()))return s=o[0]+"元整";if(-1===(e=e.toString()).indexOf(".")?(t=e,r=""):(t=(n=e.split("."))[0],r=n[1].substr(0,4)),parseInt(t,10)>0){for(var l=0,c=t.length,f=0;f<c;f+=1){var d=t.substr(f,1),h=c-f-1,p=h/4,v=h%4;"0"===d?l+=1:(l>0&&(s+=o[0]),l=0,s+=o[parseInt(d,10)]+i[v]),0===v&&l<4&&(s+=a[p])}s+="元"}if(""!==r){var y=r.length;for(f=0;f<y;f+=1){var g=r.substr(f,1);"0"!==g&&(s+=o[Number(g)]+u[f])}}return""===s?s+=o[0]+"元整":""===r&&(s+="整"),s},e.convertTextToCode=function(e,t,r){var n,o,i,a="";if(e&&Ce[e]){var u=Ce[e];if(a=null!==(n=u.code)&&void 0!==n?n:"",t&&u[t]){var s=u[t];if(a=a+("全部"===t?"":", ")+(null!==(o=s.code)&&void 0!==o?o:""),r&&s[r])a=a+("全部"===r?"":", ")+(null!==(i=s[r].code)&&void 0!==i?i:"")}}return a},e.copyTextToClipboard=function(e){if("undefined"==typeof window||"undefined"==typeof document)return!1;var t=document.createElement("textarea"),r=document.activeElement;t.value=e,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",t.style.fontSize="12pt",t.style.border="0",t.style.padding="0",t.style.margin="0";var n=document.getSelection(),o=null;n&&n.rangeCount>0&&(o=n.getRangeAt(0)),document.body.appendChild(t),t.select(),t.selectionStart=0,t.selectionEnd=e.length;var i=!1;try{i=document.execCommand("copy")}catch(e){console.error("复制失败:",e)}return t.remove(),o&&n&&(n.removeAllRanges(),n.addRange(o)),r&&r.focus(),i},e.createWebSocketStore=function(e){return void 0===e&&(e="websocket"),r.defineStore(e,{state:function(){return{isConnected:!1,wsManager:null,messages:[],connectionError:null}},getters:{connectionStatus:function(e){return e.isConnected?"已连接":"未连接"},lastMessage:function(e){return e.messages[e.messages.length-1]||null}},actions:{connect:function(e){var t;return y(this,void 0,void 0,(function(){return g(this,(function(r){return(null===(t=this.wsManager)||void 0===t?void 0:t.isConnected)||(this.wsManager=new de(e),this.setupEventListeners(),this.wsManager.connect()),[2]}))}))},setupEventListeners:function(){var e=this;this.wsManager&&(this.wsManager.on("connected",(function(t){e.isConnected=t,t&&(e.connectionError=null),pe.emit("websocket-connected",t)})),this.wsManager.on("message",(function(t){e.addMessage(t),pe.emit("websocket-message",t)})),this.wsManager.on("error",(function(t){e.connectionError=(null==t?void 0:t.message)||"WebSocket error",pe.emit("websocket-error",{message:e.connectionError})})),this.wsManager.on("closed",(function(){e.isConnected=!1,pe.emit("websocket-closed",void 0)})))},sendMessage:function(e){var t;null===(t=this.wsManager)||void 0===t||t.send(e)},addMessage:function(e){var t=v(v({},e),{timestamp:Date.now(),id:Math.random().toString(36).substring(2,11)});this.messages.push(t),this.messages.length>100&&this.messages.shift()},clearMessages:function(){this.messages=[]},disconnect:function(){var e;null===(e=this.wsManager)||void 0===e||e.disconnect(),this.wsManager=null,this.isConnected=!1,this.connectionError=null},reset:function(){this.disconnect(),this.clearMessages()}}})},e.darken=function(e,t){var r=se(e).map((function(e){return Math.floor(e*(1-t))}));return le(r[0],r[1],r[2])},e.dataURLtoBlob=P,e.deepEqual=function e(t,r){var n=Object.keys,o=typeof t;return t&&r&&"object"===o&&o===typeof r?n(t).length===n(r).length&&n(t).every((function(n){return e(t[n],r[n])})):t===r},e.delay=function(e){return new Promise((function(t){return setTimeout(t,e)}))},e.deleteChildren=we,e.deviceDetection=function(){if("undefined"==typeof window)return!1;var e=navigator.userAgent.toLowerCase(),t=/midp/i.test(e),r=/ucweb/i.test(e),n=/android/i.test(e),o=/iphone os/i.test(e),i=/windows ce/i.test(e),a=/windows mobile/i.test(e),u=/rv:1.2.3.4/i.test(e);return t||r||n||o||i||a||u},e.emitter=pe,e.encryptPassword=function(e){return u.sm3(e)},e.extractPathList=me,e.fileSizeFormat=function(e,t,r){if(void 0===t&&(t="B"),void 0===r&&(r="-"),A(e))return r;var n=I(parseFloat(e.toString()),t);return""+N(n.size,2)+n.unit},e.filterRepeat=function(e,t){var r=new Set;return e.filter((function(e){var n=e[t];return!r.has(n)&&(r.add(n),!0)}))},e.findNodePath=function(e,t,r,n){var o=[];try{for(var i=0;i<r.length;i++)U(r[i],e,t,n,o)}catch(e){return o}},e.floor=function(e,t){if(void 0===t&&(t=0),A(e))return e;var r=Math.pow(10,t),n=Number(e)*r;return Math.floor(n)/r},e.formatBank=function(e,t){return void 0===t&&(t=""),A(e)?t:e.toString().replace(/\s/g,"").replace(/(.{4})/g,"$1 ")},e.formatBytes=function(e,t){if(void 0===t&&(t=2),0===e)return"0 Bytes";var r=t<0?0:t,n=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,n)).toFixed(r))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][n]},e.formatCentsToYuan=function(e,t){return R(e,v({operation:"divide",factor:100,formatAsCurrency:!0},t))},e.formatEmptyValue=function(e,t){return void 0===t&&(t="-"),A(e)?t:e},e.formatFileSize=function(e){if(0===e)return"0 B";var t=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,t)).toFixed(2))+" "+["B","KB","MB","GB","TB"][t]},e.formatFloat=function(e,t){void 0===t&&(t=2);var r=parseFloat(String(e));if(Number.isNaN(r))return"";var n=(r=Math.round(Number(e)*Math.pow(10,t))/Math.pow(10,t)).toString(),o=n.indexOf(".");for(o<0&&(o=n.length,n+=".");n.length<=o+t;)n+="0";return n},e.formatMoney=R,e.formatPhone=function(e,t,r){if(void 0===t&&(t=" "),void 0===r&&(r="-"),A(e))return r;if(11!==e.toString().length)return e;var n=e.toString().replace(/[^\d]/g,"").split(""),o="";return n.forEach((function(e,r){3!==r&&7!==r||(o+=t),o+=e})),o},e.formatPhoneHide=function(e,t){if(void 0===t&&(t=""),A(e))return t;if(11!==e.toString().length)return e;var r=e.toString();return r.substr(0,3)+"****"+r.substr(7,11)},e.formatTime=O,e.formateTimestamp=function(e,t){if(void 0===t&&(t="YYYY年MM月DD日 hh:mm:ss"),!e)return"-";var r=new Date(e),n=r.getFullYear()+"",o=r.getMonth()+1,i=r.getDate(),a=r.getHours()>9?r.getHours():"0"+r.getHours(),u=r.getMinutes()>9?r.getMinutes():"0"+r.getMinutes(),s=r.getSeconds()>9?r.getSeconds():"0"+r.getSeconds();return t.replace("YYYY",n+"").replace("MM",o+"").replace("DD",i+"").replace("hh",a+"").replace("mm",u+"").replace("ss",s+"")},e.fromNow=function(e,t,r){if(void 0===t&&(t="yyyy年MM月dd日 HH时mm分ss秒"),void 0===r&&(r="-"),A(e))return r;e=D(e);var n=new Date(e),o=(Date.now()-n.getTime())/1e3;return o<0?e:o<30?"刚刚":o<3600?Math.ceil(o/60)+"分钟前":o<86400?Math.floor(o/3600)+"小时前":o<172800?"1天前":O(e,t)},e.genExportByBlob=function(e){var t=e.axiosRequest,r=e.notWithCredentials,n=void 0===r?[]:r;return function(e){var r=this,o=e.filename,i=e.url,a=e.data,u=void 0===a?{}:a,s=e.params,l=void 0===s?{}:s,c=e.method,f=void 0===c?"post":c;return new Promise((function(e,a){t({method:f,url:i,data:u,params:l,responseType:"blob",config:{withCredentials:n.some((function(e){return!i.includes(e)}))}}).then((function(t){return y(r,void 0,void 0,(function(){var r,n,i,u,s,l,c,f,d,h;return g(this,(function(p){switch(p.label){case 0:return"application/json"!==(r=null==t?void 0:t.data).type?[3,1]:((n=new FileReader).readAsText(r,"utf-8"),n.onload=function(){var e={};try{e=JSON.parse(n.result)}catch(t){e=r}a(e)},[3,3]);case 1:try{i=t.headers,u=i["content-disposition"],s=decodeURIComponent(u.split(";")[1].split("filename=")[1]),o&&!o.includes(".")?(l=s.split("."),c=l[l.length-1],o+="."+c):o||(o=s)}catch(e){o||(o="download.xlsx")}return f=new Blob([t.data]),d=document.createElement("a"),[4,F(f)];case 2:h=p.sent(),d.href=h,d.download=o,document.body.appendChild(d),d.click(),document.body.removeChild(d),e(t),p.label=3;case 3:return[2]}}))}))})).catch((function(e){a(e)}))}))}},e.generateEnglishLetters=function(){for(var e=[],t=65;t<91;t+=1)e.push(String.fromCharCode(t));return e},e.getCookie=function(e){for(var t="",r=document.cookie.split("; "),n=0;n<r.length;n++){var o=r[n].split("=");if(o[0]===e){t=o[1];break}}return t},e.getDeviceType=E,e.getEnvironment=function(){var e=window.navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i),t=/micromessenger/i.test(navigator.userAgent),r=/wxwork/i.test(navigator.userAgent);return r&&e?"com-wx-mobile":r&&!e?"com-wx-pc":t&&e?"wx-mobile":t&&!e?"wx-pc":"other"},e.getFileData=function(e){var t=w(e.split(","),2),r=t[0],n=void 0===r?"":r,o=t[1],i=void 0===o?"":o;return{name:decodeURIComponent(n),url:decodeURIComponent(i)}},e.getFromType=C,e.getIsComWx=function(){return/wxwork/i.test(navigator.userAgent)},e.getIsDevelopment=function(){var e=!1;return"uat2-h5-wecom.hengdayun.com"!==location.origin&&"127.0.0.1:8081"!==location.origin&&"localhost:8081"!==location.origin||(e=!0),e},e.getKeyList=function(e,t){var r,n;if(!Array.isArray(e))return[];var o=[];try{for(var i=m(e),a=i.next();!a.done;a=i.next()){var u=a.value;u&&void 0!==u[t]&&null!==u[t]&&o.push(u[t])}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return o},e.getMergedFieldCatalogByRoute=function(e,t){var r,n,o={},i=e.byRoutePath[t];i&&Object.assign(o,i);var a=e.routeToApis[t]||[];try{for(var u=m(a),s=u.next();!s.done;s=u.next()){var l=s.value,c=e.byResourceCode[l];c&&Object.assign(o,c)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return o},e.getNodeByUniqueId=Se,e.getQueryMap=function(e){var t,r;if(!/^(?:(https?|ftp|rtsp|mms|ws|wss):\/\/)?/i.test(e))return console.error(e+"不符合超链接规范"),{};var n=e.indexOf("?");if(-1===n)return{};var o=e.slice(n+1).split("&"),i={};try{for(var a=m(o),u=a.next();!u.done;u=a.next()){var s=w(u.value.split("="),2),l=s[0],c=s[1];l&&(i[l]=c||"")}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return i},e.getQueryString=function(e,t){var r=new RegExp("&{1}"+t+"\\=[a-zA-Z0-9_-]+","g"),n=e.replace(/\?/g,"&").match(r)[0];return n.substr(n.indexOf("=")+1)},e.getQueryVariable=function(e){for(var t=window.location.search.substring(1).split("&"),r=0;r<t.length;r++){var n=t[r].split("=");if(n[0]===e)return n[1]}return!1},e.getSvgInfo=function(e){if("undefined"==typeof window||"undefined"==typeof DOMParser)return e;try{var t=(new DOMParser).parseFromString(e,"image/svg+xml").querySelector("svg");if(!t)return e;var r=t.getAttribute("viewBox");if(!r)throw new Error("Invalid SVG string: Missing viewBox attribute.");var n=r.split(" ");return{width:parseInt(n[2],10),height:parseInt(n[3],10),body:Array.from(t.querySelectorAll("path")).map((function(e){return e.outerHTML})).join(" ")}}catch(t){return console.error("解析 SVG 失败:",t),e}},e.getTicket=function(){return localStorage.getItem("jsapiTicket")},e.getToken=M,e.getValidationErrorMessage=function(e){var t=e.filter((function(e){return!e.valid||"NETWORK_SLOW"===e.code}));return 0===t.length?"":t.map((function(e){return e.error})).join("\n")},e.getWecomToken=function(){return localStorage.getItem("wecom_token")},e.handleFlatStr=function(e,t){void 0===e&&(e="state");var r=function(e,t){void 0===t&&(t="state");for(var r,n=e;"string"==typeof n;)try{r=n,n=decodeURIComponent(n),n=JSON.parse(n)}catch(e){n=r;break}for(;n&&"object"==typeof n&&t in n&&("string"==typeof n[t]||"object"==typeof n[t]);)if("string"==typeof(n=n[t]))try{n=decodeURIComponent(n),n=JSON.parse(n)}catch(e){break}return n}(t,e);return"object"==typeof r?JSON.stringify(r):String(r)},e.handleTree=function(e,t,r,n){var o,i,a,u,s,l,c,f,d;if(!Array.isArray(e))return console.warn("data must be an array"),[];var h=t||"id",p=r||"parentId",v=n||"children",y={},g={},w=[];try{for(var b=m(e),S=b.next();!S.done;S=b.next()){var A=S.value,E=String(null!==(c=A[p])&&void 0!==c?c:""),C=String(null!==(f=A[h])&&void 0!==f?f:"");null==y[E]&&(y[E]=[]),g[C]=A,y[E].push(A)}}catch(e){o={error:e}}finally{try{S&&!S.done&&(i=b.return)&&i.call(b)}finally{if(o)throw o.error}}try{for(var M=m(e),T=M.next();!T.done;T=M.next()){A=T.value;null==g[E=String(null!==(d=A[p])&&void 0!==d?d:"")]&&w.push(A)}}catch(e){a={error:e}}finally{try{T&&!T.done&&(u=M.return)&&u.call(M)}finally{if(a)throw a.error}}try{for(var D=m(w),O=D.next();!O.done;O=D.next()){x(O.value)}}catch(e){s={error:e}}finally{try{O&&!O.done&&(l=D.return)&&l.call(D)}finally{if(s)throw s.error}}function x(e){var t,r,n,o=String(null!==(n=e[h])&&void 0!==n?n:"");null!==y[o]&&(e[v]=y[o]);var i=e[v];if(i&&Array.isArray(i))try{for(var a=m(i),u=a.next();!u.done;u=a.next()){x(u.value)}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}}return w},e.hasClass=ce,e.hexToRgb=se,e.hideTextAtIndex=function(e,t,r){var n,o;void 0===r&&(r="*"),"number"==typeof e&&(e=e.toString()),Array.isArray(t)||(t=[t]);var i=e.split("");try{for(var a=m(t),u=a.next();!u.done;u=a.next()){var s=u.value;if("object"!=typeof s||Array.isArray(s))"number"==typeof s&&Number.isInteger(s)&&s>=0&&s<i.length&&(i[s]=r);else{var l=s.start,c=s.end;l>=0&&l<c&&c<i.length&&i.fill(r,l,c+1)}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}return i.join("")},e.http=function(e){var t=e.cacheType,r=e.currentMode,n=e.errorCb,o=e.getTokenCb;return e.tokenKey,k.interceptors.request.use((function(e){return y(void 0,void 0,void 0,(function(){var r,n;return g(this,(function(o){return r=M(t),n=E(),e.headers.Authorization=r,e.headers.token=r,e.headers.FrontType=C(n),[2,e]}))}))}),(function(e){return Promise.reject(e)})),k.interceptors.response.use((function(e){return y(void 0,void 0,void 0,(function(){var n,i,a;return g(this,(function(u){return n=e.data,i=n.code||e.status,n instanceof Blob||i===_.CODES.Success?[2,n]:i===_.CODES.UnAuthorized?("local"!==r&&"dev"!==r&&"development"!==r&&(T(t),o&&"function"==typeof o&&o()),[2,Promise.reject(new Error("token过期!"))]):(a=n.message||n.msg,[2,Promise.reject(new Error(a||"Error"))])}))}))}),(function(e){return y(void 0,void 0,void 0,(function(){return g(this,(function(t){return n&&"function"==typeof n&&n(e),[2,Promise.reject(e)]}))}))})),k},e.httpEnum=_,e.humpTurnDashed=function(e){return void 0===e&&(e=""),e.replace(/\B([A-Z])/g,"-$1").toLowerCase()},e.intersection=function(e,t){return Array.isArray(e)&&Array.isArray(t)?e.filter((function(e){return t.includes(e)})):[]},e.isAllEmpty=function(e){return null==e||("string"==typeof e?0===e.trim().length:Array.isArray(e)?0===e.length:"object"==typeof e&&0===Object.keys(e).length)},e.isEmail=function(e){return/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(e)},e.isEmpty=A,e.isExternal=function(e){return/^(https?:|mailto:|tel:)/.test(e)},e.isImage=function(e){return/^image\//i.test(e)},e.isIncludeAllChildren=function(e,t,r){if(!Array.isArray(e)||!Array.isArray(t))return!1;var n=r||function(e,t){return JSON.stringify(e)===JSON.stringify(t)};return t.every((function(t){return e.some((function(e){return n(e,t)}))}))},e.isMobile=function(e){return/^0?(13[0-9]|14[5-9]|15[012356789]|166|17[0-8]|18[0-9]|19[8-9])[0-9]{8}$/.test(e.toString())},e.isMobileSimple=function(e){return e=e.toString(),/^1/.test(e)&&11===e.length},e.isPhone=function(e){return/^[1](([3][0-9])|([4][0,1,4-9])|([5][0-3,5-9])|([6][2,5,6,7])|([7][0-8])|([8][0-9])|([9][0-3,5-9]))[0-9]{8}$/.test(e)},e.isQQ=function(e){return/^[1-9][0-9]{4,9}$/gim.test(String(e))},e.isTelephone=function(e){return/^0[1-9][0-9]{1,2}-[2-8][0-9]{6,7}$/.test(String(e))},e.isUrl=function(e){return new RegExp("^(?:(https?|ftp|rtsp|mms|ws|wss):\\/\\/)?(?:\\S+(?::\\S*)?@)?(?:(?:localhost)|(?:[1-9]\\d{0,2}(?:\\.\\d{1,3}){3})|(?:$[0-9a-fA-F:]+$)|(?:(?:[a-zA-Z0-9-_]+\\.)+[a-zA-Z]{2,63}))(?::\\d{1,5})?(?:[/?#]\\S*)?$","i").test(e)},e.lighten=function(e,t){var r=se(e).map((function(e){return Math.floor((255-e)*t+e)}));return le(r[0],r[1],r[2])},e.limitDecimalInput=function(e,t){var r=e.replace(/[^\d.]/g,""),n=r.split(".");n.length>2&&(r=n[0]+"."+n.slice(1).join(""));var o=r.split(".");return 2===o.length&&o[1].length>t&&(r=o[0]+"."+o[1].slice(0,t)),r},e.limitIntegerInput=function(e){return e.replace(/[^\d]/g,"")},e.limitNumberInput=function(e,t){var r=e.startsWith("-"),n=e.replace(/[^\d.]/g,""),o=n.split(".");o.length>2&&(n=o[0]+"."+o.slice(1).join(""));var i=n.split(".");return 2===i.length&&i[1].length>t&&(n=i[0]+"."+i[1].slice(0,t)),r&&n&&(n="-"+n),n},e.mittBus=Ne,e.newDate=function(e){return e?new Date(D(e)):new Date},e.normalizeFieldCatalog=function(e){var t,r,n={};try{for(var o=m(Object.entries(e)),i=o.next();!i.done;i=o.next()){var a=w(i.value,2),u=(a[0],a[1]);u.allowedField&&(n[u.allowedField]=u)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n},e.openLink=function(e,t){if(void 0===t&&(t="_blank"),"undefined"!=typeof window){var r=document.createElement("a");r.setAttribute("href",e),r.setAttribute("target",t),r.setAttribute("rel","noreferrer noopener"),r.setAttribute("id","external");var n=document.getElementById("external");n&&document.body.removeChild(n),document.body.appendChild(r),r.click(),r.remove()}},e.parseMenuFieldCatalog=function(e){var t={byUrl:{},byResourceCode:{},byRoutePath:{},routeToApis:{}};return function e(t,r,n){var o,i,a;void 0===n&&(n=null);try{for(var u=m(t),s=u.next();!s.done;s=u.next()){var l=s.value,c=null===(a=l.configJson)||void 0===a?void 0:a.fieldCatalog,f=Le(l.url),d=xe(l.url),h=n;3===l.resourceType&&3===l.level&&f&&(h=f,c&&Object.keys(c).length>0&&(r.byRoutePath[f]=c),r.routeToApis[f]||(r.routeToApis[f]=[])),3===l.resourceType&&l.level>=4&&c&&Object.keys(c).length>0&&(r.byResourceCode[l.resourceCode]=c,d&&(r.byUrl[d]=c),h&&r.routeToApis[h]&&r.routeToApis[h].push(l.resourceCode)),l.children&&l.children.length>0&&e(l.children,r,h)}}catch(e){o={error:e}}finally{try{s&&!s.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}}(e,t),t},e.provinceAndCityDataPlus=De,e.randomString=function(e){e=e||32;for(var t="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678",r=t.length,n="",o=0;o<e;o++)n+=t.charAt(Math.floor(Math.random()*r));return n},e.recordLogMiddleware=function(e){var t=this;return function(r,n){return y(t,void 0,void 0,(function(){return g(this,(function(t){switch(function(e,t){var r;return function(e){var t,r;return e&&"string"==typeof e.method&&"string"==typeof e.url&&e.headers&&(void 0!==e.routerPath||void 0!==e.routeOptions||"function"==typeof e.getValidationFunction||"IncomingMessage"===(null===(r=null===(t=e.raw)||void 0===t?void 0:t.constructor)||void 0===r?void 0:r.name))}(e)&&void 0!==(null==t?void 0:t.statusCode)?"fastify":e&&e.req&&"function"==typeof e.req.header&&"function"==typeof e.req.query&&void 0!==e.req.raw?"hono":e&&e.request&&e.response&&"function"==typeof e.throw?e.requestContext||(null===(r=e.app)||void 0===r?void 0:r.getApplicationContext)?"midway":"koa":"unknown"}(r,n)){case"hono":return[2,ne(r,n,e)];case"fastify":return[2,ue(r,n,e)];case"koa":case"midway":return[2,ie(r,n,e)];default:return console.warn("[requestLoggerUnified] Unknown framework detected, falling back to Koa-style handling"),[2,ie(r,n,e)]}return[2]}))}))}},e.recordLogMiddlewareFastify=function(e){var t=this;return function(r,n){return y(t,void 0,void 0,(function(){return g(this,(function(t){return[2,ue(r,n,e)]}))}))}},e.recordLogMiddlewareHono=function(e){var t=this;return function(r,n){return y(t,void 0,void 0,(function(){return g(this,(function(t){return[2,ne(r,n,e)]}))}))}},e.recordLogMiddlewareKoa=function(e){var t=this;return function(r,n){return y(t,void 0,void 0,(function(){return g(this,(function(t){return[2,ie(r,n,e)]}))}))}},e.recordLogMiddlewareMidway=function(e){var t=this;return function(r,n){return y(t,void 0,void 0,(function(){return g(this,(function(t){return[2,ie(r,n,e)]}))}))}},e.regionData=Te,e.regionDataPlus=Oe,e.removeClass=function(e,t){if("undefined"!=typeof window&&e&&ce(e,t)){var r=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(r," ").trim()}},e.removeTicket=function(){return localStorage.removeItem("jsapiTicket")},e.removeToken=T,e.rgbToHex=le,e.sendLog=ee,e.setTicket=function(e){return localStorage.setItem("jsapiTicket",e)},e.sm3=function(e){return u.sm3(e)},e.speedCalculatorManager=qe,e.subBefore=function(e,t){return e&&"string"==typeof t?e.substring(0,e.indexOf(t)):""},e.sum=function(e){return Array.isArray(e)&&e.length>0?e.reduce((function(e,t){return e+t}),0):0},e.toThousands=L,e.toggleClass=function(e,t,r){if("undefined"!=typeof window){var n=r||document.body,o=n.className;o=o.replace(t,"").trim(),n.className=e?(o+" "+t).trim():o}},e.trimVal=function(e){return e?e.replace(/^\s+|\s+$/g,""):e},e.uuid=function(e,t){var r,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),o=[];if(t=t||n.length,e)for(r=0;r<e;r++)o[r]=n[0|Math.random()*t];else{var i=void 0;for(o[8]=o[13]=o[18]=o[23]="-",o[14]="4",r=0;r<36;r++)o[r]||(i=0|16*Math.random(),o[r]=n[19==r?3&i|8:i])}return o.join("")},e.validateFileSize=Be,e.validateFileType=Pe,e.validateFilesBeforeUpload=function(e,t,r){return void 0===t&&(t=[]),void 0===r&&(r={}),y(this,void 0,void 0,(function(){var n,o,i,a,u,s,l,c,f,d,h,p,y,w;return g(this,(function(g){switch(g.label){case 0:if(n=v(v({},Re),r),o=[],!(i=Fe(t.length,e.length,n.maxFilesCount)).valid)return[2,[i]];try{for(a=m(e),u=a.next();!u.done;u=a.next())s=u.value,(l=Be(s,n.maxFileSize)).valid?(c=Pe(s,n.allowedTypes)).valid||o.push(c):o.push(l)}catch(e){y={error:e}}finally{try{u&&!u.done&&(w=a.return)&&w.call(a)}finally{if(y)throw y.error}}if(o.length>0)return[2,o];if(f=b(t,e),!(d=Ie(f,n.maxTotalSize)).valid)return[2,[d]];if(n.checkNetwork){if(!(h=Ue()).valid)return[2,[h]];"NETWORK_SLOW"===h.code&&o.push(h)}return n.checkQuota?[4,_e(f.reduce((function(e,t){return e+t.size}),0))]:[3,2];case 1:if(!(p=g.sent()).valid)return[2,[p]];g.label=2;case 2:return 0===o.length&&o.push({valid:!0}),[2,o]}}))}))},e.validateFilesCount=Fe,e.validateTotalSize=Ie,e.validateTwoDecimal=function(e){return!e||""===e||/^(\d+)(\.\d{1,2})?$/.test(e.toString())},e.websocketService=he,Object.defineProperty(e,"__esModule",{value:!0})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jinbi-utils",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.28",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.umd.min.js",
|
|
6
6
|
"module": "dist/index.esm.min.js",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@commitlint/cli": "^11.0.0",
|
|
68
68
|
"@commitlint/config-conventional": "^11.0.0",
|
|
69
69
|
"@types/jest": "^25.2.3",
|
|
70
|
-
"@types/node": "^
|
|
70
|
+
"@types/node": "^18.19.0",
|
|
71
71
|
"@typescript-eslint/eslint-plugin": "^3.0.2",
|
|
72
72
|
"@typescript-eslint/parser": "^3.0.2",
|
|
73
73
|
"axios": "1.8.2",
|
|
@@ -107,7 +107,14 @@
|
|
|
107
107
|
"commit-msg": "exit 0"
|
|
108
108
|
}
|
|
109
109
|
},
|
|
110
|
+
"dependencies": {
|
|
111
|
+
"china-area-data": "^5.0.1",
|
|
112
|
+
"decimal.js": "^10.4.3",
|
|
113
|
+
"lodash-es": "^4.17.21",
|
|
114
|
+
"mitt": "^3.0.1",
|
|
115
|
+
"sm-crypto": "^0.3.13"
|
|
116
|
+
},
|
|
110
117
|
"optionalDependencies": {
|
|
111
118
|
"fsevents": "^2.3.2"
|
|
112
119
|
}
|
|
113
|
-
}
|
|
120
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
interface ProvinceData {
|
|
2
|
+
value: string;
|
|
3
|
+
label: string;
|
|
4
|
+
children?: Array<ProvinceData>;
|
|
5
|
+
}
|
|
6
|
+
declare type CodeTextMap = Record<string, string>;
|
|
7
|
+
declare type TextCodeMap = Record<string, Record<string, unknown>>;
|
|
8
|
+
declare const CodeToText: CodeTextMap;
|
|
9
|
+
declare const TextToCode: TextCodeMap;
|
|
10
|
+
declare const regionData: ProvinceData[];
|
|
11
|
+
declare let provinceAndCityData: ProvinceData[];
|
|
12
|
+
declare const provinceAndCityDataPlus: any;
|
|
13
|
+
declare const regionDataPlus: any;
|
|
14
|
+
/**
|
|
15
|
+
* 汉字转区域码
|
|
16
|
+
* @param provinceText 省
|
|
17
|
+
* @param cityText 市
|
|
18
|
+
* @param regionText 区
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
declare function convertTextToCode(provinceText: string, cityText: string, regionText?: string): string;
|
|
22
|
+
export { provinceAndCityData, regionData, provinceAndCityDataPlus, regionDataPlus, CodeToText, TextToCode, convertTextToCode };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 菜单树 FieldCatalog 解析工具
|
|
3
|
+
* @description 从菜单树中提取 fieldCatalog 配置,建立多维度映射
|
|
4
|
+
* @version 1.0.0
|
|
5
|
+
*
|
|
6
|
+
* 设计原则:
|
|
7
|
+
* 1. 纯函数,无副作用,易于测试和迁移
|
|
8
|
+
* 2. 支持多维度查询(URL、resourceCode、路由路径)
|
|
9
|
+
* 3. 后续可直接迁移到组件库
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* 菜单节点类型(与后端返回结构匹配)
|
|
13
|
+
*/
|
|
14
|
+
export interface MenuNode {
|
|
15
|
+
/** 节点名称 */
|
|
16
|
+
nodeName: string;
|
|
17
|
+
/** 配置 JSON(包含 fieldCatalog) */
|
|
18
|
+
configJson: {
|
|
19
|
+
fieldCatalog?: FieldCatalogMap;
|
|
20
|
+
} | null;
|
|
21
|
+
/** 节点 ID */
|
|
22
|
+
id: number;
|
|
23
|
+
/** 父节点 ID */
|
|
24
|
+
parentId: number;
|
|
25
|
+
/** URL 路径 */
|
|
26
|
+
url: string | null;
|
|
27
|
+
/** 资源编码 */
|
|
28
|
+
resourceCode: string;
|
|
29
|
+
/** 资源类型:1-应用,2-菜单,3-页面,4-接口 */
|
|
30
|
+
resourceType: number;
|
|
31
|
+
/** 节点层级 */
|
|
32
|
+
level: number;
|
|
33
|
+
/** 子节点 */
|
|
34
|
+
children: MenuNode[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* 字段目录项
|
|
38
|
+
*/
|
|
39
|
+
export interface FieldCatalogItem {
|
|
40
|
+
/** 字段类型 */
|
|
41
|
+
type: "string" | "number" | "date" | "boolean" | "json";
|
|
42
|
+
/** 字段标签 */
|
|
43
|
+
label: string;
|
|
44
|
+
/** 是否支持筛选 */
|
|
45
|
+
filter: boolean;
|
|
46
|
+
/** 是否可为空(控制列显示) */
|
|
47
|
+
nullable: boolean;
|
|
48
|
+
/** 是否是字典字段 */
|
|
49
|
+
dictField: boolean;
|
|
50
|
+
/** 对应的表格列 prop */
|
|
51
|
+
allowedField: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* 字段目录映射
|
|
55
|
+
*/
|
|
56
|
+
export declare type FieldCatalogMap = Record<string, FieldCatalogItem>;
|
|
57
|
+
/**
|
|
58
|
+
* 解析结果:多维度映射
|
|
59
|
+
*/
|
|
60
|
+
export interface FieldCatalogRegistry {
|
|
61
|
+
/**
|
|
62
|
+
* 按接口 URL 路径映射
|
|
63
|
+
* key: 接口路径(从 url 中提取 hash 后的部分)
|
|
64
|
+
* @example '/saas/base/baseProject/getProjectPage'
|
|
65
|
+
*/
|
|
66
|
+
byUrl: Record<string, FieldCatalogMap>;
|
|
67
|
+
/**
|
|
68
|
+
* 按资源编码映射
|
|
69
|
+
* key: resourceCode
|
|
70
|
+
* @example 'getProjectPage'
|
|
71
|
+
*/
|
|
72
|
+
byResourceCode: Record<string, FieldCatalogMap>;
|
|
73
|
+
/**
|
|
74
|
+
* 按页面路由路径映射
|
|
75
|
+
* key: 页面路由路径
|
|
76
|
+
* @example '/project-manage/list'
|
|
77
|
+
*/
|
|
78
|
+
byRoutePath: Record<string, FieldCatalogMap>;
|
|
79
|
+
/**
|
|
80
|
+
* 页面路由与接口 resourceCode 的关联
|
|
81
|
+
* key: 页面路由路径
|
|
82
|
+
* value: 该页面下的接口 resourceCode 数组
|
|
83
|
+
*/
|
|
84
|
+
routeToApis: Record<string, string[]>;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* 解析菜单树,提取所有 fieldCatalog 配置
|
|
88
|
+
* @param menuData 菜单数据(后端返回的 result 数组)
|
|
89
|
+
* @returns 多维度映射的 fieldCatalog 注册表
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* const menuData = await getTenantAppMenu();
|
|
94
|
+
* const registry = parseMenuFieldCatalog(menuData.data.result);
|
|
95
|
+
*
|
|
96
|
+
* // 按接口 URL 获取
|
|
97
|
+
* const catalog1 = registry.byUrl['/saas/base/baseProject/getProjectPage'];
|
|
98
|
+
*
|
|
99
|
+
* // 按 resourceCode 获取
|
|
100
|
+
* const catalog2 = registry.byResourceCode['getProjectPage'];
|
|
101
|
+
*
|
|
102
|
+
* // 按页面路由获取
|
|
103
|
+
* const catalog3 = registry.byRoutePath['/project-manage/list'];
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
export declare function parseMenuFieldCatalog(menuData: MenuNode[]): FieldCatalogRegistry;
|
|
107
|
+
/**
|
|
108
|
+
* 根据页面路由获取合并后的 fieldCatalog
|
|
109
|
+
* @description 合并页面自身的 fieldCatalog 和其关联接口的 fieldCatalog
|
|
110
|
+
* @param registry fieldCatalog 注册表
|
|
111
|
+
* @param routePath 页面路由路径
|
|
112
|
+
* @returns 合并后的 fieldCatalog
|
|
113
|
+
*/
|
|
114
|
+
export declare function getMergedFieldCatalogByRoute(registry: FieldCatalogRegistry, routePath: string): FieldCatalogMap;
|
|
115
|
+
/**
|
|
116
|
+
* 将 fieldCatalog 转换为以 allowedField 为 key 的映射
|
|
117
|
+
* @description 便于通过表格列的 prop 快速查找字段配置
|
|
118
|
+
* @param fieldCatalog 原始 fieldCatalog(key 为完整字段名如 'vwProjectCountparking.projectName')
|
|
119
|
+
* @returns 以 allowedField 为 key 的映射
|
|
120
|
+
*/
|
|
121
|
+
export declare function normalizeFieldCatalog(fieldCatalog: FieldCatalogMap): Record<string, FieldCatalogItem>;
|
package/types/index.d.ts
CHANGED
|
@@ -15,3 +15,13 @@ export * from './color';
|
|
|
15
15
|
export * from './array';
|
|
16
16
|
export * from './dom';
|
|
17
17
|
export * from './websocket';
|
|
18
|
+
export * from './money';
|
|
19
|
+
export * from './tree';
|
|
20
|
+
export * from './chinaArea';
|
|
21
|
+
export type { MenuNode, FieldCatalogMap, FieldCatalogRegistry, FieldCatalogItem as ParsedFieldCatalogItem, } from './fieldCatalogParser';
|
|
22
|
+
export { parseMenuFieldCatalog, getMergedFieldCatalogByRoute, normalizeFieldCatalog } from './fieldCatalogParser';
|
|
23
|
+
export * from './input';
|
|
24
|
+
export { emitter as mittBus } from './mitt';
|
|
25
|
+
export * from './sm3';
|
|
26
|
+
export * from './uploadValidation';
|
|
27
|
+
export * from './uploadSpeed';
|
package/types/input.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 输入验证和格式化工具函数
|
|
3
|
+
* @description 提供表单输入相关的验证和格式化工具方法
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* 限制小数位数输入
|
|
7
|
+
* @description 过滤非数字字符,只保留一个小数点,并限制小数位数
|
|
8
|
+
* @param value 输入值
|
|
9
|
+
* @param decimalPlaces 允许的小数位数
|
|
10
|
+
* @returns 格式化后的字符串
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* limitDecimalInput("123.456", 2); // "123.45"
|
|
15
|
+
* limitDecimalInput("abc123.45def", 2); // "123.45"
|
|
16
|
+
* limitDecimalInput("12.34.56", 2); // "12.3456" -> "12.34"
|
|
17
|
+
* limitDecimalInput("", 2); // ""
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function limitDecimalInput(value: string, decimalPlaces: number): string;
|
|
21
|
+
/**
|
|
22
|
+
* 限制正整数输入
|
|
23
|
+
* @description 过滤非数字字符,只允许输入正整数
|
|
24
|
+
* @param value 输入值
|
|
25
|
+
* @returns 只包含数字的字符串
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* limitIntegerInput("123"); // "123"
|
|
30
|
+
* limitIntegerInput("abc123def"); // "123"
|
|
31
|
+
* limitIntegerInput("12.34"); // "1234"
|
|
32
|
+
* limitIntegerInput("-123"); // "123"
|
|
33
|
+
* limitIntegerInput(""); // ""
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function limitIntegerInput(value: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* 限制数字输入(支持负数和小数)
|
|
39
|
+
* @description 过滤非数字字符,只保留一个负号(在开头)和一个小数点,并限制小数位数
|
|
40
|
+
* @param value 输入值
|
|
41
|
+
* @param decimalPlaces 允许的小数位数
|
|
42
|
+
* @returns 格式化后的字符串
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* limitNumberInput("-123.456", 2); // "-123.45"
|
|
47
|
+
* limitNumberInput("--123.45", 2); // "-123.45"
|
|
48
|
+
* limitNumberInput("abc-123.45def", 2); // "-123.45"
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export declare function limitNumberInput(value: string, decimalPlaces: number): string;
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
export declare function sendLog(logData: any): Promise<void>;
|
|
2
|
+
/**
|
|
3
|
+
* 错误告警推送到企业微信机器人
|
|
4
|
+
* 当日志级别为 ERROR,或 INFO 日志中包含 error 关键字时调用
|
|
5
|
+
* @param rawLog 原始日志内容
|
|
6
|
+
* @param systemName 可选,系统名称(默认 "bff-service")
|
|
7
|
+
*/
|
|
8
|
+
export declare function sendErrorNotify(rawLog: string, systemName?: string): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* 检测日志消息是否需要推送错误告警
|
|
11
|
+
* 规则:ERROR 级别,或 INFO 级别中包含 error 关键字
|
|
12
|
+
*/
|
|
13
|
+
export declare function checkAndNotify(msg: string, systemName?: string): void;
|
|
2
14
|
/**
|
|
3
15
|
* 统一请求日志中间件
|
|
4
16
|
* 自动检测运行时框架类型,支持 Hono、Koa、Midway、Fastify
|
package/types/mitt.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Emitter } from "mitt";
|
|
2
|
+
import type { WebSocketMessageType } from "./websocket/types";
|
|
3
|
+
/** 全局公共事件需要在此处添加类型 */
|
|
4
|
+
declare type Events = {
|
|
5
|
+
openPanel: string;
|
|
6
|
+
tagOnClick: string;
|
|
7
|
+
logoChange: boolean;
|
|
8
|
+
tagViewsChange: string;
|
|
9
|
+
changLayoutRoute: string;
|
|
10
|
+
tagViewsShowModel: string;
|
|
11
|
+
imageInfo: {
|
|
12
|
+
img: HTMLImageElement;
|
|
13
|
+
height: number;
|
|
14
|
+
width: number;
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
};
|
|
18
|
+
/** WebSocket 连接状态变化事件 */
|
|
19
|
+
"websocket-connected": boolean;
|
|
20
|
+
/** WebSocket 接收到消息事件 */
|
|
21
|
+
"websocket-message": WebSocketMessageType;
|
|
22
|
+
/** WebSocket 连接错误事件 */
|
|
23
|
+
"websocket-error": {
|
|
24
|
+
code?: number;
|
|
25
|
+
message: string;
|
|
26
|
+
};
|
|
27
|
+
/** WebSocket 连接关闭事件 */
|
|
28
|
+
"websocket-closed": void;
|
|
29
|
+
};
|
|
30
|
+
export declare const emitter: Emitter<Events>;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 舍入模式常量
|
|
3
|
+
*/
|
|
4
|
+
export declare const RoundingMode: {
|
|
5
|
+
/** 向上舍入(远离零) */
|
|
6
|
+
readonly UP: 0;
|
|
7
|
+
/** 向下舍入(趋向零) */
|
|
8
|
+
readonly DOWN: 1;
|
|
9
|
+
/** 向正无穷舍入 */
|
|
10
|
+
readonly CEIL: 2;
|
|
11
|
+
/** 向负无穷舍入 */
|
|
12
|
+
readonly FLOOR: 3;
|
|
13
|
+
/** 四舍五入 */
|
|
14
|
+
readonly HALF_UP: 4;
|
|
15
|
+
/** 五舍六入 */
|
|
16
|
+
readonly HALF_DOWN: 5;
|
|
17
|
+
/** 银行家舍入(四舍六入五取偶) */
|
|
18
|
+
readonly HALF_EVEN: 6;
|
|
19
|
+
/** 向最近舍入,平局时向正无穷 */
|
|
20
|
+
readonly HALF_CEIL: 7;
|
|
21
|
+
/** 向最近舍入,平局时向负无穷 */
|
|
22
|
+
readonly HALF_FLOOR: 8;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* 默认配置
|
|
26
|
+
*/
|
|
27
|
+
export declare const DEFAULT_CONFIG: {
|
|
28
|
+
/** 默认小数位数 */
|
|
29
|
+
readonly DECIMAL_PLACES: 2;
|
|
30
|
+
/** 默认货币符号 */
|
|
31
|
+
readonly CURRENCY_SYMBOL: "¥";
|
|
32
|
+
/** 默认千分位分隔符 */
|
|
33
|
+
readonly THOUSANDS_SEPARATOR: ",";
|
|
34
|
+
/** 默认小数点分隔符 */
|
|
35
|
+
readonly DECIMAL_SEPARATOR: ".";
|
|
36
|
+
/** 默认舍入模式 */
|
|
37
|
+
readonly ROUNDING_MODE: 4;
|
|
38
|
+
};
|