@das-fed/utils 1.0.8 → 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.
@@ -1,21 +1,21 @@
1
- export { appManage } from './app-manage';
2
- export { authentication } from './authentication';
3
- export { bemsModules } from './bems';
4
- export { contract } from './contract';
5
- export { dutyModules } from './duty-manage';
6
- export { enterpriseright } from './enterpriseright';
7
- export { downloadFile, useFile } from './file';
8
- export { gatewayEdge } from './gateway-edge';
9
- export { iot, iotMinio, iotModules, iotProgress, iotRelationModules } from './iot';
10
- export { justauth, oauthServer } from './justauth';
11
- export { knowledgeBase } from './knowledge';
12
- export { daslink } from './link';
13
- export { permission } from './permission';
14
- export { company, customer, customerGrade, customerType, projectManage } from './platformManage';
15
- export { portal } from './portal';
16
- export { spaceManage } from './space-manage';
17
- export { superadminLicense, superadminPermission, superadminPortal, superadminResource } from './super-admin';
18
- export { supplier, supplierClassification, supplierManage } from './supplier';
19
- export { enterpriseadminBrandModel } from './supplychain-manage';
20
- export { tool } from './tool';
21
- export { systemConfiguration } from './systemConfiguration';
1
+ export { appManage } from '@das-fed/utils/api-services/modules/app-manage';
2
+ export { authentication } from '@das-fed/utils/api-services/modules/authentication';
3
+ export { bemsModules } from '@das-fed/utils/api-services/modules/bems';
4
+ export { contract } from '@das-fed/utils/api-services/modules/contract';
5
+ export { dutyModules } from '@das-fed/utils/api-services/modules/duty-manage';
6
+ export { enterpriseright } from '@das-fed/utils/api-services/modules/enterpriseright';
7
+ export { downloadFile, useFile } from '@das-fed/utils/api-services/modules/file';
8
+ export { gatewayEdge } from '@das-fed/utils/api-services/modules/gateway-edge';
9
+ export { iot, iotMinio, iotModules, iotProgress, iotRelationModules } from '@das-fed/utils/api-services/modules/iot';
10
+ export { justauth, oauthServer } from '@das-fed/utils/api-services/modules/justauth';
11
+ export { knowledgeBase } from '@das-fed/utils/api-services/modules/knowledge';
12
+ export { daslink } from '@das-fed/utils/api-services/modules/link';
13
+ export { permission } from '@das-fed/utils/api-services/modules/permission';
14
+ export { company, customer, customerGrade, customerType, projectManage, } from '@das-fed/utils/api-services/modules/platformManage';
15
+ export { portal } from '@das-fed/utils/api-services/modules/portal';
16
+ export { spaceManage } from '@das-fed/utils/api-services/modules/space-manage';
17
+ export { superadminLicense, superadminPermission, superadminPortal, superadminResource, } from '@das-fed/utils/api-services/modules/super-admin';
18
+ export { supplier, supplierClassification, supplierManage } from '@das-fed/utils/api-services/modules/supplier';
19
+ export { enterpriseadminBrandModel } from '@das-fed/utils/api-services/modules/supplychain-manage';
20
+ export { tool } from '@das-fed/utils/api-services/modules/tool';
21
+ export { systemConfiguration } from '@das-fed/utils/api-services/modules/systemConfiguration';
@@ -1,560 +1,59 @@
1
- import { createService as o } from "@das-fed/utils/api-services";
2
- import { ref as U } from "vue";
3
- const ue = "v1", Be = o(`/api/app-manager/application/${ue}`), le = "v1", He = o(`/api/license/admin/${le}`), pe = "v1", se = `/api/bems/data-manage/${pe}`, Ye = {
4
- energyType: o(`${se}/energy-type`),
5
- energyObject: o(`${se}/energy-object`),
6
- energyDimension: o(`${se}/energy-dimension`)
7
- }, de = "v1", Ie = o(`/api/supply/contract/${de}`), Q = "v1", Ne = {
8
- classes: o(`/api/duty-manage/classes/${Q}`),
9
- // 班次管理
10
- group: o(`/api/duty-manage/group/${Q}`),
11
- // 分组管理
12
- scheduling: o(`/api/duty-manage/scheduling/${Q}`),
13
- // 排班管理
14
- shift: o(`/api/duty-manage/shift/${Q}`)
15
- // 交接班管理
16
- }, fe = "v1", Ee = o(`/api/enterpriseright/permission/${fe}`), C = "v1", We = o(`/api/iot/${C}`), ze = {
17
- thingmodel: o(`/api/iot-device/thingmodel/${C}`),
18
- deviceManage: o(`/api/iot-device/devicemanage/${C}`),
19
- product: o(`/api/iot-device/product/${C}`),
20
- productStorage: o(`/api/iot-device/product-storage/${C}`)
21
- }, Ke = {
22
- projectDevice: o(`/api/device-relation/deviceproject/${C}`),
23
- deviceRules: o(`/api/device-relation/devicerule/${C}`),
24
- project: o(`/api/device-relation/project/${C}`)
25
- }, ne = o(`/api/oss/minio/${C}`), me = o(`/api/progress/accessor/${C}`);
26
- let he = (p = 21) => {
27
- let d = "", v = crypto.getRandomValues(new Uint8Array(p));
28
- for (; p--; ) {
29
- let l = v[p] & 63;
30
- l < 36 ? d += l.toString(36) : l < 62 ? d += (l - 26).toString(36).toUpperCase() : l < 63 ? d += "_" : d += "-";
31
- }
32
- return d;
33
- };
34
- var ve = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
35
- function $e(p) {
36
- return p && p.__esModule && Object.prototype.hasOwnProperty.call(p, "default") ? p.default : p;
37
- }
38
- var oe = { exports: {} };
39
- (function(p, d) {
40
- (function(v, l) {
41
- p.exports = l();
42
- })(ve, function() {
43
- var v = 1e3, l = 6e4, T = 36e5, w = "millisecond", j = "second", S = "minute", L = "hour", b = "day", P = "week", D = "month", W = "quarter", x = "year", H = "date", V = "Invalid Date", Z = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, ee = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, te = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(s) {
44
- var t = ["th", "st", "nd", "rd"], e = s % 100;
45
- return "[" + s + (t[(e - 20) % 10] || t[e] || t[0]) + "]";
46
- } }, K = function(s, t, e) {
47
- var r = String(s);
48
- return !r || r.length >= t ? s : "" + Array(t + 1 - r.length).join(e) + s;
49
- }, z = { s: K, z: function(s) {
50
- var t = -s.utcOffset(), e = Math.abs(t), r = Math.floor(e / 60), n = e % 60;
51
- return (t <= 0 ? "+" : "-") + K(r, 2, "0") + ":" + K(n, 2, "0");
52
- }, m: function s(t, e) {
53
- if (t.date() < e.date())
54
- return -s(e, t);
55
- var r = 12 * (e.year() - t.year()) + (e.month() - t.month()), n = t.clone().add(r, D), a = e - n < 0, i = t.clone().add(r + (a ? -1 : 1), D);
56
- return +(-(r + (e - n) / (a ? n - i : i - n)) || 0);
57
- }, a: function(s) {
58
- return s < 0 ? Math.ceil(s) || 0 : Math.floor(s);
59
- }, p: function(s) {
60
- return { M: D, y: x, w: P, d: b, D: H, h: L, m: S, s: j, ms: w, Q: W }[s] || String(s || "").toLowerCase().replace(/s$/, "");
61
- }, u: function(s) {
62
- return s === void 0;
63
- } }, Y = "en", _ = {};
64
- _[Y] = te;
65
- var q = "$isDayjsObject", F = function(s) {
66
- return s instanceof $ || !(!s || !s[q]);
67
- }, f = function s(t, e, r) {
68
- var n;
69
- if (!t)
70
- return Y;
71
- if (typeof t == "string") {
72
- var a = t.toLowerCase();
73
- _[a] && (n = a), e && (_[a] = e, n = a);
74
- var i = t.split("-");
75
- if (!n && i.length > 1)
76
- return s(i[0]);
77
- } else {
78
- var m = t.name;
79
- _[m] = t, n = m;
80
- }
81
- return !r && n && (Y = n), n || !r && Y;
82
- }, c = function(s, t) {
83
- if (F(s))
84
- return s.clone();
85
- var e = typeof t == "object" ? t : {};
86
- return e.date = s, e.args = arguments, new $(e);
87
- }, u = z;
88
- u.l = f, u.i = F, u.w = function(s, t) {
89
- return c(s, { locale: t.$L, utc: t.$u, x: t.$x, $offset: t.$offset });
90
- };
91
- var $ = function() {
92
- function s(e) {
93
- this.$L = f(e.locale, null, !0), this.parse(e), this.$x = this.$x || e.x || {}, this[q] = !0;
94
- }
95
- var t = s.prototype;
96
- return t.parse = function(e) {
97
- this.$d = function(r) {
98
- var n = r.date, a = r.utc;
99
- if (n === null)
100
- return /* @__PURE__ */ new Date(NaN);
101
- if (u.u(n))
102
- return /* @__PURE__ */ new Date();
103
- if (n instanceof Date)
104
- return new Date(n);
105
- if (typeof n == "string" && !/Z$/i.test(n)) {
106
- var i = n.match(Z);
107
- if (i) {
108
- var m = i[2] - 1 || 0, h = (i[7] || "0").substring(0, 3);
109
- return a ? new Date(Date.UTC(i[1], m, i[3] || 1, i[4] || 0, i[5] || 0, i[6] || 0, h)) : new Date(i[1], m, i[3] || 1, i[4] || 0, i[5] || 0, i[6] || 0, h);
110
- }
111
- }
112
- return new Date(n);
113
- }(e), this.init();
114
- }, t.init = function() {
115
- var e = this.$d;
116
- this.$y = e.getFullYear(), this.$M = e.getMonth(), this.$D = e.getDate(), this.$W = e.getDay(), this.$H = e.getHours(), this.$m = e.getMinutes(), this.$s = e.getSeconds(), this.$ms = e.getMilliseconds();
117
- }, t.$utils = function() {
118
- return u;
119
- }, t.isValid = function() {
120
- return this.$d.toString() !== V;
121
- }, t.isSame = function(e, r) {
122
- var n = c(e);
123
- return this.startOf(r) <= n && n <= this.endOf(r);
124
- }, t.isAfter = function(e, r) {
125
- return c(e) < this.startOf(r);
126
- }, t.isBefore = function(e, r) {
127
- return this.endOf(r) < c(e);
128
- }, t.$g = function(e, r, n) {
129
- return u.u(e) ? this[r] : this.set(n, e);
130
- }, t.unix = function() {
131
- return Math.floor(this.valueOf() / 1e3);
132
- }, t.valueOf = function() {
133
- return this.$d.getTime();
134
- }, t.startOf = function(e, r) {
135
- var n = this, a = !!u.u(r) || r, i = u.p(e), m = function(N, k) {
136
- var I = u.w(n.$u ? Date.UTC(n.$y, k, N) : new Date(n.$y, k, N), n);
137
- return a ? I : I.endOf(b);
138
- }, h = function(N, k) {
139
- return u.w(n.toDate()[N].apply(n.toDate("s"), (a ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(k)), n);
140
- }, g = this.$W, y = this.$M, M = this.$D, R = "set" + (this.$u ? "UTC" : "");
141
- switch (i) {
142
- case x:
143
- return a ? m(1, 0) : m(31, 11);
144
- case D:
145
- return a ? m(1, y) : m(0, y + 1);
146
- case P:
147
- var O = this.$locale().weekStart || 0, B = (g < O ? g + 7 : g) - O;
148
- return m(a ? M - B : M + (6 - B), y);
149
- case b:
150
- case H:
151
- return h(R + "Hours", 0);
152
- case L:
153
- return h(R + "Minutes", 1);
154
- case S:
155
- return h(R + "Seconds", 2);
156
- case j:
157
- return h(R + "Milliseconds", 3);
158
- default:
159
- return this.clone();
160
- }
161
- }, t.endOf = function(e) {
162
- return this.startOf(e, !1);
163
- }, t.$set = function(e, r) {
164
- var n, a = u.p(e), i = "set" + (this.$u ? "UTC" : ""), m = (n = {}, n[b] = i + "Date", n[H] = i + "Date", n[D] = i + "Month", n[x] = i + "FullYear", n[L] = i + "Hours", n[S] = i + "Minutes", n[j] = i + "Seconds", n[w] = i + "Milliseconds", n)[a], h = a === b ? this.$D + (r - this.$W) : r;
165
- if (a === D || a === x) {
166
- var g = this.clone().set(H, 1);
167
- g.$d[m](h), g.init(), this.$d = g.set(H, Math.min(this.$D, g.daysInMonth())).$d;
168
- } else
169
- m && this.$d[m](h);
170
- return this.init(), this;
171
- }, t.set = function(e, r) {
172
- return this.clone().$set(e, r);
173
- }, t.get = function(e) {
174
- return this[u.p(e)]();
175
- }, t.add = function(e, r) {
176
- var n, a = this;
177
- e = Number(e);
178
- var i = u.p(r), m = function(y) {
179
- var M = c(a);
180
- return u.w(M.date(M.date() + Math.round(y * e)), a);
181
- };
182
- if (i === D)
183
- return this.set(D, this.$M + e);
184
- if (i === x)
185
- return this.set(x, this.$y + e);
186
- if (i === b)
187
- return m(1);
188
- if (i === P)
189
- return m(7);
190
- var h = (n = {}, n[S] = l, n[L] = T, n[j] = v, n)[i] || 1, g = this.$d.getTime() + e * h;
191
- return u.w(g, this);
192
- }, t.subtract = function(e, r) {
193
- return this.add(-1 * e, r);
194
- }, t.format = function(e) {
195
- var r = this, n = this.$locale();
196
- if (!this.isValid())
197
- return n.invalidDate || V;
198
- var a = e || "YYYY-MM-DDTHH:mm:ssZ", i = u.z(this), m = this.$H, h = this.$m, g = this.$M, y = n.weekdays, M = n.months, R = n.meridiem, O = function(k, I, J, G) {
199
- return k && (k[I] || k(r, a)) || J[I].slice(0, G);
200
- }, B = function(k) {
201
- return u.s(m % 12 || 12, k, "0");
202
- }, N = R || function(k, I, J) {
203
- var G = k < 12 ? "AM" : "PM";
204
- return J ? G.toLowerCase() : G;
205
- };
206
- return a.replace(ee, function(k, I) {
207
- return I || function(J) {
208
- switch (J) {
209
- case "YY":
210
- return String(r.$y).slice(-2);
211
- case "YYYY":
212
- return u.s(r.$y, 4, "0");
213
- case "M":
214
- return g + 1;
215
- case "MM":
216
- return u.s(g + 1, 2, "0");
217
- case "MMM":
218
- return O(n.monthsShort, g, M, 3);
219
- case "MMMM":
220
- return O(M, g);
221
- case "D":
222
- return r.$D;
223
- case "DD":
224
- return u.s(r.$D, 2, "0");
225
- case "d":
226
- return String(r.$W);
227
- case "dd":
228
- return O(n.weekdaysMin, r.$W, y, 2);
229
- case "ddd":
230
- return O(n.weekdaysShort, r.$W, y, 3);
231
- case "dddd":
232
- return y[r.$W];
233
- case "H":
234
- return String(m);
235
- case "HH":
236
- return u.s(m, 2, "0");
237
- case "h":
238
- return B(1);
239
- case "hh":
240
- return B(2);
241
- case "a":
242
- return N(m, h, !0);
243
- case "A":
244
- return N(m, h, !1);
245
- case "m":
246
- return String(h);
247
- case "mm":
248
- return u.s(h, 2, "0");
249
- case "s":
250
- return String(r.$s);
251
- case "ss":
252
- return u.s(r.$s, 2, "0");
253
- case "SSS":
254
- return u.s(r.$ms, 3, "0");
255
- case "Z":
256
- return i;
257
- }
258
- return null;
259
- }(k) || i.replace(":", "");
260
- });
261
- }, t.utcOffset = function() {
262
- return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
263
- }, t.diff = function(e, r, n) {
264
- var a, i = this, m = u.p(r), h = c(e), g = (h.utcOffset() - this.utcOffset()) * l, y = this - h, M = function() {
265
- return u.m(i, h);
266
- };
267
- switch (m) {
268
- case x:
269
- a = M() / 12;
270
- break;
271
- case D:
272
- a = M();
273
- break;
274
- case W:
275
- a = M() / 3;
276
- break;
277
- case P:
278
- a = (y - g) / 6048e5;
279
- break;
280
- case b:
281
- a = (y - g) / 864e5;
282
- break;
283
- case L:
284
- a = y / T;
285
- break;
286
- case S:
287
- a = y / l;
288
- break;
289
- case j:
290
- a = y / v;
291
- break;
292
- default:
293
- a = y;
294
- }
295
- return n ? a : u.a(a);
296
- }, t.daysInMonth = function() {
297
- return this.endOf(D).$D;
298
- }, t.$locale = function() {
299
- return _[this.$L];
300
- }, t.locale = function(e, r) {
301
- if (!e)
302
- return this.$L;
303
- var n = this.clone(), a = f(e, r, !0);
304
- return a && (n.$L = a), n;
305
- }, t.clone = function() {
306
- return u.w(this.$d, this);
307
- }, t.toDate = function() {
308
- return new Date(this.valueOf());
309
- }, t.toJSON = function() {
310
- return this.isValid() ? this.toISOString() : null;
311
- }, t.toISOString = function() {
312
- return this.$d.toISOString();
313
- }, t.toString = function() {
314
- return this.$d.toUTCString();
315
- }, s;
316
- }(), A = $.prototype;
317
- return c.prototype = A, [["$ms", w], ["$s", j], ["$m", S], ["$H", L], ["$W", b], ["$M", D], ["$y", x], ["$D", H]].forEach(function(s) {
318
- A[s[1]] = function(t) {
319
- return this.$g(t, s[0], s[1]);
320
- };
321
- }), c.extend = function(s, t) {
322
- return s.$i || (s(t, $, c), s.$i = !0), c;
323
- }, c.locale = f, c.isDayjs = F, c.unix = function(s) {
324
- return c(1e3 * s);
325
- }, c.en = _[Y], c.Ls = _, c.p = {}, c;
326
- });
327
- })(oe);
328
- var ge = oe.exports;
329
- const ye = /* @__PURE__ */ $e(ge), ae = () => {
330
- let d = { ...(window == null ? void 0 : window.config) || {} };
331
- d.rootContainer || (d.rootContainer = "#app"), d.baseURL || (d.baseURL = location.origin), d.ossBaseURL || (d.ossBaseURL = "/oss"), d.ossBaseURL.startsWith("/") && (d.ossBaseURL = `${d.baseURL}/oss`), d.ssoBaseURL || (d.ssoBaseURL = d.baseURL);
332
- let { microAppName: v, publicPath: l, mainAppName: T } = d;
333
- return v && !0 && !l && (l = `/${v}/`.replace(/\/\//g, "/")), l || (l = "/"), d.publicPath = l, d.autoOssBucket || (d.autoOssBucket = T || v), d;
334
- }, we = ne.get("token"), be = ne.post("putObject", (p) => (p.headers || (p.headers = {}), p.headers["Content-Type"] = "multipart/form-data", p.responseType = "blob", p)), Me = ne.post("upload-objects", (p) => (p.headers || (p.headers = {}), p.headers["Content-Type"] = "multipart/form-data", p.responseType = "blob", p)), Se = me.get("progress"), qe = () => {
335
- let p = U(!1), d = U(""), v = U(0), l = U("normal"), T = U(!1), w, j = U(""), S = U(""), L = U(""), b = U(""), P = U(!1), D = U(""), W = "", x;
336
- const H = () => {
337
- S.value = "", L.value = "", b.value = "", P.value = !1, D.value = "";
338
- }, V = async () => {
339
- const [f, c] = await we().run();
340
- return f ? { stauts: !1 } : { status: !0, data: c };
341
- }, Z = (f) => new Promise((c, u) => {
342
- const A = [];
343
- let s = 0;
344
- for (; s < f.size; ) {
345
- const e = f.slice(s, s + 1048576);
346
- A.push(e), s += 1048576;
347
- }
348
- const t = new Blob(A, { type: f.type });
349
- c(t);
350
- }), ee = async (f, c, u, $ = !0, A = "", s = !1) => {
351
- W = A, $ && (l.value = "normal", v.value = 0, d.value = "导入进度", p.value = !0, j.value = ""), x = c;
352
- const t = await V();
353
- if (!t.status)
354
- return;
355
- let e = t.data, r = null, { autoContentType: n, bucketName: a, importFileName: i } = u;
356
- const m = s ? Me : be;
357
- if (s) {
358
- let R = [];
359
- await c.forEach(async (O) => {
360
- let B = await Z(O);
361
- R.push(B);
362
- }), r = new FormData(), r.append("accessKeyId", e.accessKeyId), r.append("secretAccessKey", e.secretAccessKey), r.append("sessionToken", e.sessionToken), r.append("bucketName", a), c.forEach((O, B) => {
363
- r.append("file", R[B]);
364
- }), i.forEach((O) => {
365
- r.append("filePaths", O);
366
- });
367
- } else {
368
- const R = await Z(c);
369
- r = {
370
- accessKeyId: e.accessKeyId,
371
- secretAccessKey: e.secretAccessKey,
372
- sessionToken: e.sessionToken,
373
- file: R,
374
- bucketName: a,
375
- filePath: i,
376
- autoContentType: n
377
- };
378
- }
379
- const [h, g] = await m(r).run();
380
- if (h)
381
- return;
382
- const y = await je(g.data), M = await (f == null ? void 0 : f(y));
383
- if ($) {
384
- if (!M.status) {
385
- p.value = !1, l.value = "error";
386
- return;
387
- }
388
- d.value = "导入进度", p.value = !0, z(M.taskId, "import", "");
389
- } else {
390
- if (!M.status)
391
- return;
392
- l.value = "success";
393
- }
394
- }, te = async (f, c = "", u = "") => {
395
- l.value = "normal", v.value = 0, d.value = u || "导出进度", p.value = !0;
396
- const $ = await (f == null ? void 0 : f());
397
- if (!$.status) {
398
- p.value = !1, l.value = "error";
399
- return;
400
- }
401
- z($.taskId, "action", "");
402
- }, K = async (f, c = "", u = "") => {
403
- l.value = "normal", v.value = 0, d.value = "导出进度", p.value = !0;
404
- const $ = await (f == null ? void 0 : f());
405
- if (!$.status) {
406
- p.value = !1, l.value = "error";
407
- return;
408
- }
409
- ye().format("YYYYMMDDHHmmss") + "", z($.taskId, "export", c || "", u);
410
- }, z = async (f, c, u, $ = "") => {
411
- T.value = !0, _(f, c, u, $), w = setTimeout(() => {
412
- }, 50);
413
- }, Y = () => {
414
- clearTimeout(w), w = null, p.value = !1;
415
- }, _ = async (f, c = "export", u, $ = "") => {
416
- var e, r;
417
- const [A, s] = await Se("", {
418
- url: `progress/${f}`
419
- }).run();
420
- if (A) {
421
- T.value = !1;
422
- return;
423
- }
424
- v.value = s.percentage;
425
- const t = c == "export" ? "导出" : "导入";
426
- if (v.value == 100)
427
- if (j.value = s, T.value = !1, Y(), c == "export")
428
- s.status == 1 ? (l.value = "success", ie(`${ae().baseURL}/oss${s.filePath}`, u, $), T.value = !1) : s.status == 2 && (b.value = s.message || `${t}失败`);
429
- else if (c == "import") {
430
- if (s.filePath) {
431
- l.value = "error";
432
- const n = (e = x.name) == null ? void 0 : e.match(/(.*?)(\.[^.]*$|$)/), a = n.length ? n[2] : "";
433
- P.value = !0;
434
- const i = (r = s.filePath) == null ? void 0 : r.replace(/(.*\/)*([^.]+).*/gi, "$2");
435
- S.value = W || `${i}${a}`, L.value = x.sizeText, b.value = "部分数据校验不通过,请下载附件并修改,重新导入!", D.value = `${ae().baseURL}/oss${s.filePath}`;
436
- }
437
- q(s.status, t, s.message);
438
- } else
439
- c == "action" && (l.value = "success");
440
- else
441
- w && s.status != 2 ? w = setTimeout(() => {
442
- _(f, c, u, $);
443
- }, 50) : (j.value = s, T.value = !1, q(s.status, t, s.message), Y(), P.value = !0, b.value = (s == null ? void 0 : s.message) || "");
444
- }, q = (f, c, u) => {
445
- f == 1 ? (l.value = "success", S.value = "", L.value = "", b.value = "") : f == 2 ? (l.value = "error", b.value = u || "部分数据校验不通过,请下载附件并修改,重新导入!") : f == 3 && (l.value = "error");
446
- };
447
- return {
448
- showProgressDialog: p,
449
- progressTitle: d,
450
- percent: v,
451
- progressStatus: l,
452
- progressLoading: T,
453
- progressResult: j,
454
- errorFileName: S,
455
- errorFileSize: L,
456
- errorMessage: b,
457
- errorImport: P,
458
- errorFilePath: D,
459
- fileImport: ee,
460
- fileExport: K,
461
- fileAction: te,
462
- generateUniqueName: (f) => {
463
- const c = f == null ? void 0 : f.match(/(.*?)(\.[^.]*$|$)/), u = c.length ? c[2] : "";
464
- return `${c.length ? c[1] : f}${he()}${u}`;
465
- },
466
- downloadFile: ie,
467
- resetStataus: H,
468
- checkProgress: z
469
- };
470
- }, De = (p) => {
471
- let d = p == null ? void 0 : p.toLocaleLowerCase();
472
- return {
473
- excel: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
474
- pdf: "application/pdf",
475
- doc: "application/msword",
476
- docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
477
- xls: "application/vnd.ms-excel",
478
- xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
479
- zip: "application/zip",
480
- txt: "text/plain",
481
- html: "text/html",
482
- xml: "application/xml",
483
- json: "application/json",
484
- css: "text/css",
485
- js: "application/javascript",
486
- svg: "image/svg+xml",
487
- jpg: "image/jpeg",
488
- jpeg: "image/jpeg",
489
- gif: "image/gif",
490
- bmp: "image/bmp",
491
- ico: "image/x-icon",
492
- mp3: "audio/mpeg",
493
- mp4: "video/mp4",
494
- pem: "application/x-pem-file",
495
- crt: "application/x-x509-ca-cert",
496
- der: "application/x-x509-ca-cert",
497
- cer: "application/pkix-cert"
498
- }[d];
499
- }, ie = (p, d, v = "excel") => {
500
- const l = new XMLHttpRequest();
501
- l.open("get", p), l.setRequestHeader("Content-Type", "application/json; charset=UTF-8"), l.responseType = "blob", l.onload = function(T) {
502
- const w = new Blob([this.response], {
503
- type: De(v)
504
- }), j = URL.createObjectURL(w);
505
- if (window.navigator.msSaveOrOpenBlob)
506
- navigator.msSaveBlob(w, d);
507
- else {
508
- const S = document.createElement("a");
509
- S.href = j, S.download = d, S.click(), window.URL.revokeObjectURL(j);
510
- }
511
- }, l.send();
512
- }, je = (p) => new Promise((d, v) => {
513
- var l = new FileReader();
514
- l.onload = function(T) {
515
- let w = "";
516
- typeof l.result == "string" && (w = JSON.parse(l.result)), d(w);
517
- }, l.readAsText(p);
518
- }), ke = "v2", Je = o(`/api/edge/${ke}`), ce = "v1", Ve = o(`/api/justauth/oauth-server/${ce}/visitor`), Ze = o(`/api/justauth/oauth-server/${ce}`), Te = "v1", Fe = o(`/api/knowledge-base/knowledge/${Te}`), xe = "v1", Ge = o(`/api/custom-datasource/custom/${xe}`), Oe = "v1", Qe = o(`/api/permission/${Oe}`), E = "v1", Xe = o(`/api/customer/customer/${E}`), et = o(`/api/customer/company/${E}`), tt = o(`/api/customer/customer-grade/${E}`), st = o(`/api/customer/customer-type/${E}`), nt = {
519
- list: o(`/api/project/${E}/list`),
520
- app: o(`/api/project/${E}/app`),
521
- people: o(`/api/project/${E}/people`)
522
- }, Le = "v1", rt = o(`/api/portal/user/${Le}`), Re = "v1", at = o(`/api/space-manage/space-tree/${Re}`), X = "v1", it = o(`/api/superadmin/portal/${X}`), ot = o(`/api/superadmin/permission/${X}`), ct = o(`/api/superadmin/resource/${X}`), ut = o(`/api/superadmin/license/${X}`), re = "v1", lt = o(`/api/supply/supplier/${re}`), pt = o(`/api/supplier/${re}`), dt = o(`/api/supplier/${re}/classification`), Ue = "v1", ft = o(`/api/supply/brand/${Ue}`), _e = "v2", mt = o(`/api/tool/${_e}`), Ce = "v1", ht = o(`/api/system-config/${Ce}`);
1
+ import { appManage as r } from "@das-fed/utils/api-services/modules/app-manage";
2
+ import { authentication as p } from "@das-fed/utils/api-services/modules/authentication";
3
+ import { bemsModules as i } from "@das-fed/utils/api-services/modules/bems";
4
+ import { contract as s } from "@das-fed/utils/api-services/modules/contract";
5
+ import { dutyModules as f } from "@das-fed/utils/api-services/modules/duty-manage";
6
+ import { enterpriseright as x } from "@das-fed/utils/api-services/modules/enterpriseright";
7
+ import { downloadFile as l, useFile as c } from "@das-fed/utils/api-services/modules/file";
8
+ import { gatewayEdge as M } from "@das-fed/utils/api-services/modules/gateway-edge";
9
+ import { iot as h, iotMinio as w, iotModules as P, iotProgress as j, iotRelationModules as k } from "@das-fed/utils/api-services/modules/iot";
10
+ import { justauth as C, oauthServer as F } from "@das-fed/utils/api-services/modules/justauth";
11
+ import { knowledgeBase as b } from "@das-fed/utils/api-services/modules/knowledge";
12
+ import { daslink as E } from "@das-fed/utils/api-services/modules/link";
13
+ import { permission as L } from "@das-fed/utils/api-services/modules/permission";
14
+ import { company as T, customer as q, customerGrade as z, customerType as A, projectManage as D } from "@das-fed/utils/api-services/modules/platformManage";
15
+ import { portal as I } from "@das-fed/utils/api-services/modules/portal";
16
+ import { spaceManage as K } from "@das-fed/utils/api-services/modules/space-manage";
17
+ import { superadminLicense as O, superadminPermission as Q, superadminPortal as U, superadminResource as V } from "@das-fed/utils/api-services/modules/super-admin";
18
+ import { supplier as X, supplierClassification as Y, supplierManage as Z } from "@das-fed/utils/api-services/modules/supplier";
19
+ import { enterpriseadminBrandModel as $ } from "@das-fed/utils/api-services/modules/supplychain-manage";
20
+ import { tool as eo } from "@das-fed/utils/api-services/modules/tool";
21
+ import { systemConfiguration as to } from "@das-fed/utils/api-services/modules/systemConfiguration";
523
22
  export {
524
- Be as appManage,
525
- He as authentication,
526
- Ye as bemsModules,
527
- et as company,
528
- Ie as contract,
529
- Xe as customer,
530
- tt as customerGrade,
531
- st as customerType,
532
- Ge as daslink,
533
- ie as downloadFile,
534
- Ne as dutyModules,
535
- ft as enterpriseadminBrandModel,
536
- Ee as enterpriseright,
537
- Je as gatewayEdge,
538
- We as iot,
539
- ne as iotMinio,
540
- ze as iotModules,
541
- me as iotProgress,
542
- Ke as iotRelationModules,
543
- Ve as justauth,
544
- Fe as knowledgeBase,
545
- Ze as oauthServer,
546
- Qe as permission,
547
- rt as portal,
548
- nt as projectManage,
549
- at as spaceManage,
550
- ut as superadminLicense,
551
- ot as superadminPermission,
552
- it as superadminPortal,
553
- ct as superadminResource,
554
- lt as supplier,
555
- dt as supplierClassification,
556
- pt as supplierManage,
557
- ht as systemConfiguration,
558
- mt as tool,
559
- qe as useFile
23
+ r as appManage,
24
+ p as authentication,
25
+ i as bemsModules,
26
+ T as company,
27
+ s as contract,
28
+ q as customer,
29
+ z as customerGrade,
30
+ A as customerType,
31
+ E as daslink,
32
+ l as downloadFile,
33
+ f as dutyModules,
34
+ $ as enterpriseadminBrandModel,
35
+ x as enterpriseright,
36
+ M as gatewayEdge,
37
+ h as iot,
38
+ w as iotMinio,
39
+ P as iotModules,
40
+ j as iotProgress,
41
+ k as iotRelationModules,
42
+ C as justauth,
43
+ b as knowledgeBase,
44
+ F as oauthServer,
45
+ L as permission,
46
+ I as portal,
47
+ D as projectManage,
48
+ K as spaceManage,
49
+ O as superadminLicense,
50
+ Q as superadminPermission,
51
+ U as superadminPortal,
52
+ V as superadminResource,
53
+ X as supplier,
54
+ Y as supplierClassification,
55
+ Z as supplierManage,
56
+ to as systemConfiguration,
57
+ eo as tool,
58
+ c as useFile
560
59
  };
@@ -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.8",
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.8",
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",