@glodon-aiot/dataset-annotation 3.10.0-alpha.11 → 3.10.0-alpha.14

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