@das-fed/utils 1.0.2 → 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 (107) hide show
  1. package/api-services/index.d.ts +1 -0
  2. package/api-services/index.js +2 -6964
  3. package/api-services/modules/app-manage.d.ts +2 -0
  4. package/api-services/modules/app-manage.js +3 -6964
  5. package/api-services/modules/authentication.d.ts +2 -0
  6. package/api-services/modules/authentication.js +3 -6964
  7. package/api-services/modules/bems.d.ts +6 -0
  8. package/api-services/modules/bems.js +6 -6967
  9. package/api-services/modules/contract.d.ts +2 -0
  10. package/api-services/modules/contract.js +3 -6964
  11. package/api-services/modules/duty-manage.d.ts +7 -0
  12. package/api-services/modules/duty-manage.js +7 -6968
  13. package/api-services/modules/enterpriseright.d.ts +2 -0
  14. package/api-services/modules/enterpriseright.js +3 -6964
  15. package/api-services/modules/file.d.ts +36 -0
  16. package/api-services/modules/file.js +380 -7040
  17. package/api-services/modules/gateway-edge.d.ts +2 -0
  18. package/api-services/modules/gateway-edge.js +3 -6964
  19. package/api-services/modules/index.d.ts +21 -0
  20. package/api-services/modules/index.js +445 -7105
  21. package/api-services/modules/iot.d.ts +15 -0
  22. package/api-services/modules/iot.js +16 -6977
  23. package/api-services/modules/justauth.d.ts +3 -0
  24. package/api-services/modules/justauth.js +4 -6965
  25. package/api-services/modules/knowledge.d.ts +2 -0
  26. package/api-services/modules/knowledge.js +3 -6964
  27. package/api-services/modules/link.d.ts +2 -0
  28. package/api-services/modules/link.js +3 -6964
  29. package/api-services/modules/permission.d.ts +2 -0
  30. package/api-services/modules/permission.js +3 -6964
  31. package/api-services/modules/platformManage.d.ts +14 -0
  32. package/api-services/modules/platformManage.js +10 -6971
  33. package/api-services/modules/portal.d.ts +2 -0
  34. package/api-services/modules/portal.js +3 -6964
  35. package/api-services/modules/space-manage.d.ts +2 -0
  36. package/api-services/modules/space-manage.js +3 -6964
  37. package/api-services/modules/super-admin.d.ts +8 -0
  38. package/api-services/modules/super-admin.js +6 -6967
  39. package/api-services/modules/supplier.d.ts +6 -0
  40. package/api-services/modules/supplier.js +5 -6966
  41. package/api-services/modules/supplychain-manage.d.ts +2 -0
  42. package/api-services/modules/supplychain-manage.js +3 -6964
  43. package/api-services/modules/systemConfiguration.d.ts +2 -0
  44. package/api-services/modules/systemConfiguration.js +3 -6964
  45. package/api-services/modules/tool.d.ts +2 -0
  46. package/api-services/modules/tool.js +3 -6964
  47. package/api-services/src/create-service.d.ts +2 -0
  48. package/api-services/src/create-service.js +2286 -6013
  49. package/api-services/src/sso.d.ts +29 -0
  50. package/api-services/src/sso.js +506 -669
  51. package/api-services/src/util.d.ts +1 -0
  52. package/api-services/src/util.js +243 -247
  53. package/atob/index.d.ts +2 -0
  54. package/common-info/getIframeUrl.d.ts +9 -0
  55. package/common-info/getIframeUrl.js +6 -11
  56. package/common-info/index.d.ts +42 -0
  57. package/common-info/index.js +104 -163
  58. package/common-info/setInfoFromUrl.d.ts +8 -0
  59. package/common-tools/arr-tools.d.ts +15 -0
  60. package/common-tools/date-format.d.ts +7 -0
  61. package/common-tools/get-url-params.d.ts +33 -0
  62. package/common-tools/get-url-params.js +1 -0
  63. package/common-tools/handle-data.d.ts +6 -0
  64. package/common-tools/index.d.ts +7 -0
  65. package/common-tools/index.js +7 -117
  66. package/common-tools/nest-tree-format.d.ts +30 -0
  67. package/common-tools/obj-tools.d.ts +7 -0
  68. package/common-tools/setHtmlMinWH.d.ts +5 -0
  69. package/common-tools/throttled.d.ts +7 -0
  70. package/config/index.d.ts +2 -0
  71. package/curring-http/index.d.ts +11 -0
  72. package/directive/auth.d.ts +8 -0
  73. package/directive/auth.js +32 -190
  74. package/directive/clickOutside.d.ts +5 -0
  75. package/directive/clickOutside.js +19 -21
  76. package/directive/hoverInside.d.ts +5 -0
  77. package/directive/hoverInside.js +13 -15
  78. package/directive/index.d.ts +3 -0
  79. package/directive/index.js +6 -260
  80. package/directive/utils.d.ts +7 -0
  81. package/dom-check-in/index.d.ts +6 -0
  82. package/dom-watcher/index.d.ts +25 -0
  83. package/hooks/popup-manager/use-zindex.d.ts +5 -0
  84. package/index.d.ts +2 -0
  85. package/index.js +2 -266
  86. package/load-js/index.d.ts +3 -0
  87. package/load-js/index.js +8 -12
  88. package/oss/index.d.ts +2 -0
  89. package/oss/index.js +8 -12
  90. package/package.json +5 -6
  91. package/pinyin-first-character/index.d.ts +2 -0
  92. package/process-engine-info/index.d.ts +10 -0
  93. package/pure-image-src/index.d.ts +2 -0
  94. package/set-personal-info/index.d.ts +5 -0
  95. package/set-personal-info/index.js +516 -622
  96. package/size-watcher/index.d.ts +6 -0
  97. package/style/index.d.ts +2 -0
  98. package/style/math.d.ts +9 -0
  99. package/style/style.d.ts +30 -0
  100. package/token-tools/index.d.ts +18 -0
  101. package/token-tools/index.js +60 -1579
  102. package/vue/hooks/use-model-value.d.ts +3 -0
  103. package/vue/index.d.ts +1 -0
  104. package/vue/index.js +2 -8
  105. package/webSocket-service/index.d.ts +40 -0
  106. package/webSocket-service/index.js +35 -138
  107. package/with-install/index.d.ts +10 -0
@@ -0,0 +1,2 @@
1
+ export declare const encryption: (str: string) => string;
2
+ export declare const decrypt: (str: string) => string;
@@ -0,0 +1,9 @@
1
+ type pageType = 'editor' | 'editor3d' | 'editor2d3d' | 'preview' | 'preview3d';
2
+ /**
3
+ * 编辑器的路径和预览图纸的路径
4
+ * @param page 'editor' | 'editor3d' | 'editor2d3d' | 'preview' | 'preview3d'
5
+ * @param query 路由参数location.search
6
+ * @returns
7
+ */
8
+ export declare const getIframeUrl: (page: pageType, query?: Record<any, any>) => any;
9
+ export {};
@@ -1,16 +1,11 @@
1
- const s = (e, n = {}) => {
2
- let t = "", i = "";
3
- const r = Object.keys(n);
4
- return r && r.length && r.forEach((o, l) => {
5
- l === r.length - 1 ? i += `${o}=${n[o]}` : i += `${o}=${n[o]}&`;
6
- }), i ? t = location.origin + e + `?${i}` : t = location.origin + e, t;
7
- }, c = (e, n) => {
8
- if (!e)
1
+ import { getFullPath as n } from "@das-fed/utils/common-tools";
2
+ const l = (r, t) => {
3
+ if (!r)
9
4
  return;
10
- let t = {};
5
+ let e = {};
11
6
  const i = "enterpriseadmin/iocvisual";
12
- return (e === "preview" || e === "preview3d") && (t = { showLayout: !1 }), s("/" + i + "/" + e, { ...t, ...n });
7
+ return (r === "preview" || r === "preview3d") && (e = { showLayout: !1 }), n("/" + i + "/" + r, { ...e, ...t });
13
8
  };
14
9
  export {
15
- c as getIframeUrl
10
+ l as getIframeUrl
16
11
  };
@@ -0,0 +1,42 @@
1
+ import type { UserInfo, PersonalInfo, TenantInfo, ProjectInfo, SubAppsInfo, TabInfo, permissionBtnInfo } from './type';
2
+ /** 获取token */
3
+ export declare const getToken: () => string;
4
+ /** 获取token详情 */
5
+ export declare const getUserInfo: () => UserInfo;
6
+ /** 获取用户详情 */
7
+ export declare const getPersonalInfo: () => PersonalInfo;
8
+ /** 获取当前租户详情 */
9
+ export declare const getTenantInfo: () => TenantInfo;
10
+ /**
11
+ * 获取项目信息
12
+ * @returns 项目信息
13
+ */
14
+ export declare const getProjectInfo: () => ProjectInfo;
15
+ /**
16
+ * 可用于判断菜单或者按钮权限
17
+ * @param menuCode 菜单编码
18
+ * @param applicationCode 应用编码
19
+ * @returns undefined(无菜单权限);空数组(无按钮权限)
20
+ */
21
+ export declare const getPageAuth: (menuCode?: string, applicationCode?: string) => any;
22
+ /**
23
+ * 获取指定菜单的按钮权限数据
24
+ * @param menuCode 菜单编码
25
+ * @param applicationCode 应用编码
26
+ * @returns
27
+ */
28
+ export declare const getPageAuthBtn: (menuCode?: string, applicationCode?: string) => permissionBtnInfo;
29
+ /**
30
+ * 获取应用信息(独立打开子应用不可用)
31
+ * @returns 应用信息
32
+ */
33
+ export declare const getSubApps: () => SubAppsInfo;
34
+ /**
35
+ * 获取菜单
36
+ * @param appCode 应用编码
37
+ */
38
+ export declare const getMenus: (appCode?: string) => any;
39
+ /** 获取tabs标签页信息 */
40
+ export declare const getTabInfo: () => TabInfo;
41
+ /** 获取minio地址 */
42
+ export declare const getMinioAddress: () => any;
@@ -1,14 +1,17 @@
1
- import { ref as d } from "vue";
1
+ import { tokenStorage as l } from "@das-fed/utils/api-services/src/sso";
2
+ import { getConfig as f } from "@das-fed/utils/config";
3
+ import { getUrlParams as d } from "@das-fed/utils/common-tools";
4
+ import { getUrlToken as m, getProjectInfoFromQuery as S } from "@das-fed/utils/common-info/setInfoFromUrl";
2
5
  /*! js-cookie v3.0.5 | MIT */
3
- function u(e) {
4
- for (var t = 1; t < arguments.length; t++) {
5
- var n = arguments[t];
6
- for (var o in n)
7
- e[o] = n[o];
6
+ function g(e) {
7
+ for (var n = 1; n < arguments.length; n++) {
8
+ var t = arguments[n];
9
+ for (var s in t)
10
+ e[s] = t[s];
8
11
  }
9
12
  return e;
10
13
  }
11
- var l = {
14
+ var b = {
12
15
  read: function(e) {
13
16
  return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
14
17
  },
@@ -19,140 +22,78 @@ var l = {
19
22
  );
20
23
  }
21
24
  };
22
- function I(e, t) {
23
- function n(s, i, r) {
25
+ function I(e, n) {
26
+ function t(o, a, r) {
24
27
  if (!(typeof document > "u")) {
25
- r = u({}, t, r), typeof r.expires == "number" && (r.expires = new Date(Date.now() + r.expires * 864e5)), r.expires && (r.expires = r.expires.toUTCString()), s = encodeURIComponent(s).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
26
- var c = "";
27
- for (var a in r)
28
- r[a] && (c += "; " + a, r[a] !== !0 && (c += "=" + r[a].split(";")[0]));
29
- return document.cookie = s + "=" + e.write(i, s) + c;
28
+ r = g({}, n, r), typeof r.expires == "number" && (r.expires = new Date(Date.now() + r.expires * 864e5)), r.expires && (r.expires = r.expires.toUTCString()), o = encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
29
+ var i = "";
30
+ for (var c in r)
31
+ r[c] && (i += "; " + c, r[c] !== !0 && (i += "=" + r[c].split(";")[0]));
32
+ return document.cookie = o + "=" + e.write(a, o) + i;
30
33
  }
31
34
  }
32
- function o(s) {
33
- if (!(typeof document > "u" || arguments.length && !s)) {
34
- for (var i = document.cookie ? document.cookie.split("; ") : [], r = {}, c = 0; c < i.length; c++) {
35
- var a = i[c].split("="), f = a.slice(1).join("=");
35
+ function s(o) {
36
+ if (!(typeof document > "u" || arguments.length && !o)) {
37
+ for (var a = document.cookie ? document.cookie.split("; ") : [], r = {}, i = 0; i < a.length; i++) {
38
+ var c = a[i].split("="), p = c.slice(1).join("=");
36
39
  try {
37
- var g = decodeURIComponent(a[0]);
38
- if (r[g] = e.read(f, g), s === g)
40
+ var u = decodeURIComponent(c[0]);
41
+ if (r[u] = e.read(p, u), o === u)
39
42
  break;
40
43
  } catch {
41
44
  }
42
45
  }
43
- return s ? r[s] : r;
46
+ return o ? r[o] : r;
44
47
  }
45
48
  }
46
49
  return Object.create(
47
50
  {
48
- set: n,
49
- get: o,
50
- remove: function(s, i) {
51
- n(
52
- s,
51
+ set: t,
52
+ get: s,
53
+ remove: function(o, a) {
54
+ t(
55
+ o,
53
56
  "",
54
- u({}, i, {
57
+ g({}, a, {
55
58
  expires: -1
56
59
  })
57
60
  );
58
61
  },
59
- withAttributes: function(s) {
60
- return I(this.converter, u({}, this.attributes, s));
62
+ withAttributes: function(o) {
63
+ return I(this.converter, g({}, this.attributes, o));
61
64
  },
62
- withConverter: function(s) {
63
- return I(u({}, this.converter, s), this.attributes);
65
+ withConverter: function(o) {
66
+ return I(g({}, this.converter, o), this.attributes);
64
67
  }
65
68
  },
66
69
  {
67
- attributes: { value: Object.freeze(t) },
70
+ attributes: { value: Object.freeze(n) },
68
71
  converter: { value: Object.freeze(e) }
69
72
  }
70
73
  );
71
74
  }
72
- var m = I(l, { path: "/" });
73
- const h = (e) => {
74
- var t = encodeURIComponent(e);
75
- return t = btoa(t), t;
76
- }, p = () => {
77
- let t = { ...(window == null ? void 0 : window.config) || {} };
78
- t.rootContainer || (t.rootContainer = "#app"), t.baseURL || (t.baseURL = location.origin), t.ossBaseURL || (t.ossBaseURL = "/oss"), t.ossBaseURL.startsWith("/") && (t.ossBaseURL = `${t.baseURL}/oss`), t.ssoBaseURL || (t.ssoBaseURL = t.baseURL);
79
- let { microAppName: n, publicPath: o, mainAppName: s } = t;
80
- return n && !0 && !o && (o = `/${n}/`.replace(/\/\//g, "/")), o || (o = "/"), t.publicPath = o, t.autoOssBucket || (t.autoOssBucket = s || n), t;
81
- }, S = (e, t) => {
82
- let n = window.location.search || "";
83
- if (e && e !== location.href) {
84
- const s = e.indexOf("?");
85
- s !== -1 ? n = e.slice(s) : n = "";
86
- }
87
- const o = new URLSearchParams(n);
88
- if (t)
89
- return o.get(t);
90
- {
91
- let s = {};
92
- for (let [i, r] of o.entries())
93
- s[i] = r;
94
- return s;
95
- }
96
- }, k = (e) => {
97
- var t, n, o, s;
98
- sessionStorage.setItem("hotentToken", e.accessToken || ""), sessionStorage.setItem("currentUser", JSON.stringify({ token: e.accessToken || "" })), e.info && JSON.stringify(e.info) !== "{}" && sessionStorage.setItem("hotentUserInfo", JSON.stringify({ id: ((t = e.info) == null ? void 0 : t.sub) ?? "", name: ((n = e.info) == null ? void 0 : n.name) ?? "", flag: (o = e.info) == null ? void 0 : o.flag, tenantId: ((s = e.info) == null ? void 0 : s.tenant) ?? "" }));
99
- };
100
- d(!1);
101
- p();
102
- h("das123"), +/* @__PURE__ */ new Date();
103
- const b = () => {
104
- const e = "accessToken", t = "accessTokenExpiredAt", n = "refreshToken", o = "tokenInfo", s = "redirectUri";
105
- return {
106
- getData: () => ({
107
- accessToken: sessionStorage.getItem(e) || "",
108
- accessTokenExpiredAt: Number(sessionStorage.getItem(t) || "0"),
109
- refreshToken: sessionStorage.getItem(n) || "",
110
- info: JSON.parse(
111
- sessionStorage.getItem(o) === "undefined" ? "{}" : sessionStorage.getItem(o) || "{}"
112
- ),
113
- redirectUri: sessionStorage.getItem(s) || ""
114
- }),
115
- save: (i) => {
116
- const r = i.accessTokenExpiredAt || 0;
117
- sessionStorage.setItem(e, i.accessToken || ""), sessionStorage.setItem(t, r.toString()), sessionStorage.setItem(n, i.refreshToken || ""), sessionStorage.setItem(o, JSON.stringify(i.info || {})), i.redirectUri && sessionStorage.setItem(s, i.redirectUri || ""), k(i);
118
- },
119
- remove: () => {
120
- sessionStorage.removeItem(e), sessionStorage.removeItem(t), sessionStorage.removeItem(n), sessionStorage.removeItem(o), sessionStorage.removeItem(s);
121
- }
75
+ var A = I(b, { path: "/" });
76
+ const h = () => A.get("accessToken") ?? "", j = () => {
77
+ const e = f(), n = (e == null ? void 0 : e.infoStrict) ?? !0;
78
+ let t = l().getData().info;
79
+ return n || e.userInfo && (t = e.userInfo), {
80
+ id: t.sub ?? "",
81
+ name: t.name ?? "",
82
+ flag: t.flag,
83
+ tenantId: (t == null ? void 0 : t.tenant) ?? (t == null ? void 0 : t.tenantId) ?? ""
122
84
  };
123
- }, A = () => {
124
- const e = new URL(location.href).searchParams, t = e.get("token") || e.get("accessToken") || e.get("accesstoken") || "";
125
- if (t) {
126
- const n = JSON.stringify({ access_token: t });
127
- sessionStorage.setItem("accessToken", t), sessionStorage.setItem("tokenInfo", n), m.set("accessToken", t), m.set("accessTokenInfo", n);
128
- }
129
- }, v = () => {
130
- const e = JSON.parse(sessionStorage.getItem("projectInfo") || "{}"), t = new URL(location.href).searchParams, n = t.get("project") || t.get("projectId") || "";
131
- if (!n)
132
- return;
133
- const o = t.get("projectParent") || t.get("projectParentId") || (e == null ? void 0 : e.parentId) || "", s = t.get("projectName") || (e == null ? void 0 : e.name) || "";
134
- sessionStorage.setItem("project", n), sessionStorage.setItem("projectInfo", JSON.stringify({ ...e, id: n, name: s, parentId: o }));
135
- }, T = () => m.get("accessToken") ?? "", C = () => {
136
- const e = p(), t = (e == null ? void 0 : e.infoStrict) ?? !0;
137
- let n = b().getData().info;
138
- return t || e.userInfo && (n = e.userInfo), {
139
- id: n.sub ?? "",
140
- name: n.name ?? "",
141
- flag: n.flag,
142
- tenantId: (n == null ? void 0 : n.tenant) ?? (n == null ? void 0 : n.tenantId) ?? ""
143
- };
144
- }, N = () => {
145
- const e = p(), t = (e == null ? void 0 : e.infoStrict) ?? !0;
146
- let n = JSON.parse(sessionStorage.getItem("userInfo") || "{}");
147
- return t || e.personalInfo && (n = e.personalInfo), {
148
- id: n.id ?? "",
149
- name: n.name ?? "",
150
- phone: n.phone ?? "",
151
- userName: n.userName ?? "",
152
- email: n.email ?? "",
153
- headPicture: n.headPicture ?? ""
85
+ }, y = () => {
86
+ const e = f(), n = (e == null ? void 0 : e.infoStrict) ?? !0;
87
+ let t = JSON.parse(sessionStorage.getItem("userInfo") || "{}");
88
+ return n || e.personalInfo && (t = e.personalInfo), {
89
+ id: t.id ?? "",
90
+ name: t.name ?? "",
91
+ phone: t.phone ?? "",
92
+ userName: t.userName ?? "",
93
+ email: t.email ?? "",
94
+ headPicture: t.headPicture ?? ""
154
95
  };
155
- }, w = () => {
96
+ }, R = () => {
156
97
  let e = JSON.parse(sessionStorage.getItem("tenantInfo") || "{}");
157
98
  return {
158
99
  userId: e.id ?? "",
@@ -163,74 +104,74 @@ const b = () => {
163
104
  flag: e.flag ?? null,
164
105
  tenant: e.tenant ?? {}
165
106
  };
166
- }, R = () => {
167
- const e = p(), t = (e == null ? void 0 : e.infoStrict) ?? !0;
168
- let n = JSON.parse(sessionStorage.getItem("projectInfo") || "{}");
169
- return t || e.projectInfo && (n = e.projectInfo), {
170
- id: (n == null ? void 0 : n.id) ?? "",
171
- parentId: (n == null ? void 0 : n.parentId) ?? "",
172
- name: (n == null ? void 0 : n.name) ?? "",
173
- tenantId: (n == null ? void 0 : n.tenant) ?? ""
107
+ }, U = () => {
108
+ const e = f(), n = (e == null ? void 0 : e.infoStrict) ?? !0;
109
+ let t = JSON.parse(sessionStorage.getItem("projectInfo") || "{}");
110
+ return n || e.projectInfo && (t = e.projectInfo), {
111
+ id: (t == null ? void 0 : t.id) ?? "",
112
+ parentId: (t == null ? void 0 : t.parentId) ?? "",
113
+ name: (t == null ? void 0 : t.name) ?? "",
114
+ tenantId: (t == null ? void 0 : t.tenant) ?? ""
174
115
  };
175
- }, U = (e, t) => {
176
- const n = "permission-btn", o = p(), s = O(), i = S(location.href, "app") || "", r = t || i || (window.__IN_MICRO_APP__ ? s.currentSubAppCode : o.title);
116
+ }, _ = (e, n) => {
117
+ const t = "permission-btn", s = f(), o = v(), a = d(location.href, "app") || "", r = n || a || (window.__IN_MICRO_APP__ ? o.currentSubAppCode : s.title);
177
118
  if (!r)
178
119
  return;
179
- const c = S(location.href, "menu") || "", a = e || c || (window.__IN_MICRO_APP__ ? s.currentSubApp.currentMenuCode : JSON.parse(sessionStorage.getItem(`${o.title}-tabs`) || "{}").currentTab.code), f = JSON.parse(sessionStorage.getItem(n) || "{}");
180
- if (!f || JSON.stringify(f) === "{}")
120
+ const i = d(location.href, "menu") || "", c = e || i || (window.__IN_MICRO_APP__ ? o.currentSubApp.currentMenuCode : JSON.parse(sessionStorage.getItem(`${s.title}-tabs`) || "{}").currentTab.code), p = JSON.parse(sessionStorage.getItem(t) || "{}");
121
+ if (!p || JSON.stringify(p) === "{}")
181
122
  return;
182
- const g = f[r][a];
183
- return g && g.length ? g : f[r]["origin-auth"] ? f[r]["origin-auth"][a] ?? [] : [];
184
- }, P = (e, t) => U(e, t) ?? [], O = () => {
185
- var o;
123
+ const u = p[r][c];
124
+ return u && u.length ? u : p[r]["origin-auth"] ? p[r]["origin-auth"][c] ?? [] : [];
125
+ }, M = (e, n) => _(e, n) ?? [], v = () => {
126
+ var s;
186
127
  if (!window.__IN_MICRO_APP__)
187
128
  return {};
188
- const e = JSON.parse(sessionStorage.getItem("subApps") || "{}"), t = ((o = e.appcategorys) == null ? void 0 : o.map((s) => s.apps).flat()) ?? [];
129
+ const e = JSON.parse(sessionStorage.getItem("subApps") || "{}"), n = ((s = e.appcategorys) == null ? void 0 : s.map((o) => o.apps).flat()) ?? [];
189
130
  return {
190
131
  appcategorys: e.appcategorys ?? [],
191
132
  currentSubApp: e.currentSubApp ?? {},
192
133
  currentSubAppCode: e.currentSubAppCode ?? "",
193
- flatSubAppList: t,
134
+ flatSubAppList: n,
194
135
  subAppList: e.subAppList ?? []
195
136
  };
196
- }, L = (e) => {
197
- const t = JSON.parse(sessionStorage.getItem("menus") || "{}");
198
- return e ? t[e] ?? [] : t;
137
+ }, T = (e) => {
138
+ const n = JSON.parse(sessionStorage.getItem("menus") || "{}");
139
+ return e ? n[e] ?? [] : n;
199
140
  }, J = () => {
200
- const e = p();
201
- let t = {};
141
+ const e = f();
142
+ let n = {};
202
143
  if (window.__IN_MICRO_APP__) {
203
- const n = JSON.parse(sessionStorage.getItem("tabs") || "{}");
204
- t = {
205
- activeKey: n.activeKey ?? "",
206
- currentTab: n.currentTab ?? {},
207
- tabMap: n.tabMap ?? {}
144
+ const t = JSON.parse(sessionStorage.getItem("tabs") || "{}");
145
+ n = {
146
+ activeKey: t.activeKey ?? "",
147
+ currentTab: t.currentTab ?? {},
148
+ tabMap: t.tabMap ?? {}
208
149
  };
209
150
  } else {
210
- const n = JSON.parse(sessionStorage.getItem(`${e.title}-tabs`) || "{}");
211
- t = {
212
- activeKey: n.activeKey ?? "",
213
- currentTab: n.currentTab ?? {},
214
- tabList: n.tabList ?? []
151
+ const t = JSON.parse(sessionStorage.getItem(`${e.title}-tabs`) || "{}");
152
+ n = {
153
+ activeKey: t.activeKey ?? "",
154
+ currentTab: t.currentTab ?? {},
155
+ tabList: t.tabList ?? []
215
156
  };
216
157
  }
217
- return t;
218
- }, j = () => {
219
- const e = p(), t = sessionStorage.getItem("minioAddress");
220
- return t || (e.baseURL ? e.baseURL : location.origin);
158
+ return n;
159
+ }, k = () => {
160
+ const e = f(), n = sessionStorage.getItem("minioAddress");
161
+ return n || (e.baseURL ? e.baseURL : location.origin);
221
162
  };
222
- T() || A();
223
- v();
163
+ h() || m();
164
+ S();
224
165
  export {
225
- L as getMenus,
226
- j as getMinioAddress,
227
- U as getPageAuth,
228
- P as getPageAuthBtn,
229
- N as getPersonalInfo,
230
- R as getProjectInfo,
231
- O as getSubApps,
166
+ T as getMenus,
167
+ k as getMinioAddress,
168
+ _ as getPageAuth,
169
+ M as getPageAuthBtn,
170
+ y as getPersonalInfo,
171
+ U as getProjectInfo,
172
+ v as getSubApps,
232
173
  J as getTabInfo,
233
- w as getTenantInfo,
234
- T as getToken,
235
- C as getUserInfo
174
+ R as getTenantInfo,
175
+ h as getToken,
176
+ j as getUserInfo
236
177
  };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 从url获取token
3
+ */
4
+ export declare const getUrlToken: () => void;
5
+ /**
6
+ * 从url上获取project
7
+ */
8
+ export declare const getProjectInfoFromQuery: () => void;
@@ -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[];
@@ -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;
@@ -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;
@@ -20,6 +20,7 @@ const a = (r, n) => {
20
20
  i === s.length - 1 ? t += `${l}=${n[l]}` : t += `${l}=${n[l]}&`;
21
21
  }), t ? e = location.origin + r + `?${t}` : e = location.origin + r, e;
22
22
  }, u = (r, n) => {
23
+ debugger;
23
24
  const e = n || location.href, t = a(e), s = Object.keys(t) || [];
24
25
  if (!s || !s.length)
25
26
  return e.includes("?") ? e.split("?")[0] : e.split("&")[0];
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 判断是否为空值
3
+ * @param value 需要判断的值
4
+ * @returns
5
+ */
6
+ export declare const isEmpty: (value: any) => boolean;
@@ -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';
@@ -1,117 +1,7 @@
1
- const d = (t, n = "yyyy-MM-dd HH:mm:ss") => {
2
- let e = t ? new Date(t) : /* @__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
- }, s = e.getFullYear().toString();
12
- s = s.length >= 4 ? s : "0000".substr(0, 4 - s.length) + s, /(y+)/.test(n) && (n = n.replace(RegExp.$1, (s + "").substr(4 - RegExp.$1.length)));
13
- for (var i in r)
14
- new RegExp("(" + i + ")").test(n) && (n = n.replace(RegExp.$1, RegExp.$1.length === 1 ? r[i] : ("00" + r[i]).substr(("" + r[i]).length)));
15
- return n;
16
- }, f = (t, n) => {
17
- let e = window.location.search || "";
18
- if (t && t !== location.href) {
19
- const s = t.indexOf("?");
20
- s !== -1 ? e = t.slice(s) : e = "";
21
- }
22
- const r = new URLSearchParams(e);
23
- if (n)
24
- return r.get(n);
25
- {
26
- let s = {};
27
- for (let [i, o] of r.entries())
28
- s[i] = o;
29
- return s;
30
- }
31
- }, $ = (t, n = {}) => {
32
- let e = "", r = "";
33
- const s = Object.keys(n);
34
- return s && s.length && s.forEach((i, o) => {
35
- o === s.length - 1 ? r += `${i}=${n[i]}` : r += `${i}=${n[i]}&`;
36
- }), r ? e = location.origin + t + `?${r}` : e = location.origin + t, e;
37
- }, y = (t, n) => {
38
- const e = n || location.href, r = f(e), s = Object.keys(r) || [];
39
- if (!s || !s.length)
40
- return e.includes("?") ? e.split("?")[0] : e.split("&")[0];
41
- let i = s.filter((l) => !t.includes(l));
42
- if (!i || !i.length)
43
- return e.includes("?") ? e.split("?")[0] : e.split("&")[0];
44
- let o = "";
45
- return i.forEach((l, c) => {
46
- c === s.length - 1 ? o += `${l}=${r[l]}` : o += `${l}=${r[l]}&`;
47
- }), e.includes("?") ? e.split("?")[0] + `?${o}` : e.split("&")[0] + `?${o}`;
48
- }, m = (t) => {
49
- const n = new URLSearchParams(t.split("?")[1]), e = {};
50
- for (const [r, s] of n)
51
- e.hasOwnProperty(r) ? Array.isArray(e[r]) ? e[r].push(s) : e[r] = [e[r], s] : e[r] = s;
52
- return e;
53
- }, E = (t) => {
54
- let n = "";
55
- const e = Object.keys(t);
56
- return e && e.length && e.forEach((r, s) => {
57
- s === e.length - 1 ? n += `${r}=${t[r]}` : n += `${r}=${t[r]}&`;
58
- }), n;
59
- }, u = (t, n = "children") => {
60
- let e = [];
61
- for (let r = 0; r < t.length; r++)
62
- t[r][n] && t[r][n].length > 0 && (e.push(t[r]), e = e.concat(u(t[r][n])));
63
- return e;
64
- }, g = (t, n = "children", e = !0) => Array.isArray(t) && t.length ? t.reduce((r, s) => {
65
- let i = s[n], o = { ...s };
66
- return e && delete o[n], i && i.length ? r.concat(o, g(i, n, e)) : r.concat(o);
67
- }, []) : [], h = (t, n, e = "children") => t.filter((r) => n(r)).map((r) => (r = Object.assign({}, r), r[e] && (r[e] = h(r[e], n)), r)), a = (t, n) => {
68
- for (const e of t) {
69
- if (n(e))
70
- return e;
71
- if (e != null && e.children && e.children.length) {
72
- const r = a(e.children, n);
73
- if (r)
74
- return r;
75
- }
76
- }
77
- return null;
78
- }, p = (t, n) => {
79
- if (!t || !n || Object.keys(t).length !== Object.keys(n).length)
80
- return !1;
81
- for (let e in t) {
82
- if (n[e] === void 0)
83
- return !1;
84
- if (typeof n[e] == "function" || typeof t[e] == "function")
85
- throw new Error("type error");
86
- if (typeof n[e] != typeof t[e])
87
- return !1;
88
- if (typeof t[e] == "object")
89
- return p(t[e], n[e]);
90
- if (t[e] !== n[e])
91
- return !1;
92
- }
93
- return !0;
94
- }, w = (t, n, e = !0) => t.length !== n.length ? !1 : e ? t.sort().toString() === n.sort().toString() : t.toString() === n.toString(), j = (t, n) => {
95
- const e = /* @__PURE__ */ new Map();
96
- return t.filter((r) => !e.has(r[n]) && e.set(r[n], 1));
97
- }, H = (t) => t === null || typeof t > "u" || t === "", M = (t) => {
98
- let n = "", e = "";
99
- t != null && t.minWidth && (n = t.minWidth), t != null && t.minHeight && (e = t.minHeight), document.documentElement.style.minWidth = n, document.documentElement.style.minHeight = e;
100
- };
101
- export {
102
- w as arrEqual,
103
- j as arrUnique,
104
- d as dateFormat,
105
- h as filterTreeArray,
106
- u as findNonEmptyChildrenItems,
107
- g as flatTree,
108
- y as funcUrlDel,
109
- $ as getFullPath,
110
- f as getUrlParams,
111
- H as isEmpty,
112
- p as objEqual,
113
- E as objectToUrlparams,
114
- M as setHtmlMinWH,
115
- a as treeFind,
116
- m as urlParamsToObject
117
- };
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";