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

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 +374 -325
  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 -248
  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, h = (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), [x, L] = d(!1), [I, ne] = d(0), [u, P] = d(), [m, k] = d(), [re, O] = d(), [Z, y] = d(-1), oe = X(null), N = X(void 0), D = X(!1), [f, M] = 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) => {
53
- S({
49
+ }), [z, ie] = d(0), [A, ce] = d(0), [S, 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 = h({}, 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) => {
54
+ M({
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 (S) {
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 (S) {
106
107
  case "nocode":
107
108
  return "nocode";
108
109
  case "pending":
@@ -112,198 +113,225 @@ 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
+ M((s) => g(h({}, 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), M((s) => g(h({}, 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, S, 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 (S === "hascode" && (n = I - z - A), S === "nocode" && (n = z), S === "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, M((a) => g(h({}, 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, M((r) => g(h({}, 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
+ !x || !(m != null && m.id) || (N.current = m.id);
234
+ }, [x, m == null ? void 0 : m.id]), C(() => {
235
+ const e = N.current;
236
+ if (x || !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
+ }, [x, u]), C(() => {
244
+ x || ((o == null ? void 0 : o.ocrMarkTmpl) === "StructKVCOCR" ? k(void 0) : (J === "annotation" && R(), k(void 0), y(-1), O(void 0), F("preview")));
245
+ }, [x, J]), C(() => {
246
+ o && (o.markType !== "ocr" || (o == null ? void 0 : o.ocrMarkTmpl) !== "DetectionOCR") && console.error(`当前数据集不是DetectionOCR(ocr检测)类型,请检查数据集类型。
219
247
  请检查markType是否为ocr并且ocrMarkTmpl为DetectionOCR。`);
220
- }, [r]);
221
- const Oe = (r == null ? void 0 : r.ocrMarkTmpl) === "StructKVCOCR" ? Ge : Xe, Re = () => {
248
+ }, [o]);
249
+ const Ae = (o == null ? void 0 : o.ocrMarkTmpl) === "StructKVCOCR" ? tt : nt, Ke = () => {
222
250
  if (console.log("一键确认", l, t), !(l != null && l.cvforceDatahub) || !(t != null && t.id))
223
251
  return Promise.resolve(!1);
224
- Je.confirm({
252
+ Xe.confirm({
225
253
  title: "一键保存所有标注?",
226
254
  content: "待确认的所有带预标注信息的图片将保存至已标注页签下",
227
255
  onOk: () => {
228
256
  l.cvforceDatahub.getAllConfirmSamples(i, t.id).then((e) => {
229
- K.success("保存成功"), S(g(m({}, a), {
257
+ B.success("保存成功"), M(g(h({}, f), {
230
258
  current: 1
231
- })), ae(), w();
259
+ })), fe(), R();
232
260
  });
233
261
  }
234
262
  });
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, {
263
+ }, me = !m && !!(v && v.preLabel) && !!(t != null && t.id), Fe = U || me;
264
+ return /* @__PURE__ */ c(je, {
265
+ locale: Ye,
266
+ children: /* @__PURE__ */ c(st.Provider, {
239
267
  value: {
240
268
  datasetId: i,
241
269
  versionId: (t == null ? void 0 : t.id) || "",
242
270
  no: (t == null ? void 0 : t.no) || "",
243
- loading: q,
271
+ loading: ee,
244
272
  version: t,
245
- versions: v,
273
+ versions: V,
246
274
  samples: u,
247
- pagination: a,
275
+ pagination: f,
248
276
  services: l,
249
277
  featuresConfig: {
250
- labelManager: me,
251
- datasetManager: D,
252
- annotation: he,
253
- filterSwitch: H,
278
+ labelManager: Ce,
279
+ datasetManager: v,
280
+ annotation: ke,
281
+ filterSwitch: Q,
254
282
  header: p,
255
- exampleSrcRoot: ge
283
+ exampleSrcRoot: Se
256
284
  }
257
285
  },
258
- children: r ? r.markType === "ocr" ? /* @__PURE__ */ M("div", {
286
+ children: o ? o.markType === "ocr" ? /* @__PURE__ */ T("div", {
259
287
  className: "ocr-version-detail",
260
- children: [/* @__PURE__ */ M(nt, {
288
+ children: [/* @__PURE__ */ T(ct, {
261
289
  className: "product-details-page",
262
- header: p === !1 ? void 0 : /* @__PURE__ */ c(lt, {
263
- backTo: pe,
290
+ header: p === !1 ? void 0 : /* @__PURE__ */ c(ut, {
291
+ backTo: be,
264
292
  onBackClick: p != null && p.onBackClick ? () => {
265
293
  p.onBackClick && p.onBackClick();
266
294
  } : void 0,
267
- left: !q && /* @__PURE__ */ M(y, {
295
+ left: !ee && /* @__PURE__ */ T(w, {
268
296
  children: [/* @__PURE__ */ c("span", {
269
297
  style: {
270
298
  fontWeight: "bold"
271
299
  },
272
- children: r == null ? void 0 : r.name
273
- }), /* @__PURE__ */ c(Fe, {
300
+ children: o == null ? void 0 : o.name
301
+ }), /* @__PURE__ */ c(qe, {
274
302
  disabled: (p == null ? void 0 : p.versionSelect) === !1,
275
303
  value: t == null ? void 0 : t.id,
276
304
  style: {
277
305
  width: 70
278
306
  },
279
- options: v.map((e) => ({
307
+ options: V.map((e) => ({
280
308
  label: e.no,
281
309
  value: e.id
282
310
  })),
283
311
  onChange: (e) => {
284
- const n = v.find((f) => f.id === e);
285
- if (!r || !n)
312
+ const n = V.find((a) => a.id === e);
313
+ if (!o || !n)
286
314
  return;
287
- const o = v.find((f) => f.id === n.id);
288
- E(o), p != null && p.onVersionChange && p.onVersionChange(o);
315
+ const r = V.find((a) => a.id === n.id);
316
+ $(r), p != null && p.onVersionChange && p.onVersionChange(r);
289
317
  }
290
318
  })]
291
319
  }),
292
- right: /* @__PURE__ */ c(y, {
293
- children: Ne && /* @__PURE__ */ c($e, {
320
+ right: /* @__PURE__ */ c(w, {
321
+ children: Fe && /* @__PURE__ */ c(We, {
294
322
  menu: {
295
- items: [...B ? [{
323
+ items: [...U ? [{
296
324
  key: "manual",
297
- label: /* @__PURE__ */ c(y, {
298
- children: /* @__PURE__ */ c(Ze, {
325
+ label: /* @__PURE__ */ c(w, {
326
+ children: /* @__PURE__ */ c(_e, {
299
327
  title: "预标注进行中,请任务完成后再试",
300
- open: ke,
301
- children: /* @__PURE__ */ c(Q, {
328
+ open: Te,
329
+ children: /* @__PURE__ */ c(Y, {
302
330
  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),
331
+ disabled: !I || (o == null ? void 0 : o.ocrMarkTmpl) !== "StructKVCOCR" && (o == null ? void 0 : o.ocrMarkTmpl) !== "DetectionOCR" || W,
332
+ onClick: we,
333
+ onMouseEnter: () => W && ue(!0),
334
+ onMouseLeave: () => ue(!1),
307
335
  style: {
308
336
  marginRight: "10px"
309
337
  },
@@ -311,71 +339,73 @@ const Vt = (h) => {
311
339
  })
312
340
  })
313
341
  })
314
- }] : [], se ? {
342
+ }] : [], me ? {
315
343
  key: "auto",
316
- label: /* @__PURE__ */ c(Ye, {
344
+ label: /* @__PURE__ */ c(rt, {
317
345
  buttonType: "text",
318
346
  datasetId: i,
319
347
  versionId: (t == null ? void 0 : t.id) || "",
320
- disabled: !T || (r == null ? void 0 : r.ocrMarkTmpl) !== "DetectionOCR",
321
- setIsTaskChange: xe,
322
- preLabelTask: re,
348
+ disabled: !I || (o == null ? void 0 : o.ocrMarkTmpl) !== "DetectionOCR",
349
+ setIsTaskChange: ye,
350
+ preLabelTask: ae,
323
351
  datasetType: "ocr"
324
352
  })
325
353
  } : null]
326
354
  },
327
355
  placement: "bottom",
328
- children: /* @__PURE__ */ M(Q, {
356
+ children: /* @__PURE__ */ T(Y, {
329
357
  type: "primary",
330
- children: ["开始标注", /* @__PURE__ */ c(at, {})]
358
+ children: ["开始标注", /* @__PURE__ */ c(ft, {})]
331
359
  })
332
360
  })
333
361
  })
334
362
  }),
335
- children: [/* @__PURE__ */ M("div", {
363
+ children: [/* @__PURE__ */ T("div", {
336
364
  className: "ocr-header",
337
- children: [/* @__PURE__ */ c(y, {
338
- children: H.tabs && /* @__PURE__ */ c(je, {
365
+ children: [/* @__PURE__ */ c(w, {
366
+ children: Q.tabs && /* @__PURE__ */ c(He, {
339
367
  className: "header-tab",
340
- activeKey: C,
368
+ activeKey: S,
341
369
  onChange: (e) => {
342
- S(g(m({}, a), {
370
+ M(g(h({}, f), {
343
371
  current: 1,
344
372
  total: 0
345
- })), F(e);
373
+ })), j(e);
346
374
  },
347
- items: Pe
375
+ items: ze
348
376
  })
349
- }), /* @__PURE__ */ c(y, {
350
- children: C === "pending" && B && /* @__PURE__ */ c(Q, {
377
+ }), /* @__PURE__ */ c(w, {
378
+ children: S === "pending" && U && /* @__PURE__ */ c(Y, {
351
379
  type: "primary",
352
380
  className: "pending-confirm-button",
353
- onClick: Re,
381
+ onClick: Ke,
354
382
  children: "一键确认"
355
383
  })
356
384
  })]
357
385
  }), /* @__PURE__ */ c("div", {
358
386
  className: "d-row",
359
- children: u != null && u.length ? /* @__PURE__ */ M(y, {
387
+ ref: oe,
388
+ children: u != null && u.length ? /* @__PURE__ */ T(w, {
360
389
  direction: "vertical",
361
390
  className: "d-right",
362
- children: [/* @__PURE__ */ c(We, {
391
+ children: [/* @__PURE__ */ c(Je, {
363
392
  gutter: [16, 16],
364
393
  wrap: !0,
365
394
  className: "d-right-row",
366
- children: u == null ? void 0 : u.map((e, n) => /* @__PURE__ */ c(_e, {
395
+ children: u == null ? void 0 : u.map((e, n) => /* @__PURE__ */ c(Qe, {
367
396
  className: "d-right-col",
368
- onClick: () => ye(n),
369
- children: /* @__PURE__ */ M("div", {
397
+ "data-sample-id": e.id,
398
+ onClick: () => Re(n),
399
+ children: /* @__PURE__ */ T("div", {
370
400
  className: "right-col-wrapper",
371
401
  children: [/* @__PURE__ */ c("div", {
372
402
  className: "detection-status-wrapper",
373
- children: /* @__PURE__ */ c(st, {
403
+ children: /* @__PURE__ */ c(mt, {
374
404
  sample: e
375
405
  })
376
406
  }), /* @__PURE__ */ c("div", {
377
407
  className: "right-col-img",
378
- children: /* @__PURE__ */ c(ot, {
408
+ children: /* @__PURE__ */ c(lt, {
379
409
  fileKey: e.fileKey,
380
410
  width: 124,
381
411
  thumbnailUrl: e.thumbnailUrl
@@ -388,94 +418,97 @@ const Vt = (h) => {
388
418
  })]
389
419
  })
390
420
  }, e.id))
391
- }), /* @__PURE__ */ c(He, m({
392
- onChange: Ie,
421
+ }), /* @__PURE__ */ c(Ge, h({
422
+ onChange: ve,
393
423
  className: "d-right-pageination",
394
424
  showQuickJumper: !0,
395
425
  showSizeChanger: !0
396
- }, a))]
397
- }) : /* @__PURE__ */ c(rt, {})
426
+ }, f))]
427
+ }) : /* @__PURE__ */ c(at, {})
398
428
  })]
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,
429
+ }), x && /* @__PURE__ */ c(et, {
430
+ mode: J,
431
+ visible: x,
432
+ onClose: () => L(!1),
433
+ record: m,
434
+ onNextClick: () => Oe(),
435
+ onPrevClick: () => Ne(),
436
+ ocrMarkTmpl: o == null ? void 0 : o.ocrMarkTmpl,
407
437
  datasetId: i,
408
438
  versionId: t == null ? void 0 : t.id,
409
439
  handleMarkClick: (e) => {
410
- O(e), (r == null ? void 0 : r.ocrMarkTmpl) === "StructKVCOCR" ? (V(!1), $(!0)) : z("annotation");
440
+ O(e), (o == null ? void 0 : o.ocrMarkTmpl) === "StructKVCOCR" ? (L(!1), q(!0)) : F("annotation");
411
441
  },
412
- updateSampleList: w,
413
- isPreLabel: Z,
414
- selectSampleId: Y,
442
+ updateSampleList: R,
443
+ isPreLabel: W,
444
+ selectSampleId: re,
415
445
  onSave: (e) => {
416
446
  var n;
417
447
  if (!i || !t)
418
448
  throw "datasetId or version is not exist.";
419
- 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
449
+ return l.cvforceDatahub.updateSamples(i, t.id, [g(h({}, e), {
450
+ labels: (n = e.labels) == null ? void 0 : n.map((r) => g(h({}, r), {
451
+ box: r.box.length > 4 ? r.box.splice(0, 4) : r.box
422
452
  }))
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;
453
+ })]).then(() => (u && (m == null ? void 0 : m.id) === e.id && (P((r) => {
454
+ if (!r)
455
+ return r;
456
+ const a = r.findIndex((s) => s.id === e.id);
457
+ if (a > -1) {
458
+ const s = [...r];
459
+ return s[a] = e, s;
430
460
  }
431
- return o;
432
- }), b(e)), !0));
461
+ return r;
462
+ }), k(e)), !0));
433
463
  },
434
464
  onPending: (e) => {
435
465
  var n;
436
466
  if (!i || !t)
437
467
  throw "datasetId or version is not exist.";
438
- 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
468
+ return l.cvforceDatahub.updateSamples(i, t.id, [g(h({}, e), {
469
+ labels: (n = e.labels) == null ? void 0 : n.map((r) => g(h({}, r), {
470
+ box: r.box.length > 4 ? r.box.splice(0, 4) : r.box
441
471
  }))
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;
472
+ })], 1).then(() => (u && (m == null ? void 0 : m.id) === e.id && (P((r) => {
473
+ if (!r)
474
+ return r;
475
+ const a = r.findIndex((s) => s.id === e.id);
476
+ if (a > -1) {
477
+ const s = [...r];
478
+ return s[a] = e, s;
449
479
  }
450
- return o;
451
- }), b(e)), !0));
480
+ return r;
481
+ }), k(e)), !0));
452
482
  },
453
- filterMode: C,
483
+ filterMode: S,
454
484
  onFilterModeChange: (e) => {
455
- O(void 0), F(e);
485
+ O(void 0), j(e);
456
486
  },
457
487
  onPaginationChange: (e) => {
458
- S(e);
488
+ M(e);
489
+ },
490
+ onCurrentSampleChange: (e) => {
491
+ N.current = e;
459
492
  },
460
493
  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,
494
+ pagination: f,
495
+ currentIndex: Z
496
+ }), le && (t == null ? void 0 : t.id) && /* @__PURE__ */ c(Ae, {
497
+ visible: le,
498
+ selectSampleId: re,
499
+ ocrMarkTmpl: o == null ? void 0 : o.ocrMarkTmpl,
467
500
  datasetId: i,
468
501
  versionId: t.id,
469
- onClose: () => $(!1),
502
+ onClose: () => q(!1),
470
503
  onSave: (e) => {
471
504
  var n;
472
505
  if (!i || !t)
473
506
  throw "datasetId or version is not exist.";
474
- 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
507
+ return l.cvforceDatahub.updateSamples(i, t.id, [g(h({}, e), {
508
+ labels: (n = e.labels) == null ? void 0 : n.map((r) => g(h({}, r), {
509
+ box: r.box.length > 4 ? r.box.splice(0, 4) : r.box
477
510
  }))
478
- })]).then(() => (w(), !0));
511
+ })]).then(() => (R(), !0));
479
512
  }
480
513
  })]
481
514
  }) : /* @__PURE__ */ c("div", {
@@ -489,5 +522,5 @@ const Vt = (h) => {
489
522
  });
490
523
  };
491
524
  export {
492
- Vt as default
525
+ At as default
493
526
  };