@glodon-aiot/dataset-annotation 3.19.0-alpha.20 → 3.19.0-alpha.22

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