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

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,15 +1,15 @@
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 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) => {
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
+ 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]);
11
11
  return k;
12
- }, j = (k, C) => rt(k, ot(C));
12
+ }, j = (k, C) => ot(k, st(C));
13
13
  var G = (k, C, f) => new Promise((z, h) => {
14
14
  var x = (y) => {
15
15
  try {
@@ -26,19 +26,19 @@ var G = (k, C, f) => new Promise((z, h) => {
26
26
  }, R = (y) => y.done ? z(y.value) : Promise.resolve(y.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 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";
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 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";
39
39
  const {
40
40
  TabPane: Y
41
- } = Re, qt = ft((k, C) => {
41
+ } = Ve, Nt = ut((k, C) => {
42
42
  const {
43
43
  visible: f,
44
44
  selectSampleId: z,
@@ -49,239 +49,245 @@ const {
49
49
  externalSamples: y,
50
50
  externalPagination: H,
51
51
  externalCurrentIndex: he,
52
- externalFilterMode: Ve,
52
+ externalFilterMode: Le,
53
53
  onFilterModeChange: pe
54
54
  } = k, {
55
55
  services: {
56
- cvforceDatahub: l
56
+ cvforceDatahub: d
57
57
  },
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) : {
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) : {
61
62
  current: 1,
62
63
  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());
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());
64
65
  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");
66
+ 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");
67
68
  }));
68
69
  }, [f]), re(() => {
69
70
  const e = s.current || 1, t = s.pageSize || 100, i = s.type;
70
71
  if (!h || !x)
71
72
  return;
72
- if (ke.current) {
73
- ke.current = !1;
73
+ if (Ae.current) {
74
+ Ae.current = !1;
74
75
  return;
75
76
  }
76
- if (!be.current && z && (y != null && y.length) && H && he !== void 0) {
77
+ if (!ke.current && z && (y != null && y.length) && H && he !== void 0) {
77
78
  const ee = y.find((D) => D.id === z);
78
79
  if (ee) {
79
- be.current = !0, I(ee), me(y.length), A();
80
+ ke.current = !0, I(ee), xe(y.length), A();
80
81
  return;
81
82
  }
82
83
  }
83
84
  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, {
85
+ 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
+ d == null || d.getDatasetsIdVersionsVidSamples(h, x, {
87
88
  labels: p ? [p] : void 0,
88
89
  pageNo: T,
89
90
  pageSize: U
90
91
  }).then((ee) => {
91
- var Fe;
92
+ var Ee;
92
93
  if (n !== ce.current)
93
94
  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) {
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) {
98
99
  const ne = Math.min(u != null ? u : 0, Math.max(0, P.length - 1));
99
100
  Z.current[p] = {
100
101
  index: ne,
101
- page: De
102
+ page: Re
102
103
  };
103
104
  }
104
105
  q(j(L({}, s), {
105
- current: nt,
106
+ current: it,
106
107
  pageSize: t,
107
- total: $e,
108
+ total: Fe,
108
109
  type: void 0
109
110
  }));
110
111
  let te = 0, X = P[0];
111
112
  if (i === "next" && D.length)
112
- te = d.length, X = D[0];
113
+ te = a.length, X = D[0];
113
114
  else if (i === "prev" && D.length)
114
115
  te = D.length - 1, X = D[D.length - 1];
115
- else if (o) {
116
- const ne = P.findIndex((ie) => ie.id === o);
116
+ else if (r) {
117
+ const ne = P.findIndex((ie) => ie.id === r);
117
118
  if (ne !== -1)
118
119
  te = ne, X = P[ne];
119
120
  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));
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
123
  });
123
124
  return;
124
125
  }
125
126
  } else
126
127
  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
+ X && (I(X), M(te), xe(P.length), ye && W(void 0));
128
129
  }).finally(() => {
129
- n === ce.current && Ie(!1);
130
+ n === ce.current && we(!1);
130
131
  }), A();
131
132
  }, [s.current, p, h, x]);
132
133
  const A = () => {
133
- !h || !x || l == null || l.getDatasetsIdVersionsVidLabelcount(h, x).then((e) => {
134
+ !h || !x || d == null || d.getDatasetsIdVersionsVidLabelcount(h, x).then((e) => {
134
135
  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);
136
+ qe(t ? t.count : 0), Te(i ? i.count : 0);
136
137
  });
137
- }, Ae = () => {
138
+ }, De = () => {
138
139
  v && F((e) => {
139
- var S, u, a, w;
140
- const t = b.current || r, i = [...e];
140
+ var S, u, c, w;
141
+ const t = b.current || o, i = [...e];
141
142
  let n;
142
143
  if (t) {
143
144
  const T = i.findIndex((U) => U.id === t.id);
144
145
  T > -1 && i.splice(T, 1, t);
145
146
  }
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")) {
147
+ 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")) {
148
149
  const T = i.findIndex((U) => U.id === t.id);
149
150
  T > -1 && (i.splice(T, 1), n = [...i], q((U) => j(L({}, U), {
150
151
  total: U.total ? U.total - 1 : U.total
151
152
  })));
152
153
  }
153
- const o = n || i;
154
- return d >= o.length ? ((s.current - 1) * s.pageSize + d, s.total && d >= s.total ? $.error("已经是最后一个了") : q({
154
+ const r = n || i;
155
+ return a >= r.length ? ((s.current - 1) * s.pageSize + a, s.total && a >= s.total ? $.error("已经是最后一个了") : q({
155
156
  current: s.current + 1,
156
157
  pageSize: s.pageSize,
157
158
  type: "next"
158
159
  })) : setTimeout(() => {
159
- M(d);
160
- const T = o[d];
160
+ M(a);
161
+ const T = r[a];
161
162
  I(T);
162
- }, 0), o;
163
+ }, 0), r;
163
164
  });
164
- }, Ge = () => {
165
- var o, S;
165
+ }, $e = () => {
166
+ var r, S;
166
167
  if (!v)
167
168
  return;
168
- const e = b.current || r, t = [...v];
169
+ const e = b.current || o, t = [...v];
169
170
  let i;
170
171
  if (e && v) {
171
- const u = t.findIndex((a) => a.id === e.id);
172
- 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), {
172
+ 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), {
175
176
  total: w.total ? w.total - 1 : w.total
176
177
  })));
177
178
  }
178
179
  }
179
- const n = i || t, d = E - 1;
180
- if (d < 0)
181
- (s.current - 1) * s.pageSize + d < 0 ? $.error("已经是第一个了") : q({
180
+ const n = i || t, a = E - 1;
181
+ if (a < 0)
182
+ (s.current - 1) * s.pageSize + a < 0 ? $.error("已经是第一个了") : q({
182
183
  current: s.current - 1,
183
184
  pageSize: s.pageSize,
184
185
  type: "prev"
185
186
  });
186
187
  else {
187
- M(d);
188
- const u = n[d];
188
+ M(a);
189
+ const u = n[a];
189
190
  I(u);
190
191
  }
191
192
  i && F(i);
192
193
  };
193
194
  re(() => {
194
- if (!f || !h || !x || !r)
195
+ if (!f || !h || !x || !o)
195
196
  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);
197
+ const e = ++Ce.current;
198
+ Ge(!0), d == null || d.getDatasetsIdVersionsVidSsamplesSid(h, x, o.id).then((t) => {
199
+ e === Ce.current && I(t);
199
200
  }).finally(() => {
200
- e === ve.current && Pe(!1);
201
+ e === Ce.current && Ge(!1);
201
202
  });
202
- }, [f, r == null ? void 0 : r.id]);
203
- const Xe = () => G(void 0, null, function* () {
203
+ }, [f, o == null ? void 0 : o.id]);
204
+ const Ye = () => G(void 0, null, function* () {
204
205
  m === "attributeDefinition" && B.current && !(yield B.current.checkDirtyAndConfirm()) || m === "qaGeneration" && V.current && !(yield V.current.checkDirtyAndConfirm()) || ge();
205
206
  });
206
- gt(C, () => ({
207
- handleModalCancel: Xe
207
+ ht(C, () => ({
208
+ handleModalCancel: Ye
208
209
  })), re(() => {
209
210
  O.current && (O.current.width = O.current.offsetWidth, O.current.height = O.current.offsetHeight);
210
211
  }, [O.current]);
211
- const Ye = () => G(void 0, null, function* () {
212
+ const Ze = () => G(void 0, null, function* () {
212
213
  if (ae)
213
214
  return;
214
215
  if (N(!0), m === "qaGeneration" && V.current && !(yield V.current.checkDirtyAndConfirm())) {
215
216
  N(!1);
216
217
  return;
217
218
  }
218
- const e = b.current || r;
219
+ const e = b.current || o;
219
220
  if (!e) {
220
221
  N(!1);
221
222
  return;
222
223
  }
223
224
  console.log("onPrevClick sampleToUse", e), m === "textAnnotation" && _ ? (de(!0), R(e).then((t) => {
224
- t ? (J(void 0), Ge(), A()) : $.error("保存失败");
225
+ t ? (J(void 0), $e(), A()) : $.error("保存失败");
225
226
  }).finally(() => {
226
227
  de(!1), N(!1);
227
- })) : (Ge(), N(!1));
228
- }), Ze = () => G(void 0, null, function* () {
228
+ })) : ($e(), N(!1));
229
+ }), _e = () => G(void 0, null, function* () {
229
230
  if (ae)
230
231
  return;
231
232
  if (N(!0), m === "qaGeneration" && V.current && !(yield V.current.checkDirtyAndConfirm())) {
232
233
  N(!1);
233
234
  return;
234
235
  }
235
- const e = b.current || r;
236
+ const e = b.current || o;
236
237
  if (!e) {
237
238
  N(!1);
238
239
  return;
239
240
  }
240
241
  console.log("onNextClick sampleToUse", e), m === "textAnnotation" && _ ? (de(!0), R(e).then((t) => {
241
- t ? (J(void 0), Ae(), A()) : $.error("保存失败");
242
+ t ? (J(void 0), De(), A()) : $.error("保存失败");
242
243
  }).finally(() => {
243
244
  de(!1), N(!1);
244
- })) : (Ae(), N(!1));
245
+ })) : (De(), N(!1));
245
246
  });
246
247
  re(() => {
247
- b.current = r;
248
- }, [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* () {
261
- const e = b.current || r;
262
- !e || !h || !x || dt.confirm({
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`, {
255
+ pages: [{
256
+ image: e,
257
+ no: 0
258
+ }]
259
+ }, {
260
+ headers: {
261
+ Authorization: t ? `Bearer ${t}` : ""
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);
265
+ });
266
+ }, tt = () => G(void 0, null, function* () {
267
+ const e = b.current || o;
268
+ !e || !h || !x || ft.confirm({
263
269
  title: "确认要删除此数据吗?",
264
270
  content: "删除后不可恢复,请慎重操作",
265
271
  onOk: () => G(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), {
275
- total: o
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;
280
+ if (q((c) => L(j(L({}, c), {
281
+ total: r
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
+ M(c), I(n[c]);
285
291
  } else
286
292
  M(-1), I(void 0);
287
293
  return n;
@@ -291,21 +297,21 @@ const {
291
297
  }
292
298
  })
293
299
  });
294
- }), tt = () => G(void 0, null, function* () {
295
- if (!h || !x || !(r != null && r.id))
300
+ }), nt = () => G(void 0, null, function* () {
301
+ if (!h || !x || !(o != null && o.id))
296
302
  return;
297
- const e = yield l == null ? void 0 : l.getDatasetsIdVersionsVidSsamplesSid(h, x, r.id);
303
+ const e = yield d == null ? void 0 : d.getDatasetsIdVersionsVidSsamplesSid(h, x, o.id);
298
304
  e && (I(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
- children: /* @__PURE__ */ K(Re, {
310
+ children: /* @__PURE__ */ K(Ve, {
305
311
  className: "records-content-tabs",
306
312
  activeKey: p,
307
313
  onChange: (e) => G(void 0, null, function* () {
308
- var i, n, d;
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
@@ -313,45 +319,45 @@ const {
313
319
  let t = !1;
314
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()))) {
315
321
  if (m === "textAnnotation" && _) {
316
- const o = b.current || r;
317
- if (o && R) {
318
- if (!(yield R(o))) {
322
+ const r = b.current || o;
323
+ if (r && R) {
324
+ if (!(yield R(r))) {
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
+ 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), {
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 && We(Date.now()), Xe(Date.now()), m !== "attributeDefinition" && (we(!0), F([]), I(void 0), M(-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: `全部(${Me})`
344
+ }, ""), /* @__PURE__ */ l(Y, {
345
+ tab: `未标注(${Ne})`
346
+ }, "nocode"), /* @__PURE__ */ l(Y, {
347
+ tab: `已标注(${Me - Ne})`
342
348
  }, "hascode")]
343
349
  })
344
350
  }), v != null && v.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
- children: /* @__PURE__ */ K(Re, {
354
+ children: /* @__PURE__ */ K(Ve, {
349
355
  activeKey: m,
350
356
  onChange: (e) => G(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
- if (m === "textAnnotation" && R && _ && (b.current || r)) {
354
- const n = b.current || r;
359
+ if (m === "textAnnotation" && R && _ && (b.current || o)) {
360
+ const n = b.current || o;
355
361
  if (!(yield R(n))) {
356
362
  $.error("保存失败,已阻止切换页签");
357
363
  return;
@@ -372,95 +378,95 @@ const {
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" && (o != null && o.id) && (yield nt()), se(e);
376
382
  }
377
383
  }),
378
- children: [/* @__PURE__ */ c(Y, {
384
+ children: [/* @__PURE__ */ l(Y, {
379
385
  tab: "属性定义",
380
- disabled: Ce
381
- }, "attributeDefinition"), /* @__PURE__ */ c(Y, {
386
+ disabled: Se
387
+ }, "attributeDefinition"), /* @__PURE__ */ l(Y, {
382
388
  tab: "文本标注",
383
- disabled: Ce
384
- }, "textAnnotation"), /* @__PURE__ */ c(Y, {
389
+ disabled: Se
390
+ }, "textAnnotation"), /* @__PURE__ */ l(Y, {
385
391
  tab: "QA生成",
386
- disabled: Ce
392
+ disabled: Se
387
393
  }, "qaGeneration")]
388
394
  })
389
- }), m === "textAnnotation" && r && /* @__PURE__ */ c("div", {
395
+ }), m === "textAnnotation" && o && /* @__PURE__ */ l("div", {
390
396
  className: "container",
391
- children: /* @__PURE__ */ c(mt, {
392
- sample: r,
393
- labelDefinitions: ye,
397
+ children: /* @__PURE__ */ l(xt, {
398
+ sample: o,
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: et
398
404
  })
399
- }), m === "attributeDefinition" && /* @__PURE__ */ c(yt, {
405
+ }), m === "attributeDefinition" && /* @__PURE__ */ l(vt, {
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
+ Ue(e), e.length > 0 && ve.length === 0 && se("textAnnotation");
405
411
  },
406
412
  onLoadingChange: (e) => {
407
- He(e);
413
+ Ke(e);
408
414
  }
409
- }, `attribute-${Ke}`), m === "qaGeneration" && /* @__PURE__ */ c(vt, {
415
+ }, `attribute-${Oe}`), m === "qaGeneration" && /* @__PURE__ */ l(Ct, {
410
416
  ref: V,
411
- sample: r,
412
- labels: ye,
417
+ sample: o,
418
+ labels: ve,
413
419
  datasetId: h,
414
420
  visionId: x
415
- }, `qa-${We}`)]
416
- }) : Se ? /* @__PURE__ */ c("div", {
421
+ }, `qa-${Je}`)]
422
+ }) : Ie ? /* @__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(dt, {})
428
+ }) : /* @__PURE__ */ l(pt, {}), 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(Be, {
429
435
  size: 24,
430
- children: [(v == null ? void 0 : v.length) > 0 && /* @__PURE__ */ c(ue, {
436
+ children: [(v == null ? void 0 : v.length) > 0 && /* @__PURE__ */ l(ue, {
431
437
  type: "default",
432
- disabled: Ue || Se || le || ae || fe,
433
- onClick: Ye,
438
+ disabled: Pe || Ie || le || ae || fe,
439
+ onClick: Ze,
434
440
  children: "上一张"
435
- }, "prev"), (v == null ? void 0 : v.length) > 0 && /* @__PURE__ */ c(ue, {
441
+ }, "prev"), (v == null ? void 0 : v.length) > 0 && /* @__PURE__ */ l(ue, {
436
442
  type: "default",
437
- disabled: Ue || Se || le || ae || fe,
438
- onClick: Ze,
443
+ disabled: Pe || Ie || le || ae || fe,
444
+ onClick: _e,
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, {
450
- disabled: !r || !_ || le,
453
+ children: /* @__PURE__ */ l(Be, {
454
+ children: m === "textAnnotation" && (v == null ? void 0 : v.length) > 0 ? /* @__PURE__ */ K(lt, {
455
+ children: [/* @__PURE__ */ l(ue, {
456
+ disabled: !o || !_ || le,
451
457
  type: "primary",
452
458
  onClick: () => {
453
- 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));
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));
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: tt,
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
+ Nt as default
474
480
  };