@glodon-aiot/dataset-annotation 3.24.0-alpha.6 → 3.25.0-alpha.10

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