@das-fed/utils 6.4.0-dev.4 → 6.4.0-dev.41

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 (93) hide show
  1. package/api-services/index.js +1704 -1802
  2. package/api-services/index.js.gz +0 -0
  3. package/api-services/modules/app-manage/index.js +1935 -2034
  4. package/api-services/modules/app-manage/index.js.gz +0 -0
  5. package/api-services/modules/authentication/index.js +1935 -2034
  6. package/api-services/modules/authentication/index.js.gz +0 -0
  7. package/api-services/modules/bems/index.js +1938 -2037
  8. package/api-services/modules/bems/index.js.gz +0 -0
  9. package/api-services/modules/contract/index.js +1935 -2034
  10. package/api-services/modules/contract/index.js.gz +0 -0
  11. package/api-services/modules/duty-manage/index.js +1940 -2039
  12. package/api-services/modules/duty-manage/index.js.gz +0 -0
  13. package/api-services/modules/enterpriseright/index.js +1935 -2034
  14. package/api-services/modules/enterpriseright/index.js.gz +0 -0
  15. package/api-services/modules/file/index.d.ts +1 -0
  16. package/api-services/modules/file/index.js +152 -430
  17. package/api-services/modules/file/index.js.gz +0 -0
  18. package/api-services/modules/gateway-edge/index.js +1935 -2034
  19. package/api-services/modules/gateway-edge/index.js.gz +0 -0
  20. package/api-services/modules/index.js +1842 -1940
  21. package/api-services/modules/index.js.gz +0 -0
  22. package/api-services/modules/iot/index.js +1949 -2048
  23. package/api-services/modules/iot/index.js.gz +0 -0
  24. package/api-services/modules/justauth/index.js +1934 -2033
  25. package/api-services/modules/justauth/index.js.gz +0 -0
  26. package/api-services/modules/knowledge/index.js +1936 -2035
  27. package/api-services/modules/knowledge/index.js.gz +0 -0
  28. package/api-services/modules/link/index.js +1935 -2034
  29. package/api-services/modules/link/index.js.gz +0 -0
  30. package/api-services/modules/permission/index.js +1935 -2034
  31. package/api-services/modules/permission/index.js.gz +0 -0
  32. package/api-services/modules/platformManage/index.js +1942 -2041
  33. package/api-services/modules/platformManage/index.js.gz +0 -0
  34. package/api-services/modules/portal/index.js +1935 -2034
  35. package/api-services/modules/portal/index.js.gz +0 -0
  36. package/api-services/modules/space-manage/index.js +1935 -2034
  37. package/api-services/modules/space-manage/index.js.gz +0 -0
  38. package/api-services/modules/super-admin/index.js +1940 -2039
  39. package/api-services/modules/super-admin/index.js.gz +0 -0
  40. package/api-services/modules/supplier/index.js +1939 -2038
  41. package/api-services/modules/supplier/index.js.gz +0 -0
  42. package/api-services/modules/supplychain-manage/index.js +1935 -2034
  43. package/api-services/modules/supplychain-manage/index.js.gz +0 -0
  44. package/api-services/modules/systemConfiguration/index.js +1935 -2034
  45. package/api-services/modules/systemConfiguration/index.js.gz +0 -0
  46. package/api-services/modules/tool/index.js +1935 -2034
  47. package/api-services/modules/tool/index.js.gz +0 -0
  48. package/api-services/src/create-service/index.js +1937 -2036
  49. package/api-services/src/create-service/index.js.gz +0 -0
  50. package/common-info/getInfoFromUrl/index.js.gz +0 -0
  51. package/common-info/index.js +4 -3
  52. package/common-info/index.js.gz +0 -0
  53. package/common-info/set-personal-info/index.js +837 -570
  54. package/common-info/set-personal-info/index.js.gz +0 -0
  55. package/common-info/type.d.ts +106 -104
  56. package/common-tools/extract-file-name/index.d.ts +1 -0
  57. package/common-tools/extract-file-name/index.js +1716 -0
  58. package/common-tools/extract-file-name/index.js.gz +0 -0
  59. package/common-tools/get-url-params/index.js.gz +0 -0
  60. package/common-tools/index.d.ts +2 -0
  61. package/common-tools/index.js +2 -0
  62. package/common-tools/platform-tools/index.d.ts +2 -1
  63. package/common-tools/platform-tools/index.js +16 -11
  64. package/common-tools/setHtmlMinWH/index.js +4 -8
  65. package/common-tools/update-browser-title/index.d.ts +1 -0
  66. package/common-tools/update-browser-title/index.js +12 -0
  67. package/common-tools/update-fav-icon/index.js +15 -14
  68. package/create-api-service/index.js +1937 -2036
  69. package/create-api-service/index.js.gz +0 -0
  70. package/create-api-service/sso/index.js +1193 -833
  71. package/create-api-service/sso/index.js.gz +0 -0
  72. package/curring-http/index.js +1364 -1097
  73. package/curring-http/index.js.gz +0 -0
  74. package/curring-http/type.d.ts +87 -87
  75. package/directive/auth/index.js.gz +0 -0
  76. package/esm-map.json +4 -2
  77. package/hooks/popup-manager/use-zindex/index.d.ts +0 -2
  78. package/hooks/popup-manager/use-zindex/index.js +7 -20
  79. package/hooks/use-get-auth/index.js.gz +0 -0
  80. package/nextTiken/index.js.gz +0 -0
  81. package/package.json +4 -4
  82. package/pinyin-first-character/index.js +19804 -20879
  83. package/pinyin-first-character/index.js.gz +0 -0
  84. package/style/index.js +4 -2
  85. package/style/index.js.gz +0 -0
  86. package/token-tools/index.d.ts +0 -5
  87. package/token-tools/index.js +8 -84
  88. package/use-low-code/index.js +11 -11
  89. package/use-low-code/index.js.gz +0 -0
  90. package/use-low-code/style.css +1 -1
  91. package/webSocket-service/index.js.gz +0 -0
  92. package/webSocket-service/type.d.ts +28 -28
  93. package/token-tools/index.js.gz +0 -0
@@ -1,460 +1,182 @@
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 A, iotProgress as Z } from "@das-fed/utils/api-services/modules/iot";
2
+ import { extractFilename as F } from "@das-fed/utils/common-tools";
3
+ import { ref as m } from "vue";
4
+ import ee from "dayjs";
5
+ import { t as i } from "@das-fed/web/packages/i18n/index";
6
+ import { getConfig as B } from "@das-fed/utils/config";
7
+ let te = (e = 21) => {
8
+ let o = "", u = crypto.getRandomValues(new Uint8Array(e));
9
+ for (; e--; ) {
10
+ let s = u[e] & 63;
11
+ s < 36 ? o += s.toString(36) : s < 62 ? o += (s - 26).toString(36).toUpperCase() : s < 63 ? o += "_" : o += "-";
9
12
  }
10
- return g;
13
+ return o;
11
14
  };
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 = [];
15
+ const se = A.get("token"), ae = A.post("put-object", (e) => (e.headers || (e.headers = {}), e.headers["Content-Type"] = "multipart/form-data", e.responseType = "blob", e)), re = A.post("upload-objects", (e) => (e.headers || (e.headers = {}), e.headers["Content-Type"] = "multipart/form-data", e.responseType = "blob", e)), oe = Z.get("progress"), de = () => {
16
+ let e = m(!1), o = m(""), u = m(0), s = m("normal"), g = m(!1), f, h = m(""), w = m(""), T = m(""), b = m(""), $ = m(!1), L = m(""), P = "", U = m(""), I;
17
+ const Y = () => {
18
+ w.value = "", T.value = "", b.value = "", $.value = !1, L.value = "";
19
+ }, J = async () => {
20
+ const [a, r] = await se().run();
21
+ return a ? { stauts: !1 } : { status: !0, data: r };
22
+ }, K = (a) => new Promise((r, l) => {
23
+ const c = [];
302
24
  let t = 0;
303
- for (; t < f.size; ) {
304
- const e = f.slice(t, t + 1048576);
305
- T.push(e), t += 1048576;
25
+ for (; t < a.size; ) {
26
+ const v = a.slice(t, t + 1048576);
27
+ c.push(v), t += 1048576;
306
28
  }
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;
29
+ const d = new Blob(c, { type: a.type });
30
+ r(d);
31
+ }), V = async (a, r, l, n = !0, c = "", t = !1) => {
32
+ var H, O;
33
+ P = c, U.value = "import", n && (s.value = "normal", u.value = 0, o.value = i("导入进度"), e.value = !0, h.value = ""), I = r;
34
+ const d = await J();
35
+ if (!d.status) return;
36
+ let v = d.data, p = null, { autoContentType: y, bucketName: j, importFileName: E } = l;
37
+ const G = t ? re : ae;
316
38
  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);
39
+ let M = [];
40
+ await r.forEach(async (R) => {
41
+ let N = await K(R);
42
+ M.push(N);
43
+ }), p = new FormData(), p.append("accessKeyId", v.accessKeyId), p.append("secretAccessKey", v.secretAccessKey), p.append("sessionToken", v.sessionToken), p.append("bucketName", j), r.forEach((R, N) => {
44
+ p.append("file", M[N]);
45
+ }), E.forEach((R) => {
46
+ p.append("filePaths", R);
325
47
  });
326
48
  } 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
49
+ const M = await K(r);
50
+ p = {
51
+ accessKeyId: v.accessKeyId,
52
+ secretAccessKey: v.secretAccessKey,
53
+ sessionToken: v.sessionToken,
54
+ file: M,
55
+ bucketName: j,
56
+ filePath: E,
57
+ autoContentType: y
336
58
  };
337
59
  }
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) || "上传失败",
60
+ const [Q, W] = await G(p).run();
61
+ if (Q) return e.value = !1;
62
+ const x = await ne(W.data);
63
+ if ((x == null ? void 0 : x.statusCode) != 200) {
64
+ e.value = !1, (H = window.DasMessage) == null || H.error({
65
+ message: (x == null ? void 0 : x.errorMsg) || i("上传失败"),
344
66
  grouping: !0,
345
67
  repeatNum: 1
346
68
  });
347
69
  return;
348
70
  }
349
- const M = await (f == null ? void 0 : f(p));
350
- if (m) {
351
- if (!M.status) {
352
- l.value = !1, c.value = "error";
71
+ const C = await (a == null ? void 0 : a(x));
72
+ if (n) {
73
+ if (!C.status) {
74
+ e.value = !1, s.value = "error";
353
75
  return;
354
76
  }
355
- g.value = "导入进度", l.value = !0, z(M.taskId, "import", "");
77
+ o.value = i("导入进度"), e.value = !0, k(C.taskId, "import", "");
356
78
  } else {
357
- if (!M.status) return;
358
- c.value = "success", (H = window.DasMessage) == null || H.success({
359
- message: "导入成功",
79
+ if (!C.status) return;
80
+ s.value = "success", (O = window.DasMessage) == null || O.success({
81
+ message: i("导入成功"),
360
82
  grouping: !0,
361
83
  repeatNum: 1
362
84
  });
363
85
  }
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";
86
+ }, X = async (a, r = "", l = "") => {
87
+ s.value = "normal", u.value = 0, o.value = l || i("导出进度"), e.value = !0;
88
+ const n = await (a == null ? void 0 : a());
89
+ if (!n.status) {
90
+ e.value = !1, s.value = "error";
369
91
  return;
370
92
  }
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";
93
+ k(n.taskId, "action", "");
94
+ }, _ = async (a, r = "", l = "", n = !0) => {
95
+ U.value = "export", n && (s.value = "normal", u.value = 0, o.value = i("导出进度"), e.value = !0);
96
+ const c = await (a == null ? void 0 : a());
97
+ if (!c.status) {
98
+ e.value = !1, s.value = "error";
377
99
  return;
378
100
  }
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(() => {
101
+ ee().format("YYYYMMDDHHmmss") + "", k(c.taskId, "export", r || "", l);
102
+ }, k = async (a, r, l, n = "") => {
103
+ g.value = !0, D(a, r, l, n), f = setTimeout(() => {
382
104
  }, 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}`
105
+ }, S = () => {
106
+ clearTimeout(f), f = null, e.value = !1;
107
+ }, D = async (a, r = "export", l, n = "") => {
108
+ var v, p;
109
+ const [c, t] = await oe("", {
110
+ url: `progress/${a}`
389
111
  }).run();
390
- if (T) {
391
- j.value = !1;
112
+ if (c) {
113
+ g.value = !1;
392
114
  return;
393
115
  }
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}失败`,
116
+ u.value = t.percentage;
117
+ const d = r == "export" ? i("导出") : i("导入");
118
+ if (u.value == 100)
119
+ if (h.value = t, g.value = !1, S(), r == "export")
120
+ t.status == 1 ? (s.value = "success", q(`${B().baseURL}/oss${t.filePath}`, l, n), g.value = !1) : t.status == 2 && (b.value = t.message || `${d}${i("失败")}`, (v = window.DasMessage) == null || v.error({
121
+ message: t.message || `${d}${i("失败")}`,
400
122
  grouping: !0,
401
123
  repeatNum: 1
402
124
  }));
403
- else if (a == "import") {
125
+ else if (r == "import") {
404
126
  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}`;
127
+ s.value = "error", $.value = !0;
128
+ let y = await F(`/oss/${t == null ? void 0 : t.filePath}`);
129
+ const j = ((p = y == null ? void 0 : y.split("/")) == null ? void 0 : p.pop()) || "";
130
+ w.value = P || j, T.value = I.sizeText, b.value = i("部分数据校验不通过,请下载附件并修改,重新导入!"), L.value = `${B().baseURL}/oss/${t == null ? void 0 : t.filePath}`;
410
131
  }
411
- W(t.status, s, t.message);
412
- } else a == "action" && (c.value = "success");
132
+ z(t.status, d, t.message);
133
+ } else r == "action" && (s.value = "success");
413
134
  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}成功`,
135
+ f && t.status != 2 ? f = setTimeout(() => {
136
+ D(a, r, l, n);
137
+ }, 50) : (h.value = t, g.value = !1, z(t.status, d, t.message), S(), $.value = !0, b.value = (t == null ? void 0 : t.message) || "");
138
+ }, z = (a, r, l) => {
139
+ var n, c, t;
140
+ a == 1 ? (s.value = "success", (n = window.DasMessage) == null || n.success({
141
+ message: `${r}${i("成功")}`,
421
142
  grouping: !0,
422
143
  repeatNum: 1
423
- }), D.value = "", _.value = "", y.value = "") : f == 2 ? (c.value = "error", (T = window.DasMessage) == null || T.error({
424
- message: o || `${a}失败`,
144
+ }), w.value = "", T.value = "", b.value = "") : a == 2 ? (s.value = "error", (c = window.DasMessage) == null || c.error({
145
+ message: l || `${r}${i("失败")}`,
425
146
  grouping: !0,
426
147
  repeatNum: 1
427
- }), y.value = o || "部分数据校验不通过,请下载附件并修改,重新导入!") : f == 3 && (c.value = "error", (t = window.DasMessage) == null || t.error({
428
- message: `部分${a}失败`,
148
+ }), b.value = l || i("部分数据校验不通过,请下载附件并修改,重新导入!")) : a == 3 && (s.value = "error", (t = window.DasMessage) == null || t.error({
149
+ message: `${i("部分")}${r}${i("失败")}`,
429
150
  grouping: !0,
430
151
  repeatNum: 1
431
152
  }));
432
153
  };
433
154
  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}`;
155
+ showProgressDialog: e,
156
+ progressTitle: o,
157
+ percent: u,
158
+ progressStatus: s,
159
+ progressLoading: g,
160
+ progressResult: h,
161
+ errorFileName: w,
162
+ errorFileSize: T,
163
+ errorMessage: b,
164
+ errorImport: $,
165
+ errorFilePath: L,
166
+ fileImport: V,
167
+ fileExport: _,
168
+ fileAction: X,
169
+ generateUniqueName: (a) => {
170
+ const r = a == null ? void 0 : a.match(/(.*?)(\.[^.]*$|$)/), l = r.length ? r[2] : "";
171
+ return `${r.length ? r[1] : a}${te()}${l}`;
451
172
  },
452
- downloadFile: X,
453
- resetStataus: N,
454
- checkProgress: z
173
+ downloadFile: q,
174
+ resetStataus: Y,
175
+ checkProgress: k,
176
+ fileHandleType: U
455
177
  };
456
- }, fe = (l) => {
457
- let g = l == null ? void 0 : l.toLocaleLowerCase();
178
+ }, le = (e) => {
179
+ let o = e == null ? void 0 : e.toLocaleLowerCase();
458
180
  return {
459
181
  excel: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
460
182
  pdf: "application/pdf",
@@ -481,28 +203,28 @@ const ie = /* @__PURE__ */ ne(ae), oe = G.get("token"), ue = G.post("put-object"
481
203
  crt: "application/x-x509-ca-cert",
482
204
  der: "application/x-x509-ca-cert",
483
205
  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);
206
+ }[o];
207
+ }, q = (e, o, u = "excel") => {
208
+ const s = new XMLHttpRequest();
209
+ s.open("get", e), s.setRequestHeader("Content-Type", "application/json; charset=UTF-8"), s.responseType = "blob", s.onload = function(g) {
210
+ const f = new Blob([this.response], {
211
+ type: le(u)
212
+ }), h = URL.createObjectURL(f);
491
213
  if (window.navigator.msSaveOrOpenBlob)
492
- navigator.msSaveBlob(b, g);
214
+ navigator.msSaveBlob(f, o);
493
215
  else {
494
- const D = document.createElement("a");
495
- D.href = x, D.download = g, D.click(), window.URL.revokeObjectURL(x);
216
+ const w = document.createElement("a");
217
+ w.href = h, w.download = o, w.click(), window.URL.revokeObjectURL(h);
496
218
  }
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);
219
+ }, s.send();
220
+ }, ne = (e) => new Promise((o, u) => {
221
+ var s = new FileReader();
222
+ s.onload = function(g) {
223
+ let f = "";
224
+ typeof s.result == "string" && (f = JSON.parse(s.result)), o(f);
225
+ }, s.readAsText(e);
504
226
  });
505
227
  export {
506
- X as downloadFile,
507
- ve as useFile
228
+ q as downloadFile,
229
+ de as useFile
508
230
  };