hrp-ui-base 1.3.5 → 1.3.6
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/components.cjs +1 -1
- package/dist/components.es.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.es.js +2 -2
- package/dist/string-utils-DKz4mfHd.cjs +1 -0
- package/dist/{string-utils-DkXGtIS5.js → string-utils-DPWu4Qfh.js} +110 -92
- package/dist/{transform-data-4Ib3OXms.cjs → transform-data-DDmK9TEL.cjs} +1 -1
- package/dist/{transform-data-DLpie48c.js → transform-data-jyYW8phC.js} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.es.js +2 -2
- package/package.json +1 -1
- package/packages/approval-process/package.json +1 -1
- package/src/utils/HttpUtil.ts +48 -41
- package/src/utils/crypto.ts +36 -11
- package/dist/string-utils-BDHaWaqb.cjs +0 -1
package/src/utils/HttpUtil.ts
CHANGED
|
@@ -3,9 +3,9 @@ import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
3
3
|
import qs from "qs";
|
|
4
4
|
import exitLogin from "./exitLogin";
|
|
5
5
|
import { IsPhone } from "./get-env";
|
|
6
|
-
const ConfigBaseURL = window.location.origin + window.location.pathname +"api";
|
|
7
|
-
import { showNotify } from
|
|
8
|
-
import {getFinalToken, getFinalTokenResident} from "./crypto"
|
|
6
|
+
const ConfigBaseURL = window.location.origin + window.location.pathname + "api";
|
|
7
|
+
import { showNotify } from "vant";
|
|
8
|
+
import { getFinalToken, getFinalTokenResident } from "./crypto";
|
|
9
9
|
//使用create方法创建axios实例
|
|
10
10
|
const service = axios.create({
|
|
11
11
|
timeout: 1800000, // 请求超时时间
|
|
@@ -21,15 +21,14 @@ service.interceptors.response.use(
|
|
|
21
21
|
if (IsPhone()) {
|
|
22
22
|
if (response.data.code == 501 || response.data.code == 510) {
|
|
23
23
|
if (response.data.msg) {
|
|
24
|
-
|
|
25
|
-
showNotify({ type: 'danger', message: response.data.msg });
|
|
24
|
+
showNotify({ type: "danger", message: response.data.msg });
|
|
26
25
|
} else {
|
|
27
|
-
showNotify({ type:
|
|
26
|
+
showNotify({ type: "danger", message: "发生未知错误!" });
|
|
28
27
|
}
|
|
29
28
|
} else if (response.data.code == 500) {
|
|
30
|
-
showNotify({ type:
|
|
29
|
+
showNotify({ type: "danger", message: "服务发生错误!" });
|
|
31
30
|
} else if (response.data.code == 201) {
|
|
32
|
-
showNotify({ type:
|
|
31
|
+
showNotify({ type: "success", message: response.data.msg });
|
|
33
32
|
} else if (response.data.code === 401) {
|
|
34
33
|
exitLogin();
|
|
35
34
|
}
|
|
@@ -40,30 +39,32 @@ service.interceptors.response.use(
|
|
|
40
39
|
type: "error",
|
|
41
40
|
dangerouslyUseHTMLString: true,
|
|
42
41
|
message: `<span style="word-break: break-all">${response.data.msg}</span>`,
|
|
43
|
-
duration: 5000
|
|
42
|
+
duration: 5000,
|
|
44
43
|
});
|
|
45
44
|
} else {
|
|
46
45
|
ElMessage.error("发生未知错误!");
|
|
47
46
|
}
|
|
48
47
|
} else if (response.data.code == 500) {
|
|
49
48
|
// ElMessage.error("服务发生错误!");
|
|
50
|
-
ElMessageBox.alert(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
ElMessageBox.alert(
|
|
50
|
+
response.data.msg ? response.data.msg : "服务发生错误",
|
|
51
|
+
"错误提示",
|
|
52
|
+
{
|
|
53
|
+
// if you want to disable its autofocus
|
|
54
|
+
// autofocus: false,
|
|
55
|
+
confirmButtonText: "确定",
|
|
56
|
+
callback: () => {},
|
|
56
57
|
},
|
|
57
|
-
|
|
58
|
+
);
|
|
58
59
|
} else if (response.data.code == 201) {
|
|
59
60
|
ElMessage({
|
|
60
61
|
type: "success",
|
|
61
62
|
dangerouslyUseHTMLString: true,
|
|
62
63
|
message: `<span style="word-break: break-all">${response.data.msg}</span>`,
|
|
63
|
-
duration: 5000
|
|
64
|
+
duration: 5000,
|
|
64
65
|
});
|
|
65
66
|
} else if (response.data.code === 401) {
|
|
66
|
-
exitLogin()
|
|
67
|
+
exitLogin();
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
70
|
|
|
@@ -71,17 +72,16 @@ service.interceptors.response.use(
|
|
|
71
72
|
},
|
|
72
73
|
async (error) => {
|
|
73
74
|
if (error.response.status === 401) {
|
|
74
|
-
exitLogin()
|
|
75
|
+
exitLogin();
|
|
75
76
|
} else {
|
|
76
77
|
if (IsPhone()) {
|
|
77
|
-
showNotify({ type:
|
|
78
|
+
showNotify({ type: "danger", message: "网络请求失败" });
|
|
78
79
|
} else {
|
|
79
80
|
ElMessage.error("网络请求失败");
|
|
80
|
-
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
return Promise.reject(error.response);
|
|
84
|
-
}
|
|
84
|
+
},
|
|
85
85
|
);
|
|
86
86
|
export default class HttpUtil {
|
|
87
87
|
static baseUrl = ConfigBaseURL;
|
|
@@ -148,21 +148,25 @@ export default class HttpUtil {
|
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
data: data,
|
|
159
|
-
headers: {
|
|
160
|
-
"Content-Type": "multipart/form-data",
|
|
161
|
-
"Authorization-Token": getFinalTokenResident(),
|
|
162
|
-
...header,
|
|
163
|
-
}, //设置header信息
|
|
164
|
-
});
|
|
151
|
+
static uploadOSSResident(
|
|
152
|
+
url: string,
|
|
153
|
+
data?: object,
|
|
154
|
+
header?: object,
|
|
155
|
+
): Promise<any> {
|
|
156
|
+
if (data) {
|
|
157
|
+
data = data || "";
|
|
165
158
|
}
|
|
159
|
+
return service({
|
|
160
|
+
method: "post",
|
|
161
|
+
url: url,
|
|
162
|
+
data: data,
|
|
163
|
+
headers: {
|
|
164
|
+
"Content-Type": "multipart/form-data",
|
|
165
|
+
"Authorization-Token": getFinalTokenResident(),
|
|
166
|
+
...header,
|
|
167
|
+
}, //设置header信息
|
|
168
|
+
});
|
|
169
|
+
}
|
|
166
170
|
|
|
167
171
|
static exportFile(url: string, data?: object): Promise<any> {
|
|
168
172
|
if (data) {
|
|
@@ -220,7 +224,7 @@ export default class HttpUtil {
|
|
|
220
224
|
headers: {
|
|
221
225
|
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
|
222
226
|
"Authorization-Token": getFinalToken(),
|
|
223
|
-
...config
|
|
227
|
+
...config,
|
|
224
228
|
},
|
|
225
229
|
});
|
|
226
230
|
}
|
|
@@ -398,12 +402,15 @@ export default class HttpUtil {
|
|
|
398
402
|
formData.append("files", file);
|
|
399
403
|
});
|
|
400
404
|
}
|
|
401
|
-
|
|
405
|
+
|
|
402
406
|
// 为 submitWorkOrderParam 设置 application/json 类型
|
|
403
407
|
if (data.submitWorkOrderParam) {
|
|
404
|
-
formData.append(
|
|
405
|
-
|
|
406
|
-
|
|
408
|
+
formData.append(
|
|
409
|
+
"submitWorkOrderParam",
|
|
410
|
+
new Blob([JSON.stringify(data.submitWorkOrderParam)], {
|
|
411
|
+
type: "application/json;charset=utf-8",
|
|
412
|
+
}),
|
|
413
|
+
);
|
|
407
414
|
}
|
|
408
415
|
|
|
409
416
|
return service({
|
package/src/utils/crypto.ts
CHANGED
|
@@ -32,7 +32,7 @@ function strToUtf8Bytes(str: string) {
|
|
|
32
32
|
utf8.push(
|
|
33
33
|
0xe0 | (charCode >> 12),
|
|
34
34
|
0x80 | ((charCode >> 6) & 0x3f),
|
|
35
|
-
0x80 | (charCode & 0x3f)
|
|
35
|
+
0x80 | (charCode & 0x3f),
|
|
36
36
|
);
|
|
37
37
|
} else {
|
|
38
38
|
ii++;
|
|
@@ -45,7 +45,7 @@ function strToUtf8Bytes(str: string) {
|
|
|
45
45
|
0xf0 | (charCode >> 18),
|
|
46
46
|
0x80 | ((charCode >> 12) & 0x3f),
|
|
47
47
|
0x80 | ((charCode >> 6) & 0x3f),
|
|
48
|
-
0x80 | (charCode & 0x3f)
|
|
48
|
+
0x80 | (charCode & 0x3f),
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -58,16 +58,41 @@ function strToUtf8Bytes(str: string) {
|
|
|
58
58
|
}
|
|
59
59
|
return utf8;
|
|
60
60
|
}
|
|
61
|
+
// 获取加密的hrp-token
|
|
62
|
+
export const getFinalHrpToken = function () {
|
|
63
|
+
let str1 = localStorage.getItem("TOKEN") + "IhfN5d11Zk1ZC%Po" + Date.now();
|
|
64
|
+
let str2 = "*XeL#J@znVJ#sdSv";
|
|
65
|
+
return encryptSM4(str1, str2);
|
|
66
|
+
};
|
|
61
67
|
|
|
68
|
+
// 获取本地token 不加密
|
|
69
|
+
export const getFinalTokenResident = function () {
|
|
70
|
+
return localStorage.getItem("TOKEN");
|
|
71
|
+
};
|
|
62
72
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
let
|
|
66
|
-
|
|
73
|
+
// 获取pms的加密token
|
|
74
|
+
export const getPMSFinalToken = function (token: string) {
|
|
75
|
+
let str1 = token + "IhfN5d11Zk1ZC%Po" + Date.now();
|
|
76
|
+
let str2 = "*XeL#J@znVJ#sdSv";
|
|
77
|
+
return encryptSM4(str1, str2);
|
|
67
78
|
};
|
|
68
79
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
80
|
+
// 获取最终的token
|
|
81
|
+
export const getFinalToken = function () {
|
|
82
|
+
// 从 URL中获取 projectId
|
|
83
|
+
const hash = window.location.hash;
|
|
84
|
+
const pathname = window.location.pathname;
|
|
85
|
+
const projectIdMatch = hash.match(/\/project\/([^\/\?]+)/);
|
|
86
|
+
const projectId = projectIdMatch ? projectIdMatch[1] : null;
|
|
87
|
+
|
|
88
|
+
// 如果有 projectId,优先使用项目专属 token
|
|
89
|
+
if (projectId && pathname.includes("/pms/")) {
|
|
90
|
+
const projectToken = localStorage.getItem(`TOKEN-${projectId}`);
|
|
91
|
+
if (projectToken) {
|
|
92
|
+
return getPMSFinalToken(projectToken);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// 否则使用通用 TOKEN
|
|
97
|
+
return getFinalHrpToken();
|
|
98
|
+
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var E=Object.defineProperty;var D=(t,o,e)=>o in t?E(t,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[o]=e;var w=(t,o,e)=>D(t,typeof o!="symbol"?o+"":o,e);const y=require("dingtalk-jsapi"),u=require("element-plus"),R=require("axios"),A=require("qs"),v=require("lodash"),g=require("vant"),J=require("sm-crypto"),L=t=>{if(y.env.platform!=="notInDingTalk")window.open(t+"/?ddtab=true","_blank");else if(window.oaTool&&window.oaTool.isOA){window.oaTool.openNewWindow(t);return}else window.open(t,"_blank")},j=t=>encodeURIComponent(t),K=t=>(t.indexOf("?")>-1&&(t.indexOf("/?")>-1?t=t.split("/?")[0]:t=t.split("?")[0]),t[t.length-1]==="/"&&(t=t.substring(0,t.length-1)),t),M=t=>{if(!(!t||typeof t!="string"))if(y.env.platform!=="notInDingTalk")y.biz.navigation.setTitle({title:t}),document.title=t;else if(window.oaTool&&window.oaTool.isOA){window.oaTool.setTitle(t);return}else document.title=t};function P(t){try{return new URL(t),t}catch{}const o=window.location.origin,e=window.location.pathname;t.startsWith("./")?t=t.substring(2):t.startsWith("/")&&(t=t.substring(1));const n=e.endsWith("/")?e:e.substring(0,e.lastIndexOf("/")+1);return o+n+t}const W=async t=>{let o="";try{o=(sessionStorage.getItem("userConfig")?JSON.parse(sessionStorage.getItem("userConfig")):null).fileUploadType}catch(n){console.log(n)}try{await navigator.clipboard.writeText(P(t.url)),console.log("URL 已复制到剪贴板:",P(t.url)),u.ElMessage.success("文件下载链接已写入剪切板,如遇系统无法下载,自行复制到浏览器打开链接即可下载!")}catch(n){console.error("无法写入剪贴板:",n)}let e=document.createElement("a");e.style="display: none",e.download=t.fileName,e.href=t.url,e.target="_blank",document.body.appendChild(e),e.click(),document.body.removeChild(e)},b=()=>{const t=navigator.userAgent.toLowerCase();return["android","iphone","ipad","ipod","harmonyos","openharmony","huawei","honor","symbianos","windows phone","mobile","webos","blackberry","opera mini","opera mobi","iemobile","wpdesktop"].some(n=>t.includes(n))},q=()=>!b();let m=null;const $=t=>{m=t},x=()=>{var t,o,e;return((o=(t=m==null?void 0:m.currentRoute)==null?void 0:t.value)==null?void 0:o.fullPath)||((e=window.location.hash)==null?void 0:e.replace(/^#/,""))||window.location.pathname+window.location.search},B=v.debounce(()=>{alert("登录失效,请重新登录")},1e3,{leading:!0,trailing:!1});function T(t){const o=localStorage.getItem("TenantHost");localStorage.setItem("preRoute",x()),localStorage.setItem("toRouter",window.location.search),localStorage.getItem("toRouter");let e=localStorage.getItem("currentRouterInfo");if(localStorage.setItem("toRouterObject",e),y.env.platform!=="notInDingTalk")window.location.href=window.location.origin+window.location.pathname+"login/index.html?host="+o;else if(window.oaTool&&window.oaTool.isOA){const n=window.location.origin+(window.location.pathname.endsWith("/")?window.location.pathname:window.location.pathname+"/");let r=x();sessionStorage.setItem("preRoute",r),window.localStorage.removeItem("TOKEN"),window.location.href=`${n}oa-login/index.html?url=${r}`}else if(t&&t===1)window.sessionStorage.clear(),window.localStorage.clear(),window.location.href=window.location.origin+window.location.pathname+"login/index.html";else{localStorage.setItem("toRouter",window.location.search);let n=x();sessionStorage.setItem("preRoute",n),window.localStorage.removeItem("TOKEN"),window.localStorage.removeItem("clientId"),B();const r=window.location.origin+(window.location.pathname.endsWith("/")?window.location.pathname:window.location.pathname+"/");setTimeout(()=>{window.location.href=`${r}login/index.html?host=${o}`},100)}}const H=(t,o)=>J.sm4.encrypt(t,Z(o));function Z(t){const o=[];for(let e=0;e<t.length;e++){let n=t.charCodeAt(e);n<128?o.push(n):n<2048?o.push(192|n>>6,128|n&63):n<55296||n>=57344?o.push(224|n>>12,128|n>>6&63,128|n&63):(e++,n=65536+((n&1023)<<10|t.charCodeAt(e)&1023),o.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|n&63))}for(let e=0;e<o.length;e++){let n=o[e];n>127&&(o[e]=n-256)}return o}const a=function(){let t=localStorage.getItem("TOKEN")+"IhfN5d11Zk1ZC%Po"+Date.now();return H(t,"*XeL#J@znVJ#sdSv")},V=function(){return localStorage.getItem("TOKEN")+""+Date.now(),localStorage.getItem("TOKEN")},U=window.location.origin+window.location.pathname+"api",i=R.create({timeout:18e5,baseURL:U});i.interceptors.request.use(t=>t);i.interceptors.response.use(t=>(b()?t.data.code==501||t.data.code==510?t.data.msg?g.showNotify({type:"danger",message:t.data.msg}):g.showNotify({type:"danger",message:"发生未知错误!"}):t.data.code==500?g.showNotify({type:"danger",message:"服务发生错误!"}):t.data.code==201?g.showNotify({type:"success",message:t.data.msg}):t.data.code===401&&T():t.data.code==501||t.data.code==510?t.data.msg?u.ElMessage({type:"error",dangerouslyUseHTMLString:!0,message:`<span style="word-break: break-all">${t.data.msg}</span>`,duration:5e3}):u.ElMessage.error("发生未知错误!"):t.data.code==500?u.ElMessageBox.alert(t.data.msg?t.data.msg:"服务发生错误","错误提示",{confirmButtonText:"确定",callback:()=>{}}):t.data.code==201?u.ElMessage({type:"success",dangerouslyUseHTMLString:!0,message:`<span style="word-break: break-all">${t.data.msg}</span>`,duration:5e3}):t.data.code===401&&T(),t.data),async t=>(t.response.status===401?T():b()?g.showNotify({type:"danger",message:"网络请求失败"}):u.ElMessage.error("网络请求失败"),Promise.reject(t.response)));class F{static get(o,e){return e&&(e=e||""),i({method:"get",url:o,params:e,headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8","Authorization-Token":a()}})}static post(o,e){return e&&(e=e||""),i({method:"post",url:o,data:A.stringify(e),headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8","Authorization-Token":a(),"Authorization-origin-Token":localStorage.getItem("TOKEN")}})}static postJson(o,e,n){return e&&(e=e||""),i({method:"post",url:o,data:JSON.stringify(e),headers:{"Content-Type":"application/json;charset=utf-8","Authorization-Token":a(),"Authorization-origin-Token":localStorage.getItem("TOKEN"),...n}})}static uploadOSS(o,e,n){return e&&(e=e||""),i({method:"post",url:o,data:e,headers:{"Content-Type":"multipart/form-data","Authorization-Token":a(),...n}})}static uploadOSSResident(o,e,n){return e&&(e=e||""),i({method:"post",url:o,data:e,headers:{"Content-Type":"multipart/form-data","Authorization-Token":V(),...n}})}static exportFile(o,e){return e&&(e=e||""),i({method:"post",responseType:"arraybuffer",url:o,data:JSON.stringify(e),headers:{"Content-Type":"application/json;charset=utf-8","Authorization-Token":a()}})}static put(o,e){return e&&(e=e||""),i({method:"put",url:o,data:A.stringify(e),headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8","Authorization-Token":a()}})}static putJson(o,e){return e&&(e=e||""),i({method:"put",url:o,data:JSON.stringify(e),headers:{"Content-Type":"application/json;charset=utf-8","Authorization-Token":a()}})}static putFile(o,e,n){return e&&(e=e||""),i({method:"put",url:o,data:e,headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8","Authorization-Token":a(),...n}})}static deleted(o,e){return e&&(e=e||""),i({method:"delete",url:o,data:A.stringify(e),headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8","Authorization-Token":a()}})}static deletedjson(o,e){return e&&(e=e||""),i({method:"delete",url:o,data:JSON.stringify(e),headers:{"Content-Type":"application/json;charset=utf-8","Authorization-Token":a()}})}static downloadGet(o,e){return e&&(e=e||""),i({method:"get",url:o,responseType:"blob",params:e,headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8","Authorization-Token":a()}})}static downloadPost(o,e){return e&&(e=e||""),i({method:"post",url:o,responseType:"blob",params:e,headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8","Authorization-Token":a()}})}static download(o,e){return e&&(e=e||""),i({method:"post",url:o,responseType:"blob",data:JSON.stringify(e),headers:{"Content-Type":"application/json;charset=utf-8","Authorization-Token":a()}})}static downloadPostJson(o,e){return e&&(e=e||""),i({method:"post",url:o,responseType:"blob",data:JSON.stringify(e),headers:{"Content-Type":"application/json;charset=utf-8","Authorization-Token":a()}})}static downloadPut(o,e){return e&&(e=e||""),i({method:"put",url:o,responseType:"blob",params:e,headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8","Authorization-Token":a()}})}static downloadPutJson(o,e){return e&&(e=e||""),i({method:"put",url:o,responseType:"blob",data:JSON.stringify(e),headers:{"Content-Type":"application/json;charset=utf-8","Authorization-Token":a()}})}static downloadFile(o,e){return e&&(e=e||{}),i({method:"post",url:o,responseType:"blob",params:e,headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8","Authorization-Token":a()}})}static uploadBase64(o,e,n){let r=new FormData;return r.append("file",e.file),r.append("modulesId",e.modulesId),i({method:"post",url:o,data:r,headers:{"Content-Type":"multipart/form-data","Authorization-Token":a(),...n}})}static postFormData(o,e,n){let r=new FormData;return e.files&&Array.isArray(e.files)&&e.files.forEach(c=>{r.append("files",c)}),e.submitWorkOrderParam&&r.append("submitWorkOrderParam",new Blob([JSON.stringify(e.submitWorkOrderParam)],{type:"application/json;charset=utf-8"})),i({method:"post",url:o,data:r,headers:{"Authorization-Token":a(),"Content-Type":"multipart/form-data",...n}})}}w(F,"baseUrl",U);class _{constructor(){w(this,"havePermission",!1);w(this,"funPointIdList",[])}}const G=(t,o)=>{const e=o.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),n=new RegExp(e,"gi");return t.replace(n,c=>`<span style="color:var(--theme-normal-normal)">${c}</span>`)},X=t=>t.split("?")[0].substring(t.lastIndexOf(".")+1).toLowerCase(),Q=(t,o,e=0)=>{let n="";if(e>0)for(let r=0;r<e;r++)n+=".";return t.length>o?t.slice(0,o-e)+n:t};function Y(t){let o=new Array("零","壹","贰","叁","肆","伍","陆","柒","捌","玖"),e=new Array("","拾","佰","仟"),n=new Array("","万","亿","兆"),r=new Array("角","分","毫","厘"),c="元",z=1e15,p="",h="",s="",S=["",""],f,I,d,k,N,C,O;if(t==null)return"";if(t>=z)return"超出最大处理数字";if(t==0)return s=o[0]+c,s;if(t.toString().indexOf(".")==-1?(p=t.toString(),h="",c="元整"):(S=t.toString().split("."),p=S[0],h=S[1].substr(0,2)),parseInt(p,10)>0){f=0,I=p.length;for(let l=0;l<I;l++)d=p.substr(l,1),k=I-l-1,N=k/4,C=k%4,d=="0"?f++:(f>0&&(s+=o[0]),f=0,s+=o[parseInt(d)]+e[C]),C==0&&f<4&&(s+=n[N]);s+=c}if(h!=""){O=h.length;for(let l=0;l<O;l++)d=h.substr(l,1),d!="0"&&(s+=o[Number(d)]+r[l])}return s==""&&(s+=o[0]+c),s}function ee(t){const o=parseFloat(t.toString());if(isNaN(o))return t;const e=o.toString();return(e.split(".")[1]||"").length>11?o.toFixed(11):e}function te(t){const o=parseFloat(t.toString());return isNaN(o)?0:Number(Math.round(o*100)/100)}exports.FunPointVo=_;exports.HttpUtil=F;exports.IsPc=q;exports.IsPhone=b;exports.ddWindowOpen=L;exports.digitUppercase=Y;exports.downloadFile=W;exports.exitLogin=T;exports.formatDecimal=ee;exports.formatTwoDecimal=te;exports.getEllipsis=Q;exports.getFileType=X;exports.getProcessAppIdUrl=K;exports.highlightText=G;exports.openEncodeUrl=j;exports.setDingDingTitle=M;exports.setExitLoginRouter=$;
|