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

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