@glodon-aiot/dataset-annotation 3.10.0-snapshot.16 → 3.10.0-snapshot.17

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,52 +1,54 @@
1
- var pl = Object.defineProperty;
1
+ var ul = Object.defineProperty;
2
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
- for (var s in e || (e = {}))
6
- ul.call(e, s) && Pe(z, s, e[s]);
3
+ var ml = Object.prototype.hasOwnProperty, fl = Object.prototype.propertyIsEnumerable;
4
+ var Pe = (z, e, i) => e in z ? ul(z, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : z[e] = i, Me = (z, e) => {
5
+ for (var i in e || (e = {}))
6
+ ml.call(e, i) && Pe(z, i, e[i]);
7
7
  if (Ve)
8
- for (var s of Ve(e))
9
- ml.call(e, s) && Pe(z, s, e[s]);
8
+ for (var i of Ve(e))
9
+ fl.call(e, i) && Pe(z, i, e[i]);
10
10
  return z;
11
11
  };
12
- var ce = (z, e, s) => new Promise((m, K) => {
12
+ var ce = (z, e, i) => new Promise((m, K) => {
13
13
  var _ = (N) => {
14
14
  try {
15
- T(s.next(N));
15
+ T(i.next(N));
16
16
  } catch (v) {
17
17
  K(v);
18
18
  }
19
19
  }, h = (N) => {
20
20
  try {
21
- T(s.throw(N));
21
+ T(i.throw(N));
22
22
  } catch (v) {
23
23
  K(v);
24
24
  }
25
25
  }, T = (N) => N.done ? m(N.value) : Promise.resolve(N.value).then(_, h);
26
- T((s = s.apply(z, e)).next());
26
+ T((i = i.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 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";
29
+ import { useContext as hl, useState as r, useRef as gl, useEffect as O } from "react";
30
+ import { Form as V, message as $, Modal as H, Button as P, Radio as k, Tooltip as Cl, Space as je, Upload as Ge, Row as pe, Col as bl, Spin as yl, Result as De } from "antd";
31
31
  import "./style.less.mjs";
32
32
  import { InfoCircleOutlined as Sl, CloudUploadOutlined as zl, PaperClipOutlined as wl, DeleteOutlined as El, PlusOutlined as Nl } from "@ant-design/icons";
33
33
  import vl from "browser-md5-file";
34
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";
35
+ import xl from "./pic_zip.svg.mjs";
36
+ import Al from "./pic_zip_json.svg.mjs";
37
+ import Fl from "./pic_vlm_json_zip.svg.mjs";
38
+ import Rl from "./pic_vlm_zip.svg.mjs";
39
+ import { MB as Ze, GB as Bl } from "../../constant.mjs";
40
+ import { fileSuffixToLowerCase as $l } from "../../utils/index.mjs";
41
+ import kl from "../../DatasetContext/index.mjs";
42
+ import { EXAMPLE_SRC_ROOT as Tl, VLM_EXAMPLE_SRC_ROOT as Ul } from "../../featuresConfig.mjs";
43
+ import { getImportConfig as Ll } from "./config.mjs";
44
+ const {
45
+ Dragger: Ol
46
+ } = Ge;
45
47
  let f = 0, G = 0, M = 0, I = 0;
46
- const ot = (z) => {
48
+ const nt = (z) => {
47
49
  const {
48
50
  datasetIam: e,
49
- datasetId: s,
51
+ datasetId: i,
50
52
  currentVersion: m,
51
53
  tenCode: K,
52
54
  isVisible: _,
@@ -66,36 +68,36 @@ const ot = (z) => {
66
68
  exampleSrcRoot: fe,
67
69
  vlmExampleSrcRoot: he
68
70
  } = {
69
- exampleSrcRoot: Ul,
70
- vlmExampleSrcRoot: Ll
71
+ exampleSrcRoot: Tl,
72
+ vlmExampleSrcRoot: Ul
71
73
  }
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(
74
+ } = hl(kl), [w, Ie] = r(0), [E, qe] = r(0), [Y, Xe] = r([]), [j, Je] = r(), [ge, Vl] = r([]), [ee, X] = r(!1), [Ce, le] = r(!1), [Z, te] = r(!1), [se, We] = r(0), [be, He] = r(0), [J, ye] = r(-1), [ie, Pl] = r([]), [Se, Ml] = r([]), [ze, ne] = r(!1), Qe = new vl(), [W] = V.useForm(), n = V.useWatch("acceptType", W), F = V.useWatch("labelState", W), [C, we] = r([]), [R, Ee] = r([]), [B, Ye] = r(), [Ne, ve] = r(0), [xe, Ae] = r(!1), [jl, Fe] = r(""), [el, Re] = r(!1), [Be, ll] = r(
73
75
  "unlabeled"
74
76
  /* Unlabeled */
75
- ), oe = hl(!0), g = Ol(h), ae = g.imageMimeTypes, $e = g.imageAccept, re = g.maxImageSize;
77
+ ), oe = gl(!0), g = Ll(h), ae = g.imageMimeTypes, $e = g.imageAccept, re = g.maxImageSize;
76
78
  O(() => {
77
79
  f = 0, G = 0, M = 0, I = 0, te(!1), _ && (oe.current = !1, q && q());
78
80
  }, [_]);
79
- const ke = (t, i) => {
81
+ const ke = (t, s) => {
80
82
  var o;
81
83
  if (n === "image") {
82
84
  ne(!0);
83
85
  let a = 0;
84
- if (f = f + 1, G = G + 1, i.length === 0)
86
+ if (f = f + 1, G = G + 1, s.length === 0)
85
87
  return;
86
88
  let u = 0;
87
- const [...c] = i, y = window.URL || window.webkitURL, S = new Image();
89
+ const [...c] = s, y = window.URL || window.webkitURL, S = new Image();
88
90
  S.src = y.createObjectURL(t), S.onload = () => {
89
91
  Y.push({
90
92
  name: t.name,
91
93
  src: S.src,
92
94
  width: S.width,
93
95
  height: S.height
94
- }), qe(Y);
95
- }, i.map((x) => {
96
+ }), Xe(Y);
97
+ }, s.map((x) => {
96
98
  const A = ae.some((L) => L === x.type), U = x.size <= re;
97
99
  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);
100
+ }), c.length > 100 && c.splice(100, c.length), Ie(u), qe(a), G === s.length && (ne(!0), G = 0);
99
101
  const b = ae.some((x) => x === t.type), D = t.size <= re;
100
102
  if (b) {
101
103
  if (!D)
@@ -103,7 +105,7 @@ const ot = (z) => {
103
105
  } else
104
106
  return !1;
105
107
  } else {
106
- if (t.size > 2 * $l)
108
+ if (t.size > 2 * Bl)
107
109
  return $.error(`${t.name}文件总大小不能超过2G`), !1;
108
110
  const a = (o = t.name) == null ? void 0 : o.substring(t.name.lastIndexOf("."));
109
111
  if (n === "zip" && a !== ".zip")
@@ -115,52 +117,52 @@ const ot = (z) => {
115
117
  O(() => {
116
118
  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
119
  }, [ze]);
118
- const ll = (t) => {
119
- const i = t.originFileObj;
120
+ const tl = (t) => {
121
+ const s = t.originFileObj;
120
122
  return new Promise((o, a) => {
121
- He.md5(i, (u, c) => {
122
- u && a(u), il(c, i), o(c);
123
+ Qe.md5(s, (u, c) => {
124
+ u && a(u), il(c, s), o(c);
123
125
  });
124
126
  });
125
- }, tl = () => ce(void 0, null, function* () {
127
+ }, sl = () => ce(void 0, null, function* () {
126
128
  if (!C)
127
129
  return;
128
130
  const t = [];
129
- for (let i = 0; i < C.length; i++) {
130
- const o = C[i], a = yield ll(o);
131
+ for (let s = 0; s < C.length; s++) {
132
+ const o = C[s], a = yield tl(o);
131
133
  t.push(a);
132
134
  }
133
- !s || t.length === 0 || p == null || p.getDeduplication(t, s).then((i) => {
134
- Xe(i), Re(!1);
135
+ !i || t.length === 0 || p == null || p.getDeduplication(t, i).then((s) => {
136
+ Je(s), Re(!1);
135
137
  });
136
138
  });
137
139
  O(() => {
138
- tl();
140
+ sl();
139
141
  }, [C]);
140
- const il = (t, i) => {
141
- i.md5 = t, ge.push(i);
142
+ const il = (t, s) => {
143
+ s.md5 = t, ge.push(s);
142
144
  }, Te = ({
143
145
  fileList: t
144
146
  }) => {
145
147
  if (n === "zip")
146
148
  return;
147
149
  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
+ const s = t.filter((o) => o.size && o.size <= re ? ae.some((a) => o.type === a) : !1);
151
+ s.splice(100, s.length), s.length < C.length ? (we(s), I++) : (M = M - I, I = 0, M++, M == s.length && we(s), M > s.length && (M = s.length));
150
152
  }, Ue = () => {
151
153
  n === "zip" && (oe.current = !0), T(!1);
152
- }, sl = () => {
154
+ }, nl = () => {
153
155
  if (n === "image") {
154
156
  if (!j)
155
157
  return;
156
- let t = 0, i = 0;
158
+ let t = 0, s = 0;
157
159
  if (j.duplicated.length !== 0 && j.duplicated.map((o, a) => {
158
160
  var y;
159
161
  const u = j.duplicatedMd5[a], c = ((y = C.find((S) => {
160
162
  var b;
161
163
  return ((b = S.originFileObj) == null ? void 0 : b.md5) === u;
162
164
  })) == null ? void 0 : y.name) || "";
163
- se.push({
165
+ ie.push({
164
166
  labels: [],
165
167
  fileKey: o,
166
168
  sampleFileName: {
@@ -176,7 +178,7 @@ const ot = (z) => {
176
178
  "Content-Type": "application/octet-stream",
177
179
  "X-Amz-Meta-Width": b == null ? void 0 : b.width,
178
180
  "X-Amz-Meta-Height": b == null ? void 0 : b.height
179
- }, x = `dataset/${s}/sample/${a}${kl(S)}`;
181
+ }, x = `dataset/${i}/sample/${a}${$l(S)}`;
180
182
  delete c.md5;
181
183
  const A = new FileReader();
182
184
  A.readAsArrayBuffer(c), A.onload = (U) => {
@@ -186,7 +188,7 @@ const ot = (z) => {
186
188
  accessKey: e == null ? void 0 : e.accessKey,
187
189
  secretKey: e == null ? void 0 : e.secretKey
188
190
  }), _e(K, x, U.target.result, D, (L, Dl) => {
189
- X(!0), i += 1, L && (t += 1, We(t)), Je(i), Se.push({
191
+ X(!0), s += 1, L && (t += 1, He(t)), We(s), Se.push({
190
192
  labels: [],
191
193
  fileKey: `${K}/${x}`,
192
194
  sampleFileName: {
@@ -197,31 +199,31 @@ const ot = (z) => {
197
199
  };
198
200
  }));
199
201
  Promise.all(o).then(() => {
200
- !s || !m || setTimeout(() => {
201
- p == null || p.postDatasetsIdVersionsVidSamples(s, m.id, {
202
- samples: Se.concat(se)
202
+ !i || !m || setTimeout(() => {
203
+ p == null || p.postDatasetsIdVersionsVidSamples(i, m.id, {
204
+ samples: Se.concat(ie)
203
205
  }).then(() => {
204
- p.getDatasetsIdVersionsVid(s, m.id).then((a) => {
206
+ p.getDatasetsIdVersionsVid(i, m.id).then((a) => {
205
207
  ye(a.samplesCount - m.samplesCount);
206
208
  }), Q(!0), v && v(!1);
207
209
  });
208
210
  }, 100);
209
211
  });
210
212
  } else {
211
- if (!s || !m)
213
+ if (!i || !m)
212
214
  return;
213
- p == null || p.postDatasetsIdVersionsVidSamples(s, m.id, {
214
- samples: se
215
+ p == null || p.postDatasetsIdVersionsVidSamples(i, m.id, {
216
+ samples: ie
215
217
  }).then(() => {
216
- p.getDatasetsIdVersionsVid(s, m.id).then((o) => {
218
+ p.getDatasetsIdVersionsVid(i, m.id).then((o) => {
217
219
  ye(o.samplesCount - m.samplesCount);
218
220
  }), Q(!0), v && v(!1);
219
221
  });
220
222
  }
221
223
  } else
222
- nl(R);
223
- }, nl = (t) => {
224
- !s || !m || t.map((i, o) => {
224
+ ol(R);
225
+ }, ol = (t) => {
226
+ !i || !m || t.map((s, o) => {
225
227
  var S;
226
228
  const a = {
227
229
  "Content-Type": "application/octet-stream"
@@ -231,19 +233,19 @@ const ot = (z) => {
231
233
  accessKey: e == null ? void 0 : e.accessKey,
232
234
  secretKey: e == null ? void 0 : e.secretKey
233
235
  }, 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) => {
236
+ y.readAsArrayBuffer(s), y.onload = (b) => {
235
237
  Ke(u), _e(e == null ? void 0 : e.bucket, c, b.target.result, a, (D, x) => {
236
238
  if (D)
237
239
  console.log(D);
238
240
  else {
239
241
  if (oe.current)
240
242
  return;
241
- X(!0), h === "vlm" ? p == null || p.postVlmUploadPicsZip(s, m.id, {
243
+ X(!0), h === "vlm" ? p == null || p.postVlmUploadPicsZip(i, m.id, {
242
244
  zipUrl: (e == null ? void 0 : e.bucket) + "/" + c,
243
245
  type: F === "labeled" ? 2 : 1
244
246
  }).then((A) => {
245
247
  Le(A), Fe(A);
246
- }) : p == null || p.postUploadPicsZip(s, m.id, Me({
248
+ }) : p == null || p.postUploadPicsZip(i, m.id, Me({
247
249
  zipUrls: [(e == null ? void 0 : e.bucket) + "/" + c]
248
250
  }, (h === "ocr" || h === "vlm") && {
249
251
  type: F === "labeled" ? 1 : 0
@@ -255,17 +257,17 @@ const ot = (z) => {
255
257
  };
256
258
  });
257
259
  }, Le = (t) => ce(void 0, null, function* () {
258
- var i;
259
- if (!(!s || !m || !p))
260
+ var s;
261
+ if (!(!i || !m || !p))
260
262
  try {
261
- const o = yield p.checkFileResult(s, m.id, {
263
+ const o = yield p.checkFileResult(i, m.id, {
262
264
  taskId: t
263
265
  }, 5e3, h, (a) => {
264
266
  ve(a);
265
267
  });
266
- o && Qe(JSON.parse(o));
268
+ o && Ye(JSON.parse(o));
267
269
  } catch (o) {
268
- if (((i = o.cause) == null ? void 0 : i.code) === -101) {
270
+ if (((s = o.cause) == null ? void 0 : s.code) === -101) {
269
271
  Ae(!0);
270
272
  return;
271
273
  }
@@ -274,27 +276,27 @@ const ot = (z) => {
274
276
  O(() => {
275
277
  B && (ve(100), le(!0));
276
278
  }, [B]), O(() => {
277
- ie !== 0 && (Q(!1), v && v(!0));
278
- }, [ie]), O(() => {
279
+ se !== 0 && (Q(!1), v && v(!0));
280
+ }, [se]), O(() => {
279
281
  J !== -1 && (le(!0), te(!1));
280
282
  }, [J]);
281
- const ol = () => {
283
+ const al = () => {
282
284
  Oe(), le(!1), me && me();
283
285
  }, Oe = () => {
284
286
  N(), X(!1), T(!1), ue && ue(), q && q();
285
- }, al = /* @__PURE__ */ d("div", {
287
+ }, rl = /* @__PURE__ */ d("div", {
286
288
  children: [/* @__PURE__ */ l(Nl, {}), /* @__PURE__ */ l("div", {
287
289
  style: {
288
290
  marginTop: 8
289
291
  },
290
292
  children: "添加图片"
291
293
  })]
292
- }), rl = (t) => {
293
- const i = R.filter((o) => o.uid !== t.uid);
294
- Ee(i);
295
- }, cl = () => {
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`;
294
+ }), cl = (t) => {
295
+ const s = R.filter((o) => o.uid !== t.uid);
296
+ Ee(s);
297
297
  }, dl = () => {
298
+ 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`;
299
+ }, pl = () => {
298
300
  N(), Ae(!1), X(!1), T(!1);
299
301
  };
300
302
  return O(() => {
@@ -320,10 +322,10 @@ const ot = (z) => {
320
322
  type: "primary",
321
323
  htmlType: "submit",
322
324
  form: "importModal",
323
- disabled: n === "image" && !C.length || n === "zip" && !R.length || ee && Ne == 0 || Ye,
325
+ disabled: n === "image" && !C.length || n === "zip" && !R.length || ee && Ne == 0 || el,
324
326
  loading: Z == !0,
325
327
  onClick: () => {
326
- sl(), te(!0);
328
+ nl(), te(!0);
327
329
  },
328
330
  children: "导入"
329
331
  }, "confirm")],
@@ -353,14 +355,14 @@ const ot = (z) => {
353
355
  children: /* @__PURE__ */ d(k.Group, {
354
356
  disabled: Z,
355
357
  onChange: (t) => {
356
- el(t.target.value);
358
+ ll(t.target.value);
357
359
  },
358
360
  children: [/* @__PURE__ */ l(k, {
359
361
  value: "unlabeled",
360
362
  children: "无标注信息"
361
363
  }), /* @__PURE__ */ d(k, {
362
364
  value: "labeled",
363
- children: ["有标注信息", h === "vlm" && /* @__PURE__ */ l(gl, {
365
+ children: ["有标注信息", h === "vlm" && /* @__PURE__ */ l(Cl, {
364
366
  title: "支持上传带OCR标注信息的数据",
365
367
  children: /* @__PURE__ */ l(Sl, {
366
368
  style: {
@@ -405,7 +407,7 @@ const ot = (z) => {
405
407
  })
406
408
  }), /* @__PURE__ */ d("div", {
407
409
  className: "file-upload",
408
- children: [(n === "image" && !C.length || n === "zip") && /* @__PURE__ */ d(xl, {
410
+ children: [(n === "image" && !C.length || n === "zip") && /* @__PURE__ */ d(Ol, {
409
411
  name: "file",
410
412
  showUploadList: !1,
411
413
  multiple: !0,
@@ -448,10 +450,10 @@ const ot = (z) => {
448
450
  className: "item-upload-desc item-upload-desc__1",
449
451
  children: "1. 仅支持.zip格式,单个压缩包不超过2G;"
450
452
  }), F === "labeled" ? /* @__PURE__ */ l(de, {
451
- children: g.zipUploadTexts.labeled.description.map((t, i) => /* @__PURE__ */ d("div", {
453
+ children: g.zipUploadTexts.labeled.description.map((t, s) => /* @__PURE__ */ d("div", {
452
454
  className: "item-upload-desc",
453
- children: [i + 2, ". ", t]
454
- }, i))
455
+ children: [s + 2, ". ", t]
456
+ }, s))
455
457
  }) : /* @__PURE__ */ d("div", {
456
458
  className: "item-upload-desc",
457
459
  children: ["2. ", g.zipUploadTexts.unlabeled.description[0]]
@@ -462,7 +464,7 @@ const ot = (z) => {
462
464
  })]
463
465
  }), n === "image" && C.length ? /* @__PURE__ */ l("div", {
464
466
  className: "picture-upload",
465
- children: /* @__PURE__ */ l(Cl, {
467
+ children: /* @__PURE__ */ l(Ge, {
466
468
  listType: "picture-card",
467
469
  fileList: C,
468
470
  multiple: !0,
@@ -472,7 +474,7 @@ const ot = (z) => {
472
474
  beforeUpload: ke,
473
475
  accept: $e,
474
476
  onChange: Te,
475
- children: C.length < 100 ? al : null
477
+ children: C.length < 100 ? rl : null
476
478
  })
477
479
  }) : /* @__PURE__ */ l(de, {}), n === "zip" && /* @__PURE__ */ d("div", {
478
480
  className: "upload-wrapper",
@@ -500,7 +502,7 @@ const ot = (z) => {
500
502
  className: "upload-item-upload-delete",
501
503
  type: "link",
502
504
  disabled: Z,
503
- onClick: () => rl(t),
505
+ onClick: () => cl(t),
504
506
  children: /* @__PURE__ */ l(El, {})
505
507
  })]
506
508
  })
@@ -520,7 +522,7 @@ const ot = (z) => {
520
522
  padding: 0
521
523
  },
522
524
  onClick: (t) => {
523
- t.stopPropagation(), cl();
525
+ t.stopPropagation(), dl();
524
526
  },
525
527
  children: "下载示例 >"
526
528
  })]
@@ -528,7 +530,7 @@ const ot = (z) => {
528
530
  }), /* @__PURE__ */ l("div", {
529
531
  className: "upload-example-main",
530
532
  children: /* @__PURE__ */ l("img", {
531
- src: F === "labeled" ? h === "vlm" ? Rl : Fl : h === "vlm" ? Bl : Al
533
+ src: F === "labeled" ? h === "vlm" ? Fl : Al : h === "vlm" ? Rl : xl
532
534
  })
533
535
  })]
534
536
  })]
@@ -549,7 +551,7 @@ const ot = (z) => {
549
551
  children: /* @__PURE__ */ l("div", {
550
552
  className: "upload-spin",
551
553
  children: /* @__PURE__ */ l(yl, {
552
- tip: n === "image" ? `数据导入中(${ie}/${C.length}),请耐心等待` : `处理中(${Ne}/100%),请耐心等待`,
554
+ tip: n === "image" ? `数据导入中(${se}/${C.length}),请耐心等待` : `处理中(${Ne}/100%),请耐心等待`,
553
555
  size: "large",
554
556
  children: /* @__PURE__ */ l("div", {
555
557
  className: "content"
@@ -569,7 +571,7 @@ const ot = (z) => {
569
571
  status: "success",
570
572
  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
573
  extra: [/* @__PURE__ */ l(P, {
572
- onClick: ol,
574
+ onClick: al,
573
575
  children: "关闭"
574
576
  }, "close")]
575
577
  })
@@ -587,7 +589,7 @@ const ot = (z) => {
587
589
  status: "error",
588
590
  title: "文件处理失败",
589
591
  extra: [/* @__PURE__ */ l(P, {
590
- onClick: dl,
592
+ onClick: pl,
591
593
  children: "关闭"
592
594
  }, "close")]
593
595
  })
@@ -596,5 +598,5 @@ const ot = (z) => {
596
598
  });
597
599
  };
598
600
  export {
599
- ot as default
601
+ nt as default
600
602
  };
@@ -10,20 +10,20 @@ var M = (o, s, n) => s in o ? X(o, s, { enumerable: !0, configurable: !0, writab
10
10
  te.call(s, n) && M(o, n, s[n]);
11
11
  return o;
12
12
  }, A = (o, s) => Y(o, Z(s));
13
- var E = (o, s, n) => new Promise((h, f) => {
13
+ var E = (o, s, n) => new Promise((m, h) => {
14
14
  var l = (c) => {
15
15
  try {
16
16
  a(n.next(c));
17
- } catch (m) {
18
- f(m);
17
+ } catch (p) {
18
+ h(p);
19
19
  }
20
- }, p = (c) => {
20
+ }, f = (c) => {
21
21
  try {
22
22
  a(n.throw(c));
23
- } catch (m) {
24
- f(m);
23
+ } catch (p) {
24
+ h(p);
25
25
  }
26
- }, a = (c) => c.done ? h(c.value) : Promise.resolve(c.value).then(l, p);
26
+ }, a = (c) => c.done ? m(c.value) : Promise.resolve(c.value).then(l, f);
27
27
  a((n = n.apply(o, s)).next());
28
28
  });
29
29
  import { jsxs as u, jsx as i } from "react/jsx-runtime";
@@ -35,14 +35,14 @@ import B from "../../../Iconfont/index.mjs";
35
35
  const de = ie((o, s) => {
36
36
  const {
37
37
  datasetId: n,
38
- versionId: h,
39
- onAttributesChange: f,
38
+ versionId: m,
39
+ onAttributesChange: h,
40
40
  onLoadingChange: l
41
41
  } = o, {
42
42
  services: {
43
- cvforceDatahub: p
43
+ cvforceDatahub: f
44
44
  }
45
- } = ne(oe), [a, c] = b([]), [m, N] = b(!1), [D, g] = b(""), [w, O] = b(!1), [R, y] = b(null), I = re(""), S = (e) => {
45
+ } = ne(oe), [a, c] = b([]), [p, N] = b(!1), [D, g] = b(""), [w, O] = b(!1), [R, y] = b(null), I = re(""), S = (e) => {
46
46
  const t = [...e].sort((r, d) => r.id.localeCompare(d.id));
47
47
  return JSON.stringify(t);
48
48
  }, U = () => S(a) !== I.current, z = () => new Promise((e) => {
@@ -70,8 +70,8 @@ const de = ie((o, s) => {
70
70
  const V = () => E(void 0, null, function* () {
71
71
  N(!0), l == null || l(!0);
72
72
  try {
73
- if (n && h && p) {
74
- const t = (yield p.getDatasetsIdVersionsVidConfigs(n, h)) || [];
73
+ if (n && m && f) {
74
+ const t = (yield f.getDatasetsIdVersionsVidConfigs(n, m)) || [];
75
75
  return c(t), I.current = S(t), t;
76
76
  }
77
77
  } catch (e) {
@@ -126,7 +126,7 @@ const de = ie((o, s) => {
126
126
  }) : d);
127
127
  c(r);
128
128
  }, L = () => E(void 0, null, function* () {
129
- if (!(!n || !h || !p)) {
129
+ if (!(!n || !m || !f)) {
130
130
  N(!0), l == null || l(!0);
131
131
  try {
132
132
  const e = a.map((r) => {
@@ -135,11 +135,11 @@ const de = ie((o, s) => {
135
135
  id: (d = r.id) != null && d.startsWith("attr-") ? "" : r.id
136
136
  });
137
137
  });
138
- console.log("attributes", a), yield p.saveVisionLabelConfigs(n, h, {
138
+ console.log("attributes", a), yield f.saveVisionLabelConfigs(n, m, {
139
139
  data: e
140
140
  });
141
141
  const t = yield V();
142
- C.success("保存成功"), f == null || f(t || a);
142
+ C.success("保存成功"), h == null || h(t || a);
143
143
  } catch (e) {
144
144
  throw console.error("保存属性列表失败:", e), C.error("保存失败"), e;
145
145
  } finally {
@@ -209,9 +209,7 @@ const de = ie((o, s) => {
209
209
  }];
210
210
  return /* @__PURE__ */ u("div", {
211
211
  className: "attribute-detail",
212
- children: [m && /* @__PURE__ */ i("div", {
213
- children: "加载中..."
214
- }), /* @__PURE__ */ i("div", {
212
+ children: [/* @__PURE__ */ i("div", {
215
213
  className: "use-tips",
216
214
  children: /* @__PURE__ */ i("div", {
217
215
  children: "使用须知:用户需清楚能从图纸中提取出所有类型的信息,图片中的标注信息(如“零件名称”、“规格型号”),属性定义对应全局"
@@ -329,8 +327,8 @@ const de = ie((o, s) => {
329
327
  children: /* @__PURE__ */ i(T, {
330
328
  children: /* @__PURE__ */ i(v, {
331
329
  type: "primary",
332
- loading: m,
333
- disabled: m,
330
+ loading: p,
331
+ disabled: p,
334
332
  onClick: L,
335
333
  children: "保存"
336
334
  })