@glodon-aiot/dataset-annotation 3.19.0-alpha.17 → 3.19.0-alpha.19

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