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