@glodon-aiot/dataset-annotation 3.9.0-beta.9 → 3.10.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/dist/dataset-annotation.js +123598 -0
  2. package/dist/dataset-annotation.umd.cjs +1017 -0
  3. package/dist/es/DatasetContext/index.mjs +6 -3
  4. package/dist/es/components/Iconfont/index.mjs +2 -2
  5. package/dist/es/components/PicZipImportModal/config.mjs +41 -0
  6. package/dist/es/components/PicZipImportModal/index.mjs +317 -301
  7. package/dist/es/components/PicZipImportModal/pic_vlm_json_zip.svg.mjs +4 -0
  8. package/dist/es/components/PicZipImportModal/pic_vlm_zip.svg.mjs +4 -0
  9. package/dist/es/components/VLMAnnotation/RegionItem.mjs +95 -0
  10. package/dist/es/components/VLMAnnotation/TextAnnotationPanel.mjs +83 -0
  11. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasDrag.mjs +75 -0
  12. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasSetup.mjs +115 -0
  13. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasZoom.mjs +42 -0
  14. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useCropRegionImage.mjs +55 -0
  15. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useDeleteControl.mjs +51 -0
  16. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useDeleteRegion.mjs +47 -0
  17. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useDrawingMode.mjs +220 -0
  18. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRLoadingIcon.mjs +106 -0
  19. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRRecognition.mjs +68 -0
  20. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionHover.mjs +38 -0
  21. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionLoader.mjs +141 -0
  22. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionNameText.mjs +72 -0
  23. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionSelection.mjs +102 -0
  24. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionUpdate.mjs +103 -0
  25. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useTextLayouts.mjs +156 -0
  26. package/dist/es/components/VLMAnnotation/VLMLabelMaker/icons/del.png.mjs +4 -0
  27. package/dist/es/components/VLMAnnotation/VLMLabelMaker/index.mjs +507 -0
  28. package/dist/es/components/VLMAnnotation/VLMLabelMaker/style.less.mjs +4 -0
  29. package/dist/es/components/VLMAnnotation/VLMLabelMaker/utils/coordinateUtils.mjs +33 -0
  30. package/dist/es/components/VLMAnnotation/components/DragButton.mjs +18 -0
  31. package/dist/es/components/VLMAnnotation/components/FitToScreenButton.mjs +16 -0
  32. package/dist/es/components/VLMAnnotation/components/RectangleButton.mjs +30 -0
  33. package/dist/es/components/VLMAnnotation/components/Toolbar.mjs +40 -0
  34. package/dist/es/components/VLMAnnotation/components/ZoomControls.mjs +44 -0
  35. package/dist/es/components/VLMAnnotation/constants.mjs +50 -0
  36. package/dist/es/components/VLMAnnotation/index.mjs +242 -0
  37. package/dist/es/components/VLMAnnotation/style.less.mjs +4 -0
  38. package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/AttributeDetail/index.mjs +345 -0
  39. package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/AttributeDetail/style.less.mjs +4 -0
  40. package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/QAGenerationConfig.mjs +240 -0
  41. package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/index.mjs +201 -0
  42. package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/style.less.mjs +4 -0
  43. package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/index.mjs +399 -0
  44. package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/style.less.mjs +4 -0
  45. package/dist/es/components/VLMAnnotationDetail/VlmModal/index.mjs +139 -0
  46. package/dist/es/components/VLMAnnotationDetail/VlmModal/style.less.mjs +4 -0
  47. package/dist/es/components/VLMAnnotationDetail/index.mjs +446 -0
  48. package/dist/es/components/VLMAnnotationDetail/style.less.mjs +4 -0
  49. package/dist/es/constant.mjs +3 -3
  50. package/dist/es/createVlmtasetAnnotation/index.mjs +131 -0
  51. package/dist/es/featuresConfig.mjs +13 -9
  52. package/dist/es/index.mjs +11 -7
  53. package/dist/example/DatasetAnnotationDemo.d.ts +3 -0
  54. package/dist/example/DemoTabs.d.ts +3 -0
  55. package/dist/example/DetectionDatasetDemo.d.ts +5 -0
  56. package/dist/example/DetectionImageDemo.d.ts +5 -0
  57. package/dist/example/OcrDatasetDemo.d.ts +5 -0
  58. package/dist/example/OcrImageDemo.d.ts +5 -0
  59. package/dist/example/OcrkvcDatasetDemo.d.ts +5 -0
  60. package/dist/example/constant.local.d.ts +6 -0
  61. package/dist/example/index.d.ts +1 -0
  62. package/dist/lib/index.js +4 -3
  63. package/dist/src/DatasetContext/index.d.ts +2 -0
  64. package/dist/src/components/Iconfont/font_4439177_tgvowh6bmlb.d.ts +0 -0
  65. package/dist/src/components/PicZipImportModal/config.d.ts +20 -0
  66. package/dist/src/components/VLMAnnotation/ImageAnnotationDebugger.d.ts +4 -0
  67. package/dist/src/components/VLMAnnotation/RegionItem.d.ts +4 -0
  68. package/dist/src/components/VLMAnnotation/TextAnnotationPanel.d.ts +4 -0
  69. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasDrag.d.ts +12 -0
  70. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasSetup.d.ts +38 -0
  71. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasZoom.d.ts +18 -0
  72. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useCropRegionImage.d.ts +7 -0
  73. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useDeleteControl.d.ts +13 -0
  74. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useDeleteRegion.d.ts +21 -0
  75. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useDrawingMode.d.ts +31 -0
  76. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRLoadingIcon.d.ts +11 -0
  77. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRRecognition.d.ts +28 -0
  78. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionHover.d.ts +13 -0
  79. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionLoader.d.ts +37 -0
  80. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionNameText.d.ts +12 -0
  81. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionSelection.d.ts +15 -0
  82. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionUpdate.d.ts +32 -0
  83. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useTextLayouts.d.ts +25 -0
  84. package/dist/src/components/VLMAnnotation/VLMLabelMaker/index.d.ts +4 -0
  85. package/dist/src/components/VLMAnnotation/VLMLabelMaker/utils/coordinateUtils.d.ts +32 -0
  86. package/dist/src/components/VLMAnnotation/components/DragButton.d.ts +7 -0
  87. package/dist/src/components/VLMAnnotation/components/FitToScreenButton.d.ts +6 -0
  88. package/dist/src/components/VLMAnnotation/components/RectangleButton.d.ts +7 -0
  89. package/dist/src/components/VLMAnnotation/components/Toolbar.d.ts +4 -0
  90. package/dist/src/components/VLMAnnotation/components/ZoomControls.d.ts +4 -0
  91. package/dist/src/components/VLMAnnotation/constants.d.ts +97 -0
  92. package/dist/src/components/VLMAnnotation/index.d.ts +6 -0
  93. package/dist/src/components/VLMAnnotation/types.d.ts +172 -0
  94. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/AttributeDetail/index.d.ts +14 -0
  95. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/ImageDetail/index.d.ts +16 -0
  96. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/LabelEditorInput.d.ts +12 -0
  97. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/LabelEditorItem.d.ts +21 -0
  98. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/LableEditor.d.ts +16 -0
  99. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/index.d.ts +19 -0
  100. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/QAGenerationConfig.d.ts +12 -0
  101. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/index.d.ts +12 -0
  102. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/index.d.ts +12 -0
  103. package/dist/src/components/VLMAnnotationDetail/VlmModal/index.d.ts +16 -0
  104. package/dist/src/components/VLMAnnotationDetail/index.d.ts +6 -0
  105. package/dist/src/constant.d.ts +1 -1
  106. package/dist/src/createVlmtasetAnnotation/index.d.ts +16 -0
  107. package/dist/src/featuresConfig.d.ts +4 -0
  108. package/dist/src/index.d.ts +3 -0
  109. package/dist/src/utils/reactCompatibility.d.ts +5 -0
  110. package/package.json +2 -2
@@ -1,160 +1,165 @@
1
- var ol = Object.defineProperty;
2
- var Be = Object.getOwnPropertySymbols;
3
- var rl = Object.prototype.hasOwnProperty, cl = Object.prototype.propertyIsEnumerable;
4
- var Le = (y, l, i) => l in y ? ol(y, l, { enumerable: !0, configurable: !0, writable: !0, value: i }) : y[l] = i, Ae = (y, l) => {
5
- for (var i in l || (l = {}))
6
- rl.call(l, i) && Le(y, i, l[i]);
7
- if (Be)
8
- for (var i of Be(l))
9
- cl.call(l, i) && Le(y, i, l[i]);
10
- return y;
1
+ var dl = Object.defineProperty;
2
+ var Te = Object.getOwnPropertySymbols;
3
+ var pl = Object.prototype.hasOwnProperty, ml = Object.prototype.propertyIsEnumerable;
4
+ var Oe = (S, e, s) => e in S ? dl(S, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : S[e] = s, Ve = (S, e) => {
5
+ for (var s in e || (e = {}))
6
+ pl.call(e, s) && Oe(S, s, e[s]);
7
+ if (Te)
8
+ for (var s of Te(e))
9
+ ml.call(e, s) && Oe(S, s, e[s]);
10
+ return S;
11
11
  };
12
- var re = (y, l, i) => new Promise((f, M) => {
13
- var D = (w) => {
12
+ var ce = (S, e, s) => new Promise((u, K) => {
13
+ var _ = (N) => {
14
14
  try {
15
- F(i.next(w));
16
- } catch (z) {
17
- M(z);
15
+ U(s.next(N));
16
+ } catch (v) {
17
+ K(v);
18
18
  }
19
- }, Z = (w) => {
19
+ }, h = (N) => {
20
20
  try {
21
- F(i.throw(w));
22
- } catch (z) {
23
- M(z);
21
+ U(s.throw(N));
22
+ } catch (v) {
23
+ K(v);
24
24
  }
25
- }, F = (w) => w.done ? f(w.value) : Promise.resolve(w.value).then(D, Z);
26
- F((i = i.apply(y, l)).next());
25
+ }, U = (N) => N.done ? u(N.value) : Promise.resolve(N.value).then(_, h);
26
+ U((s = s.apply(S, e)).next());
27
27
  });
28
- import { jsxs as p, Fragment as ce, jsx as e } from "react/jsx-runtime";
29
- import { useContext as dl, useState as r, useRef as pl, useEffect as A } from "react";
30
- import { Form as U, message as R, Modal as H, Button as O, Radio as x, Space as Ue, Upload as ul, Row as de, Col as ml, Spin as fl, Result as Oe } from "antd";
28
+ import { jsxs as d, Fragment as de, jsx as l } from "react/jsx-runtime";
29
+ import { useContext as ul, useState as r, useRef as fl, useEffect as T } from "react";
30
+ import { Form as O, message as $, Modal as H, Button as V, Radio as k, Tooltip as hl, Space as Pe, Upload as gl, Row as pe, Col as Cl, Spin as bl, Result as Me } from "antd";
31
31
  import "./style.less.mjs";
32
- import { CloudUploadOutlined as hl, PaperClipOutlined as gl, DeleteOutlined as Cl, PlusOutlined as bl } from "@ant-design/icons";
33
- import yl from "browser-md5-file";
34
- import { initMinio as Te, putObjectBuffer as Pe } from "@glodon-aiot/minio";
35
- import Nl from "antd/lib/upload/Dragger";
36
- import Sl from "./pic_zip.svg.mjs";
37
- import wl from "./pic_zip_json.svg.mjs";
38
- import { GB as zl, MB as jl } from "../../constant.mjs";
39
- import { fileSuffixToLowerCase as kl } from "../../utils/index.mjs";
40
- import vl from "../../DatasetContext/index.mjs";
41
- import { EXAMPLE_SRC_ROOT as El } from "../../featuresConfig.mjs";
42
- let m = 0, G = 0, T = 0, _ = 0;
43
- const Wl = (y) => {
32
+ import { InfoCircleOutlined as yl, CloudUploadOutlined as Sl, PaperClipOutlined as zl, DeleteOutlined as wl, PlusOutlined as El } from "@ant-design/icons";
33
+ import Nl from "browser-md5-file";
34
+ import { initMinio as De, putObjectBuffer as Ke } from "@glodon-aiot/minio";
35
+ import vl from "antd/lib/upload/Dragger";
36
+ import xl from "./pic_zip.svg.mjs";
37
+ import Rl from "./pic_zip_json.svg.mjs";
38
+ import Bl from "./pic_vlm_json_zip.svg.mjs";
39
+ import Fl from "./pic_vlm_zip.svg.mjs";
40
+ import { MB as _e, GB as Al } from "../../constant.mjs";
41
+ import { fileSuffixToLowerCase as $l } from "../../utils/index.mjs";
42
+ import kl from "../../DatasetContext/index.mjs";
43
+ import { EXAMPLE_SRC_ROOT as Ul, VLM_EXAMPLE_SRC_ROOT as jl } from "../../featuresConfig.mjs";
44
+ import { getImportConfig as Ll } from "./config.mjs";
45
+ let f = 0, G = 0, P = 0, I = 0;
46
+ const nt = (S) => {
44
47
  const {
45
- datasetIam: l,
46
- datasetId: i,
47
- currentVersion: f,
48
- tenCode: M,
49
- isVisible: D,
50
- markType: Z,
51
- setIsVisible: F,
52
- getVersionListRequest: w,
53
- onUploadStatusChange: z,
54
- setIsConfirm: I,
55
- tableReload: pe,
48
+ datasetIam: e,
49
+ datasetId: s,
50
+ currentVersion: u,
51
+ tenCode: K,
52
+ isVisible: _,
53
+ markType: h,
54
+ setIsVisible: U,
55
+ getVersionListRequest: N,
56
+ onUploadStatusChange: v,
57
+ setIsConfirm: Q,
58
+ tableReload: me,
56
59
  loadVersionData: q,
57
60
  actionAfterFinish: ue
58
- } = y, {
61
+ } = S, {
59
62
  services: {
60
- cvforceDatahub: u
63
+ cvforceDatahub: p
61
64
  },
62
65
  featuresConfig: {
63
- exampleSrcRoot: me
66
+ exampleSrcRoot: fe,
67
+ vlmExampleSrcRoot: he
64
68
  } = {
65
- exampleSrcRoot: El
69
+ exampleSrcRoot: Ul,
70
+ vlmExampleSrcRoot: jl
66
71
  }
67
- } = dl(vl), [N, Ve] = r(0), [S, Me] = r(0), [Q, De] = r([]), [P, Ke] = r(), [fe, Rl] = r([]), [Y, J] = r(!1), [he, ee] = r(!1), [K, le] = r(!1), [te, Ge] = r(0), [ge, _e] = r(0), [W, Ce] = r(-1), [se, xl] = r([]), [be, Fl] = r([]), [ye, ie] = r(!1), Ze = new yl(), [X] = U.useForm(), n = U.useWatch("acceptType", X), v = U.useWatch("labelState", X), [h, Ne] = r([]), [k, Se] = r([]), [E, qe] = r(), [we, ze] = r(0), [je, ke] = r(!1), [$l, Je] = r(""), [We, ve] = r(!1), [Ee, Xe] = r(
72
+ } = ul(kl), [z, Ze] = r(0), [w, Ge] = r(0), [Y, Ie] = r([]), [M, qe] = r(), [ge, Tl] = r([]), [ee, X] = r(!1), [Ce, le] = r(!1), [Z, te] = r(!1), [ie, Xe] = r(0), [be, Je] = r(0), [J, ye] = r(-1), [se, Ol] = r([]), [Se, Vl] = r([]), [ze, ne] = r(!1), We = new Nl(), [W] = O.useForm(), n = O.useWatch("acceptType", W), B = O.useWatch("labelState", W), [g, we] = r([]), [F, Ee] = r([]), [A, He] = r(), [Ne, ve] = r(0), [xe, Re] = r(!1), [Pl, Be] = r(""), [Qe, Fe] = r(!1), [Ae, Ye] = r(
68
73
  "unlabeled"
69
74
  /* Unlabeled */
70
- ), ne = pl(!0), ae = ["image/jpeg", "image/jpg", "image/png", "image/bmp"], oe = 14 * jl;
71
- A(() => {
72
- m = 0, G = 0, T = 0, _ = 0, le(!1), D && (ne.current = !1, q && q());
73
- }, [D]);
74
- const Re = (t, s) => {
75
+ ), ae = fl(!0), oe = ["image/jpeg", "image/jpg", "image/png", "image/bmp"], E = Ll(h), re = E.maxImageSize;
76
+ T(() => {
77
+ f = 0, G = 0, P = 0, I = 0, te(!1), _ && (ae.current = !1, q && q());
78
+ }, [_]);
79
+ const $e = (t, i) => {
75
80
  var a;
76
81
  if (n === "image") {
77
- ie(!0);
82
+ ne(!0);
78
83
  let o = 0;
79
- if (m = m + 1, G = G + 1, s.length === 0)
84
+ if (f = f + 1, G = G + 1, i.length === 0)
80
85
  return;
81
- let d = 0;
82
- const [...c] = s, C = window.URL || window.webkitURL, b = new Image();
83
- b.src = C.createObjectURL(t), b.onload = () => {
84
- Q.push({
86
+ let m = 0;
87
+ const [...c] = i, b = window.URL || window.webkitURL, y = new Image();
88
+ y.src = b.createObjectURL(t), y.onload = () => {
89
+ Y.push({
85
90
  name: t.name,
86
- src: b.src,
87
- width: b.width,
88
- height: b.height
89
- }), De(Q);
90
- }, s.map((j) => {
91
- const $ = ae.some((L) => L === j.type), B = j.size <= oe;
92
- $ ? B || (o = o + 1, c.splice(c.findIndex((L) => L.name === j.name), 1)) : (d = d + 1, c.splice(c.findIndex((L) => L.name === j.name), 1));
93
- }), c.length > 100 && c.splice(100, c.length), Ve(d), Me(o), G === s.length && (ie(!0), G = 0);
94
- const g = ae.some((j) => j === t.type), V = t.size <= oe;
95
- if (g) {
96
- if (!V)
91
+ src: y.src,
92
+ width: y.width,
93
+ height: y.height
94
+ }), Ie(Y);
95
+ }, i.map((x) => {
96
+ const R = oe.some((L) => L === x.type), j = x.size <= re;
97
+ R ? j || (o = o + 1, c.splice(c.findIndex((L) => L.name === x.name), 1)) : (m = m + 1, c.splice(c.findIndex((L) => L.name === x.name), 1));
98
+ }), c.length > 100 && c.splice(100, c.length), Ze(m), Ge(o), G === i.length && (ne(!0), G = 0);
99
+ const C = oe.some((x) => x === t.type), D = t.size <= re;
100
+ if (C) {
101
+ if (!D)
97
102
  return !1;
98
103
  } else
99
104
  return !1;
100
105
  } else {
101
- if (t.size > 2 * zl)
102
- return R.error(`${t.name}文件总大小不能超过2G`), !1;
106
+ if (t.size > 2 * Al)
107
+ return $.error(`${t.name}文件总大小不能超过2G`), !1;
103
108
  const o = (a = t.name) == null ? void 0 : a.substring(t.name.lastIndexOf("."));
104
109
  if (n === "zip" && o !== ".zip")
105
- return R.error("存在格式不正确的文件,已自动去除"), !1;
106
- Se((d) => d.length >= 1 ? d : [...d, t]);
110
+ return $.error("存在格式不正确的文件,已自动去除"), !1;
111
+ Ee((m) => m.length >= 1 ? m : [...m, t]);
107
112
  }
108
113
  return !1;
109
114
  };
110
- A(() => {
111
- ye !== !1 && (!N && !S && !m || (m = m - _ - N - S, m < 101 ? N > 0 && S > 0 ? (R.error(`${N + S}个文件添加失败,格式、大小或数量不符合要求`), m = m - N - S) : N > 0 && S === 0 ? R.error(`${N}个文件添加失败,格式不符合要求`) : N === 0 && S > 0 ? R.error(`${S}个文件添加失败,单张图片超过14M`) : N === 0 && S === 0 && R.success("校验成功") : N + S === 0 ? (R.error(`${m - 100}个文件添加失败,超过数量限制`), m = 100) : (R.error(`${m - 100 + N + S}个文件添加失败,格式、大小或数量不符合要求`), m = m < 101 ? m : 100), ie(!1)));
112
- }, [ye]);
113
- const He = (t) => {
114
- const s = t.originFileObj;
115
+ T(() => {
116
+ ze !== !1 && (!z && !w && !f || (f = f - I - z - w, f < 101 ? z > 0 && w > 0 ? ($.error(`${z + w}个文件添加失败,格式、大小或数量不符合要求`), f = f - z - w) : z > 0 && w === 0 ? $.error(`${z}个文件添加失败,格式不符合要求`) : z === 0 && w > 0 ? $.error(`${w}个文件添加失败,单张图片超过${E.maxImageSize / _e}M`) : z === 0 && w === 0 && $.success("校验成功") : z + w === 0 ? ($.error(`${f - 100}个文件添加失败,超过数量限制`), f = 100) : ($.error(`${f - 100 + z + w}个文件添加失败,格式、大小或数量不符合要求`), f = f < 101 ? f : 100), ne(!1)));
117
+ }, [ze]);
118
+ const el = (t) => {
119
+ const i = t.originFileObj;
115
120
  return new Promise((a, o) => {
116
- Ze.md5(s, (d, c) => {
117
- d && o(d), Qe(c, s), a(c);
121
+ We.md5(i, (m, c) => {
122
+ m && o(m), tl(c, i), a(c);
118
123
  });
119
124
  });
120
- }, Ie = () => re(void 0, null, function* () {
121
- if (!h)
125
+ }, ll = () => ce(void 0, null, function* () {
126
+ if (!g)
122
127
  return;
123
128
  const t = [];
124
- for (let s = 0; s < h.length; s++) {
125
- const a = h[s], o = yield He(a);
129
+ for (let i = 0; i < g.length; i++) {
130
+ const a = g[i], o = yield el(a);
126
131
  t.push(o);
127
132
  }
128
- !i || t.length === 0 || u == null || u.getDeduplication(t, i).then((s) => {
129
- Ke(s), ve(!1);
133
+ !s || t.length === 0 || p == null || p.getDeduplication(t, s).then((i) => {
134
+ qe(i), Fe(!1);
130
135
  });
131
136
  });
132
- A(() => {
133
- Ie();
134
- }, [h]);
135
- const Qe = (t, s) => {
136
- s.md5 = t, fe.push(s);
137
- }, xe = ({
137
+ T(() => {
138
+ ll();
139
+ }, [g]);
140
+ const tl = (t, i) => {
141
+ i.md5 = t, ge.push(i);
142
+ }, ke = ({
138
143
  fileList: t
139
144
  }) => {
140
145
  if (n === "zip")
141
146
  return;
142
- ve(!0);
143
- const s = t.filter((a) => a.size && a.size <= oe ? ae.some((o) => a.type === o) : !1);
144
- s.splice(100, s.length), s.length < h.length ? (Ne(s), _++) : (T = T - _, _ = 0, T++, T == s.length && Ne(s), T > s.length && (T = s.length));
145
- }, Fe = () => {
146
- n === "zip" && (ne.current = !0), F(!1);
147
- }, Ye = () => {
147
+ Fe(!0);
148
+ const i = t.filter((a) => a.size && a.size <= re ? oe.some((o) => a.type === o) : !1);
149
+ i.splice(100, i.length), i.length < g.length ? (we(i), I++) : (P = P - I, I = 0, P++, P == i.length && we(i), P > i.length && (P = i.length));
150
+ }, Ue = () => {
151
+ n === "zip" && (ae.current = !0), U(!1);
152
+ }, il = () => {
148
153
  if (n === "image") {
149
- if (!P)
154
+ if (!M)
150
155
  return;
151
- let t = 0, s = 0;
152
- if (P.duplicated.length !== 0 && P.duplicated.map((a, o) => {
153
- var C;
154
- const d = P.duplicatedMd5[o], c = ((C = h.find((b) => {
155
- var g;
156
- return ((g = b.originFileObj) == null ? void 0 : g.md5) === d;
157
- })) == null ? void 0 : C.name) || "";
156
+ let t = 0, i = 0;
157
+ if (M.duplicated.length !== 0 && M.duplicated.map((a, o) => {
158
+ var b;
159
+ const m = M.duplicatedMd5[o], c = ((b = g.find((y) => {
160
+ var C;
161
+ return ((C = y.originFileObj) == null ? void 0 : C.md5) === m;
162
+ })) == null ? void 0 : b.name) || "";
158
163
  se.push({
159
164
  labels: [],
160
165
  fileKey: a,
@@ -162,165 +167,170 @@ const Wl = (y) => {
162
167
  name: c
163
168
  }
164
169
  });
165
- }), P.unduplicated.length !== 0) {
166
- const a = P.unduplicated.map((o) => new Promise((d) => {
167
- const c = fe.find((B) => B.md5 === o);
170
+ }), M.unduplicated.length !== 0) {
171
+ const a = M.unduplicated.map((o) => new Promise((m) => {
172
+ const c = ge.find((j) => j.md5 === o);
168
173
  if (!c)
169
- return d();
170
- const C = c.name, b = C.substring(C.indexOf(".")), g = Q.find((B) => B.name === C), V = {
174
+ return m();
175
+ const b = c.name, y = b.substring(b.indexOf(".")), C = Y.find((j) => j.name === b), D = {
171
176
  "Content-Type": "application/octet-stream",
172
- "X-Amz-Meta-Width": g == null ? void 0 : g.width,
173
- "X-Amz-Meta-Height": g == null ? void 0 : g.height
174
- }, j = `dataset/${i}/sample/${o}${kl(b)}`;
177
+ "X-Amz-Meta-Width": C == null ? void 0 : C.width,
178
+ "X-Amz-Meta-Height": C == null ? void 0 : C.height
179
+ }, x = `dataset/${s}/sample/${o}${$l(y)}`;
175
180
  delete c.md5;
176
- const $ = new FileReader();
177
- $.readAsArrayBuffer(c), $.onload = (B) => {
178
- Te({
179
- endPoint: l == null ? void 0 : l.endpoints[0],
180
- useSSL: l == null ? void 0 : l.useSSL,
181
- accessKey: l == null ? void 0 : l.accessKey,
182
- secretKey: l == null ? void 0 : l.secretKey
183
- }), Pe(M, j, B.target.result, V, (L, Bl) => {
184
- J(!0), s += 1, L && (t += 1, _e(t)), Ge(s), be.push({
181
+ const R = new FileReader();
182
+ R.readAsArrayBuffer(c), R.onload = (j) => {
183
+ De({
184
+ endPoint: e == null ? void 0 : e.endpoints[0],
185
+ useSSL: e == null ? void 0 : e.useSSL,
186
+ accessKey: e == null ? void 0 : e.accessKey,
187
+ secretKey: e == null ? void 0 : e.secretKey
188
+ }), Ke(K, x, j.target.result, D, (L, Ml) => {
189
+ X(!0), i += 1, L && (t += 1, Je(t)), Xe(i), Se.push({
185
190
  labels: [],
186
- fileKey: `${M}/${j}`,
191
+ fileKey: `${K}/${x}`,
187
192
  sampleFileName: {
188
- name: C
193
+ name: b
189
194
  }
190
- }), d();
195
+ }), m();
191
196
  });
192
197
  };
193
198
  }));
194
199
  Promise.all(a).then(() => {
195
- !i || !f || setTimeout(() => {
196
- u == null || u.postDatasetsIdVersionsVidSamples(i, f.id, {
197
- samples: be.concat(se)
200
+ !s || !u || setTimeout(() => {
201
+ p == null || p.postDatasetsIdVersionsVidSamples(s, u.id, {
202
+ samples: Se.concat(se)
198
203
  }).then(() => {
199
- u.getDatasetsIdVersionsVid(i, f.id).then((o) => {
200
- Ce(o.samplesCount - f.samplesCount);
201
- }), I(!0), z && z(!1);
204
+ p.getDatasetsIdVersionsVid(s, u.id).then((o) => {
205
+ ye(o.samplesCount - u.samplesCount);
206
+ }), Q(!0), v && v(!1);
202
207
  });
203
208
  }, 100);
204
209
  });
205
210
  } else {
206
- if (!i || !f)
211
+ if (!s || !u)
207
212
  return;
208
- u == null || u.postDatasetsIdVersionsVidSamples(i, f.id, {
213
+ p == null || p.postDatasetsIdVersionsVidSamples(s, u.id, {
209
214
  samples: se
210
215
  }).then(() => {
211
- u.getDatasetsIdVersionsVid(i, f.id).then((a) => {
212
- Ce(a.samplesCount - f.samplesCount);
213
- }), I(!0), z && z(!1);
216
+ p.getDatasetsIdVersionsVid(s, u.id).then((a) => {
217
+ ye(a.samplesCount - u.samplesCount);
218
+ }), Q(!0), v && v(!1);
214
219
  });
215
220
  }
216
221
  } else
217
- el(k);
218
- }, el = (t) => {
219
- !i || !f || t.map((s, a) => {
220
- var b;
222
+ sl(F);
223
+ }, sl = (t) => {
224
+ !s || !u || t.map((i, a) => {
225
+ var y;
221
226
  const o = {
222
227
  "Content-Type": "application/octet-stream"
223
- }, d = {
224
- endPoint: l == null ? void 0 : l.endpoints[0],
225
- useSSL: l == null ? void 0 : l.useSSL,
226
- accessKey: l == null ? void 0 : l.accessKey,
227
- secretKey: l == null ? void 0 : l.secretKey
228
- }, c = (l == null ? void 0 : l.prefix) + ((b = t[0]) == null ? void 0 : b.name), C = new FileReader();
229
- C.readAsArrayBuffer(s), C.onload = (g) => {
230
- Te(d), Pe(l == null ? void 0 : l.bucket, c, g.target.result, o, (V, j) => {
231
- if (V)
232
- console.log(V);
228
+ }, m = {
229
+ endPoint: e == null ? void 0 : e.endpoints[0],
230
+ useSSL: e == null ? void 0 : e.useSSL,
231
+ accessKey: e == null ? void 0 : e.accessKey,
232
+ secretKey: e == null ? void 0 : e.secretKey
233
+ }, c = (e == null ? void 0 : e.prefix) + ((y = t[0]) == null ? void 0 : y.name), b = new FileReader();
234
+ b.readAsArrayBuffer(i), b.onload = (C) => {
235
+ De(m), Ke(e == null ? void 0 : e.bucket, c, C.target.result, o, (D, x) => {
236
+ if (D)
237
+ console.log(D);
233
238
  else {
234
- if (ne.current)
239
+ if (ae.current)
235
240
  return;
236
- J(!0), u == null || u.postUploadPicsZip(i, f.id, Ae({
237
- zipUrls: [(l == null ? void 0 : l.bucket) + "/" + c]
238
- }, Z === "ocr" && {
239
- type: v === "labeled" ? 1 : 0
240
- })).then(($) => {
241
- ll($), Je($);
241
+ X(!0), h === "vlm" ? p == null || p.postVlmUploadPicsZip(s, u.id, {
242
+ zipUrl: (e == null ? void 0 : e.bucket) + "/" + c,
243
+ type: B === "labeled" ? 2 : 1
244
+ }).then((R) => {
245
+ je(R), Be(R);
246
+ }) : p == null || p.postUploadPicsZip(s, u.id, Ve({
247
+ zipUrls: [(e == null ? void 0 : e.bucket) + "/" + c]
248
+ }, (h === "ocr" || h === "vlm") && {
249
+ type: B === "labeled" ? 1 : 0
250
+ })).then((R) => {
251
+ je(R), Be(R);
242
252
  });
243
253
  }
244
254
  });
245
255
  };
246
256
  });
247
- }, ll = (t) => re(void 0, null, function* () {
248
- var s;
249
- if (!(!i || !f || !u))
257
+ }, je = (t) => ce(void 0, null, function* () {
258
+ var i;
259
+ if (!(!s || !u || !p))
250
260
  try {
251
- const a = yield u.checkFileResult(i, f.id, {
261
+ const a = yield p.checkFileResult(s, u.id, {
252
262
  taskId: t
253
- }, 5e3, (o) => {
254
- ze(o);
263
+ }, 5e3, h, (o) => {
264
+ ve(o);
255
265
  });
256
- a && qe(JSON.parse(a));
266
+ a && He(JSON.parse(a));
257
267
  } catch (a) {
258
- if (((s = a.cause) == null ? void 0 : s.code) === -101) {
259
- ke(!0);
268
+ if (((i = a.cause) == null ? void 0 : i.code) === -101) {
269
+ Re(!0);
260
270
  return;
261
271
  }
262
272
  }
263
273
  });
264
- A(() => {
265
- E && (ze(100), ee(!0));
266
- }, [E]), A(() => {
267
- te !== 0 && (I(!1), z && z(!0));
268
- }, [te]), A(() => {
269
- W !== -1 && (ee(!0), le(!1));
270
- }, [W]);
271
- const tl = () => {
272
- $e(), ee(!1), ue && ue();
273
- }, $e = () => {
274
- w(), J(!1), F(!1), pe && pe(), q && q();
275
- }, sl = /* @__PURE__ */ p("div", {
276
- children: [/* @__PURE__ */ e(bl, {}), /* @__PURE__ */ e("div", {
274
+ T(() => {
275
+ A && (ve(100), le(!0));
276
+ }, [A]), T(() => {
277
+ ie !== 0 && (Q(!1), v && v(!0));
278
+ }, [ie]), T(() => {
279
+ J !== -1 && (le(!0), te(!1));
280
+ }, [J]);
281
+ const nl = () => {
282
+ Le(), le(!1), ue && ue();
283
+ }, Le = () => {
284
+ N(), X(!1), U(!1), me && me(), q && q();
285
+ }, al = /* @__PURE__ */ d("div", {
286
+ children: [/* @__PURE__ */ l(El, {}), /* @__PURE__ */ l("div", {
277
287
  style: {
278
288
  marginTop: 8
279
289
  },
280
290
  children: "添加图片"
281
291
  })]
282
- }), il = (t) => {
283
- const s = k.filter((a) => a.uid !== t.uid);
284
- Se(s);
285
- }, nl = () => {
286
- v === "labeled" ? window.location.href = `${me}/%E6%A0%87%E6%B3%A8%E6%A0%BC%E5%BC%8F%E7%A4%BA%E4%BE%8B.zip` : window.location.href = `${me}/%E7%A4%BA%E4%BE%8B%E5%8E%8B%E7%BC%A9%E5%8C%85.zip`;
287
- }, al = () => {
288
- w(), ke(!1), J(!1), F(!1);
292
+ }), ol = (t) => {
293
+ const i = F.filter((a) => a.uid !== t.uid);
294
+ Ee(i);
295
+ }, rl = () => {
296
+ B === "labeled" ? h === "vlm" ? window.location.href = `${he}/%E6%9C%89%E6%A0%87%E6%B3%A8%E7%A4%BA%E4%BE%8B.zip` : window.location.href = `${fe}/%E6%A0%87%E6%B3%A8%E6%A0%BC%E5%BC%8F%E7%A4%BA%E4%BE%8B.zip` : h === "vlm" ? window.location.href = `${he}/%E6%97%A0%E6%A0%87%E6%B3%A8%E7%A4%BA%E4%BE%8B.zip` : window.location.href = `${fe}/%E7%A4%BA%E4%BE%8B%E5%8E%8B%E7%BC%A9%E5%8C%85.zip`;
297
+ }, cl = () => {
298
+ N(), Re(!1), X(!1), U(!1);
289
299
  };
290
- return A(() => {
291
- Ee === "labeled" && X.setFieldsValue({
292
- labelFormat: "json",
300
+ return T(() => {
301
+ Ae === "labeled" && W.setFieldsValue({
302
+ labelFormat: E.labelFormat || "json",
293
303
  acceptType: "zip"
294
304
  /* Zip */
295
305
  });
296
- }, [Ee]), /* @__PURE__ */ p(ce, {
297
- children: [/* @__PURE__ */ e(H, {
306
+ }, [Ae, E.labelFormat]), /* @__PURE__ */ d(de, {
307
+ children: [/* @__PURE__ */ l(H, {
298
308
  className: "upload-pics",
299
309
  width: 600,
300
310
  title: "导入数据",
301
- open: D,
311
+ open: _,
302
312
  destroyOnClose: !0,
303
- onCancel: () => Fe(),
313
+ onCancel: () => Ue(),
304
314
  maskClosable: !1,
305
315
  centered: !0,
306
- footer: [/* @__PURE__ */ e(O, {
307
- onClick: Fe,
316
+ footer: [/* @__PURE__ */ l(V, {
317
+ onClick: Ue,
308
318
  children: "取消"
309
- }, "cancel"), /* @__PURE__ */ e(O, {
319
+ }, "cancel"), /* @__PURE__ */ l(V, {
310
320
  type: "primary",
311
321
  htmlType: "submit",
312
322
  form: "importModal",
313
- disabled: n === "image" && !h.length || n === "zip" && !k.length || Y && we == 0 || We,
314
- loading: K == !0,
323
+ disabled: n === "image" && !g.length || n === "zip" && !F.length || ee && Ne == 0 || Qe,
324
+ loading: Z == !0,
315
325
  onClick: () => {
316
- Ye(), le(!0);
326
+ il(), te(!0);
317
327
  },
318
328
  children: "导入"
319
329
  }, "confirm")],
320
- children: /* @__PURE__ */ p(U, {
330
+ children: /* @__PURE__ */ d(O, {
321
331
  className: "file-form",
322
332
  preserve: !1,
323
- form: X,
333
+ form: W,
324
334
  initialValues: {
325
335
  acceptType: "image",
326
336
  labelState: "unlabeled"
@@ -333,245 +343,251 @@ const Wl = (y) => {
333
343
  width: 110
334
344
  }
335
345
  },
336
- children: [Z === "ocr" && /* @__PURE__ */ e(U.Item, {
346
+ children: [(h === "ocr" || h === "vlm") && /* @__PURE__ */ l(O.Item, {
337
347
  label: "数据标注状态",
338
348
  name: "labelState",
339
349
  rules: [{
340
350
  required: !0,
341
351
  message: "请选择数据标注状态"
342
352
  }],
343
- children: /* @__PURE__ */ p(x.Group, {
344
- disabled: K,
353
+ children: /* @__PURE__ */ d(k.Group, {
354
+ disabled: Z,
345
355
  onChange: (t) => {
346
- Xe(t.target.value);
356
+ Ye(t.target.value);
347
357
  },
348
- children: [/* @__PURE__ */ e(x, {
358
+ children: [/* @__PURE__ */ l(k, {
349
359
  value: "unlabeled",
350
360
  children: "无标注信息"
351
- }), /* @__PURE__ */ e(x, {
361
+ }), /* @__PURE__ */ d(k, {
352
362
  value: "labeled",
353
- children: "有标注信息"
363
+ children: ["有标注信息", h === "vlm" && /* @__PURE__ */ l(hl, {
364
+ title: "支持上传带OCR标注信息的数据",
365
+ children: /* @__PURE__ */ l(yl, {
366
+ style: {
367
+ cursor: "pointer",
368
+ marginLeft: 4,
369
+ marginTop: 2
370
+ }
371
+ })
372
+ })]
354
373
  })]
355
374
  })
356
- }), v === "labeled" && /* @__PURE__ */ e(U.Item, {
375
+ }), B === "labeled" && /* @__PURE__ */ l(O.Item, {
357
376
  label: "标注格式",
358
377
  name: "labelFormat",
359
378
  rules: [{
360
379
  required: !0,
361
380
  message: "请选择标注格式"
362
381
  }],
363
- children: /* @__PURE__ */ e(x.Group, {
364
- disabled: K,
365
- children: /* @__PURE__ */ e(x, {
366
- value: "json",
367
- children: "json"
382
+ children: /* @__PURE__ */ l(k.Group, {
383
+ disabled: Z,
384
+ children: /* @__PURE__ */ l(k, {
385
+ value: E.labelFormat || "json",
386
+ children: E.labelFormat || "json"
368
387
  })
369
388
  })
370
- }), /* @__PURE__ */ e(U.Item, {
389
+ }), /* @__PURE__ */ l(O.Item, {
371
390
  label: "导入方式",
372
391
  name: "acceptType",
373
392
  rules: [{
374
393
  required: !0,
375
394
  message: "请选择导入方式"
376
395
  }],
377
- children: /* @__PURE__ */ p(x.Group, {
378
- disabled: K,
379
- children: [v !== "labeled" && /* @__PURE__ */ e(x.Button, {
396
+ children: /* @__PURE__ */ d(k.Group, {
397
+ disabled: Z,
398
+ children: [B !== "labeled" && /* @__PURE__ */ l(k.Button, {
380
399
  value: "image",
381
400
  children: "上传图片"
382
- }), /* @__PURE__ */ e(x.Button, {
401
+ }), /* @__PURE__ */ l(k.Button, {
383
402
  value: "zip",
384
403
  children: "上传压缩包"
385
404
  })]
386
405
  })
387
- }), /* @__PURE__ */ p("div", {
406
+ }), /* @__PURE__ */ d("div", {
388
407
  className: "file-upload",
389
- children: [(n === "image" && !h.length || n === "zip") && /* @__PURE__ */ p(Nl, {
408
+ children: [(n === "image" && !g.length || n === "zip") && /* @__PURE__ */ d(vl, {
390
409
  name: "file",
391
410
  showUploadList: !1,
392
411
  multiple: !0,
393
- beforeUpload: Re,
412
+ beforeUpload: $e,
394
413
  accept: n === "zip" ? ".zip" : "image/png, image/jpeg, image/jpg, image/bmp",
395
414
  maxCount: n === "zip" ? 1 : void 0,
396
- onChange: xe,
397
- disabled: n === "zip" ? k.length === 1 : !1,
398
- children: [/* @__PURE__ */ e("span", {
415
+ onChange: ke,
416
+ disabled: n === "zip" ? F.length === 1 : !1,
417
+ children: [/* @__PURE__ */ l("span", {
399
418
  className: "file-upload-icon",
400
- children: /* @__PURE__ */ e(hl, {})
401
- }), /* @__PURE__ */ p(Ue, {
419
+ children: /* @__PURE__ */ l(Sl, {})
420
+ }), /* @__PURE__ */ d(Pe, {
402
421
  className: "file-upload-action",
403
- children: [n === "image" && "拖拽图片至此,或者", n === "zip" && "拖拽包含“图片”的压缩包至此,或者", /* @__PURE__ */ e(O, {
422
+ children: [n === "image" && "拖拽图片至此,或者", n === "zip" && "拖拽包含“图片”的压缩包至此,或者", /* @__PURE__ */ l(V, {
404
423
  type: "link",
405
424
  style: {
406
425
  padding: 0
407
426
  },
408
- disabled: n === "zip" ? k.length === 1 : !1,
427
+ disabled: n === "zip" ? F.length === 1 : !1,
409
428
  children: n === "image" ? "上传图片" : "上传压缩包"
410
429
  })]
411
- }), n === "image" && /* @__PURE__ */ p("div", {
430
+ }), n === "image" && /* @__PURE__ */ d("div", {
412
431
  className: "file-upload-desc",
413
432
  style: {
414
433
  width: 350
415
434
  },
416
- children: [/* @__PURE__ */ e("div", {
435
+ children: [/* @__PURE__ */ d("div", {
417
436
  className: "item-upload-desc item-upload-desc__1",
418
- children: "1. 支持jpg、png 、jpeg 、bmp格式,单张图片不超过14M;"
419
- }), /* @__PURE__ */ e("div", {
437
+ children: ["1. 支持jpg、png 、jpeg 、bmp格式,单张图片不超过", E.maxImageSize / _e, "M;"]
438
+ }), /* @__PURE__ */ l("div", {
420
439
  className: "item-upload-desc",
421
440
  children: "2. 单次上传最多可选择100个文件。"
422
441
  })]
423
- }), n === "zip" && /* @__PURE__ */ p("div", {
442
+ }), n === "zip" && /* @__PURE__ */ d("div", {
424
443
  className: "file-upload-desc",
425
444
  style: {
426
445
  width: 350
427
446
  },
428
- children: [/* @__PURE__ */ e("div", {
447
+ children: [/* @__PURE__ */ l("div", {
429
448
  className: "item-upload-desc item-upload-desc__1",
430
449
  children: "1. 仅支持.zip格式,单个压缩包不超过2G;"
431
- }), v === "labeled" ? /* @__PURE__ */ p(ce, {
432
- children: [/* @__PURE__ */ e("div", {
433
- className: "item-upload-desc",
434
- children: "2. 压缩包内每张图片(jpg、png 、jpeg 、bmp格式)需要对应一个json文件,名称需一致,位置处在一级目录下;"
435
- }), /* @__PURE__ */ e("div", {
450
+ }), B === "labeled" ? /* @__PURE__ */ l(de, {
451
+ children: E.zipUploadTexts.labeled.description.map((t, i) => /* @__PURE__ */ d("div", {
436
452
  className: "item-upload-desc",
437
- children: "3. json文件需包含标签、4点坐标,格式可参考样例。"
438
- })]
439
- }) : /* @__PURE__ */ e("div", {
453
+ children: [i + 2, ". ", t]
454
+ }, i))
455
+ }) : /* @__PURE__ */ d("div", {
440
456
  className: "item-upload-desc",
441
- children: "2. 压缩包内图片格式要求为:图片类型为jpg/png/bmp/jpeg,单张图片不超过14M;"
442
- }), /* @__PURE__ */ p("div", {
457
+ children: ["2. ", E.zipUploadTexts.unlabeled.description[0]]
458
+ }), /* @__PURE__ */ d("div", {
443
459
  className: "item-upload-desc",
444
- children: [v === "labeled" ? 4 : 3, ". 单次仅可上传1个文件。"]
460
+ children: [B === "labeled" ? E.zipUploadTexts.labeled.description.length + 2 : 3, ". 单次仅可上传1个文件。"]
445
461
  })]
446
462
  })]
447
- }), n === "image" && h.length ? /* @__PURE__ */ e("div", {
463
+ }), n === "image" && g.length ? /* @__PURE__ */ l("div", {
448
464
  className: "picture-upload",
449
- children: /* @__PURE__ */ e(ul, {
465
+ children: /* @__PURE__ */ l(gl, {
450
466
  listType: "picture-card",
451
- fileList: h,
467
+ fileList: g,
452
468
  multiple: !0,
453
469
  showUploadList: {
454
470
  showPreviewIcon: !1
455
471
  },
456
- beforeUpload: Re,
472
+ beforeUpload: $e,
457
473
  accept: "image/png, image/jpeg, image/jpg, image/bmp",
458
- onChange: xe,
459
- children: h.length < 100 ? sl : null
474
+ onChange: ke,
475
+ children: g.length < 100 ? al : null
460
476
  })
461
- }) : /* @__PURE__ */ e(ce, {}), n === "zip" && /* @__PURE__ */ p("div", {
477
+ }) : /* @__PURE__ */ l(de, {}), n === "zip" && /* @__PURE__ */ d("div", {
462
478
  className: "upload-wrapper",
463
- children: [k != null && k.length ? /* @__PURE__ */ e("div", {
479
+ children: [F != null && F.length ? /* @__PURE__ */ l("div", {
464
480
  className: "upload-main",
465
- children: /* @__PURE__ */ e(de, {
481
+ children: /* @__PURE__ */ l(pe, {
466
482
  gutter: [24, 8],
467
483
  className: "upload-pannel",
468
- children: k.map((t) => /* @__PURE__ */ e(ml, {
484
+ children: F.map((t) => /* @__PURE__ */ l(Cl, {
469
485
  span: 24,
470
486
  className: "upload-item",
471
- children: /* @__PURE__ */ p(de, {
487
+ children: /* @__PURE__ */ d(pe, {
472
488
  justify: "space-between",
473
489
  align: "middle",
474
- children: [/* @__PURE__ */ p(de, {
490
+ children: [/* @__PURE__ */ d(pe, {
475
491
  align: "middle",
476
- children: [/* @__PURE__ */ e("span", {
492
+ children: [/* @__PURE__ */ l("span", {
477
493
  className: "upload-item-file-icon",
478
- children: /* @__PURE__ */ e(gl, {})
479
- }), /* @__PURE__ */ e("span", {
494
+ children: /* @__PURE__ */ l(zl, {})
495
+ }), /* @__PURE__ */ l("span", {
480
496
  className: "upload-item-name",
481
497
  children: t.name
482
498
  })]
483
- }), /* @__PURE__ */ e(O, {
499
+ }), /* @__PURE__ */ l(V, {
484
500
  className: "upload-item-upload-delete",
485
501
  type: "link",
486
- disabled: K,
487
- onClick: () => il(t),
488
- children: /* @__PURE__ */ e(Cl, {})
502
+ disabled: Z,
503
+ onClick: () => ol(t),
504
+ children: /* @__PURE__ */ l(wl, {})
489
505
  })]
490
506
  })
491
507
  }, t.uid))
492
508
  })
493
- }) : null, n === "zip" && /* @__PURE__ */ p("div", {
509
+ }) : null, n === "zip" && /* @__PURE__ */ d("div", {
494
510
  className: "upload-example",
495
- children: [/* @__PURE__ */ e("div", {
511
+ children: [/* @__PURE__ */ l("div", {
496
512
  className: "upload-example-header",
497
- children: /* @__PURE__ */ p(Ue, {
498
- children: [/* @__PURE__ */ e("span", {
513
+ children: /* @__PURE__ */ d(Pe, {
514
+ children: [/* @__PURE__ */ l("span", {
499
515
  children: "数据示例:"
500
- }), /* @__PURE__ */ e(O, {
516
+ }), /* @__PURE__ */ l(V, {
501
517
  size: "small",
502
518
  type: "link",
503
519
  style: {
504
520
  padding: 0
505
521
  },
506
522
  onClick: (t) => {
507
- t.stopPropagation(), nl();
523
+ t.stopPropagation(), rl();
508
524
  },
509
525
  children: "下载示例 >"
510
526
  })]
511
527
  })
512
- }), /* @__PURE__ */ e("div", {
528
+ }), /* @__PURE__ */ l("div", {
513
529
  className: "upload-example-main",
514
- children: /* @__PURE__ */ e("img", {
515
- src: v === "labeled" ? wl : Sl
530
+ children: /* @__PURE__ */ l("img", {
531
+ src: B === "labeled" ? h === "vlm" ? Bl : Rl : h === "vlm" ? Fl : xl
516
532
  })
517
533
  })]
518
534
  })]
519
535
  })]
520
536
  })]
521
537
  })
522
- }), Y && /* @__PURE__ */ e(H, {
538
+ }), ee && /* @__PURE__ */ l(H, {
523
539
  className: "uploading-modal",
524
540
  width: 404,
525
541
  title: null,
526
- open: Y,
542
+ open: ee,
527
543
  maskClosable: !1,
528
544
  closable: n !== "image",
529
545
  onCancel: () => {
530
- $e();
546
+ Le();
531
547
  },
532
548
  footer: null,
533
- children: /* @__PURE__ */ e("div", {
549
+ children: /* @__PURE__ */ l("div", {
534
550
  className: "upload-spin",
535
- children: /* @__PURE__ */ e(fl, {
536
- tip: n === "image" ? `数据导入中(${te}/${h.length}),请耐心等待` : `处理中(${we}/100%),请耐心等待`,
551
+ children: /* @__PURE__ */ l(bl, {
552
+ tip: n === "image" ? `数据导入中(${ie}/${g.length}),请耐心等待` : `处理中(${Ne}/100%),请耐心等待`,
537
553
  size: "large",
538
- children: /* @__PURE__ */ e("div", {
554
+ children: /* @__PURE__ */ l("div", {
539
555
  className: "content"
540
556
  })
541
557
  })
542
558
  })
543
- }), he && /* @__PURE__ */ e(H, {
559
+ }), Ce && /* @__PURE__ */ l(H, {
544
560
  className: "result",
545
561
  width: 424,
546
562
  title: null,
547
- open: he,
563
+ open: Ce,
548
564
  closable: !1,
549
565
  footer: null,
550
- children: /* @__PURE__ */ e("div", {
566
+ children: /* @__PURE__ */ l("div", {
551
567
  className: "upload-result",
552
- children: /* @__PURE__ */ e(Oe, {
568
+ children: /* @__PURE__ */ l(Me, {
553
569
  status: "success",
554
- title: n === "image" ? `数据导入完成,成功${W}个,失败${ge}个,去重${h.length - W - ge}个` : E && `数据导入完成,格式不符合的图片${E.formatErrorCount || 0}个,成功${E.successCount || 0}个,去重${E.repeatCount || 0}个,失败${E.failedCount || 0}个` + (v === "labeled" ? `(Json格式不符合${E.labelErrorCount}个)` : ""),
555
- extra: [/* @__PURE__ */ e(O, {
556
- onClick: tl,
570
+ title: n === "image" ? `数据导入完成,成功${J}个,失败${be}个,去重${g.length - J - be}个` : A && `数据导入完成,格式不符合的图片${A.formatErrorCount || 0}个,成功${A.successCount || 0}个,去重${A.repeatCount || 0}个,失败${A.failedCount || 0}个` + (B === "labeled" ? `(${(E.labelFormat || "json").toUpperCase()}格式不符合${A.labelErrorCount}个)` : ""),
571
+ extra: [/* @__PURE__ */ l(V, {
572
+ onClick: nl,
557
573
  children: "关闭"
558
574
  }, "close")]
559
575
  })
560
576
  })
561
- }), je && /* @__PURE__ */ e(H, {
577
+ }), xe && /* @__PURE__ */ l(H, {
562
578
  className: "result",
563
579
  width: 424,
564
580
  title: null,
565
- open: je,
581
+ open: xe,
566
582
  closable: !1,
567
583
  footer: null,
568
- children: /* @__PURE__ */ e("div", {
584
+ children: /* @__PURE__ */ l("div", {
569
585
  className: "upload-result",
570
- children: /* @__PURE__ */ e(Oe, {
586
+ children: /* @__PURE__ */ l(Me, {
571
587
  status: "error",
572
588
  title: "文件处理失败",
573
- extra: [/* @__PURE__ */ e(O, {
574
- onClick: al,
589
+ extra: [/* @__PURE__ */ l(V, {
590
+ onClick: cl,
575
591
  children: "关闭"
576
592
  }, "close")]
577
593
  })
@@ -580,5 +596,5 @@ const Wl = (y) => {
580
596
  });
581
597
  };
582
598
  export {
583
- Wl as default
599
+ nt as default
584
600
  };