@glodon-aiot/dataset-annotation 3.24.0-alpha.6 → 3.25.0-alpha.8

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.
Files changed (24) hide show
  1. package/dist/es/components/ClassificationAnnotation/index.mjs +399 -343
  2. package/dist/es/components/DetectionAnnotation/components/ImageDetail/index.mjs +82 -78
  3. package/dist/es/components/DetectionAnnotation/components/ImageModal/index.mjs +28 -26
  4. package/dist/es/components/DetectionAnnotation/components/LabelMaker/index.mjs +173 -166
  5. package/dist/es/components/DetectionAnnotation/index.mjs +478 -473
  6. package/dist/es/components/OcrAnnotation/OCRBoxDetail/index.mjs +249 -230
  7. package/dist/es/components/OcrAnnotation/OcrModal/index.mjs +103 -98
  8. package/dist/es/components/OcrAnnotation/index.mjs +281 -243
  9. package/dist/es/components/VLMAnnotationDetail/VLMDetail/index.mjs +277 -272
  10. package/dist/es/components/VLMAnnotationDetail/VlmModal/index.mjs +42 -40
  11. package/dist/es/components/VLMAnnotationDetail/index.mjs +331 -278
  12. package/dist/es/index.mjs +1 -1
  13. package/dist/es/utils/checkVlmSampleLabeled.mjs +7 -0
  14. package/dist/es/utils/scrollSampleIntoView.mjs +16 -0
  15. package/dist/lib/index.js +4 -4
  16. package/dist/src/components/DetectionAnnotation/components/ImageDetail/index.d.ts +2 -0
  17. package/dist/src/components/DetectionAnnotation/components/ImageModal/index.d.ts +2 -0
  18. package/dist/src/components/OcrAnnotation/OCRBoxDetail/index.d.ts +2 -0
  19. package/dist/src/components/OcrAnnotation/OcrModal/index.d.ts +1 -0
  20. package/dist/src/components/VLMAnnotationDetail/VLMDetail/index.d.ts +6 -0
  21. package/dist/src/components/VLMAnnotationDetail/VlmModal/index.d.ts +5 -0
  22. package/dist/src/utils/checkVlmSampleLabeled.d.ts +8 -0
  23. package/dist/src/utils/scrollSampleIntoView.d.ts +9 -0
  24. package/package.json +2 -2
@@ -1,98 +1,99 @@
1
- var ze = Object.defineProperty, Ke = Object.defineProperties;
2
- var Ae = Object.getOwnPropertyDescriptors;
3
- var de = Object.getOwnPropertySymbols;
4
- var Be = Object.prototype.hasOwnProperty, Ee = Object.prototype.propertyIsEnumerable;
5
- var ue = (h, l, i) => l in h ? ze(h, l, { enumerable: !0, configurable: !0, writable: !0, value: i }) : h[l] = i, m = (h, l) => {
1
+ var Be = Object.defineProperty, Ee = Object.defineProperties;
2
+ var Ue = Object.getOwnPropertyDescriptors;
3
+ var he = Object.getOwnPropertySymbols;
4
+ var $e = Object.prototype.hasOwnProperty, Ze = Object.prototype.propertyIsEnumerable;
5
+ var pe = (b, l, i) => l in b ? Be(b, l, { enumerable: !0, configurable: !0, writable: !0, value: i }) : b[l] = i, m = (b, l) => {
6
6
  for (var i in l || (l = {}))
7
- Be.call(l, i) && ue(h, i, l[i]);
8
- if (de)
9
- for (var i of de(l))
10
- Ee.call(l, i) && ue(h, i, l[i]);
11
- return h;
12
- }, g = (h, l) => Ke(h, Ae(l));
13
- import { jsx as c, jsxs as M } from "react/jsx-runtime";
14
- import { useState as s, useEffect as x } from "react";
15
- import { message as K, ConfigProvider as Ue, Space as y, Select as Fe, Dropdown as $e, Tooltip as Ze, Button as Q, Tabs as je, Row as We, Col as _e, Pagination as He, Modal as Je } from "antd";
16
- import Qe from "antd/es/locale/zh_CN";
7
+ $e.call(l, i) && pe(b, i, l[i]);
8
+ if (he)
9
+ for (var i of he(l))
10
+ Ze.call(l, i) && pe(b, i, l[i]);
11
+ return b;
12
+ }, g = (b, l) => Ee(b, Ue(l));
13
+ import { jsx as c, jsxs as T } from "react/jsx-runtime";
14
+ import { useState as d, useRef as X, useEffect as C } from "react";
15
+ import { message as B, ConfigProvider as je, Space as w, Select as qe, Dropdown as We, Tooltip as _e, Button as Y, Tabs as He, Row as Je, Col as Qe, Pagination as Ge, Modal as Xe } from "antd";
16
+ import Ye from "antd/es/locale/zh_CN";
17
17
  import "./style.less.mjs";
18
- import qe from "./OcrModal/index.mjs";
19
- import Ge from "./MarkKVOCRModal/index.mjs";
20
- import Xe from "./MarkOCRBoxModal/index.mjs";
21
- import Ye from "./PreLabelOCR/index.mjs";
22
- import et from "lodash/merge";
23
- import { UploadZipsStatus as fe, PreLabelTaskStatus as tt } from "@glodon-aiot/apis";
24
- import nt from "../../Common/Page/index.mjs";
25
- import ot from "../Thumbnail/index.mjs";
26
- import rt from "../DataEmpty/index.mjs";
27
- import it from "../../DatasetContext/index.mjs";
28
- import { DEFAULT_FILTER_SWITCH as ct } from "../../constant.mjs";
29
- import lt from "../PageNav/index.mjs";
30
- import { DownOutlined as at } from "@ant-design/icons";
31
- import st from "../DetectionStatus/index.mjs";
32
- const Vt = (h) => {
18
+ import et from "./OcrModal/index.mjs";
19
+ import tt from "./MarkKVOCRModal/index.mjs";
20
+ import nt from "./MarkOCRBoxModal/index.mjs";
21
+ import rt from "./PreLabelOCR/index.mjs";
22
+ import ot from "lodash/merge";
23
+ import { UploadZipsStatus as ge, PreLabelTaskStatus as it } from "@glodon-aiot/apis";
24
+ import ct from "../../Common/Page/index.mjs";
25
+ import lt from "../Thumbnail/index.mjs";
26
+ import at from "../DataEmpty/index.mjs";
27
+ import st from "../../DatasetContext/index.mjs";
28
+ import { DEFAULT_FILTER_SWITCH as dt } from "../../constant.mjs";
29
+ import ut from "../PageNav/index.mjs";
30
+ import { DownOutlined as ft } from "@ant-design/icons";
31
+ import mt from "../DetectionStatus/index.mjs";
32
+ import { scrollSampleIntoView as ht } from "../../utils/scrollSampleIntoView.mjs";
33
+ const At = (b) => {
33
34
  const {
34
35
  services: l,
35
36
  datasetId: i,
36
- versionId: A,
37
- backTo: pe,
38
- labelManager: me = !1,
39
- datasetManager: D = !1,
40
- annotation: he,
37
+ versionId: E,
38
+ backTo: be,
39
+ labelManager: Ce = !1,
40
+ datasetManager: v = !1,
41
+ annotation: ke,
41
42
  header: p = {
42
43
  versionSelect: !1
43
44
  },
44
- exampleSrcRoot: ge
45
- } = h, B = !!(D && D.label), [r, be] = s(), [t, E] = s(), [v, Ce] = s([]), [q, G] = s(!1), [L, V] = s(!1), [T, X] = s(0), [u, P] = s(), [k, b] = s(), [Y, O] = s(), [U, I] = s(-1), [a, S] = s({
45
+ exampleSrcRoot: Se
46
+ } = b, U = !!(v && v.label), [o, xe] = d(), [t, $] = d(), [V, Me] = d([]), [ee, te] = d(!1), [M, L] = d(!1), [I, ne] = d(0), [u, P] = d(), [h, k] = d(), [re, O] = d(), [Z, y] = d(-1), oe = X(null), N = X(void 0), D = X(!1), [f, S] = d({
46
47
  current: 1,
47
48
  pageSize: 50
48
- }), [R, ee] = s(0), [te, ne] = s(0), [C, F] = s(""), [oe, $] = s(!1), [re, ie] = s(), [Z, ce] = s(!1), [N, j] = s(null), [ke, le] = s(!1), [Se, xe] = s(!1), [W, Me] = s(""), [_, z] = s("preview"), H = m({}, ct);
49
- et(H, h.filterSwitch);
50
- const Te = () => {
51
- O(void 0), (r == null ? void 0 : r.ocrMarkTmpl) === "StructKVCOCR" ? $(!0) : (z("annotation"), V(!0), F("nocode"));
52
- }, Ie = (e, n) => {
49
+ }), [z, ie] = d(0), [A, ce] = d(0), [x, j] = d(""), [le, q] = d(!1), [ae, se] = d(), [W, de] = d(!1), [K, _] = d(null), [Te, ue] = d(!1), [Ie, ye] = d(!1), [H, De] = d(""), [J, F] = d("preview"), Q = m({}, dt);
50
+ ot(Q, b.filterSwitch);
51
+ const we = () => {
52
+ O(void 0), (o == null ? void 0 : o.ocrMarkTmpl) === "StructKVCOCR" ? q(!0) : (F("annotation"), L(!0), j("nocode"));
53
+ }, ve = (e, n) => {
53
54
  S({
54
55
  current: e,
55
56
  pageSize: n
56
57
  });
57
- }, ye = (e) => {
58
+ }, Re = (e) => {
58
59
  if (!u)
59
60
  return;
60
- I(e);
61
+ y(e);
61
62
  const n = u[e];
62
- b(n), z("preview"), V(!0);
63
+ k(n), F("preview"), L(!0);
63
64
  };
64
- x(() => {
65
- i && (G(!0), Promise.all([
65
+ C(() => {
66
+ i && (te(!0), Promise.all([
66
67
  // 数据集
67
68
  l.cvforceDatahub.getDatasetsId(i).then((e) => {
68
- be(e);
69
+ xe(e);
69
70
  }),
70
71
  // 版本列表
71
72
  l.cvforceDatahub.getDatasetsIdVersions(i, 1, 1e3).then((e) => {
72
- Ce(e.recordList), E(A ? e.recordList.find((n) => n.id === A) : e.recordList[0]);
73
+ Me(e.recordList), $(E ? e.recordList.find((n) => n.id === E) : e.recordList[0]);
73
74
  })
74
- ]).finally(() => G(!1)));
75
- }, [i, A]);
76
- const De = () => {
75
+ ]).finally(() => te(!1)));
76
+ }, [i, E]);
77
+ const Ve = () => {
77
78
  !i || !t || l.cvforceDatahub.getDatasetsIdVersionsVid(i, t.id).then((e) => {
78
- Me(e.versionAsyncTask.state);
79
+ De(e.versionAsyncTask.state);
79
80
  });
80
81
  };
81
- x(() => {
82
- De();
83
- }, [i, t == null ? void 0 : t.id]), x(() => {
84
- W !== fe.Pending && W !== fe.Started || K.warning("文件导入中,请刷新页面再试");
85
- }, [W]);
86
- const ae = () => {
82
+ C(() => {
83
+ Ve();
84
+ }, [i, t == null ? void 0 : t.id]), C(() => {
85
+ H !== ge.Pending && H !== ge.Started || B.warning("文件导入中,请刷新页面再试");
86
+ }, [H]);
87
+ const fe = () => {
87
88
  !i || !t || l.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(i, t.id, {
88
89
  label: "allcode",
89
90
  confirmStatus: 2
90
91
  }).then((e) => {
91
- const n = e.find((d) => d.id === "allcodeid"), o = e.find((d) => d.id === "nocodeid"), f = e.find((d) => d.id === "pendingid");
92
- X(n ? n.count : 0), ee(o ? o.count : 0), ne(f ? f.count : 0);
92
+ const n = e.find((s) => s.id === "allcodeid"), r = e.find((s) => s.id === "nocodeid"), a = e.find((s) => s.id === "pendingid");
93
+ ne(n ? n.count : 0), ie(r ? r.count : 0), ce(a ? a.count : 0);
93
94
  });
94
- }, we = () => {
95
- switch (C) {
95
+ }, Le = () => {
96
+ switch (x) {
96
97
  case "nocode":
97
98
  case "hascode":
98
99
  return 0;
@@ -101,8 +102,8 @@ const Vt = (h) => {
101
102
  default:
102
103
  return 2;
103
104
  }
104
- }, ve = () => {
105
- switch (C) {
105
+ }, Pe = () => {
106
+ switch (x) {
106
107
  case "nocode":
107
108
  return "nocode";
108
109
  case "pending":
@@ -112,198 +113,230 @@ const Vt = (h) => {
112
113
  default:
113
114
  return;
114
115
  }
115
- }, w = () => {
116
- const e = a.current || 1, n = a.pageSize || 50;
117
- !i || !t || (l.cvforceDatahub.getDatasetsIdVersionsVidSamples(i, t.id, {
118
- labels: ve(),
116
+ }, R = () => {
117
+ const e = f.current || 1, n = f.pageSize || 50;
118
+ if (!i || !t) {
119
+ D.current = !1;
120
+ return;
121
+ }
122
+ l.cvforceDatahub.getDatasetsIdVersionsVidSamples(i, t.id, {
123
+ labels: Pe(),
119
124
  pageNo: e,
120
125
  pageSize: n,
121
- confirmStatus: we()
122
- }).then((o) => {
123
- const f = o.recordList || [];
124
- if (!f.length && o.totalResults > 0) {
125
- S(g(m({}, a), {
126
- current: Math.ceil(o.totalResults / n)
127
- })), Math.ceil(o.totalResults / n) === e && P([]);
126
+ confirmStatus: Le()
127
+ }).then((r) => {
128
+ const a = r.recordList || [];
129
+ if (!a.length && r.totalResults > 0) {
130
+ S((s) => g(m({}, s), {
131
+ current: Math.ceil(r.totalResults / n)
132
+ })), Math.ceil(r.totalResults / n) === e && P([]);
128
133
  return;
129
134
  }
130
- if (P(f), S(g(m({}, a), {
131
- total: o.totalResults
132
- })), a.type === "next" && f.length) {
133
- I(0);
134
- const d = o.recordList[0];
135
- b(d);
135
+ if (P(a), S((s) => g(m({}, s), {
136
+ total: r.totalResults
137
+ })), f.type === "next" && a.length) {
138
+ y(0);
139
+ const s = r.recordList[0];
140
+ k(s);
136
141
  }
137
- if (a.type === "prev" && f.length) {
138
- I(a.pageSize - 1);
139
- const d = o.recordList[a.pageSize - 1];
140
- b(d);
142
+ if (f.type === "prev" && a.length) {
143
+ y(f.pageSize - 1);
144
+ const s = r.recordList[f.pageSize - 1];
145
+ k(s);
141
146
  }
142
- }), ae());
147
+ }).finally(() => {
148
+ D.current = !1;
149
+ }), fe();
143
150
  };
144
- x(w, [a.current, a.pageSize, C, re, t == null ? void 0 : t.id, i]);
145
- const Le = () => {
151
+ C(R, [f.current, f.pageSize, x, ae, t == null ? void 0 : t.id, i]);
152
+ const Oe = () => {
146
153
  if (!u)
147
154
  return;
148
- const e = U + 1;
155
+ const e = Z + 1;
149
156
  if (e >= u.length) {
150
- let n = T;
151
- C === "hascode" && (n = T - R), C === "nocode" && (n = R), C === "pending" && (n = te), (a.current - 1) * a.pageSize + e >= n ? K.error("已经是最后一个了") : S({
152
- current: a.current + 1,
153
- pageSize: a.pageSize,
154
- type: "next"
155
- });
157
+ let n = I;
158
+ if (x === "hascode" && (n = I - z - A), x === "nocode" && (n = z), x === "pending" && (n = A), (f.current - 1) * f.pageSize + e >= n)
159
+ B.error("已经是最后一个了");
160
+ else {
161
+ if (D.current)
162
+ return;
163
+ D.current = !0, S((a) => g(m({}, a), {
164
+ current: a.current + 1,
165
+ type: "next"
166
+ }));
167
+ }
156
168
  } else {
157
- I(e);
169
+ y(e);
158
170
  const n = u[e];
159
- b(n);
171
+ k(n);
160
172
  }
161
- }, Ve = () => {
173
+ }, Ne = () => {
162
174
  if (!u)
163
175
  return;
164
- const e = U - 1;
176
+ const e = Z - 1;
165
177
  if (e < 0)
166
- (a.current - 1) * a.pageSize + e < 0 ? K.error("已经是第一个了") : S({
167
- current: a.current - 1,
168
- pageSize: a.pageSize,
169
- type: "prev"
170
- });
178
+ if ((f.current - 1) * f.pageSize + e < 0)
179
+ B.error("已经是第一个了");
180
+ else {
181
+ if (D.current)
182
+ return;
183
+ D.current = !0, S((r) => g(m({}, r), {
184
+ current: r.current - 1,
185
+ type: "prev"
186
+ }));
187
+ }
171
188
  else {
172
- I(e);
189
+ y(e);
173
190
  const n = u[e];
174
- b(n);
191
+ k(n);
175
192
  }
176
193
  };
177
- x(() => {
194
+ C(() => {
178
195
  if (!i) {
179
- N && (clearTimeout(N), j(null)), ie(void 0);
196
+ K && (clearTimeout(K), _(null)), se(void 0);
180
197
  return;
181
198
  }
182
- J();
183
- }, [t == null ? void 0 : t.id]), x(() => {
184
- J();
185
- }, [Se]);
186
- const J = () => {
199
+ G();
200
+ }, [t == null ? void 0 : t.id]), C(() => {
201
+ G();
202
+ }, [Ie]);
203
+ const G = () => {
187
204
  !i || !t || l.cvforceDatahub.getPreLabelTask(i, t.id).then((e) => {
188
205
  const n = e[0];
189
- if (ie(n), N && (clearTimeout(N), j(null)), !(n != null && n.state) || n.state !== tt.Started) {
190
- ce(!1);
206
+ if (se(n), K && (clearTimeout(K), _(null)), !(n != null && n.state) || n.state !== it.Started) {
207
+ de(!1);
191
208
  return;
192
209
  } else
193
- ce(!0);
194
- j(setTimeout(() => {
195
- J();
210
+ de(!0);
211
+ _(setTimeout(() => {
212
+ G();
196
213
  }, 1e4));
197
214
  });
198
- }, Pe = [{
215
+ }, ze = [{
199
216
  key: "",
200
- label: `全部(${T})`,
217
+ label: `全部(${I})`,
201
218
  children: null
202
219
  }, {
203
220
  key: "nocode",
204
- label: `未标注(${R})`,
221
+ label: `未标注(${z})`,
205
222
  children: null
206
223
  }, {
207
224
  key: "pending",
208
- label: `待确认(${te})`,
225
+ label: `待确认(${A})`,
209
226
  children: null
210
227
  }, {
211
228
  key: "hascode",
212
- label: `已标注(${T - R})`,
229
+ label: `已标注(${I - z - A})`,
213
230
  children: null
214
231
  }];
215
- x(() => {
216
- L || ((r == null ? void 0 : r.ocrMarkTmpl) === "StructKVCOCR" ? b(void 0) : (_ === "annotation" && w(), b(void 0), I(-1), O(void 0), z("preview")));
217
- }, [L, _]), x(() => {
218
- r && (r.markType !== "ocr" || (r == null ? void 0 : r.ocrMarkTmpl) !== "DetectionOCR") && console.error(`当前数据集不是DetectionOCR(ocr检测)类型,请检查数据集类型。
232
+ C(() => {
233
+ !M || !(h != null && h.id) || (N.current = h.id);
234
+ }, [M, h == null ? void 0 : h.id]), C(() => {
235
+ const e = N.current;
236
+ if (M || !e || !(u != null && u.length))
237
+ return;
238
+ const n = requestAnimationFrame(() => {
239
+ var a;
240
+ ht((a = oe.current) == null ? void 0 : a.querySelector(".d-right"), e) && (N.current = void 0);
241
+ });
242
+ return () => cancelAnimationFrame(n);
243
+ }, [M, u]), C(() => {
244
+ M || (S((e) => e.type ? m({
245
+ current: e.current,
246
+ pageSize: e.pageSize
247
+ }, e.total !== void 0 ? {
248
+ total: e.total
249
+ } : {}) : e), (o == null ? void 0 : o.ocrMarkTmpl) === "StructKVCOCR" ? k(void 0) : (J === "annotation" && R(), k(void 0), y(-1), O(void 0), F("preview")));
250
+ }, [M, J]), C(() => {
251
+ o && (o.markType !== "ocr" || (o == null ? void 0 : o.ocrMarkTmpl) !== "DetectionOCR") && console.error(`当前数据集不是DetectionOCR(ocr检测)类型,请检查数据集类型。
219
252
  请检查markType是否为ocr并且ocrMarkTmpl为DetectionOCR。`);
220
- }, [r]);
221
- const Oe = (r == null ? void 0 : r.ocrMarkTmpl) === "StructKVCOCR" ? Ge : Xe, Re = () => {
253
+ }, [o]);
254
+ const Ae = (o == null ? void 0 : o.ocrMarkTmpl) === "StructKVCOCR" ? tt : nt, Ke = () => {
222
255
  if (console.log("一键确认", l, t), !(l != null && l.cvforceDatahub) || !(t != null && t.id))
223
256
  return Promise.resolve(!1);
224
- Je.confirm({
257
+ Xe.confirm({
225
258
  title: "一键保存所有标注?",
226
259
  content: "待确认的所有带预标注信息的图片将保存至已标注页签下",
227
260
  onOk: () => {
228
261
  l.cvforceDatahub.getAllConfirmSamples(i, t.id).then((e) => {
229
- K.success("保存成功"), S(g(m({}, a), {
262
+ B.success("保存成功"), S(g(m({}, f), {
230
263
  current: 1
231
- })), ae(), w();
264
+ })), fe(), R();
232
265
  });
233
266
  }
234
267
  });
235
- }, se = !k && !!(D && D.preLabel) && !!(t != null && t.id), Ne = B || se;
236
- return /* @__PURE__ */ c(Ue, {
237
- locale: Qe,
238
- children: /* @__PURE__ */ c(it.Provider, {
268
+ }, me = !h && !!(v && v.preLabel) && !!(t != null && t.id), Fe = U || me;
269
+ return /* @__PURE__ */ c(je, {
270
+ locale: Ye,
271
+ children: /* @__PURE__ */ c(st.Provider, {
239
272
  value: {
240
273
  datasetId: i,
241
274
  versionId: (t == null ? void 0 : t.id) || "",
242
275
  no: (t == null ? void 0 : t.no) || "",
243
- loading: q,
276
+ loading: ee,
244
277
  version: t,
245
- versions: v,
278
+ versions: V,
246
279
  samples: u,
247
- pagination: a,
280
+ pagination: f,
248
281
  services: l,
249
282
  featuresConfig: {
250
- labelManager: me,
251
- datasetManager: D,
252
- annotation: he,
253
- filterSwitch: H,
283
+ labelManager: Ce,
284
+ datasetManager: v,
285
+ annotation: ke,
286
+ filterSwitch: Q,
254
287
  header: p,
255
- exampleSrcRoot: ge
288
+ exampleSrcRoot: Se
256
289
  }
257
290
  },
258
- children: r ? r.markType === "ocr" ? /* @__PURE__ */ M("div", {
291
+ children: o ? o.markType === "ocr" ? /* @__PURE__ */ T("div", {
259
292
  className: "ocr-version-detail",
260
- children: [/* @__PURE__ */ M(nt, {
293
+ children: [/* @__PURE__ */ T(ct, {
261
294
  className: "product-details-page",
262
- header: p === !1 ? void 0 : /* @__PURE__ */ c(lt, {
263
- backTo: pe,
295
+ header: p === !1 ? void 0 : /* @__PURE__ */ c(ut, {
296
+ backTo: be,
264
297
  onBackClick: p != null && p.onBackClick ? () => {
265
298
  p.onBackClick && p.onBackClick();
266
299
  } : void 0,
267
- left: !q && /* @__PURE__ */ M(y, {
300
+ left: !ee && /* @__PURE__ */ T(w, {
268
301
  children: [/* @__PURE__ */ c("span", {
269
302
  style: {
270
303
  fontWeight: "bold"
271
304
  },
272
- children: r == null ? void 0 : r.name
273
- }), /* @__PURE__ */ c(Fe, {
305
+ children: o == null ? void 0 : o.name
306
+ }), /* @__PURE__ */ c(qe, {
274
307
  disabled: (p == null ? void 0 : p.versionSelect) === !1,
275
308
  value: t == null ? void 0 : t.id,
276
309
  style: {
277
310
  width: 70
278
311
  },
279
- options: v.map((e) => ({
312
+ options: V.map((e) => ({
280
313
  label: e.no,
281
314
  value: e.id
282
315
  })),
283
316
  onChange: (e) => {
284
- const n = v.find((f) => f.id === e);
285
- if (!r || !n)
317
+ const n = V.find((a) => a.id === e);
318
+ if (!o || !n)
286
319
  return;
287
- const o = v.find((f) => f.id === n.id);
288
- E(o), p != null && p.onVersionChange && p.onVersionChange(o);
320
+ const r = V.find((a) => a.id === n.id);
321
+ $(r), p != null && p.onVersionChange && p.onVersionChange(r);
289
322
  }
290
323
  })]
291
324
  }),
292
- right: /* @__PURE__ */ c(y, {
293
- children: Ne && /* @__PURE__ */ c($e, {
325
+ right: /* @__PURE__ */ c(w, {
326
+ children: Fe && /* @__PURE__ */ c(We, {
294
327
  menu: {
295
- items: [...B ? [{
328
+ items: [...U ? [{
296
329
  key: "manual",
297
- label: /* @__PURE__ */ c(y, {
298
- children: /* @__PURE__ */ c(Ze, {
330
+ label: /* @__PURE__ */ c(w, {
331
+ children: /* @__PURE__ */ c(_e, {
299
332
  title: "预标注进行中,请任务完成后再试",
300
- open: ke,
301
- children: /* @__PURE__ */ c(Q, {
333
+ open: Te,
334
+ children: /* @__PURE__ */ c(Y, {
302
335
  type: "text",
303
- disabled: !T || (r == null ? void 0 : r.ocrMarkTmpl) !== "StructKVCOCR" && (r == null ? void 0 : r.ocrMarkTmpl) !== "DetectionOCR" || Z,
304
- onClick: Te,
305
- onMouseEnter: () => Z && le(!0),
306
- onMouseLeave: () => le(!1),
336
+ disabled: !I || (o == null ? void 0 : o.ocrMarkTmpl) !== "StructKVCOCR" && (o == null ? void 0 : o.ocrMarkTmpl) !== "DetectionOCR" || W,
337
+ onClick: we,
338
+ onMouseEnter: () => W && ue(!0),
339
+ onMouseLeave: () => ue(!1),
307
340
  style: {
308
341
  marginRight: "10px"
309
342
  },
@@ -311,71 +344,73 @@ const Vt = (h) => {
311
344
  })
312
345
  })
313
346
  })
314
- }] : [], se ? {
347
+ }] : [], me ? {
315
348
  key: "auto",
316
- label: /* @__PURE__ */ c(Ye, {
349
+ label: /* @__PURE__ */ c(rt, {
317
350
  buttonType: "text",
318
351
  datasetId: i,
319
352
  versionId: (t == null ? void 0 : t.id) || "",
320
- disabled: !T || (r == null ? void 0 : r.ocrMarkTmpl) !== "DetectionOCR",
321
- setIsTaskChange: xe,
322
- preLabelTask: re,
353
+ disabled: !I || (o == null ? void 0 : o.ocrMarkTmpl) !== "DetectionOCR",
354
+ setIsTaskChange: ye,
355
+ preLabelTask: ae,
323
356
  datasetType: "ocr"
324
357
  })
325
358
  } : null]
326
359
  },
327
360
  placement: "bottom",
328
- children: /* @__PURE__ */ M(Q, {
361
+ children: /* @__PURE__ */ T(Y, {
329
362
  type: "primary",
330
- children: ["开始标注", /* @__PURE__ */ c(at, {})]
363
+ children: ["开始标注", /* @__PURE__ */ c(ft, {})]
331
364
  })
332
365
  })
333
366
  })
334
367
  }),
335
- children: [/* @__PURE__ */ M("div", {
368
+ children: [/* @__PURE__ */ T("div", {
336
369
  className: "ocr-header",
337
- children: [/* @__PURE__ */ c(y, {
338
- children: H.tabs && /* @__PURE__ */ c(je, {
370
+ children: [/* @__PURE__ */ c(w, {
371
+ children: Q.tabs && /* @__PURE__ */ c(He, {
339
372
  className: "header-tab",
340
- activeKey: C,
373
+ activeKey: x,
341
374
  onChange: (e) => {
342
- S(g(m({}, a), {
375
+ S(g(m({}, f), {
343
376
  current: 1,
344
377
  total: 0
345
- })), F(e);
378
+ })), j(e);
346
379
  },
347
- items: Pe
380
+ items: ze
348
381
  })
349
- }), /* @__PURE__ */ c(y, {
350
- children: C === "pending" && B && /* @__PURE__ */ c(Q, {
382
+ }), /* @__PURE__ */ c(w, {
383
+ children: x === "pending" && U && /* @__PURE__ */ c(Y, {
351
384
  type: "primary",
352
385
  className: "pending-confirm-button",
353
- onClick: Re,
386
+ onClick: Ke,
354
387
  children: "一键确认"
355
388
  })
356
389
  })]
357
390
  }), /* @__PURE__ */ c("div", {
358
391
  className: "d-row",
359
- children: u != null && u.length ? /* @__PURE__ */ M(y, {
392
+ ref: oe,
393
+ children: u != null && u.length ? /* @__PURE__ */ T(w, {
360
394
  direction: "vertical",
361
395
  className: "d-right",
362
- children: [/* @__PURE__ */ c(We, {
396
+ children: [/* @__PURE__ */ c(Je, {
363
397
  gutter: [16, 16],
364
398
  wrap: !0,
365
399
  className: "d-right-row",
366
- children: u == null ? void 0 : u.map((e, n) => /* @__PURE__ */ c(_e, {
400
+ children: u == null ? void 0 : u.map((e, n) => /* @__PURE__ */ c(Qe, {
367
401
  className: "d-right-col",
368
- onClick: () => ye(n),
369
- children: /* @__PURE__ */ M("div", {
402
+ "data-sample-id": e.id,
403
+ onClick: () => Re(n),
404
+ children: /* @__PURE__ */ T("div", {
370
405
  className: "right-col-wrapper",
371
406
  children: [/* @__PURE__ */ c("div", {
372
407
  className: "detection-status-wrapper",
373
- children: /* @__PURE__ */ c(st, {
408
+ children: /* @__PURE__ */ c(mt, {
374
409
  sample: e
375
410
  })
376
411
  }), /* @__PURE__ */ c("div", {
377
412
  className: "right-col-img",
378
- children: /* @__PURE__ */ c(ot, {
413
+ children: /* @__PURE__ */ c(lt, {
379
414
  fileKey: e.fileKey,
380
415
  width: 124,
381
416
  thumbnailUrl: e.thumbnailUrl
@@ -388,94 +423,97 @@ const Vt = (h) => {
388
423
  })]
389
424
  })
390
425
  }, e.id))
391
- }), /* @__PURE__ */ c(He, m({
392
- onChange: Ie,
426
+ }), /* @__PURE__ */ c(Ge, m({
427
+ onChange: ve,
393
428
  className: "d-right-pageination",
394
429
  showQuickJumper: !0,
395
430
  showSizeChanger: !0
396
- }, a))]
397
- }) : /* @__PURE__ */ c(rt, {})
431
+ }, f))]
432
+ }) : /* @__PURE__ */ c(at, {})
398
433
  })]
399
- }), L && /* @__PURE__ */ c(qe, {
400
- mode: _,
401
- visible: L,
402
- onClose: () => V(!1),
403
- record: k,
404
- onNextClick: () => Le(),
405
- onPrevClick: () => Ve(),
406
- ocrMarkTmpl: r == null ? void 0 : r.ocrMarkTmpl,
434
+ }), M && /* @__PURE__ */ c(et, {
435
+ mode: J,
436
+ visible: M,
437
+ onClose: () => L(!1),
438
+ record: h,
439
+ onNextClick: () => Oe(),
440
+ onPrevClick: () => Ne(),
441
+ ocrMarkTmpl: o == null ? void 0 : o.ocrMarkTmpl,
407
442
  datasetId: i,
408
443
  versionId: t == null ? void 0 : t.id,
409
444
  handleMarkClick: (e) => {
410
- O(e), (r == null ? void 0 : r.ocrMarkTmpl) === "StructKVCOCR" ? (V(!1), $(!0)) : z("annotation");
445
+ O(e), (o == null ? void 0 : o.ocrMarkTmpl) === "StructKVCOCR" ? (L(!1), q(!0)) : F("annotation");
411
446
  },
412
- updateSampleList: w,
413
- isPreLabel: Z,
414
- selectSampleId: Y,
447
+ updateSampleList: R,
448
+ isPreLabel: W,
449
+ selectSampleId: re,
415
450
  onSave: (e) => {
416
451
  var n;
417
452
  if (!i || !t)
418
453
  throw "datasetId or version is not exist.";
419
454
  return l.cvforceDatahub.updateSamples(i, t.id, [g(m({}, e), {
420
- labels: (n = e.labels) == null ? void 0 : n.map((o) => g(m({}, o), {
421
- box: o.box.length > 4 ? o.box.splice(0, 4) : o.box
455
+ labels: (n = e.labels) == null ? void 0 : n.map((r) => g(m({}, r), {
456
+ box: r.box.length > 4 ? r.box.splice(0, 4) : r.box
422
457
  }))
423
- })]).then(() => (u && (k == null ? void 0 : k.id) === e.id && (P((o) => {
424
- if (!o)
425
- return o;
426
- const f = o.findIndex((d) => d.id === e.id);
427
- if (f > -1) {
428
- const d = [...o];
429
- return d[f] = e, d;
458
+ })]).then(() => (u && (h == null ? void 0 : h.id) === e.id && (P((r) => {
459
+ if (!r)
460
+ return r;
461
+ const a = r.findIndex((s) => s.id === e.id);
462
+ if (a > -1) {
463
+ const s = [...r];
464
+ return s[a] = e, s;
430
465
  }
431
- return o;
432
- }), b(e)), !0));
466
+ return r;
467
+ }), k(e)), !0));
433
468
  },
434
469
  onPending: (e) => {
435
470
  var n;
436
471
  if (!i || !t)
437
472
  throw "datasetId or version is not exist.";
438
473
  return l.cvforceDatahub.updateSamples(i, t.id, [g(m({}, e), {
439
- labels: (n = e.labels) == null ? void 0 : n.map((o) => g(m({}, o), {
440
- box: o.box.length > 4 ? o.box.splice(0, 4) : o.box
474
+ labels: (n = e.labels) == null ? void 0 : n.map((r) => g(m({}, r), {
475
+ box: r.box.length > 4 ? r.box.splice(0, 4) : r.box
441
476
  }))
442
- })], 1).then(() => (u && (k == null ? void 0 : k.id) === e.id && (P((o) => {
443
- if (!o)
444
- return o;
445
- const f = o.findIndex((d) => d.id === e.id);
446
- if (f > -1) {
447
- const d = [...o];
448
- return d[f] = e, d;
477
+ })], 1).then(() => (u && (h == null ? void 0 : h.id) === e.id && (P((r) => {
478
+ if (!r)
479
+ return r;
480
+ const a = r.findIndex((s) => s.id === e.id);
481
+ if (a > -1) {
482
+ const s = [...r];
483
+ return s[a] = e, s;
449
484
  }
450
- return o;
451
- }), b(e)), !0));
485
+ return r;
486
+ }), k(e)), !0));
452
487
  },
453
- filterMode: C,
488
+ filterMode: x,
454
489
  onFilterModeChange: (e) => {
455
- O(void 0), F(e);
490
+ O(void 0), j(e);
456
491
  },
457
492
  onPaginationChange: (e) => {
458
493
  S(e);
459
494
  },
495
+ onCurrentSampleChange: (e) => {
496
+ N.current = e;
497
+ },
460
498
  samples: u,
461
- pagination: a,
462
- currentIndex: U
463
- }), oe && (t == null ? void 0 : t.id) && /* @__PURE__ */ c(Oe, {
464
- visible: oe,
465
- selectSampleId: Y,
466
- ocrMarkTmpl: r == null ? void 0 : r.ocrMarkTmpl,
499
+ pagination: f,
500
+ currentIndex: Z
501
+ }), le && (t == null ? void 0 : t.id) && /* @__PURE__ */ c(Ae, {
502
+ visible: le,
503
+ selectSampleId: re,
504
+ ocrMarkTmpl: o == null ? void 0 : o.ocrMarkTmpl,
467
505
  datasetId: i,
468
506
  versionId: t.id,
469
- onClose: () => $(!1),
507
+ onClose: () => q(!1),
470
508
  onSave: (e) => {
471
509
  var n;
472
510
  if (!i || !t)
473
511
  throw "datasetId or version is not exist.";
474
512
  return l.cvforceDatahub.updateSamples(i, t.id, [g(m({}, e), {
475
- labels: (n = e.labels) == null ? void 0 : n.map((o) => g(m({}, o), {
476
- box: o.box.length > 4 ? o.box.splice(0, 4) : o.box
513
+ labels: (n = e.labels) == null ? void 0 : n.map((r) => g(m({}, r), {
514
+ box: r.box.length > 4 ? r.box.splice(0, 4) : r.box
477
515
  }))
478
- })]).then(() => (w(), !0));
516
+ })]).then(() => (R(), !0));
479
517
  }
480
518
  })]
481
519
  }) : /* @__PURE__ */ c("div", {
@@ -489,5 +527,5 @@ const Vt = (h) => {
489
527
  });
490
528
  };
491
529
  export {
492
- Vt as default
530
+ At as default
493
531
  };