@glodon-aiot/dataset-annotation 3.25.0-alpha.8 → 3.25.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,135 +1,135 @@
1
- var je = Object.defineProperty, We = Object.defineProperties;
2
- var Ge = Object.getOwnPropertyDescriptors;
3
- var ge = Object.getOwnPropertySymbols;
4
- var Je = Object.prototype.hasOwnProperty, Qe = Object.prototype.propertyIsEnumerable;
5
- var ve = (v, a, r) => a in v ? je(v, a, { enumerable: !0, configurable: !0, writable: !0, value: r }) : v[a] = r, m = (v, a) => {
6
- for (var r in a || (a = {}))
7
- Je.call(a, r) && ve(v, r, a[r]);
8
- if (ge)
9
- for (var r of ge(a))
10
- Qe.call(a, r) && ve(v, r, a[r]);
11
- return v;
12
- }, S = (v, a) => We(v, Ge(a));
13
- import { jsx as s, jsxs as V, Fragment as Xe } from "react/jsx-runtime";
14
- import { useState as d, useRef as O, useLayoutEffect as Ye, useEffect as g } from "react";
15
- import { message as Y, ConfigProvider as et, Space as $, Select as tt, Button as ee, Tabs as rt, Col as nt, Empty as it } from "antd";
16
- import ot from "antd/es/locale/zh_CN";
1
+ var We = Object.defineProperty, Ge = Object.defineProperties;
2
+ var Je = Object.getOwnPropertyDescriptors;
3
+ var ve = Object.getOwnPropertySymbols;
4
+ var Qe = Object.prototype.hasOwnProperty, Xe = Object.prototype.propertyIsEnumerable;
5
+ var Se = (S, d, n) => d in S ? We(S, d, { enumerable: !0, configurable: !0, writable: !0, value: n }) : S[d] = n, f = (S, d) => {
6
+ for (var n in d || (d = {}))
7
+ Qe.call(d, n) && Se(S, n, d[n]);
8
+ if (ve)
9
+ for (var n of ve(d))
10
+ Xe.call(d, n) && Se(S, n, d[n]);
11
+ return S;
12
+ }, p = (S, d) => Ge(S, Je(d));
13
+ import { jsx as a, jsxs as T, Fragment as Ye } from "react/jsx-runtime";
14
+ import { useState as u, useRef as $, useLayoutEffect as et, useEffect as v } from "react";
15
+ import { message as ee, ConfigProvider as tt, Space as j, Select as rt, Button as te, Tabs as nt, Col as it, Empty as ot } from "antd";
16
+ import lt from "antd/es/locale/zh_CN";
17
17
  import "./style.less.mjs";
18
- import lt from "./VlmModal/index.mjs";
19
- import st from "lodash/merge";
18
+ import st from "./VlmModal/index.mjs";
19
+ import ct from "lodash/merge";
20
20
  import { UploadZipsStatus as F } from "@glodon-aiot/apis";
21
- import ct from "rc-virtual-list";
22
- import at from "../../Common/Page/index.mjs";
23
- import dt from "../Thumbnail/index.mjs";
24
- import ut from "../../DatasetContext/index.mjs";
25
- import { DEFAULT_FILTER_SWITCH as mt } from "../../constant.mjs";
26
- import ft from "../PageNav/index.mjs";
27
- import ht from "../PicZipImportModal/index.mjs";
28
- import { Prompt as pt } from "../hooks/Prompt.mjs";
29
- import gt from "../DetectionAnnotation/icon_item_empty.svg.mjs";
30
- import { scrollSampleIntoView as Se, getVirtualListHolder as be } from "../../utils/scrollSampleIntoView.mjs";
31
- import { checkVlmSampleLabeled as vt } from "../../utils/checkVlmSampleLabeled.mjs";
32
- const Ut = (v) => {
21
+ import at from "rc-virtual-list";
22
+ import dt from "../../Common/Page/index.mjs";
23
+ import ut from "../Thumbnail/index.mjs";
24
+ import mt from "../../DatasetContext/index.mjs";
25
+ import { DEFAULT_FILTER_SWITCH as ft } from "../../constant.mjs";
26
+ import ht from "../PageNav/index.mjs";
27
+ import pt from "../PicZipImportModal/index.mjs";
28
+ import { Prompt as gt } from "../hooks/Prompt.mjs";
29
+ import vt from "../DetectionAnnotation/icon_item_empty.svg.mjs";
30
+ import { scrollSampleIntoView as be, getVirtualListHolder as Ie } from "../../utils/scrollSampleIntoView.mjs";
31
+ import { checkVlmSampleLabeled as St } from "../../utils/checkVlmSampleLabeled.mjs";
32
+ const Bt = (S) => {
33
33
  const {
34
- services: a,
35
- datasetId: r,
34
+ services: d,
35
+ datasetId: n,
36
36
  versionId: H,
37
- backTo: Ie,
37
+ backTo: ke,
38
38
  labelManager: ye = !1,
39
- datasetManager: I = !1,
40
- annotation: ke,
41
- header: h = {
39
+ datasetManager: b = !1,
40
+ annotation: Ce,
41
+ header: g = {
42
42
  versionSelect: !1
43
43
  },
44
- exampleSrcRoot: Ce,
45
- apiUrl: Ve,
44
+ exampleSrcRoot: xe,
45
+ apiUrl: Te,
46
46
  token: Le,
47
- getToken: Te
48
- } = v, [o, j] = d(), [n, x] = d(), [P, te] = d([]), [re, q] = d(!1), [Me, ne] = d(!1), [D, K] = d(!1), [we, Z] = d("preview"), [W, ie] = d(0), [f, oe] = d([]), [y, z] = d(), [xe, le] = d(), [N, A] = d(-1), [l, C] = d({
47
+ getToken: Ve
48
+ } = S, [s, W] = u(), [i, w] = u(), [B, re] = u([]), [ne, P] = u(!1), [ie, oe] = u(!1), [D, q] = u(!1), [Me, K] = u("preview"), [G, le] = u(0), [h, J] = u([]), [y, N] = u(), [we, se] = u(), [z, A] = u(-1), [o, I] = u({
49
49
  current: 0,
50
50
  pageSize: 100
51
- }), [se, ce] = d(0), [L, G] = d(""), [T, De] = d(""), [ze, Ne] = d(), [ae, J] = d(!1), [de, Ae] = d(!1), [ue, Re] = d(!0), [Ee, Fe] = d(!1), U = O(null), _ = O(void 0), Q = O(void 0), [He, Ue] = d(0), me = O(-1), X = m({}, mt);
52
- st(X, v.filterSwitch), Ye(() => {
51
+ }), [ce, ae] = u(0), [L, Q] = u(""), [V, De] = u(""), [Ne, ze] = u(), [de, X] = u(!1), [ue, Ae] = u(!1), [me, Re] = u(!0), [Ee, Fe] = u(!1), U = $(null), C = $(void 0), Z = $(void 0), [He, Ue] = u(0), fe = $(-1), Y = f({}, ft);
52
+ ct(Y, S.filterSwitch), et(() => {
53
53
  const e = U.current;
54
54
  if (!e)
55
55
  return;
56
56
  let t = 0;
57
- const c = () => {
57
+ const l = () => {
58
58
  cancelAnimationFrame(t), t = requestAnimationFrame(() => {
59
- const p = e.clientHeight, M = Math.max(1, Math.round(p));
60
- M !== me.current && (me.current = M, Ue(M));
59
+ const c = e.clientHeight, k = Math.max(1, Math.round(c));
60
+ k !== fe.current && (fe.current = k, Ue(k));
61
61
  });
62
62
  };
63
- c();
64
- const i = typeof ResizeObserver != "undefined" ? new ResizeObserver(c) : null;
65
- i == null || i.observe(e);
66
- const u = window.visualViewport;
67
- return u == null || u.addEventListener("resize", c), window.addEventListener("resize", c), () => {
68
- cancelAnimationFrame(t), i == null || i.disconnect(), u == null || u.removeEventListener("resize", c), window.removeEventListener("resize", c);
63
+ l();
64
+ const r = typeof ResizeObserver != "undefined" ? new ResizeObserver(l) : null;
65
+ r == null || r.observe(e);
66
+ const m = window.visualViewport;
67
+ return m == null || m.addEventListener("resize", l), window.addEventListener("resize", l), () => {
68
+ cancelAnimationFrame(t), r == null || r.disconnect(), m == null || m.removeEventListener("resize", l), window.removeEventListener("resize", l);
69
69
  };
70
- }, [o]);
70
+ }, [s]);
71
71
  const Be = () => {
72
- G("nocode"), Z("annotation"), K(!0);
72
+ Q("nocode"), K("annotation"), q(!0);
73
73
  }, Pe = (e) => {
74
- if (!f)
74
+ if (!h)
75
75
  return;
76
76
  A(e);
77
- const t = f[e];
78
- z(t), Z("preview"), K(!0);
77
+ const t = h[e];
78
+ N(t), K("preview"), q(!0);
79
79
  };
80
- g(() => {
81
- r && a.cvforceDatahub.getS3Iam(r).then((e) => {
82
- Ne(e);
80
+ v(() => {
81
+ n && d.cvforceDatahub.getS3Iam(n).then((e) => {
82
+ ze(e);
83
83
  });
84
- }, [r]), g(() => {
85
- !r || n || (q(!0), Promise.all([
84
+ }, [n]), v(() => {
85
+ !n || i || (P(!0), Promise.all([
86
86
  // 数据集
87
- a.cvforceDatahub.getDatasetsId(r).then((e) => {
88
- j(e);
87
+ d.cvforceDatahub.getDatasetsId(n).then((e) => {
88
+ W(e);
89
89
  }),
90
90
  // 版本列表
91
- a.cvforceDatahub.getDatasetsIdVersions(r, 1, 1e3).then((e) => {
92
- te(e.recordList), x(H ? e.recordList.find((t) => t.id === H) : e.recordList[0]);
91
+ d.cvforceDatahub.getDatasetsIdVersions(n, 1, 1e3).then((e) => {
92
+ re(e.recordList), w(H ? e.recordList.find((t) => t.id === H) : e.recordList[0]);
93
93
  })
94
- ]).finally(() => q(!1)));
95
- }, [r, n == null ? void 0 : n.id]), g(() => {
96
- r && (q(!0), Promise.all([
94
+ ]).finally(() => P(!1)));
95
+ }, [n, i == null ? void 0 : i.id]), v(() => {
96
+ n && (P(!0), Promise.all([
97
97
  // 数据集
98
- a.cvforceDatahub.getDatasetsId(r).then((e) => {
99
- j(e);
98
+ d.cvforceDatahub.getDatasetsId(n).then((e) => {
99
+ W(e);
100
100
  }),
101
101
  // 版本列表
102
- a.cvforceDatahub.getDatasetsIdVersions(r, 1, 1e3).then((e) => {
103
- te(e.recordList), x(H ? e.recordList.find((t) => t.id === H) : e.recordList[0]);
102
+ d.cvforceDatahub.getDatasetsIdVersions(n, 1, 1e3).then((e) => {
103
+ re(e.recordList), w(H ? e.recordList.find((t) => t.id === H) : e.recordList[0]);
104
104
  })
105
- ]).finally(() => q(!1)));
106
- }, [r, H]), g(() => {
107
- r && a.cvforceDatahub.getDatasetsId(r).then((e) => {
108
- j(e);
105
+ ]).finally(() => P(!1)));
106
+ }, [n, H]), v(() => {
107
+ n && d.cvforceDatahub.getDatasetsId(n).then((e) => {
108
+ W(e);
109
109
  });
110
110
  }, []);
111
- const fe = () => {
112
- !r || !n || a.cvforceDatahub.getDatasetsIdVersionsVid(r, n.id).then((e) => {
113
- x(e), De(e.versionAsyncTask.state);
111
+ const he = () => {
112
+ !n || !i || d.cvforceDatahub.getDatasetsIdVersionsVid(n, i.id).then((e) => {
113
+ w(e), De(e.versionAsyncTask.state);
114
114
  });
115
115
  };
116
- g(() => {
117
- fe();
118
- }, [r, n == null ? void 0 : n.id]), g(() => {
119
- T !== F.Pending && T !== F.Started || Y.warning("文件导入中,请刷新页面再试");
120
- }, [T]), g(() => {
121
- Fe(!ue && de);
122
- }, [ue, de]);
116
+ v(() => {
117
+ he();
118
+ }, [n, i == null ? void 0 : i.id]), v(() => {
119
+ V !== F.Pending && V !== F.Started || ee.warning("文件导入中,请刷新页面再试");
120
+ }, [V]), v(() => {
121
+ Fe(!me && ue);
122
+ }, [me, ue]);
123
123
  const R = () => {
124
- !r || !n || a.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(r, n.id).then((e) => {
125
- const t = e.find((i) => i.id === "allcodeid"), c = e.find((i) => i.id === "nocodeid");
126
- ie(t ? t.count : 0), ce(c ? c.count : 0);
124
+ !n || !i || d.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(n, i.id).then((e) => {
125
+ const t = e.find((r) => r.id === "allcodeid"), l = e.find((r) => r.id === "nocodeid");
126
+ le(t ? t.count : 0), ae(l ? l.count : 0);
127
127
  });
128
- }, E = (e, t) => {
129
- const c = (e == null ? void 0 : e.current) || l.current, i = (e == null ? void 0 : e.pageSize) || l.pageSize, u = (e == null ? void 0 : e.type) || l.type, p = t || f || [];
130
- if (!r || !n || !c)
128
+ }, M = (e, t, l) => {
129
+ const r = (e == null ? void 0 : e.current) || o.current, m = (e == null ? void 0 : e.pageSize) || o.pageSize, c = (e == null ? void 0 : e.type) || o.type, k = t || h || [];
130
+ if (!n || !i || !r)
131
131
  return Promise.resolve(!1);
132
- const M = () => {
132
+ const _ = () => {
133
133
  switch (L) {
134
134
  case "nocode":
135
135
  return "nocode";
@@ -139,278 +139,313 @@ const Ut = (v) => {
139
139
  return;
140
140
  }
141
141
  };
142
- return c === 1 && he(), C((w) => S(m({}, w), {
143
- current: c,
144
- pageSize: i
145
- })), ne(!0), a.cvforceDatahub.getDatasetsIdVersionsVidSamples(r, n.id, {
146
- pageNo: c,
147
- pageSize: i,
148
- labels: M()
149
- }).then((w) => {
150
- const b = w.recordList || [], B = c === 1 ? b : u === "prev" ? [...b, ...p] : [...p, ...b];
151
- if (oe(B), C((k) => S(m({}, k), {
142
+ return r === 1 && !(l != null && l.skipScrollToTop) && pe(), I((O) => p(f({}, O), {
143
+ current: r,
144
+ pageSize: m
145
+ })), oe(!0), d.cvforceDatahub.getDatasetsIdVersionsVidSamples(n, i.id, {
146
+ pageNo: r,
147
+ pageSize: m,
148
+ labels: _()
149
+ }).then((O) => {
150
+ const x = O.recordList || [], ge = r === 1 ? x : c === "prev" ? [...x, ...k] : [...k, ...x];
151
+ if (J(ge), I((E) => p(f({}, E), {
152
152
  type: void 0,
153
- total: w.totalResults
154
- })), u === "next" && b.length) {
155
- const k = p.length;
156
- A(k), z(b[0]);
153
+ total: O.totalResults
154
+ })), c === "next" && x.length) {
155
+ const E = k.length;
156
+ A(E), N(x[0]);
157
157
  }
158
- if (u === "prev" && b.length) {
159
- const k = b.length - 1;
160
- A(k), z(b[k]);
158
+ if (c === "prev" && x.length) {
159
+ const E = x.length - 1;
160
+ A(E), N(x[E]);
161
161
  }
162
- return B;
163
- }).catch(() => !1).finally(() => ne(!1));
162
+ return ge;
163
+ }).catch(() => !1).finally(() => oe(!1));
164
164
  };
165
- g(() => {
166
- !n || !o || (E(S(m({}, l), {
165
+ v(() => {
166
+ !i || !s || (M(p(f({}, o), {
167
167
  current: 1
168
168
  })).then((e) => {
169
169
  }), R());
170
- }, [o == null ? void 0 : o.id, n == null ? void 0 : n.id]), g(() => {
171
- if (Q.current === l.current) {
172
- Q.current = void 0, R();
170
+ }, [s == null ? void 0 : s.id, i == null ? void 0 : i.id]), v(() => {
171
+ if (Z.current === o.current) {
172
+ Z.current = void 0, R();
173
173
  return;
174
174
  }
175
- E().then((e) => {
175
+ M().then((e) => {
176
176
  }), R();
177
- }, [l.current]), g(() => {
178
- E(S(m({}, l), {
177
+ }, [o.current]), v(() => {
178
+ M(p(f({}, o), {
179
179
  current: 1,
180
180
  total: void 0
181
181
  })).then((e) => {
182
182
  });
183
183
  }, [L]);
184
184
  const qe = () => {
185
- if (!f)
185
+ if (!h)
186
186
  return;
187
- const e = N + 1;
188
- if (e >= f.length)
189
- l.total && e >= l.total ? Y.error("已经是最后一个了") : C({
190
- current: l.current + 1,
191
- pageSize: l.pageSize,
187
+ const e = z + 1;
188
+ if (e >= h.length)
189
+ o.total && e >= o.total ? ee.error("已经是最后一个了") : I({
190
+ current: o.current + 1,
191
+ pageSize: o.pageSize,
192
192
  type: "next"
193
193
  });
194
194
  else {
195
195
  A(e);
196
- const t = f[e];
197
- z(t);
196
+ const t = h[e];
197
+ N(t);
198
198
  }
199
199
  }, Ke = () => {
200
- if (!f)
200
+ if (!h)
201
201
  return;
202
- const e = N - 1;
202
+ const e = z - 1;
203
203
  if (e < 0)
204
- e < 0 ? Y.error("已经是第一个了") : C({
205
- current: l.current - 1,
206
- pageSize: l.pageSize,
204
+ e < 0 ? ee.error("已经是第一个了") : I({
205
+ current: o.current - 1,
206
+ pageSize: o.pageSize,
207
207
  type: "prev"
208
208
  });
209
209
  else {
210
210
  A(e);
211
- const t = f[e];
212
- z(t);
211
+ const t = h[e];
212
+ N(t);
213
213
  }
214
214
  }, Ze = [{
215
215
  key: "",
216
- label: `全部(${W})`,
216
+ label: `全部(${G})`,
217
217
  children: null
218
218
  }, {
219
219
  key: "nocode",
220
- label: `未标注(${se})`,
220
+ label: `未标注(${ce})`,
221
221
  children: null
222
222
  }, {
223
223
  key: "hascode",
224
- label: `已标注(${W - se})`,
224
+ label: `已标注(${G - ce})`,
225
225
  children: null
226
226
  }];
227
- g(() => {
228
- !D || !(y != null && y.id) || N < 0 || (_.current = {
227
+ v(() => {
228
+ !D || !(y != null && y.id) || z < 0 || (C.current = {
229
229
  id: y.id,
230
- index: N,
231
- page: l.current || 1
230
+ index: z,
231
+ page: o.current || 1
232
232
  });
233
- }, [D, y == null ? void 0 : y.id, N]);
233
+ }, [D, y == null ? void 0 : y.id, z]);
234
234
  const _e = (e) => {
235
- if (!f.some((i) => i.id === e.id))
235
+ if (!h.some((r) => r.id === e.id))
236
236
  return;
237
- const t = vt(e, o == null ? void 0 : o.vlmMarkTmpl), c = L === "nocode" && t || L === "hascode" && !t;
238
- oe((i) => {
239
- const u = i.findIndex((p) => p.id === e.id);
240
- if (u === -1)
241
- return i;
242
- if (!c) {
243
- const p = [...i];
244
- return p[u] = m(m({}, p[u]), e), p;
237
+ const t = St(e, s == null ? void 0 : s.vlmMarkTmpl), l = L === "nocode" && t || L === "hascode" && !t;
238
+ J((r) => {
239
+ const m = r.findIndex((c) => c.id === e.id);
240
+ if (m === -1)
241
+ return r;
242
+ if (!l) {
243
+ const c = [...r];
244
+ return c[m] = f(f({}, c[m]), e), c;
245
245
  }
246
- return [...i.slice(0, u), ...i.slice(u + 1)];
247
- }), c && C((i) => S(m({}, i), {
248
- total: i.total != null ? Math.max(0, i.total - 1) : i.total
246
+ return [...r.slice(0, m), ...r.slice(m + 1)];
247
+ }), l && I((r) => p(f({}, r), {
248
+ total: r.total != null ? Math.max(0, r.total - 1) : r.total
249
249
  }));
250
250
  }, Oe = (e) => {
251
- const t = l.pageSize || 100;
252
- e.page <= 1 || E(S(m({}, l), {
251
+ var m;
252
+ if (R(), !e) {
253
+ M(p(f({}, o), {
254
+ current: 1
255
+ }));
256
+ return;
257
+ }
258
+ const t = h.findIndex((c) => c.id === e);
259
+ if (t === -1) {
260
+ I((c) => p(f({}, c), {
261
+ total: c.total != null ? Math.max(0, c.total - 1) : c.total
262
+ }));
263
+ return;
264
+ }
265
+ const l = [...h.slice(0, t), ...h.slice(t + 1)], r = o.total != null ? Math.max(0, o.total - 1) : l.length;
266
+ if (l.length === 0 && r > 0) {
267
+ M(p(f({}, o), {
268
+ current: 1
269
+ }));
270
+ return;
271
+ }
272
+ if (J(l), I((c) => p(f({}, c), {
273
+ total: c.total != null ? Math.max(0, c.total - 1) : c.total
274
+ })), ((m = C.current) == null ? void 0 : m.id) === e)
275
+ if (l.length > 0) {
276
+ const c = Math.min(t, l.length - 1);
277
+ C.current = {
278
+ id: l[c].id,
279
+ index: c,
280
+ page: C.current.page || o.current || 1
281
+ };
282
+ } else
283
+ C.current = void 0;
284
+ }, $e = (e) => {
285
+ const t = o.pageSize || 100;
286
+ e.page <= 1 || (o.current !== 1 && (Z.current = 1), M(p(f({}, o), {
253
287
  current: 1,
254
288
  pageSize: e.page * t,
255
289
  total: void 0
256
- })).then((c) => {
257
- Array.isArray(c) && (Q.current = e.page, C((i) => S(m({}, i), {
290
+ }), void 0, {
291
+ skipScrollToTop: !0
292
+ }).then((l) => {
293
+ Array.isArray(l) && (Z.current = e.page, I((r) => p(f({}, r), {
258
294
  current: e.page,
259
295
  pageSize: t
260
296
  })), requestAnimationFrame(() => {
261
- Se(be(U.current), e.id, e.index);
297
+ be(Ie(U.current), e.id, e.index);
262
298
  }));
263
- });
299
+ }));
264
300
  };
265
- g(() => {
301
+ v(() => {
266
302
  let e;
267
303
  if (!D) {
268
- const t = _.current;
269
- _.current = void 0, z(void 0), A(-1), le(void 0), Z("preview"), t && (e = requestAnimationFrame(() => {
270
- Se(be(U.current), t.id, t.index) || Oe(t);
304
+ const t = C.current;
305
+ C.current = void 0, N(void 0), A(-1), se(void 0), K("preview"), t && (e = requestAnimationFrame(() => {
306
+ be(Ie(U.current), t.id, t.index) || $e(t);
271
307
  }));
272
308
  }
273
309
  return () => {
274
310
  e !== void 0 && cancelAnimationFrame(e);
275
311
  };
276
- }, [D]), g(() => {
277
- o && o.markType !== "vlm" && console.error(`当前数据集不是vlm类型,请检查数据集类型。
312
+ }, [D]), v(() => {
313
+ s && s.markType !== "vlm" && console.error(`当前数据集不是vlm类型,请检查数据集类型。
278
314
  请检查markType是否为vlm。`);
279
- }, [o]);
280
- const he = () => {
315
+ }, [s]);
316
+ const pe = () => {
281
317
  var e, t;
282
318
  (t = (e = U.current) == null ? void 0 : e.getElementsByClassName("rc-virtual-list-holder")[0]) == null || t.scrollTo({
283
319
  top: 0
284
320
  });
285
- }, $e = (e) => {
286
- var b, B;
321
+ }, je = (e) => {
287
322
  const {
288
323
  scrollTop: t,
289
- scrollHeight: c,
290
- clientHeight: i
291
- } = e.currentTarget, u = c - t - i, p = 3, M = (b = l.pageSize) != null ? b : 100, w = (B = l.current) != null ? B : 0;
292
- w >= 1 && f.length > 0 && f.length < w * M || (!l.total || l.total > f.length) && u <= p && C((k) => {
293
- var pe;
294
- return S(m({}, k), {
295
- current: ((pe = k.current) != null ? pe : 0) + 1
324
+ scrollHeight: l,
325
+ clientHeight: r
326
+ } = e.currentTarget, m = l - t - r, c = 3;
327
+ ie || (!o.total || o.total > h.length) && m <= c && I((k) => {
328
+ var _;
329
+ return p(f({}, k), {
330
+ current: ((_ = k.current) != null ? _ : 0) + 1
296
331
  });
297
332
  });
298
333
  };
299
- return /* @__PURE__ */ s(et, {
300
- locale: ot,
301
- children: /* @__PURE__ */ s(ut.Provider, {
334
+ return /* @__PURE__ */ a(tt, {
335
+ locale: lt,
336
+ children: /* @__PURE__ */ a(mt.Provider, {
302
337
  value: {
303
- datasetId: r,
304
- versionId: (n == null ? void 0 : n.id) || "",
305
- no: (n == null ? void 0 : n.no) || "",
306
- loading: re,
307
- version: n,
308
- versions: P,
309
- samples: f,
310
- pagination: l,
311
- services: a,
338
+ datasetId: n,
339
+ versionId: (i == null ? void 0 : i.id) || "",
340
+ no: (i == null ? void 0 : i.no) || "",
341
+ loading: ne,
342
+ version: i,
343
+ versions: B,
344
+ samples: h,
345
+ pagination: o,
346
+ services: d,
312
347
  token: Le,
313
- getToken: Te,
314
- apiUrl: Ve,
348
+ getToken: Ve,
349
+ apiUrl: Te,
315
350
  featuresConfig: {
316
351
  labelManager: ye,
317
- datasetManager: I,
318
- annotation: ke,
319
- filterSwitch: X,
320
- header: h,
321
- exampleSrcRoot: Ce
352
+ datasetManager: b,
353
+ annotation: Ce,
354
+ filterSwitch: Y,
355
+ header: g,
356
+ exampleSrcRoot: xe
322
357
  }
323
358
  },
324
- children: o ? o.markType === "vlm" ? /* @__PURE__ */ V("div", {
359
+ children: s ? s.markType === "vlm" ? /* @__PURE__ */ T("div", {
325
360
  className: "vlm-version-detail",
326
- children: [/* @__PURE__ */ V(at, {
361
+ children: [/* @__PURE__ */ T(dt, {
327
362
  className: "product-details-page",
328
- header: h === !1 ? void 0 : /* @__PURE__ */ s(ft, {
329
- backTo: Ie,
330
- onBackClick: h != null && h.onBackClick ? () => {
331
- h.onBackClick && h.onBackClick();
363
+ header: g === !1 ? void 0 : /* @__PURE__ */ a(ht, {
364
+ backTo: ke,
365
+ onBackClick: g != null && g.onBackClick ? () => {
366
+ g.onBackClick && g.onBackClick();
332
367
  } : void 0,
333
- left: !re && /* @__PURE__ */ V($, {
334
- children: [/* @__PURE__ */ s("span", {
368
+ left: !ne && /* @__PURE__ */ T(j, {
369
+ children: [/* @__PURE__ */ a("span", {
335
370
  style: {
336
371
  fontWeight: "bold"
337
372
  },
338
- children: o == null ? void 0 : o.name
339
- }), /* @__PURE__ */ s(tt, {
340
- disabled: (h == null ? void 0 : h.versionSelect) === !1,
341
- value: n == null ? void 0 : n.id,
373
+ children: s == null ? void 0 : s.name
374
+ }), /* @__PURE__ */ a(rt, {
375
+ disabled: (g == null ? void 0 : g.versionSelect) === !1,
376
+ value: i == null ? void 0 : i.id,
342
377
  style: {
343
378
  width: 70
344
379
  },
345
- options: P.map((e) => ({
380
+ options: B.map((e) => ({
346
381
  label: e.no,
347
382
  value: e.id
348
383
  })),
349
384
  onChange: (e) => {
350
- const t = P.find((i) => i.id === e);
351
- if (!o || !t)
385
+ const t = B.find((r) => r.id === e);
386
+ if (!s || !t)
352
387
  return;
353
- const c = P.find((i) => i.id === t.id);
354
- x(c), h != null && h.onVersionChange && h.onVersionChange(c);
388
+ const l = B.find((r) => r.id === t.id);
389
+ w(l), g != null && g.onVersionChange && g.onVersionChange(l);
355
390
  }
356
391
  })]
357
392
  }),
358
- right: /* @__PURE__ */ V($, {
359
- children: [!y && I && I.add && // <DisabledTooltip
393
+ right: /* @__PURE__ */ T(j, {
394
+ children: [!y && b && b.add && // <DisabledTooltip
360
395
  // isPreLabel={false}
361
396
  // placement="bottom"
362
397
  // >
363
- /* @__PURE__ */ s(ee, {
398
+ /* @__PURE__ */ a(te, {
364
399
  type: "default",
365
- onClick: () => J(!0),
366
- disabled: T === F.Pending || T === F.Started,
400
+ onClick: () => X(!0),
401
+ disabled: V === F.Pending || V === F.Started,
367
402
  children: "导入数据"
368
- }, "del"), /* @__PURE__ */ s(pt, {
403
+ }, "del"), /* @__PURE__ */ a(gt, {
369
404
  when: Ee,
370
405
  content: "确认要离开此页面吗?",
371
406
  subContent: "离开此页面后,将结束导入,放弃未上传的文件,请谨慎操作!"
372
- }), ae && /* @__PURE__ */ s(ht, {
373
- datasetIam: ze,
374
- datasetId: r,
375
- currentVersion: n,
376
- tenCode: o == null ? void 0 : o.tenantCode,
377
- markType: o.markType,
378
- vlmMarkTmpl: o == null ? void 0 : o.vlmMarkTmpl,
379
- isVisible: ae,
380
- setIsVisible: J,
407
+ }), de && /* @__PURE__ */ a(pt, {
408
+ datasetIam: Ne,
409
+ datasetId: n,
410
+ currentVersion: i,
411
+ tenCode: s == null ? void 0 : s.tenantCode,
412
+ markType: s.markType,
413
+ vlmMarkTmpl: s == null ? void 0 : s.vlmMarkTmpl,
414
+ isVisible: de,
415
+ setIsVisible: X,
381
416
  getVersionListRequest: R,
382
417
  setIsConfirm: Re,
383
418
  onUploadStatusChange: (e) => {
384
419
  Ae(e);
385
420
  },
386
421
  tableReload: () => {
387
- n != null && n.id && (he(), E(S(m({}, l), {
422
+ i != null && i.id && (pe(), M(p(f({}, o), {
388
423
  current: 1
389
424
  })));
390
425
  },
391
- loadVersionData: fe,
392
- vlmDwgImport: I && I.vlmDwgImport ? I.vlmDwgImport : !1
426
+ loadVersionData: he,
427
+ vlmDwgImport: b && b.vlmDwgImport ? b.vlmDwgImport : !1
393
428
  })]
394
429
  })
395
430
  }),
396
- children: [/* @__PURE__ */ V("div", {
431
+ children: [/* @__PURE__ */ T("div", {
397
432
  className: "vlm-header",
398
- children: [/* @__PURE__ */ s($, {
399
- children: X.tabs && /* @__PURE__ */ s(rt, {
433
+ children: [/* @__PURE__ */ a(j, {
434
+ children: Y.tabs && /* @__PURE__ */ a(nt, {
400
435
  className: "header-tab",
401
436
  activeKey: L,
402
437
  onChange: (e) => {
403
- C(S(m({}, l), {
438
+ I(p(f({}, o), {
404
439
  current: 1
405
440
  // total: 0,
406
- })), G(e);
441
+ })), Q(e);
407
442
  },
408
443
  items: Ze
409
444
  })
410
- }), /* @__PURE__ */ s($, {
411
- children: I && I.label && /* @__PURE__ */ s(ee, {
445
+ }), /* @__PURE__ */ a(j, {
446
+ children: b && b.label && /* @__PURE__ */ a(te, {
412
447
  type: "primary",
413
- disabled: !W,
448
+ disabled: !G,
414
449
  onClick: Be,
415
450
  style: {
416
451
  marginRight: "10px"
@@ -418,57 +453,57 @@ const Ut = (v) => {
418
453
  children: "标注"
419
454
  })
420
455
  })]
421
- }), /* @__PURE__ */ s("div", {
456
+ }), /* @__PURE__ */ a("div", {
422
457
  className: "d-row",
423
- children: /* @__PURE__ */ s("div", {
458
+ children: /* @__PURE__ */ a("div", {
424
459
  className: "d-right",
425
460
  ref: U,
426
- children: l.total !== void 0 && l.total > 0 ? /* @__PURE__ */ s(Xe, {
427
- children: /* @__PURE__ */ s(ct, {
461
+ children: o.total !== void 0 && o.total > 0 ? /* @__PURE__ */ a(Ye, {
462
+ children: /* @__PURE__ */ a(at, {
428
463
  innerProps: {
429
464
  className: "d-right-row"
430
465
  },
431
- data: f,
466
+ data: h,
432
467
  itemKey: "id",
433
468
  height: Math.max(He, 1),
434
- onScroll: $e,
435
- children: (e, t) => /* @__PURE__ */ s(nt, {
469
+ onScroll: je,
470
+ children: (e, t) => /* @__PURE__ */ a(it, {
436
471
  className: "d-right-col",
437
472
  "data-sample-id": e.id,
438
473
  onClick: () => Pe(t),
439
- children: /* @__PURE__ */ V("div", {
474
+ children: /* @__PURE__ */ T("div", {
440
475
  className: "right-col-wrapper",
441
- children: [/* @__PURE__ */ s("div", {
476
+ children: [/* @__PURE__ */ a("div", {
442
477
  className: "right-col-img",
443
- children: /* @__PURE__ */ s(dt, {
478
+ children: /* @__PURE__ */ a(ut, {
444
479
  fileKey: e.fileKey,
445
480
  width: 124,
446
481
  thumbnailUrl: e.thumbnailUrl
447
482
  })
448
- }), /* @__PURE__ */ s("div", {
483
+ }), /* @__PURE__ */ a("div", {
449
484
  className: "right-col-text",
450
- children: /* @__PURE__ */ s("div", {
485
+ children: /* @__PURE__ */ a("div", {
451
486
  children: t + 1
452
487
  })
453
488
  })]
454
489
  })
455
490
  }, e.id)
456
491
  })
457
- }) : /* @__PURE__ */ s("div", {
492
+ }) : /* @__PURE__ */ a("div", {
458
493
  className: "empty",
459
- children: l.total === 0 ? /* @__PURE__ */ s(it, {
460
- image: gt,
461
- description: /* @__PURE__ */ V("span", {
462
- children: ["暂无数据", L !== "hascode" && /* @__PURE__ */ s("span", {
463
- children: I && I.add && /* @__PURE__ */ V(ee, {
494
+ children: o.total === 0 ? /* @__PURE__ */ a(ot, {
495
+ image: vt,
496
+ description: /* @__PURE__ */ T("span", {
497
+ children: ["暂无数据", L !== "hascode" && /* @__PURE__ */ a("span", {
498
+ children: b && b.add && /* @__PURE__ */ T(te, {
464
499
  type: "link",
465
500
  size: "small",
466
501
  style: {
467
502
  padding: 0
468
503
  },
469
- onClick: () => J(!0),
470
- disabled: T === F.Pending || T === F.Started,
471
- children: [/* @__PURE__ */ s("span", {
504
+ onClick: () => X(!0),
505
+ disabled: V === F.Pending || V === F.Started,
506
+ children: [/* @__PURE__ */ a("span", {
472
507
  style: {
473
508
  color: "black"
474
509
  },
@@ -481,47 +516,45 @@ const Ut = (v) => {
481
516
  })
482
517
  })
483
518
  })]
484
- }), D && /* @__PURE__ */ s(lt, {
485
- vlmMarkTmpl: o == null ? void 0 : o.vlmMarkTmpl,
519
+ }), D && /* @__PURE__ */ a(st, {
520
+ vlmMarkTmpl: s == null ? void 0 : s.vlmMarkTmpl,
486
521
  isVlmModalVisible: D,
487
- setIsVlmModalVisible: K,
522
+ setIsVlmModalVisible: q,
488
523
  record: y,
489
524
  onNextClick: () => qe(),
490
525
  onPrevClick: () => Ke(),
491
- listLoading: Me,
492
- ocrMarkTmpl: o == null ? void 0 : o.ocrMarkTmpl,
493
- datasetId: r,
494
- versionId: n == null ? void 0 : n.id,
495
- initialMode: we,
526
+ listLoading: ie,
527
+ ocrMarkTmpl: s == null ? void 0 : s.ocrMarkTmpl,
528
+ datasetId: n,
529
+ versionId: i == null ? void 0 : i.id,
530
+ initialMode: Me,
496
531
  filterMode: L,
497
532
  onFilterModeChange: (e) => {
498
- G(e);
533
+ Q(e);
499
534
  },
500
535
  onCurrentSampleChange: (e) => {
501
- _.current = e;
536
+ C.current = e;
502
537
  },
503
- samples: f,
504
- pagination: l,
505
- currentIndex: N,
538
+ samples: h,
539
+ pagination: o,
540
+ currentIndex: z,
506
541
  handleMarkClick: (e) => {
507
- le(e), Z("annotation");
542
+ se(e), K("annotation");
508
543
  },
509
- updateSampleList: () => {
510
- E(S(m({}, l), {
511
- current: 1
512
- })), R();
544
+ updateSampleList: (e) => {
545
+ Oe(e);
513
546
  },
514
- selectSampleId: xe,
547
+ selectSampleId: we,
515
548
  onClose: () => {
516
- R(), K(!1);
549
+ R(), q(!1);
517
550
  },
518
551
  onSave: (e) => {
519
- if (!r || !n)
552
+ if (!n || !i)
520
553
  throw "datasetId or version is not exist.";
521
- return a.cvforceDatahub.updateSamples(r, n.id, [m({}, e)]).then(() => (_e(e), !0));
554
+ return d.cvforceDatahub.updateSamples(n, i.id, [f({}, e)]).then(() => (_e(e), !0));
522
555
  }
523
556
  })]
524
- }) : /* @__PURE__ */ s("div", {
557
+ }) : /* @__PURE__ */ a("div", {
525
558
  style: {
526
559
  color: "red",
527
560
  textAlign: "center"
@@ -532,5 +565,5 @@ const Ut = (v) => {
532
565
  });
533
566
  };
534
567
  export {
535
- Ut as default
568
+ Bt as default
536
569
  };