@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.
- package/api-services/index.js +1284 -1696
- package/api-services/index.js.gz +0 -0
- package/api-services/modules/app-manage/index.js +1080 -1492
- package/api-services/modules/app-manage/index.js.gz +0 -0
- package/api-services/modules/authentication/index.js +1080 -1492
- package/api-services/modules/authentication/index.js.gz +0 -0
- package/api-services/modules/bems/index.js +1083 -1495
- package/api-services/modules/bems/index.js.gz +0 -0
- package/api-services/modules/contract/index.js +1080 -1492
- package/api-services/modules/contract/index.js.gz +0 -0
- package/api-services/modules/duty-manage/index.js +1049 -1461
- package/api-services/modules/duty-manage/index.js.gz +0 -0
- package/api-services/modules/enterpriseright/index.js +1080 -1492
- package/api-services/modules/enterpriseright/index.js.gz +0 -0
- package/api-services/modules/file/index.js +152 -432
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/index.js +1080 -1492
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/index.js +1460 -1872
- package/api-services/modules/index.js.gz +0 -0
- package/api-services/modules/iot/index.js +1120 -1532
- package/api-services/modules/iot/index.js.gz +0 -0
- package/api-services/modules/justauth/index.js +1046 -1458
- package/api-services/modules/justauth/index.js.gz +0 -0
- package/api-services/modules/knowledge/index.js +1080 -1492
- package/api-services/modules/knowledge/index.js.gz +0 -0
- package/api-services/modules/link/index.js +1080 -1492
- package/api-services/modules/link/index.js.gz +0 -0
- package/api-services/modules/permission/index.js +1080 -1492
- package/api-services/modules/permission/index.js.gz +0 -0
- package/api-services/modules/platformManage/index.js +1086 -1498
- package/api-services/modules/platformManage/index.js.gz +0 -0
- package/api-services/modules/portal/index.js +1045 -1457
- package/api-services/modules/portal/index.js.gz +0 -0
- package/api-services/modules/space-manage/index.js +1080 -1492
- package/api-services/modules/space-manage/index.js.gz +0 -0
- package/api-services/modules/super-admin/index.js +1047 -1459
- package/api-services/modules/super-admin/index.js.gz +0 -0
- package/api-services/modules/supplier/index.js +1077 -1489
- package/api-services/modules/supplier/index.js.gz +0 -0
- package/api-services/modules/supplychain-manage/index.js +1045 -1457
- package/api-services/modules/supplychain-manage/index.js.gz +0 -0
- package/api-services/modules/systemConfiguration/index.js +1080 -1492
- package/api-services/modules/systemConfiguration/index.js.gz +0 -0
- package/api-services/modules/tool/index.js +1080 -1492
- package/api-services/modules/tool/index.js.gz +0 -0
- package/api-services/src/create-service/index.js +1074 -1486
- package/api-services/src/create-service/index.js.gz +0 -0
- package/common-tools/platform-tools/index.d.ts +2 -1
- package/common-tools/platform-tools/index.js +16 -11
- package/create-api-service/index.js +1074 -1486
- package/create-api-service/index.js.gz +0 -0
- package/esm-map.json +2 -1
- package/hooks/popup-manager/use-zindex/index.js +8 -17
- package/package.json +3 -3
|
Binary file
|
|
@@ -1,460 +1,180 @@
|
|
|
1
|
-
import { iotMinio as
|
|
2
|
-
import { ref as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
|
11
|
+
return o;
|
|
11
12
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
|
308
|
-
|
|
309
|
-
}),
|
|
310
|
-
var
|
|
311
|
-
|
|
312
|
-
const
|
|
313
|
-
if (!
|
|
314
|
-
let
|
|
315
|
-
const
|
|
316
|
-
if (
|
|
317
|
-
let
|
|
318
|
-
await
|
|
319
|
-
let
|
|
320
|
-
|
|
321
|
-
}),
|
|
322
|
-
|
|
323
|
-
}),
|
|
324
|
-
|
|
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
|
|
328
|
-
|
|
329
|
-
accessKeyId:
|
|
330
|
-
secretAccessKey:
|
|
331
|
-
sessionToken:
|
|
332
|
-
file:
|
|
333
|
-
bucketName:
|
|
334
|
-
filePath:
|
|
335
|
-
autoContentType:
|
|
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 [
|
|
339
|
-
if (
|
|
340
|
-
const
|
|
341
|
-
if ((
|
|
342
|
-
|
|
343
|
-
message: (
|
|
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
|
|
350
|
-
if (
|
|
351
|
-
if (!
|
|
352
|
-
|
|
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
|
-
|
|
75
|
+
o.value = "导入进度", e.value = !0, k(C.taskId, "import", "");
|
|
356
76
|
} else {
|
|
357
|
-
if (!
|
|
358
|
-
|
|
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
|
-
},
|
|
365
|
-
|
|
366
|
-
const
|
|
367
|
-
if (!
|
|
368
|
-
|
|
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
|
-
|
|
372
|
-
},
|
|
373
|
-
|
|
374
|
-
const
|
|
375
|
-
if (!
|
|
376
|
-
|
|
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
|
-
|
|
380
|
-
},
|
|
381
|
-
|
|
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
|
-
},
|
|
384
|
-
clearTimeout(
|
|
385
|
-
},
|
|
386
|
-
var
|
|
387
|
-
const [
|
|
388
|
-
url: `progress/${
|
|
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 (
|
|
391
|
-
|
|
110
|
+
if (u) {
|
|
111
|
+
g.value = !1;
|
|
392
112
|
return;
|
|
393
113
|
}
|
|
394
|
-
|
|
395
|
-
const
|
|
396
|
-
if (
|
|
397
|
-
if (
|
|
398
|
-
|
|
399
|
-
message:
|
|
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 (
|
|
404
|
-
if (
|
|
405
|
-
|
|
406
|
-
const
|
|
407
|
-
|
|
408
|
-
const
|
|
409
|
-
|
|
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
|
-
|
|
412
|
-
} else
|
|
131
|
+
z(a.status, d, a.message);
|
|
132
|
+
} else r == "action" && (t.value = "success");
|
|
413
133
|
else
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
}, 50) : (
|
|
417
|
-
},
|
|
418
|
-
var
|
|
419
|
-
|
|
420
|
-
message: `${
|
|
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
|
-
}),
|
|
424
|
-
message:
|
|
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
|
-
}),
|
|
428
|
-
message: `部分${
|
|
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:
|
|
435
|
-
progressTitle:
|
|
436
|
-
percent:
|
|
437
|
-
progressStatus:
|
|
438
|
-
progressLoading:
|
|
439
|
-
progressResult:
|
|
440
|
-
errorFileName:
|
|
441
|
-
errorFileSize:
|
|
442
|
-
errorMessage:
|
|
443
|
-
errorImport:
|
|
444
|
-
errorFilePath:
|
|
445
|
-
fileImport:
|
|
446
|
-
fileExport:
|
|
447
|
-
fileAction:
|
|
448
|
-
generateUniqueName: (
|
|
449
|
-
const
|
|
450
|
-
return `${
|
|
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:
|
|
453
|
-
resetStataus:
|
|
454
|
-
checkProgress:
|
|
172
|
+
downloadFile: H,
|
|
173
|
+
resetStataus: q,
|
|
174
|
+
checkProgress: k
|
|
455
175
|
};
|
|
456
|
-
},
|
|
457
|
-
let
|
|
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
|
-
}[
|
|
485
|
-
},
|
|
486
|
-
const
|
|
487
|
-
|
|
488
|
-
const
|
|
489
|
-
type:
|
|
490
|
-
}),
|
|
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(
|
|
212
|
+
navigator.msSaveBlob(p, o);
|
|
493
213
|
else {
|
|
494
|
-
const
|
|
495
|
-
|
|
214
|
+
const v = document.createElement("a");
|
|
215
|
+
v.href = h, v.download = o, v.click(), window.URL.revokeObjectURL(h);
|
|
496
216
|
}
|
|
497
|
-
},
|
|
498
|
-
},
|
|
499
|
-
var
|
|
500
|
-
|
|
501
|
-
let
|
|
502
|
-
typeof
|
|
503
|
-
},
|
|
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
|
-
|
|
507
|
-
|
|
226
|
+
H as downloadFile,
|
|
227
|
+
ce as useFile
|
|
508
228
|
};
|
|
Binary file
|