@glodon-aiot/dataset-annotation 3.19.0-alpha.19 → 3.19.0-alpha.21

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,14 +1,15 @@
1
1
  import { createContext as e } from "react";
2
- const a = e({
2
+ const o = e({
3
3
  datasetId: "",
4
4
  versionId: "",
5
5
  no: "",
6
6
  loading: !1,
7
7
  services: {},
8
8
  token: "",
9
+ getToken: void 0,
9
10
  apiUrl: "",
10
11
  featuresConfig: {}
11
12
  });
12
13
  export {
13
- a as default
14
+ o as default
14
15
  };
@@ -1,69 +1,71 @@
1
- var it = Object.defineProperty, rt = Object.defineProperties;
2
- var ot = Object.getOwnPropertyDescriptors;
3
- var Ee = Object.getOwnPropertySymbols;
4
- var st = Object.prototype.hasOwnProperty, at = Object.prototype.propertyIsEnumerable;
5
- var je = (k, C, f) => C in k ? it(k, C, { enumerable: !0, configurable: !0, writable: !0, value: f }) : k[C] = f, L = (k, C) => {
1
+ var ot = Object.defineProperty, st = Object.defineProperties;
2
+ var at = Object.getOwnPropertyDescriptors;
3
+ var Qe = Object.getOwnPropertySymbols;
4
+ var ct = Object.prototype.hasOwnProperty, lt = Object.prototype.propertyIsEnumerable;
5
+ var Be = (k, C, f) => C in k ? ot(k, C, { enumerable: !0, configurable: !0, writable: !0, value: f }) : k[C] = f, L = (k, C) => {
6
6
  for (var f in C || (C = {}))
7
- st.call(C, f) && je(k, f, C[f]);
8
- if (Ee)
9
- for (var f of Ee(C))
10
- at.call(C, f) && je(k, f, C[f]);
7
+ ct.call(C, f) && Be(k, f, C[f]);
8
+ if (Qe)
9
+ for (var f of Qe(C))
10
+ lt.call(C, f) && Be(k, f, C[f]);
11
11
  return k;
12
- }, j = (k, C) => rt(k, ot(C));
13
- var G = (k, C, f) => new Promise((z, h) => {
14
- var x = (y) => {
12
+ }, j = (k, C) => st(k, at(C));
13
+ var z = (k, C, f) => new Promise((M, h) => {
14
+ var x = (v) => {
15
15
  try {
16
- R(f.next(y));
16
+ R(f.next(v));
17
17
  } catch (H) {
18
18
  h(H);
19
19
  }
20
- }, ge = (y) => {
20
+ }, ge = (v) => {
21
21
  try {
22
- R(f.throw(y));
22
+ R(f.throw(v));
23
23
  } catch (H) {
24
24
  h(H);
25
25
  }
26
- }, R = (y) => y.done ? z(y.value) : Promise.resolve(y.value).then(x, ge);
26
+ }, R = (v) => v.done ? M(v.value) : Promise.resolve(v.value).then(x, ge);
27
27
  R((f = f.apply(k, C)).next());
28
28
  });
29
- import { jsxs as K, jsx as c, Fragment as ct } from "react/jsx-runtime";
30
- import { Tabs as Re, message as $, Spin as lt, Space as Qe, Button as ue, Modal as dt } from "antd";
31
- import { forwardRef as ft, useContext as ut, useRef as Q, useState as g, useEffect as re, useImperativeHandle as gt } from "react";
29
+ import { jsxs as K, jsx as l, Fragment as dt } from "react/jsx-runtime";
30
+ import { Tabs as Re, message as $, Spin as ft, Space as He, Button as ue, Modal as ut } from "antd";
31
+ import { forwardRef as gt, useContext as ht, useMemo as pt, useRef as Q, useState as g, useEffect as re, useImperativeHandle as mt } from "react";
32
32
  import "./style.less.mjs";
33
- import ht from "../../DataEmpty/index.mjs";
34
- import pt from "../../../DatasetContext/index.mjs";
35
- import mt from "../../VLMAnnotation/index.mjs";
36
- import xt from "axios";
37
- import yt from "../MarkVLMBoxModal/AttributeDetail/index.mjs";
38
- import vt from "../MarkVLMBoxModal/QADetail/index.mjs";
33
+ import xt from "../../DataEmpty/index.mjs";
34
+ import vt from "../../../DatasetContext/index.mjs";
35
+ import yt from "../../VLMAnnotation/index.mjs";
36
+ import Ct from "axios";
37
+ import St from "../MarkVLMBoxModal/AttributeDetail/index.mjs";
38
+ import wt from "../MarkVLMBoxModal/QADetail/index.mjs";
39
+ import { createTokenResolver as It } from "../../../utils/index.mjs";
39
40
  const {
40
41
  TabPane: Y
41
- } = Re, qt = ft((k, C) => {
42
+ } = Re, Gt = gt((k, C) => {
42
43
  const {
43
44
  visible: f,
44
- selectSampleId: z,
45
+ selectSampleId: M,
45
46
  datasetId: h,
46
47
  versionId: x,
47
48
  onClose: ge,
48
49
  onSave: R,
49
- externalSamples: y,
50
+ externalSamples: v,
50
51
  externalPagination: H,
51
52
  externalCurrentIndex: he,
52
53
  externalFilterMode: Ve,
53
54
  onFilterModeChange: pe
54
55
  } = k, {
55
56
  services: {
56
- cvforceDatahub: l
57
+ cvforceDatahub: d
57
58
  },
58
- token: Be,
59
- apiUrl: Le
60
- } = ut(pt), O = Q(null), [r, I] = g(), b = Q(void 0), [Ct, me] = g(0), [v, F] = g(() => z && (y != null && y.length) ? y : []), [E, M] = g(() => z && he !== void 0 ? he : -1), [s, q] = g(() => z && H ? L({}, H) : {
59
+ token: Le,
60
+ getToken: ze,
61
+ apiUrl: Me
62
+ } = ht(vt), Ke = pt(() => It(Le, ze), [Le, ze]), O = Q(null), [r, w] = g(), b = Q(void 0), [bt, me] = g(0), [y, F] = g(() => M && (v != null && v.length) ? v : []), [E, T] = g(() => M && he !== void 0 ? he : -1), [s, q] = g(() => M && H ? L({}, H) : {
61
63
  current: 1,
62
64
  pageSize: 100
63
- }), [ze, Me] = g(0), [qe, Ne] = g(0), [p, oe] = g(() => z && Ve ? Ve : z ? "" : "nocode"), [xe, W] = g(), Z = Q({}), [ye, Te] = g([]), [m, se] = g("textAnnotation"), [_, J] = g(), [ae, N] = g(!1), ce = Q(0), ve = Q(0), [Ce, He] = g(!1), [le, de] = g(!1), [Se, Ie] = g(!1), [Ue, Pe] = g(!1), [fe, we] = g(!1), B = Q(null), V = Q(null), be = Q(!1), ke = Q(!1), [Ke, Oe] = g(() => Date.now()), [We, Je] = g(() => Date.now());
65
+ }), [Te, qe] = g(0), [Ne, Ue] = g(0), [p, oe] = g(() => M && Ve ? Ve : M ? "" : "nocode"), [xe, W] = g(), Z = Q({}), [ve, Pe] = g([]), [m, se] = g("textAnnotation"), [_, J] = g(), [ae, N] = g(!1), ce = Q(0), ye = Q(0), [Ce, Oe] = g(!1), [le, de] = g(!1), [Se, we] = g(!1), [Ge, $e] = g(!1), [fe, Ie] = g(!1), B = Q(null), V = Q(null), be = Q(!1), ke = Q(!1), [We, Je] = g(() => Date.now()), [Xe, Ye] = g(() => Date.now());
64
66
  re(() => {
65
- f && (!h || !x || l == null || l.getDatasetsIdVersionsVidConfigs(h, x).then((e) => {
66
- Te(e || []), (e == null ? void 0 : e.length) > 0 ? se("textAnnotation") : se("attributeDefinition");
67
+ f && (!h || !x || d == null || d.getDatasetsIdVersionsVidConfigs(h, x).then((e) => {
68
+ Pe(e || []), (e == null ? void 0 : e.length) > 0 ? se("textAnnotation") : se("attributeDefinition");
67
69
  }));
68
70
  }, [f]), re(() => {
69
71
  const e = s.current || 1, t = s.pageSize || 100, i = s.type;
@@ -73,142 +75,142 @@ const {
73
75
  ke.current = !1;
74
76
  return;
75
77
  }
76
- if (!be.current && z && (y != null && y.length) && H && he !== void 0) {
77
- const ee = y.find((D) => D.id === z);
78
+ if (!be.current && M && (v != null && v.length) && H && he !== void 0) {
79
+ const ee = v.find((D) => D.id === M);
78
80
  if (ee) {
79
- be.current = !0, I(ee), me(y.length), A();
81
+ be.current = !0, w(ee), me(v.length), A();
80
82
  return;
81
83
  }
82
84
  }
83
85
  const n = ++ce.current;
84
- Ie(!0);
85
- const d = v || [], o = be.current ? xe : z || xe, S = Z.current[p], u = S == null ? void 0 : S.index, a = S == null ? void 0 : S.page, w = !i && !o && !!a && a > 1, T = w ? 1 : e, U = w ? a * t : t;
86
- l == null || l.getDatasetsIdVersionsVidSamples(h, x, {
86
+ we(!0);
87
+ const a = y || [], o = be.current ? xe : M || xe, S = Z.current[p], u = S == null ? void 0 : S.index, c = S == null ? void 0 : S.page, I = !i && !o && !!c && c > 1, U = I ? 1 : e, P = I ? c * t : t;
88
+ d == null || d.getDatasetsIdVersionsVidSamples(h, x, {
87
89
  labels: p ? [p] : void 0,
88
- pageNo: T,
89
- pageSize: U
90
+ pageNo: U,
91
+ pageSize: P
90
92
  }).then((ee) => {
91
- var Fe;
93
+ var je;
92
94
  if (n !== ce.current)
93
95
  return;
94
- const D = ee.recordList || [], P = T === 1 && !i ? D : i === "prev" ? [...D, ...d] : i === "next" ? [...d, ...D] : D;
95
- F(P), w && (ke.current = !0);
96
- const $e = (Fe = ee.totalResults) != null ? Fe : 0, De = Math.max(1, Math.ceil($e / t) || 1), nt = Math.min(w ? a : e, De);
97
- if (w && a != null && a > De) {
98
- const ne = Math.min(u != null ? u : 0, Math.max(0, P.length - 1));
96
+ const D = ee.recordList || [], G = U === 1 && !i ? D : i === "prev" ? [...D, ...a] : i === "next" ? [...a, ...D] : D;
97
+ F(G), I && (ke.current = !0);
98
+ const Ee = (je = ee.totalResults) != null ? je : 0, De = Math.max(1, Math.ceil(Ee / t) || 1), rt = Math.min(I ? c : e, De);
99
+ if (I && c != null && c > De) {
100
+ const ne = Math.min(u != null ? u : 0, Math.max(0, G.length - 1));
99
101
  Z.current[p] = {
100
102
  index: ne,
101
103
  page: De
102
104
  };
103
105
  }
104
106
  q(j(L({}, s), {
105
- current: nt,
107
+ current: rt,
106
108
  pageSize: t,
107
- total: $e,
109
+ total: Ee,
108
110
  type: void 0
109
111
  }));
110
- let te = 0, X = P[0];
112
+ let te = 0, X = G[0];
111
113
  if (i === "next" && D.length)
112
- te = d.length, X = D[0];
114
+ te = a.length, X = D[0];
113
115
  else if (i === "prev" && D.length)
114
116
  te = D.length - 1, X = D[D.length - 1];
115
117
  else if (o) {
116
- const ne = P.findIndex((ie) => ie.id === o);
118
+ const ne = G.findIndex((ie) => ie.id === o);
117
119
  if (ne !== -1)
118
- te = ne, X = P[ne];
120
+ te = ne, X = G[ne];
119
121
  else {
120
- l == null || l.getDatasetsIdVersionsVidSsamplesSid(h, x, o).then((ie) => {
121
- n === ce.current && ie && (F([ie, ...P]), I(ie), M(0), me(P.length + 1), W(void 0));
122
+ d == null || d.getDatasetsIdVersionsVidSsamplesSid(h, x, o).then((ie) => {
123
+ n === ce.current && ie && (F([ie, ...G]), w(ie), T(0), me(G.length + 1), W(void 0));
122
124
  });
123
125
  return;
124
126
  }
125
127
  } else
126
- u !== void 0 && u >= 0 && u < P.length && (te = u, X = P[u]);
127
- X && (I(X), M(te), me(P.length), xe && W(void 0));
128
+ u !== void 0 && u >= 0 && u < G.length && (te = u, X = G[u]);
129
+ X && (w(X), T(te), me(G.length), xe && W(void 0));
128
130
  }).finally(() => {
129
- n === ce.current && Ie(!1);
131
+ n === ce.current && we(!1);
130
132
  }), A();
131
133
  }, [s.current, p, h, x]);
132
134
  const A = () => {
133
- !h || !x || l == null || l.getDatasetsIdVersionsVidLabelcount(h, x).then((e) => {
135
+ !h || !x || d == null || d.getDatasetsIdVersionsVidLabelcount(h, x).then((e) => {
134
136
  const t = e.find((n) => n.id === "allcodeid"), i = e.find((n) => n.id === "nocodeid");
135
- Me(t ? t.count : 0), Ne(i ? i.count : 0);
137
+ qe(t ? t.count : 0), Ue(i ? i.count : 0);
136
138
  });
137
139
  }, Ae = () => {
138
- v && F((e) => {
139
- var S, u, a, w;
140
+ y && F((e) => {
141
+ var S, u, c, I;
140
142
  const t = b.current || r, i = [...e];
141
143
  let n;
142
144
  if (t) {
143
- const T = i.findIndex((U) => U.id === t.id);
144
- T > -1 && i.splice(T, 1, t);
145
+ const U = i.findIndex((P) => P.id === t.id);
146
+ U > -1 && i.splice(U, 1, t);
145
147
  }
146
- const d = !t || (S = t.labels) != null && S.length && p === "hascode" || !((u = t.labels) != null && u.length) && p === "nocode" || p === "" ? E + 1 : E;
147
- if (t && ((a = t.labels) != null && a.length && p === "nocode" || !((w = t.labels) != null && w.length) && p === "hascode")) {
148
- const T = i.findIndex((U) => U.id === t.id);
149
- T > -1 && (i.splice(T, 1), n = [...i], q((U) => j(L({}, U), {
150
- total: U.total ? U.total - 1 : U.total
148
+ const a = !t || (S = t.labels) != null && S.length && p === "hascode" || !((u = t.labels) != null && u.length) && p === "nocode" || p === "" ? E + 1 : E;
149
+ if (t && ((c = t.labels) != null && c.length && p === "nocode" || !((I = t.labels) != null && I.length) && p === "hascode")) {
150
+ const U = i.findIndex((P) => P.id === t.id);
151
+ U > -1 && (i.splice(U, 1), n = [...i], q((P) => j(L({}, P), {
152
+ total: P.total ? P.total - 1 : P.total
151
153
  })));
152
154
  }
153
155
  const o = n || i;
154
- return d >= o.length ? ((s.current - 1) * s.pageSize + d, s.total && d >= s.total ? $.error("已经是最后一个了") : q({
156
+ return a >= o.length ? ((s.current - 1) * s.pageSize + a, s.total && a >= s.total ? $.error("已经是最后一个了") : q({
155
157
  current: s.current + 1,
156
158
  pageSize: s.pageSize,
157
159
  type: "next"
158
160
  })) : setTimeout(() => {
159
- M(d);
160
- const T = o[d];
161
- I(T);
161
+ T(a);
162
+ const U = o[a];
163
+ w(U);
162
164
  }, 0), o;
163
165
  });
164
- }, Ge = () => {
166
+ }, Fe = () => {
165
167
  var o, S;
166
- if (!v)
168
+ if (!y)
167
169
  return;
168
- const e = b.current || r, t = [...v];
170
+ const e = b.current || r, t = [...y];
169
171
  let i;
170
- if (e && v) {
171
- const u = t.findIndex((a) => a.id === e.id);
172
+ if (e && y) {
173
+ const u = t.findIndex((c) => c.id === e.id);
172
174
  if (u > -1 && t.splice(u, 1, e), (o = e.labels) != null && o.length && p === "nocode" || !((S = e.labels) != null && S.length) && p === "hascode") {
173
- const a = t.findIndex((w) => w.id === e.id);
174
- a > -1 && (t.splice(a, 1), i = [...t], q((w) => j(L({}, w), {
175
- total: w.total ? w.total - 1 : w.total
175
+ const c = t.findIndex((I) => I.id === e.id);
176
+ c > -1 && (t.splice(c, 1), i = [...t], q((I) => j(L({}, I), {
177
+ total: I.total ? I.total - 1 : I.total
176
178
  })));
177
179
  }
178
180
  }
179
- const n = i || t, d = E - 1;
180
- if (d < 0)
181
- (s.current - 1) * s.pageSize + d < 0 ? $.error("已经是第一个了") : q({
181
+ const n = i || t, a = E - 1;
182
+ if (a < 0)
183
+ (s.current - 1) * s.pageSize + a < 0 ? $.error("已经是第一个了") : q({
182
184
  current: s.current - 1,
183
185
  pageSize: s.pageSize,
184
186
  type: "prev"
185
187
  });
186
188
  else {
187
- M(d);
188
- const u = n[d];
189
- I(u);
189
+ T(a);
190
+ const u = n[a];
191
+ w(u);
190
192
  }
191
193
  i && F(i);
192
194
  };
193
195
  re(() => {
194
196
  if (!f || !h || !x || !r)
195
197
  return;
196
- const e = ++ve.current;
197
- Pe(!0), l == null || l.getDatasetsIdVersionsVidSsamplesSid(h, x, r.id).then((t) => {
198
- e === ve.current && I(t);
198
+ const e = ++ye.current;
199
+ $e(!0), d == null || d.getDatasetsIdVersionsVidSsamplesSid(h, x, r.id).then((t) => {
200
+ e === ye.current && w(t);
199
201
  }).finally(() => {
200
- e === ve.current && Pe(!1);
202
+ e === ye.current && $e(!1);
201
203
  });
202
204
  }, [f, r == null ? void 0 : r.id]);
203
- const Xe = () => G(void 0, null, function* () {
205
+ const Ze = () => z(void 0, null, function* () {
204
206
  m === "attributeDefinition" && B.current && !(yield B.current.checkDirtyAndConfirm()) || m === "qaGeneration" && V.current && !(yield V.current.checkDirtyAndConfirm()) || ge();
205
207
  });
206
- gt(C, () => ({
207
- handleModalCancel: Xe
208
+ mt(C, () => ({
209
+ handleModalCancel: Ze
208
210
  })), re(() => {
209
211
  O.current && (O.current.width = O.current.offsetWidth, O.current.height = O.current.offsetHeight);
210
212
  }, [O.current]);
211
- const Ye = () => G(void 0, null, function* () {
213
+ const _e = () => z(void 0, null, function* () {
212
214
  if (ae)
213
215
  return;
214
216
  if (N(!0), m === "qaGeneration" && V.current && !(yield V.current.checkDirtyAndConfirm())) {
@@ -221,11 +223,11 @@ const {
221
223
  return;
222
224
  }
223
225
  console.log("onPrevClick sampleToUse", e), m === "textAnnotation" && _ ? (de(!0), R(e).then((t) => {
224
- t ? (J(void 0), Ge(), A()) : $.error("保存失败");
226
+ t ? (J(void 0), Fe(), A()) : $.error("保存失败");
225
227
  }).finally(() => {
226
228
  de(!1), N(!1);
227
- })) : (Ge(), N(!1));
228
- }), Ze = () => G(void 0, null, function* () {
229
+ })) : (Fe(), N(!1));
230
+ }), et = () => z(void 0, null, function* () {
229
231
  if (ae)
230
232
  return;
231
233
  if (N(!0), m === "qaGeneration" && V.current && !(yield V.current.checkDirtyAndConfirm())) {
@@ -246,44 +248,48 @@ const {
246
248
  re(() => {
247
249
  b.current = r;
248
250
  }, [r]);
249
- const _e = (e) => (console.log("ocrRecognize apiUrl", Le), xt.post(`${Le}/aishop/v2/infer?serviceId=Actpkb4pi3vxg`, {
250
- pages: [{
251
- image: e,
252
- no: 0
253
- }]
254
- }, {
255
- headers: {
256
- Authorization: `Bearer ${Be}`
257
- }
258
- }).then((t) => (console.log("ocrRecognize res", t.data.data), t.data.data.pages[0].layout.filter((n) => n.content))).catch((t) => {
259
- console.error("ocrRecognize error", t);
260
- })), et = () => G(void 0, null, function* () {
251
+ const tt = (e) => z(void 0, null, function* () {
252
+ console.log("ocrRecognize apiUrl", Me);
253
+ const t = yield Ke();
254
+ return Ct.post(`${Me}/aishop/v2/infer?serviceId=Actpkb4pi3vxg`, {
255
+ pages: [{
256
+ image: e,
257
+ no: 0
258
+ }]
259
+ }, {
260
+ headers: {
261
+ Authorization: t ? `Bearer ${t}` : ""
262
+ }
263
+ }).then((i) => (console.log("ocrRecognize res", i.data.data), i.data.data.pages[0].layout.filter((a) => a.content))).catch((i) => {
264
+ console.error("ocrRecognize error", i);
265
+ });
266
+ }), nt = () => z(void 0, null, function* () {
261
267
  const e = b.current || r;
262
- !e || !h || !x || dt.confirm({
268
+ !e || !h || !x || ut.confirm({
263
269
  title: "确认要删除此数据吗?",
264
270
  content: "删除后不可恢复,请慎重操作",
265
- onOk: () => G(void 0, null, function* () {
271
+ onOk: () => z(void 0, null, function* () {
266
272
  console.log("handleDeleteClick currentSample", e);
267
273
  try {
268
- yield l == null ? void 0 : l.delDatasetsIdVersionsVidSamplesId(h, x, e.id), $.success("删除成功"), F((t) => {
274
+ yield d == null ? void 0 : d.delDatasetsIdVersionsVidSamplesId(h, x, e.id), $.success("删除成功"), F((t) => {
269
275
  var u;
270
- const i = t.findIndex((a) => a.id === e.id);
276
+ const i = t.findIndex((c) => c.id === e.id);
271
277
  if (i === -1)
272
278
  return t;
273
- const n = [...t.slice(0, i), ...t.slice(i + 1)], d = s.pageSize || 1, o = Math.max(((u = s.total) != null ? u : t.length) - 1, 0), S = n.length === 0 && o > s.current * d;
274
- if (q((a) => L(j(L({}, a), {
279
+ const n = [...t.slice(0, i), ...t.slice(i + 1)], a = s.pageSize || 1, o = Math.max(((u = s.total) != null ? u : t.length) - 1, 0), S = n.length === 0 && o > s.current * a;
280
+ if (q((c) => L(j(L({}, c), {
275
281
  total: o
276
282
  }), S ? {
277
- current: a.current + 1,
278
- pageSize: d,
283
+ current: c.current + 1,
284
+ pageSize: a,
279
285
  type: "next"
280
286
  } : {
281
287
  type: S ? "next" : void 0
282
288
  })), n.length) {
283
- const a = Math.min(i, n.length - 1);
284
- M(a), I(n[a]);
289
+ const c = Math.min(i, n.length - 1);
290
+ T(c), w(n[c]);
285
291
  } else
286
- M(-1), I(void 0);
292
+ T(-1), w(void 0);
287
293
  return n;
288
294
  }), A();
289
295
  } catch (t) {
@@ -291,21 +297,21 @@ const {
291
297
  }
292
298
  })
293
299
  });
294
- }), tt = () => G(void 0, null, function* () {
300
+ }), it = () => z(void 0, null, function* () {
295
301
  if (!h || !x || !(r != null && r.id))
296
302
  return;
297
- const e = yield l == null ? void 0 : l.getDatasetsIdVersionsVidSsamplesSid(h, x, r.id);
298
- e && (I(e), b.current = e);
303
+ const e = yield d == null ? void 0 : d.getDatasetsIdVersionsVidSsamplesSid(h, x, r.id);
304
+ e && (w(e), b.current = e);
299
305
  });
300
306
  return /* @__PURE__ */ K("div", {
301
307
  className: "vlm-records-content",
302
- children: [/* @__PURE__ */ c("div", {
308
+ children: [/* @__PURE__ */ l("div", {
303
309
  className: "records-content-tabs-container",
304
310
  children: /* @__PURE__ */ K(Re, {
305
311
  className: "records-content-tabs",
306
312
  activeKey: p,
307
- onChange: (e) => G(void 0, null, function* () {
308
- var i, n, d;
313
+ onChange: (e) => z(void 0, null, function* () {
314
+ var i, n, a;
309
315
  E >= 0 && p !== void 0 && p !== null && (Z.current[p] = {
310
316
  index: E,
311
317
  page: s.current || 1
@@ -319,35 +325,35 @@ const {
319
325
  $.error("保存失败,已阻止切换筛选");
320
326
  return;
321
327
  }
322
- I(o), b.current = o, J(void 0), A == null || A(), p === "nocode" && ((d = o == null ? void 0 : o.labels) != null && d.length) && (F([]), I(o), M(-1), W(o.id), q(j(L({}, s), {
328
+ w(o), b.current = o, J(void 0), A == null || A(), p === "nocode" && ((a = o == null ? void 0 : o.labels) != null && a.length) && (F([]), w(o), T(-1), W(o.id), q(j(L({}, s), {
323
329
  current: 1,
324
330
  total: void 0,
325
331
  type: void 0
326
332
  })), oe("hascode"));
327
333
  }
328
334
  }
329
- t && Oe(Date.now()), Je(Date.now()), m !== "attributeDefinition" && (Ie(!0), F([]), I(void 0), M(-1), W(void 0)), q(j(L({}, s), {
335
+ t && Je(Date.now()), Ye(Date.now()), m !== "attributeDefinition" && (we(!0), F([]), w(void 0), T(-1), W(void 0)), q(j(L({}, s), {
330
336
  current: 1,
331
337
  total: void 0,
332
338
  type: void 0
333
339
  })), oe(e), pe == null || pe(e);
334
340
  }
335
341
  }),
336
- children: [/* @__PURE__ */ c(Y, {
337
- tab: `全部(${ze})`
338
- }, ""), /* @__PURE__ */ c(Y, {
339
- tab: `未标注(${qe})`
340
- }, "nocode"), /* @__PURE__ */ c(Y, {
341
- tab: `已标注(${ze - qe})`
342
+ children: [/* @__PURE__ */ l(Y, {
343
+ tab: `全部(${Te})`
344
+ }, ""), /* @__PURE__ */ l(Y, {
345
+ tab: `未标注(${Ne})`
346
+ }, "nocode"), /* @__PURE__ */ l(Y, {
347
+ tab: `已标注(${Te - Ne})`
342
348
  }, "hascode")]
343
349
  })
344
- }), v != null && v.length ? /* @__PURE__ */ K("div", {
350
+ }), y != null && y.length ? /* @__PURE__ */ K("div", {
345
351
  className: "sample-detail",
346
- children: [/* @__PURE__ */ c("div", {
352
+ children: [/* @__PURE__ */ l("div", {
347
353
  className: "content-mode-buttons",
348
354
  children: /* @__PURE__ */ K(Re, {
349
355
  activeKey: m,
350
- onChange: (e) => G(void 0, null, function* () {
356
+ onChange: (e) => z(void 0, null, function* () {
351
357
  var t, i;
352
358
  if (!(m === "attributeDefinition" && B.current && !(yield B.current.checkDirtyAndConfirm())) && !(m === "qaGeneration" && V.current && !(yield V.current.checkDirtyAndConfirm()))) {
353
359
  if (m === "textAnnotation" && R && _ && (b.current || r)) {
@@ -356,111 +362,111 @@ const {
356
362
  $.error("保存失败,已阻止切换页签");
357
363
  return;
358
364
  }
359
- I(n), b.current = n, J(void 0), A == null || A(), p === "nocode" && ((t = n == null ? void 0 : n.labels) != null && t.length) && (E >= 0 && (Z.current.nocode = {
365
+ w(n), b.current = n, J(void 0), A == null || A(), p === "nocode" && ((t = n == null ? void 0 : n.labels) != null && t.length) && (E >= 0 && (Z.current.nocode = {
360
366
  index: E,
361
367
  page: s.current || 1
362
- }), F([]), I(n), M(-1), W(n.id), q(j(L({}, s), {
368
+ }), F([]), w(n), T(-1), W(n.id), q(j(L({}, s), {
363
369
  current: 1,
364
370
  total: void 0,
365
371
  type: void 0
366
372
  })), oe("hascode")), p === "hascode" && !((i = n == null ? void 0 : n.labels) != null && i.length) && (E >= 0 && (Z.current.hascode = {
367
373
  index: E,
368
374
  page: s.current || 1
369
- }), F([]), I(n), M(-1), W(n.id), q(j(L({}, s), {
375
+ }), F([]), w(n), T(-1), W(n.id), q(j(L({}, s), {
370
376
  current: 1,
371
377
  total: void 0,
372
378
  type: void 0
373
379
  })), oe("nocode"));
374
380
  }
375
- e === "textAnnotation" && (r != null && r.id) && (yield tt()), se(e);
381
+ e === "textAnnotation" && (r != null && r.id) && (yield it()), se(e);
376
382
  }
377
383
  }),
378
- children: [/* @__PURE__ */ c(Y, {
384
+ children: [/* @__PURE__ */ l(Y, {
379
385
  tab: "属性定义",
380
386
  disabled: Ce
381
- }, "attributeDefinition"), /* @__PURE__ */ c(Y, {
387
+ }, "attributeDefinition"), /* @__PURE__ */ l(Y, {
382
388
  tab: "文本标注",
383
389
  disabled: Ce
384
- }, "textAnnotation"), /* @__PURE__ */ c(Y, {
390
+ }, "textAnnotation"), /* @__PURE__ */ l(Y, {
385
391
  tab: "QA生成",
386
392
  disabled: Ce
387
393
  }, "qaGeneration")]
388
394
  })
389
- }), m === "textAnnotation" && r && /* @__PURE__ */ c("div", {
395
+ }), m === "textAnnotation" && r && /* @__PURE__ */ l("div", {
390
396
  className: "container",
391
- children: /* @__PURE__ */ c(mt, {
397
+ children: /* @__PURE__ */ l(yt, {
392
398
  sample: r,
393
- labelDefinitions: ye,
399
+ labelDefinitions: ve,
394
400
  onChange: (e) => {
395
401
  console.log("接收到 VLMAnnotation onChange", e), b.current = e, J(e);
396
402
  },
397
- ocrRecognize: _e
403
+ ocrRecognize: tt
398
404
  })
399
- }), m === "attributeDefinition" && /* @__PURE__ */ c(yt, {
405
+ }), m === "attributeDefinition" && /* @__PURE__ */ l(St, {
400
406
  ref: B,
401
407
  datasetId: h,
402
408
  versionId: x,
403
409
  onAttributesChange: (e) => {
404
- Te(e), e.length > 0 && ye.length === 0 && se("textAnnotation");
410
+ Pe(e), e.length > 0 && ve.length === 0 && se("textAnnotation");
405
411
  },
406
412
  onLoadingChange: (e) => {
407
- He(e);
413
+ Oe(e);
408
414
  }
409
- }, `attribute-${Ke}`), m === "qaGeneration" && /* @__PURE__ */ c(vt, {
415
+ }, `attribute-${We}`), m === "qaGeneration" && /* @__PURE__ */ l(wt, {
410
416
  ref: V,
411
417
  sample: r,
412
- labels: ye,
418
+ labels: ve,
413
419
  datasetId: h,
414
420
  visionId: x
415
- }, `qa-${We}`)]
416
- }) : Se ? /* @__PURE__ */ c("div", {
421
+ }, `qa-${Xe}`)]
422
+ }) : Se ? /* @__PURE__ */ l("div", {
417
423
  style: {
418
424
  padding: "48px 0",
419
425
  textAlign: "center"
420
426
  },
421
- children: /* @__PURE__ */ c(lt, {})
422
- }) : /* @__PURE__ */ c(ht, {}), m !== "attributeDefinition" ? /* @__PURE__ */ K("div", {
427
+ children: /* @__PURE__ */ l(ft, {})
428
+ }) : /* @__PURE__ */ l(xt, {}), m !== "attributeDefinition" ? /* @__PURE__ */ K("div", {
423
429
  className: "vlm-detail-footer",
424
- children: [/* @__PURE__ */ c("div", {
430
+ children: [/* @__PURE__ */ l("div", {
425
431
  style: {
426
432
  flex: 1
427
433
  }
428
- }), /* @__PURE__ */ K(Qe, {
434
+ }), /* @__PURE__ */ K(He, {
429
435
  size: 24,
430
- children: [(v == null ? void 0 : v.length) > 0 && /* @__PURE__ */ c(ue, {
436
+ children: [(y == null ? void 0 : y.length) > 0 && /* @__PURE__ */ l(ue, {
431
437
  type: "default",
432
- disabled: Ue || Se || le || ae || fe,
433
- onClick: Ye,
438
+ disabled: Ge || Se || le || ae || fe,
439
+ onClick: _e,
434
440
  children: "上一张"
435
- }, "prev"), (v == null ? void 0 : v.length) > 0 && /* @__PURE__ */ c(ue, {
441
+ }, "prev"), (y == null ? void 0 : y.length) > 0 && /* @__PURE__ */ l(ue, {
436
442
  type: "default",
437
- disabled: Ue || Se || le || ae || fe,
438
- onClick: Ze,
443
+ disabled: Ge || Se || le || ae || fe,
444
+ onClick: et,
439
445
  children: "下一张"
440
446
  }, "next")]
441
- }), /* @__PURE__ */ c("div", {
447
+ }), /* @__PURE__ */ l("div", {
442
448
  style: {
443
449
  flex: 1,
444
450
  display: "flex",
445
451
  justifyContent: "flex-end"
446
452
  },
447
- children: /* @__PURE__ */ c(Qe, {
448
- children: m === "textAnnotation" && (v == null ? void 0 : v.length) > 0 ? /* @__PURE__ */ K(ct, {
449
- children: [/* @__PURE__ */ c(ue, {
453
+ children: /* @__PURE__ */ l(He, {
454
+ children: m === "textAnnotation" && (y == null ? void 0 : y.length) > 0 ? /* @__PURE__ */ K(dt, {
455
+ children: [/* @__PURE__ */ l(ue, {
450
456
  disabled: !r || !_ || le,
451
457
  type: "primary",
452
458
  onClick: () => {
453
459
  const e = b.current || r;
454
- e && (we(!0), console.log("save currentSample", e), R(e).then((t) => G(void 0, null, function* () {
455
- t ? ($.success("保存成功"), J(void 0), Ae(), A(), we(!1)) : ($.error("保存失败"), we(!1));
460
+ e && (Ie(!0), console.log("save currentSample", e), R(e).then((t) => z(void 0, null, function* () {
461
+ t ? ($.success("保存成功"), J(void 0), Ae(), A(), Ie(!1)) : ($.error("保存失败"), Ie(!1));
456
462
  })));
457
463
  },
458
464
  loading: fe,
459
465
  children: "保存标注"
460
- }, "save"), /* @__PURE__ */ c(ue, {
466
+ }, "save"), /* @__PURE__ */ l(ue, {
461
467
  type: "default",
462
468
  disabled: fe || le,
463
- onClick: et,
469
+ onClick: nt,
464
470
  children: "删除数据"
465
471
  })]
466
472
  }) : null
@@ -470,5 +476,5 @@ const {
470
476
  });
471
477
  });
472
478
  export {
473
- qt as default
479
+ Gt as default
474
480
  };