@glodon-aiot/dataset-annotation 3.19.0-alpha.27 → 3.19.0-beta.31

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