@das-fed/utils 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-services/index.js +6840 -19720
- package/api-services/modules/app-manage.js +6966 -6
- package/api-services/modules/authentication.js +6966 -6
- package/api-services/modules/bems.js +6970 -11
- package/api-services/modules/contract.js +6966 -6
- package/api-services/modules/duty-manage.js +6970 -10
- package/api-services/modules/enterpriseright.js +6966 -6
- package/api-services/modules/file.js +7108 -353
- package/api-services/modules/gateway-edge.js +6966 -6
- package/api-services/modules/index.js +7163 -437
- package/api-services/modules/iot.js +6979 -19
- package/api-services/modules/justauth.js +6967 -7
- package/api-services/modules/knowledge.js +6966 -6
- package/api-services/modules/link.js +6966 -6
- package/api-services/modules/permission.js +6966 -6
- package/api-services/modules/platformManage.js +6974 -14
- package/api-services/modules/portal.js +6966 -6
- package/api-services/modules/space-manage.js +6966 -6
- package/api-services/modules/super-admin.js +6969 -9
- package/api-services/modules/supplier.js +6968 -8
- package/api-services/modules/supplychain-manage.js +6966 -6
- package/api-services/modules/systemConfiguration.js +6966 -6
- package/api-services/modules/tool.js +6966 -6
- package/api-services/src/create-service.js +6840 -19720
- package/api-services/src/sso.js +1711 -157
- package/api-services/src/util.js +1466 -19
- package/atob/index.js +9 -10
- package/common-info/getIframeUrl.js +14 -11
- package/common-info/index.js +194 -269
- package/common-info/setInfoFromUrl.js +60 -128
- package/common-tools/arr-tools.js +6 -13
- package/common-tools/date-format.js +18 -21
- package/common-tools/get-url-params.js +47 -88
- package/common-tools/handle-data.js +3 -4
- package/common-tools/index.js +108 -204
- package/common-tools/nest-tree-format.js +22 -49
- package/common-tools/obj-tools.js +17 -18
- package/common-tools/setHtmlMinWH.js +6 -10
- package/common-tools/throttled.js +7 -16
- package/config/index.js +8 -25
- package/curring-http/index.js +5150 -17289
- package/directive/auth.js +205 -97
- package/directive/clickOutside.js +25 -49
- package/directive/hoverInside.js +18 -35
- package/directive/index.js +238 -159
- package/directive/utils.js +6 -11
- package/dom-check-in/index.js +7 -15
- package/dom-watcher/index.js +7 -8
- package/hooks/popup-manager/use-zindex.js +17 -36
- package/index.js +242 -191
- package/load-js/index.js +14 -20
- package/oss/index.js +15 -15
- package/package.json +7 -11
- package/pinyin-first-character/index.js +25011 -12217
- package/process-engine-info/index.js +8 -10
- package/pure-image-src/index.js +3 -29
- package/set-personal-info/index.js +1566 -16
- package/size-watcher/index.js +17 -24
- package/style/index.js +62 -103
- package/style/math.js +16 -31
- package/style/style.js +49 -72
- package/token-tools/index.js +1594 -152
- package/vue/hooks/use-model-value.js +9 -10
- package/vue/index.js +9 -10
- package/webSocket-service/index.js +162 -135
- package/with-install/index.js +5 -7
|
@@ -1,156 +1,88 @@
|
|
|
1
1
|
/*! js-cookie v3.0.5 | MIT */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
target[key] = source[key];
|
|
8
|
-
}
|
|
2
|
+
function a(e) {
|
|
3
|
+
for (var n = 1; n < arguments.length; n++) {
|
|
4
|
+
var r = arguments[n];
|
|
5
|
+
for (var i in r)
|
|
6
|
+
e[i] = r[i];
|
|
9
7
|
}
|
|
10
|
-
return
|
|
8
|
+
return e;
|
|
11
9
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var defaultConverter = {
|
|
16
|
-
read: function (value) {
|
|
17
|
-
if (value[0] === '"') {
|
|
18
|
-
value = value.slice(1, -1);
|
|
19
|
-
}
|
|
20
|
-
return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent)
|
|
10
|
+
var I = {
|
|
11
|
+
read: function(e) {
|
|
12
|
+
return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
|
21
13
|
},
|
|
22
|
-
write: function
|
|
23
|
-
return encodeURIComponent(
|
|
14
|
+
write: function(e) {
|
|
15
|
+
return encodeURIComponent(e).replace(
|
|
24
16
|
/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
|
|
25
17
|
decodeURIComponent
|
|
26
|
-
)
|
|
18
|
+
);
|
|
27
19
|
}
|
|
28
20
|
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
attributes = assign({}, defaultAttributes, attributes);
|
|
40
|
-
|
|
41
|
-
if (typeof attributes.expires === 'number') {
|
|
42
|
-
attributes.expires = new Date(Date.now() + attributes.expires * 864e5);
|
|
21
|
+
function g(e, n) {
|
|
22
|
+
function r(o, f, t) {
|
|
23
|
+
if (!(typeof document > "u")) {
|
|
24
|
+
t = a({}, n, t), typeof t.expires == "number" && (t.expires = new Date(Date.now() + t.expires * 864e5)), t.expires && (t.expires = t.expires.toUTCString()), o = encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
25
|
+
var c = "";
|
|
26
|
+
for (var s in t)
|
|
27
|
+
t[s] && (c += "; " + s, t[s] !== !0 && (c += "=" + t[s].split(";")[0]));
|
|
28
|
+
return document.cookie = o + "=" + e.write(f, o) + c;
|
|
43
29
|
}
|
|
44
|
-
if (attributes.expires) {
|
|
45
|
-
attributes.expires = attributes.expires.toUTCString();
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
name = encodeURIComponent(name)
|
|
49
|
-
.replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)
|
|
50
|
-
.replace(/[()]/g, escape);
|
|
51
|
-
|
|
52
|
-
var stringifiedAttributes = '';
|
|
53
|
-
for (var attributeName in attributes) {
|
|
54
|
-
if (!attributes[attributeName]) {
|
|
55
|
-
continue
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
stringifiedAttributes += '; ' + attributeName;
|
|
59
|
-
|
|
60
|
-
if (attributes[attributeName] === true) {
|
|
61
|
-
continue
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// Considers RFC 6265 section 5.2:
|
|
65
|
-
// ...
|
|
66
|
-
// 3. If the remaining unparsed-attributes contains a %x3B (";")
|
|
67
|
-
// character:
|
|
68
|
-
// Consume the characters of the unparsed-attributes up to,
|
|
69
|
-
// not including, the first %x3B (";") character.
|
|
70
|
-
// ...
|
|
71
|
-
stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return (document.cookie =
|
|
75
|
-
name + '=' + converter.write(value, name) + stringifiedAttributes)
|
|
76
30
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
var jar = {};
|
|
87
|
-
for (var i = 0; i < cookies.length; i++) {
|
|
88
|
-
var parts = cookies[i].split('=');
|
|
89
|
-
var value = parts.slice(1).join('=');
|
|
90
|
-
|
|
91
|
-
try {
|
|
92
|
-
var found = decodeURIComponent(parts[0]);
|
|
93
|
-
jar[found] = converter.read(value, found);
|
|
94
|
-
|
|
95
|
-
if (name === found) {
|
|
96
|
-
break
|
|
31
|
+
function i(o) {
|
|
32
|
+
if (!(typeof document > "u" || arguments.length && !o)) {
|
|
33
|
+
for (var f = document.cookie ? document.cookie.split("; ") : [], t = {}, c = 0; c < f.length; c++) {
|
|
34
|
+
var s = f[c].split("="), u = s.slice(1).join("=");
|
|
35
|
+
try {
|
|
36
|
+
var p = decodeURIComponent(s[0]);
|
|
37
|
+
if (t[p] = e.read(u, p), o === p)
|
|
38
|
+
break;
|
|
39
|
+
} catch {
|
|
97
40
|
}
|
|
98
|
-
}
|
|
41
|
+
}
|
|
42
|
+
return o ? t[o] : t;
|
|
99
43
|
}
|
|
100
|
-
|
|
101
|
-
return name ? jar[name] : jar
|
|
102
44
|
}
|
|
103
|
-
|
|
104
45
|
return Object.create(
|
|
105
46
|
{
|
|
106
|
-
set,
|
|
107
|
-
get,
|
|
108
|
-
remove: function
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
47
|
+
set: r,
|
|
48
|
+
get: i,
|
|
49
|
+
remove: function(o, f) {
|
|
50
|
+
r(
|
|
51
|
+
o,
|
|
52
|
+
"",
|
|
53
|
+
a({}, f, {
|
|
113
54
|
expires: -1
|
|
114
55
|
})
|
|
115
56
|
);
|
|
116
57
|
},
|
|
117
|
-
withAttributes: function
|
|
118
|
-
return
|
|
58
|
+
withAttributes: function(o) {
|
|
59
|
+
return g(this.converter, a({}, this.attributes, o));
|
|
119
60
|
},
|
|
120
|
-
withConverter: function
|
|
121
|
-
return
|
|
61
|
+
withConverter: function(o) {
|
|
62
|
+
return g(a({}, this.converter, o), this.attributes);
|
|
122
63
|
}
|
|
123
64
|
},
|
|
124
65
|
{
|
|
125
|
-
attributes: { value: Object.freeze(
|
|
126
|
-
converter: { value: Object.freeze(
|
|
66
|
+
attributes: { value: Object.freeze(n) },
|
|
67
|
+
converter: { value: Object.freeze(e) }
|
|
127
68
|
}
|
|
128
|
-
)
|
|
69
|
+
);
|
|
129
70
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
if (token) {
|
|
137
|
-
const tokenInfo = JSON.stringify({ access_token: token });
|
|
138
|
-
sessionStorage.setItem("accessToken", token);
|
|
139
|
-
sessionStorage.setItem("tokenInfo", tokenInfo);
|
|
140
|
-
api.set("accessToken", token);
|
|
141
|
-
api.set("accessTokenInfo", tokenInfo);
|
|
71
|
+
var d = g(I, { path: "/" });
|
|
72
|
+
const h = () => {
|
|
73
|
+
const e = new URL(location.href).searchParams, n = e.get("token") || e.get("accessToken") || e.get("accesstoken") || "";
|
|
74
|
+
if (n) {
|
|
75
|
+
const r = JSON.stringify({ access_token: n });
|
|
76
|
+
sessionStorage.setItem("accessToken", n), sessionStorage.setItem("tokenInfo", r), d.set("accessToken", n), d.set("accessTokenInfo", r);
|
|
142
77
|
}
|
|
143
|
-
}
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
const search = new URL(location.href).searchParams;
|
|
147
|
-
const id = search.get("project") || search.get("projectId") || "";
|
|
148
|
-
if (!id)
|
|
78
|
+
}, v = () => {
|
|
79
|
+
const e = JSON.parse(sessionStorage.getItem("projectInfo") || "{}"), n = new URL(location.href).searchParams, r = n.get("project") || n.get("projectId") || "";
|
|
80
|
+
if (!r)
|
|
149
81
|
return;
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
82
|
+
const i = n.get("projectParent") || n.get("projectParentId") || (e == null ? void 0 : e.parentId) || "", o = n.get("projectName") || (e == null ? void 0 : e.name) || "";
|
|
83
|
+
sessionStorage.setItem("project", r), sessionStorage.setItem("projectInfo", JSON.stringify({ ...e, id: r, name: o, parentId: i }));
|
|
84
|
+
};
|
|
85
|
+
export {
|
|
86
|
+
v as getProjectInfoFromQuery,
|
|
87
|
+
h as getUrlToken
|
|
154
88
|
};
|
|
155
|
-
|
|
156
|
-
export { getProjectInfoFromQuery, getUrlToken };
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
if (isSort) {
|
|
5
|
-
return a.sort().toString() === b.sort().toString();
|
|
6
|
-
} else {
|
|
7
|
-
return a.toString() === b.toString();
|
|
8
|
-
}
|
|
1
|
+
const o = (t, r, e = !0) => t.length !== r.length ? !1 : e ? t.sort().toString() === r.sort().toString() : t.toString() === r.toString(), s = (t, r) => {
|
|
2
|
+
const e = /* @__PURE__ */ new Map();
|
|
3
|
+
return t.filter((n) => !e.has(n[r]) && e.set(n[r], 1));
|
|
9
4
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
export {
|
|
6
|
+
o as arrEqual,
|
|
7
|
+
s as arrUnique
|
|
13
8
|
};
|
|
14
|
-
|
|
15
|
-
export { arrEqual, arrUnique };
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
const
|
|
2
|
-
let
|
|
3
|
-
var
|
|
4
|
-
"M+":
|
|
5
|
-
"d+":
|
|
6
|
-
"H+":
|
|
7
|
-
"m+":
|
|
8
|
-
"s+":
|
|
9
|
-
"q+": Math.floor((
|
|
10
|
-
S:
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return fmt;
|
|
1
|
+
const a = (s, t = "yyyy-MM-dd HH:mm:ss") => {
|
|
2
|
+
let e = s ? new Date(s) : /* @__PURE__ */ new Date();
|
|
3
|
+
var r = {
|
|
4
|
+
"M+": e.getMonth() + 1,
|
|
5
|
+
"d+": e.getDate(),
|
|
6
|
+
"H+": e.getHours(),
|
|
7
|
+
"m+": e.getMinutes(),
|
|
8
|
+
"s+": e.getSeconds(),
|
|
9
|
+
"q+": Math.floor((e.getMonth() + 3) / 3),
|
|
10
|
+
S: e.getMilliseconds()
|
|
11
|
+
}, g = e.getFullYear().toString();
|
|
12
|
+
g = g.length >= 4 ? g : "0000".substr(0, 4 - g.length) + g, /(y+)/.test(t) && (t = t.replace(RegExp.$1, (g + "").substr(4 - RegExp.$1.length)));
|
|
13
|
+
for (var n in r)
|
|
14
|
+
new RegExp("(" + n + ")").test(t) && (t = t.replace(RegExp.$1, RegExp.$1.length === 1 ? r[n] : ("00" + r[n]).substr(("" + r[n]).length)));
|
|
15
|
+
return t;
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
a as dateFormat
|
|
20
19
|
};
|
|
21
|
-
|
|
22
|
-
export { dateFormat };
|
|
@@ -1,92 +1,51 @@
|
|
|
1
|
-
const
|
|
2
|
-
let
|
|
3
|
-
if (
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
search = allUrl.slice(index);
|
|
7
|
-
} else {
|
|
8
|
-
search = "";
|
|
9
|
-
}
|
|
1
|
+
const a = (r, n) => {
|
|
2
|
+
let e = window.location.search || "";
|
|
3
|
+
if (r && r !== location.href) {
|
|
4
|
+
const s = r.indexOf("?");
|
|
5
|
+
s !== -1 ? e = r.slice(s) : e = "";
|
|
10
6
|
}
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
13
|
-
return
|
|
14
|
-
|
|
15
|
-
let
|
|
16
|
-
for (let [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return allParams;
|
|
7
|
+
const t = new URLSearchParams(e);
|
|
8
|
+
if (n)
|
|
9
|
+
return t.get(n);
|
|
10
|
+
{
|
|
11
|
+
let s = {};
|
|
12
|
+
for (let [l, i] of t.entries())
|
|
13
|
+
s[l] = i;
|
|
14
|
+
return s;
|
|
20
15
|
}
|
|
16
|
+
}, f = (r, n = {}) => {
|
|
17
|
+
let e = "", t = "";
|
|
18
|
+
const s = Object.keys(n);
|
|
19
|
+
return s && s.length && s.forEach((l, i) => {
|
|
20
|
+
i === s.length - 1 ? t += `${l}=${n[l]}` : t += `${l}=${n[l]}&`;
|
|
21
|
+
}), t ? e = location.origin + r + `?${t}` : e = location.origin + r, e;
|
|
22
|
+
}, u = (r, n) => {
|
|
23
|
+
const e = n || location.href, t = a(e), s = Object.keys(t) || [];
|
|
24
|
+
if (!s || !s.length)
|
|
25
|
+
return e.includes("?") ? e.split("?")[0] : e.split("&")[0];
|
|
26
|
+
let l = s.filter((o) => !r.includes(o));
|
|
27
|
+
if (!l || !l.length)
|
|
28
|
+
return e.includes("?") ? e.split("?")[0] : e.split("&")[0];
|
|
29
|
+
let i = "";
|
|
30
|
+
return l.forEach((o, c) => {
|
|
31
|
+
c === s.length - 1 ? i += `${o}=${t[o]}` : i += `${o}=${t[o]}&`;
|
|
32
|
+
}), e.includes("?") ? e.split("?")[0] + `?${i}` : e.split("&")[0] + `?${i}`;
|
|
33
|
+
}, h = (r) => {
|
|
34
|
+
const n = new URLSearchParams(r.split("?")[1]), e = {};
|
|
35
|
+
for (const [t, s] of n)
|
|
36
|
+
e.hasOwnProperty(t) ? Array.isArray(e[t]) ? e[t].push(s) : e[t] = [e[t], s] : e[t] = s;
|
|
37
|
+
return e;
|
|
38
|
+
}, $ = (r) => {
|
|
39
|
+
let n = "";
|
|
40
|
+
const e = Object.keys(r);
|
|
41
|
+
return e && e.length && e.forEach((t, s) => {
|
|
42
|
+
s === e.length - 1 ? n += `${t}=${r[t]}` : n += `${t}=${r[t]}&`;
|
|
43
|
+
}), n;
|
|
21
44
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (index === keys.length - 1) {
|
|
29
|
-
query += `${key}=${params[key]}`;
|
|
30
|
-
} else {
|
|
31
|
-
query += `${key}=${params[key]}&`;
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
if (query) {
|
|
36
|
-
result = location.origin + url + `?${query}`;
|
|
37
|
-
} else {
|
|
38
|
-
result = location.origin + url;
|
|
39
|
-
}
|
|
40
|
-
return result;
|
|
41
|
-
};
|
|
42
|
-
const funcUrlDel = (names, url) => {
|
|
43
|
-
const preUrl = url ? url : location.href;
|
|
44
|
-
const params = getUrlParams(preUrl);
|
|
45
|
-
const keys = Object.keys(params) || [];
|
|
46
|
-
if (!keys || !keys.length)
|
|
47
|
-
return preUrl.includes("?") ? preUrl.split("?")[0] : preUrl.split("&")[0];
|
|
48
|
-
let paramsResult = keys.filter((item) => !names.includes(item));
|
|
49
|
-
if (!paramsResult || !paramsResult.length)
|
|
50
|
-
return preUrl.includes("?") ? preUrl.split("?")[0] : preUrl.split("&")[0];
|
|
51
|
-
let query = "";
|
|
52
|
-
paramsResult.forEach((key, index) => {
|
|
53
|
-
if (index === keys.length - 1) {
|
|
54
|
-
query += `${key}=${params[key]}`;
|
|
55
|
-
} else {
|
|
56
|
-
query += `${key}=${params[key]}&`;
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
return preUrl.includes("?") ? preUrl.split("?")[0] + `?${query}` : preUrl.split("&")[0] + `?${query}`;
|
|
60
|
-
};
|
|
61
|
-
const urlParamsToObject = (url) => {
|
|
62
|
-
const searchParams = new URLSearchParams(url.split("?")[1]);
|
|
63
|
-
const params = {};
|
|
64
|
-
for (const [key, value] of searchParams) {
|
|
65
|
-
if (params.hasOwnProperty(key)) {
|
|
66
|
-
if (Array.isArray(params[key])) {
|
|
67
|
-
params[key].push(value);
|
|
68
|
-
} else {
|
|
69
|
-
params[key] = [params[key], value];
|
|
70
|
-
}
|
|
71
|
-
} else {
|
|
72
|
-
params[key] = value;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return params;
|
|
76
|
-
};
|
|
77
|
-
const objectToUrlparams = (params) => {
|
|
78
|
-
let query = "";
|
|
79
|
-
const keys = Object.keys(params);
|
|
80
|
-
if (keys && keys.length) {
|
|
81
|
-
keys.forEach((key, index) => {
|
|
82
|
-
if (index === keys.length - 1) {
|
|
83
|
-
query += `${key}=${params[key]}`;
|
|
84
|
-
} else {
|
|
85
|
-
query += `${key}=${params[key]}&`;
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
return query;
|
|
45
|
+
export {
|
|
46
|
+
u as funcUrlDel,
|
|
47
|
+
f as getFullPath,
|
|
48
|
+
a as getUrlParams,
|
|
49
|
+
$ as objectToUrlparams,
|
|
50
|
+
h as urlParamsToObject
|
|
90
51
|
};
|
|
91
|
-
|
|
92
|
-
export { funcUrlDel, getFullPath, getUrlParams, objectToUrlparams, urlParamsToObject };
|