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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,195 +1,232 @@
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";
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";
21
37
  import "./style.less.mjs";
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;
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;
42
58
  const {
43
- services: f,
59
+ services: h,
44
60
  datasetId: c,
45
- versionId: le,
46
- backTo: Ze,
47
- labelManager: Ie = !1,
48
- datasetManager: N = !1,
49
- annotation: We,
50
- header: T = {
61
+ versionId: Z,
62
+ backTo: he,
63
+ labelManager: ue = !1,
64
+ datasetManager: T = !1,
65
+ annotation: Q,
66
+ header: C = {
51
67
  versionSelect: !1
52
68
  },
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({
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({
57
73
  current: 0,
58
74
  pageSize: 100
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), {
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), {
62
78
  current: 1,
63
79
  type: void 0
64
80
  }));
65
81
  }, 10);
66
82
  };
67
- Bt("Esc", j), p(() => {
68
- c && f.cvforceDatahub.getS3Iam(c).then((e) => {
69
- Ge(e);
83
+ Yt("Esc", _), S(() => {
84
+ c && h.cvforceDatahub.getS3Iam(c).then((e) => {
85
+ st(e);
70
86
  });
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([
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([
77
93
  // 数据集
78
- f.cvforceDatahub.getDatasetsId(c).then((e) => {
79
- ye(e);
94
+ h.cvforceDatahub.getDatasetsId(c).then((e) => {
95
+ Re(e);
80
96
  }),
81
97
  // 版本列表
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]);
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]);
84
100
  })
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);
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);
90
106
  });
91
107
  };
92
- p(() => {
93
- U !== W.Pending && U !== W.Started || A.warning("文件导入中,请刷新页面再试");
94
- }, [U]), p(() => {
95
- X(void 0), V(v(m({}, l), {
108
+ S(() => {
109
+ $ !== J.Pending && $ !== J.Started || N.warning("文件导入中,请刷新页面再试");
110
+ }, [$]), S(() => {
111
+ ne(void 0), V(v(b({}, o), {
96
112
  current: 1
97
- })), z([]), Ae();
98
- }, [c, le]), p(() => {
99
- c && f.cvforceDatahub.getDatasetsId(c).then((e) => {
100
- ye(e);
113
+ })), F([]), je();
114
+ }, [c, Z]), S(() => {
115
+ c && h.cvforceDatahub.getDatasetsId(c).then((e) => {
116
+ Re(e);
101
117
  });
102
- }, [c]), p(() => {
103
- Z();
104
- }, [K, i, s]), p(() => {
105
- !i || !L || R(v(m({}, l), {
118
+ }, [c]), S(() => {
119
+ U();
120
+ }, [W, l, a]), S(() => {
121
+ !l || !P || A(v(b({}, o), {
106
122
  current: 1
107
123
  })).then((e) => {
108
124
  });
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), {
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), {
116
138
  current: 1,
139
+ pageSize: e.page * 100,
140
+ // 假设默认pageSize为100
117
141
  total: 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);
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);
123
153
  } else
124
- C(void 0), D(void 0), x(-1), Z(), setTimeout(() => {
125
- V((t) => v(m({}, t), {
154
+ x(void 0), w(void 0), L(-1), U(), setTimeout(() => {
155
+ V((i) => v(b({}, i), {
126
156
  current: 1,
127
157
  type: void 0
128
158
  }));
129
159
  }, 10);
130
160
  });
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(() => {
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(() => {
136
166
  if (!c) {
137
- ce && (clearTimeout(ce), ge(null)), Ee(void 0);
167
+ pe && (clearTimeout(pe), Ie(null)), We(void 0);
138
168
  return;
139
169
  }
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), {
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), {
147
177
  current: 1
148
- })), k();
149
- }, [ne]), p(() => {
150
- be("");
151
- }, [u]);
152
- const me = () => {
153
- i && f.cvforceDatahub.getDatasetsIdVersionsVidSamples(c, i.id, {
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, {
154
191
  pageNo: 1,
155
192
  pageSize: 1e3,
156
193
  confirmStatus: 1
157
194
  }).then((e) => {
158
- lt(e.recordList.length);
195
+ bt(e.recordList.length);
159
196
  });
160
- }, pe = () => {
161
- !c || !i || f.cvforceDatahub.getPreLabelTask(c, i.id).then((e) => {
197
+ }, Ne = () => {
198
+ !c || !l || h.cvforceDatahub.getPreLabelTask(c, l.id).then((e) => {
162
199
  const t = e[0];
163
- if (Ee(t), ce && (clearTimeout(ce), ge(null)), !(t != null && t.state) || t.state !== Rt.Started) {
164
- Re(!1), k();
200
+ if (We(t), pe && (clearTimeout(pe), Ie(null)), !(t != null && t.state) || t.state !== _t.Started) {
201
+ $e(!1), D();
165
202
  return;
166
203
  } else
167
- Re(!0);
168
- ge(setTimeout(() => {
169
- pe();
204
+ $e(!0);
205
+ Ie(setTimeout(() => {
206
+ Ne();
170
207
  }, 1e4));
171
208
  });
172
209
  };
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)
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)
179
216
  return Promise.resolve(!1);
180
- const o = K.map((I) => I.label), h = () => {
181
- switch (s) {
217
+ const r = W.map((I) => I.label), d = () => {
218
+ switch (a) {
182
219
  case "nocode":
183
220
  return "nocode";
184
221
  case "pending":
185
- return o.length ? o : "";
222
+ return r.length ? r : "";
186
223
  case "hascode":
187
- return o.length ? o : "hascode";
224
+ return r.length ? r : "hascode";
188
225
  default:
189
- return o.length ? o : void 0;
226
+ return r.length ? r : void 0;
190
227
  }
191
- }, b = () => {
192
- switch (s) {
228
+ }, p = () => {
229
+ switch (a) {
193
230
  case "nocode":
194
231
  case "hascode":
195
232
  return 0;
@@ -199,245 +236,274 @@ const wn = (S) => {
199
236
  return 2;
200
237
  }
201
238
  };
202
- return n === 1 && mt(), V(v(m({}, l), {
239
+ return n === 1 && Nt(), V(v(b({}, o), {
203
240
  current: n,
204
- pageSize: r
205
- })), f.cvforceDatahub.getDatasetsIdVersionsVidSamples(c, i.id, {
241
+ pageSize: i
242
+ })), h.cvforceDatahub.getDatasetsIdVersionsVidSamples(c, l.id, {
206
243
  pageNo: n,
207
- pageSize: r,
208
- labels: h(),
209
- confirmStatus: b(),
210
- searchName: ne
244
+ pageSize: i,
245
+ labels: d(),
246
+ confirmStatus: p(),
247
+ searchName: ae
211
248
  }).then((I) => {
212
- const P = I.recordList || [], ae = n === 1 ? P : [...t || y, ...P];
213
- if (z(ae), V(v(m({}, l), {
249
+ const z = I.recordList || [], be = n === 1 ? z : [...t || y, ...z];
250
+ if (F(be), V(v(b({}, o), {
214
251
  current: n,
215
- pageSize: r,
252
+ pageSize: i,
216
253
  total: I.totalResults
217
- })), l.type === "next" && P.length) {
218
- x(0);
219
- const ie = I.recordList[0];
220
- C(ie);
254
+ })), o.type === "next" && z.length) {
255
+ L(0);
256
+ const de = I.recordList[0];
257
+ x(de);
221
258
  }
222
- if (l.type === "prev" && P.length) {
223
- x(l.pageSize - 1);
224
- const ie = I.recordList[l.pageSize - 1];
225
- C(ie);
259
+ if (o.type === "prev" && z.length) {
260
+ L(o.pageSize - 1);
261
+ const de = I.recordList[o.pageSize - 1];
262
+ x(de);
226
263
  }
227
- return Q && F < 0 && (x(0), C(P[0]), te(!0)), ae;
264
+ return oe && H < 0 && (L(0), x(z[0]), ce(!0)), be;
228
265
  }).catch(() => !1);
229
266
  };
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
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
239
276
  }));
240
- }, [G, $, J]);
241
- const k = () => {
242
- !c || !i || f.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(c, i.id, {
277
+ }, [ie, q, re]);
278
+ const D = () => {
279
+ !c || !l || h.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(c, l.id, {
243
280
  label: "allcode",
244
281
  confirmStatus: 2,
245
- searchName: ne
282
+ searchName: ae
246
283
  }).then((e) => {
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);
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);
249
286
  });
250
- }, Z = () => {
251
- if (!c || !(i != null && i.id))
287
+ }, U = () => {
288
+ if (!c || !(l != null && l.id))
252
289
  return;
253
290
  let e = 2;
254
- return s === "pending" ? e = 1 : s === "hascode" && (e = 0), f.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(c, i.id, {
291
+ return a === "pending" ? e = 1 : a === "hascode" && (e = 0), h.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(c, l.id, {
255
292
  confirmStatus: e
256
293
  }).then((t) => {
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]
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]
262
299
  }));
263
- return we(r), t;
300
+ return Ue(i), t;
264
301
  });
265
- }, dt = (e) => {
302
+ }, xt = (e) => {
266
303
  if (!y)
267
304
  return;
268
- Y(!1), x(e);
305
+ le(!1), L(e);
269
306
  const t = y[e];
270
- C(t), D(void 0), te(!0), s !== void 0 && (O.current[s] = e);
307
+ x(t), w(void 0), ce(!0), a !== void 0 && (B.current[a] = {
308
+ index: e,
309
+ page: o.current || 1
310
+ });
271
311
  };
272
- p(() => {
273
- l.type || R();
274
- }, [l.type]), p(() => {
275
- if (!d)
312
+ S(() => {
313
+ o.type || A();
314
+ }, [o.type]), S(() => {
315
+ if (!f)
276
316
  return;
277
317
  const e = [];
278
- d == null || d.labels.forEach((t) => {
318
+ f == null || f.labels.forEach((t) => {
279
319
  M != null && M.find((n) => n.id === t.id) && e.push(t);
280
- }), e.length !== d.labels.length && D(v(m({}, d), {
320
+ }), e.length !== f.labels.length && w(v(b({}, f), {
281
321
  labels: e
282
322
  }));
283
323
  }, [M]);
284
- const ze = (e, t) => {
324
+ const Ze = (e, t) => {
285
325
  if (y) {
286
- if (!Q) {
287
- z((n) => {
288
- var b;
326
+ if (!oe) {
327
+ F((n) => {
328
+ var p;
289
329
  if (!Array.isArray(n) || !n.length)
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,
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,
295
335
  type: "next"
296
336
  }, n).then((I) => {
297
- x(r);
298
- const P = I[r];
299
- C(P), D(void 0), s !== void 0 && (O.current[s] = r);
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
+ });
300
343
  }) : setTimeout(() => {
301
- x(r);
302
- const I = n[r];
303
- C(I), D(void 0), s !== void 0 && (O.current[s] = r);
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
+ });
304
350
  }, 200), n;
305
351
  });
306
352
  return;
307
353
  }
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));
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));
319
365
  }
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));
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));
323
369
  }
324
- H >= r.length ? l.total && H >= l.total ? A.error("已经是最后一个了") : R({
325
- current: l.current + 1,
326
- pageSize: l.pageSize,
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,
327
381
  type: "next"
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);
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
+ });
332
389
  }) : setTimeout(() => {
333
- x(H);
334
- const B = r[H];
335
- C(B), D(void 0), s !== void 0 && (O.current[s] = H);
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
+ });
336
396
  }, 200);
337
397
  }
338
- return o || r;
398
+ return r || i;
339
399
  })), n));
340
400
  }
341
- }, ft = (e) => {
401
+ }, It = (e) => {
342
402
  if (y) {
343
- if (!Q) {
344
- z((t) => {
403
+ if (!oe) {
404
+ F((t) => {
345
405
  if (!Array.isArray(t) || !t.length)
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);
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
+ });
352
415
  }, 200), t;
353
416
  });
354
417
  return;
355
418
  }
356
- ve(e).then((t) => {
357
- t && (k(), z((n) => {
358
- let r;
419
+ Te(e).then((t) => {
420
+ t && (D(), F((n) => {
421
+ let i;
359
422
  if (Array.isArray(n)) {
360
423
  if (!n.length)
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,
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,
367
430
  type: "prev"
368
431
  });
369
432
  else {
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));
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));
373
436
  }
374
437
  setTimeout(() => {
375
- x(o);
376
- const h = n[o];
377
- C(h), D(void 0), s !== void 0 && (O.current[s] = o);
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
+ });
378
444
  }, 200);
379
445
  }
380
446
  }
381
- return r || n;
447
+ return i || n;
382
448
  }));
383
449
  });
384
450
  }
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;
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;
387
453
  return t >= 2 ? `+${t - 1}` : null;
388
- }, ht = (e) => {
454
+ }, Lt = (e) => {
389
455
  var t;
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
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
392
458
  }));
393
- }, ve = (e, t) => {
394
- var n, r;
395
- if (!i)
459
+ }, Te = (e, t) => {
460
+ var n, i;
461
+ if (!l)
396
462
  return Promise.resolve(!1);
397
- if (d && !E) {
398
- const o = v(m({}, d), {
399
- labels: d.labels ? [...d.labels] : []
463
+ if (f && !O) {
464
+ const r = v(b({}, f), {
465
+ labels: f.labels ? [...f.labels] : []
400
466
  });
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({
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({
403
469
  content: "保存成功"
404
470
  });
405
- const h = v(m({}, o), {
406
- labels: o.labels ? [...o.labels] : []
471
+ const d = v(b({}, r), {
472
+ labels: r.labels ? [...r.labels] : []
407
473
  });
408
- return z((b) => {
409
- const I = b.findIndex((P) => P.id === (h == null ? void 0 : h.id));
474
+ return F((p) => {
475
+ const I = p.findIndex((z) => z.id === (d == null ? void 0 : d.id));
410
476
  if (I > -1) {
411
- const P = [...b];
412
- return P[I] = h, P;
477
+ const z = [...p];
478
+ return z[I] = d, z;
413
479
  }
414
- return b;
415
- }), C(h), D(h), !0;
480
+ return p;
481
+ }), x(d), w(d), !0;
416
482
  }).catch(() => !1);
417
483
  } else
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({
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({
419
485
  content: "保存成功"
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({
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({
430
496
  title: "确认要删除当前数据吗?",
431
497
  content: "数据包含当前标注的内容和图片,删除后无法恢复,请确认是否删除!",
432
498
  onOk: () => {
433
- !u || !i || f.cvforceDatahub.delDatasetsIdVersionsVidSamplesId(c, i.id, u.id).then(() => {
499
+ !u || !l || h.cvforceDatahub.delDatasetsIdVersionsVidSamplesId(c, l.id, u.id).then(() => {
434
500
  const e = y.findIndex((n) => n.id === u.id);
435
501
  y.splice(e, 1);
436
502
  const t = y.length;
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), {
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), {
441
507
  current: 1,
442
508
  type: void 0
443
509
  }));
@@ -445,305 +511,586 @@ const wn = (S) => {
445
511
  });
446
512
  }
447
513
  });
448
- }, Fe = [{
514
+ }, qe = [{
449
515
  key: "",
450
- label: `全部(${$})`,
516
+ label: `全部(${q})`,
451
517
  children: null
452
518
  }, {
453
519
  key: "nocode",
454
- label: `未标注(${G})`,
520
+ label: `未标注(${ie})`,
455
521
  children: null
456
522
  }, {
457
523
  key: "pending",
458
- label: `待确认(${J})`,
524
+ label: `待确认(${re})`,
459
525
  children: null
460
526
  }, {
461
527
  key: "hascode",
462
- label: `已标注(${$ - G - J})`,
528
+ label: `已标注(${q - ie - re})`,
463
529
  children: null
464
- }], mt = () => {
530
+ }], Nt = () => {
465
531
  var e, t;
466
- (t = (e = _.current) == null ? void 0 : e.getElementsByClassName("rc-virtual-list-holder")[0]) == null || t.scrollTo({
532
+ (t = (e = te.current) == null ? void 0 : e.getElementsByClassName("rc-virtual-list-holder")[0]) == null || t.scrollTo({
467
533
  top: 0
468
534
  });
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), {
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), {
475
544
  current: 1,
476
545
  total: void 0
477
- })), fe(e)), e === "nocode" && he([]);
478
- }, vt = () => {
479
- if (console.log("一键确认", f, i), !(f != null && f.cvforceDatahub) || !(i != null && i.id))
546
+ })), Se(e)), e === "nocode" && xe([]);
547
+ }, Pt = () => {
548
+ if (console.log("一键确认", h, l), !(h != null && h.cvforceDatahub) || !(l != null && l.id))
480
549
  return Promise.resolve(!1);
481
- Ue.confirm({
550
+ ye.confirm({
482
551
  title: "一键保存所有标注?",
483
552
  content: "待确认的所有带预标注信息的图片将保存至已标注页签下",
484
553
  onOk: () => {
485
- f.cvforceDatahub.getAllConfirmSamples(c, i.id).then((e) => {
486
- A.success("保存成功"), R(v(m({}, l), {
554
+ h.cvforceDatahub.getAllConfirmSamples(c, l.id).then((e) => {
555
+ N.success("保存成功"), A(v(b({}, o), {
487
556
  current: 1
488
- })), k();
557
+ })), D();
489
558
  });
490
559
  }
491
560
  });
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
+ });
492
796
  };
493
- return /* @__PURE__ */ a(Dt, {
494
- locale: At,
495
- children: /* @__PURE__ */ a(zt.Provider, {
797
+ return /* @__PURE__ */ s(Ht, {
798
+ locale: Xt,
799
+ children: /* @__PURE__ */ s(Gt.Provider, {
496
800
  value: {
497
801
  datasetId: c,
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,
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,
503
807
  samples: y,
504
- pagination: l,
505
- services: f,
808
+ pagination: o,
809
+ services: h,
506
810
  featuresConfig: {
507
- labelManager: Ie,
508
- datasetManager: N,
509
- annotation: We,
510
- filterSwitch: q,
511
- header: T,
512
- exampleSrcRoot: qe
811
+ labelManager: ue,
812
+ datasetManager: T,
813
+ annotation: Q,
814
+ filterSwitch: ee,
815
+ header: C,
816
+ exampleSrcRoot: Y
513
817
  }
514
818
  },
515
- children: L ? L.markType === "detection" ? /* @__PURE__ */ a("div", {
819
+ children: P ? P.markType === "detection" ? /* @__PURE__ */ s("div", {
516
820
  className: "detection-version-detail",
517
- children: rt ? i != null && i.id && N && N.preLabel ? /* @__PURE__ */ a(Ht, {
821
+ children: pt ? l != null && l.id && T && T.preLabel ? /* @__PURE__ */ s(en, {
518
822
  datasetId: c,
519
- versionId: i.id,
823
+ versionId: l.id,
520
824
  onClose: () => {
521
- ot(!1), me(), Z(), k(), R();
825
+ mt(!1), De(), U(), D(), A();
522
826
  },
523
827
  samples: y,
524
828
  labels: M,
525
- fetchLength: me
526
- }) : null : /* @__PURE__ */ w($t, {
829
+ fetchLength: De
830
+ }) : null : /* @__PURE__ */ m(nn, {
527
831
  className: "product-details-page",
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();
832
+ header: C === !1 ? void 0 : /* @__PURE__ */ s(on, {
833
+ backTo: he,
834
+ onBackClick: C != null && C.onBackClick ? () => {
835
+ u && _(), C.onBackClick && C.onBackClick();
532
836
  } : void 0,
533
- left: !xe && /* @__PURE__ */ w(de, {
534
- children: [/* @__PURE__ */ a("span", {
837
+ left: !ze && /* @__PURE__ */ m(fe, {
838
+ children: [/* @__PURE__ */ s("span", {
535
839
  style: {
536
840
  fontWeight: "bold"
537
841
  },
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,
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,
542
846
  style: {
543
847
  width: 70
544
848
  },
545
- options: se.map((e) => ({
849
+ options: ge.map((e) => ({
546
850
  label: e.no,
547
851
  value: e.id
548
852
  })),
549
853
  onChange: (e) => {
550
- const t = se.find((r) => r.id === e);
551
- if (!L || !t)
854
+ const t = ge.find((i) => i.id === e);
855
+ if (!P || !t)
552
856
  return;
553
- const n = se.find((r) => r.id === t.id);
554
- X(n), T != null && T.onVersionChange && T.onVersionChange(n);
857
+ const n = ge.find((i) => i.id === t.id);
858
+ ne(n), X(), C != null && C.onVersionChange && C.onVersionChange(n);
555
859
  }
556
860
  })]
557
861
  }),
558
- right: /* @__PURE__ */ w(de, {
559
- children: [!u && N && N.add && /* @__PURE__ */ a(je, {
560
- isPreLabel: E,
862
+ right: /* @__PURE__ */ m(fe, {
863
+ children: [!u && T && T.add && /* @__PURE__ */ s(it, {
864
+ isPreLabel: O,
561
865
  placement: "bottom",
562
- children: /* @__PURE__ */ a(oe, {
866
+ children: /* @__PURE__ */ s(G, {
563
867
  type: "default",
564
- onClick: () => ue(!0),
565
- disabled: U === W.Pending || U === W.Started || E,
868
+ onClick: () => Ce(!0),
869
+ disabled: $ === J.Pending || $ === J.Started || O,
566
870
  children: "导入数据"
567
871
  }, "del")
568
- }), /* @__PURE__ */ a(kt, {
872
+ }), /* @__PURE__ */ s(et, {
569
873
  menu: {
570
874
  items: [{
571
875
  key: "manual",
572
- label: /* @__PURE__ */ a(je, {
573
- isPreLabel: E,
574
- children: /* @__PURE__ */ a(de, {
575
- children: N && N.label && /* @__PURE__ */ a(oe, {
876
+ label: /* @__PURE__ */ s(it, {
877
+ isPreLabel: O,
878
+ children: /* @__PURE__ */ s(fe, {
879
+ children: T && T.label && /* @__PURE__ */ s(G, {
576
880
  type: "text",
577
- disabled: E,
881
+ disabled: O,
578
882
  onClick: () => {
579
- u || fe("nocode"), Y(!0), x(-1), s === "nocode" && (x(0), C(y[0])), te(!0);
883
+ u || Se("nocode"), le(!0), L(-1), a === "nocode" && (L(0), x(y[0])), ce(!0);
580
884
  },
581
885
  children: "人工标注"
582
886
  })
583
887
  })
584
888
  })
585
- }, !u && N && N.preLabel && (i != null && i.id) ? {
889
+ }, !u && T && T.preLabel && (l != null && l.id) ? {
586
890
  key: "auto",
587
- label: /* @__PURE__ */ a(Xt, {
891
+ label: /* @__PURE__ */ s(an, {
588
892
  buttonType: "text",
589
893
  datasetId: c,
590
- versionId: i.id,
894
+ versionId: l.id,
591
895
  disabled: !y.length,
592
- setIsTaskChange: it,
896
+ setIsTaskChange: gt,
593
897
  datasetType: "detection",
594
- preLabelTask: Me
898
+ preLabelTask: Ke
595
899
  })
596
900
  } : null]
597
901
  },
598
902
  placement: "bottom",
599
- children: /* @__PURE__ */ w(oe, {
903
+ children: /* @__PURE__ */ m(G, {
600
904
  type: "primary",
601
- children: ["开始标注", /* @__PURE__ */ a(Kt, {})]
905
+ children: ["开始标注", /* @__PURE__ */ s(rt, {})]
602
906
  })
603
- }), /* @__PURE__ */ a(_t, {
604
- when: Ye,
907
+ }), /* @__PURE__ */ s(cn, {
908
+ when: dt,
605
909
  content: "确认要离开此页面吗?",
606
910
  subContent: "离开此页面后,将结束导入,放弃未上传的文件,请谨慎操作!"
607
- }), Te && /* @__PURE__ */ a(jt, {
608
- datasetIam: Xe,
911
+ }), Oe && /* @__PURE__ */ s(rn, {
912
+ datasetIam: lt,
609
913
  datasetId: c,
610
- currentVersion: i,
611
- tenCode: L == null ? void 0 : L.tenantCode,
612
- isVisible: Te,
613
- setIsVisible: ue,
614
- getVersionListRequest: k,
615
- setIsConfirm: Qe,
914
+ currentVersion: l,
915
+ tenCode: P == null ? void 0 : P.tenantCode,
916
+ isVisible: Oe,
917
+ setIsVisible: Ce,
918
+ getVersionListRequest: D,
919
+ setIsConfirm: at,
616
920
  onUploadStatusChange: (e) => {
617
- Je(e);
921
+ ct(e);
618
922
  },
619
923
  tableReload: () => {
620
924
  var e, t, n;
621
- i != null && i.id && ((t = (e = _.current) == null ? void 0 : e.getElementsByClassName("rc-virtual-list-holder")[0]) == null || t.scrollTo({
925
+ l != null && l.id && ((t = (e = te.current) == null ? void 0 : e.getElementsByClassName("rc-virtual-list-holder")[0]) == null || t.scrollTo({
622
926
  top: 0
623
- }), R(v(m({}, l), {
927
+ }), A(v(b({}, o), {
624
928
  current: 1
625
- })), (n = Se.current) == null || n.fetchLabels());
929
+ })), (n = Ve.current) == null || n.fetchLabels());
626
930
  },
627
- loadVersionData: Ae,
628
- markType: L.markType
931
+ loadVersionData: je,
932
+ markType: P.markType
629
933
  })]
630
934
  })
631
935
  }),
632
- children: [/* @__PURE__ */ w("div", {
936
+ children: [/* @__PURE__ */ m("div", {
633
937
  className: "detection-header",
634
- children: [/* @__PURE__ */ w(de, {
635
- children: [q.tabs && /* @__PURE__ */ a(Tt, {
938
+ children: [/* @__PURE__ */ m(fe, {
939
+ children: [ee.tabs && /* @__PURE__ */ s(Kt, {
636
940
  className: "header-tab",
637
- activeKey: s,
638
- items: Fe,
639
- onChange: Oe
640
- }), !u && q.search && /* @__PURE__ */ a(qt, {
941
+ activeKey: a,
942
+ items: qe,
943
+ onChange: _e
944
+ }), !u && ee.search && /* @__PURE__ */ s(sn, {
641
945
  placeholder: "请输入图片名称搜索",
642
- suffix: /* @__PURE__ */ a(Ut, {}),
643
- value: ne,
644
- onChange: pt,
946
+ style: {
947
+ width: 200
948
+ },
949
+ suffix: /* @__PURE__ */ s(tn, {}),
950
+ value: ae,
951
+ onChange: Tt,
645
952
  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
+ })]
646
982
  })]
647
- }), s === "pending" && /* @__PURE__ */ a(oe, {
648
- type: "primary",
649
- className: "pending-confirm-button",
650
- onClick: vt,
651
- children: "一键确认"
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
+ })
652
990
  })]
653
- }), /* @__PURE__ */ w("div", {
991
+ }), /* @__PURE__ */ m("div", {
654
992
  className: "d-row",
655
- children: [/* @__PURE__ */ w("div", {
993
+ children: [/* @__PURE__ */ m("div", {
656
994
  className: "d-right",
657
- ref: _,
658
- children: [ee && /* @__PURE__ */ a(Yt, {
995
+ ref: te,
996
+ children: [se && /* @__PURE__ */ s(un, {
659
997
  datasetId: c,
660
- isImageDetailVisible: ee,
661
- setIsImageDetailVisible: te,
662
- currentSample: d != null ? d : u,
998
+ isImageDetailVisible: se,
999
+ setIsImageDetailVisible: ce,
1000
+ currentSample: f != null ? f : u,
663
1001
  labels: M,
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(),
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(),
673
1011
  onEnterEdit: () => {
674
- Y(!0);
1012
+ le(!0);
675
1013
  },
676
1014
  onRefresh: () => {
677
1015
  var e;
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));
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));
685
1023
  }
686
1024
  if (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));
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));
691
1029
  }
692
- }), k();
1030
+ }), D();
693
1031
  },
694
- isPreLabel: E,
1032
+ isPreLabel: O,
695
1033
  imgCount: {
696
- total: $,
697
- index: F + 1
1034
+ total: q,
1035
+ index: H + 1
698
1036
  },
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, {
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, {
704
1042
  innerProps: {
705
1043
  className: "d-right-row"
706
1044
  },
707
1045
  data: y,
708
1046
  itemKey: "id",
709
- height: (Be = _.current) == null ? void 0 : Be.clientHeight,
710
- onScroll: ht,
1047
+ height: (Ge = te.current) == null ? void 0 : Ge.clientHeight,
1048
+ onScroll: Lt,
711
1049
  children: (e, t) => {
712
1050
  var n;
713
- return /* @__PURE__ */ a(Vt, {
1051
+ return /* @__PURE__ */ s(Wt, {
714
1052
  className: "d-right-col",
715
- onClick: () => dt(t),
716
- children: /* @__PURE__ */ w("div", {
1053
+ children: /* @__PURE__ */ m("div", {
717
1054
  className: "right-col-wrapper",
718
- onMouseEnter: () => be(e.id),
719
- onMouseLeave: () => be(""),
720
- children: [/* @__PURE__ */ a("div", {
1055
+ onMouseEnter: () => ke(e.id),
1056
+ onMouseLeave: () => ke(""),
1057
+ children: [/* @__PURE__ */ s("div", {
721
1058
  className: "detection-status-wrapper",
722
- children: /* @__PURE__ */ a(Qt, {
1059
+ children: /* @__PURE__ */ s(hn, {
723
1060
  sample: e
724
1061
  })
725
- }), /* @__PURE__ */ a("div", {
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", {
726
1072
  className: "right-col-img",
727
- children: /* @__PURE__ */ a(Wt, {
1073
+ onClick: () => xt(t),
1074
+ children: /* @__PURE__ */ s(ln, {
728
1075
  fileKey: e.fileKey,
729
1076
  width: 124,
730
- imgProxy: ct
1077
+ imgProxy: yt
731
1078
  })
732
- }), /* @__PURE__ */ w("div", {
1079
+ }), /* @__PURE__ */ m("div", {
733
1080
  className: "right-col-text",
734
- children: [(n = e.labels) != null && n.length ? /* @__PURE__ */ a(Pt, {
1081
+ children: [(n = e.labels) != null && n.length ? /* @__PURE__ */ s($t, {
735
1082
  placement: "top",
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))
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))
740
1087
  }),
741
- children: /* @__PURE__ */ w("div", {
1088
+ children: /* @__PURE__ */ m("div", {
742
1089
  style: {
743
1090
  width: "100%",
744
1091
  display: "flex"
745
1092
  },
746
- children: [/* @__PURE__ */ a("span", {
1093
+ children: [/* @__PURE__ */ s("span", {
747
1094
  style: {
748
1095
  display: "inline-block",
749
1096
  maxWidth: "calc(100% - 25px)",
@@ -752,21 +1099,21 @@ const wn = (S) => {
752
1099
  whiteSpace: "nowrap"
753
1100
  },
754
1101
  children: e.labels[0].label
755
- }), e.labels.length > 1 ? /* @__PURE__ */ a("span", {
1102
+ }), e.labels.length > 1 ? /* @__PURE__ */ s("span", {
756
1103
  style: {
757
1104
  color: "rgba(0,0,0,0.45)",
758
1105
  marginLeft: 5
759
1106
  },
760
- children: ut(e)
1107
+ children: kt(e)
761
1108
  }) : null]
762
1109
  })
763
- }) : /* @__PURE__ */ a("span", {
1110
+ }) : /* @__PURE__ */ s("span", {
764
1111
  style: {
765
1112
  color: "rgba(0,0,0,0.45)",
766
1113
  width: "100%"
767
1114
  },
768
1115
  children: "无标签"
769
- }), /* @__PURE__ */ a("div", {
1116
+ }), /* @__PURE__ */ s("div", {
770
1117
  children: t + 1
771
1118
  })]
772
1119
  })]
@@ -774,21 +1121,21 @@ const wn = (S) => {
774
1121
  }, e.id);
775
1122
  }
776
1123
  })
777
- }) : /* @__PURE__ */ a("div", {
1124
+ }) : /* @__PURE__ */ s("div", {
778
1125
  className: "empty",
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, {
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, {
784
1131
  type: "link",
785
1132
  size: "small",
786
1133
  style: {
787
1134
  padding: 0
788
1135
  },
789
- onClick: () => ue(!0),
790
- disabled: U === W.Pending || U === W.Started,
791
- children: [/* @__PURE__ */ a("span", {
1136
+ onClick: () => Ce(!0),
1137
+ disabled: $ === J.Pending || $ === J.Started,
1138
+ children: [/* @__PURE__ */ s("span", {
792
1139
  style: {
793
1140
  color: "black"
794
1141
  },
@@ -797,40 +1144,40 @@ const wn = (S) => {
797
1144
  })
798
1145
  })]
799
1146
  })
800
- }) : /* @__PURE__ */ a(Mt, {})
1147
+ }) : /* @__PURE__ */ s(Zt, {})
801
1148
  })]
802
- }), s !== "nocode" && !u && q.labels && /* @__PURE__ */ a("div", {
1149
+ }), a !== "nocode" && !u && ee.labels && /* @__PURE__ */ s("div", {
803
1150
  className: "d-sider",
804
- children: /* @__PURE__ */ a(Ot, {
805
- ref: Se,
1151
+ children: /* @__PURE__ */ s(Qt, {
1152
+ ref: Ve,
806
1153
  datasetId: c,
807
1154
  data: M || [],
808
- selected: K,
1155
+ selected: W,
809
1156
  onSelectedChange: (e) => {
810
- he((M == null ? void 0 : M.filter((t) => e.find((n) => n.label === t.label))) || []);
1157
+ X(), xe((M == null ? void 0 : M.filter((t) => e.find((n) => n.label === t.label))) || []);
811
1158
  },
812
1159
  onListChange: (e) => {
813
- if (!i)
1160
+ if (!l)
814
1161
  return;
815
1162
  let t = 2;
816
- s === "pending" ? t = 1 : s === "hascode" && (t = 0), f.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(c, i.id, {
1163
+ a === "pending" ? t = 1 : a === "hascode" && (t = 0), h.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(c, l.id, {
817
1164
  confirmStatus: t
818
1165
  }).then((n) => {
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();
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();
827
1174
  },
828
- isPreLabel: E
1175
+ isPreLabel: O
829
1176
  })
830
1177
  })]
831
1178
  })]
832
1179
  })
833
- }) : /* @__PURE__ */ a("div", {
1180
+ }) : /* @__PURE__ */ s("div", {
834
1181
  style: {
835
1182
  color: "red",
836
1183
  textAlign: "center"
@@ -841,6 +1188,6 @@ const wn = (S) => {
841
1188
  });
842
1189
  };
843
1190
  export {
844
- en as ISampleActionType,
845
- wn as default
1191
+ gn as ISampleActionType,
1192
+ $n as default
846
1193
  };