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