@glodon-aiot/dataset-annotation 3.16.1-alpha.0 → 3.16.1-alpha.3

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