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