@glodon-aiot/dataset-annotation 3.19.0-alpha.24 → 3.19.0-alpha.25

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,43 +1,43 @@
1
- var tt = Object.defineProperty, ot = Object.defineProperties;
2
- var lt = Object.getOwnPropertyDescriptors;
1
+ var Ye = Object.defineProperty, et = Object.defineProperties;
2
+ var tt = Object.getOwnPropertyDescriptors;
3
3
  var Ne = Object.getOwnPropertySymbols;
4
- var it = Object.prototype.hasOwnProperty, nt = Object.prototype.propertyIsEnumerable;
5
- var ke = (V, c, i) => c in V ? tt(V, c, { enumerable: !0, configurable: !0, writable: !0, value: i }) : V[c] = i, u = (V, c) => {
6
- for (var i in c || (c = {}))
7
- it.call(c, i) && ke(V, i, c[i]);
4
+ var lt = Object.prototype.hasOwnProperty, it = Object.prototype.propertyIsEnumerable;
5
+ var ke = (D, c, o) => c in D ? Ye(D, c, { enumerable: !0, configurable: !0, writable: !0, value: o }) : D[c] = o, u = (D, c) => {
6
+ for (var o in c || (c = {}))
7
+ lt.call(c, o) && ke(D, o, c[o]);
8
8
  if (Ne)
9
- for (var i of Ne(c))
10
- nt.call(c, i) && ke(V, i, c[i]);
11
- return V;
12
- }, h = (V, c) => ot(V, lt(c));
9
+ for (var o of Ne(c))
10
+ it.call(c, o) && ke(D, o, c[o]);
11
+ return D;
12
+ }, h = (D, c) => et(D, tt(c));
13
13
  import { jsx as n, jsxs as E } from "react/jsx-runtime";
14
- import { useRef as se, useState as a, useEffect as D } from "react";
15
- import { message as j, ConfigProvider as rt, Space as ce, Select as st, Button as Te, Tabs as ct, Col as at, Tooltip as dt, Empty as we, Spin as Ee, Modal as ft } from "antd";
16
- import ut from "rc-virtual-list";
14
+ import { useRef as se, useState as d, useEffect as N } from "react";
15
+ import { message as j, ConfigProvider as ot, Space as ce, Select as nt, Button as Te, Tabs as rt, Col as st, Tooltip as ct, Empty as we, Spin as Ee, Modal as at } from "antd";
16
+ import dt from "rc-virtual-list";
17
17
  import { UploadZipsStatus as Y } from "@glodon-aiot/apis";
18
- import ht from "antd/es/locale/zh_CN";
19
- import mt from "../../DatasetContext/index.mjs";
20
- import bt from "../DetectionAnnotation/icon_item_empty.svg.mjs";
18
+ import ft from "antd/es/locale/zh_CN";
19
+ import ut from "../../DatasetContext/index.mjs";
20
+ import ht from "../DetectionAnnotation/icon_item_empty.svg.mjs";
21
21
  import "./style.less.mjs";
22
22
  import { tagColors as Me } from "../../utils/index.mjs";
23
- import { useKeyPress as gt } from "ahooks";
24
- import { SearchOutlined as vt } from "@ant-design/icons";
25
- import pt from "../../Common/Page/index.mjs";
26
- import Ct from "../PageNav/index.mjs";
27
- import It from "../Thumbnail/index.mjs";
28
- import xt from "../CompositionInput/index.mjs";
29
- import St from "lodash/merge";
30
- import { DEFAULT_FILTER_SWITCH as yt } from "../../constant.mjs";
31
- import Lt from "../DetectionStatus/index.mjs";
32
- import Dt from "./components/ClassificationImageModal/index.mjs";
33
- import Vt from "../DetectionAnnotation/components/Labels/index.mjs";
34
- import Nt from "../PicZipImportModal/index.mjs";
35
- import { Prompt as kt } from "../hooks/Prompt.mjs";
36
- const Yt = (V) => {
23
+ import { useKeyPress as mt } from "ahooks";
24
+ import { SearchOutlined as bt } from "@ant-design/icons";
25
+ import gt from "../../Common/Page/index.mjs";
26
+ import vt from "../PageNav/index.mjs";
27
+ import pt from "../Thumbnail/index.mjs";
28
+ import Ct from "../CompositionInput/index.mjs";
29
+ import It from "lodash/merge";
30
+ import { DEFAULT_FILTER_SWITCH as St } from "../../constant.mjs";
31
+ import xt from "../DetectionStatus/index.mjs";
32
+ import yt from "./components/ClassificationImageModal/index.mjs";
33
+ import Lt from "../DetectionAnnotation/components/Labels/index.mjs";
34
+ import Dt from "../PicZipImportModal/index.mjs";
35
+ import { Prompt as Vt } from "../hooks/Prompt.mjs";
36
+ const Qt = (D) => {
37
37
  var Le, De;
38
38
  const {
39
39
  services: c,
40
- datasetId: i,
40
+ datasetId: o,
41
41
  versionId: ee,
42
42
  backTo: Re,
43
43
  labelManager: ae = !1,
@@ -46,60 +46,58 @@ const Yt = (V) => {
46
46
  header: m = {
47
47
  versionSelect: !1
48
48
  }
49
- } = V, q = St(u({}, yt), V.filterSwitch), _ = se(null), te = se(null), [C, ze] = a(), [l, G] = a(), [oe, Fe] = a([]), [de, fe] = a(!1), [H, Pe] = a(0), [J, Be] = a(0), [d, le] = a(""), [A, He] = a(0), [w, ue] = a([]), [b, ie] = a([]), [he, K] = a(!1), [U, z] = a(!1), [M, v] = a(-1), [I, p] = a(), [x, y] = a(), [S, N] = a({
49
+ } = D, q = It(u({}, St), D.filterSwitch), _ = se(null), te = se(null), [C, ze] = d(), [i, G] = d(), [le, Ue] = d([]), [de, fe] = d(!1), [H, Fe] = d(0), [J, Be] = d(0), [a, ie] = d(""), [A, He] = d(0), [w, ue] = d([]), [b, oe] = d([]), [he, K] = d(!1), [P, z] = d(!1), [M, v] = d(-1), [I, p] = d(), [S, y] = d(), [x, V] = d({
50
50
  current: 0,
51
51
  pageSize: 100
52
- }), [O, ne] = a([]), [Z, Ke] = a(""), [Ue, Oe] = a(), F = se({}), [Ze, We] = a(), [me, be] = a(!1), [ge, $e] = a(!1), [ve, je] = a(!0), [qe, _e] = a(!1), [W, Ge] = a(""), pe = () => {
52
+ }), [Z, ne] = d([]), [O, Ke] = d(""), U = se({}), [Pe, Ze] = d(), [me, be] = d(!1), [ge, Oe] = d(!1), [ve, We] = d(!0), [$e, je] = d(!1), [W, qe] = d(""), pe = () => {
53
53
  p(void 0), y(void 0), v(-1), K(!1), Q(), setTimeout(() => {
54
- N((e) => h(u({}, e), {
54
+ V((e) => h(u({}, e), {
55
55
  current: 1,
56
56
  type: void 0
57
57
  }));
58
58
  }, 10);
59
59
  };
60
- gt("Esc", pe), D(() => {
61
- i && c.cvforceDatahub.getS3Iam(i).then((e) => {
62
- We(e);
60
+ mt("Esc", pe), N(() => {
61
+ o && c.cvforceDatahub.getS3Iam(o).then((e) => {
62
+ Ze(e);
63
63
  });
64
- }, [i, c.cvforceDatahub]), D(() => {
65
- c.cvforceDatahub && c.cvforceDatahub.getOptionsImgproxy().then((e) => Oe(e));
66
- }, [c.cvforceDatahub]), D(() => {
67
- i && (fe(!0), Promise.all([c.cvforceDatahub.getDatasetsId(i).then(ze), c.cvforceDatahub.getDatasetsIdVersions(i, 1, 1e3).then((e) => {
68
- Fe(e.recordList), G(ee ? e.recordList.find((t) => t.id === ee) : e.recordList[0]);
64
+ }, [o, c.cvforceDatahub]), N(() => {
65
+ o && (fe(!0), Promise.all([c.cvforceDatahub.getDatasetsId(o).then(ze), c.cvforceDatahub.getDatasetsIdVersions(o, 1, 1e3).then((e) => {
66
+ Ue(e.recordList), G(ee ? e.recordList.find((t) => t.id === ee) : e.recordList[0]);
69
67
  })]).finally(() => fe(!1)));
70
- }, [i, ee]), D(() => {
68
+ }, [o, ee]), N(() => {
71
69
  k();
72
- }, [l == null ? void 0 : l.id, Z]), D(() => {
70
+ }, [i == null ? void 0 : i.id, O]), N(() => {
73
71
  Q();
74
- }, [l, d]), D(() => {
75
- !l || !C || $(h(u({}, S), {
72
+ }, [i, a]), N(() => {
73
+ !i || !C || $(h(u({}, x), {
76
74
  current: 1
77
75
  }));
78
- }, [C == null ? void 0 : C.id, l == null ? void 0 : l.id, O, Z]), D(() => {
76
+ }, [C == null ? void 0 : C.id, i == null ? void 0 : i.id, Z, O]), N(() => {
79
77
  $().then(() => {
80
78
  }), k();
81
- }, [S.current]), D(() => {
82
- U || (p(void 0), y(void 0), K(!1), v(-1), Q(), k());
83
- }, [U]), D(() => {
84
- !l || !C || $(h(u({}, S), {
79
+ }, [x.current]), N(() => {
80
+ P || (p(void 0), y(void 0), K(!1), v(-1), Q(), k());
81
+ }, [P]), N(() => {
82
+ !i || !C || $(h(u({}, x), {
85
83
  current: 1,
86
84
  total: void 0
87
85
  })).then((e) => {
88
- if (!(!e || !Array.isArray(e)) && !(!I && !U))
86
+ if (!(!e || !Array.isArray(e)) && !(!I && !P))
89
87
  if (e.length > 0) {
90
- const t = F.current[d], o = t !== void 0 && t >= 0 && t < e.length ? t : 0;
91
- v(o), p(e[o]), y(void 0);
88
+ const t = U.current[a], l = t !== void 0 && t >= 0 && t < e.length ? t : 0;
89
+ v(l), p(e[l]), y(void 0);
92
90
  } else
93
- p(void 0), y(void 0), v(-1), N((t) => h(u({}, t), {
91
+ p(void 0), y(void 0), v(-1), V((t) => h(u({}, t), {
94
92
  current: 1
95
93
  }));
96
94
  });
97
- }, [d]), D(() => {
98
- N(d === "nocode" ? (e) => h(u({}, e), {
95
+ }, [a]), N(() => {
96
+ V(a === "nocode" ? (e) => h(u({}, e), {
99
97
  total: H
100
- }) : d === "" ? (e) => h(u({}, e), {
98
+ }) : a === "" ? (e) => h(u({}, e), {
101
99
  total: A
102
- }) : d === "pending" ? (e) => h(u({}, e), {
100
+ }) : a === "pending" ? (e) => h(u({}, e), {
103
101
  total: J
104
102
  }) : (e) => h(u({}, e), {
105
103
  total: A - H - J
@@ -111,44 +109,44 @@ const Yt = (V) => {
111
109
  top: 0
112
110
  });
113
111
  }, Ie = () => {
114
- !i || !l || c.cvforceDatahub.getDatasetsIdVersionsVid(i, l.id).then((e) => {
115
- var t, o;
116
- G(e), Ge((o = (t = e.versionAsyncTask) == null ? void 0 : t.state) != null ? o : "");
112
+ !o || !i || c.cvforceDatahub.getDatasetsIdVersionsVid(o, i.id).then((e) => {
113
+ var t, l;
114
+ G(e), qe((l = (t = e.versionAsyncTask) == null ? void 0 : t.state) != null ? l : "");
117
115
  });
118
116
  };
119
- D(() => {
117
+ N(() => {
120
118
  W !== Y.Pending && W !== Y.Started || j.warning("文件导入中,请刷新页面再试");
121
- }, [W]), D(() => {
122
- _e(!ve && ge);
123
- }, [ve, ge]), D(() => {
124
- i && (l != null && l.id) && Ie();
125
- }, [i, l == null ? void 0 : l.id]);
119
+ }, [W]), N(() => {
120
+ je(!ve && ge);
121
+ }, [ve, ge]), N(() => {
122
+ o && (i != null && i.id) && Ie();
123
+ }, [o, i == null ? void 0 : i.id]);
126
124
  const k = () => {
127
- !i || !l || c.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(i, l.id, {
125
+ !o || !i || c.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(o, i.id, {
128
126
  label: "allcode",
129
- searchName: Z
127
+ searchName: O
130
128
  }).then((e) => {
131
129
  var s, g, L;
132
- const t = e == null ? void 0 : e.find((f) => f.id === "allcodeid"), o = e == null ? void 0 : e.find((f) => f.id === "nocodeid"), r = e == null ? void 0 : e.find((f) => f.id === "pendingid");
133
- He((s = t == null ? void 0 : t.count) != null ? s : 0), Pe((g = o == null ? void 0 : o.count) != null ? g : 0), Be((L = r == null ? void 0 : r.count) != null ? L : 0);
130
+ const t = e == null ? void 0 : e.find((f) => f.id === "allcodeid"), l = e == null ? void 0 : e.find((f) => f.id === "nocodeid"), r = e == null ? void 0 : e.find((f) => f.id === "pendingid");
131
+ He((s = t == null ? void 0 : t.count) != null ? s : 0), Fe((g = l == null ? void 0 : l.count) != null ? g : 0), Be((L = r == null ? void 0 : r.count) != null ? L : 0);
134
132
  });
135
133
  }, Q = () => {
136
- if (!(!i || !(l != null && l.id)))
137
- return c.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(i, l.id, {}).then((e) => {
138
- const o = (e || []).filter((r) => r.label !== "nocode").map((r, s) => ({
134
+ if (!(!o || !(i != null && i.id)))
135
+ return c.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(o, i.id, {}).then((e) => {
136
+ const l = (e || []).filter((r) => r.label !== "nocode").map((r, s) => ({
139
137
  label: r.label,
140
138
  count: r.count,
141
139
  id: r.id,
142
140
  color: Me[s % 40]
143
141
  }));
144
- return ue(o), e;
142
+ return ue(l), e;
145
143
  });
146
144
  }, $ = (e, t) => {
147
- const o = (e == null ? void 0 : e.current) || S.current, r = (e == null ? void 0 : e.pageSize) || S.pageSize;
148
- if (!i || !l || !o)
145
+ const l = (e == null ? void 0 : e.current) || x.current, r = (e == null ? void 0 : e.pageSize) || x.pageSize;
146
+ if (!o || !i || !l)
149
147
  return Promise.resolve(!1);
150
- const s = O.map((L) => L.label), g = () => {
151
- switch (d) {
148
+ const s = Z.map((L) => L.label), g = () => {
149
+ switch (a) {
152
150
  case "nocode":
153
151
  return "nocode";
154
152
  case "hascode":
@@ -157,141 +155,141 @@ const Yt = (V) => {
157
155
  return s.length ? s : void 0;
158
156
  }
159
157
  };
160
- return o === 1 && Ce(), N((L) => h(u({}, L), {
161
- current: o,
158
+ return l === 1 && Ce(), V((L) => h(u({}, L), {
159
+ current: l,
162
160
  pageSize: r
163
- })), c.cvforceDatahub.getDatasetsIdVersionsVidSamples(i, l.id, {
164
- pageNo: o,
161
+ })), c.cvforceDatahub.getDatasetsIdVersionsVidSamples(o, i.id, {
162
+ pageNo: l,
165
163
  pageSize: r,
166
164
  labels: g(),
167
- searchName: Z
165
+ searchName: O
168
166
  }).then((L) => {
169
- const f = L.recordList || [], R = o === 1 ? f : [...t || b, ...f];
170
- return ie(R), N((X) => h(u({}, X), {
171
- current: o,
167
+ const f = L.recordList || [], R = l === 1 ? f : [...t || b, ...f];
168
+ return oe(R), V((X) => h(u({}, X), {
169
+ current: l,
172
170
  pageSize: r,
173
171
  total: L.totalResults
174
172
  })), (e == null ? void 0 : e.type) === "next" && f.length && (v(0), p(f[0])), (e == null ? void 0 : e.type) === "prev" && f.length && (v(r - 1), p(f[f.length - 1])), he && M < 0 && f.length && (v(0), p(f[0]), z(!0)), R;
175
173
  }).catch(() => !1);
176
- }, Je = (e) => {
177
- b && (K(!1), v(e), p(b[e]), y(void 0), z(!0), d !== void 0 && (F.current[d] = e));
174
+ }, _e = (e) => {
175
+ b && (K(!1), v(e), p(b[e]), y(void 0), z(!0), a !== void 0 && (U.current[a] = e));
178
176
  };
179
- D(() => {
180
- var t, o, r;
181
- if (!x)
177
+ N(() => {
178
+ var t, l, r;
179
+ if (!S)
182
180
  return;
183
181
  const e = [];
184
- (t = x.labels) == null || t.forEach((s) => {
182
+ (t = S.labels) == null || t.forEach((s) => {
185
183
  w != null && w.find((g) => g.id === s.id) && e.push(s);
186
- }), e.length !== ((r = (o = x.labels) == null ? void 0 : o.length) != null ? r : 0) && y(h(u({}, x), {
184
+ }), e.length !== ((r = (l = S.labels) == null ? void 0 : l.length) != null ? r : 0) && y(h(u({}, S), {
187
185
  labels: e
188
186
  }));
189
187
  }, [w]);
190
188
  const re = () => {
191
- if (!l)
189
+ if (!i)
192
190
  return Promise.resolve(!1);
193
- const e = x != null ? x : I;
194
- if (!e || !x)
191
+ const e = S != null ? S : I;
192
+ if (!e || !S)
195
193
  return Promise.resolve(!0);
196
- const t = (I == null ? void 0 : I.labels) || [], o = (x.labels || []).filter((s) => !!s.id);
197
- if (t.length === o.length && o.every((s, g) => {
194
+ const t = (I == null ? void 0 : I.labels) || [], l = (S.labels || []).filter((s) => !!s.id);
195
+ if (t.length === l.length && l.every((s, g) => {
198
196
  var L;
199
197
  return ((L = t[g]) == null ? void 0 : L.id) === s.id;
200
198
  }))
201
199
  return Promise.resolve(!0);
202
200
  const r = h(u({}, e), {
203
- labels: o.map((s) => {
201
+ labels: l.map((s) => {
204
202
  var g;
205
203
  return h(u({}, s), {
206
204
  box: (g = s.box) != null ? g : []
207
205
  });
208
206
  }),
209
- isLabeled: o.length > 0
207
+ isLabeled: l.length > 0
210
208
  });
211
- return c.cvforceDatahub.updateSamples(i, l.id, [r]).then(() => {
209
+ return c.cvforceDatahub.updateSamples(o, i.id, [r]).then(() => {
212
210
  var g, L;
213
211
  j.success({
214
212
  content: "保存成功"
215
213
  });
216
- const s = d === "nocode" && ((g = r.labels) == null ? void 0 : g.length) || d === "hascode" && !((L = r.labels) != null && L.length);
217
- return ie((f) => {
218
- const R = f.findIndex((P) => P.id === r.id);
214
+ const s = a === "nocode" && ((g = r.labels) == null ? void 0 : g.length) || a === "hascode" && !((L = r.labels) != null && L.length);
215
+ return oe((f) => {
216
+ const R = f.findIndex((F) => F.id === r.id);
219
217
  if (R === -1)
220
218
  return f;
221
219
  if (s) {
222
- const P = f.slice(0, R).concat(f.slice(R + 1));
223
- if (N((B) => h(u({}, B), {
220
+ const F = f.slice(0, R).concat(f.slice(R + 1));
221
+ if (V((B) => h(u({}, B), {
224
222
  total: B.total != null ? Math.max(0, B.total - 1) : void 0
225
- })), P.length === 0)
223
+ })), F.length === 0)
226
224
  p(void 0), y(void 0), v(-1), z(!1);
227
225
  else {
228
- const B = Math.min(M, P.length - 1), Ve = P[B];
226
+ const B = Math.min(M, F.length - 1), Ve = F[B];
229
227
  Ve != null && (p(Ve), v(B), y(void 0));
230
228
  }
231
- return P;
229
+ return F;
232
230
  }
233
231
  const X = [...f];
234
232
  return X[R] = r, X;
235
233
  }), s || (p(r), y(r)), !0;
236
234
  }).catch(() => !1);
237
- }, xe = () => {
235
+ }, Se = () => {
238
236
  b && re().then((e) => {
239
237
  if (!e)
240
238
  return;
241
239
  k();
242
240
  const t = M + 1;
243
- t >= b.length ? S.total != null && t >= S.total ? j.error("已经是最后一个了") : $({
244
- current: S.current + 1,
245
- pageSize: S.pageSize,
241
+ t >= b.length ? x.total != null && t >= x.total ? j.error("已经是最后一个了") : $({
242
+ current: x.current + 1,
243
+ pageSize: x.pageSize,
246
244
  type: "next"
247
- }, b).then((o) => {
248
- Array.isArray(o) && (v(t), p(o[t]), y(void 0), d !== void 0 && (F.current[d] = t));
245
+ }, b).then((l) => {
246
+ Array.isArray(l) && (v(t), p(l[t]), y(void 0), a !== void 0 && (U.current[a] = t));
249
247
  }) : setTimeout(() => {
250
- v(t), p(b[t]), y(void 0), d !== void 0 && (F.current[d] = t);
248
+ v(t), p(b[t]), y(void 0), a !== void 0 && (U.current[a] = t);
251
249
  }, 200);
252
250
  });
253
- }, Qe = () => {
251
+ }, Ge = () => {
254
252
  b && re().then((e) => {
255
253
  if (!e)
256
254
  return;
257
255
  k();
258
256
  const t = M - 1;
259
257
  t < 0 ? j.error("已经是第一个了") : setTimeout(() => {
260
- v(t), p(b[t]), y(void 0), d !== void 0 && (F.current[d] = t);
258
+ v(t), p(b[t]), y(void 0), a !== void 0 && (U.current[a] = t);
261
259
  }, 200);
262
260
  });
263
- }, Xe = () => {
261
+ }, Je = () => {
264
262
  var e;
265
- if ((e = x == null ? void 0 : x.labels) != null && e.some((t) => !t.id))
263
+ if ((e = S == null ? void 0 : S.labels) != null && e.some((t) => !t.id))
266
264
  return j.error("请选择标签"), Promise.resolve(!1);
267
- xe();
268
- }, Ye = () => {
269
- ft.confirm({
265
+ Se();
266
+ }, Qe = () => {
267
+ at.confirm({
270
268
  title: "确认要删除当前数据吗?",
271
269
  content: "数据包含当前标注的内容和图片,删除后无法恢复,请确认是否删除!",
272
270
  onOk: () => {
273
- !I || !l || c.cvforceDatahub.delDatasetsIdVersionsVidSamplesId(i, l.id, I.id).then(() => {
274
- const e = b.findIndex((o) => o.id === I.id), t = [...b];
275
- if (t.splice(e, 1), ie(t), N((o) => h(u({}, o), {
276
- total: o.total != null ? o.total - 1 : 0
271
+ !I || !i || c.cvforceDatahub.delDatasetsIdVersionsVidSamplesId(o, i.id, I.id).then(() => {
272
+ const e = b.findIndex((l) => l.id === I.id), t = [...b];
273
+ if (t.splice(e, 1), oe(t), V((l) => h(u({}, l), {
274
+ total: l.total != null ? l.total - 1 : 0
277
275
  })), t.length > 0) {
278
- const o = e < t.length ? e : e - 1;
279
- p(t[o]), v(o);
276
+ const l = e < t.length ? e : e - 1;
277
+ p(t[l]), v(l);
280
278
  } else
281
- p(void 0), y(void 0), v(-1), z(!1), N((o) => h(u({}, o), {
279
+ p(void 0), y(void 0), v(-1), z(!1), V((l) => h(u({}, l), {
282
280
  current: 1
283
281
  }));
284
282
  y(void 0), k();
285
283
  });
286
284
  }
287
285
  });
288
- }, Se = (e) => {
289
- M >= 0 && d !== void 0 && d !== null && (F.current[d] = M), x ? re().then((t) => {
290
- t && (le(e), k());
291
- }) : (N((t) => h(u({}, t), {
286
+ }, xe = (e) => {
287
+ M >= 0 && a !== void 0 && a !== null && (U.current[a] = M), S ? re().then((t) => {
288
+ t && (ie(e), k());
289
+ }) : (V((t) => h(u({}, t), {
292
290
  current: 1,
293
291
  total: void 0
294
- })), le(e)), e === "nocode" && ne([]);
292
+ })), ie(e)), e === "nocode" && ne([]);
295
293
  }, ye = [{
296
294
  key: "",
297
295
  label: `全部(${A})`,
@@ -304,25 +302,25 @@ const Yt = (V) => {
304
302
  key: "hascode",
305
303
  label: `已标注(${A - H - J})`,
306
304
  children: null
307
- }], et = (e) => {
308
- var o;
305
+ }], Xe = (e) => {
306
+ var l;
309
307
  const t = e.currentTarget;
310
- (S.total == null || S.total > b.length) && t.scrollHeight - t.scrollTop === ((o = _.current) == null ? void 0 : o.clientHeight) && N((r) => h(u({}, r), {
308
+ (x.total == null || x.total > b.length) && t.scrollHeight - t.scrollTop === ((l = _.current) == null ? void 0 : l.clientHeight) && V((r) => h(u({}, r), {
311
309
  current: r.current + 1
312
310
  }));
313
311
  };
314
- return /* @__PURE__ */ n(rt, {
315
- locale: ht,
316
- children: /* @__PURE__ */ n(mt.Provider, {
312
+ return /* @__PURE__ */ n(ot, {
313
+ locale: ft,
314
+ children: /* @__PURE__ */ n(ut.Provider, {
317
315
  value: {
318
- datasetId: i,
319
- versionId: (l == null ? void 0 : l.id) || "",
320
- no: (l == null ? void 0 : l.no) || "",
316
+ datasetId: o,
317
+ versionId: (i == null ? void 0 : i.id) || "",
318
+ no: (i == null ? void 0 : i.no) || "",
321
319
  loading: de,
322
- version: l,
323
- versions: oe,
320
+ version: i,
321
+ versions: le,
324
322
  samples: b,
325
- pagination: S,
323
+ pagination: x,
326
324
  services: c,
327
325
  featuresConfig: {
328
326
  labelManager: ae,
@@ -330,14 +328,14 @@ const Yt = (V) => {
330
328
  annotation: Ae,
331
329
  filterSwitch: q,
332
330
  header: m,
333
- exampleSrcRoot: V.exampleSrcRoot
331
+ exampleSrcRoot: D.exampleSrcRoot
334
332
  }
335
333
  },
336
334
  children: C ? C.markType === "classification" ? /* @__PURE__ */ n("div", {
337
335
  className: "classification-version-detail",
338
- children: /* @__PURE__ */ E(pt, {
336
+ children: /* @__PURE__ */ E(gt, {
339
337
  className: "product-details-page",
340
- header: m !== !1 ? /* @__PURE__ */ n(Ct, {
338
+ header: m !== !1 ? /* @__PURE__ */ n(vt, {
341
339
  backTo: Re,
342
340
  onBackClick: m != null && m.onBackClick ? () => {
343
341
  var e;
@@ -349,20 +347,20 @@ const Yt = (V) => {
349
347
  fontWeight: "bold"
350
348
  },
351
349
  children: C == null ? void 0 : C.name
352
- }), /* @__PURE__ */ n(st, {
350
+ }), /* @__PURE__ */ n(nt, {
353
351
  disabled: (m == null ? void 0 : m.versionSelect) === !1,
354
- value: l == null ? void 0 : l.id,
352
+ value: i == null ? void 0 : i.id,
355
353
  style: {
356
354
  width: 70
357
355
  },
358
- options: oe.map((e) => ({
356
+ options: le.map((e) => ({
359
357
  label: e.no,
360
358
  value: e.id
361
359
  })),
362
360
  onChange: (e) => {
363
- var o;
364
- const t = oe.find((r) => r.id === e);
365
- t && (G(t), (o = m == null ? void 0 : m.onVersionChange) == null || o.call(m, t));
361
+ var l;
362
+ const t = le.find((r) => r.id === e);
363
+ t && (G(t), (l = m == null ? void 0 : m.onVersionChange) == null || l.call(m, t));
366
364
  }
367
365
  })]
368
366
  }),
@@ -375,28 +373,28 @@ const Yt = (V) => {
375
373
  }), !I && T && T.label && /* @__PURE__ */ n(Te, {
376
374
  type: "primary",
377
375
  onClick: () => {
378
- I || le("nocode"), K(!0), v(-1), d === "nocode" && (b != null && b.length) && (v(0), p(b[0])), z(!0);
376
+ I || ie("nocode"), K(!0), v(-1), a === "nocode" && (b != null && b.length) && (v(0), p(b[0])), z(!0);
379
377
  },
380
378
  children: "开始标注"
381
- }), /* @__PURE__ */ n(kt, {
382
- when: qe,
379
+ }), /* @__PURE__ */ n(Vt, {
380
+ when: $e,
383
381
  content: "确认要离开此页面吗?",
384
382
  subContent: "离开此页面后,将结束导入,放弃未上传的文件,请谨慎操作!"
385
- }), me && /* @__PURE__ */ n(Nt, {
386
- datasetIam: Ze,
387
- datasetId: i,
388
- currentVersion: l,
383
+ }), me && /* @__PURE__ */ n(Dt, {
384
+ datasetIam: Pe,
385
+ datasetId: o,
386
+ currentVersion: i,
389
387
  tenCode: C == null ? void 0 : C.tenantCode,
390
388
  isVisible: me,
391
389
  setIsVisible: be,
392
390
  getVersionListRequest: k,
393
- setIsConfirm: je,
391
+ setIsConfirm: We,
394
392
  onUploadStatusChange: (e) => {
395
- $e(e);
393
+ Oe(e);
396
394
  },
397
395
  tableReload: () => {
398
396
  var e;
399
- l != null && l.id && (Ce(), $(h(u({}, S), {
397
+ i != null && i.id && (Ce(), $(h(u({}, x), {
400
398
  current: 1
401
399
  })), (e = te.current) == null || e.fetchLabels());
402
400
  },
@@ -408,15 +406,15 @@ const Yt = (V) => {
408
406
  children: [/* @__PURE__ */ n("div", {
409
407
  className: "detection-header",
410
408
  children: /* @__PURE__ */ E(ce, {
411
- children: [q.tabs && /* @__PURE__ */ n(ct, {
409
+ children: [q.tabs && /* @__PURE__ */ n(rt, {
412
410
  className: "header-tab",
413
- activeKey: d,
411
+ activeKey: a,
414
412
  items: ye,
415
- onChange: Se
416
- }), !I && q.search && /* @__PURE__ */ n(xt, {
413
+ onChange: xe
414
+ }), !I && q.search && /* @__PURE__ */ n(Ct, {
417
415
  placeholder: "请输入图片名称搜索",
418
- suffix: /* @__PURE__ */ n(vt, {}),
419
- value: Z,
416
+ suffix: /* @__PURE__ */ n(bt, {}),
417
+ value: O,
420
418
  onChange: Ke,
421
419
  allowClear: !0
422
420
  })]
@@ -426,22 +424,22 @@ const Yt = (V) => {
426
424
  children: [/* @__PURE__ */ E("div", {
427
425
  className: "d-right",
428
426
  ref: _,
429
- children: [U && /* @__PURE__ */ n(Dt, {
430
- datasetId: i,
431
- isImageDetailVisible: U,
427
+ children: [P && /* @__PURE__ */ n(yt, {
428
+ datasetId: o,
429
+ isImageDetailVisible: P,
432
430
  setIsImageDetailVisible: z,
433
- currentSample: x != null ? x : I,
431
+ currentSample: S != null ? S : I,
434
432
  labels: w,
435
433
  previewMode: !he,
436
434
  filterItems: ye,
437
- filterMode: d,
438
- onFilterChange: Se,
435
+ filterMode: a,
436
+ onFilterChange: xe,
439
437
  onChange: y,
440
- onNextClick: xe,
441
- onPrevClick: Qe,
442
- onSave: Xe,
438
+ onNextClick: Se,
439
+ onPrevClick: Ge,
440
+ onSave: Je,
443
441
  onEnterEdit: () => K(!0),
444
- onDeleteSample: Ye,
442
+ onDeleteSample: Qe,
445
443
  onRefresh: () => {
446
444
  var e, t;
447
445
  (e = Q()) == null || e.then(() => k()), (t = te.current) == null || t.fetchLabels();
@@ -454,36 +452,36 @@ const Yt = (V) => {
454
452
  settingHide: !ae,
455
453
  canLabel: !!(T && T.label),
456
454
  canDelete: !!(T && T.delete)
457
- }), I ? /* @__PURE__ */ n("div", {}) : S.total !== void 0 && S.total > 0 ? /* @__PURE__ */ n(ut, {
455
+ }), I ? /* @__PURE__ */ n("div", {}) : x.total !== void 0 && x.total > 0 ? /* @__PURE__ */ n(dt, {
458
456
  innerProps: {
459
457
  className: "d-right-row"
460
458
  },
461
459
  data: b,
462
460
  itemKey: "id",
463
461
  height: (De = (Le = _.current) == null ? void 0 : Le.clientHeight) != null ? De : 600,
464
- onScroll: et,
462
+ onScroll: Xe,
465
463
  children: (e, t) => {
466
- var o;
467
- return /* @__PURE__ */ n(at, {
464
+ var l;
465
+ return /* @__PURE__ */ n(st, {
468
466
  className: "d-right-col",
469
- onClick: () => Je(t),
467
+ onClick: () => _e(t),
470
468
  children: /* @__PURE__ */ E("div", {
471
469
  className: "right-col-wrapper",
472
470
  children: [/* @__PURE__ */ n("div", {
473
471
  className: "detection-status-wrapper",
474
- children: /* @__PURE__ */ n(Lt, {
472
+ children: /* @__PURE__ */ n(xt, {
475
473
  sample: e
476
474
  })
477
475
  }), /* @__PURE__ */ n("div", {
478
476
  className: "right-col-img",
479
- children: /* @__PURE__ */ n(It, {
477
+ children: /* @__PURE__ */ n(pt, {
480
478
  fileKey: e.fileKey,
481
479
  width: 124,
482
- imgProxy: Ue
480
+ thumbnailUrl: e.thumbnailUrl
483
481
  })
484
482
  }), /* @__PURE__ */ E("div", {
485
483
  className: "right-col-text",
486
- children: [(o = e.labels) != null && o.length ? /* @__PURE__ */ n(dt, {
484
+ children: [(l = e.labels) != null && l.length ? /* @__PURE__ */ n(ct, {
487
485
  placement: "top",
488
486
  title: e.labels[0].label,
489
487
  children: /* @__PURE__ */ n("span", {
@@ -511,30 +509,30 @@ const Yt = (V) => {
511
509
  }
512
510
  }) : /* @__PURE__ */ n("div", {
513
511
  className: "empty",
514
- children: S.total === 0 ? /* @__PURE__ */ n(we, {
515
- image: bt,
512
+ children: x.total === 0 ? /* @__PURE__ */ n(we, {
513
+ image: ht,
516
514
  description: "暂无数据"
517
515
  }) : /* @__PURE__ */ n(Ee, {})
518
516
  })]
519
- }), d !== "nocode" && !I && q.labels && /* @__PURE__ */ n("div", {
517
+ }), a !== "nocode" && !I && q.labels && /* @__PURE__ */ n("div", {
520
518
  className: "d-sider",
521
- children: /* @__PURE__ */ n(Vt, {
519
+ children: /* @__PURE__ */ n(Lt, {
522
520
  ref: te,
523
- datasetId: i,
521
+ datasetId: o,
524
522
  data: w || [],
525
- selected: O,
523
+ selected: Z,
526
524
  onSelectedChange: (e) => {
527
- ne((w == null ? void 0 : w.filter((t) => e.find((o) => o.label === t.label))) || []);
525
+ ne((w == null ? void 0 : w.filter((t) => e.find((l) => l.label === t.label))) || []);
528
526
  },
529
527
  onListChange: () => {
530
- l && (c.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(i, l.id, {}).then((e) => {
531
- const o = (e || []).filter((s) => s.label !== "nocode").map((s, g) => ({
528
+ i && (c.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(o, i.id, {}).then((e) => {
529
+ const l = (e || []).filter((s) => s.label !== "nocode").map((s, g) => ({
532
530
  label: s.label,
533
531
  count: s.count,
534
532
  id: s.id,
535
533
  color: Me[g % 40]
536
- })), r = O.filter((s) => o.some((g) => g.id === s.id));
537
- ue(o), O.length !== r.length && ne(r);
534
+ })), r = Z.filter((s) => l.some((g) => g.id === s.id));
535
+ ue(l), Z.length !== r.length && ne(r);
538
536
  }), k());
539
537
  },
540
538
  isPreLabel: !1
@@ -555,5 +553,5 @@ const Yt = (V) => {
555
553
  });
556
554
  };
557
555
  export {
558
- Yt as default
556
+ Qt as default
559
557
  };