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

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 (41) hide show
  1. package/dist/dataset-annotation.js +123598 -0
  2. package/dist/dataset-annotation.umd.cjs +1017 -0
  3. package/dist/es/components/ClassificationAnnotation/index.mjs +399 -343
  4. package/dist/es/components/DetectionAnnotation/components/ImageDetail/index.mjs +82 -78
  5. package/dist/es/components/DetectionAnnotation/components/ImageModal/index.mjs +28 -26
  6. package/dist/es/components/DetectionAnnotation/components/LabelMaker/index.mjs +173 -166
  7. package/dist/es/components/DetectionAnnotation/index.mjs +607 -590
  8. package/dist/es/components/OcrAnnotation/OCRBoxDetail/index.mjs +249 -230
  9. package/dist/es/components/OcrAnnotation/OcrModal/index.mjs +103 -98
  10. package/dist/es/components/OcrAnnotation/index.mjs +281 -243
  11. package/dist/es/components/VLMAnnotationDetail/VLMDetail/index.mjs +304 -298
  12. package/dist/es/components/VLMAnnotationDetail/VlmModal/index.mjs +86 -83
  13. package/dist/es/components/VLMAnnotationDetail/index.mjs +386 -300
  14. package/dist/es/index.mjs +1 -1
  15. package/dist/es/utils/checkVlmSampleLabeled.mjs +7 -0
  16. package/dist/es/utils/scrollSampleIntoView.mjs +16 -0
  17. package/dist/example/DatasetAnnotationDemo.d.ts +3 -0
  18. package/dist/example/DemoTabs.d.ts +3 -0
  19. package/dist/example/DetectionDatasetDemo.d.ts +5 -0
  20. package/dist/example/DetectionImageDemo.d.ts +5 -0
  21. package/dist/example/OcrDatasetDemo.d.ts +5 -0
  22. package/dist/example/OcrImageDemo.d.ts +5 -0
  23. package/dist/example/OcrkvcDatasetDemo.d.ts +5 -0
  24. package/dist/example/constant.local.d.ts +6 -0
  25. package/dist/example/index.d.ts +1 -0
  26. package/dist/lib/index.js +4 -4
  27. package/dist/src/components/DetectionAnnotation/components/ImageDetail/index.d.ts +2 -0
  28. package/dist/src/components/DetectionAnnotation/components/ImageModal/index.d.ts +2 -0
  29. package/dist/src/components/OcrAnnotation/OCRBoxDetail/index.d.ts +2 -0
  30. package/dist/src/components/OcrAnnotation/OcrModal/index.d.ts +1 -0
  31. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/ImageDetail/index.d.ts +16 -0
  32. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/LabelEditorInput.d.ts +12 -0
  33. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/LabelEditorItem.d.ts +21 -0
  34. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/LableEditor.d.ts +16 -0
  35. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/index.d.ts +19 -0
  36. package/dist/src/components/VLMAnnotationDetail/VLMDetail/index.d.ts +7 -0
  37. package/dist/src/components/VLMAnnotationDetail/VlmModal/index.d.ts +6 -1
  38. package/dist/src/utils/checkVlmSampleLabeled.d.ts +8 -0
  39. package/dist/src/utils/reactCompatibility.d.ts +5 -0
  40. package/dist/src/utils/scrollSampleIntoView.d.ts +9 -0
  41. package/package.json +2 -2
@@ -1,54 +1,55 @@
1
- var Se = Object.defineProperty, ye = Object.defineProperties;
2
- var be = Object.getOwnPropertyDescriptors;
3
- var ae = Object.getOwnPropertySymbols;
4
- var ve = Object.prototype.hasOwnProperty, Ce = Object.prototype.propertyIsEnumerable;
5
- var ue = (x, f, o) => f in x ? Se(x, f, { enumerable: !0, configurable: !0, writable: !0, value: o }) : x[f] = o, R = (x, f) => {
6
- for (var o in f || (f = {}))
7
- ve.call(f, o) && ue(x, o, f[o]);
8
- if (ae)
9
- for (var o of ae(f))
10
- Ce.call(f, o) && ue(x, o, f[o]);
11
- return x;
12
- }, U = (x, f) => ye(x, be(f));
13
- import { jsxs as k, Fragment as ze, jsx as g } from "react/jsx-runtime";
14
- import { Tabs as ge, Space as fe, Button as A, Tooltip as Ne, Modal as ke, message as N } from "antd";
15
- import { useContext as we, useRef as H, useState as h, useEffect as X } from "react";
1
+ var Ne = Object.defineProperty, ke = Object.defineProperties;
2
+ var we = Object.getOwnPropertyDescriptors;
3
+ var pe = Object.getOwnPropertySymbols;
4
+ var ze = Object.prototype.hasOwnProperty, Le = Object.prototype.propertyIsEnumerable;
5
+ var Ie = (p, u, s) => u in p ? Ne(p, u, { enumerable: !0, configurable: !0, writable: !0, value: s }) : p[u] = s, k = (p, u) => {
6
+ for (var s in u || (u = {}))
7
+ ze.call(u, s) && Ie(p, s, u[s]);
8
+ if (pe)
9
+ for (var s of pe(u))
10
+ Le.call(u, s) && Ie(p, s, u[s]);
11
+ return p;
12
+ }, V = (p, u) => ke(p, we(u));
13
+ import { jsxs as P, Fragment as Ve, jsx as x } from "react/jsx-runtime";
14
+ import { Tabs as ye, Space as me, Button as K, Tooltip as Pe, Modal as Te, message as w } from "antd";
15
+ import { useContext as Oe, useRef as z, useState as I, useEffect as W } from "react";
16
16
  import "./style.less.mjs";
17
- import Le from "../../DataEmpty/index.mjs";
18
- import Ve from "../../../DatasetContext/index.mjs";
19
- import Te from "../MarkOCRBoxModal/ImageDetail/index.mjs";
17
+ import De from "../../DataEmpty/index.mjs";
18
+ import qe from "../../../DatasetContext/index.mjs";
19
+ import Je from "../MarkOCRBoxModal/ImageDetail/index.mjs";
20
20
  const {
21
- TabPane: K
22
- } = ge, He = (x) => {
23
- var le;
21
+ TabPane: G
22
+ } = ye, Qe = (p) => {
23
+ var he;
24
24
  const {
25
- visible: f,
26
- selectSampleId: o,
27
- datasetId: v,
28
- versionId: C,
29
- ocrMarkTmpl: Re,
30
- onClose: Oe,
31
- onSave: J,
32
- onPending: W,
33
- categories: pe,
34
- externalSamples: y,
35
- externalPagination: O,
36
- externalCurrentIndex: q,
37
- externalFilterMode: Y,
38
- onFilterModeChange: F,
39
- onPaginationChange: b
40
- } = x, {
25
+ visible: u,
26
+ selectSampleId: s,
27
+ datasetId: C,
28
+ versionId: R,
29
+ ocrMarkTmpl: Me,
30
+ onClose: $e,
31
+ onSave: j,
32
+ onPending: Q,
33
+ categories: be,
34
+ externalSamples: S,
35
+ externalPagination: J,
36
+ externalCurrentIndex: U,
37
+ externalFilterMode: ne,
38
+ onFilterModeChange: X,
39
+ onPaginationChange: Y,
40
+ onCurrentSampleChange: Z
41
+ } = p, {
41
42
  services: {
42
- cvforceDatahub: I
43
+ cvforceDatahub: m
43
44
  }
44
- } = we(Ve), w = H(null), [t, p] = h(), G = H({}), [Pe, P] = h(0), [m, M] = h(() => o && (y != null && y.length) ? y : []), [L, z] = h(() => o && q !== void 0 ? q : -1), [r, V] = h(() => o && O ? R({}, O) : !o && O ? {
45
+ } = Oe(qe), T = z(null), [e, h] = I(), _ = z({}), [je, M] = I(0), [y, B] = I(() => s && (S != null && S.length) ? S : []), [O, N] = I(() => s && U !== void 0 ? U : -1), [d, D] = I(() => s && J ? k({}, J) : !s && J ? {
45
46
  current: 1,
46
- pageSize: O.pageSize
47
+ pageSize: J.pageSize
47
48
  } : {
48
49
  current: 1,
49
50
  pageSize: 50
50
- }), [Z, _] = h(0), [ee, te] = h(0), [ne, re] = h(0), [s, xe] = h(() => o && Y ? Y : o ? "" : "nocode"), ie = H(!1), S = H({}), [$, j] = h(!1), [Q, B] = h(!1), he = () => {
51
- switch (s) {
51
+ }), [re, ie] = I(0), [se, oe] = I(0), [ce, le] = I(0), [o, ve] = I(() => s && ne ? ne : s ? "" : "nocode"), de = z(!1), ae = z(0), ee = z(0), L = z(!1), $ = z(!1), b = z({}), [E, A] = I(!1), [te, F] = I(!1), Se = () => {
52
+ switch (o) {
52
53
  case "nocode":
53
54
  case "hascode":
54
55
  return 0;
@@ -57,8 +58,8 @@ const {
57
58
  default:
58
59
  return 2;
59
60
  }
60
- }, Ie = () => {
61
- switch (s) {
61
+ }, Ce = () => {
62
+ switch (o) {
62
63
  case "nocode":
63
64
  return "nocode";
64
65
  case "pending":
@@ -69,280 +70,298 @@ const {
69
70
  return;
70
71
  }
71
72
  };
72
- X(() => {
73
- if (!v || !C)
73
+ W(() => {
74
+ if (!C || !R) {
75
+ L.current = !1;
74
76
  return;
75
- const e = r.current || 1, n = r.pageSize || 50;
76
- if (!ie.current && o && (y != null && y.length) && O && q !== void 0) {
77
- const a = y.find((i) => i.id === o);
78
- if (a) {
79
- ie.current = !0, p(a), P(y.length), T();
77
+ }
78
+ const t = d.current || 1, n = d.pageSize || 50;
79
+ if (!de.current && s && (S != null && S.length) && J && U !== void 0) {
80
+ const c = S.find((r) => r.id === s);
81
+ if (c) {
82
+ de.current = !0, $.current = !0, L.current = !1, h(c), M(S.length), q();
80
83
  return;
81
84
  }
82
85
  }
83
- I == null || I.getDatasetsIdVersionsVidSamples(v, C, {
84
- labels: Ie(),
85
- pageNo: e,
86
+ const f = ++ee.current;
87
+ m == null || m.getDatasetsIdVersionsVidSamples(C, R, {
88
+ labels: Ce(),
89
+ pageNo: t,
86
90
  pageSize: n,
87
- confirmStatus: he()
88
- }).then((a) => {
89
- const i = a.recordList || [];
90
- M(i);
91
- const d = U(R({}, r), {
92
- current: e,
91
+ confirmStatus: Se()
92
+ }).then((c) => {
93
+ if (f !== ee.current)
94
+ return;
95
+ const r = c.recordList || [];
96
+ B(r);
97
+ const g = V(k({}, d), {
98
+ current: t,
93
99
  pageSize: n,
94
- total: a.totalResults
100
+ total: c.totalResults
95
101
  });
96
- if (V(d), b == null || b(d), r.type === "next" && i.length) {
97
- z(0);
98
- const c = a.recordList[0];
99
- p(c), P(i.length), s !== void 0 && (S.current[s] = {
102
+ if (delete g.type, D(g), Y == null || Y({
103
+ current: t,
104
+ pageSize: n,
105
+ total: c.totalResults
106
+ }), d.type === "next" && r.length) {
107
+ N(0);
108
+ const l = c.recordList[0];
109
+ h(l), M(r.length), o !== void 0 && (b.current[o] = {
100
110
  index: 0,
101
- page: e
111
+ page: t
102
112
  });
103
- const u = R({}, d);
104
- delete u.type, V(u), b == null || b(u);
105
113
  return;
106
114
  }
107
- if (r.type === "prev" && i.length) {
108
- const l = r.pageSize - 1;
109
- z(l);
110
- const c = a.recordList[l];
111
- p(c), P(i.length), s !== void 0 && (S.current[s] = {
112
- index: l,
113
- page: e
115
+ if (d.type === "prev" && r.length) {
116
+ const i = d.pageSize - 1;
117
+ N(i);
118
+ const l = c.recordList[i];
119
+ h(l), M(r.length), o !== void 0 && (b.current[o] = {
120
+ index: i,
121
+ page: t
114
122
  });
115
- const u = R({}, d);
116
- delete u.type, V(u), b == null || b(u);
117
123
  return;
118
124
  }
119
- if (i.find((l) => l.id === o)) {
120
- if (o) {
121
- p(i.find((c) => c.id === o));
122
- const l = i.findIndex((c) => c.id === o);
123
- z(l), s !== void 0 && (S.current[s] = {
124
- index: l,
125
- page: e
125
+ if (r.find((i) => i.id === s) && !$.current) {
126
+ if (s) {
127
+ $.current = !0, h(r.find((l) => l.id === s));
128
+ const i = r.findIndex((l) => l.id === s);
129
+ N(i), o !== void 0 && (b.current[o] = {
130
+ index: i,
131
+ page: t
126
132
  });
127
133
  } else {
128
- const l = S.current[s], c = l == null ? void 0 : l.index, u = c !== void 0 && c >= 0 && c < i.length ? c : 0;
129
- p(i[u]), z(u);
134
+ const i = b.current[o], l = i == null ? void 0 : i.index, a = l !== void 0 && l >= 0 && l < r.length ? l : 0;
135
+ h(r[a]), N(a);
130
136
  }
131
- P(i.length);
132
- } else if (o)
133
- I.getDatasetsIdVersionsVidSsamplesSid(v, C, o).then((l) => {
134
- p(l);
137
+ M(r.length);
138
+ } else if (s && !$.current)
139
+ $.current = !0, m.getDatasetsIdVersionsVidSsamplesSid(C, R, s).then((i) => {
140
+ h(i);
135
141
  });
136
142
  else {
137
- const l = S.current[s], c = l == null ? void 0 : l.index, u = c !== void 0 && c >= 0 && c < i.length ? c : 0;
138
- p(i[u]), z(u), P(i.length);
143
+ const i = b.current[o], l = i == null ? void 0 : i.index, a = l !== void 0 && l >= 0 && l < r.length ? l : 0;
144
+ h(r[a]), N(a), M(r.length);
139
145
  }
140
- }), T();
141
- }, [r.current, s, v, C]);
142
- const T = () => {
143
- !v || !C || I == null || I.getDatasetsIdVersionsVidLabelcount(v, C, {
146
+ }).finally(() => {
147
+ f === ee.current && (L.current = !1);
148
+ }), q();
149
+ }, [d.current, o, C, R]), W(() => {
150
+ e != null && e.id && (Z == null || Z(e.id));
151
+ }, [e == null ? void 0 : e.id]);
152
+ const q = () => {
153
+ !C || !R || m == null || m.getDatasetsIdVersionsVidLabelcount(C, R, {
144
154
  label: "allcode",
145
155
  confirmStatus: 2
146
- }).then((e) => {
147
- const n = e.find((d) => d.id === "allcodeid"), a = e.find((d) => d.id === "nocodeid"), i = e.find((d) => d.id === "pendingid");
148
- _(n ? n.count : 0), te(a ? a.count : 0), re(i ? i.count : 0);
156
+ }).then((t) => {
157
+ const n = t.find((r) => r.id === "allcodeid"), f = t.find((r) => r.id === "nocodeid"), c = t.find((r) => r.id === "pendingid");
158
+ ie(n ? n.count : 0), oe(f ? f.count : 0), le(c ? c.count : 0);
149
159
  });
150
- }, E = (e) => {
151
- m && M((n) => {
152
- var D, l;
153
- let a;
154
- const i = !!(t && ((D = t.labels) != null && D.length && s === "nocode" || !((l = t.labels) != null && l.length) && s === "hascode" || e === !0)), d = i ? L : L + 1;
155
- if (t && i) {
156
- const c = n.findIndex((u) => u.id === t.id);
157
- c > -1 && (n.splice(c, 1), a = [...n], r.total && (r.total = r.total - 1));
160
+ }, H = (t) => {
161
+ y && B((n) => {
162
+ var v, i;
163
+ const f = !!(e && ((v = e.labels) != null && v.length && o === "nocode" || !((i = e.labels) != null && i.length) && o === "hascode" || t === !0)), c = f ? O : O + 1;
164
+ let r = n, g = d.total;
165
+ if (e && f) {
166
+ const l = n.findIndex((a) => a.id === e.id);
167
+ l > -1 && (r = n.slice(0, l).concat(n.slice(l + 1)), g && (g = g - 1, D((a) => V(k({}, a), {
168
+ total: g
169
+ }))));
158
170
  }
159
- if (d >= n.length) {
160
- const c = (r.current - 1) * r.pageSize + d;
161
- r.total == null || c >= r.total ? (n.length > 0 && L >= n.length && setTimeout(() => {
162
- const u = n.length - 1;
163
- z(u);
164
- const me = n[u];
165
- p(me), s !== void 0 && (S.current[s] = {
166
- index: u,
167
- page: r.current || 1
171
+ if (c >= r.length) {
172
+ const l = (d.current - 1) * d.pageSize + c;
173
+ g == null || l >= g ? (r.length > 0 && O >= r.length && setTimeout(() => {
174
+ const a = r.length - 1;
175
+ N(a);
176
+ const Re = r[a];
177
+ h(Re), o !== void 0 && (b.current[o] = {
178
+ index: a,
179
+ page: d.current || 1
168
180
  });
169
- }, 0), N.error("已经是最后一个了")) : V({
170
- current: r.current + 1,
171
- pageSize: r.pageSize,
181
+ }, 0), w.error("已经是最后一个了")) : L.current || (L.current = !0, D((a) => V(k({}, a), {
182
+ current: a.current + 1,
183
+ // total 要带上,否则翻页请求回来之前判空会误报“已经是最后一个了”
184
+ total: g,
172
185
  type: "next"
173
- });
186
+ })));
174
187
  } else
175
188
  setTimeout(() => {
176
- z(d);
177
- const c = n[d];
178
- p(c), s !== void 0 && (S.current[s] = {
179
- index: d,
180
- page: r.current || 1
189
+ N(c);
190
+ const l = r[c];
191
+ h(l), o !== void 0 && (b.current[o] = {
192
+ index: c,
193
+ page: d.current || 1
181
194
  });
182
195
  }, 0);
183
- return a || n;
196
+ return r;
184
197
  });
185
- }, oe = () => {
186
- var a, i;
187
- if (!m)
198
+ }, ue = () => {
199
+ var r, g;
200
+ if (!y)
188
201
  return;
189
- let e;
190
- if (t && m && ((a = t.labels) != null && a.length && s === "nocode" || !((i = t.labels) != null && i.length) && s === "hascode")) {
191
- const d = m.findIndex((D) => D.id === t.id);
192
- d > -1 && (m.splice(d, 1), e = [...m], r.total && (r.total = r.total - 1));
202
+ let t, n = d.total;
203
+ if (e && y && ((r = e.labels) != null && r.length && o === "nocode" || !((g = e.labels) != null && g.length) && o === "hascode")) {
204
+ const v = y.findIndex((i) => i.id === e.id);
205
+ v > -1 && (t = y.slice(0, v).concat(y.slice(v + 1)), n && (n = n - 1, D((i) => V(k({}, i), {
206
+ total: n
207
+ }))));
193
208
  }
194
- const n = L - 1;
195
- if (n < 0)
196
- (r.current - 1) * r.pageSize + n < 0 ? N.error("已经是第一个了") : V({
197
- current: r.current - 1,
198
- pageSize: r.pageSize,
209
+ const f = t || y, c = O - 1;
210
+ if (c < 0)
211
+ (d.current - 1) * d.pageSize + c < 0 ? w.error("已经是第一个了") : L.current || (L.current = !0, D((i) => V(k({}, i), {
212
+ current: i.current - 1,
213
+ // total 要带上,否则翻页请求回来之前判空会误报“已经是最后一个了”
214
+ total: n,
199
215
  type: "prev"
200
- });
216
+ })));
201
217
  else {
202
- z(n);
203
- const d = m[n];
204
- p(d), s !== void 0 && (S.current[s] = {
205
- index: n,
206
- page: r.current || 1
218
+ N(c);
219
+ const v = f[c];
220
+ h(v), o !== void 0 && (b.current[o] = {
221
+ index: c,
222
+ page: d.current || 1
207
223
  });
208
224
  }
209
- e && M(e);
225
+ t && B(t);
210
226
  };
211
- X(() => {
212
- f && v && C && t && (I == null || I.getDatasetsIdVersionsVidSsamplesSid(v, C, t.id).then((e) => {
213
- p(e), G.current = JSON.parse(JSON.stringify(e));
214
- }));
215
- }, [t == null ? void 0 : t.id]), X(() => {
216
- w.current && (w.current.width = w.current.offsetWidth, w.current.height = w.current.offsetHeight);
217
- }, [w.current]);
218
- const se = () => !t || !G.current ? !1 : JSON.stringify(t) !== JSON.stringify(G.current), ce = () => {
219
- if (t)
220
- if (se()) {
221
- j(!0);
222
- const e = t.confirmStatus === 1 ? W : J;
223
- e == null || e(t).then((n) => {
224
- n ? (oe(), T()) : N.error("保存失败");
227
+ W(() => {
228
+ if (!u || !C || !R || !e)
229
+ return;
230
+ const t = ++ae.current;
231
+ m == null || m.getDatasetsIdVersionsVidSsamplesSid(C, R, e.id).then((n) => {
232
+ t === ae.current && (h(n), _.current = JSON.parse(JSON.stringify(n)));
233
+ });
234
+ }, [e == null ? void 0 : e.id]), W(() => {
235
+ T.current && (T.current.width = T.current.offsetWidth, T.current.height = T.current.offsetHeight);
236
+ }, [T.current]);
237
+ const fe = () => !e || !_.current ? !1 : JSON.stringify(e) !== JSON.stringify(_.current), ge = () => {
238
+ if (e)
239
+ if (fe()) {
240
+ A(!0);
241
+ const t = e.confirmStatus === 1 ? Q : j;
242
+ t == null || t(e).then((n) => {
243
+ n ? (ue(), q()) : w.error("保存失败");
225
244
  }).finally(() => {
226
- j(!1);
245
+ A(!1);
227
246
  });
228
247
  } else
229
- oe();
230
- }, de = () => {
231
- if (t)
232
- if (se()) {
233
- j(!0);
234
- const e = t.confirmStatus === 1 ? W : J;
235
- e == null || e(t).then((n) => {
236
- n ? (E(), T()) : N.error("保存失败");
248
+ ue();
249
+ }, xe = () => {
250
+ if (e)
251
+ if (fe()) {
252
+ A(!0);
253
+ const t = e.confirmStatus === 1 ? Q : j;
254
+ t == null || t(e).then((n) => {
255
+ n ? (H(), q()) : w.error("保存失败");
237
256
  }).finally(() => {
238
- j(!1);
257
+ A(!1);
239
258
  });
240
259
  } else
241
- E();
260
+ H();
242
261
  };
243
- return /* @__PURE__ */ k(ze, {
244
- children: [/* @__PURE__ */ k("div", {
262
+ return /* @__PURE__ */ P(Ve, {
263
+ children: [/* @__PURE__ */ P("div", {
245
264
  className: "ocr-box-detail-records-content",
246
- children: [/* @__PURE__ */ k(ge, {
265
+ children: [/* @__PURE__ */ P(ye, {
247
266
  className: "ocr-box-detail-records-content-tabs",
248
- activeKey: s,
249
- onChange: (e) => {
250
- L >= 0 && s !== void 0 && s !== null && (S.current[s] = {
251
- index: L,
252
- page: r.current || 1
267
+ activeKey: o,
268
+ onChange: (t) => {
269
+ O >= 0 && o !== void 0 && o !== null && (b.current[o] = {
270
+ index: O,
271
+ page: d.current || 1
253
272
  });
254
- const n = S.current[e], a = (n == null ? void 0 : n.page) || 1;
255
- V(U(R({}, r), {
256
- current: a
257
- })), xe(e), F == null || F(e);
273
+ const n = b.current[t], f = (n == null ? void 0 : n.page) || 1;
274
+ D(V(k({}, d), {
275
+ current: f
276
+ })), ve(t), X == null || X(t);
258
277
  },
259
- children: [/* @__PURE__ */ g(K, {
260
- tab: `全部(${Z})`
261
- }, ""), /* @__PURE__ */ g(K, {
262
- tab: `未标注(${ee})`
263
- }, "nocode"), /* @__PURE__ */ g(K, {
264
- tab: `待确认(${ne})`
265
- }, "pending"), /* @__PURE__ */ g(K, {
266
- tab: `已标注(${Z - ee - ne})`
278
+ children: [/* @__PURE__ */ x(G, {
279
+ tab: `全部(${re})`
280
+ }, ""), /* @__PURE__ */ x(G, {
281
+ tab: `未标注(${se})`
282
+ }, "nocode"), /* @__PURE__ */ x(G, {
283
+ tab: `待确认(${ce})`
284
+ }, "pending"), /* @__PURE__ */ x(G, {
285
+ tab: `已标注(${re - se - ce})`
267
286
  }, "hascode")]
268
- }), m != null && m.length ? /* @__PURE__ */ g(Te, {
269
- currentSample: t,
270
- categories: pe,
271
- onChange: (e) => {
272
- p(e), M((n) => {
273
- const a = n.findIndex((i) => i.id === e.id);
274
- return n[a] = e, [...n];
287
+ }), y != null && y.length ? /* @__PURE__ */ x(Je, {
288
+ currentSample: e,
289
+ categories: be,
290
+ onChange: (t) => {
291
+ h(t), B((n) => {
292
+ const f = n.findIndex((c) => c.id === t.id);
293
+ return n[f] = t, [...n];
275
294
  });
276
295
  },
277
- onNextClick: de,
278
- onPrevClick: ce
279
- }) : /* @__PURE__ */ g(Le, {})]
280
- }), /* @__PURE__ */ k("div", {
296
+ onNextClick: xe,
297
+ onPrevClick: ge
298
+ }) : /* @__PURE__ */ x(De, {})]
299
+ }), /* @__PURE__ */ P("div", {
281
300
  className: "ocr-box-detail-footer",
282
- children: [/* @__PURE__ */ g("div", {
301
+ children: [/* @__PURE__ */ x("div", {
283
302
  style: {
284
303
  width: "420px"
285
304
  }
286
- }), /* @__PURE__ */ k(fe, {
287
- children: [/* @__PURE__ */ g(A, {
305
+ }), /* @__PURE__ */ P(me, {
306
+ children: [/* @__PURE__ */ x(K, {
288
307
  type: "default",
289
- onClick: ce,
290
- disabled: $ || Q,
308
+ onClick: ge,
309
+ disabled: E || te,
291
310
  children: "上一张"
292
- }, "prev"), /* @__PURE__ */ g(A, {
311
+ }, "prev"), /* @__PURE__ */ x(K, {
293
312
  type: "default",
294
- onClick: de,
295
- disabled: $ || Q,
313
+ onClick: xe,
314
+ disabled: E || te,
296
315
  children: "下一张"
297
316
  }, "next")]
298
- }), /* @__PURE__ */ k(fe, {
317
+ }), /* @__PURE__ */ P(me, {
299
318
  style: {
300
319
  width: "420px",
301
320
  justifyContent: "flex-end"
302
321
  },
303
- children: [/* @__PURE__ */ k("span", {
322
+ children: [/* @__PURE__ */ P("span", {
304
323
  className: "ocr-modal-label-num",
305
- children: ["当前图片标注框数量:", ((le = t == null ? void 0 : t.labels) == null ? void 0 : le.length) || 0]
306
- }), (t == null ? void 0 : t.confirmStatus) === 1 && /* @__PURE__ */ g(Ne, {
307
- title: /* @__PURE__ */ g("span", {
324
+ children: ["当前图片标注框数量:", ((he = e == null ? void 0 : e.labels) == null ? void 0 : he.length) || 0]
325
+ }), (e == null ? void 0 : e.confirmStatus) === 1 && /* @__PURE__ */ x(Pe, {
326
+ title: /* @__PURE__ */ x("span", {
308
327
  style: {
309
328
  color: "#ff9800"
310
329
  },
311
330
  children: 'AI预标注数据,请"确认标注"完成审核'
312
331
  }),
313
332
  placement: "top",
314
- children: /* @__PURE__ */ g(A, {
333
+ children: /* @__PURE__ */ x(K, {
315
334
  type: "primary",
316
335
  onClick: () => {
317
- ke.confirm({
336
+ Te.confirm({
318
337
  title: "确认",
319
338
  content: "是否确认当前标注?",
320
339
  onOk: () => {
321
- t && (B(!0), J(t).then((e) => {
322
- e ? (N.success("保存成功"), E(!0), T()) : N.error("保存失败");
340
+ e && (F(!0), j(e).then((t) => {
341
+ t ? (w.success("保存成功"), H(!0), q()) : w.error("保存失败");
323
342
  }).finally(() => {
324
- B(!1);
343
+ F(!1);
325
344
  }));
326
345
  }
327
346
  });
328
347
  },
329
- disabled: !t || $,
348
+ disabled: !e || E,
330
349
  className: "ocr-confirm-label-btn",
331
350
  children: "确认标注"
332
351
  })
333
- }), /* @__PURE__ */ g(A, {
334
- disabled: !t || $,
352
+ }), /* @__PURE__ */ x(K, {
353
+ disabled: !e || E,
335
354
  type: "primary",
336
- loading: Q,
355
+ loading: te,
337
356
  onClick: () => {
338
- if (!t)
357
+ if (!e)
339
358
  return;
340
- B(!0);
341
- const e = t.confirmStatus === 1 ? W : J;
342
- e == null || e(t).then((n) => {
343
- n ? (N.success("保存成功"), E(), T()) : N.error("保存失败");
359
+ F(!0);
360
+ const t = e.confirmStatus === 1 ? Q : j;
361
+ t == null || t(e).then((n) => {
362
+ n ? (w.success("保存成功"), H(), q()) : w.error("保存失败");
344
363
  }).finally(() => {
345
- B(!1);
364
+ F(!1);
346
365
  });
347
366
  },
348
367
  children: "保存标注"
@@ -352,5 +371,5 @@ const {
352
371
  });
353
372
  };
354
373
  export {
355
- He as default
374
+ Qe as default
356
375
  };