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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,140 +1,140 @@
1
- var Wt = Object.defineProperty, $t = Object.defineProperties;
2
- var jt = Object.getOwnPropertyDescriptors;
3
- var it = Object.getOwnPropertySymbols;
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) => {
1
+ var Zt = Object.defineProperty, _t = Object.defineProperties;
2
+ var Xt = Object.getOwnPropertyDescriptors;
3
+ var lt = Object.getOwnPropertySymbols;
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
6
  for (var c in g || (g = {}))
7
- Gt.call(g, c) && rt(L, c, g[c]);
8
- if (it)
9
- for (var c of it(g))
10
- Zt.call(g, c) && rt(L, c, g[c]);
7
+ Jt.call(g, c) && st(L, c, g[c]);
8
+ if (lt)
9
+ for (var c of lt(g))
10
+ Qt.call(g, c) && st(L, c, g[c]);
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
+ }, y = (L, g) => _t(L, Xt(g));
13
+ var Oe = (L, g, c) => new Promise((J, be) => {
14
+ var ve = (I) => {
15
15
  try {
16
16
  oe(c.next(I));
17
17
  } catch (le) {
18
- me(le);
18
+ be(le);
19
19
  }
20
- }, N = (I) => {
20
+ }, R = (I) => {
21
21
  try {
22
22
  oe(c.throw(I));
23
23
  } catch (le) {
24
- me(le);
24
+ be(le);
25
25
  }
26
- }, oe = (I) => I.done ? J(I.value) : Promise.resolve(I.value).then(be, N);
26
+ }, oe = (I) => I.done ? J(I.value) : Promise.resolve(I.value).then(ve, R);
27
27
  oe((c = c.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";
32
- import on from "rc-virtual-list";
33
- import { UploadZipsStatus as re, PreLabelTaskStatus as ln } from "@glodon-aiot/apis";
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";
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";
34
+ import fn from "antd/es/locale/zh_CN";
35
+ import hn from "../../DatasetContext/index.mjs";
36
+ import un from "./icon_item_empty.svg.mjs";
37
37
  import "./style.less.mjs";
38
- import { tagColors as at } from "../../utils/index.mjs";
39
- import dn from "./components/Labels/index.mjs";
40
- import { useKeyPress as fn } from "ahooks";
41
- import ct from "./components/DisabledTooltip/index.mjs";
42
- import hn from "./PreSamplesPage/index.mjs";
43
- import { DownOutlined as dt, SearchOutlined as un } from "@ant-design/icons";
44
- import gn from "../../Common/Page/index.mjs";
45
- import pn from "../PicZipImportModal/index.mjs";
46
- import mn from "../PageNav/index.mjs";
47
- import bn from "../Thumbnail/index.mjs";
48
- import vn from "../CompositionInput/index.mjs";
49
- import { Prompt as yn } from "../hooks/Prompt.mjs";
50
- import Sn from "../PreLabelOCR/index.mjs";
51
- import Cn from "lodash/merge";
52
- import { DEFAULT_FILTER_SWITCH as In } from "../../constant.mjs";
53
- import xn from "../DetectionStatus/index.mjs";
54
- import kn from "./components/ImageModal/index.mjs";
55
- import Ln from "./hooks/useSamplePreload.mjs";
56
- var wn = /* @__PURE__ */ ((L) => (L.Next = "NEXT", L.Prev = "PREV", L.Confirm = "CONFIRM", L.Save = "Save", L))(wn || {});
57
- const ii = (L) => {
38
+ import { tagColors as ft } from "../../utils/index.mjs";
39
+ import gn from "./components/Labels/index.mjs";
40
+ import { useKeyPress as pn } from "ahooks";
41
+ import ht from "./components/DisabledTooltip/index.mjs";
42
+ import mn from "./PreSamplesPage/index.mjs";
43
+ import { DownOutlined as ut, SearchOutlined as bn } from "@ant-design/icons";
44
+ import vn from "../../Common/Page/index.mjs";
45
+ import yn from "../PicZipImportModal/index.mjs";
46
+ import Sn from "../PageNav/index.mjs";
47
+ import Cn from "../Thumbnail/index.mjs";
48
+ import In from "../CompositionInput/index.mjs";
49
+ import { Prompt as xn } from "../hooks/Prompt.mjs";
50
+ import kn from "../PreLabelOCR/index.mjs";
51
+ import Ln from "lodash/merge";
52
+ import { DEFAULT_FILTER_SWITCH as wn } from "../../constant.mjs";
53
+ import Dn from "../DetectionStatus/index.mjs";
54
+ import Nn from "./components/ImageModal/index.mjs";
55
+ import Rn from "./hooks/useSamplePreload.mjs";
56
+ var Tn = /* @__PURE__ */ ((L) => (L.Next = "NEXT", L.Prev = "PREV", L.Confirm = "CONFIRM", L.Save = "Save", L))(Tn || {});
57
+ const sr = (L) => {
58
58
  const {
59
59
  services: g,
60
60
  datasetId: c,
61
61
  versionId: J,
62
- backTo: me,
63
- labelManager: be = !1,
64
- datasetManager: N = !1,
62
+ backTo: be,
63
+ labelManager: ve = !1,
64
+ datasetManager: R = !1,
65
65
  annotation: oe,
66
66
  header: I = {
67
67
  versionSelect: !1
68
68
  },
69
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({
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({
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);
76
- _t(() => {
77
- const e = ae.current;
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);
76
+ Yt(() => {
77
+ const e = ce.current;
78
78
  if (!e)
79
79
  return;
80
80
  let t = 0;
81
81
  const n = () => {
82
82
  cancelAnimationFrame(t), t = requestAnimationFrame(() => {
83
83
  const s = e.clientHeight, f = Math.max(1, Math.round(s));
84
- f !== Je.current && (Je.current = f, ht(f));
84
+ f !== et.current && (et.current = f, pt(f));
85
85
  });
86
86
  };
87
87
  n();
88
- const i = typeof ResizeObserver != "undefined" ? new ResizeObserver(n) : null;
89
- i == null || i.observe(e);
90
- const r = window.visualViewport;
91
- return r == null || r.addEventListener("resize", n), window.addEventListener("resize", n), () => {
92
- cancelAnimationFrame(t), i == null || i.disconnect(), r == null || r.removeEventListener("resize", n), window.removeEventListener("resize", n);
88
+ const r = typeof ResizeObserver != "undefined" ? new ResizeObserver(n) : null;
89
+ r == null || r.observe(e);
90
+ const i = window.visualViewport;
91
+ return i == null || i.addEventListener("resize", n), window.addEventListener("resize", n), () => {
92
+ cancelAnimationFrame(t), r == null || r.disconnect(), i == null || i.removeEventListener("resize", n), window.removeEventListener("resize", n);
93
93
  };
94
94
  }, [x]);
95
95
  const te = () => {
96
- R(void 0), z(void 0), V(-1), j(!1), q(), setTimeout(() => {
96
+ N(void 0), z(void 0), V(-1), j(!1), q(), setTimeout(() => {
97
97
  T((e) => y(b({}, e), {
98
98
  current: 1,
99
99
  type: void 0
100
100
  }));
101
101
  }, 10);
102
102
  };
103
- fn("Esc", te), C(() => {
103
+ pn("Esc", te), C(() => {
104
104
  c && g.cvforceDatahub.getS3Iam(c).then((e) => {
105
- pt(e);
105
+ vt(e);
106
106
  });
107
107
  }, [c]), C(() => {
108
108
  w();
109
109
  }, [o == null ? void 0 : o.id]), C(() => {
110
- c && (Oe(!0), Promise.all([
110
+ c && (qe(!0), Promise.all([
111
111
  // 数据集
112
112
  g.cvforceDatahub.getDatasetsId(c).then((e) => {
113
- Me(e);
113
+ He(e);
114
114
  }),
115
115
  // 版本列表
116
116
  g.cvforceDatahub.getDatasetsIdVersions(c, 1, 1e3).then((e) => {
117
- ut(e.recordList), ce(J ? e.recordList.find((t) => t.id === J) : e.recordList[0]);
117
+ mt(e.recordList), de(J ? e.recordList.find((t) => t.id === J) : e.recordList[0]);
118
118
  })
119
- ]).finally(() => Oe(!1)));
119
+ ]).finally(() => qe(!1)));
120
120
  }, [c, J]);
121
- const Qe = () => {
121
+ const tt = () => {
122
122
  !c || !o || g.cvforceDatahub.getDatasetsIdVersionsVid(c, o.id).then((e) => {
123
- ce(e), Ct(e.versionAsyncTask.state);
123
+ de(e), kt(e.versionAsyncTask.state);
124
124
  });
125
125
  };
126
126
  C(() => {
127
- G !== re.Pending && G !== re.Started || D.warning("文件导入中,请刷新页面再试");
127
+ G !== ie.Pending && G !== ie.Started || D.warning("文件导入中,请刷新页面再试");
128
128
  }, [G]), C(() => {
129
- ce(void 0), T(y(b({}, l), {
129
+ de(void 0), T(y(b({}, l), {
130
130
  current: 1
131
- })), U([]), Qe();
131
+ })), U([]), tt();
132
132
  }, [c, J]), C(() => {
133
133
  c && g.cvforceDatahub.getDatasetsId(c).then((e) => {
134
- Me(e);
134
+ He(e);
135
135
  });
136
136
  }, [c]), C(() => {
137
- Se.current++, Ce.current++, Z.current++;
137
+ Ie.current++, xe.current++, Z.current++;
138
138
  }, [x == null ? void 0 : x.id, o == null ? void 0 : o.id, h, W, ee]), C(() => {
139
139
  q();
140
140
  }, [W, o, h]), C(() => {
@@ -143,23 +143,23 @@ const ii = (L) => {
143
143
  })).then((e) => {
144
144
  });
145
145
  }, [x == null ? void 0 : x.id, o == null ? void 0 : o.id, W]), C(() => {
146
- if (Pe.current) {
147
- Pe.current = !1, w();
146
+ if (Ae.current) {
147
+ Ae.current = !1, w();
148
148
  return;
149
149
  }
150
150
  A().then((e) => {
151
151
  }), w();
152
152
  }, [l.current]), C(() => {
153
153
  H && w();
154
- }, [Ze]), C(() => {
155
- const e = ge.current[h];
154
+ }, [Je]), C(() => {
155
+ const e = pe.current[h];
156
156
  let t;
157
157
  e && e.page > 1 ? t = A(y(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) => (Ae.current = !0, T((r) => y(b({}, r), {
163
163
  current: e.page,
164
164
  pageSize: 100
165
165
  })), n)) : t = A(y(b({}, l), {
@@ -168,11 +168,11 @@ const ii = (L) => {
168
168
  })), t.then((n) => {
169
169
  if (n && !(!u && !Y))
170
170
  if (Array.isArray(n) && n.length) {
171
- const i = ge.current[h], r = i == null ? void 0 : i.index, s = r !== void 0 && r >= 0 && r < n.length ? r : 0;
172
- V(s), R(n[s]), z(void 0);
171
+ const r = pe.current[h], i = r == null ? void 0 : r.index, s = i !== void 0 && i >= 0 && i < n.length ? i : 0;
172
+ V(s), N(n[s]), z(void 0);
173
173
  } else
174
- R(void 0), z(void 0), V(-1), q(), setTimeout(() => {
175
- T((i) => y(b({}, i), {
174
+ N(void 0), z(void 0), V(-1), q(), setTimeout(() => {
175
+ T((r) => y(b({}, r), {
176
176
  current: 1,
177
177
  type: void 0
178
178
  }));
@@ -182,13 +182,13 @@ const ii = (L) => {
182
182
  var t;
183
183
  let e;
184
184
  if (!Y) {
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(() => {
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(() => {
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 = 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(i))) != null ? X : r >= 0 ? f[r] : void 0;
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
192
  if (!S)
193
193
  return;
194
194
  const k = s.getBoundingClientRect(), E = S.getBoundingClientRect(), K = s.scrollTop + E.top - k.top - Math.max(0, (s.clientHeight - E.height) / 2);
@@ -201,58 +201,58 @@ const ii = (L) => {
201
201
  e !== void 0 && cancelAnimationFrame(e);
202
202
  };
203
203
  }, [Y]);
204
- const Rt = Xt((e, t) => {
205
- Ge(e ? void 0 : t);
204
+ const Vt = en((e, t) => {
205
+ Xe(e ? void 0 : t);
206
206
  }, []);
207
- Ln({
207
+ Rn({
208
208
  samples: v,
209
209
  currentIndex: M,
210
210
  active: Y,
211
- loadedImageUrl: St
211
+ loadedImageUrl: xt
212
212
  }), C(() => {
213
- yt(!$e && We);
214
- }, [$e, We]), C(() => {
213
+ It(!Ze && Ge);
214
+ }, [Ze, Ge]), C(() => {
215
215
  if (!c) {
216
- ye && (clearTimeout(ye), Re(null)), _e(void 0);
216
+ Ce && (clearTimeout(Ce), Ve(null)), Qe(void 0);
217
217
  return;
218
218
  }
219
- Ae();
219
+ Me();
220
220
  }, [c, o == null ? void 0 : o.id]), C(() => {
221
- Ae();
222
- }, [It]), C(() => {
223
- ze();
221
+ Me();
222
+ }, [Lt]), C(() => {
223
+ Be();
224
224
  }, [H, c, o]), C(() => {
225
225
  A(y(b({}, l), {
226
226
  current: 1
227
227
  })), w();
228
228
  }, [ee]), C(() => {
229
- Te("");
229
+ ze("");
230
230
  }, [u]), C(() => {
231
231
  if (v.length === 0) {
232
- Ie(!1);
232
+ ke(!1);
233
233
  return;
234
234
  }
235
235
  const e = v.every((t) => P.has(t.id));
236
- Ie(e);
236
+ ke(e);
237
237
  }, [v, P]);
238
- const ze = () => {
238
+ const Be = () => {
239
239
  o && g.cvforceDatahub.getDatasetsIdVersionsVidSamples(c, o.id, {
240
240
  pageNo: 1,
241
241
  pageSize: 1e3,
242
242
  confirmStatus: 1
243
243
  }).then((e) => {
244
- wt(e.recordList.length);
244
+ Rt(e.recordList.length);
245
245
  });
246
- }, Ae = () => {
246
+ }, Me = () => {
247
247
  !c || !o || g.cvforceDatahub.getPreLabelTask(c, 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 (Qe(t), Ce && (clearTimeout(Ce), Ve(null)), !(t != null && t.state) || t.state !== dn.Started) {
250
+ Ye(!1), w();
251
251
  return;
252
252
  } else
253
- Xe(!0);
254
- Re(setTimeout(() => {
255
- Ae();
253
+ Ye(!0);
254
+ Ve(setTimeout(() => {
255
+ Me();
256
256
  }, 1e4));
257
257
  });
258
258
  };
@@ -260,10 +260,10 @@ const ii = (L) => {
260
260
  x && x.markType !== "detection" && console.error("当前数据集不是detection(物体检测)类型,请检查数据集类型。");
261
261
  }, [x]);
262
262
  const A = (e, t) => {
263
- const n = (e == null ? void 0 : e.current) || l.current, i = (e == null ? void 0 : e.pageSize) || l.pageSize;
263
+ const n = (e == null ? void 0 : e.current) || l.current, r = (e == null ? void 0 : e.pageSize) || l.pageSize;
264
264
  if (!c || !o || !n)
265
265
  return Promise.resolve(!1);
266
- const r = Se.current, s = W.map((k) => k.label), f = () => {
266
+ const i = Ie.current, s = W.map((k) => k.label), f = () => {
267
267
  switch (h) {
268
268
  case "nocode":
269
269
  return "nocode";
@@ -285,80 +285,80 @@ const ii = (L) => {
285
285
  return 2;
286
286
  }
287
287
  };
288
- return n === 1 && Mt(), T(y(b({}, l), {
288
+ return n === 1 && Ht(), T(y(b({}, l), {
289
289
  current: n,
290
- pageSize: i
290
+ pageSize: r
291
291
  })), g.cvforceDatahub.getDatasetsIdVersionsVidSamples(c, o.id, {
292
292
  pageNo: n,
293
- pageSize: i,
293
+ pageSize: r,
294
294
  labels: f(),
295
295
  confirmStatus: S(),
296
296
  searchName: ee
297
297
  }).then((k) => {
298
- if (r !== Se.current)
298
+ if (i !== Ie.current)
299
299
  return !1;
300
300
  const E = k.recordList || [], K = n === 1 ? E : [...t || v, ...E];
301
301
  if (U(K), T(y(b({}, l), {
302
302
  current: n,
303
- pageSize: i,
303
+ pageSize: r,
304
304
  total: k.totalResults
305
305
  })), l.type === "next" && E.length) {
306
306
  V(0);
307
307
  const F = k.recordList[0];
308
- R(F);
308
+ N(F);
309
309
  }
310
310
  if (l.type === "prev" && E.length) {
311
311
  V(l.pageSize - 1);
312
312
  const F = k.recordList[l.pageSize - 1];
313
- R(F);
313
+ N(F);
314
314
  }
315
- return he && M < 0 && (V(0), R(E[0]), ue(!0)), K;
315
+ return ue && M < 0 && (V(0), N(E[0]), ge(!0)), K;
316
316
  }).catch(() => !1);
317
317
  };
318
318
  C(() => {
319
319
  T(h === "nocode" ? y(b({}, l), {
320
- total: de
320
+ total: fe
321
321
  }) : h === "" ? y(b({}, l), {
322
322
  total: Q
323
323
  }) : h === "pending" ? y(b({}, l), {
324
- total: fe
324
+ total: he
325
325
  }) : y(b({}, l), {
326
- total: Q - de - fe
326
+ total: Q - fe - he
327
327
  }));
328
- }, [de, Q, fe]);
328
+ }, [fe, Q, he]);
329
329
  const w = () => {
330
330
  !c || !o || g.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(c, o.id, {
331
331
  label: "allcode",
332
332
  confirmStatus: 2,
333
333
  searchName: ee
334
334
  }).then((e) => {
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);
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);
337
337
  });
338
338
  }, q = () => {
339
339
  if (!c || !(o != null && o.id))
340
340
  return;
341
- const e = Ce.current;
341
+ const e = xe.current;
342
342
  let t = 2;
343
343
  return h === "pending" ? t = 1 : h === "hascode" && (t = 0), g.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(c, 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) => ({
348
+ const i = (n || []).filter((s) => s.label !== "nocode").map((s, f) => ({
349
349
  label: s.label,
350
350
  count: s.count,
351
351
  id: s.id,
352
- color: at[f % 40]
352
+ color: ft[f % 40]
353
353
  }));
354
- return je(r), n;
354
+ return _e(i), n;
355
355
  });
356
- }, Tt = (e) => {
356
+ }, zt = (e) => {
357
357
  if (!v)
358
358
  return;
359
359
  j(!1), V(e);
360
360
  const t = v[e];
361
- R(t), z(void 0), ue(!0), h !== void 0 && (ge.current[h] = {
361
+ N(t), z(void 0), ge(!0), h !== void 0 && (pe.current[h] = {
362
362
  index: e,
363
363
  page: l.current || 1
364
364
  });
@@ -375,54 +375,54 @@ const ii = (L) => {
375
375
  labels: e
376
376
  }));
377
377
  }, [O]);
378
- const _ = (e, t, n, i) => {
378
+ const _ = (e, t, n, r) => {
379
379
  setTimeout(() => {
380
- i === Z.current && (V(t), R(e[t]), z(void 0), h !== void 0 && (ge.current[h] = {
380
+ r === Z.current && (V(t), N(e[t]), z(void 0), h !== void 0 && (pe.current[h] = {
381
381
  index: t,
382
382
  page: n
383
383
  }));
384
384
  }, 0);
385
- }, Ye = (e, t) => {
385
+ }, nt = (e, t) => {
386
386
  if (!v)
387
387
  return;
388
388
  const n = ++Z.current;
389
- if (!he) {
390
- U((i) => {
389
+ if (!ue) {
390
+ U((r) => {
391
391
  var S;
392
- 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({
392
+ 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({
396
396
  current: l.current + 1,
397
397
  pageSize: l.pageSize,
398
398
  type: "next"
399
- }, i).then((k) => {
400
- Array.isArray(k) && _(k, r, l.current + 1, n);
401
- }) : _(i, r, l.current || 1, n), i;
399
+ }, r).then((k) => {
400
+ Array.isArray(k) && _(k, i, l.current + 1, n);
401
+ }) : _(r, i, l.current || 1, n), r;
402
402
  });
403
403
  return;
404
404
  }
405
- return xe(e, t).then((i) => (i && n === Z.current && (console.log("action", t, "changedSample", d), w(), U((r) => {
405
+ return Le(e, t).then((r) => (r && n === Z.current && (console.log("action", t, "changedSample", d), w(), U((i) => {
406
406
  var f, S;
407
407
  let s;
408
- if (Array.isArray(r)) {
409
- if (!r.length)
410
- return te(), r;
408
+ if (Array.isArray(i)) {
409
+ if (!i.length)
410
+ return te(), i;
411
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
412
  if (d) {
413
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);
415
- B > -1 && (r.splice(B, 1), s = [...r], l.total && (l.total = l.total - 1));
414
+ const B = i.findIndex((Fe) => Fe.id === d.id);
415
+ B > -1 && (i.splice(B, 1), s = [...i], l.total && (l.total = l.total - 1));
416
416
  }
417
417
  } else if (t === "CONFIRM" && h === "pending") {
418
- const B = r.findIndex((Ee) => Ee.id === (u == null ? void 0 : u.id));
419
- B > -1 && (r.splice(B, 1), s = [...r], l.total && (l.total = l.total - 1));
418
+ const B = i.findIndex((Fe) => Fe.id === (u == null ? void 0 : u.id));
419
+ B > -1 && (i.splice(B, 1), s = [...i], l.total && (l.total = l.total - 1));
420
420
  }
421
- if (X >= r.length)
421
+ if (X >= i.length)
422
422
  if (l.total && X >= l.total) {
423
- if (r.length > 0) {
424
- const B = r.length - 1;
425
- _(r, B, l.current || 1, n);
423
+ if (i.length > 0) {
424
+ const B = i.length - 1;
425
+ _(i, B, l.current || 1, n);
426
426
  }
427
427
  D.error("已经是最后一个了");
428
428
  } else
@@ -430,33 +430,33 @@ const ii = (L) => {
430
430
  current: l.current + 1,
431
431
  pageSize: l.pageSize,
432
432
  type: "next"
433
- }, r).then((B) => {
433
+ }, i).then((B) => {
434
434
  Array.isArray(B) && _(B, X, l.current + 1, n);
435
435
  });
436
436
  else
437
- _(r, X, l.current || 1, n);
437
+ _(i, X, l.current || 1, n);
438
438
  }
439
- return s || r;
440
- })), i));
441
- }, Pt = (e) => {
439
+ return s || i;
440
+ })), r));
441
+ }, At = (e) => {
442
442
  if (!v)
443
443
  return;
444
444
  const t = ++Z.current;
445
- if (!he) {
445
+ if (!ue) {
446
446
  U((n) => {
447
447
  if (!Array.isArray(n) || !n.length)
448
448
  return te(), n;
449
- const i = M - 1;
450
- return i < 0 ? D.error("已经是第一个了") : _(n, i, l.current || 1, t), n;
449
+ const r = M - 1;
450
+ return r < 0 ? D.error("已经是第一个了") : _(n, r, l.current || 1, t), n;
451
451
  });
452
452
  return;
453
453
  }
454
- xe(e).then((n) => {
455
- n && t === Z.current && (w(), U((i) => {
456
- let r;
457
- if (Array.isArray(i)) {
458
- if (!i.length)
459
- return te(), i;
454
+ Le(e).then((n) => {
455
+ n && t === Z.current && (w(), U((r) => {
456
+ let i;
457
+ if (Array.isArray(r)) {
458
+ if (!r.length)
459
+ return te(), r;
460
460
  const s = M - 1;
461
461
  if (s < 0)
462
462
  s < 0 ? D.error("已经是第一个了") : T({
@@ -466,45 +466,45 @@ const ii = (L) => {
466
466
  });
467
467
  else {
468
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));
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));
471
471
  }
472
- _(i, s, l.current || 1, t);
472
+ _(r, s, l.current || 1, t);
473
473
  }
474
474
  }
475
- return r || i;
475
+ return i || r;
476
476
  }));
477
477
  });
478
- }, Vt = (e) => {
479
- const t = Object.keys(e.labels.reduce((n, i) => (n[i.label] ? ++n[i.label] : n[i.label] = 1, n), {})).length;
478
+ }, Et = (e) => {
479
+ const t = Object.keys(e.labels.reduce((n, r) => (n[r.label] ? ++n[r.label] : n[r.label] = 1, n), {})).length;
480
480
  return t >= 2 ? `+${t - 1}` : null;
481
- }, zt = (e) => {
481
+ }, Bt = (e) => {
482
482
  var k, E;
483
483
  const {
484
484
  scrollTop: t,
485
485
  scrollHeight: n,
486
- 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) => {
486
+ 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) => {
489
489
  var F;
490
490
  return y(b({}, K), {
491
491
  current: ((F = K.current) != null ? F : 0) + 1
492
492
  });
493
493
  });
494
- }, xe = (e, t) => {
495
- var n, i;
494
+ }, Le = (e, t) => {
495
+ var n, r;
496
496
  if (!o)
497
497
  return Promise.resolve(!1);
498
498
  if (d && !H) {
499
- const r = y(b({}, d), {
499
+ const i = y(b({}, d), {
500
500
  labels: d.labels ? [...d.labels] : []
501
501
  });
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(() => {
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(() => {
503
503
  D.success({
504
504
  content: "保存成功"
505
505
  });
506
- const s = y(b({}, r), {
507
- labels: r.labels ? [...r.labels] : []
506
+ const s = y(b({}, i), {
507
+ labels: i.labels ? [...i.labels] : []
508
508
  });
509
509
  return U((f) => {
510
510
  const S = f.findIndex((k) => k.id === (s == null ? void 0 : s.id));
@@ -513,20 +513,20 @@ const ii = (L) => {
513
513
  return k[S] = s, k;
514
514
  }
515
515
  return f;
516
- }), R(s), z(s), !0;
516
+ }), N(s), z(s), !0;
517
517
  }).catch(() => !1);
518
518
  } 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({
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({
520
520
  content: "保存成功"
521
- }), U((r) => {
522
- const s = r.findIndex((f) => f.id === (u == null ? void 0 : u.id));
523
- return s > -1 && (r[s] = u), [...r];
524
- }), R(b({}, u)), !0)).catch(() => !1)) : Promise.resolve(!0);
525
- }, At = (e, t) => {
521
+ }), U((i) => {
522
+ const s = i.findIndex((f) => f.id === (u == null ? void 0 : u.id));
523
+ return s > -1 && (i[s] = u), [...i];
524
+ }), N(b({}, u)), !0)).catch(() => !1)) : Promise.resolve(!0);
525
+ }, Mt = (e, t) => {
526
526
  if (d && d.labels.some((n) => !n.id))
527
527
  return D.error("所有标注需设置标签"), Promise.resolve(!1);
528
- Ye(e, t);
529
- }, Et = (e) => {
528
+ nt(e, t);
529
+ }, Ft = (e) => {
530
530
  if (d && d.labels.some((t) => !t.id)) {
531
531
  D.error("所有标注需设置标签");
532
532
  return;
@@ -535,11 +535,11 @@ const ii = (L) => {
535
535
  j(!1);
536
536
  return;
537
537
  }
538
- xe(e).then((t) => {
538
+ Le(e).then((t) => {
539
539
  t && (z(void 0), j(!1), w(), q());
540
540
  });
541
- }, Bt = () => {
542
- ke.confirm({
541
+ }, Ot = () => {
542
+ we.confirm({
543
543
  title: "确认要删除当前数据吗?",
544
544
  content: "数据包含当前标注的内容和图片,删除后无法恢复,请确认是否删除!",
545
545
  onOk: () => {
@@ -549,7 +549,7 @@ const ii = (L) => {
549
549
  const t = v.length;
550
550
  U([...v]), T(y(b({}, l), {
551
551
  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(() => {
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
553
  T((n) => y(b({}, n), {
554
554
  current: 1,
555
555
  type: void 0
@@ -558,43 +558,43 @@ const ii = (L) => {
558
558
  });
559
559
  }
560
560
  });
561
- }, et = [{
561
+ }, rt = [{
562
562
  key: "",
563
563
  label: `全部(${Q})`,
564
564
  children: null
565
565
  }, {
566
566
  key: "nocode",
567
- label: `未标注(${de})`,
567
+ label: `未标注(${fe})`,
568
568
  children: null
569
569
  }, {
570
570
  key: "pending",
571
- label: `待确认(${fe})`,
571
+ label: `待确认(${he})`,
572
572
  children: null
573
573
  }, {
574
574
  key: "hascode",
575
- label: `已标注(${Q - de - fe})`,
575
+ label: `已标注(${Q - fe - he})`,
576
576
  children: null
577
- }], Mt = () => {
577
+ }], Ht = () => {
578
578
  var e, t;
579
- (t = (e = ae.current) == null ? void 0 : e.getElementsByClassName("rc-virtual-list-holder")[0]) == null || t.scrollTo({
579
+ (t = (e = ce.current) == null ? void 0 : e.getElementsByClassName("rc-virtual-list-holder")[0]) == null || t.scrollTo({
580
580
  top: 0
581
581
  });
582
- }, Ft = (e) => {
583
- Dt(e), ne();
584
- }, tt = (e) => {
585
- Se.current++, Ce.current++, Z.current++, M >= 0 && h !== void 0 && h !== null && (ge.current[h] = {
582
+ }, Ut = (e) => {
583
+ Tt(e), ne();
584
+ }, it = (e) => {
585
+ Ie.current++, xe.current++, Z.current++, M >= 0 && h !== void 0 && h !== null && (pe.current[h] = {
586
586
  index: M,
587
587
  page: l.current || 1
588
- }), ne(), d ? xe(d == null ? void 0 : d.confirmStatus).then((t) => {
589
- t ? (we(e), w()) : D.error("保存失败");
588
+ }), ne(), d ? Le(d == null ? void 0 : d.confirmStatus).then((t) => {
589
+ t ? (Re(e), w()) : D.error("保存失败");
590
590
  }) : (T(y(b({}, l), {
591
591
  current: 1,
592
592
  total: void 0
593
- })), we(e)), e === "nocode" && Ne([]);
594
- }, Ot = () => {
593
+ })), Re(e)), e === "nocode" && Pe([]);
594
+ }, qt = () => {
595
595
  if (console.log("一键确认", g, o), !(g != null && g.cvforceDatahub) || !(o != null && o.id))
596
596
  return Promise.resolve(!1);
597
- ke.confirm({
597
+ we.confirm({
598
598
  title: "一键保存所有标注?",
599
599
  content: "待确认的所有带预标注信息的图片将保存至已标注页签下",
600
600
  onOk: () => {
@@ -605,19 +605,19 @@ const ii = (L) => {
605
605
  });
606
606
  }
607
607
  });
608
- }, Ht = (e, t) => {
608
+ }, Kt = (e, t) => {
609
609
  const n = new Set(P);
610
- t ? n.add(e) : n.delete(e), Ve(n);
611
- }, Ut = (e) => {
610
+ t ? n.add(e) : n.delete(e), Ee(n);
611
+ }, Wt = (e) => {
612
612
  const t = new Set(P);
613
613
  e ? v.forEach((n) => {
614
614
  t.add(n.id);
615
615
  }) : v.forEach((n) => {
616
616
  t.delete(n.id);
617
- }), Ve(t), Ie(e);
617
+ }), Ee(t), ke(e);
618
618
  }, ne = () => {
619
- Ve(/* @__PURE__ */ new Set()), Ie(!1);
620
- }, nt = () => {
619
+ Ee(/* @__PURE__ */ new Set()), ke(!1);
620
+ }, ot = () => {
621
621
  const e = v.filter((n) => P.has(n.id)), t = {
622
622
  nocode: 0,
623
623
  pending: 0,
@@ -626,12 +626,14 @@ const ii = (L) => {
626
626
  return e.forEach((n) => {
627
627
  n.confirmStatus === 1 ? t.pending++ : !n.labels || n.labels.length === 0 ? t.nocode++ : t.hascode++;
628
628
  }), t;
629
- }, qt = () => {
629
+ }, $t = () => {
630
+ if (!ye)
631
+ return;
630
632
  if (P.size === 0) {
631
633
  D.warning("请先选择要删除的图片");
632
634
  return;
633
635
  }
634
- const e = nt(), t = e.nocode > 0, n = e.pending > 0, i = e.hascode > 0, r = /* @__PURE__ */ m("div", {
636
+ const e = ot(), t = e.nocode > 0, n = e.pending > 0, r = e.hascode > 0, i = /* @__PURE__ */ m("div", {
635
637
  children: [/* @__PURE__ */ a("p", {
636
638
  style: {
637
639
  marginBottom: 16
@@ -681,7 +683,7 @@ const ii = (L) => {
681
683
  }), /* @__PURE__ */ m("span", {
682
684
  children: [e.pending, "张"]
683
685
  })]
684
- }), i && /* @__PURE__ */ m("div", {
686
+ }), r && /* @__PURE__ */ m("div", {
685
687
  style: {
686
688
  display: "flex",
687
689
  alignItems: "center",
@@ -709,13 +711,13 @@ const ii = (L) => {
709
711
  children: "彻底移除选中的图片文件及其关联的所有标注坐标、标签信息。数据不可恢复。"
710
712
  })]
711
713
  });
712
- ke.confirm({
714
+ we.confirm({
713
715
  title: "删除操作确认",
714
- content: r,
716
+ content: i,
715
717
  okText: "确定",
716
718
  cancelText: "取消",
717
719
  width: 500,
718
- onOk: () => Be(void 0, null, function* () {
720
+ onOk: () => Oe(void 0, null, function* () {
719
721
  if (!o)
720
722
  return;
721
723
  const s = Array.from(P);
@@ -732,12 +734,14 @@ const ii = (L) => {
732
734
  }
733
735
  })
734
736
  });
735
- }, Kt = () => {
737
+ }, jt = () => {
738
+ if (!ae)
739
+ return;
736
740
  if (P.size === 0) {
737
741
  D.warning("请先选择要清除标注的图片");
738
742
  return;
739
743
  }
740
- const e = nt(), t = e.nocode > 0, n = e.pending > 0, i = e.hascode > 0, r = /* @__PURE__ */ m("div", {
744
+ const e = ot(), t = e.nocode > 0, n = e.pending > 0, r = e.hascode > 0, i = /* @__PURE__ */ m("div", {
741
745
  children: [/* @__PURE__ */ a("p", {
742
746
  style: {
743
747
  marginBottom: 16
@@ -787,7 +791,7 @@ const ii = (L) => {
787
791
  }), /* @__PURE__ */ m("span", {
788
792
  children: [e.pending, "张"]
789
793
  })]
790
- }), i && /* @__PURE__ */ m("div", {
794
+ }), r && /* @__PURE__ */ m("div", {
791
795
  style: {
792
796
  display: "flex",
793
797
  alignItems: "center",
@@ -812,13 +816,13 @@ const ii = (L) => {
812
816
  children: '保留图片文件,仅删除其内部的标注框(含 AI 预标注)。删除后图片状态变更为"未标注"。'
813
817
  })]
814
818
  });
815
- ke.confirm({
819
+ we.confirm({
816
820
  title: "删除操作确认",
817
- content: r,
821
+ content: i,
818
822
  okText: "确定",
819
823
  cancelText: "取消",
820
824
  width: 500,
821
- onOk: () => Be(void 0, null, function* () {
825
+ onOk: () => Oe(void 0, null, function* () {
822
826
  if (!o)
823
827
  return;
824
828
  const s = v.filter((f) => P.has(f.id));
@@ -840,23 +844,31 @@ const ii = (L) => {
840
844
  }
841
845
  })
842
846
  });
843
- };
844
- return /* @__PURE__ */ a(Jt, {
845
- locale: sn,
846
- children: /* @__PURE__ */ a(an.Provider, {
847
+ }, Gt = [...ye ? [{
848
+ key: "deleteWithAnnotations",
849
+ label: "删除所选图片(含标注)",
850
+ onClick: $t
851
+ }] : [], ...ae ? [{
852
+ key: "clearAnnotations",
853
+ label: "仅清除所选图片内的标注",
854
+ onClick: jt
855
+ }] : []];
856
+ return /* @__PURE__ */ a(tn, {
857
+ locale: fn,
858
+ children: /* @__PURE__ */ a(hn.Provider, {
847
859
  value: {
848
860
  datasetId: c,
849
861
  versionId: (o == null ? void 0 : o.id) || "",
850
862
  no: (o == null ? void 0 : o.no) || "",
851
- loading: Fe,
863
+ loading: Ue,
852
864
  version: o,
853
- versions: ve,
865
+ versions: Se,
854
866
  samples: v,
855
867
  pagination: l,
856
868
  services: g,
857
869
  featuresConfig: {
858
- labelManager: be,
859
- datasetManager: N,
870
+ labelManager: ve,
871
+ datasetManager: R,
860
872
  annotation: oe,
861
873
  filterSwitch: se,
862
874
  header: I,
@@ -865,160 +877,152 @@ const ii = (L) => {
865
877
  },
866
878
  children: x ? x.markType === "detection" ? /* @__PURE__ */ a("div", {
867
879
  className: "detection-version-detail",
868
- children: kt ? o != null && o.id && N && N.preLabel ? /* @__PURE__ */ a(hn, {
880
+ children: Dt ? o != null && o.id && R && R.preLabel ? /* @__PURE__ */ a(mn, {
869
881
  datasetId: c,
870
882
  versionId: o.id,
871
883
  onClose: () => {
872
- Lt(!1), ze(), q(), w(), A();
884
+ Nt(!1), Be(), q(), w(), A();
873
885
  },
874
886
  samples: v,
875
887
  labels: O,
876
- fetchLength: ze
877
- }) : null : /* @__PURE__ */ m(gn, {
888
+ fetchLength: Be
889
+ }) : null : /* @__PURE__ */ m(vn, {
878
890
  className: "product-details-page",
879
- header: I === !1 ? void 0 : /* @__PURE__ */ a(mn, {
880
- backTo: me,
891
+ header: I === !1 ? void 0 : /* @__PURE__ */ a(Sn, {
892
+ backTo: be,
881
893
  onBackClick: I != null && I.onBackClick ? () => {
882
894
  u && te(), I.onBackClick && I.onBackClick();
883
895
  } : void 0,
884
- left: !Fe && /* @__PURE__ */ m(pe, {
896
+ left: !Ue && /* @__PURE__ */ m(me, {
885
897
  children: [/* @__PURE__ */ a("span", {
886
898
  style: {
887
899
  fontWeight: "bold"
888
900
  },
889
901
  children: x == null ? void 0 : x.name
890
- }), /* @__PURE__ */ a(Qt, {
902
+ }), /* @__PURE__ */ a(nn, {
891
903
  disabled: (I == null ? void 0 : I.versionSelect) === !1,
892
904
  value: o == null ? void 0 : o.id,
893
905
  style: {
894
906
  width: 70
895
907
  },
896
- options: ve.map((e) => ({
908
+ options: Se.map((e) => ({
897
909
  label: e.no,
898
910
  value: e.id
899
911
  })),
900
912
  onChange: (e) => {
901
- const t = ve.find((i) => i.id === e);
913
+ const t = Se.find((r) => r.id === e);
902
914
  if (!x || !t)
903
915
  return;
904
- const n = ve.find((i) => i.id === t.id);
905
- ce(n), ne(), I != null && I.onVersionChange && I.onVersionChange(n);
916
+ const n = Se.find((r) => r.id === t.id);
917
+ de(n), ne(), I != null && I.onVersionChange && I.onVersionChange(n);
906
918
  }
907
919
  })]
908
920
  }),
909
- right: /* @__PURE__ */ m(pe, {
910
- children: [!u && N && N.add && /* @__PURE__ */ a(ct, {
921
+ right: /* @__PURE__ */ m(me, {
922
+ children: [!u && R && R.add && /* @__PURE__ */ a(ht, {
911
923
  isPreLabel: H,
912
924
  placement: "bottom",
913
- children: /* @__PURE__ */ a(ie, {
925
+ children: /* @__PURE__ */ a(re, {
914
926
  type: "default",
915
- onClick: () => De(!0),
916
- disabled: G === re.Pending || G === re.Started || H,
927
+ onClick: () => Te(!0),
928
+ disabled: G === ie.Pending || G === ie.Started || H,
917
929
  children: "导入数据"
918
930
  }, "del")
919
- }), /* @__PURE__ */ a(lt, {
931
+ }), /* @__PURE__ */ a(ct, {
920
932
  menu: {
921
933
  items: [{
922
934
  key: "manual",
923
- label: /* @__PURE__ */ a(ct, {
935
+ label: /* @__PURE__ */ a(ht, {
924
936
  isPreLabel: H,
925
- children: /* @__PURE__ */ a(pe, {
926
- children: N && N.label && /* @__PURE__ */ a(ie, {
937
+ children: /* @__PURE__ */ a(me, {
938
+ children: ae && /* @__PURE__ */ a(re, {
927
939
  type: "text",
928
940
  disabled: H,
929
941
  onClick: () => {
930
- u || we("nocode"), j(!0), V(-1), h === "nocode" && (V(0), R(v[0])), ue(!0);
942
+ u || Re("nocode"), j(!0), V(-1), h === "nocode" && (V(0), N(v[0])), ge(!0);
931
943
  },
932
944
  children: "人工标注"
933
945
  })
934
946
  })
935
947
  })
936
- }, !u && N && N.preLabel && (o != null && o.id) ? {
948
+ }, !u && R && R.preLabel && (o != null && o.id) ? {
937
949
  key: "auto",
938
- label: /* @__PURE__ */ a(Sn, {
950
+ label: /* @__PURE__ */ a(kn, {
939
951
  buttonType: "text",
940
952
  datasetId: c,
941
953
  versionId: o.id,
942
954
  disabled: !v.length,
943
- setIsTaskChange: xt,
955
+ setIsTaskChange: wt,
944
956
  datasetType: "detection",
945
- preLabelTask: Ze
957
+ preLabelTask: Je
946
958
  })
947
959
  } : null]
948
960
  },
949
961
  placement: "bottom",
950
- children: /* @__PURE__ */ m(ie, {
962
+ children: /* @__PURE__ */ m(re, {
951
963
  type: "primary",
952
- children: ["开始标注", /* @__PURE__ */ a(dt, {})]
964
+ children: ["开始标注", /* @__PURE__ */ a(ut, {})]
953
965
  })
954
- }), /* @__PURE__ */ a(yn, {
955
- when: vt,
966
+ }), /* @__PURE__ */ a(xn, {
967
+ when: Ct,
956
968
  content: "确认要离开此页面吗?",
957
969
  subContent: "离开此页面后,将结束导入,放弃未上传的文件,请谨慎操作!"
958
- }), Ke && /* @__PURE__ */ a(pn, {
959
- datasetIam: gt,
970
+ }), je && /* @__PURE__ */ a(yn, {
971
+ datasetIam: bt,
960
972
  datasetId: c,
961
973
  currentVersion: o,
962
974
  tenCode: x == null ? void 0 : x.tenantCode,
963
- isVisible: Ke,
964
- setIsVisible: De,
975
+ isVisible: je,
976
+ setIsVisible: Te,
965
977
  getVersionListRequest: w,
966
- setIsConfirm: bt,
978
+ setIsConfirm: St,
967
979
  onUploadStatusChange: (e) => {
968
- mt(e);
980
+ yt(e);
969
981
  },
970
982
  tableReload: () => {
971
983
  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({
984
+ o != null && o.id && ((t = (e = ce.current) == null ? void 0 : e.getElementsByClassName("rc-virtual-list-holder")[0]) == null || t.scrollTo({
973
985
  top: 0
974
986
  }), A(y(b({}, l), {
975
987
  current: 1
976
- })), (n = Le.current) == null || n.fetchLabels());
988
+ })), (n = Ne.current) == null || n.fetchLabels());
977
989
  },
978
- loadVersionData: Qe,
990
+ loadVersionData: tt,
979
991
  markType: x.markType
980
992
  })]
981
993
  })
982
994
  }),
983
995
  children: [/* @__PURE__ */ m("div", {
984
996
  className: "detection-header",
985
- children: [/* @__PURE__ */ m(pe, {
986
- children: [se.tabs && /* @__PURE__ */ a(Yt, {
997
+ children: [/* @__PURE__ */ m(me, {
998
+ children: [se.tabs && /* @__PURE__ */ a(rn, {
987
999
  className: "header-tab",
988
1000
  activeKey: h,
989
- items: et,
990
- onChange: tt
991
- }), !u && se.search && /* @__PURE__ */ a(vn, {
1001
+ items: rt,
1002
+ onChange: it
1003
+ }), !u && se.search && /* @__PURE__ */ a(In, {
992
1004
  placeholder: "请输入图片名称搜索",
993
1005
  style: {
994
1006
  width: 200
995
1007
  },
996
- suffix: /* @__PURE__ */ a(un, {}),
1008
+ suffix: /* @__PURE__ */ a(bn, {}),
997
1009
  value: ee,
998
- onChange: Ft,
1010
+ onChange: Ut,
999
1011
  allowClear: !0
1000
- }), !u && /* @__PURE__ */ a(lt, {
1012
+ }), !u && De && /* @__PURE__ */ a(ct, {
1001
1013
  menu: {
1002
- items: [{
1003
- key: "deleteWithAnnotations",
1004
- label: "删除所选图片(含标注)",
1005
- onClick: qt
1006
- }, {
1007
- key: "clearAnnotations",
1008
- label: "仅清除所选图片内的标注",
1009
- onClick: Kt
1010
- }]
1014
+ items: Gt
1011
1015
  },
1012
1016
  disabled: P.size === 0,
1013
- children: /* @__PURE__ */ m(ie, {
1017
+ children: /* @__PURE__ */ m(re, {
1014
1018
  size: "middle",
1015
1019
  disabled: P.size === 0,
1016
- children: ["删除", /* @__PURE__ */ a(dt, {})]
1020
+ children: ["删除", /* @__PURE__ */ a(ut, {})]
1017
1021
  })
1018
- }), !u && /* @__PURE__ */ m(ot, {
1019
- children: [/* @__PURE__ */ a(st, {
1020
- checked: Nt,
1021
- onChange: (e) => Ut(e.target.checked),
1022
+ }), !u && De && /* @__PURE__ */ m(at, {
1023
+ children: [/* @__PURE__ */ a(dt, {
1024
+ checked: Pt,
1025
+ onChange: (e) => Wt(e.target.checked),
1022
1026
  children: "选择当前页"
1023
1027
  }), P.size > 0 && /* @__PURE__ */ m("span", {
1024
1028
  style: {
@@ -1027,11 +1031,11 @@ 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__ */ a(me, {
1035
+ children: h === "pending" && /* @__PURE__ */ a(re, {
1032
1036
  type: "primary",
1033
1037
  className: "pending-confirm-button",
1034
- onClick: Ot,
1038
+ onClick: qt,
1035
1039
  children: "一键确认"
1036
1040
  })
1037
1041
  })]
@@ -1039,42 +1043,42 @@ 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, {
1046
+ ref: ce,
1047
+ children: [Y && /* @__PURE__ */ a(Nn, {
1044
1048
  datasetId: c,
1045
1049
  isImageDetailVisible: Y,
1046
- setIsImageDetailVisible: ue,
1050
+ setIsImageDetailVisible: ge,
1047
1051
  currentSample: d != null ? d : u,
1048
1052
  labels: O,
1049
- previewMode: !he,
1050
- filterItems: et,
1053
+ previewMode: !ue,
1054
+ filterItems: rt,
1051
1055
  filterMode: h,
1052
- onFilterChange: tt,
1056
+ onFilterChange: it,
1053
1057
  onChange: z,
1054
- onNextClick: (e) => Ye(e),
1055
- onPrevClick: (e) => Pt(e),
1056
- onSave: (e, t) => At(e, t),
1057
- onDeleteSample: () => Bt(),
1058
+ onNextClick: (e) => nt(e),
1059
+ onPrevClick: (e) => At(e),
1060
+ onSave: (e, t) => Mt(e, t),
1061
+ onDeleteSample: () => Ot(),
1058
1062
  onEnterEdit: () => {
1059
1063
  j(!0);
1060
1064
  },
1061
- onBackToDetail: (e) => Et(e),
1062
- onLoadingChange: Rt,
1065
+ onBackToDetail: (e) => Ft(e),
1066
+ onLoadingChange: Vt,
1063
1067
  onRefresh: () => {
1064
1068
  var e;
1065
1069
  (e = q()) == null || e.then((t) => {
1066
- var n, i;
1070
+ var n, r;
1067
1071
  if (d) {
1068
- const r = [];
1072
+ const i = [];
1069
1073
  (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));
1074
+ t != null && t.find((f) => f.id === s.id) && i.push(s);
1075
+ }), d.labels = i, z(b({}, d));
1072
1076
  }
1073
1077
  if (u) {
1074
- const r = [];
1075
- (i = u.labels) == null || i.forEach((s) => {
1076
- t != null && t.find((f) => f.id === s.id) && r.push(s);
1077
- }), u.labels = r, R(b({}, u));
1078
+ const i = [];
1079
+ (r = u.labels) == null || r.forEach((s) => {
1080
+ t != null && t.find((f) => f.id === s.id) && i.push(s);
1081
+ }), u.labels = i, N(b({}, u));
1078
1082
  }
1079
1083
  }), w();
1080
1084
  },
@@ -1083,57 +1087,57 @@ const ii = (L) => {
1083
1087
  total: Q,
1084
1088
  index: M + 1
1085
1089
  },
1086
- settingHide: !be,
1087
- canLabel: !!(N && N.label),
1088
- canDelete: !!(N && N.delete)
1089
- }), l.total !== void 0 && l.total > 0 ? /* @__PURE__ */ a(ot, {
1090
- children: /* @__PURE__ */ a(on, {
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, {
1091
1095
  innerProps: {
1092
1096
  className: "d-right-row"
1093
1097
  },
1094
1098
  data: v,
1095
1099
  itemKey: "id",
1096
- height: Math.max(ft, 1),
1097
- onScroll: zt,
1100
+ height: Math.max(gt, 1),
1101
+ onScroll: Bt,
1098
1102
  children: (e, t) => {
1099
1103
  var n;
1100
- return /* @__PURE__ */ a(en, {
1104
+ return /* @__PURE__ */ a(on, {
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(""),
1109
+ onMouseEnter: () => ze(e.id),
1110
+ onMouseLeave: () => ze(""),
1107
1111
  children: [/* @__PURE__ */ a("div", {
1108
1112
  className: "detection-status-wrapper",
1109
- children: /* @__PURE__ */ a(xn, {
1113
+ children: /* @__PURE__ */ a(Dn, {
1110
1114
  sample: e
1111
1115
  })
1112
- }), /* @__PURE__ */ a("div", {
1116
+ }), De && /* @__PURE__ */ a("div", {
1113
1117
  className: "sample-checkbox-wrapper",
1114
- children: /* @__PURE__ */ a(st, {
1118
+ children: /* @__PURE__ */ a(dt, {
1115
1119
  checked: P.has(e.id),
1116
- onChange: (i) => {
1117
- i.stopPropagation(), Ht(e.id, i.target.checked);
1120
+ onChange: (r) => {
1121
+ r.stopPropagation(), Kt(e.id, r.target.checked);
1118
1122
  },
1119
- onClick: (i) => i.stopPropagation()
1123
+ onClick: (r) => r.stopPropagation()
1120
1124
  })
1121
1125
  }), /* @__PURE__ */ a("div", {
1122
1126
  className: "right-col-img",
1123
- onClick: () => Tt(t),
1124
- children: /* @__PURE__ */ a(bn, {
1127
+ onClick: () => zt(t),
1128
+ children: /* @__PURE__ */ a(Cn, {
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__ */ a(ln, {
1132
1136
  placement: "top",
1133
1137
  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", {
1135
- children: i
1136
- }, i))
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", {
1139
+ children: r
1140
+ }, r))
1137
1141
  }),
1138
1142
  children: /* @__PURE__ */ m("div", {
1139
1143
  style: {
@@ -1154,7 +1158,7 @@ const ii = (L) => {
1154
1158
  color: "rgba(0,0,0,0.45)",
1155
1159
  marginLeft: 5
1156
1160
  },
1157
- children: Vt(e)
1161
+ children: Et(e)
1158
1162
  }) : null]
1159
1163
  })
1160
1164
  }) : /* @__PURE__ */ a("span", {
@@ -1173,18 +1177,18 @@ const ii = (L) => {
1173
1177
  })
1174
1178
  }) : /* @__PURE__ */ a("div", {
1175
1179
  className: "empty",
1176
- children: l.total === 0 ? /* @__PURE__ */ a(nn, {
1177
- image: cn,
1180
+ children: l.total === 0 ? /* @__PURE__ */ a(sn, {
1181
+ image: un,
1178
1182
  description: /* @__PURE__ */ m("span", {
1179
1183
  children: ["暂无数据", h !== "hascode" && !ee && /* @__PURE__ */ a("span", {
1180
- children: N && N.add && /* @__PURE__ */ m(ie, {
1184
+ children: R && R.add && /* @__PURE__ */ m(re, {
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,
1190
+ onClick: () => Te(!0),
1191
+ disabled: G === ie.Pending || G === ie.Started,
1188
1192
  children: [/* @__PURE__ */ a("span", {
1189
1193
  style: {
1190
1194
  color: "black"
@@ -1194,17 +1198,17 @@ const ii = (L) => {
1194
1198
  })
1195
1199
  })]
1196
1200
  })
1197
- }) : /* @__PURE__ */ a(rn, {})
1201
+ }) : /* @__PURE__ */ a(an, {})
1198
1202
  })]
1199
1203
  }), h !== "nocode" && se.labels && /* @__PURE__ */ a("div", {
1200
1204
  className: "d-sider",
1201
- children: /* @__PURE__ */ a(dn, {
1202
- ref: Le,
1205
+ children: /* @__PURE__ */ a(gn, {
1206
+ ref: Ne,
1203
1207
  datasetId: c,
1204
1208
  data: O || [],
1205
1209
  selected: W,
1206
1210
  onSelectedChange: (e) => {
1207
- ne(), Ne((O == null ? void 0 : O.filter((t) => e.find((n) => n.label === t.label))) || []);
1211
+ ne(), Pe((O == null ? void 0 : O.filter((t) => e.find((n) => n.label === t.label))) || []);
1208
1212
  },
1209
1213
  onListChange: (e) => {
1210
1214
  if (!o)
@@ -1213,13 +1217,13 @@ const ii = (L) => {
1213
1217
  h === "pending" ? t = 1 : h === "hascode" && (t = 0), g.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(c, o.id, {
1214
1218
  confirmStatus: t
1215
1219
  }).then((n) => {
1216
- const r = (n || []).filter((f) => f.label !== "nocode").map((f, S) => ({
1220
+ const i = (n || []).filter((f) => f.label !== "nocode").map((f, S) => ({
1217
1221
  label: f.label,
1218
1222
  count: f.count,
1219
1223
  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);
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);
1223
1227
  }), w();
1224
1228
  },
1225
1229
  isPreLabel: H
@@ -1238,6 +1242,6 @@ const ii = (L) => {
1238
1242
  });
1239
1243
  };
1240
1244
  export {
1241
- wn as ISampleActionType,
1242
- ii as default
1245
+ Tn as ISampleActionType,
1246
+ sr as default
1243
1247
  };