@glodon-aiot/dataset-annotation 3.25.0-alpha.9 → 3.25.1-alpha.0

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