@glodon-aiot/dataset-annotation 3.19.1 → 3.19.2-alpha.1

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,83 +1,83 @@
1
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) => {
2
+ var Pe = Object.getOwnPropertySymbols;
3
+ var Bl = Object.prototype.hasOwnProperty, yl = 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, _e = (A, l) => {
5
5
  for (var s in l || (l = {}))
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]);
6
+ Bl.call(l, s) && Ze(A, s, l[s]);
7
+ if (Pe)
8
+ for (var s of Pe(l))
9
+ yl.call(l, s) && Ze(A, s, l[s]);
10
10
  return A;
11
11
  };
12
- var ge = (A, l, s) => new Promise((g, M) => {
13
- var Z = (S) => {
12
+ var ge = (A, l, s) => new Promise((g, Z) => {
13
+ var _ = (S) => {
14
14
  try {
15
- K(s.next(S));
16
- } catch (O) {
17
- M(O);
15
+ U(s.next(S));
16
+ } catch (D) {
17
+ Z(D);
18
18
  }
19
19
  }, c = (S) => {
20
20
  try {
21
- K(s.throw(S));
22
- } catch (O) {
23
- M(O);
21
+ U(s.throw(S));
22
+ } catch (D) {
23
+ Z(D);
24
24
  }
25
- }, K = (S) => S.done ? g(S.value) : Promise.resolve(S.value).then(Z, c);
26
- K((s = s.apply(A, l)).next());
25
+ }, U = (S) => S.done ? g(S.value) : Promise.resolve(S.value).then(_, c);
26
+ U((s = s.apply(A, l)).next());
27
27
  });
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";
28
+ import { jsxs as d, Fragment as Q, jsx as e } from "react/jsx-runtime";
29
+ import { useContext as Al, useState as p, useRef as Sl, useEffect as V } from "react";
30
+ import { Form as L, message as T, Modal as H, Button as R, Radio as N, Tooltip as vl, Space as Ke, Upload as Ie, Row as be, Col as Fl, Spin as Nl, Result as Ge } from "antd";
31
31
  import "./style.less.mjs";
32
32
  import { InfoCircleOutlined as $l, CloudUploadOutlined as xl, PaperClipOutlined as jl, DeleteOutlined as kl, PlusOutlined as Ll } from "@ant-design/icons";
33
33
  import Tl from "browser-md5-file";
34
34
  import { initMinio as qe, putObjectBuffer as We } from "@glodon-aiot/minio";
35
35
  import Ul from "./pic_zip.svg.mjs";
36
- import Rl from "./pic_zip_json.svg.mjs";
37
- import Vl from "./pic_vlm_json_zip.svg.mjs";
36
+ import Vl from "./pic_zip_json.svg.mjs";
37
+ import Rl from "./pic_vlm_json_zip.svg.mjs";
38
38
  import Ol from "./pic_vlm_zip.svg.mjs";
39
- import Pl from "./pic_vlm_dwg_zip.svg.mjs";
39
+ import Dl from "./pic_vlm_dwg_zip.svg.mjs";
40
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";
41
+ import { fileSuffixToLowerCase as Ml } from "../../utils/index.mjs";
42
+ import Pl from "../../DatasetContext/index.mjs";
43
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) => {
44
+ import { getImportConfig as _l } from "./config.mjs";
45
+ let C = 0, G = 0, O = 0, q = 0;
46
+ const mt = (A) => {
47
47
  const {
48
48
  datasetIam: l,
49
49
  datasetId: s,
50
50
  currentVersion: g,
51
- tenCode: M,
52
- isVisible: Z,
51
+ tenCode: Z,
52
+ isVisible: _,
53
53
  markType: c,
54
- vlmMarkTmpl: K,
54
+ vlmMarkTmpl: U,
55
55
  setIsVisible: S,
56
- getVersionListRequest: O,
57
- onUploadStatusChange: P,
56
+ getVersionListRequest: D,
57
+ onUploadStatusChange: M,
58
58
  setIsConfirm: Y,
59
59
  tableReload: Ce,
60
60
  loadVersionData: W,
61
61
  actionAfterFinish: Ee,
62
- vlmDwgImport: He = !1
62
+ vlmDwgImport: Qe = !1
63
63
  } = A, {
64
64
  services: {
65
- cvforceDatahub: u
65
+ cvforceDatahub: m
66
66
  },
67
67
  featuresConfig: {
68
68
  exampleSrcRoot: we
69
69
  } = {
70
70
  exampleSrcRoot: Zl
71
71
  }
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
+ } = Al(Pl), [v, He] = p(0), [F, Ye] = p(0), [ee, el] = p([]), [P, ll] = p(), [ze, Kl] = p([]), [le, J] = p(!1), [Be, te] = p(!1), [K, ie] = p(!1), [se, tl] = p(0), [il, sl] = p(0), [ne, ye] = 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), [B, 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(
73
73
  "unlabeled"
74
74
  /* Unlabeled */
75
- ), ue = Sl(!0), {
75
+ ), me = Sl(!0), {
76
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());
80
- }, [Z]);
77
+ } = Ie, u = _l(c, re, U), ue = u.imageMimeTypes, Le = u.imageAccept, fe = u.maxImageSize;
78
+ V(() => {
79
+ C = 0, G = 0, O = 0, q = 0, ie(!1), _ && (me.current = !1, W && W());
80
+ }, [_]);
81
81
  const Te = (i, t) => {
82
82
  var a;
83
83
  if (r === "image") {
@@ -95,17 +95,17 @@ const ut = (A) => {
95
95
  height: E.height
96
96
  }), el(ee);
97
97
  }, t.map((w) => {
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;
98
+ const z = ue.some((y) => y === w.type), k = w.size <= fe;
99
+ z ? k || (o = o + 1, n.splice(n.findIndex((y) => y.name === w.name), 1)) : (f = f + 1, n.splice(n.findIndex((y) => y.name === w.name), 1));
100
+ }), n.length > 100 && n.splice(100, n.length), He(f), Ye(o), G === t.length && (oe(!0), G = 0);
101
+ const h = ue.some((w) => w === i.type), j = i.size <= fe;
102
102
  if (h) {
103
103
  if (!j)
104
104
  return !1;
105
105
  } else
106
106
  return !1;
107
107
  } else {
108
- const o = m.maxZipSize;
108
+ const o = u.maxZipSize;
109
109
  if (i.size > o)
110
110
  return T.error(`${i.name}文件总大小不能超过${o / Xe}G`), !1;
111
111
  const f = (a = i.name) == null ? void 0 : a.substring(i.name.lastIndexOf("."));
@@ -115,32 +115,32 @@ const ut = (A) => {
115
115
  }
116
116
  return !1;
117
117
  };
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)));
118
+ V(() => {
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}个文件添加失败,单张图片超过${u.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
120
  }, [Se]);
121
121
  const dl = (i) => {
122
122
  const t = i.originFileObj;
123
123
  return new Promise((a, o) => {
124
124
  nl.md5(t, (f, n) => {
125
- f && o(f), ul(n, t), a(n);
125
+ f && o(f), ml(n, t), a(n);
126
126
  });
127
127
  });
128
128
  }, pl = () => ge(void 0, null, function* () {
129
- if (!y)
129
+ if (!B)
130
130
  return;
131
131
  const i = [];
132
- for (let t = 0; t < y.length; t++) {
133
- const a = y[t], o = yield dl(a);
132
+ for (let t = 0; t < B.length; t++) {
133
+ const a = B[t], o = yield dl(a);
134
134
  i.push(o);
135
135
  }
136
- !s || i.length === 0 || u == null || u.getDeduplication(i, s).then((t) => {
136
+ !s || i.length === 0 || m == null || m.getDeduplication(i, s).then((t) => {
137
137
  ll(t), je(!1);
138
138
  });
139
139
  });
140
- U(() => {
140
+ V(() => {
141
141
  pl();
142
- }, [y]);
143
- const ul = (i, t) => {
142
+ }, [B]);
143
+ const ml = (i, t) => {
144
144
  t.md5 = i, ze.push(t);
145
145
  }, Ue = ({
146
146
  fileList: i
@@ -148,18 +148,18 @@ const ut = (A) => {
148
148
  if (r === "zip")
149
149
  return;
150
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 = () => {
151
+ const t = i.filter((a) => a.size && a.size <= fe ? ue.some((o) => a.type === o) : !1);
152
+ t.splice(100, t.length), t.length < B.length ? (ce(t), q++) : (O = O - q, q = 0, O++, O == t.length && ce(t), O > t.length && (O = t.length));
153
+ }, Ve = () => {
154
+ r === "zip" && (me.current = !0), S(!1);
155
+ }, ul = () => {
156
156
  if (r === "image") {
157
- if (!D)
157
+ if (!P)
158
158
  return;
159
159
  let i = 0, t = 0;
160
- if (D.duplicated.length !== 0 && D.duplicated.map((a, o) => {
160
+ if (P.duplicated.length !== 0 && P.duplicated.map((a, o) => {
161
161
  var b;
162
- const f = D.duplicatedMd5[o], n = ((b = y.find((E) => {
162
+ const f = P.duplicatedMd5[o], n = ((b = B.find((E) => {
163
163
  var h;
164
164
  return ((h = E.originFileObj) == null ? void 0 : h.md5) === f;
165
165
  })) == null ? void 0 : b.name) || "";
@@ -170,8 +170,8 @@ const ut = (A) => {
170
170
  name: n
171
171
  }
172
172
  });
173
- }), D.unduplicated.length !== 0) {
174
- const a = D.unduplicated.map((o) => new Promise((f) => {
173
+ }), P.unduplicated.length !== 0) {
174
+ const a = P.unduplicated.map((o) => new Promise((f) => {
175
175
  const n = ze.find((k) => k.md5 === o);
176
176
  if (!n)
177
177
  return f();
@@ -179,7 +179,7 @@ const ut = (A) => {
179
179
  "Content-Type": "application/octet-stream",
180
180
  "X-Amz-Meta-Width": h == null ? void 0 : h.width,
181
181
  "X-Amz-Meta-Height": h == null ? void 0 : h.height
182
- }, w = `dataset/${s}/sample/${o}${Dl(E)}`;
182
+ }, w = `dataset/${s}/sample/${o}${Ml(E)}`;
183
183
  delete n.md5;
184
184
  const z = new FileReader();
185
185
  z.readAsArrayBuffer(n), z.onload = (k) => {
@@ -188,10 +188,10 @@ const ut = (A) => {
188
188
  useSSL: l == null ? void 0 : l.useSSL,
189
189
  accessKey: l == null ? void 0 : l.accessKey,
190
190
  secretKey: l == null ? void 0 : l.secretKey
191
- }), We(M, w, k.target.result, j, (B, X) => {
192
- J(!0), t += 1, B && (i += 1, sl(i)), tl(t), Ae.push({
191
+ }), We(Z, w, k.target.result, j, (y, X) => {
192
+ J(!0), t += 1, y && (i += 1, sl(i)), tl(t), Ae.push({
193
193
  labels: [],
194
- fileKey: `${M}/${w}`,
194
+ fileKey: `${Z}/${w}`,
195
195
  sampleFileName: {
196
196
  name: b
197
197
  }
@@ -201,24 +201,24 @@ const ut = (A) => {
201
201
  }));
202
202
  Promise.all(a).then(() => {
203
203
  !s || !g || setTimeout(() => {
204
- u == null || u.postDatasetsIdVersionsVidSamples(s, g.id, {
204
+ m == null || m.postDatasetsIdVersionsVidSamples(s, g.id, {
205
205
  samples: Ae.concat(ae)
206
206
  }).then(() => {
207
- u.getDatasetsIdVersionsVid(s, g.id).then((o) => {
208
- Be(o.samplesCount - g.samplesCount);
209
- }), Y(!0), P && P(!1);
207
+ m.getDatasetsIdVersionsVid(s, g.id).then((o) => {
208
+ ye(o.samplesCount - g.samplesCount);
209
+ }), Y(!0), M && M(!1);
210
210
  });
211
211
  }, 100);
212
212
  });
213
213
  } else {
214
214
  if (!s || !g)
215
215
  return;
216
- u == null || u.postDatasetsIdVersionsVidSamples(s, g.id, {
216
+ m == null || m.postDatasetsIdVersionsVidSamples(s, g.id, {
217
217
  samples: ae
218
218
  }).then(() => {
219
- u.getDatasetsIdVersionsVid(s, g.id).then((a) => {
220
- Be(a.samplesCount - g.samplesCount);
221
- }), Y(!0), P && P(!1);
219
+ m.getDatasetsIdVersionsVid(s, g.id).then((a) => {
220
+ ye(a.samplesCount - g.samplesCount);
221
+ }), Y(!0), M && M(!1);
222
222
  });
223
223
  }
224
224
  } else
@@ -239,29 +239,29 @@ const ut = (A) => {
239
239
  if (j)
240
240
  console.log(j);
241
241
  else {
242
- if (ue.current)
242
+ if (me.current)
243
243
  return;
244
- J(!0), c === "vlm" ? u == null || u.postVlmUploadPicsZip(s, g.id, {
244
+ J(!0), c === "vlm" ? m == null || m.postVlmUploadPicsZip(s, g.id, {
245
245
  zipUrl: (l == null ? void 0 : l.bucket) + "/" + n,
246
246
  type: $ === "labeled" ? 2 : 1
247
247
  }).then((z) => {
248
- Ve(z), xe(z);
249
- }) : u == null || u.postUploadPicsZip(s, g.id, Ke({
248
+ Re(z), xe(z);
249
+ }) : m == null || m.postUploadPicsZip(s, g.id, _e({
250
250
  zipUrls: [(l == null ? void 0 : l.bucket) + "/" + n]
251
251
  }, (c === "ocr" || c === "detection" || c === "classification") && {
252
252
  type: $ === "labeled" ? 1 : 0
253
253
  })).then((z) => {
254
- Ve(z), xe(z);
254
+ Re(z), xe(z);
255
255
  });
256
256
  }
257
257
  });
258
258
  };
259
259
  });
260
- }, Ve = (i) => ge(void 0, null, function* () {
260
+ }, Re = (i) => ge(void 0, null, function* () {
261
261
  var t;
262
- if (!(!s || !g || !u))
262
+ if (!(!s || !g || !m))
263
263
  try {
264
- const a = yield u.checkFileResult(s, g.id, {
264
+ const a = yield m.checkFileResult(s, g.id, {
265
265
  taskId: i
266
266
  }, 5e3, c, (o) => {
267
267
  Fe(o);
@@ -274,17 +274,17 @@ const ut = (A) => {
274
274
  }
275
275
  }
276
276
  });
277
- U(() => {
277
+ V(() => {
278
278
  pe && (Fe(100), te(!0));
279
- }, [pe]), U(() => {
280
- se !== 0 && (Y(!1), P && P(!0));
281
- }, [se]), U(() => {
279
+ }, [pe]), V(() => {
280
+ se !== 0 && (Y(!1), M && M(!0));
281
+ }, [se]), V(() => {
282
282
  ne !== -1 && (te(!0), ie(!1));
283
283
  }, [ne]);
284
284
  const hl = () => {
285
285
  Oe(), te(!1), Ee && Ee();
286
286
  }, Oe = () => {
287
- O(), J(!1), S(!1), Ce && Ce(), W && W();
287
+ D(), J(!1), S(!1), Ce && Ce(), W && W();
288
288
  }, gl = /* @__PURE__ */ d("div", {
289
289
  children: [/* @__PURE__ */ e(Ll, {}), /* @__PURE__ */ e("div", {
290
290
  style: {
@@ -298,17 +298,17 @@ const ut = (A) => {
298
298
  const t = x.filter((a) => a.uid !== i.uid);
299
299
  de(t);
300
300
  }, Cl = () => {
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`;
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" : U === "VQA" ? window.location.href = "https://sjzn-cv-data.obs.cn-north-4.myhuaweicloud.com/dataset_data/VLM-VQA%E6%A0%87%E6%B3%A8%E6%95%B0%E6%8D%AE%E7%A4%BA%E4%BE%8B.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
302
  }, El = () => {
303
- O(), $e(!1), J(!1), S(!1);
304
- }, Pe = c === "vlm" ? "jsonl" : m.labelFormat || "json";
305
- U(() => {
303
+ D(), $e(!1), J(!1), S(!1);
304
+ }, De = c === "vlm" ? "jsonl" : u.labelFormat || "json";
305
+ V(() => {
306
306
  ke === "labeled" && I.setFieldsValue({
307
- labelFormat: Pe,
307
+ labelFormat: De,
308
308
  acceptType: "zip"
309
309
  /* Zip */
310
310
  });
311
- }, [ke, Pe]);
311
+ }, [ke, De]);
312
312
  const wl = (i, t, a, o, f, n, b, E) => {
313
313
  if (i === "image") {
314
314
  const X = f.length - n - b;
@@ -317,34 +317,34 @@ const ut = (A) => {
317
317
  if (!t)
318
318
  return "";
319
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
+ let y = `数据导入完成,格式不符合的图片${h}个,成功${j}个,去重${w}个,失败${z}个`;
321
321
  if (a === "labeled") {
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}个)`;
322
+ const X = (o.labelFormat || "json").toUpperCase(), Me = t.labelErrorCount || 0;
323
+ E === "detection" ? y = `成功导入已标注${k}张,未标注${Me}张,去重${w}张,失败${z}张,格式不符合${h}张` : o.labelFormat === "dwg-json" ? y = `数据导入完成,成功${j}个,去重${w}个,失败${z}个` : y += `(${X}格式不符合${Me}个)`;
324
324
  }
325
- return B;
325
+ return y;
326
326
  };
327
- return /* @__PURE__ */ d(H, {
328
- children: [/* @__PURE__ */ e(Q, {
327
+ return /* @__PURE__ */ d(Q, {
328
+ children: [/* @__PURE__ */ e(H, {
329
329
  className: "upload-pics",
330
330
  width: 600,
331
331
  title: "导入数据",
332
- open: Z,
332
+ open: _,
333
333
  destroyOnClose: !0,
334
- onCancel: () => Re(),
334
+ onCancel: () => Ve(),
335
335
  maskClosable: !1,
336
336
  centered: !0,
337
337
  footer: [/* @__PURE__ */ e(R, {
338
- onClick: Re,
338
+ onClick: Ve,
339
339
  children: "取消"
340
340
  }, "cancel"), /* @__PURE__ */ e(R, {
341
341
  type: "primary",
342
342
  htmlType: "submit",
343
343
  form: "importModal",
344
- disabled: r === "image" && !y.length || r === "zip" && !x.length || le && ve == 0 || ol,
345
- loading: _ == !0,
344
+ disabled: r === "image" && !B.length || r === "zip" && !x.length || le && ve == 0 || ol,
345
+ loading: K == !0,
346
346
  onClick: () => {
347
- ml(), ie(!0);
347
+ ul(), ie(!0);
348
348
  },
349
349
  children: "导入"
350
350
  }, "confirm")],
@@ -372,7 +372,7 @@ const ut = (A) => {
372
372
  message: "请选择数据标注状态"
373
373
  }],
374
374
  children: /* @__PURE__ */ d(N.Group, {
375
- disabled: _,
375
+ disabled: K,
376
376
  onChange: (i) => {
377
377
  rl(i.target.value), he();
378
378
  },
@@ -401,22 +401,22 @@ const ut = (A) => {
401
401
  message: "请选择标注格式"
402
402
  }],
403
403
  children: /* @__PURE__ */ e(N.Group, {
404
- disabled: _,
404
+ disabled: K,
405
405
  onChange: he,
406
- children: c === "vlm" ? /* @__PURE__ */ d(H, {
406
+ children: c === "vlm" ? /* @__PURE__ */ d(Q, {
407
407
  children: [/* @__PURE__ */ e(N, {
408
408
  value: "jsonl",
409
409
  children: "jsonl"
410
- }), He && K === "KIE" && /* @__PURE__ */ e(N, {
410
+ }), Qe && U === "KIE" && /* @__PURE__ */ e(N, {
411
411
  value: "dwg-json",
412
412
  children: "图纸json"
413
413
  })]
414
- }) : m.labelFormatLabel ? /* @__PURE__ */ e(N, {
415
- value: m.labelFormat || "folder",
416
- children: m.labelFormatLabel
414
+ }) : u.labelFormatLabel ? /* @__PURE__ */ e(N, {
415
+ value: u.labelFormat || "folder",
416
+ children: u.labelFormatLabel
417
417
  }) : /* @__PURE__ */ e(N, {
418
- value: m.labelFormat || "json",
419
- children: m.labelFormat || "json"
418
+ value: u.labelFormat || "json",
419
+ children: u.labelFormat || "json"
420
420
  })
421
421
  })
422
422
  }), /* @__PURE__ */ e(L.Item, {
@@ -427,7 +427,7 @@ const ut = (A) => {
427
427
  message: "请选择导入方式"
428
428
  }],
429
429
  children: /* @__PURE__ */ d(N.Group, {
430
- disabled: _,
430
+ disabled: K,
431
431
  onChange: he,
432
432
  children: [$ !== "labeled" && /* @__PURE__ */ e(N.Button, {
433
433
  value: "image",
@@ -439,7 +439,7 @@ const ut = (A) => {
439
439
  })
440
440
  }), /* @__PURE__ */ d("div", {
441
441
  className: "file-upload",
442
- children: [(r === "image" && !y.length || r === "zip") && /* @__PURE__ */ d(cl, {
442
+ children: [(r === "image" && !B.length || r === "zip") && /* @__PURE__ */ d(cl, {
443
443
  name: "file",
444
444
  showUploadList: !1,
445
445
  multiple: !0,
@@ -451,7 +451,7 @@ const ut = (A) => {
451
451
  children: [/* @__PURE__ */ e("span", {
452
452
  className: "file-upload-icon",
453
453
  children: /* @__PURE__ */ e(xl, {})
454
- }), /* @__PURE__ */ d(_e, {
454
+ }), /* @__PURE__ */ d(Ke, {
455
455
  className: "file-upload-action",
456
456
  children: [r === "image" && "拖拽图片至此,或者", r === "zip" && "拖拽包含“图片”的压缩包至此,或者", /* @__PURE__ */ e(R, {
457
457
  type: "link",
@@ -468,7 +468,7 @@ const ut = (A) => {
468
468
  },
469
469
  children: [/* @__PURE__ */ d("div", {
470
470
  className: "item-upload-desc item-upload-desc__1",
471
- children: ["1. 支持", m.imageFormatsText, "格式,单张图片不超过", m.maxImageSize / Je, "M;"]
471
+ children: ["1. 支持", u.imageFormatsText, "格式,单张图片不超过", u.maxImageSize / Je, "M;"]
472
472
  }), /* @__PURE__ */ e("div", {
473
473
  className: "item-upload-desc",
474
474
  children: "2. 单次上传最多可选择100个文件。"
@@ -480,25 +480,25 @@ const ut = (A) => {
480
480
  },
481
481
  children: [/* @__PURE__ */ d("div", {
482
482
  className: "item-upload-desc item-upload-desc__1",
483
- children: ["1. 仅支持.zip格式,单个压缩包不超过", m.maxZipSize / Xe, "G;"]
484
- }), $ === "labeled" ? /* @__PURE__ */ e(H, {
485
- children: m.zipUploadTexts.labeled.description.map((i, t) => /* @__PURE__ */ d("div", {
483
+ children: ["1. 仅支持.zip格式,单个压缩包不超过", u.maxZipSize / Xe, "G;"]
484
+ }), $ === "labeled" ? /* @__PURE__ */ e(Q, {
485
+ children: u.zipUploadTexts.labeled.description.map((i, t) => /* @__PURE__ */ d("div", {
486
486
  className: "item-upload-desc",
487
487
  children: [t + 2, ". ", i]
488
488
  }, t))
489
489
  }) : /* @__PURE__ */ d("div", {
490
490
  className: "item-upload-desc",
491
- children: ["2. ", m.zipUploadTexts.unlabeled.description[0]]
491
+ children: ["2. ", u.zipUploadTexts.unlabeled.description[0]]
492
492
  }), /* @__PURE__ */ d("div", {
493
493
  className: "item-upload-desc",
494
- children: [$ === "labeled" ? m.zipUploadTexts.labeled.description.length + 2 : 3, ". 单次仅可上传1个文件。"]
494
+ children: [$ === "labeled" ? u.zipUploadTexts.labeled.description.length + 2 : 3, ". 单次仅可上传1个文件。"]
495
495
  })]
496
496
  })]
497
- }), r === "image" && y.length ? /* @__PURE__ */ e("div", {
497
+ }), r === "image" && B.length ? /* @__PURE__ */ e("div", {
498
498
  className: "picture-upload",
499
499
  children: /* @__PURE__ */ e(Ie, {
500
500
  listType: "picture-card",
501
- fileList: y,
501
+ fileList: B,
502
502
  multiple: !0,
503
503
  showUploadList: {
504
504
  showPreviewIcon: !1
@@ -506,9 +506,9 @@ const ut = (A) => {
506
506
  beforeUpload: Te,
507
507
  accept: Le,
508
508
  onChange: Ue,
509
- children: y.length < 100 ? gl : null
509
+ children: B.length < 100 ? gl : null
510
510
  })
511
- }) : /* @__PURE__ */ e(H, {}), r === "zip" && /* @__PURE__ */ d("div", {
511
+ }) : /* @__PURE__ */ e(Q, {}), r === "zip" && /* @__PURE__ */ d("div", {
512
512
  className: "upload-wrapper",
513
513
  children: [x != null && x.length ? /* @__PURE__ */ e("div", {
514
514
  className: "upload-main",
@@ -533,7 +533,7 @@ const ut = (A) => {
533
533
  }), /* @__PURE__ */ e(R, {
534
534
  className: "upload-item-upload-delete",
535
535
  type: "link",
536
- disabled: _,
536
+ disabled: K,
537
537
  onClick: () => bl(i),
538
538
  children: /* @__PURE__ */ e(kl, {})
539
539
  })]
@@ -544,7 +544,7 @@ const ut = (A) => {
544
544
  className: "upload-example",
545
545
  children: [/* @__PURE__ */ e("div", {
546
546
  className: "upload-example-header",
547
- children: /* @__PURE__ */ d(_e, {
547
+ children: /* @__PURE__ */ d(Ke, {
548
548
  children: [/* @__PURE__ */ e("span", {
549
549
  children: "数据示例:"
550
550
  }), /* @__PURE__ */ e(R, {
@@ -559,17 +559,17 @@ const ut = (A) => {
559
559
  children: "下载示例 >"
560
560
  })]
561
561
  })
562
- }), c !== "classification" && /* @__PURE__ */ e("div", {
562
+ }), c !== "classification" && !($ === "labeled" && u.showExampleImage === !1) && /* @__PURE__ */ e("div", {
563
563
  className: "upload-example-main",
564
564
  children: /* @__PURE__ */ e("img", {
565
- src: $ === "labeled" ? c === "vlm" ? re === "dwg-json" ? Pl : Vl : Rl : c === "vlm" ? Ol : Ul
565
+ src: $ === "labeled" ? c === "vlm" ? re === "dwg-json" ? Dl : Rl : Vl : c === "vlm" ? Ol : Ul
566
566
  })
567
567
  })]
568
568
  })]
569
569
  })]
570
570
  })]
571
571
  })
572
- }), le && /* @__PURE__ */ e(Q, {
572
+ }), le && /* @__PURE__ */ e(H, {
573
573
  className: "uploading-modal",
574
574
  width: 404,
575
575
  title: null,
@@ -583,32 +583,32 @@ const ut = (A) => {
583
583
  children: /* @__PURE__ */ e("div", {
584
584
  className: "upload-spin",
585
585
  children: /* @__PURE__ */ e(Nl, {
586
- tip: r === "image" ? `数据导入中(${se}/${y.length}),请耐心等待` : `处理中(${ve}/100%),请耐心等待`,
586
+ tip: r === "image" ? `数据导入中(${se}/${B.length}),请耐心等待` : `处理中(${ve}/100%),请耐心等待`,
587
587
  size: "large",
588
588
  children: /* @__PURE__ */ e("div", {
589
589
  className: "content"
590
590
  })
591
591
  })
592
592
  })
593
- }), ye && /* @__PURE__ */ e(Q, {
593
+ }), Be && /* @__PURE__ */ e(H, {
594
594
  className: "result",
595
595
  width: 424,
596
596
  title: null,
597
- open: ye,
597
+ open: Be,
598
598
  closable: !1,
599
599
  footer: null,
600
600
  children: /* @__PURE__ */ e("div", {
601
601
  className: "upload-result",
602
602
  children: /* @__PURE__ */ e(Ge, {
603
603
  status: "success",
604
- title: wl(r, pe, $, m, y, ne, il, c),
604
+ title: wl(r, pe, $, u, B, ne, il, c),
605
605
  extra: [/* @__PURE__ */ e(R, {
606
606
  onClick: hl,
607
607
  children: "关闭"
608
608
  }, "close")]
609
609
  })
610
610
  })
611
- }), Ne && /* @__PURE__ */ e(Q, {
611
+ }), Ne && /* @__PURE__ */ e(H, {
612
612
  className: "result",
613
613
  width: 424,
614
614
  title: null,
@@ -630,5 +630,5 @@ const ut = (A) => {
630
630
  });
631
631
  };
632
632
  export {
633
- ut as default
633
+ mt as default
634
634
  };