@glodon-aiot/dataset-annotation 3.22.2-alpha.4 → 3.24.0-alpha.3

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