@das-fed/utils 1.0.1 → 1.0.3

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.
Files changed (131) hide show
  1. package/api-services/index.d.ts +1 -0
  2. package/api-services/index.js +3 -19845
  3. package/api-services/modules/app-manage.d.ts +2 -0
  4. package/api-services/modules/app-manage.js +5 -6
  5. package/api-services/modules/authentication.d.ts +2 -0
  6. package/api-services/modules/authentication.js +5 -6
  7. package/api-services/modules/bems.d.ts +6 -0
  8. package/api-services/modules/bems.js +8 -10
  9. package/api-services/modules/contract.d.ts +2 -0
  10. package/api-services/modules/contract.js +5 -6
  11. package/api-services/modules/duty-manage.d.ts +7 -0
  12. package/api-services/modules/duty-manage.js +9 -10
  13. package/api-services/modules/enterpriseright.d.ts +2 -0
  14. package/api-services/modules/enterpriseright.js +5 -6
  15. package/api-services/modules/file.d.ts +36 -0
  16. package/api-services/modules/file.js +449 -354
  17. package/api-services/modules/gateway-edge.d.ts +2 -0
  18. package/api-services/modules/gateway-edge.js +5 -6
  19. package/api-services/modules/index.d.ts +21 -0
  20. package/api-services/modules/index.js +501 -435
  21. package/api-services/modules/iot.d.ts +15 -0
  22. package/api-services/modules/iot.js +17 -18
  23. package/api-services/modules/justauth.d.ts +3 -0
  24. package/api-services/modules/justauth.js +6 -7
  25. package/api-services/modules/knowledge.d.ts +2 -0
  26. package/api-services/modules/knowledge.js +5 -6
  27. package/api-services/modules/link.d.ts +2 -0
  28. package/api-services/modules/link.js +5 -6
  29. package/api-services/modules/permission.d.ts +2 -0
  30. package/api-services/modules/permission.js +5 -6
  31. package/api-services/modules/platformManage.d.ts +14 -0
  32. package/api-services/modules/platformManage.js +12 -13
  33. package/api-services/modules/portal.d.ts +2 -0
  34. package/api-services/modules/portal.js +5 -6
  35. package/api-services/modules/space-manage.d.ts +2 -0
  36. package/api-services/modules/space-manage.js +5 -6
  37. package/api-services/modules/super-admin.d.ts +8 -0
  38. package/api-services/modules/super-admin.js +8 -9
  39. package/api-services/modules/supplier.d.ts +6 -0
  40. package/api-services/modules/supplier.js +7 -8
  41. package/api-services/modules/supplychain-manage.d.ts +2 -0
  42. package/api-services/modules/supplychain-manage.js +5 -6
  43. package/api-services/modules/systemConfiguration.d.ts +2 -0
  44. package/api-services/modules/systemConfiguration.js +5 -6
  45. package/api-services/modules/tool.d.ts +2 -0
  46. package/api-services/modules/tool.js +5 -6
  47. package/api-services/src/create-service.d.ts +2 -0
  48. package/api-services/src/create-service.js +3119 -19726
  49. package/api-services/src/sso.d.ts +29 -0
  50. package/api-services/src/sso.js +1547 -156
  51. package/api-services/src/util.d.ts +1 -0
  52. package/api-services/src/util.js +1462 -19
  53. package/atob/index.d.ts +2 -0
  54. package/atob/index.js +9 -10
  55. package/common-info/getIframeUrl.d.ts +9 -0
  56. package/common-info/getIframeUrl.js +9 -11
  57. package/common-info/index.d.ts +42 -0
  58. package/common-info/index.js +138 -272
  59. package/common-info/setInfoFromUrl.d.ts +8 -0
  60. package/common-info/setInfoFromUrl.js +60 -128
  61. package/common-tools/arr-tools.d.ts +15 -0
  62. package/common-tools/arr-tools.js +6 -13
  63. package/common-tools/date-format.d.ts +7 -0
  64. package/common-tools/date-format.js +18 -21
  65. package/common-tools/get-url-params.d.ts +33 -0
  66. package/common-tools/get-url-params.js +48 -88
  67. package/common-tools/handle-data.d.ts +6 -0
  68. package/common-tools/handle-data.js +3 -4
  69. package/common-tools/index.d.ts +7 -0
  70. package/common-tools/index.js +7 -213
  71. package/common-tools/nest-tree-format.d.ts +30 -0
  72. package/common-tools/nest-tree-format.js +22 -49
  73. package/common-tools/obj-tools.d.ts +7 -0
  74. package/common-tools/obj-tools.js +17 -18
  75. package/common-tools/setHtmlMinWH.d.ts +5 -0
  76. package/common-tools/setHtmlMinWH.js +6 -10
  77. package/common-tools/throttled.d.ts +7 -0
  78. package/common-tools/throttled.js +7 -16
  79. package/config/index.d.ts +2 -0
  80. package/config/index.js +8 -25
  81. package/curring-http/index.d.ts +11 -0
  82. package/curring-http/index.js +5150 -17289
  83. package/directive/auth.d.ts +8 -0
  84. package/directive/auth.js +54 -104
  85. package/directive/clickOutside.d.ts +5 -0
  86. package/directive/clickOutside.js +23 -49
  87. package/directive/hoverInside.d.ts +5 -0
  88. package/directive/hoverInside.js +16 -35
  89. package/directive/index.d.ts +3 -0
  90. package/directive/index.js +7 -182
  91. package/directive/utils.d.ts +7 -0
  92. package/directive/utils.js +6 -11
  93. package/dom-check-in/index.d.ts +6 -0
  94. package/dom-check-in/index.js +7 -15
  95. package/dom-watcher/index.d.ts +25 -0
  96. package/dom-watcher/index.js +7 -8
  97. package/hooks/popup-manager/use-zindex.d.ts +5 -0
  98. package/hooks/popup-manager/use-zindex.js +17 -36
  99. package/index.d.ts +2 -0
  100. package/index.js +2 -215
  101. package/load-js/index.d.ts +3 -0
  102. package/load-js/index.js +10 -20
  103. package/oss/index.d.ts +2 -0
  104. package/oss/index.js +11 -15
  105. package/package.json +8 -13
  106. package/pinyin-first-character/index.d.ts +2 -0
  107. package/pinyin-first-character/index.js +25011 -12217
  108. package/process-engine-info/index.d.ts +10 -0
  109. package/process-engine-info/index.js +8 -10
  110. package/pure-image-src/index.d.ts +2 -0
  111. package/pure-image-src/index.js +3 -29
  112. package/set-personal-info/index.d.ts +5 -0
  113. package/set-personal-info/index.js +1460 -16
  114. package/size-watcher/index.d.ts +6 -0
  115. package/size-watcher/index.js +17 -24
  116. package/style/index.d.ts +2 -0
  117. package/style/index.js +62 -103
  118. package/style/math.d.ts +9 -0
  119. package/style/math.js +16 -31
  120. package/style/style.d.ts +30 -0
  121. package/style/style.js +49 -72
  122. package/token-tools/index.d.ts +18 -0
  123. package/token-tools/index.js +72 -149
  124. package/vue/hooks/use-model-value.d.ts +3 -0
  125. package/vue/hooks/use-model-value.js +9 -10
  126. package/vue/index.d.ts +1 -0
  127. package/vue/index.js +3 -10
  128. package/webSocket-service/index.d.ts +40 -0
  129. package/webSocket-service/index.js +62 -138
  130. package/with-install/index.d.ts +10 -0
  131. package/with-install/index.js +5 -7
@@ -1,156 +1,88 @@
1
1
  /*! js-cookie v3.0.5 | MIT */
2
- /* eslint-disable no-var */
3
- function assign (target) {
4
- for (var i = 1; i < arguments.length; i++) {
5
- var source = arguments[i];
6
- for (var key in source) {
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 target
8
+ return e;
11
9
  }
12
- /* eslint-enable no-var */
13
-
14
- /* eslint-disable no-var */
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 (value) {
23
- return encodeURIComponent(value).replace(
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
- /* eslint-enable no-var */
30
-
31
- /* eslint-disable no-var */
32
-
33
- function init (converter, defaultAttributes) {
34
- function set (name, value, attributes) {
35
- if (typeof document === 'undefined') {
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
- function get (name) {
79
- if (typeof document === 'undefined' || (arguments.length && !name)) {
80
- return
81
- }
82
-
83
- // To prevent the for loop in the first place assign an empty array
84
- // in case there are no cookies at all.
85
- var cookies = document.cookie ? document.cookie.split('; ') : [];
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
- } catch (e) {}
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 (name, attributes) {
109
- set(
110
- name,
111
- '',
112
- assign({}, attributes, {
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 (attributes) {
118
- return init(this.converter, assign({}, this.attributes, attributes))
58
+ withAttributes: function(o) {
59
+ return g(this.converter, a({}, this.attributes, o));
119
60
  },
120
- withConverter: function (converter) {
121
- return init(assign({}, this.converter, converter), this.attributes)
61
+ withConverter: function(o) {
62
+ return g(a({}, this.converter, o), this.attributes);
122
63
  }
123
64
  },
124
65
  {
125
- attributes: { value: Object.freeze(defaultAttributes) },
126
- converter: { value: Object.freeze(converter) }
66
+ attributes: { value: Object.freeze(n) },
67
+ converter: { value: Object.freeze(e) }
127
68
  }
128
- )
69
+ );
129
70
  }
130
-
131
- var api = init(defaultConverter, { path: '/' });
132
-
133
- const getUrlToken = () => {
134
- const search = new URL(location.href).searchParams;
135
- const token = search.get("token") || search.get("accessToken") || search.get("accesstoken") || "";
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 getProjectInfoFromQuery = () => {
145
- const preProject = JSON.parse(sessionStorage.getItem("projectInfo") || "{}");
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 parentId = search.get("projectParent") || search.get("projectParentId") || preProject?.parentId || "";
151
- const name = search.get("projectName") || preProject?.name || "";
152
- sessionStorage.setItem("project", id);
153
- sessionStorage.setItem("projectInfo", JSON.stringify({ ...preProject, id, name, parentId }));
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 };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * 判断两个数组是否内容相等
3
+ * @param a 数组一
4
+ * @param b 数组二
5
+ * @param isSort 是否排序完成之后再比较,也就是顺序无关,默认为true
6
+ * @returns 是否相等
7
+ */
8
+ export declare const arrEqual: (a: any[], b: any[], isSort?: boolean) => boolean;
9
+ /**
10
+ * 根据数组对象的某个字段去重
11
+ * @param arr 需要处理的数组
12
+ * @param val 要根据哪个字段来去重
13
+ * @returns
14
+ */
15
+ export declare const arrUnique: (arr: any[], val: string) => any[];
@@ -1,15 +1,8 @@
1
- const arrEqual = (a, b, isSort = true) => {
2
- if (a.length !== b.length)
3
- return false;
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
- const arrUnique = (arr, val) => {
11
- const res = /* @__PURE__ */ new Map();
12
- return arr.filter((item) => !res.has(item[val]) && res.set(item[val], 1));
5
+ export {
6
+ o as arrEqual,
7
+ s as arrUnique
13
8
  };
14
-
15
- export { arrEqual, arrUnique };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 时间格式化工具
3
+ * @param value 需要格式化的时间戳,不传则默认当前时间
4
+ * @param fmt 格式化字符串格式,默认'yyyy-MM-dd HH:mm:ss'
5
+ * @returns 如2017-09-15 10:09:00
6
+ */
7
+ export declare const dateFormat: (value?: string, fmt?: string) => string;
@@ -1,22 +1,19 @@
1
- const dateFormat = (value, fmt = "yyyy-MM-dd HH:mm:ss") => {
2
- let date = value ? new Date(value) : /* @__PURE__ */ new Date();
3
- var o = {
4
- "M+": date.getMonth() + 1,
5
- "d+": date.getDate(),
6
- "H+": date.getHours(),
7
- "m+": date.getMinutes(),
8
- "s+": date.getSeconds(),
9
- "q+": Math.floor((date.getMonth() + 3) / 3),
10
- S: date.getMilliseconds()
11
- };
12
- var year = date.getFullYear().toString();
13
- year = year.length >= 4 ? year : "0000".substr(0, 4 - year.length) + year;
14
- if (/(y+)/.test(fmt))
15
- fmt = fmt.replace(RegExp.$1, (year + "").substr(4 - RegExp.$1.length));
16
- for (var k in o)
17
- if (new RegExp("(" + k + ")").test(fmt))
18
- fmt = fmt.replace(RegExp.$1, RegExp.$1.length === 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
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 };
@@ -0,0 +1,33 @@
1
+ /**
2
+ * 获取url中的参数
3
+ * @param url url地址
4
+ * @param name 参数名称,不传则返回参数集合
5
+ * @returns
6
+ */
7
+ export declare const getUrlParams: (allUrl?: string, name?: string) => any;
8
+ /**
9
+ * 拼接完整的url
10
+ * @param url pathname
11
+ * @param params 参数
12
+ * @returns
13
+ */
14
+ export declare const getFullPath: (url: string, params?: any) => string;
15
+ /**
16
+ * 删除url中指定的参数,并返回最终的url
17
+ * @param names 数组,需要删除的参数名集合
18
+ * @param url 指定url
19
+ * @returns
20
+ */
21
+ export declare const funcUrlDel: (names: string[], url?: string) => string;
22
+ /**
23
+ * 将url中的参数转换成对象
24
+ * @param url url链接,域名可带可不带
25
+ * @returns params url链接参数转化的Object
26
+ */
27
+ export declare const urlParamsToObject: (url: string) => any;
28
+ /**
29
+ * 将对象转换成url中的参数
30
+ * @param params 参数对象
31
+ * @returns url形式的参数
32
+ */
33
+ export declare const objectToUrlparams: (params: any) => string;
@@ -1,92 +1,52 @@
1
- const getUrlParams = (allUrl, name) => {
2
- let search = window.location.search || "";
3
- if (allUrl && allUrl !== location.href) {
4
- const index = allUrl.indexOf("?");
5
- if (index !== -1) {
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 params = new URLSearchParams(search);
12
- if (name) {
13
- return params.get(name);
14
- } else {
15
- let allParams = {};
16
- for (let [key, value] of params.entries()) {
17
- allParams[key] = value;
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
+ debugger;
24
+ const e = n || location.href, t = a(e), s = Object.keys(t) || [];
25
+ if (!s || !s.length)
26
+ return e.includes("?") ? e.split("?")[0] : e.split("&")[0];
27
+ let l = s.filter((o) => !r.includes(o));
28
+ if (!l || !l.length)
29
+ return e.includes("?") ? e.split("?")[0] : e.split("&")[0];
30
+ let i = "";
31
+ return l.forEach((o, c) => {
32
+ c === s.length - 1 ? i += `${o}=${t[o]}` : i += `${o}=${t[o]}&`;
33
+ }), e.includes("?") ? e.split("?")[0] + `?${i}` : e.split("&")[0] + `?${i}`;
34
+ }, h = (r) => {
35
+ const n = new URLSearchParams(r.split("?")[1]), e = {};
36
+ for (const [t, s] of n)
37
+ e.hasOwnProperty(t) ? Array.isArray(e[t]) ? e[t].push(s) : e[t] = [e[t], s] : e[t] = s;
38
+ return e;
39
+ }, $ = (r) => {
40
+ let n = "";
41
+ const e = Object.keys(r);
42
+ return e && e.length && e.forEach((t, s) => {
43
+ s === e.length - 1 ? n += `${t}=${r[t]}` : n += `${t}=${r[t]}&`;
44
+ }), n;
21
45
  };
22
- const getFullPath = (url, params = {}) => {
23
- let result = "";
24
- let query = "";
25
- const keys = Object.keys(params);
26
- if (keys && keys.length) {
27
- keys.forEach((key, index) => {
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;
46
+ export {
47
+ u as funcUrlDel,
48
+ f as getFullPath,
49
+ a as getUrlParams,
50
+ $ as objectToUrlparams,
51
+ h as urlParamsToObject
90
52
  };
91
-
92
- export { funcUrlDel, getFullPath, getUrlParams, objectToUrlparams, urlParamsToObject };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 判断是否为空值
3
+ * @param value 需要判断的值
4
+ * @returns
5
+ */
6
+ export declare const isEmpty: (value: any) => boolean;
@@ -1,5 +1,4 @@
1
- const isEmpty = (value) => {
2
- return !!(value === null || typeof value === "undefined" || value === "");
1
+ const t = (n) => n === null || typeof n > "u" || n === "";
2
+ export {
3
+ t as isEmpty
3
4
  };
4
-
5
- export { isEmpty };
@@ -0,0 +1,7 @@
1
+ export * from '@das-fed/utils/common-tools/date-format';
2
+ export * from '@das-fed/utils/common-tools/get-url-params';
3
+ export * from '@das-fed/utils/common-tools/nest-tree-format';
4
+ export * from '@das-fed/utils/common-tools/obj-tools';
5
+ export * from '@das-fed/utils/common-tools/arr-tools';
6
+ export * from '@das-fed/utils/common-tools/handle-data';
7
+ export * from '@das-fed/utils/common-tools/setHtmlMinWH';