@glodon-aiot/dataset-annotation 3.24.0-alpha.3 → 3.24.0-alpha.4

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.
@@ -2,35 +2,35 @@ var Zt = Object.defineProperty, _t = Object.defineProperties;
2
2
  var Xt = Object.getOwnPropertyDescriptors;
3
3
  var lt = Object.getOwnPropertySymbols;
4
4
  var Jt = Object.prototype.hasOwnProperty, Qt = Object.prototype.propertyIsEnumerable;
5
- var st = (L, g, c) => g in L ? Zt(L, g, { enumerable: !0, configurable: !0, writable: !0, value: c }) : L[g] = c, b = (L, g) => {
6
- for (var c in g || (g = {}))
7
- Jt.call(g, c) && st(L, c, g[c]);
5
+ var st = (L, g, a) => g in L ? Zt(L, g, { enumerable: !0, configurable: !0, writable: !0, value: a }) : L[g] = a, b = (L, g) => {
6
+ for (var a in g || (g = {}))
7
+ Jt.call(g, a) && st(L, a, g[a]);
8
8
  if (lt)
9
- for (var c of lt(g))
10
- Qt.call(g, c) && st(L, c, g[c]);
9
+ for (var a of lt(g))
10
+ Qt.call(g, a) && st(L, a, g[a]);
11
11
  return L;
12
- }, y = (L, g) => _t(L, Xt(g));
13
- var Oe = (L, g, c) => new Promise((J, be) => {
14
- var ve = (I) => {
12
+ }, S = (L, g) => _t(L, Xt(g));
13
+ var Fe = (L, g, a) => new Promise((J, ve) => {
14
+ var ye = (x) => {
15
15
  try {
16
- oe(c.next(I));
17
- } catch (le) {
18
- be(le);
16
+ ie(a.next(x));
17
+ } catch (oe) {
18
+ ve(oe);
19
19
  }
20
- }, R = (I) => {
20
+ }, R = (x) => {
21
21
  try {
22
- oe(c.throw(I));
23
- } catch (le) {
24
- be(le);
22
+ ie(a.throw(x));
23
+ } catch (oe) {
24
+ ve(oe);
25
25
  }
26
- }, oe = (I) => I.done ? J(I.value) : Promise.resolve(I.value).then(ve, R);
27
- oe((c = c.apply(L, g)).next());
26
+ }, ie = (x) => x.done ? J(x.value) : Promise.resolve(x.value).then(ye, R);
27
+ ie((a = a.apply(L, g)).next());
28
28
  });
29
- import { jsx as a, jsxs as m, Fragment as at } from "react/jsx-runtime";
30
- import { useRef as $, useState as p, useLayoutEffect as Yt, useEffect as C, useCallback as en } from "react";
31
- import { message as D, ConfigProvider as tn, Space as me, Select as nn, Button as re, Dropdown as ct, Tabs as rn, Checkbox as dt, Col as on, Tooltip as ln, Empty as sn, Spin as an, Modal as we } from "antd";
32
- import cn from "rc-virtual-list";
33
- import { UploadZipsStatus as ie, PreLabelTaskStatus as dn } from "@glodon-aiot/apis";
29
+ import { jsx as c, jsxs as m, Fragment as ct } from "react/jsx-runtime";
30
+ import { useRef as j, useState as p, useLayoutEffect as Yt, useEffect as I, useCallback as en } from "react";
31
+ import { message as D, ConfigProvider as tn, Space as be, Select as nn, Button as ne, Dropdown as at, Tabs as rn, Checkbox as dt, Col as on, Tooltip as ln, Empty as sn, Spin as cn, Modal as Le } from "antd";
32
+ import an from "rc-virtual-list";
33
+ import { UploadZipsStatus as re, PreLabelTaskStatus as dn } from "@glodon-aiot/apis";
34
34
  import fn from "antd/es/locale/zh_CN";
35
35
  import hn from "../../DatasetContext/index.mjs";
36
36
  import un from "./icon_item_empty.svg.mjs";
@@ -57,22 +57,22 @@ var Tn = /* @__PURE__ */ ((L) => (L.Next = "NEXT", L.Prev = "PREV", L.Confirm =
57
57
  const sr = (L) => {
58
58
  const {
59
59
  services: g,
60
- datasetId: c,
60
+ datasetId: a,
61
61
  versionId: J,
62
- backTo: be,
63
- labelManager: ve = !1,
62
+ backTo: ve,
63
+ labelManager: ye = !1,
64
64
  datasetManager: R = !1,
65
- annotation: oe,
66
- header: I = {
65
+ annotation: ie,
66
+ header: x = {
67
67
  versionSelect: !1
68
68
  },
69
- exampleSrcRoot: le
70
- } = L, se = b({}, wn);
71
- Ln(se, L.filterSwitch);
72
- const ye = !!(R && R.delete), ae = !!(R && R.label), De = ye || ae, ce = $(null), Ne = $(null), [gt, pt] = p(0), [x, He] = p(), [o, de] = p(), [Se, mt] = p([]), [Ue, qe] = p(!1), [fe, Ke] = p(0), [he, We] = p(0), [h, Re] = p(""), [Q, $e] = p(0), [bt, vt] = p(), [je, Te] = p(!1), [Ge, yt] = p(!1), [Ze, St] = p(!0), [Ct, It] = p(!1), [O, _e] = p([]), [v, U] = p([]), [ue, j] = p(!1), [Y, ge] = p(!1), [M, V] = p(-1), [u, N] = p(), [xt, Xe] = p(), [d, z] = p(), [l, T] = p({
69
+ exampleSrcRoot: oe
70
+ } = L, le = b({}, wn);
71
+ Ln(le, L.filterSwitch);
72
+ const Se = !!(R && R.delete), se = !!(R && R.label), we = Se || se, ce = j(null), De = j(null), [gt, pt] = p(0), [k, Oe] = p(), [o, ae] = p(), [Ce, mt] = p([]), [He, Ue] = p(!1), [de, qe] = p(0), [fe, Ke] = p(0), [h, Ne] = p(""), [Q, We] = p(0), [bt, vt] = p(), [$e, Re] = p(!1), [je, yt] = p(!1), [Ge, St] = p(!0), [Ct, It] = p(!1), [O, Ze] = p([]), [v, U] = p([]), [he, G] = p(!1), [Y, ue] = p(!1), [M, V] = p(-1), [u, N] = p(), [xt, _e] = p(), [f, z] = p(), [l, T] = p({
73
73
  current: 0,
74
74
  pageSize: 100
75
- }), [W, Pe] = p([]), [G, kt] = p(""), [Lt, wt] = p(!1), [Je, Qe] = p(), [Ce, Ve] = p(null), [H, Ye] = p(!1), [Dt, Nt] = p(!1), [Pn, Rt] = p(0), [Vn, ze] = p(""), [ee, Tt] = p(""), pe = $({}), Ae = $(!1), Ie = $(0), xe = $(0), Z = $(0), [P, Ee] = p(/* @__PURE__ */ new Set()), [Pt, ke] = p(!1), et = $(-1);
75
+ }), [W, Te] = p([]), [Z, kt] = p(""), [Lt, wt] = p(!1), [Xe, Je] = p(), [Ie, Pe] = p(null), [H, Qe] = p(!1), [Dt, Nt] = p(!1), [Pn, Rt] = p(0), [Vn, Ve] = p(""), [ge, Tt] = p(""), pe = j({}), ze = j(!1), me = j(0), Ye = j(0), $ = j(0), [P, Ae] = p(/* @__PURE__ */ new Set()), [Pt, xe] = p(!1), et = j(-1);
76
76
  Yt(() => {
77
77
  const e = ce.current;
78
78
  if (!e)
@@ -80,8 +80,8 @@ const sr = (L) => {
80
80
  let t = 0;
81
81
  const n = () => {
82
82
  cancelAnimationFrame(t), t = requestAnimationFrame(() => {
83
- const s = e.clientHeight, f = Math.max(1, Math.round(s));
84
- f !== et.current && (et.current = f, pt(f));
83
+ const s = e.clientHeight, d = Math.max(1, Math.round(s));
84
+ d !== et.current && (et.current = d, pt(d));
85
85
  });
86
86
  };
87
87
  n();
@@ -91,78 +91,78 @@ const sr = (L) => {
91
91
  return i == null || i.addEventListener("resize", n), window.addEventListener("resize", n), () => {
92
92
  cancelAnimationFrame(t), r == null || r.disconnect(), i == null || i.removeEventListener("resize", n), window.removeEventListener("resize", n);
93
93
  };
94
- }, [x]);
95
- const te = () => {
96
- N(void 0), z(void 0), V(-1), j(!1), q(), setTimeout(() => {
97
- T((e) => y(b({}, e), {
94
+ }, [k]);
95
+ const ee = () => {
96
+ N(void 0), z(void 0), V(-1), G(!1), q(), setTimeout(() => {
97
+ T((e) => S(b({}, e), {
98
98
  current: 1,
99
99
  type: void 0
100
100
  }));
101
101
  }, 10);
102
102
  };
103
- pn("Esc", te), C(() => {
104
- c && g.cvforceDatahub.getS3Iam(c).then((e) => {
103
+ pn("Esc", ee), I(() => {
104
+ a && g.cvforceDatahub.getS3Iam(a).then((e) => {
105
105
  vt(e);
106
106
  });
107
- }, [c]), C(() => {
107
+ }, [a]), I(() => {
108
108
  w();
109
- }, [o == null ? void 0 : o.id]), C(() => {
110
- c && (qe(!0), Promise.all([
109
+ }, [o == null ? void 0 : o.id]), I(() => {
110
+ a && (Ue(!0), Promise.all([
111
111
  // 数据集
112
- g.cvforceDatahub.getDatasetsId(c).then((e) => {
113
- He(e);
112
+ g.cvforceDatahub.getDatasetsId(a).then((e) => {
113
+ Oe(e);
114
114
  }),
115
115
  // 版本列表
116
- g.cvforceDatahub.getDatasetsIdVersions(c, 1, 1e3).then((e) => {
117
- mt(e.recordList), de(J ? e.recordList.find((t) => t.id === J) : e.recordList[0]);
116
+ g.cvforceDatahub.getDatasetsIdVersions(a, 1, 1e3).then((e) => {
117
+ mt(e.recordList), ae(J ? e.recordList.find((t) => t.id === J) : e.recordList[0]);
118
118
  })
119
- ]).finally(() => qe(!1)));
120
- }, [c, J]);
119
+ ]).finally(() => Ue(!1)));
120
+ }, [a, J]);
121
121
  const tt = () => {
122
- !c || !o || g.cvforceDatahub.getDatasetsIdVersionsVid(c, o.id).then((e) => {
123
- de(e), kt(e.versionAsyncTask.state);
122
+ !a || !o || g.cvforceDatahub.getDatasetsIdVersionsVid(a, o.id).then((e) => {
123
+ ae(e), kt(e.versionAsyncTask.state);
124
124
  });
125
125
  };
126
- C(() => {
127
- G !== ie.Pending && G !== ie.Started || D.warning("文件导入中,请刷新页面再试");
128
- }, [G]), C(() => {
129
- de(void 0), T(y(b({}, l), {
126
+ I(() => {
127
+ Z !== re.Pending && Z !== re.Started || D.warning("文件导入中,请刷新页面再试");
128
+ }, [Z]), I(() => {
129
+ ae(void 0), T(S(b({}, l), {
130
130
  current: 1
131
131
  })), U([]), tt();
132
- }, [c, J]), C(() => {
133
- c && g.cvforceDatahub.getDatasetsId(c).then((e) => {
134
- He(e);
132
+ }, [a, J]), I(() => {
133
+ a && g.cvforceDatahub.getDatasetsId(a).then((e) => {
134
+ Oe(e);
135
135
  });
136
- }, [c]), C(() => {
137
- Ie.current++, xe.current++, Z.current++;
138
- }, [x == null ? void 0 : x.id, o == null ? void 0 : o.id, h, W, ee]), C(() => {
136
+ }, [a]), I(() => {
137
+ me.current++, $.current++;
138
+ }, [k == null ? void 0 : k.id, o == null ? void 0 : o.id, h, W]), I(() => {
139
139
  q();
140
- }, [W, o, h]), C(() => {
141
- !o || !x || A(y(b({}, l), {
140
+ }, [W, o, h]), I(() => {
141
+ !o || !k || A(S(b({}, l), {
142
142
  current: 1
143
143
  })).then((e) => {
144
144
  });
145
- }, [x == null ? void 0 : x.id, o == null ? void 0 : o.id, W]), C(() => {
146
- if (Ae.current) {
147
- Ae.current = !1, w();
145
+ }, [k == null ? void 0 : k.id, o == null ? void 0 : o.id, W]), I(() => {
146
+ if (ze.current) {
147
+ ze.current = !1, w();
148
148
  return;
149
149
  }
150
150
  A().then((e) => {
151
151
  }), w();
152
- }, [l.current]), C(() => {
152
+ }, [l.current]), I(() => {
153
153
  H && w();
154
- }, [Je]), C(() => {
154
+ }, [Xe]), I(() => {
155
155
  const e = pe.current[h];
156
156
  let t;
157
- e && e.page > 1 ? t = A(y(b({}, l), {
157
+ e && e.page > 1 ? t = A(S(b({}, l), {
158
158
  current: 1,
159
159
  pageSize: e.page * 100,
160
160
  // 假设默认pageSize为100
161
161
  total: void 0
162
- })).then((n) => (Ae.current = !0, T((r) => y(b({}, r), {
162
+ })).then((n) => (ze.current = !0, T((r) => S(b({}, r), {
163
163
  current: e.page,
164
164
  pageSize: 100
165
- })), n)) : t = A(y(b({}, l), {
165
+ })), n)) : t = A(S(b({}, l), {
166
166
  current: 1,
167
167
  total: void 0
168
168
  })), t.then((n) => {
@@ -172,26 +172,26 @@ const sr = (L) => {
172
172
  V(s), N(n[s]), z(void 0);
173
173
  } else
174
174
  N(void 0), z(void 0), V(-1), q(), setTimeout(() => {
175
- T((r) => y(b({}, r), {
175
+ T((r) => S(b({}, r), {
176
176
  current: 1,
177
177
  type: void 0
178
178
  }));
179
179
  }, 10);
180
180
  });
181
- }, [h]), C(() => {
181
+ }, [h]), I(() => {
182
182
  var t;
183
183
  let e;
184
184
  if (!Y) {
185
185
  const n = u !== void 0, r = u == null ? void 0 : u.id, i = M;
186
- N(void 0), z(void 0), j(!1), V(-1), Xe(void 0), q(), n && ((t = Ne.current) == null || t.fetchLabels()), w(), r !== void 0 && (e = requestAnimationFrame(() => {
186
+ N(void 0), z(void 0), G(!1), V(-1), _e(void 0), q(), n && ((t = De.current) == null || t.fetchLabels()), w(), r !== void 0 && (e = requestAnimationFrame(() => {
187
187
  var F, X;
188
188
  const s = (F = ce.current) == null ? void 0 : F.getElementsByClassName("rc-virtual-list-holder")[0];
189
189
  if (!s)
190
190
  return;
191
- const f = Array.from(s.querySelectorAll("[data-sample-id]")), S = (X = f.find((B) => B.dataset.sampleId === String(r))) != null ? X : i >= 0 ? f[i] : void 0;
192
- if (!S)
191
+ const d = Array.from(s.querySelectorAll("[data-sample-id]")), y = (X = d.find((B) => B.dataset.sampleId === String(r))) != null ? X : i >= 0 ? d[i] : void 0;
192
+ if (!y)
193
193
  return;
194
- const k = s.getBoundingClientRect(), E = S.getBoundingClientRect(), K = s.scrollTop + E.top - k.top - Math.max(0, (s.clientHeight - E.height) / 2);
194
+ const C = s.getBoundingClientRect(), E = y.getBoundingClientRect(), K = s.scrollTop + E.top - C.top - Math.max(0, (s.clientHeight - E.height) / 2);
195
195
  s.scrollTo({
196
196
  top: Math.max(0, K)
197
197
  });
@@ -202,68 +202,68 @@ const sr = (L) => {
202
202
  };
203
203
  }, [Y]);
204
204
  const Vt = en((e, t) => {
205
- Xe(e ? void 0 : t);
205
+ _e(e ? void 0 : t);
206
206
  }, []);
207
207
  Rn({
208
208
  samples: v,
209
209
  currentIndex: M,
210
210
  active: Y,
211
211
  loadedImageUrl: xt
212
- }), C(() => {
213
- It(!Ze && Ge);
214
- }, [Ze, Ge]), C(() => {
215
- if (!c) {
216
- Ce && (clearTimeout(Ce), Ve(null)), Qe(void 0);
212
+ }), I(() => {
213
+ It(!Ge && je);
214
+ }, [Ge, je]), I(() => {
215
+ if (!a) {
216
+ Ie && (clearTimeout(Ie), Pe(null)), Je(void 0);
217
217
  return;
218
218
  }
219
- Me();
220
- }, [c, o == null ? void 0 : o.id]), C(() => {
221
- Me();
222
- }, [Lt]), C(() => {
223
219
  Be();
224
- }, [H, c, o]), C(() => {
225
- A(y(b({}, l), {
220
+ }, [a, o == null ? void 0 : o.id]), I(() => {
221
+ Be();
222
+ }, [Lt]), I(() => {
223
+ Ee();
224
+ }, [H, a, o]), I(() => {
225
+ me.current++, $.current++, A(S(b({}, l), {
226
226
  current: 1
227
227
  })), w();
228
- }, [ee]), C(() => {
229
- ze("");
230
- }, [u]), C(() => {
228
+ }, [ge]), I(() => {
229
+ Ve("");
230
+ }, [u]), I(() => {
231
231
  if (v.length === 0) {
232
- ke(!1);
232
+ xe(!1);
233
233
  return;
234
234
  }
235
235
  const e = v.every((t) => P.has(t.id));
236
- ke(e);
236
+ xe(e);
237
237
  }, [v, P]);
238
- const Be = () => {
239
- o && g.cvforceDatahub.getDatasetsIdVersionsVidSamples(c, o.id, {
238
+ const Ee = () => {
239
+ o && g.cvforceDatahub.getDatasetsIdVersionsVidSamples(a, o.id, {
240
240
  pageNo: 1,
241
241
  pageSize: 1e3,
242
242
  confirmStatus: 1
243
243
  }).then((e) => {
244
244
  Rt(e.recordList.length);
245
245
  });
246
- }, Me = () => {
247
- !c || !o || g.cvforceDatahub.getPreLabelTask(c, o.id).then((e) => {
246
+ }, Be = () => {
247
+ !a || !o || g.cvforceDatahub.getPreLabelTask(a, o.id).then((e) => {
248
248
  const t = e[0];
249
- if (Qe(t), Ce && (clearTimeout(Ce), Ve(null)), !(t != null && t.state) || t.state !== dn.Started) {
250
- Ye(!1), w();
249
+ if (Je(t), Ie && (clearTimeout(Ie), Pe(null)), !(t != null && t.state) || t.state !== dn.Started) {
250
+ Qe(!1), w();
251
251
  return;
252
252
  } else
253
- Ye(!0);
254
- Ve(setTimeout(() => {
255
- Me();
253
+ Qe(!0);
254
+ Pe(setTimeout(() => {
255
+ Be();
256
256
  }, 1e4));
257
257
  });
258
258
  };
259
- C(() => {
260
- x && x.markType !== "detection" && console.error("当前数据集不是detection(物体检测)类型,请检查数据集类型。");
261
- }, [x]);
259
+ I(() => {
260
+ k && k.markType !== "detection" && console.error("当前数据集不是detection(物体检测)类型,请检查数据集类型。");
261
+ }, [k]);
262
262
  const A = (e, t) => {
263
263
  const n = (e == null ? void 0 : e.current) || l.current, r = (e == null ? void 0 : e.pageSize) || l.pageSize;
264
- if (!c || !o || !n)
264
+ if (!a || !o || !n)
265
265
  return Promise.resolve(!1);
266
- const i = Ie.current, s = W.map((k) => k.label), f = () => {
266
+ const i = me.current, s = W.map((C) => C.label), d = () => {
267
267
  switch (h) {
268
268
  case "nocode":
269
269
  return "nocode";
@@ -274,7 +274,7 @@ const sr = (L) => {
274
274
  default:
275
275
  return s.length ? s : void 0;
276
276
  }
277
- }, S = () => {
277
+ }, y = () => {
278
278
  switch (h) {
279
279
  case "nocode":
280
280
  case "hascode":
@@ -285,99 +285,103 @@ const sr = (L) => {
285
285
  return 2;
286
286
  }
287
287
  };
288
- return n === 1 && Ht(), T(y(b({}, l), {
288
+ return n === 1 && Ht(), T(S(b({}, l), {
289
289
  current: n,
290
290
  pageSize: r
291
- })), g.cvforceDatahub.getDatasetsIdVersionsVidSamples(c, o.id, {
291
+ })), g.cvforceDatahub.getDatasetsIdVersionsVidSamples(a, o.id, {
292
292
  pageNo: n,
293
293
  pageSize: r,
294
- labels: f(),
295
- confirmStatus: S(),
296
- searchName: ee
297
- }).then((k) => {
298
- if (i !== Ie.current)
294
+ labels: d(),
295
+ confirmStatus: y(),
296
+ searchName: ge
297
+ }).then((C) => {
298
+ if (i !== me.current)
299
299
  return !1;
300
- const E = k.recordList || [], K = n === 1 ? E : [...t || v, ...E];
301
- if (U(K), T(y(b({}, l), {
300
+ const E = C.recordList || [], K = n === 1 ? E : [...t || v, ...E];
301
+ if (U(K), T(S(b({}, l), {
302
302
  current: n,
303
303
  pageSize: r,
304
- total: k.totalResults
304
+ total: C.totalResults
305
305
  })), l.type === "next" && E.length) {
306
306
  V(0);
307
- const F = k.recordList[0];
307
+ const F = C.recordList[0];
308
308
  N(F);
309
309
  }
310
310
  if (l.type === "prev" && E.length) {
311
311
  V(l.pageSize - 1);
312
- const F = k.recordList[l.pageSize - 1];
312
+ const F = C.recordList[l.pageSize - 1];
313
313
  N(F);
314
314
  }
315
- return ue && M < 0 && (V(0), N(E[0]), ge(!0)), K;
315
+ return he && M < 0 && (V(0), N(E[0]), ue(!0)), K;
316
316
  }).catch(() => !1);
317
317
  };
318
- C(() => {
319
- T(h === "nocode" ? y(b({}, l), {
320
- total: fe
321
- }) : h === "" ? y(b({}, l), {
318
+ I(() => {
319
+ T(h === "nocode" ? S(b({}, l), {
320
+ total: de
321
+ }) : h === "" ? S(b({}, l), {
322
322
  total: Q
323
- }) : h === "pending" ? y(b({}, l), {
324
- total: he
325
- }) : y(b({}, l), {
326
- total: Q - fe - he
323
+ }) : h === "pending" ? S(b({}, l), {
324
+ total: fe
325
+ }) : S(b({}, l), {
326
+ total: Q - de - fe
327
327
  }));
328
- }, [fe, Q, he]);
328
+ }, [de, Q, fe]);
329
329
  const w = () => {
330
- !c || !o || g.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(c, o.id, {
330
+ !a || !o || g.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(a, o.id, {
331
331
  label: "allcode",
332
332
  confirmStatus: 2,
333
- searchName: ee
333
+ searchName: ge
334
334
  }).then((e) => {
335
335
  const t = e.find((i) => i.id === "allcodeid"), n = e.find((i) => i.id === "nocodeid"), r = e.find((i) => i.id === "pendingid");
336
- $e(t ? t.count : 0), Ke(n ? n.count : 0), We(r ? r.count : 0);
336
+ We(t ? t.count : 0), qe(n ? n.count : 0), Ke(r ? r.count : 0);
337
337
  });
338
338
  }, q = () => {
339
- if (!c || !(o != null && o.id))
339
+ if (!a || !(o != null && o.id))
340
340
  return;
341
- const e = xe.current;
341
+ const e = ++Ye.current;
342
342
  let t = 2;
343
- return h === "pending" ? t = 1 : h === "hascode" && (t = 0), g.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(c, o.id, {
343
+ return h === "pending" ? t = 1 : h === "hascode" && (t = 0), g.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(a, o.id, {
344
344
  confirmStatus: t
345
345
  }).then((n) => {
346
- if (e !== xe.current)
346
+ if (e !== Ye.current)
347
347
  return;
348
- const i = (n || []).filter((s) => s.label !== "nocode").map((s, f) => ({
349
- label: s.label,
350
- count: s.count,
351
- id: s.id,
352
- color: ft[f % 40]
353
- }));
354
- return _e(i), n;
348
+ const i = (n || []).filter((s) => s.label !== "nocode").map((s, d) => {
349
+ var y;
350
+ return {
351
+ label: s.label,
352
+ count: s.count,
353
+ boxCount: (y = s.boxCount) != null ? y : 0,
354
+ id: s.id,
355
+ color: ft[d % 40]
356
+ };
357
+ });
358
+ return Ze(i), n;
355
359
  });
356
360
  }, zt = (e) => {
357
361
  if (!v)
358
362
  return;
359
- j(!1), V(e);
363
+ G(!1), V(e);
360
364
  const t = v[e];
361
- N(t), z(void 0), ge(!0), h !== void 0 && (pe.current[h] = {
365
+ N(t), z(void 0), ue(!0), h !== void 0 && (pe.current[h] = {
362
366
  index: e,
363
367
  page: l.current || 1
364
368
  });
365
369
  };
366
- C(() => {
370
+ I(() => {
367
371
  l.type || A();
368
- }, [l.type]), C(() => {
369
- if (!d)
372
+ }, [l.type]), I(() => {
373
+ if (!f)
370
374
  return;
371
375
  const e = [];
372
- d == null || d.labels.forEach((t) => {
376
+ f == null || f.labels.forEach((t) => {
373
377
  O != null && O.find((n) => n.id === t.id) && e.push(t);
374
- }), e.length !== d.labels.length && z(y(b({}, d), {
378
+ }), e.length !== f.labels.length && z(S(b({}, f), {
375
379
  labels: e
376
380
  }));
377
381
  }, [O]);
378
382
  const _ = (e, t, n, r) => {
379
383
  setTimeout(() => {
380
- r === Z.current && (V(t), N(e[t]), z(void 0), h !== void 0 && (pe.current[h] = {
384
+ r === $.current && (V(t), N(e[t]), z(void 0), h !== void 0 && (pe.current[h] = {
381
385
  index: t,
382
386
  page: n
383
387
  }));
@@ -385,37 +389,37 @@ const sr = (L) => {
385
389
  }, nt = (e, t) => {
386
390
  if (!v)
387
391
  return;
388
- const n = ++Z.current;
389
- if (!ue) {
392
+ const n = ++$.current;
393
+ if (!he) {
390
394
  U((r) => {
391
- var S;
395
+ var y;
392
396
  if (!Array.isArray(r) || !r.length)
393
- return te(), r;
394
- const i = M + 1, f = !!W.length ? r.length : (S = l.total) != null ? S : r.length;
395
- return i >= r.length ? i >= f ? D.error("已经是最后一个了") : A({
397
+ return ee(), r;
398
+ const i = M + 1, d = !!W.length ? r.length : (y = l.total) != null ? y : r.length;
399
+ return i >= r.length ? i >= d ? D.error("已经是最后一个了") : A({
396
400
  current: l.current + 1,
397
401
  pageSize: l.pageSize,
398
402
  type: "next"
399
- }, r).then((k) => {
400
- Array.isArray(k) && _(k, i, l.current + 1, n);
403
+ }, r).then((C) => {
404
+ Array.isArray(C) && _(C, i, l.current + 1, n);
401
405
  }) : _(r, i, l.current || 1, n), r;
402
406
  });
403
407
  return;
404
408
  }
405
- return Le(e, t).then((r) => (r && n === Z.current && (console.log("action", t, "changedSample", d), w(), U((i) => {
406
- var f, S;
409
+ return ke(e, t).then((r) => (r && n === $.current && (console.log("action", t, "changedSample", f), w(), U((i) => {
410
+ var d, y;
407
411
  let s;
408
412
  if (Array.isArray(i)) {
409
413
  if (!i.length)
410
- return te(), i;
411
- const k = h === "", E = (!((f = d == null ? void 0 : d.labels) != null && f.length) || !d) && h === "nocode", K = t !== "CONFIRM" && h === "pending", F = (((S = d == null ? void 0 : d.labels) == null ? void 0 : S.length) || !d) && h === "hascode", X = k || K || F || E ? M + 1 : M;
412
- if (d) {
413
- if (d.labels.length && h === "nocode" || !d.labels.length && h === "hascode" || t === "CONFIRM" && h === "pending") {
414
- const B = i.findIndex((Fe) => Fe.id === d.id);
414
+ return ee(), i;
415
+ const C = h === "", E = (!((d = f == null ? void 0 : f.labels) != null && d.length) || !f) && h === "nocode", K = t !== "CONFIRM" && h === "pending", F = (((y = f == null ? void 0 : f.labels) == null ? void 0 : y.length) || !f) && h === "hascode", X = C || K || F || E ? M + 1 : M;
416
+ if (f) {
417
+ if (f.labels.length && h === "nocode" || !f.labels.length && h === "hascode" || t === "CONFIRM" && h === "pending") {
418
+ const B = i.findIndex((Me) => Me.id === f.id);
415
419
  B > -1 && (i.splice(B, 1), s = [...i], l.total && (l.total = l.total - 1));
416
420
  }
417
421
  } else if (t === "CONFIRM" && h === "pending") {
418
- const B = i.findIndex((Fe) => Fe.id === (u == null ? void 0 : u.id));
422
+ const B = i.findIndex((Me) => Me.id === (u == null ? void 0 : u.id));
419
423
  B > -1 && (i.splice(B, 1), s = [...i], l.total && (l.total = l.total - 1));
420
424
  }
421
425
  if (X >= i.length)
@@ -441,22 +445,22 @@ const sr = (L) => {
441
445
  }, At = (e) => {
442
446
  if (!v)
443
447
  return;
444
- const t = ++Z.current;
445
- if (!ue) {
448
+ const t = ++$.current;
449
+ if (!he) {
446
450
  U((n) => {
447
451
  if (!Array.isArray(n) || !n.length)
448
- return te(), n;
452
+ return ee(), n;
449
453
  const r = M - 1;
450
454
  return r < 0 ? D.error("已经是第一个了") : _(n, r, l.current || 1, t), n;
451
455
  });
452
456
  return;
453
457
  }
454
- Le(e).then((n) => {
455
- n && t === Z.current && (w(), U((r) => {
458
+ ke(e).then((n) => {
459
+ n && t === $.current && (w(), U((r) => {
456
460
  let i;
457
461
  if (Array.isArray(r)) {
458
462
  if (!r.length)
459
- return te(), r;
463
+ return ee(), r;
460
464
  const s = M - 1;
461
465
  if (s < 0)
462
466
  s < 0 ? D.error("已经是第一个了") : T({
@@ -465,9 +469,9 @@ const sr = (L) => {
465
469
  type: "prev"
466
470
  });
467
471
  else {
468
- if (d && (d.labels.length && h === "nocode" || !d.labels.length && h === "hascode")) {
469
- const f = r.findIndex((S) => S.id === d.id);
470
- f > -1 && (r.splice(f, 1), i = [...r], l.total && (l.total = l.total - 1));
472
+ if (f && (f.labels.length && h === "nocode" || !f.labels.length && h === "hascode")) {
473
+ const d = r.findIndex((y) => y.id === f.id);
474
+ d > -1 && (r.splice(d, 1), i = [...r], l.total && (l.total = l.total - 1));
471
475
  }
472
476
  _(r, s, l.current || 1, t);
473
477
  }
@@ -479,78 +483,78 @@ const sr = (L) => {
479
483
  const t = Object.keys(e.labels.reduce((n, r) => (n[r.label] ? ++n[r.label] : n[r.label] = 1, n), {})).length;
480
484
  return t >= 2 ? `+${t - 1}` : null;
481
485
  }, Bt = (e) => {
482
- var k, E;
486
+ var C, E;
483
487
  const {
484
488
  scrollTop: t,
485
489
  scrollHeight: n,
486
490
  clientHeight: r
487
- } = e.currentTarget, i = n - t - r, s = 3, f = (k = l.pageSize) != null ? k : 100, S = (E = l.current) != null ? E : 0;
488
- S >= 1 && v.length > 0 && v.length < S * f || (!l.total || l.total > v.length) && i <= s && T((K) => {
491
+ } = e.currentTarget, i = n - t - r, s = 3, d = (C = l.pageSize) != null ? C : 100, y = (E = l.current) != null ? E : 0;
492
+ y >= 1 && v.length > 0 && v.length < y * d || (!l.total || l.total > v.length) && i <= s && T((K) => {
489
493
  var F;
490
- return y(b({}, K), {
494
+ return S(b({}, K), {
491
495
  current: ((F = K.current) != null ? F : 0) + 1
492
496
  });
493
497
  });
494
- }, Le = (e, t) => {
498
+ }, ke = (e, t) => {
495
499
  var n, r;
496
500
  if (!o)
497
501
  return Promise.resolve(!1);
498
- if (d && !H) {
499
- const i = y(b({}, d), {
500
- labels: d.labels ? [...d.labels] : []
502
+ if (f && !H) {
503
+ const i = S(b({}, f), {
504
+ labels: f.labels ? [...f.labels] : []
501
505
  });
502
- return i.labels && (i.labels = i.labels.filter((s) => !!s.id)), e !== void 0 && (i.confirmStatus = e, i.isLabeled = ((n = i.labels) == null ? void 0 : n.length) > 0), g.cvforceDatahub.updateSamples(c, o.id, [i], e).then(() => {
506
+ return i.labels && (i.labels = i.labels.filter((s) => !!s.id)), e !== void 0 && (i.confirmStatus = e, i.isLabeled = ((n = i.labels) == null ? void 0 : n.length) > 0), g.cvforceDatahub.updateSamples(a, o.id, [i], e).then(() => {
503
507
  D.success({
504
508
  content: "保存成功"
505
509
  });
506
- const s = y(b({}, i), {
510
+ const s = S(b({}, i), {
507
511
  labels: i.labels ? [...i.labels] : []
508
512
  });
509
- return U((f) => {
510
- const S = f.findIndex((k) => k.id === (s == null ? void 0 : s.id));
511
- if (S > -1) {
512
- const k = [...f];
513
- return k[S] = s, k;
513
+ return U((d) => {
514
+ const y = d.findIndex((C) => C.id === (s == null ? void 0 : s.id));
515
+ if (y > -1) {
516
+ const C = [...d];
517
+ return C[y] = s, C;
514
518
  }
515
- return f;
519
+ return d;
516
520
  }), N(s), z(s), !0;
517
521
  }).catch(() => !1);
518
522
  } else
519
- return !d && !H && u ? t !== "CONFIRM" && h === "pending" || h === "nocode" || h === "hascode" || h === "" && (u.confirmStatus !== 1 || t !== "CONFIRM") ? Promise.resolve(!0) : (u.labels && (u.labels = u.labels.filter((i) => !!i.id)), e !== void 0 && (u.confirmStatus = e, u.isLabeled = ((r = u.labels) == null ? void 0 : r.length) > 0), g.cvforceDatahub.updateSamples(c, o.id, [u], e).then(() => (D.success({
523
+ return !f && !H && u ? t !== "CONFIRM" && h === "pending" || h === "nocode" || h === "hascode" || h === "" && (u.confirmStatus !== 1 || t !== "CONFIRM") ? Promise.resolve(!0) : (u.labels && (u.labels = u.labels.filter((i) => !!i.id)), e !== void 0 && (u.confirmStatus = e, u.isLabeled = ((r = u.labels) == null ? void 0 : r.length) > 0), g.cvforceDatahub.updateSamples(a, o.id, [u], e).then(() => (D.success({
520
524
  content: "保存成功"
521
525
  }), U((i) => {
522
- const s = i.findIndex((f) => f.id === (u == null ? void 0 : u.id));
526
+ const s = i.findIndex((d) => d.id === (u == null ? void 0 : u.id));
523
527
  return s > -1 && (i[s] = u), [...i];
524
528
  }), N(b({}, u)), !0)).catch(() => !1)) : Promise.resolve(!0);
525
529
  }, Mt = (e, t) => {
526
- if (d && d.labels.some((n) => !n.id))
530
+ if (f && f.labels.some((n) => !n.id))
527
531
  return D.error("所有标注需设置标签"), Promise.resolve(!1);
528
532
  nt(e, t);
529
533
  }, Ft = (e) => {
530
- if (d && d.labels.some((t) => !t.id)) {
534
+ if (f && f.labels.some((t) => !t.id)) {
531
535
  D.error("所有标注需设置标签");
532
536
  return;
533
537
  }
534
- if (!d) {
535
- j(!1);
538
+ if (!f) {
539
+ G(!1);
536
540
  return;
537
541
  }
538
- Le(e).then((t) => {
539
- t && (z(void 0), j(!1), w(), q());
542
+ ke(e).then((t) => {
543
+ t && (z(void 0), G(!1), w(), q());
540
544
  });
541
545
  }, Ot = () => {
542
- we.confirm({
546
+ Le.confirm({
543
547
  title: "确认要删除当前数据吗?",
544
548
  content: "数据包含当前标注的内容和图片,删除后无法恢复,请确认是否删除!",
545
549
  onOk: () => {
546
- !u || !o || g.cvforceDatahub.delDatasetsIdVersionsVidSamplesId(c, o.id, u.id).then(() => {
550
+ !u || !o || g.cvforceDatahub.delDatasetsIdVersionsVidSamplesId(a, o.id, u.id).then(() => {
547
551
  const e = v.findIndex((n) => n.id === u.id);
548
552
  v.splice(e, 1);
549
553
  const t = v.length;
550
- U([...v]), T(y(b({}, l), {
554
+ U([...v]), T(S(b({}, l), {
551
555
  total: l.total ? l.total - 1 : 0
552
- })), e <= v.length - 1 ? N(v[e]) : (N(v[e - 1]), V(e - 1)), w(), z(void 0), (t === 0 || l.total && l.total - 1 === 0) && (N(void 0), z(void 0), V(-1), ue || ge(!1), setTimeout(() => {
553
- T((n) => y(b({}, n), {
556
+ })), e <= v.length - 1 ? N(v[e]) : (N(v[e - 1]), V(e - 1)), w(), z(void 0), (t === 0 || l.total && l.total - 1 === 0) && (N(void 0), z(void 0), V(-1), he || ue(!1), setTimeout(() => {
557
+ T((n) => S(b({}, n), {
554
558
  current: 1,
555
559
  type: void 0
556
560
  }));
@@ -564,15 +568,15 @@ const sr = (L) => {
564
568
  children: null
565
569
  }, {
566
570
  key: "nocode",
567
- label: `未标注(${fe})`,
571
+ label: `未标注(${de})`,
568
572
  children: null
569
573
  }, {
570
574
  key: "pending",
571
- label: `待确认(${he})`,
575
+ label: `待确认(${fe})`,
572
576
  children: null
573
577
  }, {
574
578
  key: "hascode",
575
- label: `已标注(${Q - fe - he})`,
579
+ label: `已标注(${Q - de - fe})`,
576
580
  children: null
577
581
  }], Ht = () => {
578
582
  var e, t;
@@ -580,26 +584,26 @@ const sr = (L) => {
580
584
  top: 0
581
585
  });
582
586
  }, Ut = (e) => {
583
- Tt(e), ne();
587
+ Tt(e), te();
584
588
  }, it = (e) => {
585
- Ie.current++, xe.current++, Z.current++, M >= 0 && h !== void 0 && h !== null && (pe.current[h] = {
589
+ me.current++, $.current++, M >= 0 && h !== void 0 && h !== null && (pe.current[h] = {
586
590
  index: M,
587
591
  page: l.current || 1
588
- }), ne(), d ? Le(d == null ? void 0 : d.confirmStatus).then((t) => {
589
- t ? (Re(e), w()) : D.error("保存失败");
590
- }) : (T(y(b({}, l), {
592
+ }), te(), f ? ke(f == null ? void 0 : f.confirmStatus).then((t) => {
593
+ t ? (Ne(e), w()) : D.error("保存失败");
594
+ }) : (T(S(b({}, l), {
591
595
  current: 1,
592
596
  total: void 0
593
- })), Re(e)), e === "nocode" && Pe([]);
597
+ })), Ne(e)), e === "nocode" && Te([]);
594
598
  }, qt = () => {
595
599
  if (console.log("一键确认", g, o), !(g != null && g.cvforceDatahub) || !(o != null && o.id))
596
600
  return Promise.resolve(!1);
597
- we.confirm({
601
+ Le.confirm({
598
602
  title: "一键保存所有标注?",
599
603
  content: "待确认的所有带预标注信息的图片将保存至已标注页签下",
600
604
  onOk: () => {
601
- g.cvforceDatahub.getAllConfirmSamples(c, o.id).then((e) => {
602
- D.success("保存成功"), A(y(b({}, l), {
605
+ g.cvforceDatahub.getAllConfirmSamples(a, o.id).then((e) => {
606
+ D.success("保存成功"), A(S(b({}, l), {
603
607
  current: 1
604
608
  })), w();
605
609
  });
@@ -607,16 +611,16 @@ const sr = (L) => {
607
611
  });
608
612
  }, Kt = (e, t) => {
609
613
  const n = new Set(P);
610
- t ? n.add(e) : n.delete(e), Ee(n);
614
+ t ? n.add(e) : n.delete(e), Ae(n);
611
615
  }, Wt = (e) => {
612
616
  const t = new Set(P);
613
617
  e ? v.forEach((n) => {
614
618
  t.add(n.id);
615
619
  }) : v.forEach((n) => {
616
620
  t.delete(n.id);
617
- }), Ee(t), ke(e);
618
- }, ne = () => {
619
- Ee(/* @__PURE__ */ new Set()), ke(!1);
621
+ }), Ae(t), xe(e);
622
+ }, te = () => {
623
+ Ae(/* @__PURE__ */ new Set()), xe(!1);
620
624
  }, ot = () => {
621
625
  const e = v.filter((n) => P.has(n.id)), t = {
622
626
  nocode: 0,
@@ -627,14 +631,14 @@ const sr = (L) => {
627
631
  n.confirmStatus === 1 ? t.pending++ : !n.labels || n.labels.length === 0 ? t.nocode++ : t.hascode++;
628
632
  }), t;
629
633
  }, $t = () => {
630
- if (!ye)
634
+ if (!Se)
631
635
  return;
632
636
  if (P.size === 0) {
633
637
  D.warning("请先选择要删除的图片");
634
638
  return;
635
639
  }
636
640
  const e = ot(), t = e.nocode > 0, n = e.pending > 0, r = e.hascode > 0, i = /* @__PURE__ */ m("div", {
637
- children: [/* @__PURE__ */ a("p", {
641
+ children: [/* @__PURE__ */ c("p", {
638
642
  style: {
639
643
  marginBottom: 16
640
644
  },
@@ -649,7 +653,7 @@ const sr = (L) => {
649
653
  alignItems: "center",
650
654
  marginBottom: 4
651
655
  },
652
- children: [/* @__PURE__ */ a("span", {
656
+ children: [/* @__PURE__ */ c("span", {
653
657
  style: {
654
658
  display: "inline-block",
655
659
  padding: "2px 8px",
@@ -669,7 +673,7 @@ const sr = (L) => {
669
673
  alignItems: "center",
670
674
  marginBottom: 4
671
675
  },
672
- children: [/* @__PURE__ */ a("span", {
676
+ children: [/* @__PURE__ */ c("span", {
673
677
  style: {
674
678
  display: "inline-block",
675
679
  padding: "2px 8px",
@@ -689,7 +693,7 @@ const sr = (L) => {
689
693
  alignItems: "center",
690
694
  marginBottom: 4
691
695
  },
692
- children: [/* @__PURE__ */ a("span", {
696
+ children: [/* @__PURE__ */ c("span", {
693
697
  style: {
694
698
  display: "inline-block",
695
699
  padding: "2px 8px",
@@ -704,20 +708,20 @@ const sr = (L) => {
704
708
  children: [e.hascode, "张"]
705
709
  })]
706
710
  })]
707
- }), /* @__PURE__ */ a("p", {
711
+ }), /* @__PURE__ */ c("p", {
708
712
  style: {
709
713
  color: "red"
710
714
  },
711
715
  children: "彻底移除选中的图片文件及其关联的所有标注坐标、标签信息。数据不可恢复。"
712
716
  })]
713
717
  });
714
- we.confirm({
718
+ Le.confirm({
715
719
  title: "删除操作确认",
716
720
  content: i,
717
721
  okText: "确定",
718
722
  cancelText: "取消",
719
723
  width: 500,
720
- onOk: () => Oe(void 0, null, function* () {
724
+ onOk: () => Fe(void 0, null, function* () {
721
725
  if (!o)
722
726
  return;
723
727
  const s = Array.from(P);
@@ -726,23 +730,23 @@ const sr = (L) => {
726
730
  return;
727
731
  }
728
732
  try {
729
- yield g.cvforceDatahub.delDatasetsIdVersionsVidSamples(c, o.id, s), D.success("删除成功"), ne(), A(y(b({}, l), {
733
+ yield g.cvforceDatahub.delDatasetsIdVersionsVidSamples(a, o.id, s), D.success("删除成功"), te(), A(S(b({}, l), {
730
734
  current: 1
731
735
  })), w(), q();
732
- } catch (f) {
736
+ } catch (d) {
733
737
  D.error("删除失败");
734
738
  }
735
739
  })
736
740
  });
737
741
  }, jt = () => {
738
- if (!ae)
742
+ if (!se)
739
743
  return;
740
744
  if (P.size === 0) {
741
745
  D.warning("请先选择要清除标注的图片");
742
746
  return;
743
747
  }
744
748
  const e = ot(), t = e.nocode > 0, n = e.pending > 0, r = e.hascode > 0, i = /* @__PURE__ */ m("div", {
745
- children: [/* @__PURE__ */ a("p", {
749
+ children: [/* @__PURE__ */ c("p", {
746
750
  style: {
747
751
  marginBottom: 16
748
752
  },
@@ -757,7 +761,7 @@ const sr = (L) => {
757
761
  alignItems: "center",
758
762
  marginBottom: 4
759
763
  },
760
- children: [/* @__PURE__ */ a("span", {
764
+ children: [/* @__PURE__ */ c("span", {
761
765
  style: {
762
766
  display: "inline-block",
763
767
  padding: "2px 8px",
@@ -777,7 +781,7 @@ const sr = (L) => {
777
781
  alignItems: "center",
778
782
  marginBottom: 4
779
783
  },
780
- children: [/* @__PURE__ */ a("span", {
784
+ children: [/* @__PURE__ */ c("span", {
781
785
  style: {
782
786
  display: "inline-block",
783
787
  padding: "2px 8px",
@@ -797,7 +801,7 @@ const sr = (L) => {
797
801
  alignItems: "center",
798
802
  marginBottom: 4
799
803
  },
800
- children: [/* @__PURE__ */ a("span", {
804
+ children: [/* @__PURE__ */ c("span", {
801
805
  style: {
802
806
  display: "inline-block",
803
807
  padding: "2px 8px",
@@ -812,134 +816,134 @@ const sr = (L) => {
812
816
  children: [e.hascode, "张"]
813
817
  })]
814
818
  })]
815
- }), /* @__PURE__ */ a("p", {
819
+ }), /* @__PURE__ */ c("p", {
816
820
  children: '保留图片文件,仅删除其内部的标注框(含 AI 预标注)。删除后图片状态变更为"未标注"。'
817
821
  })]
818
822
  });
819
- we.confirm({
823
+ Le.confirm({
820
824
  title: "删除操作确认",
821
825
  content: i,
822
826
  okText: "确定",
823
827
  cancelText: "取消",
824
828
  width: 500,
825
- onOk: () => Oe(void 0, null, function* () {
829
+ onOk: () => Fe(void 0, null, function* () {
826
830
  if (!o)
827
831
  return;
828
- const s = v.filter((f) => P.has(f.id));
832
+ const s = v.filter((d) => P.has(d.id));
829
833
  if (s.length === 0) {
830
834
  D.warning("没有选中的图片");
831
835
  return;
832
836
  }
833
837
  try {
834
- const f = s.map((S) => y(b({}, S), {
838
+ const d = s.map((y) => S(b({}, y), {
835
839
  labels: [],
836
840
  confirmStatus: 0,
837
841
  isLabeled: !1
838
842
  }));
839
- yield g.cvforceDatahub.updateSamples(c, o.id, f, 0), D.success("清除标注成功"), ne(), A(y(b({}, l), {
843
+ yield g.cvforceDatahub.updateSamples(a, o.id, d, 0), D.success("清除标注成功"), te(), A(S(b({}, l), {
840
844
  current: 1
841
845
  })), w(), q();
842
- } catch (f) {
846
+ } catch (d) {
843
847
  D.error("清除标注失败");
844
848
  }
845
849
  })
846
850
  });
847
- }, Gt = [...ye ? [{
851
+ }, Gt = [...Se ? [{
848
852
  key: "deleteWithAnnotations",
849
853
  label: "删除所选图片(含标注)",
850
854
  onClick: $t
851
- }] : [], ...ae ? [{
855
+ }] : [], ...se ? [{
852
856
  key: "clearAnnotations",
853
857
  label: "仅清除所选图片内的标注",
854
858
  onClick: jt
855
859
  }] : []];
856
- return /* @__PURE__ */ a(tn, {
860
+ return /* @__PURE__ */ c(tn, {
857
861
  locale: fn,
858
- children: /* @__PURE__ */ a(hn.Provider, {
862
+ children: /* @__PURE__ */ c(hn.Provider, {
859
863
  value: {
860
- datasetId: c,
864
+ datasetId: a,
861
865
  versionId: (o == null ? void 0 : o.id) || "",
862
866
  no: (o == null ? void 0 : o.no) || "",
863
- loading: Ue,
867
+ loading: He,
864
868
  version: o,
865
- versions: Se,
869
+ versions: Ce,
866
870
  samples: v,
867
871
  pagination: l,
868
872
  services: g,
869
873
  featuresConfig: {
870
- labelManager: ve,
874
+ labelManager: ye,
871
875
  datasetManager: R,
872
- annotation: oe,
873
- filterSwitch: se,
874
- header: I,
875
- exampleSrcRoot: le
876
+ annotation: ie,
877
+ filterSwitch: le,
878
+ header: x,
879
+ exampleSrcRoot: oe
876
880
  }
877
881
  },
878
- children: x ? x.markType === "detection" ? /* @__PURE__ */ a("div", {
882
+ children: k ? k.markType === "detection" ? /* @__PURE__ */ c("div", {
879
883
  className: "detection-version-detail",
880
- children: Dt ? o != null && o.id && R && R.preLabel ? /* @__PURE__ */ a(mn, {
881
- datasetId: c,
884
+ children: Dt ? o != null && o.id && R && R.preLabel ? /* @__PURE__ */ c(mn, {
885
+ datasetId: a,
882
886
  versionId: o.id,
883
887
  onClose: () => {
884
- Nt(!1), Be(), q(), w(), A();
888
+ Nt(!1), Ee(), q(), w(), A();
885
889
  },
886
890
  samples: v,
887
891
  labels: O,
888
- fetchLength: Be
892
+ fetchLength: Ee
889
893
  }) : null : /* @__PURE__ */ m(vn, {
890
894
  className: "product-details-page",
891
- header: I === !1 ? void 0 : /* @__PURE__ */ a(Sn, {
892
- backTo: be,
893
- onBackClick: I != null && I.onBackClick ? () => {
894
- u && te(), I.onBackClick && I.onBackClick();
895
+ header: x === !1 ? void 0 : /* @__PURE__ */ c(Sn, {
896
+ backTo: ve,
897
+ onBackClick: x != null && x.onBackClick ? () => {
898
+ u && ee(), x.onBackClick && x.onBackClick();
895
899
  } : void 0,
896
- left: !Ue && /* @__PURE__ */ m(me, {
897
- children: [/* @__PURE__ */ a("span", {
900
+ left: !He && /* @__PURE__ */ m(be, {
901
+ children: [/* @__PURE__ */ c("span", {
898
902
  style: {
899
903
  fontWeight: "bold"
900
904
  },
901
- children: x == null ? void 0 : x.name
902
- }), /* @__PURE__ */ a(nn, {
903
- disabled: (I == null ? void 0 : I.versionSelect) === !1,
905
+ children: k == null ? void 0 : k.name
906
+ }), /* @__PURE__ */ c(nn, {
907
+ disabled: (x == null ? void 0 : x.versionSelect) === !1,
904
908
  value: o == null ? void 0 : o.id,
905
909
  style: {
906
910
  width: 70
907
911
  },
908
- options: Se.map((e) => ({
912
+ options: Ce.map((e) => ({
909
913
  label: e.no,
910
914
  value: e.id
911
915
  })),
912
916
  onChange: (e) => {
913
- const t = Se.find((r) => r.id === e);
914
- if (!x || !t)
917
+ const t = Ce.find((r) => r.id === e);
918
+ if (!k || !t)
915
919
  return;
916
- const n = Se.find((r) => r.id === t.id);
917
- de(n), ne(), I != null && I.onVersionChange && I.onVersionChange(n);
920
+ const n = Ce.find((r) => r.id === t.id);
921
+ ae(n), te(), x != null && x.onVersionChange && x.onVersionChange(n);
918
922
  }
919
923
  })]
920
924
  }),
921
- right: /* @__PURE__ */ m(me, {
922
- children: [!u && R && R.add && /* @__PURE__ */ a(ht, {
925
+ right: /* @__PURE__ */ m(be, {
926
+ children: [!u && R && R.add && /* @__PURE__ */ c(ht, {
923
927
  isPreLabel: H,
924
928
  placement: "bottom",
925
- children: /* @__PURE__ */ a(re, {
929
+ children: /* @__PURE__ */ c(ne, {
926
930
  type: "default",
927
- onClick: () => Te(!0),
928
- disabled: G === ie.Pending || G === ie.Started || H,
931
+ onClick: () => Re(!0),
932
+ disabled: Z === re.Pending || Z === re.Started || H,
929
933
  children: "导入数据"
930
934
  }, "del")
931
- }), /* @__PURE__ */ a(ct, {
935
+ }), /* @__PURE__ */ c(at, {
932
936
  menu: {
933
937
  items: [{
934
938
  key: "manual",
935
- label: /* @__PURE__ */ a(ht, {
939
+ label: /* @__PURE__ */ c(ht, {
936
940
  isPreLabel: H,
937
- children: /* @__PURE__ */ a(me, {
938
- children: ae && /* @__PURE__ */ a(re, {
941
+ children: /* @__PURE__ */ c(be, {
942
+ children: se && /* @__PURE__ */ c(ne, {
939
943
  type: "text",
940
944
  disabled: H,
941
945
  onClick: () => {
942
- u || Re("nocode"), j(!0), V(-1), h === "nocode" && (V(0), N(v[0])), ge(!0);
946
+ u || Ne("nocode"), G(!0), V(-1), h === "nocode" && (V(0), N(v[0])), ue(!0);
943
947
  },
944
948
  children: "人工标注"
945
949
  })
@@ -947,33 +951,33 @@ const sr = (L) => {
947
951
  })
948
952
  }, !u && R && R.preLabel && (o != null && o.id) ? {
949
953
  key: "auto",
950
- label: /* @__PURE__ */ a(kn, {
954
+ label: /* @__PURE__ */ c(kn, {
951
955
  buttonType: "text",
952
- datasetId: c,
956
+ datasetId: a,
953
957
  versionId: o.id,
954
958
  disabled: !v.length,
955
959
  setIsTaskChange: wt,
956
960
  datasetType: "detection",
957
- preLabelTask: Je
961
+ preLabelTask: Xe
958
962
  })
959
963
  } : null]
960
964
  },
961
965
  placement: "bottom",
962
- children: /* @__PURE__ */ m(re, {
966
+ children: /* @__PURE__ */ m(ne, {
963
967
  type: "primary",
964
- children: ["开始标注", /* @__PURE__ */ a(ut, {})]
968
+ children: ["开始标注", /* @__PURE__ */ c(ut, {})]
965
969
  })
966
- }), /* @__PURE__ */ a(xn, {
970
+ }), /* @__PURE__ */ c(xn, {
967
971
  when: Ct,
968
972
  content: "确认要离开此页面吗?",
969
973
  subContent: "离开此页面后,将结束导入,放弃未上传的文件,请谨慎操作!"
970
- }), je && /* @__PURE__ */ a(yn, {
974
+ }), $e && /* @__PURE__ */ c(yn, {
971
975
  datasetIam: bt,
972
- datasetId: c,
976
+ datasetId: a,
973
977
  currentVersion: o,
974
- tenCode: x == null ? void 0 : x.tenantCode,
975
- isVisible: je,
976
- setIsVisible: Te,
978
+ tenCode: k == null ? void 0 : k.tenantCode,
979
+ isVisible: $e,
980
+ setIsVisible: Re,
977
981
  getVersionListRequest: w,
978
982
  setIsConfirm: St,
979
983
  onUploadStatusChange: (e) => {
@@ -983,44 +987,44 @@ const sr = (L) => {
983
987
  var e, t, n;
984
988
  o != null && o.id && ((t = (e = ce.current) == null ? void 0 : e.getElementsByClassName("rc-virtual-list-holder")[0]) == null || t.scrollTo({
985
989
  top: 0
986
- }), A(y(b({}, l), {
990
+ }), A(S(b({}, l), {
987
991
  current: 1
988
- })), (n = Ne.current) == null || n.fetchLabels());
992
+ })), (n = De.current) == null || n.fetchLabels());
989
993
  },
990
994
  loadVersionData: tt,
991
- markType: x.markType
995
+ markType: k.markType
992
996
  })]
993
997
  })
994
998
  }),
995
999
  children: [/* @__PURE__ */ m("div", {
996
1000
  className: "detection-header",
997
- children: [/* @__PURE__ */ m(me, {
998
- children: [se.tabs && /* @__PURE__ */ a(rn, {
1001
+ children: [/* @__PURE__ */ m(be, {
1002
+ children: [le.tabs && /* @__PURE__ */ c(rn, {
999
1003
  className: "header-tab",
1000
1004
  activeKey: h,
1001
1005
  items: rt,
1002
1006
  onChange: it
1003
- }), !u && se.search && /* @__PURE__ */ a(In, {
1007
+ }), !u && le.search && /* @__PURE__ */ c(In, {
1004
1008
  placeholder: "请输入图片名称搜索",
1005
1009
  style: {
1006
1010
  width: 200
1007
1011
  },
1008
- suffix: /* @__PURE__ */ a(bn, {}),
1009
- value: ee,
1012
+ suffix: /* @__PURE__ */ c(bn, {}),
1013
+ value: ge,
1010
1014
  onChange: Ut,
1011
1015
  allowClear: !0
1012
- }), !u && De && /* @__PURE__ */ a(ct, {
1016
+ }), !u && we && /* @__PURE__ */ c(at, {
1013
1017
  menu: {
1014
1018
  items: Gt
1015
1019
  },
1016
1020
  disabled: P.size === 0,
1017
- children: /* @__PURE__ */ m(re, {
1021
+ children: /* @__PURE__ */ m(ne, {
1018
1022
  size: "middle",
1019
1023
  disabled: P.size === 0,
1020
- children: ["删除", /* @__PURE__ */ a(ut, {})]
1024
+ children: ["删除", /* @__PURE__ */ c(ut, {})]
1021
1025
  })
1022
- }), !u && De && /* @__PURE__ */ m(at, {
1023
- children: [/* @__PURE__ */ a(dt, {
1026
+ }), !u && we && /* @__PURE__ */ m(ct, {
1027
+ children: [/* @__PURE__ */ c(dt, {
1024
1028
  checked: Pt,
1025
1029
  onChange: (e) => Wt(e.target.checked),
1026
1030
  children: "选择当前页"
@@ -1031,8 +1035,8 @@ const sr = (L) => {
1031
1035
  children: ["已选中", P.size, "张,共", l.total || 0, "张"]
1032
1036
  })]
1033
1037
  })]
1034
- }), /* @__PURE__ */ a(me, {
1035
- children: h === "pending" && /* @__PURE__ */ a(re, {
1038
+ }), /* @__PURE__ */ c(be, {
1039
+ children: h === "pending" && /* @__PURE__ */ c(ne, {
1036
1040
  type: "primary",
1037
1041
  className: "pending-confirm-button",
1038
1042
  onClick: qt,
@@ -1044,13 +1048,13 @@ const sr = (L) => {
1044
1048
  children: [/* @__PURE__ */ m("div", {
1045
1049
  className: "d-right",
1046
1050
  ref: ce,
1047
- children: [Y && /* @__PURE__ */ a(Nn, {
1048
- datasetId: c,
1051
+ children: [Y && /* @__PURE__ */ c(Nn, {
1052
+ datasetId: a,
1049
1053
  isImageDetailVisible: Y,
1050
- setIsImageDetailVisible: ge,
1051
- currentSample: d != null ? d : u,
1054
+ setIsImageDetailVisible: ue,
1055
+ currentSample: f != null ? f : u,
1052
1056
  labels: O,
1053
- previewMode: !ue,
1057
+ previewMode: !he,
1054
1058
  filterItems: rt,
1055
1059
  filterMode: h,
1056
1060
  onFilterChange: it,
@@ -1060,7 +1064,7 @@ const sr = (L) => {
1060
1064
  onSave: (e, t) => Mt(e, t),
1061
1065
  onDeleteSample: () => Ot(),
1062
1066
  onEnterEdit: () => {
1063
- j(!0);
1067
+ G(!0);
1064
1068
  },
1065
1069
  onBackToDetail: (e) => Ft(e),
1066
1070
  onLoadingChange: Vt,
@@ -1068,16 +1072,16 @@ const sr = (L) => {
1068
1072
  var e;
1069
1073
  (e = q()) == null || e.then((t) => {
1070
1074
  var n, r;
1071
- if (d) {
1075
+ if (f) {
1072
1076
  const i = [];
1073
- (n = d.labels) == null || n.forEach((s) => {
1074
- t != null && t.find((f) => f.id === s.id) && i.push(s);
1075
- }), d.labels = i, z(b({}, d));
1077
+ (n = f.labels) == null || n.forEach((s) => {
1078
+ t != null && t.find((d) => d.id === s.id) && i.push(s);
1079
+ }), f.labels = i, z(b({}, f));
1076
1080
  }
1077
1081
  if (u) {
1078
1082
  const i = [];
1079
1083
  (r = u.labels) == null || r.forEach((s) => {
1080
- t != null && t.find((f) => f.id === s.id) && i.push(s);
1084
+ t != null && t.find((d) => d.id === s.id) && i.push(s);
1081
1085
  }), u.labels = i, N(b({}, u));
1082
1086
  }
1083
1087
  }), w();
@@ -1087,11 +1091,11 @@ const sr = (L) => {
1087
1091
  total: Q,
1088
1092
  index: M + 1
1089
1093
  },
1090
- settingHide: !ve,
1091
- canLabel: ae,
1092
- canDelete: ye
1093
- }), l.total !== void 0 && l.total > 0 ? /* @__PURE__ */ a(at, {
1094
- children: /* @__PURE__ */ a(cn, {
1094
+ settingHide: !ye,
1095
+ canLabel: se,
1096
+ canDelete: Se
1097
+ }), l.total !== void 0 && l.total > 0 ? /* @__PURE__ */ c(ct, {
1098
+ children: /* @__PURE__ */ c(an, {
1095
1099
  innerProps: {
1096
1100
  className: "d-right-row"
1097
1101
  },
@@ -1101,41 +1105,41 @@ const sr = (L) => {
1101
1105
  onScroll: Bt,
1102
1106
  children: (e, t) => {
1103
1107
  var n;
1104
- return /* @__PURE__ */ a(on, {
1108
+ return /* @__PURE__ */ c(on, {
1105
1109
  className: "d-right-col",
1106
1110
  "data-sample-id": e.id,
1107
1111
  children: /* @__PURE__ */ m("div", {
1108
1112
  className: "right-col-wrapper",
1109
- onMouseEnter: () => ze(e.id),
1110
- onMouseLeave: () => ze(""),
1111
- children: [/* @__PURE__ */ a("div", {
1113
+ onMouseEnter: () => Ve(e.id),
1114
+ onMouseLeave: () => Ve(""),
1115
+ children: [/* @__PURE__ */ c("div", {
1112
1116
  className: "detection-status-wrapper",
1113
- children: /* @__PURE__ */ a(Dn, {
1117
+ children: /* @__PURE__ */ c(Dn, {
1114
1118
  sample: e
1115
1119
  })
1116
- }), De && /* @__PURE__ */ a("div", {
1120
+ }), we && /* @__PURE__ */ c("div", {
1117
1121
  className: "sample-checkbox-wrapper",
1118
- children: /* @__PURE__ */ a(dt, {
1122
+ children: /* @__PURE__ */ c(dt, {
1119
1123
  checked: P.has(e.id),
1120
1124
  onChange: (r) => {
1121
1125
  r.stopPropagation(), Kt(e.id, r.target.checked);
1122
1126
  },
1123
1127
  onClick: (r) => r.stopPropagation()
1124
1128
  })
1125
- }), /* @__PURE__ */ a("div", {
1129
+ }), /* @__PURE__ */ c("div", {
1126
1130
  className: "right-col-img",
1127
1131
  onClick: () => zt(t),
1128
- children: /* @__PURE__ */ a(Cn, {
1132
+ children: /* @__PURE__ */ c(Cn, {
1129
1133
  fileKey: e.fileKey,
1130
1134
  width: 124,
1131
1135
  thumbnailUrl: e.thumbnailUrl
1132
1136
  })
1133
1137
  }), /* @__PURE__ */ m("div", {
1134
1138
  className: "right-col-text",
1135
- children: [(n = e.labels) != null && n.length ? /* @__PURE__ */ a(ln, {
1139
+ children: [(n = e.labels) != null && n.length ? /* @__PURE__ */ c(ln, {
1136
1140
  placement: "top",
1137
- title: /* @__PURE__ */ a("div", {
1138
- children: Object.keys(e.labels.reduce((r, i) => (r[i.label] ? ++r[i.label] : r[i.label] = 1, r), {})).map((r) => /* @__PURE__ */ a("div", {
1141
+ title: /* @__PURE__ */ c("div", {
1142
+ children: Object.keys(e.labels.reduce((r, i) => (r[i.label] ? ++r[i.label] : r[i.label] = 1, r), {})).map((r) => /* @__PURE__ */ c("div", {
1139
1143
  children: r
1140
1144
  }, r))
1141
1145
  }),
@@ -1144,7 +1148,7 @@ const sr = (L) => {
1144
1148
  width: "100%",
1145
1149
  display: "flex"
1146
1150
  },
1147
- children: [/* @__PURE__ */ a("span", {
1151
+ children: [/* @__PURE__ */ c("span", {
1148
1152
  style: {
1149
1153
  display: "inline-block",
1150
1154
  maxWidth: "calc(100% - 25px)",
@@ -1153,7 +1157,7 @@ const sr = (L) => {
1153
1157
  whiteSpace: "nowrap"
1154
1158
  },
1155
1159
  children: e.labels[0].label
1156
- }), e.labels.length > 1 ? /* @__PURE__ */ a("span", {
1160
+ }), e.labels.length > 1 ? /* @__PURE__ */ c("span", {
1157
1161
  style: {
1158
1162
  color: "rgba(0,0,0,0.45)",
1159
1163
  marginLeft: 5
@@ -1161,13 +1165,13 @@ const sr = (L) => {
1161
1165
  children: Et(e)
1162
1166
  }) : null]
1163
1167
  })
1164
- }) : /* @__PURE__ */ a("span", {
1168
+ }) : /* @__PURE__ */ c("span", {
1165
1169
  style: {
1166
1170
  color: "rgba(0,0,0,0.45)",
1167
1171
  width: "100%"
1168
1172
  },
1169
1173
  children: "无标签"
1170
- }), /* @__PURE__ */ a("div", {
1174
+ }), /* @__PURE__ */ c("div", {
1171
1175
  children: t + 1
1172
1176
  })]
1173
1177
  })]
@@ -1175,21 +1179,21 @@ const sr = (L) => {
1175
1179
  }, e.id);
1176
1180
  }
1177
1181
  })
1178
- }) : /* @__PURE__ */ a("div", {
1182
+ }) : /* @__PURE__ */ c("div", {
1179
1183
  className: "empty",
1180
- children: l.total === 0 ? /* @__PURE__ */ a(sn, {
1184
+ children: l.total === 0 ? /* @__PURE__ */ c(sn, {
1181
1185
  image: un,
1182
1186
  description: /* @__PURE__ */ m("span", {
1183
- children: ["暂无数据", h !== "hascode" && !ee && /* @__PURE__ */ a("span", {
1184
- children: R && R.add && /* @__PURE__ */ m(re, {
1187
+ children: ["暂无数据", h !== "hascode" && !ge && /* @__PURE__ */ c("span", {
1188
+ children: R && R.add && /* @__PURE__ */ m(ne, {
1185
1189
  type: "link",
1186
1190
  size: "small",
1187
1191
  style: {
1188
1192
  padding: 0
1189
1193
  },
1190
- onClick: () => Te(!0),
1191
- disabled: G === ie.Pending || G === ie.Started,
1192
- children: [/* @__PURE__ */ a("span", {
1194
+ onClick: () => Re(!0),
1195
+ disabled: Z === re.Pending || Z === re.Started,
1196
+ children: [/* @__PURE__ */ c("span", {
1193
1197
  style: {
1194
1198
  color: "black"
1195
1199
  },
@@ -1198,32 +1202,37 @@ const sr = (L) => {
1198
1202
  })
1199
1203
  })]
1200
1204
  })
1201
- }) : /* @__PURE__ */ a(an, {})
1205
+ }) : /* @__PURE__ */ c(cn, {})
1202
1206
  })]
1203
- }), h !== "nocode" && se.labels && /* @__PURE__ */ a("div", {
1207
+ }), h !== "nocode" && le.labels && /* @__PURE__ */ c("div", {
1204
1208
  className: "d-sider",
1205
- children: /* @__PURE__ */ a(gn, {
1206
- ref: Ne,
1207
- datasetId: c,
1209
+ children: /* @__PURE__ */ c(gn, {
1210
+ ref: De,
1211
+ datasetId: a,
1208
1212
  data: O || [],
1213
+ showStatColumns: !0,
1209
1214
  selected: W,
1210
1215
  onSelectedChange: (e) => {
1211
- ne(), Pe((O == null ? void 0 : O.filter((t) => e.find((n) => n.label === t.label))) || []);
1216
+ te(), Te((O == null ? void 0 : O.filter((t) => e.find((n) => n.label === t.label))) || []);
1212
1217
  },
1213
1218
  onListChange: (e) => {
1214
1219
  if (!o)
1215
1220
  return;
1216
1221
  let t = 2;
1217
- h === "pending" ? t = 1 : h === "hascode" && (t = 0), g.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(c, o.id, {
1222
+ h === "pending" ? t = 1 : h === "hascode" && (t = 0), g.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(a, o.id, {
1218
1223
  confirmStatus: t
1219
1224
  }).then((n) => {
1220
- const i = (n || []).filter((f) => f.label !== "nocode").map((f, S) => ({
1221
- label: f.label,
1222
- count: f.count,
1223
- id: f.id,
1224
- color: ft[S % 40]
1225
- })), s = W.filter((f) => i.some((S) => S.id === f.id));
1226
- _e(i), W.length !== s.length && Pe(s);
1225
+ const i = (n || []).filter((d) => d.label !== "nocode").map((d, y) => {
1226
+ var C;
1227
+ return {
1228
+ label: d.label,
1229
+ count: d.count,
1230
+ boxCount: (C = d.boxCount) != null ? C : 0,
1231
+ id: d.id,
1232
+ color: ft[y % 40]
1233
+ };
1234
+ }), s = W.filter((d) => i.some((y) => y.id === d.id));
1235
+ Ze(i), W.length !== s.length && Te(s);
1227
1236
  }), w();
1228
1237
  },
1229
1238
  isPreLabel: H
@@ -1231,7 +1240,7 @@ const sr = (L) => {
1231
1240
  })]
1232
1241
  })]
1233
1242
  })
1234
- }) : /* @__PURE__ */ a("div", {
1243
+ }) : /* @__PURE__ */ c("div", {
1235
1244
  style: {
1236
1245
  color: "red",
1237
1246
  textAlign: "center"