@das-fed/utils 1.0.7 → 1.0.9

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.
@@ -1457,13 +1457,13 @@ const Te = (e) => new URL(location.href).searchParams.get(e), ue = {
1457
1457
  // 重定向到登录页
1458
1458
  token: "/api/justauth/oauth-server/v1/visitor/oauth/token"
1459
1459
  // 通过code获取token
1460
- }, x = We(!1), { baseURL: En, mainAppName: Sn, microAppName: bn } = ne(), te = Sn || window.__IN_MICRO_APP__ ? `${location.origin}/` : location.origin + location.pathname, H = {
1460
+ }, x = We(!1), { baseURL: En, mainAppName: Nn, microAppName: Sn } = ne(), te = `${location.origin}/`, H = {
1461
1461
  response_type: "code",
1462
1462
  scope: "sever",
1463
1463
  client_id: "sys",
1464
1464
  client_secret: Xe("das123"),
1465
1465
  state: +/* @__PURE__ */ new Date()
1466
- }, gn = async (e, t, n, r) => {
1466
+ }, bn = async (e, t, n, r) => {
1467
1467
  const s = Qe(location.href, "kingdee_token") || "";
1468
1468
  let o = {};
1469
1469
  const i = {
@@ -1515,10 +1515,10 @@ const Te = (e) => new URL(location.href).searchParams.get(e), ue = {
1515
1515
  const t = fe(), { accessTokenExpiredAt: n, redirectUri: r } = F().getData(), s = Te("code") || "", o = !!Te("keep_login");
1516
1516
  x.value = !0;
1517
1517
  const i = JSON.parse(sessionStorage.getItem("noLogin-page")) || [];
1518
- if ((!t || n === 0) && bn !== "oauth" && !i.includes(location.pathname) && !s)
1518
+ if ((!t || n === 0) && Sn !== "oauth" && !i.includes(location.pathname) && !s)
1519
1519
  return le({ ...H, redirect_uri: te });
1520
1520
  if (n > 0 && +/* @__PURE__ */ new Date() + 60 * 1e3 > n)
1521
- return Rn(H);
1521
+ return gn(H);
1522
1522
  if (t)
1523
1523
  return t;
1524
1524
  if (!s) {
@@ -1526,7 +1526,7 @@ const Te = (e) => new URL(location.href).searchParams.get(e), ue = {
1526
1526
  return;
1527
1527
  }
1528
1528
  try {
1529
- const f = await gn(s, H, r, o);
1529
+ const f = await bn(s, H, r, o);
1530
1530
  return x.value = !1, f;
1531
1531
  } catch {
1532
1532
  x.value = !1;
@@ -1536,7 +1536,7 @@ const Te = (e) => new URL(location.href).searchParams.get(e), ue = {
1536
1536
  e.logout = "true", n && (e.locale = "locale");
1537
1537
  const r = Object.keys(e).filter((o) => o !== "client_secret").map((o) => `${o}=${e[o]}`).join("&"), s = `${t}${ue.oauth}?${r}`;
1538
1538
  Ye(), sessionStorage.clear(), F().save({ redirectUri: e.redirect_uri }), window.__isAutoCloseApp = !1, location.replace(s);
1539
- }, Rn = async (e) => {
1539
+ }, gn = async (e) => {
1540
1540
  const { baseURL: t } = ne(), { refreshToken: n, redirectUri: r } = F().getData();
1541
1541
  e.redirect_uri = r;
1542
1542
  try {
@@ -1583,7 +1583,7 @@ const Te = (e) => new URL(location.href).searchParams.get(e), ue = {
1583
1583
  export {
1584
1584
  Te as getQuery,
1585
1585
  Pn as getToken,
1586
- gn as getTokenFromCode,
1586
+ bn as getTokenFromCode,
1587
1587
  H as getTokenParams,
1588
1588
  le as login,
1589
1589
  te as real_uri,
@@ -1,4 +1,4 @@
1
- import type { UserInfo, PersonalInfo, TenantInfo, ProjectInfo, SubAppsInfo, TabInfo, permissionBtnInfo } from './type';
1
+ import type { UserInfo, PersonalInfo, TenantInfo, ProjectInfo, SubAppsInfo, permissionBtnInfo } from './type';
2
2
  /** 获取token */
3
3
  export declare const getToken: () => string;
4
4
  /** 获取token详情 */
@@ -27,7 +27,7 @@ export declare const getPageAuth: (menuCode?: string, applicationCode?: string)
27
27
  */
28
28
  export declare const getPageAuthBtn: (menuCode?: string, applicationCode?: string) => permissionBtnInfo;
29
29
  /**
30
- * 获取应用信息(独立打开子应用不可用)
30
+ * 获取应用信息
31
31
  * @returns 应用信息
32
32
  */
33
33
  export declare const getSubApps: () => SubAppsInfo;
@@ -36,7 +36,7 @@ export declare const getSubApps: () => SubAppsInfo;
36
36
  * @param appCode 应用编码
37
37
  */
38
38
  export declare const getMenus: (appCode?: string) => any;
39
- /** 获取tabs标签页信息 */
40
- export declare const getTabInfo: () => TabInfo;
39
+ /** 获取tabs标签页 */
40
+ export declare const getTabInfo: () => any;
41
41
  /** 获取minio地址 */
42
42
  export declare const getMinioAddress: () => any;
@@ -1,17 +1,17 @@
1
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";
2
+ import { getConfig as u } from "@das-fed/utils/config";
3
+ import { getUrlParams as I } from "@das-fed/utils/common-tools";
4
4
  import { getUrlToken as m, getProjectInfoFromQuery as S } from "@das-fed/utils/common-info/setInfoFromUrl";
5
5
  /*! js-cookie v3.0.5 | MIT */
6
- function g(e) {
6
+ function f(e) {
7
7
  for (var n = 1; n < arguments.length; n++) {
8
- var r = arguments[n];
9
- for (var s in r)
10
- e[s] = r[s];
8
+ var s = arguments[n];
9
+ for (var c in s)
10
+ e[c] = s[c];
11
11
  }
12
12
  return e;
13
13
  }
14
- var b = {
14
+ var h = {
15
15
  read: function(e) {
16
16
  return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
17
17
  },
@@ -22,48 +22,48 @@ var b = {
22
22
  );
23
23
  }
24
24
  };
25
- function I(e, n) {
26
- function r(o, a, t) {
25
+ function d(e, n) {
26
+ function s(r, i, t) {
27
27
  if (!(typeof document > "u")) {
28
- t = g({}, 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);
29
- var i = "";
30
- for (var c in t)
31
- t[c] && (i += "; " + c, t[c] !== !0 && (i += "=" + t[c].split(";")[0]));
32
- return document.cookie = o + "=" + e.write(a, o) + i;
28
+ t = f({}, n, t), typeof t.expires == "number" && (t.expires = new Date(Date.now() + t.expires * 864e5)), t.expires && (t.expires = t.expires.toUTCString()), r = encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
29
+ var a = "";
30
+ for (var o in t)
31
+ t[o] && (a += "; " + o, t[o] !== !0 && (a += "=" + t[o].split(";")[0]));
32
+ return document.cookie = r + "=" + e.write(i, r) + a;
33
33
  }
34
34
  }
35
- function s(o) {
36
- if (!(typeof document > "u" || arguments.length && !o)) {
37
- for (var a = document.cookie ? document.cookie.split("; ") : [], t = {}, i = 0; i < a.length; i++) {
38
- var c = a[i].split("="), p = c.slice(1).join("=");
35
+ function c(r) {
36
+ if (!(typeof document > "u" || arguments.length && !r)) {
37
+ for (var i = document.cookie ? document.cookie.split("; ") : [], t = {}, a = 0; a < i.length; a++) {
38
+ var o = i[a].split("="), p = o.slice(1).join("=");
39
39
  try {
40
- var u = decodeURIComponent(c[0]);
41
- if (t[u] = e.read(p, u), o === u)
40
+ var g = decodeURIComponent(o[0]);
41
+ if (t[g] = e.read(p, g), r === g)
42
42
  break;
43
43
  } catch {
44
44
  }
45
45
  }
46
- return o ? t[o] : t;
46
+ return r ? t[r] : t;
47
47
  }
48
48
  }
49
49
  return Object.create(
50
50
  {
51
- set: r,
52
- get: s,
53
- remove: function(o, a) {
54
- r(
55
- o,
51
+ set: s,
52
+ get: c,
53
+ remove: function(r, i) {
54
+ s(
55
+ r,
56
56
  "",
57
- g({}, a, {
57
+ f({}, i, {
58
58
  expires: -1
59
59
  })
60
60
  );
61
61
  },
62
- withAttributes: function(o) {
63
- return I(this.converter, g({}, this.attributes, o));
62
+ withAttributes: function(r) {
63
+ return d(this.converter, f({}, this.attributes, r));
64
64
  },
65
- withConverter: function(o) {
66
- return I(g({}, this.converter, o), this.attributes);
65
+ withConverter: function(r) {
66
+ return d(f({}, this.converter, r), this.attributes);
67
67
  }
68
68
  },
69
69
  {
@@ -72,20 +72,20 @@ function I(e, n) {
72
72
  }
73
73
  );
74
74
  }
75
- var A = I(b, { path: "/" });
76
- const h = () => A.get("accessToken") ?? "", w = () => {
77
- var s;
78
- let e = (s = l().getData()) == null ? void 0 : s.info;
79
- const n = f();
75
+ var A = d(h, { path: "/" });
76
+ const b = () => A.get("accessToken") ?? "", y = () => {
77
+ var c;
78
+ let e = (c = l().getData()) == null ? void 0 : c.info;
79
+ const n = u();
80
80
  return JSON.stringify(e) === "{}" && n.userInfo && (e = n.userInfo), {
81
81
  id: e.sub ?? "",
82
82
  name: e.name ?? "",
83
83
  flag: e.flag,
84
84
  tenantId: (e == null ? void 0 : e.tenant) ?? (e == null ? void 0 : e.tenantId) ?? ""
85
85
  };
86
- }, J = () => {
86
+ }, T = () => {
87
87
  let e = JSON.parse(sessionStorage.getItem("userInfo") || "{}");
88
- const n = f();
88
+ const n = u();
89
89
  return JSON.stringify(e) === "{}" && n.personalInfo && (e = n.personalInfo), {
90
90
  id: e.id ?? "",
91
91
  name: e.name ?? "",
@@ -94,7 +94,7 @@ const h = () => A.get("accessToken") ?? "", w = () => {
94
94
  email: e.email ?? "",
95
95
  headPicture: e.headPicture ?? ""
96
96
  };
97
- }, j = () => {
97
+ }, k = () => {
98
98
  let e = JSON.parse(sessionStorage.getItem("tenantInfo") || "{}");
99
99
  return {
100
100
  userId: e.id ?? "",
@@ -105,74 +105,62 @@ const h = () => A.get("accessToken") ?? "", w = () => {
105
105
  flag: e.flag ?? null,
106
106
  tenant: e.tenant ?? {}
107
107
  };
108
- }, R = () => {
108
+ }, x = () => {
109
109
  let e = JSON.parse(sessionStorage.getItem("projectInfo") || "{}");
110
- const n = f();
110
+ const n = u();
111
111
  return JSON.stringify(e) === "{}" && n.projectInfo && (e = n.projectInfo), {
112
112
  id: (e == null ? void 0 : e.id) ?? "",
113
113
  parentId: (e == null ? void 0 : e.parentId) ?? "",
114
114
  name: (e == null ? void 0 : e.name) ?? "",
115
115
  tenantId: (e == null ? void 0 : e.tenant) ?? ""
116
116
  };
117
- }, _ = (e, n) => {
118
- const r = "permission-btn", s = f(), o = v(), a = d(location.href, "app") || "", t = n || a || (window.__IN_MICRO_APP__ ? o.currentSubAppCode : s.title);
119
- if (!t)
117
+ }, C = (e, n) => {
118
+ const s = "permission-btn";
119
+ u();
120
+ const c = v(), r = I(location.href, "app") || "", i = n || r || c.currentSubAppCode;
121
+ if (!i)
120
122
  return;
121
- 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(r) || "{}");
122
- if (!p || JSON.stringify(p) === "{}")
123
+ const t = I(location.href, "menu") || "", a = e || t || c.currentSubApp.currentMenuCode, o = JSON.parse(sessionStorage.getItem(s) || "{}");
124
+ if (!o || JSON.stringify(o) === "{}")
123
125
  return;
124
- const u = p[t][c];
125
- return u && u.length ? u : p[t]["origin-auth"] ? p[t]["origin-auth"][c] ?? [] : [];
126
- }, U = (e, n) => _(e, n) ?? [], v = () => {
127
- var s;
128
- if (!window.__IN_MICRO_APP__)
129
- return {};
130
- const e = JSON.parse(sessionStorage.getItem("subApps") || "{}"), n = ((s = e.appcategorys) == null ? void 0 : s.map((o) => o.apps).flat()) ?? [];
126
+ const p = o[i][a];
127
+ return p && p.length ? p : o[i]["origin-auth"] ? o[i]["origin-auth"][a] ?? [] : [];
128
+ }, P = (e, n) => C(e, n) ?? [], v = () => {
129
+ const e = JSON.parse(sessionStorage.getItem("subApps") || "{}");
131
130
  return {
132
131
  appcategorys: e.appcategorys ?? [],
133
132
  currentSubApp: e.currentSubApp ?? {},
134
133
  currentSubAppCode: e.currentSubAppCode ?? "",
135
- flatSubAppList: n,
136
134
  subAppList: e.subAppList ?? []
137
135
  };
138
- }, M = (e) => {
136
+ }, R = (e) => {
139
137
  const n = JSON.parse(sessionStorage.getItem("menus") || "{}");
140
138
  return e ? n[e] ?? [] : n;
141
- }, T = () => {
142
- const e = f();
143
- let n = {};
144
- if (window.__IN_MICRO_APP__) {
145
- const r = JSON.parse(sessionStorage.getItem("tabs") || "{}");
146
- n = {
147
- activeKey: r.activeKey ?? "",
148
- currentTab: r.currentTab ?? {},
149
- tabMap: r.tabMap ?? {}
150
- };
151
- } else {
152
- const r = JSON.parse(sessionStorage.getItem(`${e.title}-tabs`) || "{}");
153
- n = {
154
- activeKey: r.activeKey ?? "",
155
- currentTab: r.currentTab ?? {},
156
- tabList: r.tabList ?? []
157
- };
158
- }
159
- return n;
160
- }, k = () => {
161
- const e = f(), n = sessionStorage.getItem("minioAddress");
139
+ }, M = () => {
140
+ let e = {};
141
+ const n = JSON.parse(sessionStorage.getItem("tabs") || "{}");
142
+ return e = {
143
+ currentCode: n.currentCode ?? "",
144
+ currentTab: n.currentTab ?? {},
145
+ tabMap: n.tabMap ?? {},
146
+ preTab: n.preTab ?? {}
147
+ }, e;
148
+ }, w = () => {
149
+ const e = u(), n = sessionStorage.getItem("minioAddress");
162
150
  return n || (e.baseURL ? e.baseURL : location.origin);
163
151
  };
164
- h() || m();
152
+ b() || m();
165
153
  S();
166
154
  export {
167
- M as getMenus,
168
- k as getMinioAddress,
169
- _ as getPageAuth,
170
- U as getPageAuthBtn,
171
- J as getPersonalInfo,
172
- R as getProjectInfo,
155
+ R as getMenus,
156
+ w as getMinioAddress,
157
+ C as getPageAuth,
158
+ P as getPageAuthBtn,
159
+ T as getPersonalInfo,
160
+ x as getProjectInfo,
173
161
  v as getSubApps,
174
- T as getTabInfo,
175
- j as getTenantInfo,
176
- h as getToken,
177
- w as getUserInfo
162
+ M as getTabInfo,
163
+ k as getTenantInfo,
164
+ b as getToken,
165
+ y as getUserInfo
178
166
  };
@@ -0,0 +1,45 @@
1
+ /** 存储当前租户详情 */
2
+ export declare const setTenantInfo: (data?: {}) => void;
3
+ /** 存储首页信息 */
4
+ export declare const setHomeInfo: (data?: {}) => void;
5
+ /** 存储项目信息 */
6
+ export declare const setProjectInfo: (data?: {
7
+ id: string;
8
+ }) => void;
9
+ /** 存储标签页信息 */
10
+ export declare const setTabs: (options: any) => void;
11
+ /**
12
+ * 存储应用数据
13
+ * @param options
14
+ */
15
+ export declare const setSubApps: (options: any) => void;
16
+ /** 设置应用当前选中菜单 */
17
+ export declare const setSubAppsCurrentMenuCode: (value: string) => void;
18
+ /**
19
+ * 存储菜单数据
20
+ * @param data 菜单list
21
+ * @param code 当前子应用code
22
+ * @returns
23
+ */
24
+ export declare const setMenus: (data: any[], code: string) => any;
25
+ /**
26
+ * 存储权限按钮数据
27
+ * @param data 菜单list
28
+ * @param code 当前子应用code
29
+ * @returns
30
+ */
31
+ export declare const setPermissionBtns: (data: any[], code: string) => any;
32
+ /**
33
+ * 存储面包屑显示、隐藏数据
34
+ * @param flatMenuList 拍平的菜单list
35
+ * @param code 当前子应用code
36
+ * @returns
37
+ */
38
+ export declare const setBreadcrumb: (flatMenuList: any[], code: string) => any;
39
+ /**
40
+ * 存储页签风格数据
41
+ * @param flatMenuList 拍平的菜单list
42
+ * @param code 当前子应用code
43
+ * @returns
44
+ */
45
+ export declare const setTabStyle: (flatMenuList: any[], code: string) => any;
@@ -0,0 +1,103 @@
1
+ import { flatTree as y } from "@das-fed/utils/common-tools";
2
+ import { getTabInfo as A, getSubApps as h } from "@das-fed/utils/common-info";
3
+ const v = (n = {}) => {
4
+ sessionStorage.setItem("tenantInfo", JSON.stringify(n));
5
+ }, I = (n = {}) => {
6
+ sessionStorage.setItem("home-config", JSON.stringify(n));
7
+ }, M = (n = { id: "" }) => {
8
+ sessionStorage.setItem("projectInfo", JSON.stringify(n)), sessionStorage.setItem("project", n.id);
9
+ }, J = (n) => {
10
+ let s = A();
11
+ Array.isArray(n) ? n.forEach((e) => {
12
+ var t;
13
+ if (e.key.startsWith("tabMap")) {
14
+ const o = e.key.split(":")[1];
15
+ if (Array.isArray(e.value))
16
+ s.tabMap[o] = e.value;
17
+ else if ((t = s.tabMap[o]) != null && t.length) {
18
+ const i = s.tabMap[o].findIndex((f) => f.code === e.value.code);
19
+ i !== -1 ? s.tabMap[o].splice(i, 1, e.value) : s.tabMap[o].push(e.value);
20
+ } else
21
+ s.tabMap[o] = [e.value];
22
+ } else if (e.key.startsWith("preTab")) {
23
+ const o = e.key.split(":")[1];
24
+ s.preTab || (s.preTab = {}), s.preTab[o] = e.value;
25
+ } else
26
+ Object.assign(s, { [e.key]: e.value });
27
+ }) : Object.assign(s, { [n.key]: n.value }), sessionStorage.setItem("tabs", JSON.stringify(s));
28
+ }, N = (n) => {
29
+ let s = h();
30
+ Array.isArray(n) ? n.forEach((e) => {
31
+ if (e.key === "subAppList" && !Array.isArray(e.value)) {
32
+ const t = s.subAppList.findIndex((o) => o.code === e.value.code);
33
+ t !== -1 ? s.subAppList.splice(t, 1, e.value) : s.subAppList.push(e.value);
34
+ } else
35
+ Object.assign(s, { [e.key]: e.value });
36
+ }) : Object.assign(s, { [n.key]: n.value }), sessionStorage.setItem("subApps", JSON.stringify(s));
37
+ }, k = (n) => {
38
+ let s = h();
39
+ s.currentSubApp.currentMenuCode = n;
40
+ for (const e in s.subAppList)
41
+ s.subAppList[e].code === s.currentSubAppCode && (s.subAppList[e].currentMenuCode = n);
42
+ sessionStorage.setItem("subApps", JSON.stringify(s));
43
+ }, E = (n, s) => {
44
+ const e = "menus", t = JSON.parse(sessionStorage.getItem(e) || "{}") || {};
45
+ return t[s] = n, sessionStorage.setItem(e, JSON.stringify(t)), t;
46
+ }, L = (n, s) => {
47
+ const e = "permission-btn", t = JSON.parse(sessionStorage.getItem(e) || "{}") || {}, o = n != null && n.length ? n.filter((r) => r.routeUrl) : [], i = n != null && n.length ? n.filter((r) => !r.routeUrl && r.children).map((r) => r.children).flat() : [], f = [...o, ...i], c = {};
48
+ return f.forEach((r) => {
49
+ var S;
50
+ const p = r.code, u = (r == null ? void 0 : r.originalCode) ?? "";
51
+ c[p] || (c[p] = []);
52
+ let g = [];
53
+ r != null && r.children && ((S = r == null ? void 0 : r.children) != null && S.length) && (r.children.forEach((a) => {
54
+ var l;
55
+ !(a != null && a.children) || !((l = a.children) != null && l.length) ? g.push({
56
+ code: a.code,
57
+ originalCode: a.originalCode,
58
+ name: a.name
59
+ }) : y([a]).forEach((b) => {
60
+ g.push({
61
+ code: b.code,
62
+ originalCode: b.originalCode,
63
+ name: b.name
64
+ });
65
+ });
66
+ }), g.forEach((a) => {
67
+ let l = a.originalCode ? a.originalCode : a.code ? a.code : "";
68
+ l.includes(p + ".") && (l = l.replace(p + ".", "").replaceAll(".", "-")), l.includes(u + ".") && (l = l.replace(u + ".", "").replaceAll(".", "-"));
69
+ const d = {
70
+ code: l,
71
+ name: a.name
72
+ };
73
+ c[p].push(d), u && p !== u && (c["origin-auth"] || (c["origin-auth"] = {}), c["origin-auth"][u] || (c["origin-auth"][u] = []), c["origin-auth"][u].push(d));
74
+ }));
75
+ }), t[s] = c, sessionStorage.setItem(e, JSON.stringify(t)), t;
76
+ }, T = (n, s) => {
77
+ const e = "breadcrumb", t = n.filter((i) => i.routeUrl), o = JSON.parse(sessionStorage.getItem(e) || "{}") || {};
78
+ return t.forEach((i) => {
79
+ const c = ((i == null ? void 0 : i.style) ?? 1) === 1, r = i.code;
80
+ o[s] || (o[s] = {}), o[s][r] = c;
81
+ }), sessionStorage.setItem(e, JSON.stringify(o)), o;
82
+ }, j = (n, s) => {
83
+ const e = "tabStyle", t = n.filter((i) => i.routeUrl), o = JSON.parse(sessionStorage.getItem(e) || "{}") || {};
84
+ return t.forEach((i) => {
85
+ const f = i.code, c = {
86
+ fontColor: i.fontColor,
87
+ backgroundColor: i.backgroundColor
88
+ };
89
+ o[s] || (o[s] = {}), o[s][f] = c;
90
+ }), sessionStorage.setItem(e, JSON.stringify(o)), o;
91
+ };
92
+ export {
93
+ T as setBreadcrumb,
94
+ I as setHomeInfo,
95
+ E as setMenus,
96
+ L as setPermissionBtns,
97
+ M as setProjectInfo,
98
+ N as setSubApps,
99
+ k as setSubAppsCurrentMenuCode,
100
+ j as setTabStyle,
101
+ J as setTabs,
102
+ v as setTenantInfo
103
+ };
@@ -5,3 +5,4 @@ export * from '@das-fed/utils/common-tools/obj-tools';
5
5
  export * from '@das-fed/utils/common-tools/arr-tools';
6
6
  export * from '@das-fed/utils/common-tools/handle-data';
7
7
  export * from '@das-fed/utils/common-tools/setHtmlMinWH';
8
+ export * from '@das-fed/utils/common-tools/queue-promise';
@@ -5,3 +5,4 @@ export * from "@das-fed/utils/common-tools/obj-tools";
5
5
  export * from "@das-fed/utils/common-tools/arr-tools";
6
6
  export * from "@das-fed/utils/common-tools/handle-data";
7
7
  export * from "@das-fed/utils/common-tools/setHtmlMinWH";
8
+ export * from "@das-fed/utils/common-tools/queue-promise";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 串行执行promise
3
+ * @param promiseFuncArr promise数组
4
+ * @returns promise
5
+ */
6
+ export declare function runPromiseByQueue(promiseFuncArr: any[]): Promise<unknown>;
@@ -0,0 +1,9 @@
1
+ function c(r) {
2
+ const e = [];
3
+ return new Promise((n, u) => {
4
+ r.reduce((t, o) => t.then(o).then((s) => e.push(s)), Promise.resolve()).then(() => n(e));
5
+ });
6
+ }
7
+ export {
8
+ c as runPromiseByQueue
9
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@das-fed/utils",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -9,8 +9,8 @@
9
9
  "license": "ISC",
10
10
  "dependencies": {
11
11
  "@antv/x6": "^2.18.1",
12
- "@das-fed/ui": "1.1.3",
13
- "@das-fed/utils": "1.0.7",
12
+ "@das-fed/ui": "1.1.4",
13
+ "@das-fed/utils": "1.0.9",
14
14
  "@vue/shared": "^3.4.21",
15
15
  "axios": "^1.6.7",
16
16
  "dayjs": "^1.11.10",
@@ -22,6 +22,7 @@
22
22
  "devDependencies": {
23
23
  "@vitejs/plugin-vue": "^5.0.4",
24
24
  "consola": "^3.2.3",
25
+ "ant-design-vue": "3.2.20",
25
26
  "element-plus": "2.4.2",
26
27
  "fast-glob": "^3.3.2",
27
28
  "fs-extra": "^11.2.0",