@glodon-aiot/dataset-annotation 3.25.1-alpha.7 → 3.26.0-alpha.5

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