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