@glodon-aiot/dataset-annotation 3.13.0-alpha.28 → 3.13.0-alpha.29

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,20 +1,20 @@
1
- var ft = Object.defineProperty, ut = Object.defineProperties;
2
- var ht = Object.getOwnPropertyDescriptors;
1
+ var ft = Object.defineProperty, ht = Object.defineProperties;
2
+ var ut = Object.getOwnPropertyDescriptors;
3
3
  var Ae = Object.getOwnPropertySymbols;
4
- var mt = Object.prototype.hasOwnProperty, gt = Object.prototype.propertyIsEnumerable;
5
- var Ee = (N, f, o) => f in N ? ft(N, f, { enumerable: !0, configurable: !0, writable: !0, value: o }) : N[f] = o, m = (N, f) => {
4
+ var gt = Object.prototype.hasOwnProperty, mt = Object.prototype.propertyIsEnumerable;
5
+ var Ee = (N, f, o) => f in N ? ft(N, f, { enumerable: !0, configurable: !0, writable: !0, value: o }) : N[f] = o, g = (N, f) => {
6
6
  for (var o in f || (f = {}))
7
- mt.call(f, o) && Ee(N, o, f[o]);
7
+ gt.call(f, o) && Ee(N, o, f[o]);
8
8
  if (Ae)
9
9
  for (var o of Ae(f))
10
- gt.call(f, o) && Ee(N, o, f[o]);
10
+ mt.call(f, o) && Ee(N, o, f[o]);
11
11
  return N;
12
- }, S = (N, f) => ut(N, ht(f));
12
+ }, S = (N, f) => ht(N, ut(f));
13
13
  import { jsx as s, jsxs as V, Fragment as ze } from "react/jsx-runtime";
14
14
  import { useRef as pt, useState as d, useEffect as u } from "react";
15
15
  import { message as z, ConfigProvider as bt, Space as te, Select as vt, Button as ie, Tabs as St, Col as Ct, Tooltip as yt, Empty as It, Spin as Lt, Modal as Dt } from "antd";
16
16
  import kt from "rc-virtual-list";
17
- import { UploadZipsStatus as U, PreLabelTaskStatus as Tt } from "@glodon-aiot/apis";
17
+ import { UploadZipsStatus as K, PreLabelTaskStatus as Tt } from "@glodon-aiot/apis";
18
18
  import xt from "antd/es/locale/zh_CN";
19
19
  import Vt from "../../DatasetContext/index.mjs";
20
20
  import Nt from "./icon_item_empty.svg.mjs";
@@ -22,15 +22,15 @@ import "./style.less.mjs";
22
22
  import { tagColors as Me } from "../../utils/index.mjs";
23
23
  import Pt from "./components/Labels/index.mjs";
24
24
  import { useKeyPress as wt } from "ahooks";
25
- import Re from "./components/DisabledTooltip/index.mjs";
25
+ import Fe from "./components/DisabledTooltip/index.mjs";
26
26
  import At from "./PreSamplesPage/index.mjs";
27
27
  import { SearchOutlined as Et } from "@ant-design/icons";
28
28
  import zt from "../../Common/Page/index.mjs";
29
29
  import Mt from "../PicZipImportModal/index.mjs";
30
- import Rt from "../PageNav/index.mjs";
31
- import Bt from "../Thumbnail/index.mjs";
32
- import Ot from "../CompositionInput/index.mjs";
33
- import { Prompt as Ft } from "../hooks/Prompt.mjs";
30
+ import Ft from "../PageNav/index.mjs";
31
+ import Rt from "../Thumbnail/index.mjs";
32
+ import Bt from "../CompositionInput/index.mjs";
33
+ import { Prompt as Ot } from "../hooks/Prompt.mjs";
34
34
  import Ht from "../PreLabelOCR/index.mjs";
35
35
  import Kt from "lodash/merge";
36
36
  import { DEFAULT_FILTER_SWITCH as Ut } from "../../constant.mjs";
@@ -40,109 +40,109 @@ const bi = (N) => {
40
40
  const {
41
41
  services: f,
42
42
  datasetId: o,
43
- versionId: Q,
44
- backTo: Be,
45
- labelManager: ue = !1,
46
- datasetManager: I = !1,
47
- annotation: Oe,
48
- header: D = {
43
+ versionId: X,
44
+ backTo: Re,
45
+ labelManager: he = !1,
46
+ datasetManager: D = !1,
47
+ annotation: Be,
48
+ header: k = {
49
49
  versionSelect: !1
50
50
  },
51
- exampleSrcRoot: Fe
52
- } = N, j = m({}, Ut);
53
- Kt(j, N.filterSwitch);
54
- const Z = pt(null), [C, he] = d(), [i, $] = d(), [X, He] = d([]), [me, ge] = d(!1), [B, pe] = d(0), [L, ne] = d(""), [O, be] = d(0), [Ke, Ue] = d(), [ve, re] = d(!1), [Se, je] = d(!1), [Ce, Ze] = d(!0), [$e, We] = d(!1), [P, ye] = d([]), [b, E] = d([]), [W, q] = d(!1), [Y, _] = d(!1), [M, p] = d(-1), [v, g] = d(), [a, y] = d(), [n, T] = d({
51
+ exampleSrcRoot: Oe
52
+ } = N, U = g({}, Ut);
53
+ Kt(U, N.filterSwitch);
54
+ const j = pt(null), [C, ue] = d(), [i, Z] = d(), [Y, He] = d([]), [ge, me] = d(!1), [$, pe] = d(0), [y, ne] = d(""), [B, be] = d(0), [Ke, Ue] = d(), [ve, re] = d(!1), [Se, je] = d(!1), [Ce, Ze] = d(!0), [$e, We] = d(!1), [P, ye] = d([]), [p, E] = d([]), [W, q] = d(!1), [_, G] = d(!1), [M, b] = d(-1), [v, m] = d(), [c, I] = d(), [r, x] = d({
55
55
  current: 0,
56
56
  pageSize: 100
57
- }), [F, oe] = d([]), [R, qe] = d(""), [_e, Ge] = d(!1), [Ie, Le] = d(), [ee, le] = d(null), [w, De] = d(!1), [Je, ke] = d(!1), [Qe, Xe] = d(0), [Zt, se] = d(""), [G, Ye] = d(""), [et, tt] = d(), H = () => {
58
- g(void 0), y(void 0), p(-1), q(!1), K(), setTimeout(() => {
59
- T((e) => S(m({}, e), {
57
+ }), [F, oe] = d([]), [R, qe] = d(""), [_e, Ge] = d(!1), [Ie, Le] = d(), [ee, le] = d(null), [w, De] = d(!1), [Je, ke] = d(!1), [Qe, Xe] = d(0), [Zt, se] = d(""), [J, Ye] = d(""), [et, tt] = d(), O = () => {
58
+ m(void 0), I(void 0), b(-1), q(!1), H(), setTimeout(() => {
59
+ x((e) => S(g({}, e), {
60
60
  current: 1,
61
61
  type: void 0
62
62
  }));
63
63
  }, 10);
64
64
  };
65
- wt("Esc", H), u(() => {
65
+ wt("Esc", O), u(() => {
66
66
  o && f.cvforceDatahub.getS3Iam(o).then((e) => {
67
67
  Ue(e);
68
68
  });
69
69
  }, [o]), u(() => {
70
70
  f.cvforceDatahub && f.cvforceDatahub.getOptionsImgproxy().then((e) => tt(e));
71
71
  }, [f.cvforceDatahub]), u(() => {
72
- x();
72
+ T();
73
73
  }, [i == null ? void 0 : i.id]), u(() => {
74
- o && (ge(!0), Promise.all([
74
+ o && (me(!0), Promise.all([
75
75
  // 数据集
76
76
  f.cvforceDatahub.getDatasetsId(o).then((e) => {
77
- he(e);
77
+ ue(e);
78
78
  }),
79
79
  // 版本列表
80
80
  f.cvforceDatahub.getDatasetsIdVersions(o, 1, 1e3).then((e) => {
81
- He(e.recordList), $(Q ? e.recordList.find((t) => t.id === Q) : e.recordList[0]);
81
+ He(e.recordList), Z(X ? e.recordList.find((t) => t.id === X) : e.recordList[0]);
82
82
  })
83
- ]).finally(() => ge(!1)));
84
- }, [o, Q]);
83
+ ]).finally(() => me(!1)));
84
+ }, [o, X]);
85
85
  const Te = () => {
86
86
  !o || !i || f.cvforceDatahub.getDatasetsIdVersionsVid(o, i.id).then((e) => {
87
- $(e), qe(e.versionAsyncTask.state);
87
+ Z(e), qe(e.versionAsyncTask.state);
88
88
  });
89
89
  };
90
90
  u(() => {
91
- R !== U.Pending && R !== U.Started || z.warning("文件导入中,请刷新页面再试");
91
+ R !== K.Pending && R !== K.Started || z.warning("文件导入中,请刷新页面再试");
92
92
  }, [R]), u(() => {
93
- $(void 0), T(S(m({}, n), {
93
+ Z(void 0), x(S(g({}, r), {
94
94
  current: 1
95
95
  })), E([]), Te();
96
- }, [o, Q]), u(() => {
96
+ }, [o, X]), u(() => {
97
97
  o && f.cvforceDatahub.getDatasetsId(o).then((e) => {
98
- he(e);
98
+ ue(e);
99
99
  });
100
100
  }, [o]), u(() => {
101
- K();
101
+ H();
102
102
  }, [F, i]), u(() => {
103
- !i || !C || A(S(m({}, n), {
103
+ !i || !C || A(S(g({}, r), {
104
104
  current: 1
105
105
  })).then((e) => {
106
106
  });
107
107
  }, [C == null ? void 0 : C.id, i == null ? void 0 : i.id, F]), u(() => {
108
108
  A().then((e) => {
109
- }), x();
110
- }, [n.current]), u(() => {
111
- w && x();
109
+ }), T();
110
+ }, [r.current]), u(() => {
111
+ w && T();
112
112
  }, [Ie]), u(() => {
113
- A(S(m({}, n), {
113
+ A(S(g({}, r), {
114
114
  current: 1,
115
115
  total: void 0
116
116
  })).then((e) => {
117
- e && v && (Array.isArray(e) && e.length ? (p(0), g(e[0]), y(void 0)) : (g(void 0), y(void 0), p(-1), K(), setTimeout(() => {
118
- T((t) => S(m({}, t), {
117
+ e && (!v && !_ || (Array.isArray(e) && e.length ? (b(0), m(e[0]), I(void 0)) : (m(void 0), I(void 0), b(-1), H(), setTimeout(() => {
118
+ x((t) => S(g({}, t), {
119
119
  current: 1,
120
120
  type: void 0
121
121
  }));
122
- }, 10)));
122
+ }, 10))));
123
123
  });
124
- }, [L]), u(() => {
125
- Y || (g(void 0), y(void 0), q(!1), p(-1));
126
- }, [Y]), u(() => {
124
+ }, [y]), u(() => {
125
+ _ || (m(void 0), I(void 0), q(!1), b(-1), H(), T());
126
+ }, [_]), u(() => {
127
127
  We(!Ce && Se);
128
128
  }, [Ce, Se]), u(() => {
129
129
  if (!o) {
130
130
  ee && (clearTimeout(ee), le(null)), Le(void 0);
131
131
  return;
132
132
  }
133
- ce();
133
+ ae();
134
134
  }, [o, i == null ? void 0 : i.id]), u(() => {
135
- ce();
136
- }, [_e]), u(() => {
137
135
  ae();
136
+ }, [_e]), u(() => {
137
+ ce();
138
138
  }, [w, o, i]), u(() => {
139
- A(S(m({}, n), {
139
+ A(S(g({}, r), {
140
140
  current: 1
141
- })), x();
142
- }, [G]), u(() => {
141
+ })), T();
142
+ }, [J]), u(() => {
143
143
  se("");
144
144
  }, [v]);
145
- const ae = () => {
145
+ const ce = () => {
146
146
  i && f.cvforceDatahub.getDatasetsIdVersionsVidSamples(o, i.id, {
147
147
  pageNo: 1,
148
148
  pageSize: 1e3,
@@ -150,16 +150,16 @@ const bi = (N) => {
150
150
  }).then((e) => {
151
151
  Xe(e.recordList.length);
152
152
  });
153
- }, ce = () => {
153
+ }, ae = () => {
154
154
  !o || !i || f.cvforceDatahub.getPreLabelTask(o, i.id).then((e) => {
155
155
  const t = e[0];
156
156
  if (Le(t), ee && (clearTimeout(ee), le(null)), !(t != null && t.state) || t.state !== Tt.Started) {
157
- De(!1), x();
157
+ De(!1), T();
158
158
  return;
159
159
  } else
160
160
  De(!0);
161
161
  le(setTimeout(() => {
162
- ce();
162
+ ae();
163
163
  }, 1e4));
164
164
  });
165
165
  };
@@ -167,178 +167,179 @@ const bi = (N) => {
167
167
  C && C.markType !== "detection" && console.error("当前数据集不是detection(物体检测)类型,请检查数据集类型。");
168
168
  }, [C]);
169
169
  const A = (e, t) => {
170
- const l = (e == null ? void 0 : e.current) || n.current, r = (e == null ? void 0 : e.pageSize) || n.pageSize;
170
+ const l = (e == null ? void 0 : e.current) || r.current, n = (e == null ? void 0 : e.pageSize) || r.pageSize;
171
171
  if (!o || !i || !l)
172
172
  return Promise.resolve(!1);
173
- const c = F.map((k) => k.label), h = () => {
174
- switch (L) {
173
+ const a = F.map((L) => L.label), h = () => {
174
+ switch (y) {
175
175
  case "nocode":
176
176
  return "nocode";
177
177
  case "hascode":
178
- return c.length ? c : "hascode";
178
+ return a.length ? a : "hascode";
179
179
  default:
180
- return c.length ? c : void 0;
180
+ return a.length ? a : void 0;
181
181
  }
182
182
  };
183
- return l === 1 && at(), T(S(m({}, n), {
183
+ return l === 1 && ct(), x(S(g({}, r), {
184
184
  current: l,
185
- pageSize: r
185
+ pageSize: n
186
186
  })), f.cvforceDatahub.getDatasetsIdVersionsVidSamples(o, i.id, {
187
187
  pageNo: l,
188
- pageSize: r,
188
+ pageSize: n,
189
189
  labels: h(),
190
- searchName: G
191
- }).then((k) => {
192
- const J = k.recordList || [], we = l === 1 ? J : [...t || b, ...J];
193
- if (E(we), T(S(m({}, n), {
190
+ searchName: J
191
+ }).then((L) => {
192
+ const Q = L.recordList || [], we = l === 1 ? Q : [...t || p, ...Q];
193
+ if (E(we), x(S(g({}, r), {
194
194
  current: l,
195
- pageSize: r,
196
- total: k.totalResults
197
- })), n.type === "next" && J.length) {
198
- p(0);
199
- const fe = k.recordList[0];
200
- g(fe);
195
+ pageSize: n,
196
+ total: L.totalResults
197
+ })), r.type === "next" && Q.length) {
198
+ b(0);
199
+ const fe = L.recordList[0];
200
+ m(fe);
201
201
  }
202
- if (n.type === "prev" && J.length) {
203
- p(n.pageSize - 1);
204
- const fe = k.recordList[n.pageSize - 1];
205
- g(fe);
202
+ if (r.type === "prev" && Q.length) {
203
+ b(r.pageSize - 1);
204
+ const fe = L.recordList[r.pageSize - 1];
205
+ m(fe);
206
206
  }
207
- return W && M < 0 && (p(0), g(J[0]), _(!0)), we;
207
+ return W && M < 0 && (b(0), m(Q[0]), G(!0)), we;
208
208
  }).catch(() => !1);
209
209
  };
210
210
  u(() => {
211
- T(L === "nocode" ? S(m({}, n), {
211
+ x(y === "nocode" ? S(g({}, r), {
212
+ total: $
213
+ }) : y === "" ? S(g({}, r), {
212
214
  total: B
213
- }) : L === "" ? S(m({}, n), {
214
- total: O
215
- }) : S(m({}, n), {
216
- total: O - B
215
+ }) : S(g({}, r), {
216
+ total: B - $
217
217
  }));
218
- }, [B, O]);
219
- const x = () => {
218
+ }, [$, B]);
219
+ const T = () => {
220
220
  !o || !i || f.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(o, i.id, {
221
221
  label: "allcode",
222
- searchName: G
222
+ searchName: J
223
223
  }).then((e) => {
224
- const t = e.find((r) => r.id === "allcodeid"), l = e.find((r) => r.id === "nocodeid");
224
+ const t = e.find((n) => n.id === "allcodeid"), l = e.find((n) => n.id === "nocodeid");
225
225
  be(t ? t.count : 0), pe(l ? l.count : 0);
226
226
  });
227
- }, K = () => {
227
+ }, H = () => {
228
228
  if (!(!o || !(i != null && i.id)))
229
229
  return f.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(o, i.id).then((e) => {
230
- const l = (e || []).filter((r) => r.label !== "nocode").map((r, c) => ({
231
- label: r.label,
232
- count: r.count,
233
- id: r.id,
234
- color: Me[c % 40]
230
+ const l = (e || []).filter((n) => n.label !== "nocode").map((n, a) => ({
231
+ label: n.label,
232
+ count: n.count,
233
+ id: n.id,
234
+ color: Me[a % 40]
235
235
  }));
236
236
  return ye(l), e;
237
237
  });
238
238
  }, it = (e) => {
239
- if (!b)
239
+ if (!p)
240
240
  return;
241
- q(!1), p(e);
242
- const t = b[e];
243
- g(t), y(void 0), _(!0);
241
+ q(!1), b(e);
242
+ const t = p[e];
243
+ m(t), I(void 0), G(!0);
244
244
  };
245
245
  u(() => {
246
- n.type || A();
247
- }, [n.type]), u(() => {
248
- if (!a)
246
+ r.type || A();
247
+ }, [r.type]), u(() => {
248
+ if (!c)
249
249
  return;
250
250
  const e = [];
251
- a == null || a.labels.forEach((t) => {
251
+ c == null || c.labels.forEach((t) => {
252
252
  P != null && P.find((l) => l.id === t.id) && e.push(t);
253
- }), a.labels = e, y(a);
253
+ }), c.labels = e, I(c);
254
254
  }, [P]);
255
255
  const xe = () => {
256
- if (b) {
256
+ if (p) {
257
257
  if (!W) {
258
258
  E((e) => {
259
+ var a;
259
260
  if (!Array.isArray(e) || !e.length)
260
- return H(), e;
261
- const t = M + 1;
262
- return t >= e.length ? n.total && t >= n.total ? z.error("已经是最后一个了") : A({
263
- current: n.current + 1,
264
- pageSize: n.pageSize,
261
+ return O(), e;
262
+ const t = M + 1, n = !!F.length ? e.length : (a = r.total) != null ? a : e.length;
263
+ return t >= e.length ? t >= n ? z.error("已经是最后一个了") : A({
264
+ current: r.current + 1,
265
+ pageSize: r.pageSize,
265
266
  type: "next"
266
- }, e).then((l) => {
267
- p(t);
268
- const r = l[t];
269
- g(r), y(void 0);
267
+ }, e).then((h) => {
268
+ b(t);
269
+ const L = h[t];
270
+ m(L), I(void 0);
270
271
  }) : setTimeout(() => {
271
- p(t);
272
- const l = e[t];
273
- g(l), y(void 0);
272
+ b(t);
273
+ const h = e[t];
274
+ m(h), I(void 0);
274
275
  }, 200), e;
275
276
  });
276
277
  return;
277
278
  }
278
- return de().then((e) => (e && (x(), E((t) => {
279
+ return de().then((e) => (e && (T(), E((t) => {
279
280
  let l;
280
281
  if (Array.isArray(t)) {
281
282
  if (!t.length)
282
- return H(), t;
283
- const r = !a || a.labels.length && L === "hascode" || !a.labels.length && L === "nocode" || L === "" ? M + 1 : M;
284
- if (a && (a.labels.length && L === "nocode" || !a.labels.length && L === "hascode")) {
285
- const c = t.findIndex((h) => h.id === a.id);
286
- c > -1 && (t.splice(c, 1), l = [...t], n.total && (n.total = n.total - 1));
283
+ return O(), t;
284
+ const n = !c || c.labels.length && y === "hascode" || !c.labels.length && y === "nocode" || y === "" ? M + 1 : M;
285
+ if (c && (c.labels.length && y === "nocode" || !c.labels.length && y === "hascode")) {
286
+ const a = t.findIndex((h) => h.id === c.id);
287
+ a > -1 && (t.splice(a, 1), l = [...t], r.total && (r.total = r.total - 1));
287
288
  }
288
- r >= t.length ? n.total && r >= n.total ? z.error("已经是最后一个了") : A({
289
- current: n.current + 1,
290
- pageSize: n.pageSize,
289
+ n >= t.length ? r.total && n >= r.total ? z.error("已经是最后一个了") : A({
290
+ current: r.current + 1,
291
+ pageSize: r.pageSize,
291
292
  type: "next"
292
- }, t).then((c) => {
293
- p(r);
294
- const h = c[r];
295
- g(h), y(void 0);
293
+ }, t).then((a) => {
294
+ b(n);
295
+ const h = a[n];
296
+ m(h), I(void 0);
296
297
  }) : setTimeout(() => {
297
- p(r);
298
- const c = t[r];
299
- g(c), y(void 0);
298
+ b(n);
299
+ const a = t[n];
300
+ m(a), I(void 0);
300
301
  }, 200);
301
302
  }
302
303
  return l || t;
303
304
  })), e));
304
305
  }
305
306
  }, nt = () => {
306
- if (b) {
307
+ if (p) {
307
308
  if (!W) {
308
309
  E((e) => {
309
310
  if (!Array.isArray(e) || !e.length)
310
- return H(), e;
311
+ return O(), e;
311
312
  const t = M - 1;
312
313
  return t < 0 ? z.error("已经是第一个了") : setTimeout(() => {
313
- p(t);
314
+ b(t);
314
315
  const l = e[t];
315
- g(l), y(void 0);
316
+ m(l), I(void 0);
316
317
  }, 200), e;
317
318
  });
318
319
  return;
319
320
  }
320
321
  de().then((e) => {
321
- e && (x(), E((t) => {
322
+ e && (T(), E((t) => {
322
323
  let l;
323
324
  if (Array.isArray(t)) {
324
325
  if (!t.length)
325
- return H(), t;
326
- const r = M - 1;
327
- if (r < 0)
328
- r < 0 ? z.error("已经是第一个了") : T({
329
- current: n.current - 1,
330
- pageSize: n.pageSize,
326
+ return O(), t;
327
+ const n = M - 1;
328
+ if (n < 0)
329
+ n < 0 ? z.error("已经是第一个了") : x({
330
+ current: r.current - 1,
331
+ pageSize: r.pageSize,
331
332
  type: "prev"
332
333
  });
333
334
  else {
334
- if (a && (a.labels.length && L === "nocode" || !a.labels.length && L === "hascode")) {
335
- const c = t.findIndex((h) => h.id === a.id);
336
- c > -1 && (t.splice(c, 1), l = [...t], n.total && (n.total = n.total - 1));
335
+ if (c && (c.labels.length && y === "nocode" || !c.labels.length && y === "hascode")) {
336
+ const a = t.findIndex((h) => h.id === c.id);
337
+ a > -1 && (t.splice(a, 1), l = [...t], r.total && (r.total = r.total - 1));
337
338
  }
338
339
  setTimeout(() => {
339
- p(r);
340
- const c = t[r];
341
- g(c), y(void 0);
340
+ b(n);
341
+ const a = t[n];
342
+ m(a), I(void 0);
342
343
  }, 200);
343
344
  }
344
345
  }
@@ -347,20 +348,20 @@ const bi = (N) => {
347
348
  });
348
349
  }
349
350
  }, rt = (e) => {
350
- const t = Object.keys(e.labels.reduce((l, r) => (l[r.label] ? ++l[r.label] : l[r.label] = 1, l), {})).length;
351
+ const t = Object.keys(e.labels.reduce((l, n) => (l[n.label] ? ++l[n.label] : l[n.label] = 1, l), {})).length;
351
352
  return t >= 2 ? `+${t - 1}` : null;
352
353
  }, ot = (e) => {
353
354
  var t;
354
- (!n.total || n.total > b.length) && e.currentTarget.scrollHeight - e.currentTarget.scrollTop === ((t = Z.current) == null ? void 0 : t.clientHeight) && T(S(m({}, n), {
355
- current: n.current + 1
355
+ (!r.total || r.total > p.length) && e.currentTarget.scrollHeight - e.currentTarget.scrollTop === ((t = j.current) == null ? void 0 : t.clientHeight) && x(S(g({}, r), {
356
+ current: r.current + 1
356
357
  }));
357
- }, de = () => i ? a && !w ? (a.labels && (a.labels = a.labels.filter((e) => !!e.id)), f.cvforceDatahub.updateSamples(o, i.id, [a], 0).then(() => (z.success({
358
+ }, de = () => i ? c && !w ? (c.labels && (c.labels = c.labels.filter((e) => !!e.id)), f.cvforceDatahub.updateSamples(o, i.id, [c], 0).then(() => (z.success({
358
359
  content: "保存成功"
359
360
  }), E((e) => {
360
- const t = e.findIndex((l) => l.id === (a == null ? void 0 : a.id));
361
- return t > -1 && (e[t] = a), [...e];
361
+ const t = e.findIndex((l) => l.id === (c == null ? void 0 : c.id));
362
+ return t > -1 && (e[t] = c), [...e];
362
363
  }), !0)).catch(() => !1)) : Promise.resolve(!0) : Promise.resolve(!1), lt = () => {
363
- if (a && a.labels.some((e) => !e.id))
364
+ if (c && c.labels.some((e) => !e.id))
364
365
  return z.error("所有标注需设置标签"), Promise.resolve(!1);
365
366
  xe();
366
367
  }, st = () => {
@@ -369,11 +370,13 @@ const bi = (N) => {
369
370
  content: "数据包含当前标注的内容和图片,删除后无法恢复,请确认是否删除!",
370
371
  onOk: () => {
371
372
  !v || !i || f.cvforceDatahub.delDatasetsIdVersionsVidSamplesId(o, i.id, v.id).then(() => {
372
- const e = b.findIndex((t) => t.id === v.id);
373
- b.splice(e, 1), E([...b]), T(S(m({}, n), {
374
- total: n.total ? n.total - 1 : 0
375
- })), e <= b.length - 1 ? g(b[e]) : (g(b[e - 1]), p(e - 1)), x(), y(void 0), n.total && n.total - 1 === 0 && (g(void 0), y(void 0), p(-1), W || _(!1), K(), setTimeout(() => {
376
- T((t) => S(m({}, t), {
373
+ const e = p.findIndex((l) => l.id === v.id);
374
+ p.splice(e, 1);
375
+ const t = p.length;
376
+ E([...p]), x(S(g({}, r), {
377
+ total: r.total ? r.total - 1 : 0
378
+ })), e <= p.length - 1 ? m(p[e]) : (m(p[e - 1]), b(e - 1)), T(), I(void 0), (t === 0 || r.total && r.total - 1 === 0) && (m(void 0), I(void 0), b(-1), W || G(!1), setTimeout(() => {
379
+ x((l) => S(g({}, l), {
377
380
  current: 1,
378
381
  type: void 0
379
382
  }));
@@ -383,29 +386,29 @@ const bi = (N) => {
383
386
  });
384
387
  }, Ve = [{
385
388
  key: "",
386
- label: `全部(${O})`,
389
+ label: `全部(${B})`,
387
390
  children: null
388
391
  }, {
389
392
  key: "nocode",
390
- label: `未标注(${B})`,
393
+ label: `未标注(${$})`,
391
394
  children: null
392
395
  }, {
393
396
  key: "hascode",
394
- label: `已标注(${O - B})`,
397
+ label: `已标注(${B - $})`,
395
398
  children: null
396
- }], at = () => {
399
+ }], ct = () => {
397
400
  var e, t;
398
- (t = (e = Z.current) == null ? void 0 : e.getElementsByClassName("rc-virtual-list-holder")[0]) == null || t.scrollTo({
401
+ (t = (e = j.current) == null ? void 0 : e.getElementsByClassName("rc-virtual-list-holder")[0]) == null || t.scrollTo({
399
402
  top: 0
400
403
  });
401
- }, ct = () => {
404
+ }, at = () => {
402
405
  ke(!0);
403
406
  }, dt = (e) => {
404
407
  Ye(e);
405
408
  }, Ne = (e) => {
406
- a ? de().then((t) => {
407
- t ? (ne(e), x()) : z.error("保存失败");
408
- }) : (T(S(m({}, n), {
409
+ c ? de().then((t) => {
410
+ t ? (ne(e), T()) : z.error("保存失败");
411
+ }) : (x(S(g({}, r), {
409
412
  current: 1,
410
413
  total: void 0
411
414
  })), ne(e)), e === "nocode" && oe([]);
@@ -417,88 +420,88 @@ const bi = (N) => {
417
420
  datasetId: o,
418
421
  versionId: (i == null ? void 0 : i.id) || "",
419
422
  no: (i == null ? void 0 : i.no) || "",
420
- loading: me,
423
+ loading: ge,
421
424
  version: i,
422
- versions: X,
423
- samples: b,
424
- pagination: n,
425
+ versions: Y,
426
+ samples: p,
427
+ pagination: r,
425
428
  services: f,
426
429
  featuresConfig: {
427
- labelManager: ue,
428
- datasetManager: I,
429
- annotation: Oe,
430
- filterSwitch: j,
431
- header: D,
432
- exampleSrcRoot: Fe
430
+ labelManager: he,
431
+ datasetManager: D,
432
+ annotation: Be,
433
+ filterSwitch: U,
434
+ header: k,
435
+ exampleSrcRoot: Oe
433
436
  }
434
437
  },
435
438
  children: C ? C.markType === "detection" ? /* @__PURE__ */ s("div", {
436
439
  className: "detection-version-detail",
437
- children: Je ? i != null && i.id && I && I.preLabel ? /* @__PURE__ */ s(At, {
440
+ children: Je ? i != null && i.id && D && D.preLabel ? /* @__PURE__ */ s(At, {
438
441
  datasetId: o,
439
442
  versionId: i.id,
440
443
  onClose: () => {
441
- ke(!1), ae(), K(), x(), A();
444
+ ke(!1), ce(), H(), T(), A();
442
445
  },
443
- samples: b,
446
+ samples: p,
444
447
  labels: P,
445
- fetchLength: ae
448
+ fetchLength: ce
446
449
  }) : null : /* @__PURE__ */ V(zt, {
447
450
  className: "product-details-page",
448
- header: D === !1 ? void 0 : /* @__PURE__ */ s(Rt, {
449
- backTo: Be,
450
- onBackClick: D != null && D.onBackClick ? () => {
451
- v && H(), D.onBackClick && D.onBackClick();
451
+ header: k === !1 ? void 0 : /* @__PURE__ */ s(Ft, {
452
+ backTo: Re,
453
+ onBackClick: k != null && k.onBackClick ? () => {
454
+ v && O(), k.onBackClick && k.onBackClick();
452
455
  } : void 0,
453
- left: !me && /* @__PURE__ */ V(te, {
456
+ left: !ge && /* @__PURE__ */ V(te, {
454
457
  children: [/* @__PURE__ */ s("span", {
455
458
  style: {
456
459
  fontWeight: "bold"
457
460
  },
458
461
  children: C == null ? void 0 : C.name
459
462
  }), /* @__PURE__ */ s(vt, {
460
- disabled: (D == null ? void 0 : D.versionSelect) === !1,
463
+ disabled: (k == null ? void 0 : k.versionSelect) === !1,
461
464
  value: i == null ? void 0 : i.id,
462
465
  style: {
463
466
  width: 70
464
467
  },
465
- options: X.map((e) => ({
468
+ options: Y.map((e) => ({
466
469
  label: e.no,
467
470
  value: e.id
468
471
  })),
469
472
  onChange: (e) => {
470
- const t = X.find((r) => r.id === e);
473
+ const t = Y.find((n) => n.id === e);
471
474
  if (!C || !t)
472
475
  return;
473
- const l = X.find((r) => r.id === t.id);
474
- $(l), D != null && D.onVersionChange && D.onVersionChange(l);
476
+ const l = Y.find((n) => n.id === t.id);
477
+ Z(l), k != null && k.onVersionChange && k.onVersionChange(l);
475
478
  }
476
479
  })]
477
480
  }),
478
481
  right: /* @__PURE__ */ V(te, {
479
- children: [!v && I && I.add && /* @__PURE__ */ s(Re, {
482
+ children: [!v && D && D.add && /* @__PURE__ */ s(Fe, {
480
483
  isPreLabel: w,
481
484
  placement: "bottom",
482
485
  children: /* @__PURE__ */ s(ie, {
483
486
  type: "default",
484
487
  onClick: () => re(!0),
485
- disabled: R === U.Pending || R === U.Started || w,
488
+ disabled: R === K.Pending || R === K.Started || w,
486
489
  children: "导入数据"
487
490
  }, "del")
488
- }), !v && I && I.preLabel && (i != null && i.id) ? /* @__PURE__ */ V(ze, {
491
+ }), !v && D && D.preLabel && (i != null && i.id) ? /* @__PURE__ */ V(ze, {
489
492
  children: [/* @__PURE__ */ s(Ht, {
490
493
  datasetId: o,
491
494
  versionId: i.id,
492
- disabled: !b.length,
495
+ disabled: !p.length,
493
496
  setIsTaskChange: Ge,
494
497
  datasetType: "detection",
495
498
  preLabelTask: Ie
496
499
  }), /* @__PURE__ */ s(ie, {
497
500
  disabled: w || !Qe,
498
- onClick: ct,
501
+ onClick: at,
499
502
  children: "待确认标注"
500
503
  })]
501
- }) : null, /* @__PURE__ */ s(Ft, {
504
+ }) : null, /* @__PURE__ */ s(Ot, {
502
505
  when: $e,
503
506
  content: "确认要离开此页面吗?",
504
507
  subContent: "离开此页面后,将结束导入,放弃未上传的文件,请谨慎操作!"
@@ -509,16 +512,16 @@ const bi = (N) => {
509
512
  tenCode: C == null ? void 0 : C.tenantCode,
510
513
  isVisible: ve,
511
514
  setIsVisible: re,
512
- getVersionListRequest: x,
515
+ getVersionListRequest: T,
513
516
  setIsConfirm: Ze,
514
517
  onUploadStatusChange: (e) => {
515
518
  je(e);
516
519
  },
517
520
  tableReload: () => {
518
521
  var e, t;
519
- i != null && i.id && ((t = (e = Z.current) == null ? void 0 : e.getElementsByClassName("rc-virtual-list-holder")[0]) == null || t.scrollTo({
522
+ i != null && i.id && ((t = (e = j.current) == null ? void 0 : e.getElementsByClassName("rc-virtual-list-holder")[0]) == null || t.scrollTo({
520
523
  top: 0
521
- }), A(S(m({}, n), {
524
+ }), A(S(g({}, r), {
522
525
  current: 1
523
526
  })));
524
527
  },
@@ -529,26 +532,26 @@ const bi = (N) => {
529
532
  children: [/* @__PURE__ */ V("div", {
530
533
  className: "detection-header",
531
534
  children: [/* @__PURE__ */ V(te, {
532
- children: [j.tabs && /* @__PURE__ */ s(St, {
535
+ children: [U.tabs && /* @__PURE__ */ s(St, {
533
536
  className: "header-tab",
534
- activeKey: L,
537
+ activeKey: y,
535
538
  items: Ve,
536
539
  onChange: Ne
537
- }), !v && j.search && /* @__PURE__ */ s(Ot, {
540
+ }), !v && U.search && /* @__PURE__ */ s(Bt, {
538
541
  placeholder: "请输入图片名称搜索",
539
542
  suffix: /* @__PURE__ */ s(Et, {}),
540
- value: G,
543
+ value: J,
541
544
  onChange: dt,
542
545
  allowClear: !0
543
546
  })]
544
- }), /* @__PURE__ */ s(Re, {
547
+ }), /* @__PURE__ */ s(Fe, {
545
548
  isPreLabel: w,
546
549
  children: /* @__PURE__ */ s(te, {
547
- children: I && I.label && /* @__PURE__ */ s(ie, {
550
+ children: D && D.label && /* @__PURE__ */ s(ie, {
548
551
  type: "primary",
549
- disabled: !B || w,
552
+ disabled: w,
550
553
  onClick: () => {
551
- v || ne("nocode"), q(!0), p(-1), L === "nocode" && (p(0), g(b[0])), _(!0);
554
+ v || ne("nocode"), q(!0), b(-1), y === "nocode" && (b(0), m(p[0])), G(!0);
552
555
  },
553
556
  children: "标注"
554
557
  })
@@ -558,18 +561,18 @@ const bi = (N) => {
558
561
  className: "d-row",
559
562
  children: [/* @__PURE__ */ V("div", {
560
563
  className: "d-right",
561
- ref: Z,
562
- children: [Y && /* @__PURE__ */ s(jt, {
564
+ ref: j,
565
+ children: [_ && /* @__PURE__ */ s(jt, {
563
566
  datasetId: o,
564
- isImageDetailVisible: Y,
565
- setIsImageDetailVisible: _,
566
- currentSample: a != null ? a : v,
567
+ isImageDetailVisible: _,
568
+ setIsImageDetailVisible: G,
569
+ currentSample: c != null ? c : v,
567
570
  labels: P,
568
571
  previewMode: !W,
569
572
  filterItems: Ve,
570
- filterMode: L,
573
+ filterMode: y,
571
574
  onFilterChange: Ne,
572
- onChange: y,
575
+ onChange: I,
573
576
  onNextClick: () => xe(),
574
577
  onPrevClick: () => nt(),
575
578
  onSave: () => lt(),
@@ -579,38 +582,38 @@ const bi = (N) => {
579
582
  },
580
583
  onRefresh: () => {
581
584
  var e;
582
- (e = K()) == null || e.then((t) => {
583
- var l, r;
584
- if (a) {
585
- const c = [];
586
- (l = a.labels) == null || l.forEach((h) => {
587
- t != null && t.find((k) => k.id === h.id) && c.push(h);
588
- }), a.labels = c, y(m({}, a));
585
+ (e = H()) == null || e.then((t) => {
586
+ var l, n;
587
+ if (c) {
588
+ const a = [];
589
+ (l = c.labels) == null || l.forEach((h) => {
590
+ t != null && t.find((L) => L.id === h.id) && a.push(h);
591
+ }), c.labels = a, I(g({}, c));
589
592
  }
590
593
  if (v) {
591
- const c = [];
592
- (r = v.labels) == null || r.forEach((h) => {
593
- t != null && t.find((k) => k.id === h.id) && c.push(h);
594
- }), v.labels = c, g(m({}, v));
594
+ const a = [];
595
+ (n = v.labels) == null || n.forEach((h) => {
596
+ t != null && t.find((L) => L.id === h.id) && a.push(h);
597
+ }), v.labels = a, m(g({}, v));
595
598
  }
596
- }), x();
599
+ }), T();
597
600
  },
598
601
  isPreLabel: w,
599
602
  imgCount: {
600
- total: O,
603
+ total: B,
601
604
  index: M + 1
602
605
  },
603
- settingHide: !ue,
604
- canLabel: !!(I && I.label),
605
- canDelete: !!(I && I.delete)
606
- }), v ? /* @__PURE__ */ s("div", {}) : n.total !== void 0 && n.total > 0 ? /* @__PURE__ */ s(ze, {
606
+ settingHide: !he,
607
+ canLabel: !!(D && D.label),
608
+ canDelete: !!(D && D.delete)
609
+ }), v ? /* @__PURE__ */ s("div", {}) : r.total !== void 0 && r.total > 0 ? /* @__PURE__ */ s(ze, {
607
610
  children: /* @__PURE__ */ s(kt, {
608
611
  innerProps: {
609
612
  className: "d-right-row"
610
613
  },
611
- data: b,
614
+ data: p,
612
615
  itemKey: "id",
613
- height: (Pe = Z.current) == null ? void 0 : Pe.clientHeight,
616
+ height: (Pe = j.current) == null ? void 0 : Pe.clientHeight,
614
617
  onScroll: ot,
615
618
  children: (e, t) => {
616
619
  var l;
@@ -623,7 +626,7 @@ const bi = (N) => {
623
626
  onMouseLeave: () => se(""),
624
627
  children: [/* @__PURE__ */ s("div", {
625
628
  className: "right-col-img",
626
- children: /* @__PURE__ */ s(Bt, {
629
+ children: /* @__PURE__ */ s(Rt, {
627
630
  fileKey: e.fileKey,
628
631
  width: 124,
629
632
  imgProxy: et
@@ -633,9 +636,9 @@ const bi = (N) => {
633
636
  children: [(l = e.labels) != null && l.length ? /* @__PURE__ */ s(yt, {
634
637
  placement: "top",
635
638
  title: /* @__PURE__ */ s("div", {
636
- children: Object.keys(e.labels.reduce((r, c) => (r[c.label] ? ++r[c.label] : r[c.label] = 1, r), {})).map((r) => /* @__PURE__ */ s("div", {
637
- children: r
638
- }, r))
639
+ children: Object.keys(e.labels.reduce((n, a) => (n[a.label] ? ++n[a.label] : n[a.label] = 1, n), {})).map((n) => /* @__PURE__ */ s("div", {
640
+ children: n
641
+ }, n))
639
642
  }),
640
643
  children: /* @__PURE__ */ V("div", {
641
644
  style: {
@@ -675,18 +678,18 @@ const bi = (N) => {
675
678
  })
676
679
  }) : /* @__PURE__ */ s("div", {
677
680
  className: "empty",
678
- children: n.total === 0 ? /* @__PURE__ */ s(It, {
681
+ children: r.total === 0 ? /* @__PURE__ */ s(It, {
679
682
  image: Nt,
680
683
  description: /* @__PURE__ */ V("span", {
681
- children: ["暂无数据", L !== "hascode" && !G && /* @__PURE__ */ s("span", {
682
- children: I && I.add && /* @__PURE__ */ V(ie, {
684
+ children: ["暂无数据", y !== "hascode" && !J && /* @__PURE__ */ s("span", {
685
+ children: D && D.add && /* @__PURE__ */ V(ie, {
683
686
  type: "link",
684
687
  size: "small",
685
688
  style: {
686
689
  padding: 0
687
690
  },
688
691
  onClick: () => re(!0),
689
- disabled: R === U.Pending || R === U.Started,
692
+ disabled: R === K.Pending || R === K.Started,
690
693
  children: [/* @__PURE__ */ s("span", {
691
694
  style: {
692
695
  color: "black"
@@ -698,7 +701,7 @@ const bi = (N) => {
698
701
  })
699
702
  }) : /* @__PURE__ */ s(Lt, {})
700
703
  })]
701
- }), !v && j.labels && /* @__PURE__ */ s("div", {
704
+ }), y !== "nocode" && !v && U.labels && /* @__PURE__ */ s("div", {
702
705
  className: "d-sider",
703
706
  children: /* @__PURE__ */ s(Pt, {
704
707
  datasetId: o,
@@ -709,14 +712,14 @@ const bi = (N) => {
709
712
  },
710
713
  onListChange: (e) => {
711
714
  i && (f.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(o, i.id).then((t) => {
712
- const r = (t || []).filter((h) => h.label !== "nocode").map((h, k) => ({
715
+ const n = (t || []).filter((h) => h.label !== "nocode").map((h, L) => ({
713
716
  label: h.label,
714
717
  count: h.count,
715
718
  id: h.id,
716
- color: Me[k % 40]
717
- })), c = F.filter((h) => r.some((k) => k.id === h.id));
718
- ye(r), F.length !== c.length && oe(c);
719
- }), x());
719
+ color: Me[L % 40]
720
+ })), a = F.filter((h) => n.some((L) => L.id === h.id));
721
+ ye(n), F.length !== a.length && oe(a);
722
+ }), T());
720
723
  },
721
724
  isPreLabel: w
722
725
  })