antd-import-export 1.0.7 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -27
- package/README_EN.md +56 -27
- package/dist/components/ExportButton.d.ts +3 -5
- package/dist/components/ImportButton.d.ts +6 -5
- package/dist/core/excel/exportFile.d.ts +2 -4
- package/dist/core/limits.d.ts +0 -7
- package/dist/core/task/types.d.ts +2 -8
- package/dist/index.cjs +6 -6
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +388 -400
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -13,24 +13,24 @@ var j = Object.create, M = Object.defineProperty, te = Object.getOwnPropertyDesc
|
|
|
13
13
|
enumerable: !(r = te(t, s)) || r.enumerable
|
|
14
14
|
});
|
|
15
15
|
return e;
|
|
16
|
-
},
|
|
16
|
+
}, F = (e, t, n) => (n = e == null ? {} : j(ne(e)), ie(t || !e || !e.__esModule || !P.call(e, "default") ? M(n, "default", {
|
|
17
17
|
value: e,
|
|
18
18
|
enumerable: !0
|
|
19
19
|
}) : n, e));
|
|
20
20
|
// src/core/schema/index.ts
|
|
21
|
-
function
|
|
21
|
+
function ae(e) {
|
|
22
22
|
return e.filter((e) => e.importable !== !1);
|
|
23
23
|
}
|
|
24
24
|
// src/core/schema/multiValue.ts
|
|
25
|
-
var
|
|
26
|
-
function
|
|
25
|
+
var I = ";", oe = /[;;]/;
|
|
26
|
+
function L(e) {
|
|
27
27
|
return e.map((e) => String(e)).join(";");
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
return e.split(
|
|
29
|
+
function se(e) {
|
|
30
|
+
return e.split(oe).map((e) => e.trim()).filter(Boolean);
|
|
31
31
|
}
|
|
32
32
|
// src/core/schema/validate.ts
|
|
33
|
-
var
|
|
33
|
+
var ce = /* @__PURE__ */ F((/* @__PURE__ */ re(((e, t, n) => {
|
|
34
34
|
(function(n, r) {
|
|
35
35
|
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs_plugin_customParseFormat = r();
|
|
36
36
|
})(n, (function() {
|
|
@@ -187,8 +187,8 @@ var le = /* @__PURE__ */ ae((/* @__PURE__ */ re(((e, t, n) => {
|
|
|
187
187
|
};
|
|
188
188
|
}));
|
|
189
189
|
})))(), 1);
|
|
190
|
-
e.extend(
|
|
191
|
-
function
|
|
190
|
+
e.extend(ce.default);
|
|
191
|
+
function R(e, t) {
|
|
192
192
|
return e.length > t.property.max_length ? {
|
|
193
193
|
validateSuccess: !1,
|
|
194
194
|
validateMessage: `长度不能超过 ${t.property.max_length}`
|
|
@@ -197,7 +197,7 @@ function L(e, t) {
|
|
|
197
197
|
validateValue: e
|
|
198
198
|
};
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function le(e, n) {
|
|
201
201
|
let r = Number(e);
|
|
202
202
|
if (!Number.isFinite(r)) return {
|
|
203
203
|
validateSuccess: !1,
|
|
@@ -235,7 +235,7 @@ function ue(e, n) {
|
|
|
235
235
|
validateValue: r
|
|
236
236
|
};
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function ue(e, t) {
|
|
239
239
|
return e === t.property.true_label ? {
|
|
240
240
|
validateSuccess: !0,
|
|
241
241
|
validateValue: !0
|
|
@@ -247,7 +247,7 @@ function de(e, t) {
|
|
|
247
247
|
validateMessage: `内容必须是 ${t.property.true_label}|${t.property.false_label}`
|
|
248
248
|
};
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function de(t) {
|
|
251
251
|
let n = e(t, "YYYY-MM-DD", !0);
|
|
252
252
|
return n.isValid() ? {
|
|
253
253
|
validateSuccess: !0,
|
|
@@ -257,17 +257,25 @@ function fe(t) {
|
|
|
257
257
|
validateMessage: "不是有效的日期格式 YYYY-MM-DD"
|
|
258
258
|
};
|
|
259
259
|
}
|
|
260
|
-
function
|
|
261
|
-
let t = /^([01]?[0-9]|2[0-3]):([0-5][0-9])$/.exec(e);
|
|
262
|
-
|
|
260
|
+
function fe(e) {
|
|
261
|
+
let t = /^([01]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/.exec(e);
|
|
262
|
+
if (t) {
|
|
263
|
+
let e = t[1].padStart(2, "0"), n = t[2], r = t[3];
|
|
264
|
+
return {
|
|
265
|
+
validateSuccess: !0,
|
|
266
|
+
validateValue: r === "00" ? `${e}:${n}` : `${e}:${n}:${r}`
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
let n = /^([01]?[0-9]|2[0-3]):([0-5][0-9])$/.exec(e);
|
|
270
|
+
return n ? {
|
|
263
271
|
validateSuccess: !0,
|
|
264
|
-
validateValue: `${
|
|
272
|
+
validateValue: `${n[1].padStart(2, "0")}:${n[2]}`
|
|
265
273
|
} : {
|
|
266
274
|
validateSuccess: !1,
|
|
267
|
-
validateMessage: "
|
|
275
|
+
validateMessage: "不是有效的时间格式 HH:mm 或 HH:mm:ss"
|
|
268
276
|
};
|
|
269
277
|
}
|
|
270
|
-
function
|
|
278
|
+
function pe(t) {
|
|
271
279
|
let n = e(t, "YYYY-MM-DD HH:mm:ss", !0);
|
|
272
280
|
if (n.isValid()) return {
|
|
273
281
|
validateSuccess: !0,
|
|
@@ -282,8 +290,8 @@ function me(t) {
|
|
|
282
290
|
validateMessage: "不是有效的日期时间格式 YYYY-MM-DD HH:mm 或 YYYY-MM-DD HH:mm:ss"
|
|
283
291
|
};
|
|
284
292
|
}
|
|
285
|
-
function
|
|
286
|
-
let n =
|
|
293
|
+
function z(e, t) {
|
|
294
|
+
let n = se(e);
|
|
287
295
|
if (n.length > t.property.list_max_length) return {
|
|
288
296
|
validateSuccess: !1,
|
|
289
297
|
validateMessage: `列表长度不能超过 ${t.property.list_max_length}`
|
|
@@ -297,7 +305,7 @@ function R(e, t) {
|
|
|
297
305
|
validateValue: n
|
|
298
306
|
};
|
|
299
307
|
}
|
|
300
|
-
function
|
|
308
|
+
function B(e, t) {
|
|
301
309
|
return e in t.property.option_map ? {
|
|
302
310
|
validateSuccess: !0,
|
|
303
311
|
validateValue: t.property.option_map[e]
|
|
@@ -306,8 +314,8 @@ function z(e, t) {
|
|
|
306
314
|
validateMessage: `内容必须是 ${Object.keys(t.property.option_map).join("|")}`
|
|
307
315
|
};
|
|
308
316
|
}
|
|
309
|
-
function
|
|
310
|
-
let n =
|
|
317
|
+
function V(e, t) {
|
|
318
|
+
let n = se(e), r = t.property.option_map, i = [];
|
|
311
319
|
for (let e of n) {
|
|
312
320
|
if (!(e in r)) return {
|
|
313
321
|
validateSuccess: !1,
|
|
@@ -320,7 +328,7 @@ function B(e, t) {
|
|
|
320
328
|
validateValue: i
|
|
321
329
|
};
|
|
322
330
|
}
|
|
323
|
-
function
|
|
331
|
+
function H(e, t) {
|
|
324
332
|
if (e === null) return t.property.required ? {
|
|
325
333
|
validateSuccess: !1,
|
|
326
334
|
validateMessage: "不能为空"
|
|
@@ -328,84 +336,81 @@ function V(e, t) {
|
|
|
328
336
|
validateSuccess: !0,
|
|
329
337
|
validateValue: t.property.default_value
|
|
330
338
|
};
|
|
331
|
-
if (t.type === "text") return
|
|
332
|
-
if (t.type === "number") return
|
|
333
|
-
if (t.type === "boolean") return
|
|
334
|
-
if (t.type === "date") return
|
|
335
|
-
if (t.type === "time") return
|
|
336
|
-
if (t.type === "datetime") return
|
|
337
|
-
if (t.type === "list") return
|
|
338
|
-
if (t.type === "single_choice") return
|
|
339
|
-
if (t.type === "multiple_choice") return
|
|
339
|
+
if (t.type === "text") return R(e, t);
|
|
340
|
+
if (t.type === "number") return le(e, t);
|
|
341
|
+
if (t.type === "boolean") return ue(e, t);
|
|
342
|
+
if (t.type === "date") return de(e);
|
|
343
|
+
if (t.type === "time") return fe(e);
|
|
344
|
+
if (t.type === "datetime") return pe(e);
|
|
345
|
+
if (t.type === "list") return z(e, t);
|
|
346
|
+
if (t.type === "single_choice") return B(e, t);
|
|
347
|
+
if (t.type === "multiple_choice") return V(e, t);
|
|
340
348
|
throw Error("未知的字段类型");
|
|
341
349
|
}
|
|
342
350
|
// src/core/limits.ts
|
|
343
|
-
var
|
|
344
|
-
function W(e, t, n) {
|
|
345
|
-
return e <= t ? null : `${n}数据 ${e.toLocaleString()} 条,超过上限 ${t.toLocaleString()} 条,请分批${n}`;
|
|
346
|
-
}
|
|
347
|
-
function ge(e, t, n) {
|
|
348
|
-
let r = W(e, t, n);
|
|
349
|
-
if (r) throw Error(r);
|
|
350
|
-
}
|
|
351
|
+
var me = 20971520;
|
|
351
352
|
// src/core/excel/importEditor.ts
|
|
352
|
-
function
|
|
353
|
+
function U(e, t) {
|
|
353
354
|
if (t != null) {
|
|
354
355
|
if (e.type !== "single_choice" && e.type !== "multiple_choice") return String(t);
|
|
355
356
|
for (let [n, r] of Object.entries(e.property.option_map)) if (r === t) return n;
|
|
356
357
|
return String(t);
|
|
357
358
|
}
|
|
358
359
|
}
|
|
359
|
-
function
|
|
360
|
-
return e.type === "boolean" ? t === !0 ? e.property.true_label : t === !1 ? e.property.false_label : void 0 : e.type === "single_choice" ?
|
|
360
|
+
function he(e, t) {
|
|
361
|
+
return e.type === "boolean" ? t === !0 ? e.property.true_label : t === !1 ? e.property.false_label : void 0 : e.type === "single_choice" ? U(e, t) : e.type === "multiple_choice" ? Array.isArray(t) ? t.map((t) => U(e, t)).filter(Boolean) : [] : e.type === "list" ? Array.isArray(t) ? L(t) : "" : e.type === "number" ? typeof t == "number" ? t : void 0 : t == null ? "" : String(t);
|
|
361
362
|
}
|
|
362
|
-
function
|
|
363
|
-
return t === null ? e.type === "multiple_choice" ? [] : "" : e.type === "multiple_choice" ?
|
|
363
|
+
function W(e, t) {
|
|
364
|
+
return t === null ? e.type === "multiple_choice" ? [] : "" : e.type === "multiple_choice" ? se(t) : t;
|
|
364
365
|
}
|
|
365
|
-
function
|
|
366
|
-
return t == null ? "" : e.type === "boolean" || e.type === "single_choice" ? String(t) : (e.type === "multiple_choice" || e.type === "list") && Array.isArray(t) ?
|
|
366
|
+
function ge(e, t) {
|
|
367
|
+
return t == null ? "" : e.type === "boolean" || e.type === "single_choice" ? String(t) : (e.type === "multiple_choice" || e.type === "list") && Array.isArray(t) ? L(t) : String(t);
|
|
367
368
|
}
|
|
368
369
|
// src/core/excel/parseSheet.ts
|
|
369
|
-
function
|
|
370
|
+
function _e(e) {
|
|
370
371
|
return !Number.isFinite(e) || e < 1 || e >= 2958466 ? null : new Date(Math.round((e - 25569) * 24 * 3600 * 1e3));
|
|
371
372
|
}
|
|
372
|
-
function
|
|
373
|
+
function ve(e, t = !1) {
|
|
373
374
|
let n = String(e.getUTCMonth() + 1).padStart(2, "0"), r = String(e.getUTCDate()).padStart(2, "0"), i = `${e.getUTCFullYear()}-${n}-${r}`;
|
|
374
375
|
if (!t) return i;
|
|
375
376
|
let a = String(e.getUTCHours()).padStart(2, "0"), o = String(e.getUTCMinutes()).padStart(2, "0"), s = e.getUTCSeconds();
|
|
376
377
|
return s === 0 ? `${i} ${a}:${o}` : `${i} ${a}:${o}:${s}`;
|
|
377
378
|
}
|
|
378
|
-
function
|
|
379
|
-
let
|
|
379
|
+
function ye(e) {
|
|
380
|
+
let t = String(e.getUTCHours()).padStart(2, "0"), n = String(e.getUTCMinutes()).padStart(2, "0"), r = e.getUTCSeconds();
|
|
381
|
+
return r === 0 ? `${t}:${n}` : `${t}:${n}:${r}`;
|
|
382
|
+
}
|
|
383
|
+
function be(e, t) {
|
|
384
|
+
let n = (e) => e.trim() === "" ? null : e.trim(), i = t === "datetime", a = t === "time", o = t === "date" || i || a, s = (e) => a ? ye(e) : ve(e, i);
|
|
380
385
|
if (e.type === r.ValueType.Null) return null;
|
|
381
|
-
if (e.type === r.ValueType.Date) return
|
|
386
|
+
if (e.type === r.ValueType.Date) return s(e.value);
|
|
382
387
|
if (e.type === r.ValueType.Formula) {
|
|
383
388
|
if (e.result === null || e.result === void 0) return null;
|
|
384
|
-
if (e.result instanceof Date) return
|
|
385
|
-
if (
|
|
386
|
-
let t =
|
|
387
|
-
if (t) return
|
|
389
|
+
if (e.result instanceof Date) return s(e.result);
|
|
390
|
+
if (o && typeof e.result == "number") {
|
|
391
|
+
let t = _e(e.result);
|
|
392
|
+
if (t) return s(t);
|
|
388
393
|
}
|
|
389
394
|
return n(String(e.result));
|
|
390
395
|
}
|
|
391
396
|
if (e.type === r.ValueType.Number) {
|
|
392
|
-
if (
|
|
393
|
-
let t =
|
|
394
|
-
if (t) return
|
|
397
|
+
if (o && typeof e.value == "number") {
|
|
398
|
+
let t = _e(e.value);
|
|
399
|
+
if (t) return s(t);
|
|
395
400
|
}
|
|
396
401
|
return n(String(e.value));
|
|
397
402
|
}
|
|
398
403
|
return n(e.text);
|
|
399
404
|
}
|
|
400
|
-
function
|
|
405
|
+
function xe(e) {
|
|
401
406
|
let t = e.property.default_value;
|
|
402
407
|
if (t == null) return null;
|
|
403
408
|
if (e.type === "boolean") return t ? e.property.true_label : e.property.false_label;
|
|
404
|
-
if (Array.isArray(t)) return t.length > 0 ?
|
|
409
|
+
if (Array.isArray(t)) return t.length > 0 ? L(t) : null;
|
|
405
410
|
let n = String(t);
|
|
406
411
|
return n.trim() === "" ? null : n;
|
|
407
412
|
}
|
|
408
|
-
function
|
|
413
|
+
function Se(e, t) {
|
|
409
414
|
let n = new Map(t.map((e) => [e.title, e])), r = [];
|
|
410
415
|
for (let t = 1; t <= e.columnCount; t++) {
|
|
411
416
|
let i = e.getRow(1).getCell(t).text.split("\n")[0].trim();
|
|
@@ -413,51 +418,40 @@ function Te(e, t) {
|
|
|
413
418
|
}
|
|
414
419
|
return r;
|
|
415
420
|
}
|
|
416
|
-
function
|
|
417
|
-
let n = [], i = [], a = [], o = 0, s =
|
|
418
|
-
|
|
419
|
-
e.property.required && !
|
|
420
|
-
}), n.length > 0)
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
let d = 0;
|
|
427
|
-
return e.eachRow({ includeEmpty: !1 }, (e, l) => {
|
|
428
|
-
if (l === 1) return;
|
|
429
|
-
let f = {};
|
|
430
|
-
if (c.forEach((t, n) => {
|
|
431
|
-
t && (f[t.key] = Ce(e.getCell(n + 1), t.type));
|
|
432
|
-
}), c.forEach((t, n) => {
|
|
421
|
+
function Ce(e, t) {
|
|
422
|
+
let n = [], i = [], a = [], o = 0, s = Se(e, t), c = s.filter((e) => e !== null).map((e) => e.key), l = new Set(c);
|
|
423
|
+
return t.forEach((e) => {
|
|
424
|
+
e.property.required && !l.has(e.key) && n.push(`缺少列: ${e.title}`);
|
|
425
|
+
}), n.length > 0 || (e.eachRow({ includeEmpty: !1 }, (e, n) => {
|
|
426
|
+
if (n === 1) return;
|
|
427
|
+
let c = {};
|
|
428
|
+
if (s.forEach((t, n) => {
|
|
429
|
+
t && (c[t.key] = be(e.getCell(n + 1), t.type));
|
|
430
|
+
}), s.forEach((t, a) => {
|
|
433
431
|
if (!t) return;
|
|
434
|
-
let
|
|
435
|
-
|
|
436
|
-
}), Object.values(
|
|
437
|
-
|
|
438
|
-
s ||= (n.push(`导入数据超出限制(${H} 条), 请分批导入`), !0);
|
|
439
|
-
return;
|
|
440
|
-
}
|
|
441
|
-
let p = {
|
|
432
|
+
let s = e.getCell(a + 1);
|
|
433
|
+
s.type === r.ValueType.Formula && (s.result === null || s.result === void 0) && (o += 1, i.length < 20 && i.push(`第 ${n} 行 [${t.title}] 是公式且没有保存计算结果, 请用 Excel 打开并保存后再导入`));
|
|
434
|
+
}), Object.values(c).every((e) => e === null)) return;
|
|
435
|
+
let u = {
|
|
442
436
|
key: String(a.length),
|
|
443
|
-
rowNumber:
|
|
437
|
+
rowNumber: n,
|
|
444
438
|
values: {},
|
|
445
439
|
errors: {}
|
|
446
440
|
};
|
|
447
441
|
t.forEach((e) => {
|
|
448
|
-
if (!
|
|
449
|
-
let t =
|
|
450
|
-
t.validateSuccess ?
|
|
451
|
-
}), a.push(
|
|
452
|
-
}), o > i.length && i.push(`还有 ${o - i.length} 个公式单元格没有保存计算结果`), {
|
|
442
|
+
if (!l.has(e.key)) return;
|
|
443
|
+
let t = H(c[e.key] ?? xe(e), e);
|
|
444
|
+
t.validateSuccess ? u.values[e.key] = he(e, t.validateValue ?? null) : (u.values[e.key] = W(e, c[e.key] ?? null), u.errors[e.key] = t.validateMessage);
|
|
445
|
+
}), a.push(u);
|
|
446
|
+
}), o > i.length && i.push(`还有 ${o - i.length} 个公式单元格没有保存计算结果`)), {
|
|
453
447
|
headerMessages: n,
|
|
454
448
|
formulaMessages: i,
|
|
455
449
|
rows: a,
|
|
456
|
-
includedKeys:
|
|
450
|
+
includedKeys: c
|
|
457
451
|
};
|
|
458
452
|
}
|
|
459
453
|
// src/core/excel/worksheet.ts
|
|
460
|
-
function
|
|
454
|
+
function we(t, n) {
|
|
461
455
|
let r = n[t.key];
|
|
462
456
|
if (r == null || r === "") return null;
|
|
463
457
|
switch (t.type) {
|
|
@@ -465,6 +459,12 @@ function De(t, n) {
|
|
|
465
459
|
let t = e(r);
|
|
466
460
|
return t.second() === 0 ? t.format("YYYY-MM-DD HH:mm") : t.format("YYYY-MM-DD HH:mm:ss");
|
|
467
461
|
}
|
|
462
|
+
case "time": {
|
|
463
|
+
let e = /^(\d{1,2}):(\d{2})(?::(\d{2}))?$/.exec(String(r));
|
|
464
|
+
if (!e) return String(r);
|
|
465
|
+
let t = e[1].padStart(2, "0"), n = e[3];
|
|
466
|
+
return n && n !== "00" ? `${t}:${e[2]}:${n}` : `${t}:${e[2]}`;
|
|
467
|
+
}
|
|
468
468
|
case "boolean": return r ? t.property.true_label : t.property.false_label;
|
|
469
469
|
case "single_choice": {
|
|
470
470
|
let e = t.property.option_map;
|
|
@@ -472,21 +472,21 @@ function De(t, n) {
|
|
|
472
472
|
}
|
|
473
473
|
case "multiple_choice": {
|
|
474
474
|
let e = t.property.option_map;
|
|
475
|
-
return
|
|
475
|
+
return L((Array.isArray(r) ? r : [r]).map((t) => Object.keys(e).find((n) => e[n] === t) ?? String(t)));
|
|
476
476
|
}
|
|
477
477
|
case "list": {
|
|
478
478
|
let e = Array.isArray(r) ? r : [r], n = t.property.item_key;
|
|
479
|
-
return
|
|
479
|
+
return L(e.map((e) => String(n && typeof e == "object" && e ? e[n] ?? "" : e)));
|
|
480
480
|
}
|
|
481
481
|
default: return r;
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
|
-
function
|
|
484
|
+
function Te(e, t) {
|
|
485
485
|
t.forEach((t, n) => {
|
|
486
486
|
t.type === "text" && (e.getColumn(n + 1).numFmt = "@");
|
|
487
487
|
});
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function Ee(e, t, n) {
|
|
490
490
|
let r = n.map((e) => e.importable === !1 ? `${e.title}\n(仅导出)` : e.title), i = e.addRow(r);
|
|
491
491
|
i.height = 20 + (Math.max(1, ...r.map((e) => e.split("\n").length)) - 1) * 15, i.eachCell({ includeEmpty: !0 }, (e) => {
|
|
492
492
|
e.font = {
|
|
@@ -502,16 +502,16 @@ function Oe(e, t, n) {
|
|
|
502
502
|
wrapText: !0
|
|
503
503
|
};
|
|
504
504
|
}), t.forEach((t) => {
|
|
505
|
-
e.addRow(n.map((e) =>
|
|
505
|
+
e.addRow(n.map((e) => we(e, t))).eachCell({ includeEmpty: !0 }, (e) => {
|
|
506
506
|
e.alignment = {
|
|
507
507
|
...e.alignment,
|
|
508
508
|
wrapText: !0,
|
|
509
509
|
vertical: "top"
|
|
510
510
|
};
|
|
511
511
|
});
|
|
512
|
-
}),
|
|
512
|
+
}), Te(e, n), ke(e);
|
|
513
513
|
}
|
|
514
|
-
function
|
|
514
|
+
function De(e) {
|
|
515
515
|
let t = [e.property.required ? "必填" : "可选"];
|
|
516
516
|
switch (e.type) {
|
|
517
517
|
case "text":
|
|
@@ -527,7 +527,7 @@ function ke(e) {
|
|
|
527
527
|
t.push("格式 YYYY-MM-DD");
|
|
528
528
|
break;
|
|
529
529
|
case "time":
|
|
530
|
-
t.push("格式 HH:mm");
|
|
530
|
+
t.push("格式 HH:mm, 可带秒");
|
|
531
531
|
break;
|
|
532
532
|
case "datetime":
|
|
533
533
|
t.push("格式 YYYY-MM-DD HH:mm, 可带秒");
|
|
@@ -541,11 +541,11 @@ function ke(e) {
|
|
|
541
541
|
case "multiple_choice": t.push(`可多选, 分号分隔(中英文均可): ${Object.keys(e.property.option_map).join(" / ")}`);
|
|
542
542
|
}
|
|
543
543
|
e.key.endsWith("_name") ? t.push("填对应记录的名称") : e.key.endsWith("_number") && t.push("填对应记录的编号");
|
|
544
|
-
let n =
|
|
544
|
+
let n = we(e, { [e.key]: e.property.default_value });
|
|
545
545
|
return t.push(`默认值: ${n == null || n === "" ? "空" : n}`), t.join("\n");
|
|
546
546
|
}
|
|
547
|
-
function
|
|
548
|
-
let n = t.map((e) => `${e.title}\n\n${
|
|
547
|
+
function Oe(e, t) {
|
|
548
|
+
let n = t.map((e) => `${e.title}\n\n${De(e)}`), r = e.addRow(n);
|
|
549
549
|
r.height = 20 + (Math.max(1, ...n.map((e) => e.split("\n").length)) - 1) * 15, r.eachCell({ includeEmpty: !0 }, (e) => {
|
|
550
550
|
e.font = {
|
|
551
551
|
bold: !0,
|
|
@@ -559,9 +559,9 @@ function Ae(e, t) {
|
|
|
559
559
|
vertical: "top",
|
|
560
560
|
wrapText: !0
|
|
561
561
|
};
|
|
562
|
-
}),
|
|
562
|
+
}), Te(e, t), ke(e);
|
|
563
563
|
}
|
|
564
|
-
function
|
|
564
|
+
function ke(e, t = 20, n = 60) {
|
|
565
565
|
let r = [];
|
|
566
566
|
e.eachRow({ includeEmpty: !1 }, (e) => {
|
|
567
567
|
e.eachCell({ includeEmpty: !1 }, (e, t) => {
|
|
@@ -583,47 +583,47 @@ function je(e, t = 20, n = 60) {
|
|
|
583
583
|
});
|
|
584
584
|
}
|
|
585
585
|
// src/core/excel/runtime.ts
|
|
586
|
-
var
|
|
587
|
-
function
|
|
586
|
+
var Ae = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
587
|
+
function je(e, t) {
|
|
588
588
|
n(e, `${t}.xlsx`);
|
|
589
589
|
}
|
|
590
|
-
var
|
|
591
|
-
function
|
|
592
|
-
return
|
|
593
|
-
throw
|
|
594
|
-
}),
|
|
590
|
+
var Me;
|
|
591
|
+
function Ne() {
|
|
592
|
+
return Me ??= import("exceljs").then((e) => e.default ?? e, (e) => {
|
|
593
|
+
throw Me = void 0, e;
|
|
594
|
+
}), Me;
|
|
595
595
|
}
|
|
596
|
-
function
|
|
596
|
+
function Pe() {
|
|
597
597
|
return new Promise((e) => {
|
|
598
598
|
requestAnimationFrame(() => setTimeout(e, 0));
|
|
599
599
|
});
|
|
600
600
|
}
|
|
601
|
-
function
|
|
601
|
+
function Fe(e) {
|
|
602
602
|
if (e?.aborted) throw new DOMException("任务已取消", "AbortError");
|
|
603
603
|
}
|
|
604
|
-
async function
|
|
605
|
-
let r = await
|
|
606
|
-
|
|
604
|
+
async function Ie(e, t, n) {
|
|
605
|
+
let r = await Ne();
|
|
606
|
+
Fe(n), await Pe();
|
|
607
607
|
let i = new r.Workbook();
|
|
608
|
-
|
|
608
|
+
Ee(i.addWorksheet("Sheet"), e, t);
|
|
609
609
|
let a = await i.xlsx.writeBuffer();
|
|
610
|
-
return
|
|
610
|
+
return Fe(n), new Blob([a], { type: Ae });
|
|
611
611
|
}
|
|
612
|
-
async function
|
|
613
|
-
let r = await
|
|
614
|
-
return
|
|
612
|
+
async function Le(e, t, n) {
|
|
613
|
+
let r = await Ie(e, t);
|
|
614
|
+
return je(r, n), r;
|
|
615
615
|
}
|
|
616
|
-
async function
|
|
617
|
-
let n = await
|
|
618
|
-
await
|
|
616
|
+
async function Re(e, t) {
|
|
617
|
+
let n = await Ne();
|
|
618
|
+
await Pe();
|
|
619
619
|
let r = new n.Workbook();
|
|
620
|
-
|
|
620
|
+
Oe(r.addWorksheet("导入模板"), e);
|
|
621
621
|
let i = await r.xlsx.writeBuffer();
|
|
622
|
-
|
|
622
|
+
je(new Blob([i], { type: Ae }), t);
|
|
623
623
|
}
|
|
624
|
-
async function
|
|
625
|
-
let n = await
|
|
626
|
-
await
|
|
624
|
+
async function ze(e, t) {
|
|
625
|
+
let n = await Ne(), r = await e.arrayBuffer();
|
|
626
|
+
await Pe();
|
|
627
627
|
let i = new n.Workbook();
|
|
628
628
|
if (await i.xlsx.load(r), i.worksheets.length > 1) return {
|
|
629
629
|
headerMessages: ["文件包含多个工作表, 只支持单个工作表, 请删除其他工作表后再导入"],
|
|
@@ -632,7 +632,7 @@ async function Ve(e, t) {
|
|
|
632
632
|
includedKeys: []
|
|
633
633
|
};
|
|
634
634
|
let a = i.worksheets[0];
|
|
635
|
-
return a ?
|
|
635
|
+
return a ? Ce(a, t) : {
|
|
636
636
|
headerMessages: ["文件里没有工作表"],
|
|
637
637
|
formulaMessages: [],
|
|
638
638
|
rows: [],
|
|
@@ -640,23 +640,23 @@ async function Ve(e, t) {
|
|
|
640
640
|
};
|
|
641
641
|
}
|
|
642
642
|
// src/core/excel/exportFile.ts
|
|
643
|
-
function
|
|
643
|
+
function Be(t) {
|
|
644
644
|
return `${t}_${e().format("YYYYMMDDHHmmss")}`;
|
|
645
645
|
}
|
|
646
|
-
async function
|
|
647
|
-
let { title: t, fieldSchemas: n, rows: r
|
|
646
|
+
async function Ve(e) {
|
|
647
|
+
let { title: t, fieldSchemas: n, rows: r } = e;
|
|
648
648
|
if (r.length === 0) throw Error("没有可导出的数据");
|
|
649
|
-
return
|
|
649
|
+
return Le(r, n, Be(t));
|
|
650
650
|
}
|
|
651
651
|
// src/core/task/stats.ts
|
|
652
|
-
function
|
|
652
|
+
function He(e, t) {
|
|
653
653
|
let n = Date.now();
|
|
654
654
|
return [...e, {
|
|
655
655
|
time: n,
|
|
656
656
|
processed: t
|
|
657
657
|
}].filter((e) => n - e.time <= 15e3).slice(-20);
|
|
658
658
|
}
|
|
659
|
-
function
|
|
659
|
+
function Ue(e) {
|
|
660
660
|
if (e.status !== "running" || e.total <= 0) return null;
|
|
661
661
|
let t = Math.max(0, e.total - (e.validationFailedCount ?? 0) - e.processed);
|
|
662
662
|
if (t === 0) return 0;
|
|
@@ -664,149 +664,144 @@ function Ge(e) {
|
|
|
664
664
|
let n = e.samples[0], r = e.samples[e.samples.length - 1], i = (r.time - n.time) / 1e3, a = r.processed - n.processed;
|
|
665
665
|
return i <= 0 || a <= 0 ? null : t / (a / i);
|
|
666
666
|
}
|
|
667
|
-
function
|
|
667
|
+
function We(e) {
|
|
668
668
|
return e.type === "import" ? e.successCount === void 0 ? e.rowStates?.filter((e) => e.status === "completed").length ?? e.processed : e.successCount : e.processed;
|
|
669
669
|
}
|
|
670
|
-
function
|
|
671
|
-
return e.total <= 0 ? 0 : Math.min(100,
|
|
670
|
+
function Ge(e) {
|
|
671
|
+
return e.total <= 0 ? 0 : Math.min(100, We(e) / e.total * 100);
|
|
672
672
|
}
|
|
673
|
-
function
|
|
673
|
+
function Ke(e) {
|
|
674
674
|
if (e.finalizing) return 100;
|
|
675
|
-
let t =
|
|
675
|
+
let t = Ge(e);
|
|
676
676
|
return t >= 100 ? 100 : Math.trunc(t * 10) / 10;
|
|
677
677
|
}
|
|
678
|
-
function
|
|
678
|
+
function qe(e) {
|
|
679
679
|
return `${(Math.trunc(e * 10) / 10).toFixed(1)}%`;
|
|
680
680
|
}
|
|
681
|
-
function
|
|
681
|
+
function Je(e) {
|
|
682
682
|
if (e === null) return "计算中...";
|
|
683
683
|
let t = Math.ceil(e);
|
|
684
684
|
return t < 60 ? `约 ${t} 秒` : `约 ${Math.floor(t / 60)} 分 ${t % 60} 秒`;
|
|
685
685
|
}
|
|
686
686
|
// src/core/task/store.ts
|
|
687
|
-
var
|
|
688
|
-
function
|
|
689
|
-
|
|
687
|
+
var G = { tasks: [] }, Ye = /* @__PURE__ */ new Set(), Xe = /* @__PURE__ */ new Map(), K = /* @__PURE__ */ new Map(), q = /* @__PURE__ */ new Map();
|
|
688
|
+
function Ze() {
|
|
689
|
+
G = { ...G }, Ye.forEach((e) => e());
|
|
690
690
|
}
|
|
691
|
-
function
|
|
692
|
-
return
|
|
693
|
-
|
|
691
|
+
function Qe(e) {
|
|
692
|
+
return Ye.add(e), () => {
|
|
693
|
+
Ye.delete(e);
|
|
694
694
|
};
|
|
695
695
|
}
|
|
696
|
-
function
|
|
697
|
-
return
|
|
696
|
+
function $e(e) {
|
|
697
|
+
return Qe(e);
|
|
698
698
|
}
|
|
699
|
-
function
|
|
700
|
-
return
|
|
699
|
+
function et() {
|
|
700
|
+
return G.tasks;
|
|
701
701
|
}
|
|
702
|
-
function
|
|
702
|
+
function tt() {
|
|
703
703
|
return `task-${Date.now()}-${Math.random().toString(36).slice(2, 10)}`;
|
|
704
704
|
}
|
|
705
|
-
function
|
|
706
|
-
return
|
|
705
|
+
function J(e) {
|
|
706
|
+
return G.tasks.find((t) => t.id === e);
|
|
707
707
|
}
|
|
708
|
-
function
|
|
709
|
-
let n = !1, r =
|
|
708
|
+
function Y(e, t) {
|
|
709
|
+
let n = !1, r = G.tasks.map((r) => r.id === e ? (n = !0, {
|
|
710
710
|
...r,
|
|
711
711
|
...t
|
|
712
712
|
}) : r);
|
|
713
|
-
n && (
|
|
714
|
-
...
|
|
713
|
+
n && (G = {
|
|
714
|
+
...G,
|
|
715
715
|
tasks: r
|
|
716
|
-
},
|
|
716
|
+
}, Ze());
|
|
717
717
|
}
|
|
718
|
-
function
|
|
719
|
-
|
|
720
|
-
...
|
|
721
|
-
tasks: [...
|
|
722
|
-
},
|
|
718
|
+
function nt(e) {
|
|
719
|
+
G = {
|
|
720
|
+
...G,
|
|
721
|
+
tasks: [...G.tasks, e]
|
|
722
|
+
}, Ze();
|
|
723
723
|
}
|
|
724
|
-
function
|
|
725
|
-
|
|
726
|
-
...
|
|
727
|
-
tasks:
|
|
728
|
-
},
|
|
724
|
+
function rt(e) {
|
|
725
|
+
G = {
|
|
726
|
+
...G,
|
|
727
|
+
tasks: G.tasks.filter((t) => t.id !== e)
|
|
728
|
+
}, Ze();
|
|
729
729
|
}
|
|
730
|
-
function
|
|
731
|
-
|
|
730
|
+
function it() {
|
|
731
|
+
q.forEach((e) => e.abort()), q.clear(), Xe.clear(), K.clear(), G = { tasks: [] }, Ze();
|
|
732
732
|
}
|
|
733
733
|
// src/core/task/types.ts
|
|
734
|
-
var
|
|
734
|
+
var at = class extends Error {
|
|
735
735
|
constructor(e) {
|
|
736
736
|
super(e), this.name = "ImportPauseError";
|
|
737
737
|
}
|
|
738
|
-
},
|
|
739
|
-
function
|
|
740
|
-
let r =
|
|
738
|
+
}, ot = 100, st = 20, ct = 200, lt = 100, X = /* @__PURE__ */ new Set(), Z = null;
|
|
739
|
+
function Q(e, t, n) {
|
|
740
|
+
let r = K.get(e);
|
|
741
741
|
r && (r.rowStates[t] = {
|
|
742
742
|
...r.rowStates[t],
|
|
743
743
|
...n
|
|
744
|
-
},
|
|
744
|
+
}, ut(e));
|
|
745
745
|
}
|
|
746
|
-
function
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
let e = [...
|
|
750
|
-
|
|
746
|
+
function ut(e) {
|
|
747
|
+
X.add(e), Z === null && (Z = setTimeout(() => {
|
|
748
|
+
Z = null;
|
|
749
|
+
let e = [...X];
|
|
750
|
+
X.clear(), e.forEach(mt);
|
|
751
751
|
}, lt));
|
|
752
752
|
}
|
|
753
|
-
function
|
|
754
|
-
|
|
753
|
+
function dt(e) {
|
|
754
|
+
X.delete(e);
|
|
755
755
|
}
|
|
756
|
-
function
|
|
757
|
-
|
|
756
|
+
function ft() {
|
|
757
|
+
X.clear(), Z !== null && (clearTimeout(Z), Z = null);
|
|
758
758
|
}
|
|
759
|
-
function
|
|
759
|
+
function pt(e, t) {
|
|
760
760
|
return {
|
|
761
761
|
processed: t.processed,
|
|
762
|
-
total:
|
|
762
|
+
total: ht(t),
|
|
763
763
|
successCount: t.successCount,
|
|
764
764
|
failureCount: t.failures.length,
|
|
765
765
|
validationFailedCount: t.validationFailedCount,
|
|
766
766
|
failures: t.failures,
|
|
767
767
|
rowStates: t.rowStates,
|
|
768
|
-
samples:
|
|
768
|
+
samples: He(J(e)?.samples ?? [], t.processed)
|
|
769
769
|
};
|
|
770
770
|
}
|
|
771
|
+
function mt(e) {
|
|
772
|
+
let t = K.get(e);
|
|
773
|
+
t && J(e) && Y(e, pt(e, t));
|
|
774
|
+
}
|
|
771
775
|
function ht(e) {
|
|
772
|
-
|
|
773
|
-
t && Y(e) && X(e, mt(e, t));
|
|
776
|
+
return e.options.rows.length - e.deletedIndexes.size;
|
|
774
777
|
}
|
|
775
778
|
function gt(e) {
|
|
776
|
-
return e.
|
|
779
|
+
return `成功 ${e.successCount} 条, 失败 ${e.failures.length} 条, 可修正失败行后继续`;
|
|
777
780
|
}
|
|
778
781
|
function _t(e) {
|
|
779
|
-
|
|
782
|
+
if (e === void 0) return st;
|
|
783
|
+
let t = Math.floor(e);
|
|
784
|
+
return !Number.isFinite(t) || t < 1 ? st : Math.min(t, ct);
|
|
780
785
|
}
|
|
781
786
|
async function vt(e, t, n) {
|
|
782
787
|
let r = t.options.rows.length;
|
|
783
788
|
if (t.controller = n, t.pauseRequested = !1, t.cancelRequested = !1, t.runFailureCount = 0, r === 0) {
|
|
784
|
-
|
|
789
|
+
Y(e, {
|
|
785
790
|
status: "failed",
|
|
786
791
|
pausing: !1,
|
|
787
792
|
errorMessage: "没有可导入的数据"
|
|
788
793
|
}), t.options.onFinished?.();
|
|
789
794
|
return;
|
|
790
795
|
}
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
} catch (n) {
|
|
794
|
-
X(e, {
|
|
795
|
-
status: "failed",
|
|
796
|
-
pausing: !1,
|
|
797
|
-
errorMessage: n instanceof Error ? n.message : "导入数据超出上限"
|
|
798
|
-
}), t.options.onFinished?.();
|
|
799
|
-
return;
|
|
800
|
-
}
|
|
801
|
-
X(e, {
|
|
802
|
-
...mt(e, t),
|
|
796
|
+
Y(e, {
|
|
797
|
+
...pt(e, t),
|
|
803
798
|
status: "running",
|
|
804
799
|
samples: [{
|
|
805
800
|
time: Date.now(),
|
|
806
801
|
processed: t.processed
|
|
807
802
|
}]
|
|
808
803
|
});
|
|
809
|
-
let i =
|
|
804
|
+
let i = _t(t.options.batchSize), a = Math.min(Math.max(t.options.concurrency ?? 3, 1), 5), o = () => {
|
|
810
805
|
let e = [];
|
|
811
806
|
for (; e.length < i;) {
|
|
812
807
|
let n = t.nextIndex;
|
|
@@ -820,19 +815,19 @@ async function vt(e, t, n) {
|
|
|
820
815
|
let r = o();
|
|
821
816
|
if (r.length === 0) return;
|
|
822
817
|
r.forEach((t) => {
|
|
823
|
-
|
|
818
|
+
Q(e, t, {
|
|
824
819
|
status: "running",
|
|
825
820
|
message: void 0,
|
|
826
821
|
fieldErrors: void 0
|
|
827
822
|
});
|
|
828
823
|
});
|
|
829
824
|
try {
|
|
830
|
-
let i = r.map((e) => t.options.rows[e]), a = await t.options.importRows(i
|
|
825
|
+
let i = r.map((e) => t.options.rows[e]), a = await t.options.importRows(i);
|
|
831
826
|
if (n.signal.aborted) return;
|
|
832
|
-
if (a.length !== r.length) throw new
|
|
827
|
+
if (a.length !== r.length) throw new at("导入接口返回结果数量不正确, 任务已暂停");
|
|
833
828
|
a.forEach((n, i) => {
|
|
834
829
|
let a = r[i], o = t.options.rows[a];
|
|
835
|
-
n.success ? (t.successCount += 1,
|
|
830
|
+
n.success ? (t.successCount += 1, Q(e, a, {
|
|
836
831
|
status: "completed",
|
|
837
832
|
fieldErrors: void 0
|
|
838
833
|
})) : (t.failures.push({
|
|
@@ -840,31 +835,31 @@ async function vt(e, t, n) {
|
|
|
840
835
|
rowNumber: o.rowNumber,
|
|
841
836
|
message: n.message ?? "导入失败",
|
|
842
837
|
fieldErrors: n.fieldErrors
|
|
843
|
-
}),
|
|
838
|
+
}), Q(e, a, {
|
|
844
839
|
status: "failed",
|
|
845
840
|
message: n.message,
|
|
846
841
|
fieldErrors: n.fieldErrors
|
|
847
|
-
}), t.runFailureCount += 1, t.runFailureCount >
|
|
842
|
+
}), t.runFailureCount += 1, t.runFailureCount > ot && (t.pauseRequested = !0));
|
|
848
843
|
});
|
|
849
844
|
} catch (i) {
|
|
850
845
|
if (n.signal.aborted) return;
|
|
851
|
-
let a = i instanceof
|
|
846
|
+
let a = i instanceof at, o = `${i instanceof Error ? i.message : "导入失败"}(该批结果未知,重试可能重复)`;
|
|
852
847
|
r.forEach((n) => {
|
|
853
848
|
t.failures.push({
|
|
854
849
|
index: n,
|
|
855
850
|
rowNumber: t.options.rows[n].rowNumber,
|
|
856
851
|
message: o
|
|
857
|
-
}),
|
|
852
|
+
}), Q(e, n, {
|
|
858
853
|
status: "failed",
|
|
859
854
|
message: o
|
|
860
855
|
}), t.runFailureCount += 1;
|
|
861
|
-
}), a ? (t.pauseRequested = !0, n.abort()) : t.runFailureCount >
|
|
856
|
+
}), a ? (t.pauseRequested = !0, n.abort()) : t.runFailureCount > ot && (t.pauseRequested = !0);
|
|
862
857
|
} finally {
|
|
863
|
-
t.processed += r.length,
|
|
858
|
+
t.processed += r.length, ut(e);
|
|
864
859
|
}
|
|
865
860
|
}
|
|
866
861
|
}, c = Math.min(a, Math.max(1, r));
|
|
867
|
-
await Promise.all(Array.from({ length: c }, () => s())), t.controller = null,
|
|
862
|
+
await Promise.all(Array.from({ length: c }, () => s())), t.controller = null, J(e) && St(e, t, n);
|
|
868
863
|
}
|
|
869
864
|
function yt(e) {
|
|
870
865
|
e.rowStates = e.rowStates.map((e) => e.status === "queued" || e.status === "running" ? { status: "canceled" } : e);
|
|
@@ -879,14 +874,14 @@ function xt(e) {
|
|
|
879
874
|
return e.failures.length > 0 ? `累计失败 ${e.failures.length} 条, 任务已暂停, 可继续导入` : void 0;
|
|
880
875
|
}
|
|
881
876
|
function $(e, t, n) {
|
|
882
|
-
|
|
883
|
-
...
|
|
877
|
+
Y(e, {
|
|
878
|
+
...pt(e, t),
|
|
884
879
|
pausing: !1,
|
|
885
880
|
...n
|
|
886
|
-
}), t.options.onFinished?.();
|
|
881
|
+
}), n.status !== "paused" && t.options.onFinished?.();
|
|
887
882
|
}
|
|
888
883
|
function St(e, t, n) {
|
|
889
|
-
if (
|
|
884
|
+
if (dt(e), t.cancelRequested) {
|
|
890
885
|
yt(t), $(e, t, {
|
|
891
886
|
status: "canceled",
|
|
892
887
|
canceling: !1
|
|
@@ -917,7 +912,7 @@ function St(e, t, n) {
|
|
|
917
912
|
if (t.failures.length > 0) {
|
|
918
913
|
$(e, t, {
|
|
919
914
|
status: "paused",
|
|
920
|
-
errorMessage:
|
|
915
|
+
errorMessage: gt(t)
|
|
921
916
|
});
|
|
922
917
|
return;
|
|
923
918
|
}
|
|
@@ -929,12 +924,12 @@ function St(e, t, n) {
|
|
|
929
924
|
}
|
|
930
925
|
function Ct(e, t) {
|
|
931
926
|
let n = new AbortController();
|
|
932
|
-
|
|
933
|
-
|
|
927
|
+
q.set(e, n), vt(e, t, n).finally(() => {
|
|
928
|
+
q.delete(e), X.delete(e), J(e)?.status !== "paused" && K.delete(e);
|
|
934
929
|
});
|
|
935
930
|
}
|
|
936
931
|
function wt(e) {
|
|
937
|
-
let t =
|
|
932
|
+
let t = tt(), n = e.rows.map((e) => ({
|
|
938
933
|
status: "queued",
|
|
939
934
|
validationErrors: Object.keys(e.errors).length > 0 ? e.errors : void 0
|
|
940
935
|
})), r = new Set(e.rows.flatMap((e, t) => Object.keys(e.errors).length > 0 ? [t] : [])), i = r.size, a = {
|
|
@@ -966,18 +961,18 @@ function wt(e) {
|
|
|
966
961
|
runFailureCount: 0,
|
|
967
962
|
controller: null
|
|
968
963
|
};
|
|
969
|
-
return
|
|
964
|
+
return K.set(t, o), nt(a), Ct(t, o), t;
|
|
970
965
|
}
|
|
971
966
|
function Tt(e) {
|
|
972
|
-
let t =
|
|
967
|
+
let t = J(e);
|
|
973
968
|
if (!t || t.type !== "import" || t.status !== "paused") return;
|
|
974
|
-
let n =
|
|
969
|
+
let n = K.get(e);
|
|
975
970
|
if (!n) return;
|
|
976
971
|
let r = n.rowStates.filter((e) => e.status === "completed").length, i = n.rowStates.map((e) => e.status === "completed" || e.status === "deleted" ? e : {
|
|
977
972
|
status: "queued",
|
|
978
973
|
validationErrors: e.validationErrors
|
|
979
974
|
}), a = i.filter((e) => e.validationErrors && Object.keys(e.validationErrors).length > 0).length;
|
|
980
|
-
n.rowStates = i, n.validationFailedCount = a, n.nextIndex = 0, n.processed = r, n.successCount = r, n.failures = [], n.pauseRequested = !1, n.cancelRequested = !1, n.runFailureCount = 0,
|
|
975
|
+
n.rowStates = i, n.validationFailedCount = a, n.nextIndex = 0, n.processed = r, n.successCount = r, n.failures = [], n.pauseRequested = !1, n.cancelRequested = !1, n.runFailureCount = 0, Y(e, {
|
|
981
976
|
status: "running",
|
|
982
977
|
pausing: !1,
|
|
983
978
|
canceling: !1,
|
|
@@ -991,19 +986,19 @@ function Tt(e) {
|
|
|
991
986
|
}), Ct(e, n);
|
|
992
987
|
}
|
|
993
988
|
function Et(e) {
|
|
994
|
-
let t =
|
|
989
|
+
let t = J(e);
|
|
995
990
|
if (!t || t.type !== "import" || t.status !== "running" || t.canceling) return;
|
|
996
|
-
let n =
|
|
997
|
-
n && (n.pauseRequested = !0,
|
|
991
|
+
let n = K.get(e);
|
|
992
|
+
n && (n.pauseRequested = !0, Y(e, { pausing: !0 }));
|
|
998
993
|
}
|
|
999
994
|
function Dt(e, t, n) {
|
|
1000
|
-
let r =
|
|
995
|
+
let r = J(e), i = K.get(e);
|
|
1001
996
|
if (!r || r.type !== "import" || r.status !== "paused" && r.status !== "failed" || !i) return;
|
|
1002
997
|
let a = r.rowStates?.[t]?.status;
|
|
1003
998
|
(a === "queued" || a === "failed") && (i.options.rows[t] = n);
|
|
1004
999
|
}
|
|
1005
1000
|
function Ot(e, t, n) {
|
|
1006
|
-
let r =
|
|
1001
|
+
let r = J(e), i = K.get(e);
|
|
1007
1002
|
if (!r || r.type !== "import" || !i || r.status !== "paused" && r.status !== "failed") return;
|
|
1008
1003
|
let a = Object.keys(n).length > 0, o = i.rowStates[t]?.validationErrors, s = !!(o && Object.keys(o).length > 0);
|
|
1009
1004
|
a ? (i.skippedIndexes.add(t), s || (i.validationFailedCount += 1)) : (i.skippedIndexes.delete(t), s && --i.validationFailedCount), i.rowStates[t] = {
|
|
@@ -1012,30 +1007,30 @@ function Ot(e, t, n) {
|
|
|
1012
1007
|
}, i.options.rows[t] = {
|
|
1013
1008
|
...i.options.rows[t],
|
|
1014
1009
|
errors: n
|
|
1015
|
-
},
|
|
1010
|
+
}, Y(e, {
|
|
1016
1011
|
validationFailedCount: i.validationFailedCount,
|
|
1017
1012
|
rowStates: i.rowStates
|
|
1018
1013
|
});
|
|
1019
1014
|
}
|
|
1020
1015
|
function kt(e, t) {
|
|
1021
|
-
let n =
|
|
1016
|
+
let n = J(e), r = K.get(e);
|
|
1022
1017
|
n && n.type === "import" && n.status === "paused" && r && (t.forEach((e) => {
|
|
1023
1018
|
let t = r.rowStates[e];
|
|
1024
1019
|
t?.status === "queued" && (t.validationErrors && Object.keys(t.validationErrors).length > 0 && --r.validationFailedCount, r.deletedIndexes.add(e), r.rowStates[e] = {
|
|
1025
1020
|
status: "deleted",
|
|
1026
1021
|
fieldErrors: void 0
|
|
1027
1022
|
});
|
|
1028
|
-
}),
|
|
1029
|
-
total:
|
|
1023
|
+
}), Y(e, {
|
|
1024
|
+
total: ht(r),
|
|
1030
1025
|
validationFailedCount: r.validationFailedCount,
|
|
1031
1026
|
rowStates: r.rowStates
|
|
1032
1027
|
}));
|
|
1033
1028
|
}
|
|
1034
1029
|
function At(e, t, n) {
|
|
1035
|
-
let r =
|
|
1030
|
+
let r = J(e)?.rowStates?.[t];
|
|
1036
1031
|
if (!r?.fieldErrors?.some((e) => n in e)) return;
|
|
1037
1032
|
let i = r.fieldErrors.filter((e) => !(n in e));
|
|
1038
|
-
|
|
1033
|
+
Q(e, t, {
|
|
1039
1034
|
...r,
|
|
1040
1035
|
fieldErrors: i.length > 0 ? i : void 0
|
|
1041
1036
|
});
|
|
@@ -1079,27 +1074,24 @@ function Lt(e) {
|
|
|
1079
1074
|
async function Rt(e, t, n) {
|
|
1080
1075
|
let { options: r } = t;
|
|
1081
1076
|
t.controller = n, t.cancelRequested = !1;
|
|
1082
|
-
let i = r.maxRows ?? 2e4;
|
|
1083
1077
|
try {
|
|
1084
1078
|
for (; !t.cancelRequested;) {
|
|
1085
|
-
let
|
|
1086
|
-
r.batchSize !== void 0 && (a.page_size = Math.min(Math.max(Math.floor(r.batchSize), 1), 1e3));
|
|
1087
|
-
let o = await r.exportRows(a, n.signal);
|
|
1079
|
+
let i = t.cursorId === void 0 ? {} : { cursor_id: t.cursorId }, a = await r.exportRows(i);
|
|
1088
1080
|
if (n.signal.aborted) throw new DOMException("任务已取消", "AbortError");
|
|
1089
|
-
if (t.total =
|
|
1090
|
-
t.rows = t.rows.concat(
|
|
1091
|
-
let
|
|
1092
|
-
|
|
1081
|
+
if (t.total = a.count, a.results.length === 0) break;
|
|
1082
|
+
t.rows = t.rows.concat(a.results);
|
|
1083
|
+
let o = t.rows.length;
|
|
1084
|
+
Y(e, {
|
|
1093
1085
|
total: t.total,
|
|
1094
|
-
processed:
|
|
1095
|
-
samples:
|
|
1086
|
+
processed: o,
|
|
1087
|
+
samples: He(J(e)?.samples ?? [], o)
|
|
1096
1088
|
});
|
|
1097
|
-
let
|
|
1098
|
-
if (typeof
|
|
1099
|
-
t.cursorId =
|
|
1089
|
+
let s = a.results[a.results.length - 1]?.id;
|
|
1090
|
+
if (typeof s != "number") throw Error("导出数据缺少 id");
|
|
1091
|
+
t.cursorId = s;
|
|
1100
1092
|
}
|
|
1101
1093
|
if (t.cancelRequested) {
|
|
1102
|
-
|
|
1094
|
+
Y(e, {
|
|
1103
1095
|
status: "canceled",
|
|
1104
1096
|
pausing: !1,
|
|
1105
1097
|
canceling: !1,
|
|
@@ -1108,26 +1100,26 @@ async function Rt(e, t, n) {
|
|
|
1108
1100
|
return;
|
|
1109
1101
|
}
|
|
1110
1102
|
if (t.rows.length === 0) throw Error("没有可导出的数据");
|
|
1111
|
-
|
|
1112
|
-
let
|
|
1103
|
+
Y(e, { finalizing: !0 }), await Lt(It);
|
|
1104
|
+
let i = await Ie(t.rows, r.fieldSchemas, n.signal);
|
|
1113
1105
|
if (n.signal.aborted) throw new DOMException("任务已取消", "AbortError");
|
|
1114
1106
|
try {
|
|
1115
|
-
|
|
1107
|
+
je(i, r.fileName);
|
|
1116
1108
|
} catch (e) {
|
|
1117
1109
|
console.error(`自动下载失败: ${e}`);
|
|
1118
1110
|
}
|
|
1119
|
-
|
|
1111
|
+
Y(e, {
|
|
1120
1112
|
status: "completed",
|
|
1121
1113
|
pausing: !1,
|
|
1122
1114
|
finalizing: !1,
|
|
1123
1115
|
canceling: !1,
|
|
1124
1116
|
total: t.rows.length,
|
|
1125
1117
|
processed: t.rows.length,
|
|
1126
|
-
blob:
|
|
1118
|
+
blob: i
|
|
1127
1119
|
});
|
|
1128
1120
|
} catch (t) {
|
|
1129
1121
|
if (n.signal.aborted) {
|
|
1130
|
-
|
|
1122
|
+
Y(e, {
|
|
1131
1123
|
status: "canceled",
|
|
1132
1124
|
pausing: !1,
|
|
1133
1125
|
finalizing: !1,
|
|
@@ -1135,7 +1127,7 @@ async function Rt(e, t, n) {
|
|
|
1135
1127
|
});
|
|
1136
1128
|
return;
|
|
1137
1129
|
}
|
|
1138
|
-
|
|
1130
|
+
Y(e, {
|
|
1139
1131
|
status: "failed",
|
|
1140
1132
|
pausing: !1,
|
|
1141
1133
|
finalizing: !1,
|
|
@@ -1151,12 +1143,12 @@ function zt(e) {
|
|
|
1151
1143
|
}
|
|
1152
1144
|
function Bt(e, t) {
|
|
1153
1145
|
let n = new AbortController();
|
|
1154
|
-
|
|
1155
|
-
|
|
1146
|
+
q.set(e, n), Rt(e, t, n).finally(() => {
|
|
1147
|
+
q.delete(e), Xe.delete(e);
|
|
1156
1148
|
});
|
|
1157
1149
|
}
|
|
1158
1150
|
function Vt(e) {
|
|
1159
|
-
let t =
|
|
1151
|
+
let t = tt(), n = {
|
|
1160
1152
|
id: t,
|
|
1161
1153
|
type: "export",
|
|
1162
1154
|
title: e.title,
|
|
@@ -1172,55 +1164,57 @@ function Vt(e) {
|
|
|
1172
1164
|
cancelRequested: !1,
|
|
1173
1165
|
controller: null
|
|
1174
1166
|
};
|
|
1175
|
-
return
|
|
1167
|
+
return Xe.set(t, r), nt(n), Bt(t, r), t;
|
|
1176
1168
|
}
|
|
1177
1169
|
function Ht(e, t) {
|
|
1178
1170
|
try {
|
|
1179
|
-
return
|
|
1171
|
+
return je(e, t), !0;
|
|
1180
1172
|
} catch (e) {
|
|
1181
1173
|
return console.error(`下载失败: ${e}`), !1;
|
|
1182
1174
|
}
|
|
1183
1175
|
}
|
|
1184
1176
|
function Ut(e) {
|
|
1185
|
-
let t =
|
|
1177
|
+
let t = J(e);
|
|
1186
1178
|
return t?.type !== "export" || !t.blob || !t.fileName ? !1 : Ht(t.blob, t.fileName);
|
|
1187
1179
|
}
|
|
1188
1180
|
// src/core/task/index.ts
|
|
1189
1181
|
function Wt(e) {
|
|
1190
|
-
let t =
|
|
1182
|
+
let t = J(e);
|
|
1191
1183
|
if (!t) return;
|
|
1192
1184
|
if (t.status === "paused") {
|
|
1193
|
-
|
|
1185
|
+
Y(e, {
|
|
1194
1186
|
status: "canceled",
|
|
1195
1187
|
pausing: !1,
|
|
1196
1188
|
canceling: !1,
|
|
1197
1189
|
rowStates: (t.rowStates ?? []).map((e) => e.status === "queued" || e.status === "running" ? { status: "canceled" } : e)
|
|
1198
|
-
})
|
|
1190
|
+
});
|
|
1191
|
+
let n = K.get(e);
|
|
1192
|
+
K.delete(e), dt(e), n?.options.onFinished?.();
|
|
1199
1193
|
return;
|
|
1200
1194
|
}
|
|
1201
1195
|
if (t.status !== "running") return;
|
|
1202
1196
|
if (t.type === "export") {
|
|
1203
1197
|
if (t.canceling || t.finalizing) return;
|
|
1204
|
-
let n =
|
|
1198
|
+
let n = Xe.get(e);
|
|
1205
1199
|
if (!n) return;
|
|
1206
|
-
n.cancelRequested = !0, n.controller?.abort(),
|
|
1200
|
+
n.cancelRequested = !0, n.controller?.abort(), Y(e, { canceling: !0 });
|
|
1207
1201
|
return;
|
|
1208
1202
|
}
|
|
1209
1203
|
if (t.canceling) return;
|
|
1210
|
-
let n =
|
|
1211
|
-
n && (n.cancelRequested = !0,
|
|
1204
|
+
let n = K.get(e);
|
|
1205
|
+
n && (n.cancelRequested = !0, Y(e, { canceling: !0 }));
|
|
1212
1206
|
}
|
|
1213
1207
|
function Gt(e) {
|
|
1214
|
-
let t =
|
|
1215
|
-
t && (t.status === "running" &&
|
|
1208
|
+
let t = J(e);
|
|
1209
|
+
t && (t.status === "running" && q.get(e)?.abort(), Xe.delete(e), K.delete(e), dt(e), rt(e));
|
|
1216
1210
|
}
|
|
1217
1211
|
function Kt() {
|
|
1218
|
-
|
|
1212
|
+
ft(), it();
|
|
1219
1213
|
}
|
|
1220
1214
|
// src/react/useTaskDetail.ts
|
|
1221
1215
|
function qt(e) {
|
|
1222
|
-
let t = C(() => e ?
|
|
1223
|
-
return O(
|
|
1216
|
+
let t = C(() => e ? et().find((t) => t.id === e) : void 0, [e]);
|
|
1217
|
+
return O($e, t);
|
|
1224
1218
|
}
|
|
1225
1219
|
// src/components/ExportTaskModal.tsx
|
|
1226
1220
|
function Jt(e) {
|
|
@@ -1248,7 +1242,7 @@ function Xt(e) {
|
|
|
1248
1242
|
var Zt = ({ taskId: e, onClose: t }) => {
|
|
1249
1243
|
let n = qt(e), { message: r } = c.useApp();
|
|
1250
1244
|
if (!n) return null;
|
|
1251
|
-
let i = n.status === "completed" || n.status === "failed" || n.status === "canceled", a =
|
|
1245
|
+
let i = n.status === "completed" || n.status === "failed" || n.status === "canceled", a = Ke(n), o = () => {
|
|
1252
1246
|
Gt(n.id), t();
|
|
1253
1247
|
}, s = () => {
|
|
1254
1248
|
Ut(n.id) || r.error("文件不存在");
|
|
@@ -1295,7 +1289,7 @@ var Zt = ({ taskId: e, onClose: t }) => {
|
|
|
1295
1289
|
type: "secondary",
|
|
1296
1290
|
children: [
|
|
1297
1291
|
"已导出 ",
|
|
1298
|
-
|
|
1292
|
+
We(n).toLocaleString(),
|
|
1299
1293
|
" / 总数 ",
|
|
1300
1294
|
n.total > 0 ? n.total.toLocaleString() : "--"
|
|
1301
1295
|
]
|
|
@@ -1306,7 +1300,7 @@ var Zt = ({ taskId: e, onClose: t }) => {
|
|
|
1306
1300
|
}),
|
|
1307
1301
|
/* @__PURE__ */ k(h, {
|
|
1308
1302
|
percent: a,
|
|
1309
|
-
format: () =>
|
|
1303
|
+
format: () => qe(a),
|
|
1310
1304
|
status: Xt(n),
|
|
1311
1305
|
size: "small"
|
|
1312
1306
|
}),
|
|
@@ -1328,36 +1322,36 @@ function Qt() {
|
|
|
1328
1322
|
}, []), [e, t];
|
|
1329
1323
|
}
|
|
1330
1324
|
// src/components/ExportButton.tsx
|
|
1331
|
-
var $t = ({ title: e, fieldSchemas: t, buttonText: n = "导出",
|
|
1332
|
-
let { message:
|
|
1325
|
+
var $t = ({ title: e, fieldSchemas: t, buttonText: n = "导出", disabled: r, exportRows: i, beforeExport: o, afterExport: s, onModalClose: u }) => {
|
|
1326
|
+
let { message: d } = c.useApp(), [f, p] = Qt();
|
|
1333
1327
|
return /* @__PURE__ */ A(ee, { children: [/* @__PURE__ */ k(b, {
|
|
1334
1328
|
title: "导出 Excel",
|
|
1335
1329
|
children: /* @__PURE__ */ k(l, {
|
|
1336
1330
|
type: "default",
|
|
1337
1331
|
icon: /* @__PURE__ */ k(a, {}),
|
|
1338
|
-
disabled:
|
|
1332
|
+
disabled: r,
|
|
1339
1333
|
onClick: async () => {
|
|
1340
1334
|
try {
|
|
1341
|
-
await
|
|
1335
|
+
await o?.();
|
|
1342
1336
|
} catch (e) {
|
|
1343
|
-
|
|
1337
|
+
d.error(e instanceof Error ? e.message : "导出已取消");
|
|
1344
1338
|
return;
|
|
1345
1339
|
}
|
|
1346
|
-
|
|
1340
|
+
p(Vt({
|
|
1347
1341
|
title: `${e}导出`,
|
|
1348
|
-
fileName:
|
|
1342
|
+
fileName: Be(e),
|
|
1349
1343
|
fieldSchemas: t,
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
exportRows: s,
|
|
1353
|
-
onFinished: d
|
|
1344
|
+
exportRows: i,
|
|
1345
|
+
onFinished: s
|
|
1354
1346
|
}));
|
|
1355
1347
|
},
|
|
1356
1348
|
children: n
|
|
1357
1349
|
})
|
|
1358
|
-
}),
|
|
1359
|
-
taskId:
|
|
1360
|
-
onClose: () =>
|
|
1350
|
+
}), f ? /* @__PURE__ */ k(Zt, {
|
|
1351
|
+
taskId: f,
|
|
1352
|
+
onClose: () => {
|
|
1353
|
+
p(void 0), u?.();
|
|
1354
|
+
}
|
|
1361
1355
|
}) : null] });
|
|
1362
1356
|
}, { Text: en } = x, tn = ({ missingTitles: e, headerMessages: t }) => /* @__PURE__ */ A(u, {
|
|
1363
1357
|
vertical: !0,
|
|
@@ -1366,7 +1360,7 @@ var $t = ({ title: e, fieldSchemas: t, buttonText: n = "导出", maxRows: r = U,
|
|
|
1366
1360
|
});
|
|
1367
1361
|
// src/components/EditableImportCell.tsx
|
|
1368
1362
|
function nn(e) {
|
|
1369
|
-
return e == null || e === "" ? "" : Array.isArray(e) ?
|
|
1363
|
+
return e == null || e === "" ? "" : Array.isArray(e) ? L(e) : String(e);
|
|
1370
1364
|
}
|
|
1371
1365
|
var rn = ({ field: e, record: t, disabled: n, onChange: r, onSave: i }) => {
|
|
1372
1366
|
let { token: a } = S.useToken(), [o, s] = D(!1), [c, l] = D(!1), u = t.values[e.key];
|
|
@@ -1506,7 +1500,7 @@ function an(e) {
|
|
|
1506
1500
|
function on(e, t) {
|
|
1507
1501
|
if (e.canceling) return "正在取消...";
|
|
1508
1502
|
switch (e.status) {
|
|
1509
|
-
case "running": return `预计剩余 ${
|
|
1503
|
+
case "running": return `预计剩余 ${Je(t)}`;
|
|
1510
1504
|
default: return null;
|
|
1511
1505
|
}
|
|
1512
1506
|
}
|
|
@@ -1590,14 +1584,14 @@ var mn = ({ open: e, title: t, fieldSchemas: n, rows: r, taskId: a, includedKeys
|
|
|
1590
1584
|
w(() => {
|
|
1591
1585
|
P && (re.current = P);
|
|
1592
1586
|
}, [P]);
|
|
1593
|
-
let ie = T(() => new Set(o), [o]),
|
|
1587
|
+
let ie = T(() => new Set(o), [o]), F = n.filter((e) => ie.has(e.key)), ae = re.current, I = P ?? (ae?.id === a ? ae : void 0), oe = I ? an(I) : void 0, L = !!(I && I.status !== "completed" && I.status !== "failed" && I.status !== "canceled"), se = pn(I?.status === "running" ? Ue(I) : null, 1e3), ce = I ? on(I, se) : null, R = (e) => e.taskIndex === void 0 ? void 0 : I?.rowStates?.[e.taskIndex], le = !(!P || P.status !== "failed" && P.status !== "paused"), ue = (e) => {
|
|
1594
1588
|
if (!a) return !0;
|
|
1595
|
-
let t =
|
|
1596
|
-
return
|
|
1597
|
-
},
|
|
1589
|
+
let t = R(e)?.status;
|
|
1590
|
+
return le && (t === "queued" || t === "failed") ? !0 : le && e.taskIndex === void 0 && Object.keys(e.errors).length > 0;
|
|
1591
|
+
}, de = (e) => !a || P?.status === "paused" && R(e)?.status === "queued", fe = T(() => ["valid", "invalid"].map((e) => ({
|
|
1598
1592
|
value: e,
|
|
1599
1593
|
label: cn[e].label
|
|
1600
|
-
})), []),
|
|
1594
|
+
})), []), pe = T(() => [
|
|
1601
1595
|
"pending",
|
|
1602
1596
|
"running",
|
|
1603
1597
|
"completed",
|
|
@@ -1606,21 +1600,21 @@ var mn = ({ open: e, title: t, fieldSchemas: n, rows: r, taskId: a, includedKeys
|
|
|
1606
1600
|
].map((e) => ({
|
|
1607
1601
|
value: e,
|
|
1608
1602
|
label: ln[e].label
|
|
1609
|
-
})), []),
|
|
1610
|
-
if (!
|
|
1611
|
-
let e =
|
|
1612
|
-
return r.filter((t) =>
|
|
1603
|
+
})), []), z = I?.status === "running", B = z ? "" : N, V = !z && S !== "all" && fe.some((e) => e.value === S) ? S : "all", H = !z && O !== "all" && pe.some((e) => e.value === O) ? O : "all", me = V !== "all" || B.trim() !== "", U = H !== "all", he = me || U, W = T(() => {
|
|
1604
|
+
if (!me) return r;
|
|
1605
|
+
let e = B.trim().toLowerCase();
|
|
1606
|
+
return r.filter((t) => V !== "all" && un(t) !== V ? !1 : !e || Object.values(t.values).some((t) => (Array.isArray(t) ? t.join(" ") : String(t ?? "")).toLowerCase().includes(e)));
|
|
1613
1607
|
}, [
|
|
1614
1608
|
r,
|
|
1609
|
+
V,
|
|
1615
1610
|
B,
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
]), ge = pn(F, 300), _e = U ? ge : void 0, ve = T(() => U ? W.filter((e) => dn(e, a, _e) === V) : a && F ? W.slice() : W, [
|
|
1611
|
+
me
|
|
1612
|
+
]), ge = pn(I, 300), _e = U ? ge : void 0, ve = T(() => U ? W.filter((e) => dn(e, a, _e) === H) : a && I ? W.slice() : W, [
|
|
1619
1613
|
W,
|
|
1620
|
-
|
|
1614
|
+
H,
|
|
1621
1615
|
U,
|
|
1622
1616
|
_e,
|
|
1623
|
-
|
|
1617
|
+
I,
|
|
1624
1618
|
a
|
|
1625
1619
|
]), ye = (e) => {
|
|
1626
1620
|
let t = Object.entries(e.errors);
|
|
@@ -1656,7 +1650,7 @@ var mn = ({ open: e, title: t, fieldSchemas: n, rows: r, taskId: a, includedKeys
|
|
|
1656
1650
|
children: n.label
|
|
1657
1651
|
});
|
|
1658
1652
|
}, xe = (e) => {
|
|
1659
|
-
let t =
|
|
1653
|
+
let t = R(e), r = t?.fieldErrors ?? [], i = t?.message;
|
|
1660
1654
|
if (r.length === 0) return /* @__PURE__ */ k(x.Text, { children: i ?? "导入失败" });
|
|
1661
1655
|
let a = /* @__PURE__ */ new Map();
|
|
1662
1656
|
r.forEach((e) => {
|
|
@@ -1689,9 +1683,9 @@ var mn = ({ open: e, title: t, fieldSchemas: n, rows: r, taskId: a, includedKeys
|
|
|
1689
1683
|
]
|
|
1690
1684
|
});
|
|
1691
1685
|
}, Se = (e) => {
|
|
1692
|
-
let t = dn(e, a,
|
|
1686
|
+
let t = dn(e, a, I), n = ln[t];
|
|
1693
1687
|
if (t === "failed") {
|
|
1694
|
-
let t =
|
|
1688
|
+
let t = R(e), r = (t?.fieldErrors?.length ?? 0) + +!!t?.message, i = r > 0 ? `导入失败(${r})` : n.label;
|
|
1695
1689
|
return /* @__PURE__ */ k(m, {
|
|
1696
1690
|
trigger: "hover",
|
|
1697
1691
|
placement: "topRight",
|
|
@@ -1711,7 +1705,7 @@ var mn = ({ open: e, title: t, fieldSchemas: n, rows: r, taskId: a, includedKeys
|
|
|
1711
1705
|
type: "primary",
|
|
1712
1706
|
danger: !0,
|
|
1713
1707
|
size: "small",
|
|
1714
|
-
disabled: !
|
|
1708
|
+
disabled: !de(e),
|
|
1715
1709
|
icon: /* @__PURE__ */ k(i, {}),
|
|
1716
1710
|
onClick: () => {
|
|
1717
1711
|
f(e), P && e.taskIndex !== void 0 && kt(P.id, [e.taskIndex]);
|
|
@@ -1725,7 +1719,7 @@ var mn = ({ open: e, title: t, fieldSchemas: n, rows: r, taskId: a, includedKeys
|
|
|
1725
1719
|
width: 60,
|
|
1726
1720
|
fixed: "left"
|
|
1727
1721
|
},
|
|
1728
|
-
...
|
|
1722
|
+
...F.map((e) => ({
|
|
1729
1723
|
key: e.key,
|
|
1730
1724
|
title: e.title,
|
|
1731
1725
|
dataIndex: e.key,
|
|
@@ -1733,7 +1727,7 @@ var mn = ({ open: e, title: t, fieldSchemas: n, rows: r, taskId: a, includedKeys
|
|
|
1733
1727
|
render: (t, n) => /* @__PURE__ */ k(rn, {
|
|
1734
1728
|
field: e,
|
|
1735
1729
|
record: n,
|
|
1736
|
-
disabled: !
|
|
1730
|
+
disabled: !ue(n),
|
|
1737
1731
|
onChange: (t) => s(n, e, t),
|
|
1738
1732
|
onSave: (t) => c(n, e, t)
|
|
1739
1733
|
})
|
|
@@ -1759,7 +1753,7 @@ var mn = ({ open: e, title: t, fieldSchemas: n, rows: r, taskId: a, includedKeys
|
|
|
1759
1753
|
fixed: "right",
|
|
1760
1754
|
render: (e, t) => Ce(t)
|
|
1761
1755
|
}
|
|
1762
|
-
], Te = Math.max(1200, 60 +
|
|
1756
|
+
], Te = Math.max(1200, 60 + F.length * 160 + 100 + 110 + 80), Ee = I && I.total > 0 ? Ke(I) : 0, De = I?.failureCount ?? I?.failures?.length ?? 0, Oe = I?.validationFailedCount ?? r.filter((e) => Object.keys(e.errors).length > 0).length, ke = r.filter((e) => Object.keys(e.errors).length > 0).length, Ae = r.length > 0 && ke === r.length;
|
|
1763
1757
|
return /* @__PURE__ */ k(ee, { children: /* @__PURE__ */ A(p, {
|
|
1764
1758
|
title: a ? `${t}导入` : `${t}导入预览`,
|
|
1765
1759
|
open: e,
|
|
@@ -1768,7 +1762,7 @@ var mn = ({ open: e, title: t, fieldSchemas: n, rows: r, taskId: a, includedKeys
|
|
|
1768
1762
|
closable: !1,
|
|
1769
1763
|
keyboard: !1,
|
|
1770
1764
|
onCancel: () => {
|
|
1771
|
-
|
|
1765
|
+
L || b();
|
|
1772
1766
|
},
|
|
1773
1767
|
footer: (() => {
|
|
1774
1768
|
if (!a) return /* @__PURE__ */ A(u, {
|
|
@@ -1776,9 +1770,9 @@ var mn = ({ open: e, title: t, fieldSchemas: n, rows: r, taskId: a, includedKeys
|
|
|
1776
1770
|
align: "center",
|
|
1777
1771
|
gap: 8,
|
|
1778
1772
|
wrap: !0,
|
|
1779
|
-
children: [/* @__PURE__ */ k("span", { children: r.length > 0 &&
|
|
1780
|
-
type:
|
|
1781
|
-
children:
|
|
1773
|
+
children: [/* @__PURE__ */ k("span", { children: r.length > 0 && ke > 0 ? /* @__PURE__ */ k(x.Text, {
|
|
1774
|
+
type: Ae ? "danger" : "secondary",
|
|
1775
|
+
children: Ae ? "全部行校验失败, 请先修正后再导入" : `有 ${ke} 行校验失败, 不会导入`
|
|
1782
1776
|
}) : null }), /* @__PURE__ */ A(u, {
|
|
1783
1777
|
gap: 8,
|
|
1784
1778
|
children: [/* @__PURE__ */ k(l, {
|
|
@@ -1786,7 +1780,7 @@ var mn = ({ open: e, title: t, fieldSchemas: n, rows: r, taskId: a, includedKeys
|
|
|
1786
1780
|
children: "取消"
|
|
1787
1781
|
}), /* @__PURE__ */ k(l, {
|
|
1788
1782
|
type: "primary",
|
|
1789
|
-
disabled: r.length === 0 ||
|
|
1783
|
+
disabled: r.length === 0 || Ae,
|
|
1790
1784
|
onClick: () => {
|
|
1791
1785
|
ne(), _();
|
|
1792
1786
|
},
|
|
@@ -1794,38 +1788,38 @@ var mn = ({ open: e, title: t, fieldSchemas: n, rows: r, taskId: a, includedKeys
|
|
|
1794
1788
|
})]
|
|
1795
1789
|
})]
|
|
1796
1790
|
});
|
|
1797
|
-
if (!P || !
|
|
1791
|
+
if (!P || !I) return /* @__PURE__ */ k(u, {
|
|
1798
1792
|
justify: "flex-end",
|
|
1799
1793
|
children: /* @__PURE__ */ k(l, {
|
|
1800
1794
|
onClick: b,
|
|
1801
1795
|
children: "关闭"
|
|
1802
1796
|
})
|
|
1803
1797
|
});
|
|
1804
|
-
let e =
|
|
1798
|
+
let e = I.status === "running", t = I.status === "paused";
|
|
1805
1799
|
return /* @__PURE__ */ A(u, {
|
|
1806
1800
|
justify: "flex-end",
|
|
1807
1801
|
gap: 8,
|
|
1808
1802
|
children: [
|
|
1809
1803
|
e ? /* @__PURE__ */ A(ee, { children: [/* @__PURE__ */ k(l, {
|
|
1810
1804
|
danger: !0,
|
|
1811
|
-
loading:
|
|
1812
|
-
disabled:
|
|
1813
|
-
onClick: () => Wt(
|
|
1814
|
-
children:
|
|
1805
|
+
loading: I.canceling,
|
|
1806
|
+
disabled: I.canceling,
|
|
1807
|
+
onClick: () => Wt(I.id),
|
|
1808
|
+
children: I.canceling ? "取消中" : "取消任务"
|
|
1815
1809
|
}), /* @__PURE__ */ k(l, {
|
|
1816
|
-
loading:
|
|
1817
|
-
disabled:
|
|
1818
|
-
onClick: () => Et(
|
|
1810
|
+
loading: I.pausing,
|
|
1811
|
+
disabled: I.canceling,
|
|
1812
|
+
onClick: () => Et(I.id),
|
|
1819
1813
|
children: "暂停"
|
|
1820
1814
|
})] }) : null,
|
|
1821
1815
|
t ? /* @__PURE__ */ A(ee, { children: [/* @__PURE__ */ k(l, {
|
|
1822
1816
|
danger: !0,
|
|
1823
|
-
onClick: () => Wt(
|
|
1817
|
+
onClick: () => Wt(I.id),
|
|
1824
1818
|
children: "取消任务"
|
|
1825
1819
|
}), /* @__PURE__ */ k(l, {
|
|
1826
1820
|
type: "primary",
|
|
1827
1821
|
onClick: () => {
|
|
1828
|
-
ne(), Tt(
|
|
1822
|
+
ne(), Tt(I.id);
|
|
1829
1823
|
},
|
|
1830
1824
|
children: "继续导入"
|
|
1831
1825
|
})] }) : null,
|
|
@@ -1838,7 +1832,7 @@ var mn = ({ open: e, title: t, fieldSchemas: n, rows: r, taskId: a, includedKeys
|
|
|
1838
1832
|
});
|
|
1839
1833
|
})(),
|
|
1840
1834
|
children: [
|
|
1841
|
-
|
|
1835
|
+
I && oe ? /* @__PURE__ */ A(u, {
|
|
1842
1836
|
vertical: !0,
|
|
1843
1837
|
gap: 4,
|
|
1844
1838
|
style: { marginBottom: 12 },
|
|
@@ -1849,23 +1843,23 @@ var mn = ({ open: e, title: t, fieldSchemas: n, rows: r, taskId: a, includedKeys
|
|
|
1849
1843
|
type: "secondary",
|
|
1850
1844
|
children: [
|
|
1851
1845
|
"已导入 ",
|
|
1852
|
-
|
|
1846
|
+
We(I).toLocaleString(),
|
|
1853
1847
|
" / 总数 ",
|
|
1854
|
-
|
|
1848
|
+
I.total.toLocaleString()
|
|
1855
1849
|
]
|
|
1856
1850
|
}), /* @__PURE__ */ A(u, {
|
|
1857
1851
|
align: "center",
|
|
1858
1852
|
gap: 8,
|
|
1859
1853
|
children: [
|
|
1860
|
-
|
|
1854
|
+
ce ? /* @__PURE__ */ k(x.Text, {
|
|
1861
1855
|
type: "secondary",
|
|
1862
|
-
children:
|
|
1856
|
+
children: ce
|
|
1863
1857
|
}) : null,
|
|
1864
|
-
|
|
1858
|
+
Oe > 0 ? /* @__PURE__ */ A(y, {
|
|
1865
1859
|
color: "error",
|
|
1866
1860
|
children: [
|
|
1867
1861
|
"校验失败 ",
|
|
1868
|
-
|
|
1862
|
+
Oe,
|
|
1869
1863
|
" 条"
|
|
1870
1864
|
]
|
|
1871
1865
|
}) : null,
|
|
@@ -1878,15 +1872,15 @@ var mn = ({ open: e, title: t, fieldSchemas: n, rows: r, taskId: a, includedKeys
|
|
|
1878
1872
|
]
|
|
1879
1873
|
}) : null,
|
|
1880
1874
|
/* @__PURE__ */ k(y, {
|
|
1881
|
-
color:
|
|
1882
|
-
children:
|
|
1875
|
+
color: oe.color,
|
|
1876
|
+
children: oe.label
|
|
1883
1877
|
})
|
|
1884
1878
|
]
|
|
1885
1879
|
})]
|
|
1886
1880
|
}), /* @__PURE__ */ k(h, {
|
|
1887
1881
|
percent: Ee,
|
|
1888
|
-
format: () =>
|
|
1889
|
-
status: sn(
|
|
1882
|
+
format: () => qe(Ee),
|
|
1883
|
+
status: sn(I),
|
|
1890
1884
|
size: "small"
|
|
1891
1885
|
})]
|
|
1892
1886
|
}) : a ? null : /* @__PURE__ */ A(u, {
|
|
@@ -1902,11 +1896,11 @@ var mn = ({ open: e, title: t, fieldSchemas: n, rows: r, taskId: a, includedKeys
|
|
|
1902
1896
|
}), /* @__PURE__ */ A(u, {
|
|
1903
1897
|
align: "center",
|
|
1904
1898
|
gap: 8,
|
|
1905
|
-
children: [
|
|
1899
|
+
children: [Oe > 0 ? /* @__PURE__ */ A(y, {
|
|
1906
1900
|
color: "error",
|
|
1907
1901
|
children: [
|
|
1908
1902
|
"校验失败 ",
|
|
1909
|
-
|
|
1903
|
+
Oe,
|
|
1910
1904
|
" 条"
|
|
1911
1905
|
]
|
|
1912
1906
|
}) : null, /* @__PURE__ */ k(y, { children: "待导入" })]
|
|
@@ -1930,9 +1924,9 @@ var mn = ({ open: e, title: t, fieldSchemas: n, rows: r, taskId: a, includedKeys
|
|
|
1930
1924
|
children: [
|
|
1931
1925
|
/* @__PURE__ */ k(d, {
|
|
1932
1926
|
allowClear: !0,
|
|
1933
|
-
disabled:
|
|
1927
|
+
disabled: z,
|
|
1934
1928
|
placeholder: "搜索所有字段",
|
|
1935
|
-
value:
|
|
1929
|
+
value: z ? "" : M,
|
|
1936
1930
|
style: { width: 260 },
|
|
1937
1931
|
onChange: (e) => {
|
|
1938
1932
|
te(e.target.value);
|
|
@@ -1940,10 +1934,10 @@ var mn = ({ open: e, title: t, fieldSchemas: n, rows: r, taskId: a, includedKeys
|
|
|
1940
1934
|
}),
|
|
1941
1935
|
/* @__PURE__ */ k(g, {
|
|
1942
1936
|
allowClear: !0,
|
|
1943
|
-
disabled:
|
|
1937
|
+
disabled: z,
|
|
1944
1938
|
placeholder: "数据状态",
|
|
1945
|
-
value:
|
|
1946
|
-
options:
|
|
1939
|
+
value: V === "all" ? void 0 : V,
|
|
1940
|
+
options: fe,
|
|
1947
1941
|
style: { width: 140 },
|
|
1948
1942
|
onChange: (e) => {
|
|
1949
1943
|
C(e ?? "all");
|
|
@@ -1951,10 +1945,10 @@ var mn = ({ open: e, title: t, fieldSchemas: n, rows: r, taskId: a, includedKeys
|
|
|
1951
1945
|
}),
|
|
1952
1946
|
/* @__PURE__ */ k(g, {
|
|
1953
1947
|
allowClear: !0,
|
|
1954
|
-
disabled:
|
|
1948
|
+
disabled: z,
|
|
1955
1949
|
placeholder: "导入状态",
|
|
1956
|
-
value:
|
|
1957
|
-
options:
|
|
1950
|
+
value: H === "all" ? void 0 : H,
|
|
1951
|
+
options: pe,
|
|
1958
1952
|
style: { width: 140 },
|
|
1959
1953
|
onChange: (e) => {
|
|
1960
1954
|
j(e ?? "all");
|
|
@@ -2015,7 +2009,7 @@ function vn(e, t, n) {
|
|
|
2015
2009
|
let r = {};
|
|
2016
2010
|
return t.forEach((t) => {
|
|
2017
2011
|
if (!n.includes(t.key)) return;
|
|
2018
|
-
let i =
|
|
2012
|
+
let i = ge(t, e.values[t.key]), a = H(i.trim() === "" ? null : i, t);
|
|
2019
2013
|
if (!a.validateSuccess) throw Error(a.validateMessage);
|
|
2020
2014
|
r[t.key] = a.validateValue ?? null;
|
|
2021
2015
|
}), r;
|
|
@@ -2035,8 +2029,8 @@ function bn(e) {
|
|
|
2035
2029
|
}
|
|
2036
2030
|
return Ft(e, "导入", "任务已暂停") ?? (e instanceof Error && e.message ? e.message : "导入失败, 任务已暂停");
|
|
2037
2031
|
}
|
|
2038
|
-
var xn = ({ title: e, fieldSchemas: t, buttonText: n = "导入",
|
|
2039
|
-
let [f, p] = D(!1), [m, h] = D([]), [g, v] = Qt(), [y, x] = D("empty"), [S, C] = D(!1), [w, O] = D(!1), [j, M] = D([]), { modal: te, message: N } = c.useApp(), ne = E(null), P = T(() =>
|
|
2032
|
+
var xn = ({ title: e, fieldSchemas: t, buttonText: n = "导入", batchSize: r = 20, importRows: i, beforeImport: a, afterImport: u, onModalClose: d }) => {
|
|
2033
|
+
let [f, p] = D(!1), [m, h] = D([]), [g, v] = Qt(), [y, x] = D("empty"), [S, C] = D(!1), [w, O] = D(!1), [j, M] = D([]), { modal: te, message: N } = c.useApp(), ne = E(null), P = T(() => ae(t), [t]), re = T(() => new Set([...j].filter((e) => P.some((t) => t.key === e))), [P, j]), ie = () => ne.current?.click(), F = (e, t) => {
|
|
2040
2034
|
te.warning({
|
|
2041
2035
|
title: t ?? (e.missingTitles.length > 0 ? "文件表头不完整" : "文件检查未通过"),
|
|
2042
2036
|
width: 480,
|
|
@@ -2047,21 +2041,21 @@ var xn = ({ title: e, fieldSchemas: t, buttonText: n = "导入", maxRows: r = H,
|
|
|
2047
2041
|
closable: !0,
|
|
2048
2042
|
onOk: ie
|
|
2049
2043
|
});
|
|
2050
|
-
},
|
|
2044
|
+
}, I = async (e) => {
|
|
2051
2045
|
if (e.size > 20971520) N.error("文件大小超过 20MB, 请拆分后再导入");
|
|
2052
2046
|
else {
|
|
2053
2047
|
v(void 0), M([]), C(!0);
|
|
2054
2048
|
try {
|
|
2055
|
-
let { headerMessages: t, formulaMessages: n, rows: r, includedKeys: i } = await
|
|
2049
|
+
let { headerMessages: t, formulaMessages: n, rows: r, includedKeys: i } = await ze(e, P);
|
|
2056
2050
|
if (n.length > 0) {
|
|
2057
|
-
|
|
2051
|
+
F({
|
|
2058
2052
|
missingTitles: [],
|
|
2059
2053
|
headerMessages: n
|
|
2060
2054
|
}, "文件里的公式还没有计算结果");
|
|
2061
2055
|
return;
|
|
2062
2056
|
}
|
|
2063
2057
|
if (t.length > 0) {
|
|
2064
|
-
|
|
2058
|
+
F({
|
|
2065
2059
|
missingTitles: t.filter((e) => e.startsWith(yn)).map((e) => e.slice(5)),
|
|
2066
2060
|
headerMessages: t.filter((e) => !e.startsWith(yn))
|
|
2067
2061
|
});
|
|
@@ -2071,6 +2065,12 @@ var xn = ({ title: e, fieldSchemas: t, buttonText: n = "导入", maxRows: r = H,
|
|
|
2071
2065
|
N.error("文件里没有数据行");
|
|
2072
2066
|
return;
|
|
2073
2067
|
}
|
|
2068
|
+
try {
|
|
2069
|
+
await a?.(r);
|
|
2070
|
+
} catch (e) {
|
|
2071
|
+
N.error(e instanceof Error ? e.message : "导入已取消");
|
|
2072
|
+
return;
|
|
2073
|
+
}
|
|
2074
2074
|
M(i), x(`${e.name}-${Date.now()}`), h(r), p(!0);
|
|
2075
2075
|
} catch (e) {
|
|
2076
2076
|
console.error(`导入文件解析失败: ${e}`), N.error("导入文件解析失败, 请确认上传的是 Excel 文件");
|
|
@@ -2101,7 +2101,7 @@ var xn = ({ title: e, fieldSchemas: t, buttonText: n = "导入", maxRows: r = H,
|
|
|
2101
2101
|
onClick: async () => {
|
|
2102
2102
|
O(!0);
|
|
2103
2103
|
try {
|
|
2104
|
-
await
|
|
2104
|
+
await Re(P, `${e}导入模板`);
|
|
2105
2105
|
} catch (e) {
|
|
2106
2106
|
console.error(`模板下载失败: ${e}`), N.error("模板下载失败");
|
|
2107
2107
|
} finally {
|
|
@@ -2119,7 +2119,7 @@ var xn = ({ title: e, fieldSchemas: t, buttonText: n = "导入", maxRows: r = H,
|
|
|
2119
2119
|
style: { display: "none" },
|
|
2120
2120
|
onChange: (e) => {
|
|
2121
2121
|
let t = e.target.files?.[0];
|
|
2122
|
-
e.target.value = "", t &&
|
|
2122
|
+
e.target.value = "", t && I(t);
|
|
2123
2123
|
}
|
|
2124
2124
|
}),
|
|
2125
2125
|
/* @__PURE__ */ k(mn, {
|
|
@@ -2131,7 +2131,7 @@ var xn = ({ title: e, fieldSchemas: t, buttonText: n = "导入", maxRows: r = H,
|
|
|
2131
2131
|
includedKeys: j,
|
|
2132
2132
|
onChangeCell: (e, t, n) => {
|
|
2133
2133
|
if (!j.includes(t.key)) return;
|
|
2134
|
-
let r =
|
|
2134
|
+
let r = ge(t, n), i = H(r.trim() === "" ? null : r, t);
|
|
2135
2135
|
h((r) => r.map((r) => {
|
|
2136
2136
|
if (r.key !== e.key) return r;
|
|
2137
2137
|
let a = { ...r.errors };
|
|
@@ -2153,7 +2153,7 @@ var xn = ({ title: e, fieldSchemas: t, buttonText: n = "导入", maxRows: r = H,
|
|
|
2153
2153
|
}, i = {};
|
|
2154
2154
|
P.forEach((e) => {
|
|
2155
2155
|
if (!j.includes(e.key)) return;
|
|
2156
|
-
let t =
|
|
2156
|
+
let t = ge(e, r[e.key]), n = H(t.trim() === "" ? null : t, e);
|
|
2157
2157
|
n.validateSuccess || (i[e.key] = n.validateMessage);
|
|
2158
2158
|
});
|
|
2159
2159
|
let a = {
|
|
@@ -2176,46 +2176,34 @@ var xn = ({ title: e, fieldSchemas: t, buttonText: n = "导入", maxRows: r = H,
|
|
|
2176
2176
|
N.error("所有行都有校验错误, 请先修正后再导入");
|
|
2177
2177
|
return;
|
|
2178
2178
|
}
|
|
2179
|
-
let n =
|
|
2180
|
-
if (n) {
|
|
2181
|
-
N.error(n);
|
|
2182
|
-
return;
|
|
2183
|
-
}
|
|
2184
|
-
try {
|
|
2185
|
-
await u?.();
|
|
2186
|
-
} catch (e) {
|
|
2187
|
-
N.error(e instanceof Error ? e.message : "导入已取消");
|
|
2188
|
-
return;
|
|
2189
|
-
}
|
|
2190
|
-
let o = t.map((e, t) => ({
|
|
2179
|
+
let n = t.map((e, t) => ({
|
|
2191
2180
|
...e,
|
|
2192
2181
|
taskIndex: t
|
|
2193
2182
|
}));
|
|
2194
|
-
h(
|
|
2195
|
-
let
|
|
2183
|
+
h(n);
|
|
2184
|
+
let a = wt({
|
|
2196
2185
|
title: `${e}导入`,
|
|
2197
|
-
rows:
|
|
2186
|
+
rows: n,
|
|
2198
2187
|
fieldSchemas: P,
|
|
2199
2188
|
includedKeys: j,
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
importRows: async (e, t) => {
|
|
2189
|
+
batchSize: r,
|
|
2190
|
+
importRows: async (e) => {
|
|
2203
2191
|
try {
|
|
2204
|
-
let
|
|
2205
|
-
if (
|
|
2206
|
-
return
|
|
2192
|
+
let t = await i(e.map((e) => vn(e, P, j)));
|
|
2193
|
+
if (t.length !== e.length) throw new at("导入接口返回结果数量不正确, 任务已暂停");
|
|
2194
|
+
return t.map((e) => _n(e, re));
|
|
2207
2195
|
} catch (e) {
|
|
2208
|
-
throw
|
|
2196
|
+
throw e instanceof at ? e : new at(bn(e));
|
|
2209
2197
|
}
|
|
2210
2198
|
},
|
|
2211
|
-
onFinished:
|
|
2199
|
+
onFinished: u
|
|
2212
2200
|
});
|
|
2213
|
-
v(
|
|
2201
|
+
v(a);
|
|
2214
2202
|
},
|
|
2215
2203
|
onClose: () => {
|
|
2216
|
-
g && Gt(g), p(!1), v(void 0), h([]), M([]);
|
|
2204
|
+
g && Gt(g), p(!1), v(void 0), h([]), M([]), d?.();
|
|
2217
2205
|
}
|
|
2218
2206
|
}, y)
|
|
2219
2207
|
] });
|
|
2220
2208
|
};
|
|
2221
|
-
export { $t as ExportButton, xn as ImportButton,
|
|
2209
|
+
export { $t as ExportButton, xn as ImportButton, me as MAX_IMPORT_FILE_SIZE, I as MULTI_VALUE_SEPARATOR, Ve as exportRowsToFile, ae as importableFields, L as joinMultiValues, Kt as resetTasks, se as splitMultiValues, ue as validateBooleanField, de as validateDateField, pe as validateDateTimeField, H as validateField, z as validateListField, V as validateMultipleChoiceField, le as validateNumberField, B as validateSingleChoiceField, R as validateTextField, fe as validateTimeField };
|