@glodon-aiot/dataset-annotation 3.25.0-alpha.9 → 3.25.1-alpha.0

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