@glodon-aiot/dataset-annotation 3.25.1-alpha.5 → 3.25.1-alpha.7

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