@das-fed/utils 6.4.0-dev.9 → 6.4.0-hot.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/api-services/index.js +1284 -1696
  2. package/api-services/index.js.gz +0 -0
  3. package/api-services/modules/app-manage/index.js +1080 -1492
  4. package/api-services/modules/app-manage/index.js.gz +0 -0
  5. package/api-services/modules/authentication/index.js +1080 -1492
  6. package/api-services/modules/authentication/index.js.gz +0 -0
  7. package/api-services/modules/bems/index.js +1083 -1495
  8. package/api-services/modules/bems/index.js.gz +0 -0
  9. package/api-services/modules/contract/index.js +1080 -1492
  10. package/api-services/modules/contract/index.js.gz +0 -0
  11. package/api-services/modules/duty-manage/index.js +1049 -1461
  12. package/api-services/modules/duty-manage/index.js.gz +0 -0
  13. package/api-services/modules/enterpriseright/index.js +1080 -1492
  14. package/api-services/modules/enterpriseright/index.js.gz +0 -0
  15. package/api-services/modules/file/index.js +152 -432
  16. package/api-services/modules/file/index.js.gz +0 -0
  17. package/api-services/modules/gateway-edge/index.js +1080 -1492
  18. package/api-services/modules/gateway-edge/index.js.gz +0 -0
  19. package/api-services/modules/index.js +1460 -1872
  20. package/api-services/modules/index.js.gz +0 -0
  21. package/api-services/modules/iot/index.js +1120 -1532
  22. package/api-services/modules/iot/index.js.gz +0 -0
  23. package/api-services/modules/justauth/index.js +1046 -1458
  24. package/api-services/modules/justauth/index.js.gz +0 -0
  25. package/api-services/modules/knowledge/index.js +1080 -1492
  26. package/api-services/modules/knowledge/index.js.gz +0 -0
  27. package/api-services/modules/link/index.js +1080 -1492
  28. package/api-services/modules/link/index.js.gz +0 -0
  29. package/api-services/modules/permission/index.js +1080 -1492
  30. package/api-services/modules/permission/index.js.gz +0 -0
  31. package/api-services/modules/platformManage/index.js +1086 -1498
  32. package/api-services/modules/platformManage/index.js.gz +0 -0
  33. package/api-services/modules/portal/index.js +1045 -1457
  34. package/api-services/modules/portal/index.js.gz +0 -0
  35. package/api-services/modules/space-manage/index.js +1080 -1492
  36. package/api-services/modules/space-manage/index.js.gz +0 -0
  37. package/api-services/modules/super-admin/index.js +1047 -1459
  38. package/api-services/modules/super-admin/index.js.gz +0 -0
  39. package/api-services/modules/supplier/index.js +1077 -1489
  40. package/api-services/modules/supplier/index.js.gz +0 -0
  41. package/api-services/modules/supplychain-manage/index.js +1045 -1457
  42. package/api-services/modules/supplychain-manage/index.js.gz +0 -0
  43. package/api-services/modules/systemConfiguration/index.js +1080 -1492
  44. package/api-services/modules/systemConfiguration/index.js.gz +0 -0
  45. package/api-services/modules/tool/index.js +1080 -1492
  46. package/api-services/modules/tool/index.js.gz +0 -0
  47. package/api-services/src/create-service/index.js +1074 -1486
  48. package/api-services/src/create-service/index.js.gz +0 -0
  49. package/common-tools/platform-tools/index.d.ts +2 -1
  50. package/common-tools/platform-tools/index.js +16 -11
  51. package/create-api-service/index.js +1074 -1486
  52. package/create-api-service/index.js.gz +0 -0
  53. package/esm-map.json +2 -1
  54. package/hooks/popup-manager/use-zindex/index.js +8 -17
  55. package/package.json +3 -3
@@ -1,460 +1,180 @@
1
- import { iotMinio as G, iotProgress as te } from "@das-fed/utils/api-services/modules/iot";
2
- import { ref as L } from "vue";
3
- import { getConfig as Q } from "@das-fed/utils/config";
4
- let se = (l = 21) => {
5
- let g = "", w = crypto.getRandomValues(new Uint8Array(l));
6
- for (; l--; ) {
7
- let c = w[l] & 63;
8
- c < 36 ? g += c.toString(36) : c < 62 ? g += (c - 26).toString(36).toUpperCase() : c < 63 ? g += "_" : g += "-";
1
+ import { iotMinio as I, iotProgress as Q } from "@das-fed/utils/api-services/modules/iot";
2
+ import { ref as f } from "vue";
3
+ import W from "dayjs";
4
+ import { getConfig as B } from "@das-fed/utils/config";
5
+ let Z = (e = 21) => {
6
+ let o = "", i = crypto.getRandomValues(new Uint8Array(e));
7
+ for (; e--; ) {
8
+ let t = i[e] & 63;
9
+ t < 36 ? o += t.toString(36) : t < 62 ? o += (t - 26).toString(36).toUpperCase() : t < 63 ? o += "_" : o += "-";
9
10
  }
10
- return g;
11
+ return o;
11
12
  };
12
- var re = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
13
- function ne(l) {
14
- return l && l.__esModule && Object.prototype.hasOwnProperty.call(l, "default") ? l.default : l;
15
- }
16
- var ee = { exports: {} };
17
- (function(l, g) {
18
- (function(w, c) {
19
- l.exports = c();
20
- })(re, function() {
21
- var w = 1e3, c = 6e4, j = 36e5, b = "millisecond", x = "second", D = "minute", _ = "hour", y = "day", Y = "week", S = "month", R = "quarter", k = "year", N = "date", B = "Invalid Date", q = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, Z = /\[([^\]]+)]|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, F = { 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(t) {
22
- var s = ["th", "st", "nd", "rd"], e = t % 100;
23
- return "[" + t + (s[(e - 20) % 10] || s[e] || s[0]) + "]";
24
- } }, E = function(t, s, e) {
25
- var n = String(t);
26
- return !n || n.length >= s ? t : "" + Array(s + 1 - n.length).join(e) + t;
27
- }, z = { s: E, z: function(t) {
28
- var s = -t.utcOffset(), e = Math.abs(s), n = Math.floor(e / 60), r = e % 60;
29
- return (s <= 0 ? "+" : "-") + E(n, 2, "0") + ":" + E(r, 2, "0");
30
- }, m: function t(s, e) {
31
- if (s.date() < e.date()) return -t(e, s);
32
- var n = 12 * (e.year() - s.year()) + (e.month() - s.month()), r = s.clone().add(n, S), i = e - r < 0, u = s.clone().add(n + (i ? -1 : 1), S);
33
- return +(-(n + (e - r) / (i ? r - u : u - r)) || 0);
34
- }, a: function(t) {
35
- return t < 0 ? Math.ceil(t) || 0 : Math.floor(t);
36
- }, p: function(t) {
37
- return { M: S, y: k, w: Y, d: y, D: N, h: _, m: D, s: x, ms: b, Q: R }[t] || String(t || "").toLowerCase().replace(/s$/, "");
38
- }, u: function(t) {
39
- return t === void 0;
40
- } }, P = "en", C = {};
41
- C[P] = F;
42
- var W = "$isDayjsObject", J = function(t) {
43
- return t instanceof m || !(!t || !t[W]);
44
- }, f = function t(s, e, n) {
45
- var r;
46
- if (!s) return P;
47
- if (typeof s == "string") {
48
- var i = s.toLowerCase();
49
- C[i] && (r = i), e && (C[i] = e, r = i);
50
- var u = s.split("-");
51
- if (!r && u.length > 1) return t(u[0]);
52
- } else {
53
- var d = s.name;
54
- C[d] = s, r = d;
55
- }
56
- return !n && r && (P = r), r || !n && P;
57
- }, a = function(t, s) {
58
- if (J(t)) return t.clone();
59
- var e = typeof s == "object" ? s : {};
60
- return e.date = t, e.args = arguments, new m(e);
61
- }, o = z;
62
- o.l = f, o.i = J, o.w = function(t, s) {
63
- return a(t, { locale: s.$L, utc: s.$u, x: s.$x, $offset: s.$offset });
64
- };
65
- var m = function() {
66
- function t(e) {
67
- this.$L = f(e.locale, null, !0), this.parse(e), this.$x = this.$x || e.x || {}, this[W] = !0;
68
- }
69
- var s = t.prototype;
70
- return s.parse = function(e) {
71
- this.$d = function(n) {
72
- var r = n.date, i = n.utc;
73
- if (r === null) return /* @__PURE__ */ new Date(NaN);
74
- if (o.u(r)) return /* @__PURE__ */ new Date();
75
- if (r instanceof Date) return new Date(r);
76
- if (typeof r == "string" && !/Z$/i.test(r)) {
77
- var u = r.match(q);
78
- if (u) {
79
- var d = u[2] - 1 || 0, h = (u[7] || "0").substring(0, 3);
80
- return i ? new Date(Date.UTC(u[1], d, u[3] || 1, u[4] || 0, u[5] || 0, u[6] || 0, h)) : new Date(u[1], d, u[3] || 1, u[4] || 0, u[5] || 0, u[6] || 0, h);
81
- }
82
- }
83
- return new Date(r);
84
- }(e), this.init();
85
- }, s.init = function() {
86
- var e = this.$d;
87
- 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();
88
- }, s.$utils = function() {
89
- return o;
90
- }, s.isValid = function() {
91
- return this.$d.toString() !== B;
92
- }, s.isSame = function(e, n) {
93
- var r = a(e);
94
- return this.startOf(n) <= r && r <= this.endOf(n);
95
- }, s.isAfter = function(e, n) {
96
- return a(e) < this.startOf(n);
97
- }, s.isBefore = function(e, n) {
98
- return this.endOf(n) < a(e);
99
- }, s.$g = function(e, n, r) {
100
- return o.u(e) ? this[n] : this.set(r, e);
101
- }, s.unix = function() {
102
- return Math.floor(this.valueOf() / 1e3);
103
- }, s.valueOf = function() {
104
- return this.$d.getTime();
105
- }, s.startOf = function(e, n) {
106
- var r = this, i = !!o.u(n) || n, u = o.p(e), d = function(O, $) {
107
- var I = o.w(r.$u ? Date.UTC(r.$y, $, O) : new Date(r.$y, $, O), r);
108
- return i ? I : I.endOf(y);
109
- }, h = function(O, $) {
110
- return o.w(r.toDate()[O].apply(r.toDate("s"), (i ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice($)), r);
111
- }, v = this.$W, p = this.$M, M = this.$D, A = "set" + (this.$u ? "UTC" : "");
112
- switch (u) {
113
- case k:
114
- return i ? d(1, 0) : d(31, 11);
115
- case S:
116
- return i ? d(1, p) : d(0, p + 1);
117
- case Y:
118
- var H = this.$locale().weekStart || 0, U = (v < H ? v + 7 : v) - H;
119
- return d(i ? M - U : M + (6 - U), p);
120
- case y:
121
- case N:
122
- return h(A + "Hours", 0);
123
- case _:
124
- return h(A + "Minutes", 1);
125
- case D:
126
- return h(A + "Seconds", 2);
127
- case x:
128
- return h(A + "Milliseconds", 3);
129
- default:
130
- return this.clone();
131
- }
132
- }, s.endOf = function(e) {
133
- return this.startOf(e, !1);
134
- }, s.$set = function(e, n) {
135
- var r, i = o.p(e), u = "set" + (this.$u ? "UTC" : ""), d = (r = {}, r[y] = u + "Date", r[N] = u + "Date", r[S] = u + "Month", r[k] = u + "FullYear", r[_] = u + "Hours", r[D] = u + "Minutes", r[x] = u + "Seconds", r[b] = u + "Milliseconds", r)[i], h = i === y ? this.$D + (n - this.$W) : n;
136
- if (i === S || i === k) {
137
- var v = this.clone().set(N, 1);
138
- v.$d[d](h), v.init(), this.$d = v.set(N, Math.min(this.$D, v.daysInMonth())).$d;
139
- } else d && this.$d[d](h);
140
- return this.init(), this;
141
- }, s.set = function(e, n) {
142
- return this.clone().$set(e, n);
143
- }, s.get = function(e) {
144
- return this[o.p(e)]();
145
- }, s.add = function(e, n) {
146
- var r, i = this;
147
- e = Number(e);
148
- var u = o.p(n), d = function(p) {
149
- var M = a(i);
150
- return o.w(M.date(M.date() + Math.round(p * e)), i);
151
- };
152
- if (u === S) return this.set(S, this.$M + e);
153
- if (u === k) return this.set(k, this.$y + e);
154
- if (u === y) return d(1);
155
- if (u === Y) return d(7);
156
- var h = (r = {}, r[D] = c, r[_] = j, r[x] = w, r)[u] || 1, v = this.$d.getTime() + e * h;
157
- return o.w(v, this);
158
- }, s.subtract = function(e, n) {
159
- return this.add(-1 * e, n);
160
- }, s.format = function(e) {
161
- var n = this, r = this.$locale();
162
- if (!this.isValid()) return r.invalidDate || B;
163
- var i = e || "YYYY-MM-DDTHH:mm:ssZ", u = o.z(this), d = this.$H, h = this.$m, v = this.$M, p = r.weekdays, M = r.months, A = r.meridiem, H = function($, I, K, V) {
164
- return $ && ($[I] || $(n, i)) || K[I].slice(0, V);
165
- }, U = function($) {
166
- return o.s(d % 12 || 12, $, "0");
167
- }, O = A || function($, I, K) {
168
- var V = $ < 12 ? "AM" : "PM";
169
- return K ? V.toLowerCase() : V;
170
- };
171
- return i.replace(Z, function($, I) {
172
- return I || function(K) {
173
- switch (K) {
174
- case "YY":
175
- return String(n.$y).slice(-2);
176
- case "YYYY":
177
- return o.s(n.$y, 4, "0");
178
- case "M":
179
- return v + 1;
180
- case "MM":
181
- return o.s(v + 1, 2, "0");
182
- case "MMM":
183
- return H(r.monthsShort, v, M, 3);
184
- case "MMMM":
185
- return H(M, v);
186
- case "D":
187
- return n.$D;
188
- case "DD":
189
- return o.s(n.$D, 2, "0");
190
- case "d":
191
- return String(n.$W);
192
- case "dd":
193
- return H(r.weekdaysMin, n.$W, p, 2);
194
- case "ddd":
195
- return H(r.weekdaysShort, n.$W, p, 3);
196
- case "dddd":
197
- return p[n.$W];
198
- case "H":
199
- return String(d);
200
- case "HH":
201
- return o.s(d, 2, "0");
202
- case "h":
203
- return U(1);
204
- case "hh":
205
- return U(2);
206
- case "a":
207
- return O(d, h, !0);
208
- case "A":
209
- return O(d, h, !1);
210
- case "m":
211
- return String(h);
212
- case "mm":
213
- return o.s(h, 2, "0");
214
- case "s":
215
- return String(n.$s);
216
- case "ss":
217
- return o.s(n.$s, 2, "0");
218
- case "SSS":
219
- return o.s(n.$ms, 3, "0");
220
- case "Z":
221
- return u;
222
- }
223
- return null;
224
- }($) || u.replace(":", "");
225
- });
226
- }, s.utcOffset = function() {
227
- return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
228
- }, s.diff = function(e, n, r) {
229
- var i, u = this, d = o.p(n), h = a(e), v = (h.utcOffset() - this.utcOffset()) * c, p = this - h, M = function() {
230
- return o.m(u, h);
231
- };
232
- switch (d) {
233
- case k:
234
- i = M() / 12;
235
- break;
236
- case S:
237
- i = M();
238
- break;
239
- case R:
240
- i = M() / 3;
241
- break;
242
- case Y:
243
- i = (p - v) / 6048e5;
244
- break;
245
- case y:
246
- i = (p - v) / 864e5;
247
- break;
248
- case _:
249
- i = p / j;
250
- break;
251
- case D:
252
- i = p / c;
253
- break;
254
- case x:
255
- i = p / w;
256
- break;
257
- default:
258
- i = p;
259
- }
260
- return r ? i : o.a(i);
261
- }, s.daysInMonth = function() {
262
- return this.endOf(S).$D;
263
- }, s.$locale = function() {
264
- return C[this.$L];
265
- }, s.locale = function(e, n) {
266
- if (!e) return this.$L;
267
- var r = this.clone(), i = f(e, n, !0);
268
- return i && (r.$L = i), r;
269
- }, s.clone = function() {
270
- return o.w(this.$d, this);
271
- }, s.toDate = function() {
272
- return new Date(this.valueOf());
273
- }, s.toJSON = function() {
274
- return this.isValid() ? this.toISOString() : null;
275
- }, s.toISOString = function() {
276
- return this.$d.toISOString();
277
- }, s.toString = function() {
278
- return this.$d.toUTCString();
279
- }, t;
280
- }(), T = m.prototype;
281
- return a.prototype = T, [["$ms", b], ["$s", x], ["$m", D], ["$H", _], ["$W", y], ["$M", S], ["$y", k], ["$D", N]].forEach(function(t) {
282
- T[t[1]] = function(s) {
283
- return this.$g(s, t[0], t[1]);
284
- };
285
- }), a.extend = function(t, s) {
286
- return t.$i || (t(s, m, a), t.$i = !0), a;
287
- }, a.locale = f, a.isDayjs = J, a.unix = function(t) {
288
- return a(1e3 * t);
289
- }, a.en = C[P], a.Ls = C, a.p = {}, a;
290
- });
291
- })(ee);
292
- var ae = ee.exports;
293
- const ie = /* @__PURE__ */ ne(ae), oe = G.get("token"), ue = G.post("put-object", (l) => (l.headers || (l.headers = {}), l.headers["Content-Type"] = "multipart/form-data", l.responseType = "blob", l)), le = G.post("upload-objects", (l) => (l.headers || (l.headers = {}), l.headers["Content-Type"] = "multipart/form-data", l.responseType = "blob", l)), ce = te.get("progress"), ve = () => {
294
- let l = L(!1), g = L(""), w = L(0), c = L("normal"), j = L(!1), b, x = L(""), D = L(""), _ = L(""), y = L(""), Y = L(!1), S = L(""), R = "", k;
295
- const N = () => {
296
- D.value = "", _.value = "", y.value = "", Y.value = !1, S.value = "";
297
- }, B = async () => {
298
- const [f, a] = await oe().run();
299
- return f ? { stauts: !1 } : { status: !0, data: a };
300
- }, q = (f) => new Promise((a, o) => {
301
- const T = [];
302
- let t = 0;
303
- for (; t < f.size; ) {
304
- const e = f.slice(t, t + 1048576);
305
- T.push(e), t += 1048576;
13
+ const F = I.get("token"), ee = I.post("put-object", (e) => (e.headers || (e.headers = {}), e.headers["Content-Type"] = "multipart/form-data", e.responseType = "blob", e)), te = I.post("upload-objects", (e) => (e.headers || (e.headers = {}), e.headers["Content-Type"] = "multipart/form-data", e.responseType = "blob", e)), se = Q.get("progress"), ce = () => {
14
+ let e = f(!1), o = f(""), i = f(0), t = f("normal"), g = f(!1), p, h = f(""), v = f(""), y = f(""), w = f(""), T = f(!1), P = f(""), L = "", U;
15
+ const q = () => {
16
+ v.value = "", y.value = "", w.value = "", T.value = !1, P.value = "";
17
+ }, Y = async () => {
18
+ const [s, r] = await F().run();
19
+ return s ? { stauts: !1 } : { status: !0, data: r };
20
+ }, K = (s) => new Promise((r, l) => {
21
+ const u = [];
22
+ let a = 0;
23
+ for (; a < s.size; ) {
24
+ const m = s.slice(a, a + 1048576);
25
+ u.push(m), a += 1048576;
306
26
  }
307
- const s = new Blob(T, { type: f.type });
308
- a(s);
309
- }), Z = async (f, a, o, m = !0, T = "", t = !1) => {
310
- var A, H;
311
- R = T, m && (c.value = "normal", w.value = 0, g.value = "导入进度", l.value = !0, x.value = ""), k = a;
312
- const s = await B();
313
- if (!s.status) return;
314
- let e = s.data, n = null, { autoContentType: r, bucketName: i, importFileName: u } = o;
315
- const d = t ? le : ue;
316
- if (t) {
317
- let U = [];
318
- await a.forEach(async (O) => {
319
- let $ = await q(O);
320
- U.push($);
321
- }), n = new FormData(), n.append("accessKeyId", e.accessKeyId), n.append("secretAccessKey", e.secretAccessKey), n.append("sessionToken", e.sessionToken), n.append("bucketName", i), a.forEach((O, $) => {
322
- n.append("file", U[$]);
323
- }), u.forEach((O) => {
324
- n.append("filePaths", O);
27
+ const d = new Blob(u, { type: s.type });
28
+ r(d);
29
+ }), J = async (s, r, l, n = !0, u = "", a = !1) => {
30
+ var E, O;
31
+ L = u, n && (t.value = "normal", i.value = 0, o.value = "导入进度", e.value = !0, h.value = ""), U = r;
32
+ const d = await Y();
33
+ if (!d.status) return;
34
+ let m = d.data, c = null, { autoContentType: $, bucketName: x, importFileName: j } = l;
35
+ const N = a ? te : ee;
36
+ if (a) {
37
+ let M = [];
38
+ await r.forEach(async (R) => {
39
+ let A = await K(R);
40
+ M.push(A);
41
+ }), c = new FormData(), c.append("accessKeyId", m.accessKeyId), c.append("secretAccessKey", m.secretAccessKey), c.append("sessionToken", m.sessionToken), c.append("bucketName", x), r.forEach((R, A) => {
42
+ c.append("file", M[A]);
43
+ }), j.forEach((R) => {
44
+ c.append("filePaths", R);
325
45
  });
326
46
  } else {
327
- const U = await q(a);
328
- n = {
329
- accessKeyId: e.accessKeyId,
330
- secretAccessKey: e.secretAccessKey,
331
- sessionToken: e.sessionToken,
332
- file: U,
333
- bucketName: i,
334
- filePath: u,
335
- autoContentType: r
47
+ const M = await K(r);
48
+ c = {
49
+ accessKeyId: m.accessKeyId,
50
+ secretAccessKey: m.secretAccessKey,
51
+ sessionToken: m.sessionToken,
52
+ file: M,
53
+ bucketName: x,
54
+ filePath: j,
55
+ autoContentType: $
336
56
  };
337
57
  }
338
- const [h, v] = await d(n).run();
339
- if (h) return l.value = !1;
340
- const p = await de(v.data);
341
- if ((p == null ? void 0 : p.statusCode) != 200) {
342
- l.value = !1, (A = window.DasMessage) == null || A.error({
343
- message: (p == null ? void 0 : p.errorMsg) || "上传失败",
58
+ const [_, G] = await N(c).run();
59
+ if (_) return e.value = !1;
60
+ const b = await re(G.data);
61
+ if ((b == null ? void 0 : b.statusCode) != 200) {
62
+ e.value = !1, (E = window.DasMessage) == null || E.error({
63
+ message: (b == null ? void 0 : b.errorMsg) || "上传失败",
344
64
  grouping: !0,
345
65
  repeatNum: 1
346
66
  });
347
67
  return;
348
68
  }
349
- const M = await (f == null ? void 0 : f(p));
350
- if (m) {
351
- if (!M.status) {
352
- l.value = !1, c.value = "error";
69
+ const C = await (s == null ? void 0 : s(b));
70
+ if (n) {
71
+ if (!C.status) {
72
+ e.value = !1, t.value = "error";
353
73
  return;
354
74
  }
355
- g.value = "导入进度", l.value = !0, z(M.taskId, "import", "");
75
+ o.value = "导入进度", e.value = !0, k(C.taskId, "import", "");
356
76
  } else {
357
- if (!M.status) return;
358
- c.value = "success", (H = window.DasMessage) == null || H.success({
77
+ if (!C.status) return;
78
+ t.value = "success", (O = window.DasMessage) == null || O.success({
359
79
  message: "导入成功",
360
80
  grouping: !0,
361
81
  repeatNum: 1
362
82
  });
363
83
  }
364
- }, F = async (f, a = "", o = "") => {
365
- c.value = "normal", w.value = 0, g.value = o || "导出进度", l.value = !0;
366
- const m = await (f == null ? void 0 : f());
367
- if (!m.status) {
368
- l.value = !1, c.value = "error";
84
+ }, V = async (s, r = "", l = "") => {
85
+ t.value = "normal", i.value = 0, o.value = l || "导出进度", e.value = !0;
86
+ const n = await (s == null ? void 0 : s());
87
+ if (!n.status) {
88
+ e.value = !1, t.value = "error";
369
89
  return;
370
90
  }
371
- z(m.taskId, "action", "");
372
- }, E = async (f, a = "", o = "", m = !0) => {
373
- m && (c.value = "normal", w.value = 0, g.value = "导出进度", l.value = !0);
374
- const T = await (f == null ? void 0 : f());
375
- if (!T.status) {
376
- l.value = !1, c.value = "error";
91
+ k(n.taskId, "action", "");
92
+ }, X = async (s, r = "", l = "", n = !0) => {
93
+ n && (t.value = "normal", i.value = 0, o.value = "导出进度", e.value = !0);
94
+ const u = await (s == null ? void 0 : s());
95
+ if (!u.status) {
96
+ e.value = !1, t.value = "error";
377
97
  return;
378
98
  }
379
- ie().format("YYYYMMDDHHmmss") + "", z(T.taskId, "export", a || "", o);
380
- }, z = async (f, a, o, m = "") => {
381
- j.value = !0, C(f, a, o, m), b = setTimeout(() => {
99
+ W().format("YYYYMMDDHHmmss") + "", k(u.taskId, "export", r || "", l);
100
+ }, k = async (s, r, l, n = "") => {
101
+ g.value = !0, D(s, r, l, n), p = setTimeout(() => {
382
102
  }, 50);
383
- }, P = () => {
384
- clearTimeout(b), b = null, l.value = !1;
385
- }, C = async (f, a = "export", o, m = "") => {
386
- var e, n, r;
387
- const [T, t] = await ce("", {
388
- url: `progress/${f}`
103
+ }, S = () => {
104
+ clearTimeout(p), p = null, e.value = !1;
105
+ }, D = async (s, r = "export", l, n = "") => {
106
+ var m, c, $;
107
+ const [u, a] = await se("", {
108
+ url: `progress/${s}`
389
109
  }).run();
390
- if (T) {
391
- j.value = !1;
110
+ if (u) {
111
+ g.value = !1;
392
112
  return;
393
113
  }
394
- w.value = t.percentage;
395
- const s = a == "export" ? "导出" : "导入";
396
- if (w.value == 100)
397
- if (x.value = t, j.value = !1, P(), a == "export")
398
- t.status == 1 ? (c.value = "success", X(`${Q().baseURL}/oss${t.filePath}`, o, m), j.value = !1) : t.status == 2 && (y.value = t.message || `${s}失败`, (e = window.DasMessage) == null || e.error({
399
- message: t.message || `${s}失败`,
114
+ i.value = a.percentage;
115
+ const d = r == "export" ? "导出" : "导入";
116
+ if (i.value == 100)
117
+ if (h.value = a, g.value = !1, S(), r == "export")
118
+ a.status == 1 ? (t.value = "success", H(`${B().baseURL}/oss${a.filePath}`, l, n), g.value = !1) : a.status == 2 && (w.value = a.message || `${d}失败`, (m = window.DasMessage) == null || m.error({
119
+ message: a.message || `${d}失败`,
400
120
  grouping: !0,
401
121
  repeatNum: 1
402
122
  }));
403
- else if (a == "import") {
404
- if (t.filePath) {
405
- c.value = "error";
406
- const i = (n = k.name) == null ? void 0 : n.match(/(.*?)(\.[^.]*$|$)/), u = i.length ? i[2] : "";
407
- Y.value = !0;
408
- const d = (r = t.filePath) == null ? void 0 : r.replace(/(.*\/)*([^.]+).*/gi, "$2");
409
- D.value = R || `${d}${u}`, _.value = k.sizeText, y.value = "部分数据校验不通过,请下载附件并修改,重新导入!", S.value = `${Q().baseURL}/oss${t.filePath}`;
123
+ else if (r == "import") {
124
+ if (a.filePath) {
125
+ t.value = "error";
126
+ const x = (c = U.name) == null ? void 0 : c.match(/(.*?)(\.[^.]*$|$)/), j = x.length ? x[2] : "";
127
+ T.value = !0;
128
+ const N = ($ = a.filePath) == null ? void 0 : $.replace(/(.*\/)*([^.]+).*/gi, "$2");
129
+ v.value = L || `${N}${j}`, y.value = U.sizeText, w.value = "部分数据校验不通过,请下载附件并修改,重新导入!", P.value = `${B().baseURL}/oss${a.filePath}`;
410
130
  }
411
- W(t.status, s, t.message);
412
- } else a == "action" && (c.value = "success");
131
+ z(a.status, d, a.message);
132
+ } else r == "action" && (t.value = "success");
413
133
  else
414
- b && t.status != 2 ? b = setTimeout(() => {
415
- C(f, a, o, m);
416
- }, 50) : (x.value = t, j.value = !1, W(t.status, s, t.message), P(), Y.value = !0, y.value = (t == null ? void 0 : t.message) || "");
417
- }, W = (f, a, o) => {
418
- var m, T, t;
419
- f == 1 ? (c.value = "success", (m = window.DasMessage) == null || m.success({
420
- message: `${a}成功`,
134
+ p && a.status != 2 ? p = setTimeout(() => {
135
+ D(s, r, l, n);
136
+ }, 50) : (h.value = a, g.value = !1, z(a.status, d, a.message), S(), T.value = !0, w.value = (a == null ? void 0 : a.message) || "");
137
+ }, z = (s, r, l) => {
138
+ var n, u, a;
139
+ s == 1 ? (t.value = "success", (n = window.DasMessage) == null || n.success({
140
+ message: `${r}成功`,
421
141
  grouping: !0,
422
142
  repeatNum: 1
423
- }), D.value = "", _.value = "", y.value = "") : f == 2 ? (c.value = "error", (T = window.DasMessage) == null || T.error({
424
- message: o || `${a}失败`,
143
+ }), v.value = "", y.value = "", w.value = "") : s == 2 ? (t.value = "error", (u = window.DasMessage) == null || u.error({
144
+ message: l || `${r}失败`,
425
145
  grouping: !0,
426
146
  repeatNum: 1
427
- }), y.value = o || "部分数据校验不通过,请下载附件并修改,重新导入!") : f == 3 && (c.value = "error", (t = window.DasMessage) == null || t.error({
428
- message: `部分${a}失败`,
147
+ }), w.value = l || "部分数据校验不通过,请下载附件并修改,重新导入!") : s == 3 && (t.value = "error", (a = window.DasMessage) == null || a.error({
148
+ message: `部分${r}失败`,
429
149
  grouping: !0,
430
150
  repeatNum: 1
431
151
  }));
432
152
  };
433
153
  return {
434
- showProgressDialog: l,
435
- progressTitle: g,
436
- percent: w,
437
- progressStatus: c,
438
- progressLoading: j,
439
- progressResult: x,
440
- errorFileName: D,
441
- errorFileSize: _,
442
- errorMessage: y,
443
- errorImport: Y,
444
- errorFilePath: S,
445
- fileImport: Z,
446
- fileExport: E,
447
- fileAction: F,
448
- generateUniqueName: (f) => {
449
- const a = f == null ? void 0 : f.match(/(.*?)(\.[^.]*$|$)/), o = a.length ? a[2] : "";
450
- return `${a.length ? a[1] : f}${se()}${o}`;
154
+ showProgressDialog: e,
155
+ progressTitle: o,
156
+ percent: i,
157
+ progressStatus: t,
158
+ progressLoading: g,
159
+ progressResult: h,
160
+ errorFileName: v,
161
+ errorFileSize: y,
162
+ errorMessage: w,
163
+ errorImport: T,
164
+ errorFilePath: P,
165
+ fileImport: J,
166
+ fileExport: X,
167
+ fileAction: V,
168
+ generateUniqueName: (s) => {
169
+ const r = s == null ? void 0 : s.match(/(.*?)(\.[^.]*$|$)/), l = r.length ? r[2] : "";
170
+ return `${r.length ? r[1] : s}${Z()}${l}`;
451
171
  },
452
- downloadFile: X,
453
- resetStataus: N,
454
- checkProgress: z
172
+ downloadFile: H,
173
+ resetStataus: q,
174
+ checkProgress: k
455
175
  };
456
- }, fe = (l) => {
457
- let g = l == null ? void 0 : l.toLocaleLowerCase();
176
+ }, ae = (e) => {
177
+ let o = e == null ? void 0 : e.toLocaleLowerCase();
458
178
  return {
459
179
  excel: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
460
180
  pdf: "application/pdf",
@@ -481,28 +201,28 @@ const ie = /* @__PURE__ */ ne(ae), oe = G.get("token"), ue = G.post("put-object"
481
201
  crt: "application/x-x509-ca-cert",
482
202
  der: "application/x-x509-ca-cert",
483
203
  cer: "application/pkix-cert"
484
- }[g];
485
- }, X = (l, g, w = "excel") => {
486
- const c = new XMLHttpRequest();
487
- c.open("get", l), c.setRequestHeader("Content-Type", "application/json; charset=UTF-8"), c.responseType = "blob", c.onload = function(j) {
488
- const b = new Blob([this.response], {
489
- type: fe(w)
490
- }), x = URL.createObjectURL(b);
204
+ }[o];
205
+ }, H = (e, o, i = "excel") => {
206
+ const t = new XMLHttpRequest();
207
+ t.open("get", e), t.setRequestHeader("Content-Type", "application/json; charset=UTF-8"), t.responseType = "blob", t.onload = function(g) {
208
+ const p = new Blob([this.response], {
209
+ type: ae(i)
210
+ }), h = URL.createObjectURL(p);
491
211
  if (window.navigator.msSaveOrOpenBlob)
492
- navigator.msSaveBlob(b, g);
212
+ navigator.msSaveBlob(p, o);
493
213
  else {
494
- const D = document.createElement("a");
495
- D.href = x, D.download = g, D.click(), window.URL.revokeObjectURL(x);
214
+ const v = document.createElement("a");
215
+ v.href = h, v.download = o, v.click(), window.URL.revokeObjectURL(h);
496
216
  }
497
- }, c.send();
498
- }, de = (l) => new Promise((g, w) => {
499
- var c = new FileReader();
500
- c.onload = function(j) {
501
- let b = "";
502
- typeof c.result == "string" && (b = JSON.parse(c.result)), g(b);
503
- }, c.readAsText(l);
217
+ }, t.send();
218
+ }, re = (e) => new Promise((o, i) => {
219
+ var t = new FileReader();
220
+ t.onload = function(g) {
221
+ let p = "";
222
+ typeof t.result == "string" && (p = JSON.parse(t.result)), o(p);
223
+ }, t.readAsText(e);
504
224
  });
505
225
  export {
506
- X as downloadFile,
507
- ve as useFile
226
+ H as downloadFile,
227
+ ce as useFile
508
228
  };