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

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