@glodon-aiot/dataset-annotation 3.10.0-alpha.10 → 3.10.0-alpha.13

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,256 +1,256 @@
1
- var we = Object.defineProperty, ve = Object.defineProperties;
2
- var ke = Object.getOwnPropertyDescriptors;
3
- var le = Object.getOwnPropertySymbols;
4
- var Ie = Object.prototype.hasOwnProperty, be = Object.prototype.propertyIsEnumerable;
5
- var de = (x, c, o) => c in x ? we(x, c, { enumerable: !0, configurable: !0, writable: !0, value: o }) : x[c] = o, j = (x, c) => {
6
- for (var o in c || (c = {}))
7
- Ie.call(c, o) && de(x, o, c[o]);
8
- if (le)
9
- for (var o of le(c))
10
- be.call(c, o) && de(x, o, c[o]);
11
- return x;
12
- }, B = (x, c) => ve(x, ke(c));
13
- var M = (x, c, o) => new Promise((f, l) => {
14
- var H = (z) => {
1
+ var Ie = Object.defineProperty, ke = Object.defineProperties;
2
+ var be = Object.getOwnPropertyDescriptors;
3
+ var ue = Object.getOwnPropertySymbols;
4
+ var Ae = Object.prototype.hasOwnProperty, Ve = Object.prototype.propertyIsEnumerable;
5
+ var he = (v, l, o) => l in v ? Ie(v, l, { enumerable: !0, configurable: !0, writable: !0, value: o }) : v[l] = o, U = (v, l) => {
6
+ for (var o in l || (l = {}))
7
+ Ae.call(l, o) && he(v, o, l[o]);
8
+ if (ue)
9
+ for (var o of ue(l))
10
+ Ve.call(l, o) && he(v, o, l[o]);
11
+ return v;
12
+ }, G = (v, l) => ke(v, be(l));
13
+ var q = (v, l, o) => new Promise((u, f) => {
14
+ var H = (N) => {
15
15
  try {
16
- r(o.next(z));
17
- } catch (U) {
18
- l(U);
16
+ r(o.next(N));
17
+ } catch (P) {
18
+ f(P);
19
19
  }
20
- }, D = (z) => {
20
+ }, M = (N) => {
21
21
  try {
22
- r(o.throw(z));
23
- } catch (U) {
24
- l(U);
22
+ r(o.throw(N));
23
+ } catch (P) {
24
+ f(P);
25
25
  }
26
- }, r = (z) => z.done ? f(z.value) : Promise.resolve(z.value).then(H, D);
27
- r((o = o.apply(x, c)).next());
26
+ }, r = (N) => N.done ? u(N.value) : Promise.resolve(N.value).then(H, M);
27
+ r((o = o.apply(v, l)).next());
28
28
  });
29
- import { jsx as a, jsxs as R, Fragment as Ae } from "react/jsx-runtime";
30
- import { Modal as Ve, Space as fe, Button as J, message as V, Tabs as ee } from "antd";
31
- import { useContext as De, useRef as E, useState as v, useEffect as K } from "react";
29
+ import { jsx as a, jsxs as $, Fragment as De } from "react/jsx-runtime";
30
+ import { Modal as ze, Space as ge, Button as X, message as z, Tabs as ne } from "antd";
31
+ import { useContext as Me, useRef as E, useState as S, useEffect as K } from "react";
32
32
  import "./style.less.mjs";
33
- import ze from "../../DataEmpty/index.mjs";
33
+ import Ne from "../../DataEmpty/index.mjs";
34
34
  import Te from "../../../DatasetContext/index.mjs";
35
- import Me from "./AttributeDetail/index.mjs";
36
- import Ne from "./QADetail/index.mjs";
37
- import Le from "../../VLMAnnotation/index.mjs";
38
- import qe from "axios";
35
+ import Le from "./AttributeDetail/index.mjs";
36
+ import qe from "./QADetail/index.mjs";
37
+ import Re from "../../VLMAnnotation/index.mjs";
38
+ import Ue from "axios";
39
39
  const {
40
- TabPane: Q
41
- } = ee, Oe = (x) => {
40
+ TabPane: F
41
+ } = ne, Je = (v) => {
42
42
  const {
43
- visible: c,
43
+ visible: l,
44
44
  selectSampleId: o,
45
- datasetId: f,
46
- versionId: l,
45
+ datasetId: u,
46
+ versionId: f,
47
47
  // vmlMarkTmpl,
48
48
  onClose: H,
49
- onSave: D
50
- } = x, {
49
+ onSave: M
50
+ } = v, {
51
51
  services: {
52
52
  cvforceDatahub: r
53
53
  },
54
- token: z,
55
- apiUrl: U
56
- } = De(Te), G = E(null);
54
+ token: N,
55
+ apiUrl: P
56
+ } = Me(Te), j = E(null);
57
57
  E(null), E({});
58
- const [n, T] = v(), k = E(void 0), [Re, te] = v(0), [h, $] = v([]), [X, q] = v(-1), [u, N] = v({
58
+ const [i, w] = S(), y = E(void 0), [Ge, ie] = S(0), [h, R] = S([]), [Y, T] = S(-1), [d, D] = S({
59
59
  current: 1,
60
60
  pageSize: 100
61
61
  // 与主列表保持一致
62
- }), [ne, ie] = v(0), [oe, re] = v(0), [I, ue] = v(() => o ? "" : "nocode"), [Y, se] = v([]), [g, O] = v("textAnnotation"), [W, P] = v(), [Z, he] = v(!1), F = E(null), b = E(null), [ge, pe] = v(() => Date.now());
62
+ }), [oe, re] = S(0), [se, ce] = S(0), [I, Z] = S(() => o ? "" : "nocode"), [ae, O] = S(), [_, le] = S([]), [g, W] = S("textAnnotation"), [J, B] = S(), [ee, pe] = S(!1), Q = E(null), A = E(null), [me, xe] = S(() => Date.now());
63
63
  K(() => {
64
- c && (!f || !l || r == null || r.getDatasetsIdVersionsVidConfigs(f, l).then((e) => {
65
- se(e || []), (e == null ? void 0 : e.length) > 0 ? O("textAnnotation") : O("attributeDefinition");
64
+ l && (!u || !f || r == null || r.getDatasetsIdVersionsVidConfigs(u, f).then((e) => {
65
+ le(e || []), (e == null ? void 0 : e.length) > 0 ? W("textAnnotation") : W("attributeDefinition");
66
66
  }));
67
- }, [c]), K(() => {
68
- const e = u.current || 1, t = u.pageSize || 100, i = u.type;
69
- if (!f || !l)
67
+ }, [l]), K(() => {
68
+ const e = d.current || 1, t = d.pageSize || 100, n = d.type;
69
+ if (!u || !f)
70
70
  return;
71
- const d = h || [];
72
- r == null || r.getDatasetsIdVersionsVidSamples(f, l, {
71
+ const c = h || [], s = o || ae;
72
+ r == null || r.getDatasetsIdVersionsVidSamples(u, f, {
73
73
  labels: I ? [I] : void 0,
74
74
  pageNo: e,
75
75
  pageSize: t
76
- }).then((s) => {
77
- const p = s.recordList || [], C = e === 1 && !i ? p : i === "prev" ? [...p, ...d] : i === "next" ? [...d, ...p] : p;
78
- $(C), N(B(j({}, u), {
76
+ }).then((L) => {
77
+ const p = L.recordList || [], m = e === 1 && !n ? p : n === "prev" ? [...p, ...c] : n === "next" ? [...c, ...p] : p;
78
+ R(m), D(G(U({}, d), {
79
79
  current: e,
80
80
  pageSize: t,
81
- total: s.totalResults,
81
+ total: L.totalResults,
82
82
  type: void 0
83
83
  }));
84
- let S = 0, y = C[0];
85
- if (i === "next" && p.length)
86
- S = d.length, y = p[0];
87
- else if (i === "prev" && p.length)
88
- S = p.length - 1, y = p[p.length - 1];
89
- else if (o) {
90
- const w = C.findIndex((m) => m.id === o);
91
- if (w !== -1)
92
- S = w, y = C[w];
84
+ let b = 0, x = m[0];
85
+ if (n === "next" && p.length)
86
+ b = c.length, x = p[0];
87
+ else if (n === "prev" && p.length)
88
+ b = p.length - 1, x = p[p.length - 1];
89
+ else if (s) {
90
+ const k = m.findIndex((C) => C.id === s);
91
+ if (k !== -1)
92
+ b = k, x = m[k];
93
93
  else {
94
- r == null || r.getDatasetsIdVersionsVidSsamplesSid(f, l, o).then((m) => {
95
- m && ($([m, ...C]), T(m), q(0), te(C.length + 1));
94
+ r == null || r.getDatasetsIdVersionsVidSsamplesSid(u, f, s).then((C) => {
95
+ C && (R([C, ...m]), w(C), T(0), ie(m.length + 1), O(void 0));
96
96
  });
97
97
  return;
98
98
  }
99
99
  }
100
- y && (T(y), q(S), te(C.length));
101
- }), A();
102
- }, [u.current, I, f, l]);
103
- const A = () => {
104
- !f || !l || r == null || r.getDatasetsIdVersionsVidLabelcount(f, l).then((e) => {
105
- const t = e.find((d) => d.id === "allcodeid"), i = e.find((d) => d.id === "nocodeid");
106
- ie(t ? t.count : 0), re(i ? i.count : 0);
100
+ x && (w(x), T(b), ie(m.length), ae && O(void 0));
101
+ }), V();
102
+ }, [d.current, I, u, f]);
103
+ const V = () => {
104
+ !u || !f || r == null || r.getDatasetsIdVersionsVidLabelcount(u, f).then((e) => {
105
+ const t = e.find((c) => c.id === "allcodeid"), n = e.find((c) => c.id === "nocodeid");
106
+ re(t ? t.count : 0), ce(n ? n.count : 0);
107
107
  });
108
- }, _ = () => {
109
- h && $((e) => {
110
- var C, S, y, w;
111
- const t = k.current || n, i = [...e];
112
- let d;
108
+ }, te = () => {
109
+ h && R((e) => {
110
+ var p, m, b, x;
111
+ const t = y.current || i, n = [...e];
112
+ let c;
113
113
  if (t) {
114
- const m = i.findIndex((L) => L.id === t.id);
115
- m > -1 && i.splice(m, 1, t);
114
+ const k = n.findIndex((C) => C.id === t.id);
115
+ k > -1 && n.splice(k, 1, t);
116
116
  }
117
- const s = !t || (C = t.labels) != null && C.length && I === "hascode" || !((S = t.labels) != null && S.length) && I === "nocode" || I === "" ? X + 1 : X;
118
- if (t && ((y = t.labels) != null && y.length && I === "nocode" || !((w = t.labels) != null && w.length) && I === "hascode")) {
119
- const m = i.findIndex((L) => L.id === t.id);
120
- m > -1 && (i.splice(m, 1), d = [...i], N((L) => B(j({}, L), {
121
- total: L.total ? L.total - 1 : L.total
117
+ const s = !t || (p = t.labels) != null && p.length && I === "hascode" || !((m = t.labels) != null && m.length) && I === "nocode" || I === "" ? Y + 1 : Y;
118
+ if (t && ((b = t.labels) != null && b.length && I === "nocode" || !((x = t.labels) != null && x.length) && I === "hascode")) {
119
+ const k = n.findIndex((C) => C.id === t.id);
120
+ k > -1 && (n.splice(k, 1), c = [...n], D((C) => G(U({}, C), {
121
+ total: C.total ? C.total - 1 : C.total
122
122
  })));
123
123
  }
124
- const p = d || i;
125
- if (s >= p.length) {
126
- const m = (u.current - 1) * u.pageSize + s;
127
- u.total && m >= u.total ? V.error("已经是最后一个了") : N({
128
- current: u.current + 1,
129
- pageSize: u.pageSize,
124
+ const L = c || n;
125
+ if (s >= L.length) {
126
+ const k = (d.current - 1) * d.pageSize + s;
127
+ d.total && k >= d.total ? z.error("已经是最后一个了") : D({
128
+ current: d.current + 1,
129
+ pageSize: d.pageSize,
130
130
  type: "next"
131
131
  });
132
132
  } else
133
133
  setTimeout(() => {
134
- q(s);
135
- const m = p[s];
136
- T(m);
134
+ T(s);
135
+ const k = L[s];
136
+ w(k);
137
137
  }, 200);
138
- return p;
138
+ return L;
139
139
  });
140
- }, ae = () => {
141
- var p, C;
140
+ }, de = () => {
141
+ var L, p;
142
142
  if (!h)
143
143
  return;
144
- const e = k.current || n, t = [...h];
145
- let i;
144
+ const e = y.current || i, t = [...h];
145
+ let n;
146
146
  if (e && h) {
147
- const S = t.findIndex((y) => y.id === e.id);
148
- if (S > -1 && t.splice(S, 1, e), (p = e.labels) != null && p.length && I === "nocode" || !((C = e.labels) != null && C.length) && I === "hascode") {
149
- const y = t.findIndex((w) => w.id === e.id);
150
- y > -1 && (t.splice(y, 1), i = [...t], N((w) => B(j({}, w), {
151
- total: w.total ? w.total - 1 : w.total
147
+ const m = t.findIndex((b) => b.id === e.id);
148
+ if (m > -1 && t.splice(m, 1, e), (L = e.labels) != null && L.length && I === "nocode" || !((p = e.labels) != null && p.length) && I === "hascode") {
149
+ const b = t.findIndex((x) => x.id === e.id);
150
+ b > -1 && (t.splice(b, 1), n = [...t], D((x) => G(U({}, x), {
151
+ total: x.total ? x.total - 1 : x.total
152
152
  })));
153
153
  }
154
154
  }
155
- const d = i || t, s = X - 1;
155
+ const c = n || t, s = Y - 1;
156
156
  if (s < 0)
157
- (u.current - 1) * u.pageSize + s < 0 ? V.error("已经是第一个了") : N({
158
- current: u.current - 1,
159
- pageSize: u.pageSize,
157
+ (d.current - 1) * d.pageSize + s < 0 ? z.error("已经是第一个了") : D({
158
+ current: d.current - 1,
159
+ pageSize: d.pageSize,
160
160
  type: "prev"
161
161
  });
162
162
  else {
163
- q(s);
164
- const S = d[s];
165
- T(S);
163
+ T(s);
164
+ const m = c[s];
165
+ w(m);
166
166
  }
167
- i && $(i);
167
+ n && R(n);
168
168
  };
169
169
  K(() => {
170
- c && f && l && n && (r == null || r.getDatasetsIdVersionsVidSsamplesSid(f, l, n.id).then((e) => {
171
- T(e);
170
+ l && u && f && i && (r == null || r.getDatasetsIdVersionsVidSsamplesSid(u, f, i.id).then((e) => {
171
+ w(e);
172
172
  }));
173
- }, [c, n == null ? void 0 : n.id]);
174
- const me = () => M(void 0, null, function* () {
175
- g === "attributeDefinition" && F.current && !(yield F.current.checkDirtyAndConfirm()) || g === "qaGeneration" && b.current && !(yield b.current.checkDirtyAndConfirm()) || H();
173
+ }, [l, i == null ? void 0 : i.id]);
174
+ const ye = () => q(void 0, null, function* () {
175
+ g === "attributeDefinition" && Q.current && !(yield Q.current.checkDirtyAndConfirm()) || g === "qaGeneration" && A.current && !(yield A.current.checkDirtyAndConfirm()) || H();
176
176
  });
177
177
  K(() => {
178
- G.current && (G.current.width = G.current.offsetWidth, G.current.height = G.current.offsetHeight);
179
- }, [G.current]);
180
- const xe = () => M(void 0, null, function* () {
181
- if (g === "qaGeneration" && b.current && !(yield b.current.checkDirtyAndConfirm()))
178
+ j.current && (j.current.width = j.current.offsetWidth, j.current.height = j.current.offsetHeight);
179
+ }, [j.current]);
180
+ const Ce = () => q(void 0, null, function* () {
181
+ if (g === "qaGeneration" && A.current && !(yield A.current.checkDirtyAndConfirm()))
182
182
  return;
183
- const e = k.current || n;
184
- e && (console.log("onPrevClick sampleToUse", e), g === "textAnnotation" && W ? D(e).then((t) => {
185
- t ? (P(void 0), ae(), A()) : V.error("保存失败");
186
- }) : ae());
187
- }), Ce = () => M(void 0, null, function* () {
188
- if (g === "qaGeneration" && b.current && !(yield b.current.checkDirtyAndConfirm()))
183
+ const e = y.current || i;
184
+ e && (console.log("onPrevClick sampleToUse", e), g === "textAnnotation" && J ? M(e).then((t) => {
185
+ t ? (B(void 0), de(), V()) : z.error("保存失败");
186
+ }) : de());
187
+ }), Se = () => q(void 0, null, function* () {
188
+ if (g === "qaGeneration" && A.current && !(yield A.current.checkDirtyAndConfirm()))
189
189
  return;
190
- const e = k.current || n;
191
- e && (console.log("onNextClick sampleToUse", e), g === "textAnnotation" && W ? D(e).then((t) => {
192
- t ? (P(void 0), _(), A()) : V.error("保存失败");
193
- }) : _());
190
+ const e = y.current || i;
191
+ e && (console.log("onNextClick sampleToUse", e), g === "textAnnotation" && J ? M(e).then((t) => {
192
+ t ? (B(void 0), te(), V()) : z.error("保存失败");
193
+ }) : te());
194
194
  });
195
195
  K(() => {
196
- k.current = n;
197
- }, [n]);
198
- const Se = (e) => (console.log("ocrRecognize apiUrl", U), qe.post(`${U}/aishop/v2/infer?serviceId=Actpkb4pi3vxg`, {
196
+ y.current = i;
197
+ }, [i]);
198
+ const ve = (e) => (console.log("ocrRecognize apiUrl", P), Ue.post(`${P}/aishop/v2/infer?serviceId=Actpkb4pi3vxg`, {
199
199
  pages: [{
200
200
  image: e,
201
201
  no: 0
202
202
  }]
203
203
  }, {
204
204
  headers: {
205
- Authorization: `Bearer ${z}`
205
+ Authorization: `Bearer ${N}`
206
206
  }
207
- }).then((t) => (console.log("ocrRecognize res", t.data.data), t.data.data.pages[0].layout.filter((d) => d.content))).catch((t) => {
207
+ }).then((t) => (console.log("ocrRecognize res", t.data.data), t.data.data.pages[0].layout.filter((c) => c.content))).catch((t) => {
208
208
  console.error("ocrRecognize error", t);
209
- })), ye = () => M(void 0, null, function* () {
210
- const e = k.current || n;
211
- if (!(!e || !f || !l)) {
209
+ })), we = () => q(void 0, null, function* () {
210
+ const e = y.current || i;
211
+ if (!(!e || !u || !f)) {
212
212
  console.log("handleDeleteClick currentSample", e);
213
213
  try {
214
- yield r == null ? void 0 : r.delDatasetsIdVersionsVidSamplesId(f, l, e.id), V.success("删除成功"), o ? H() : $((t) => {
215
- const i = t.findIndex((s) => s.id === e.id);
216
- if (i === -1)
214
+ yield r == null ? void 0 : r.delDatasetsIdVersionsVidSamplesId(u, f, e.id), z.success("删除成功"), o ? H() : R((t) => {
215
+ const n = t.findIndex((s) => s.id === e.id);
216
+ if (n === -1)
217
217
  return t;
218
- const d = [...t.slice(0, i), ...t.slice(i + 1)];
219
- if (N((s) => B(j({}, s), {
218
+ const c = [...t.slice(0, n), ...t.slice(n + 1)];
219
+ if (D((s) => G(U({}, s), {
220
220
  total: s.total ? s.total - 1 : s.total
221
- })), d.length) {
222
- const s = Math.min(i, d.length - 1);
223
- q(s), T(d[s]);
221
+ })), c.length) {
222
+ const s = Math.min(n, c.length - 1);
223
+ T(s), w(c[s]);
224
224
  } else
225
- q(-1), T(void 0), N({
226
- current: u.current + 1,
227
- pageSize: u.pageSize,
225
+ T(-1), w(void 0), D({
226
+ current: d.current + 1,
227
+ pageSize: d.pageSize,
228
228
  type: "next"
229
229
  });
230
- return d;
231
- }), A();
230
+ return c;
231
+ }), V();
232
232
  } catch (t) {
233
- V.error("删除失败");
233
+ z.error("删除失败");
234
234
  }
235
235
  }
236
- }), ce = () => M(void 0, null, function* () {
237
- if (!f || !l || !(n != null && n.id))
236
+ }), fe = () => q(void 0, null, function* () {
237
+ if (!u || !f || !(i != null && i.id))
238
238
  return;
239
- const e = yield r == null ? void 0 : r.getDatasetsIdVersionsVidSsamplesSid(f, l, n.id);
240
- e && (T(e), k.current = e);
239
+ const e = yield r == null ? void 0 : r.getDatasetsIdVersionsVidSsamplesSid(u, f, i.id);
240
+ e && (w(e), y.current = e);
241
241
  });
242
- return /* @__PURE__ */ a(Ve, {
242
+ return /* @__PURE__ */ a(ze, {
243
243
  title: "标注",
244
244
  width: "100%",
245
245
  wrapClassName: "vlm-modal-wrap",
246
246
  className: "vlm-modal",
247
- open: c,
247
+ open: l,
248
248
  destroyOnClose: !0,
249
- onCancel: () => me(),
249
+ onCancel: () => ye(),
250
250
  maskClosable: !1,
251
251
  keyboard: !1,
252
252
  centered: !0,
253
- footer: g !== "attributeDefinition" ? /* @__PURE__ */ R("div", {
253
+ footer: g !== "attributeDefinition" ? /* @__PURE__ */ $("div", {
254
254
  style: {
255
255
  display: "flex",
256
256
  justifyContent: "space-between",
@@ -260,15 +260,15 @@ const {
260
260
  style: {
261
261
  flex: 1
262
262
  }
263
- }), /* @__PURE__ */ R(fe, {
263
+ }), /* @__PURE__ */ $(ge, {
264
264
  size: 24,
265
- children: [!o && (h == null ? void 0 : h.length) > 0 && /* @__PURE__ */ a(J, {
265
+ children: [!o && (h == null ? void 0 : h.length) > 0 && /* @__PURE__ */ a(X, {
266
266
  type: "default",
267
- onClick: xe,
267
+ onClick: Ce,
268
268
  children: "上一张"
269
- }, "prev"), !o && (h == null ? void 0 : h.length) > 0 && /* @__PURE__ */ a(J, {
269
+ }, "prev"), !o && (h == null ? void 0 : h.length) > 0 && /* @__PURE__ */ a(X, {
270
270
  type: "default",
271
- onClick: Ce,
271
+ onClick: Se,
272
272
  children: "下一张"
273
273
  }, "next")]
274
274
  }), /* @__PURE__ */ a("div", {
@@ -277,123 +277,133 @@ const {
277
277
  display: "flex",
278
278
  justifyContent: "flex-end"
279
279
  },
280
- children: /* @__PURE__ */ a(fe, {
281
- children: g === "textAnnotation" && (h == null ? void 0 : h.length) > 0 ? /* @__PURE__ */ R(Ae, {
282
- children: [/* @__PURE__ */ a(J, {
283
- disabled: !n,
280
+ children: /* @__PURE__ */ a(ge, {
281
+ children: g === "textAnnotation" && (h == null ? void 0 : h.length) > 0 ? /* @__PURE__ */ $(De, {
282
+ children: [/* @__PURE__ */ a(X, {
283
+ disabled: !i,
284
284
  type: "primary",
285
285
  onClick: () => {
286
- const e = k.current || n;
287
- e && (console.log("save currentSample", e), D(e).then((t) => M(void 0, null, function* () {
288
- t ? (V.success("保存成功"), P(void 0), o ? yield ce() : _(), A()) : V.error("保存失败");
286
+ const e = y.current || i;
287
+ e && (console.log("save currentSample", e), M(e).then((t) => q(void 0, null, function* () {
288
+ t ? (z.success("保存成功"), B(void 0), o ? yield fe() : te(), V()) : z.error("保存失败");
289
289
  })));
290
290
  },
291
291
  children: "保存标注"
292
- }, "save"), /* @__PURE__ */ a(J, {
292
+ }, "save"), /* @__PURE__ */ a(X, {
293
293
  type: "default",
294
- onClick: ye,
294
+ onClick: we,
295
295
  children: "删除数据"
296
296
  })]
297
297
  }) : null
298
298
  })
299
299
  })]
300
300
  }) : null,
301
- children: /* @__PURE__ */ R("div", {
301
+ children: /* @__PURE__ */ $("div", {
302
302
  className: "vlm-records-content",
303
303
  children: [/* @__PURE__ */ a("div", {
304
304
  className: "records-content-tabs-container",
305
- children: !o && /* @__PURE__ */ R(ee, {
305
+ children: !o && /* @__PURE__ */ $(ne, {
306
306
  className: "records-content-tabs",
307
307
  activeKey: I,
308
- onChange: (e) => M(void 0, null, function* () {
309
- if (!(g === "qaGeneration" && b.current && !(yield b.current.checkDirtyAndConfirm()))) {
310
- if (g === "textAnnotation" && W) {
311
- const t = k.current || n;
312
- if (t && D) {
313
- if (!(yield D(t))) {
314
- V.error("保存失败,已阻止切换筛选");
308
+ onChange: (e) => q(void 0, null, function* () {
309
+ var t;
310
+ if (!(g === "qaGeneration" && A.current && !(yield A.current.checkDirtyAndConfirm()))) {
311
+ if (g === "textAnnotation" && J) {
312
+ const n = y.current || i;
313
+ if (n && M) {
314
+ if (!(yield M(n))) {
315
+ z.error("保存失败,已阻止切换筛选");
315
316
  return;
316
317
  }
317
- P(void 0), A == null || A();
318
+ w(n), y.current = n, B(void 0), V == null || V(), !o && I === "nocode" && ((t = n == null ? void 0 : n.labels) != null && t.length) && (R([]), w(n), T(-1), O(n.id), D(G(U({}, d), {
319
+ current: 1,
320
+ total: void 0,
321
+ type: void 0
322
+ })), Z("hascode"));
318
323
  }
319
324
  }
320
- pe(Date.now()), $([]), T(void 0), q(-1), N(B(j({}, u), {
325
+ xe(Date.now()), R([]), w(void 0), T(-1), D(G(U({}, d), {
321
326
  current: 1,
322
327
  total: void 0,
323
328
  type: void 0
324
- })), ue(e);
329
+ })), Z(e);
325
330
  }
326
331
  }),
327
- children: [/* @__PURE__ */ a(Q, {
328
- tab: `全部(${ne})`
329
- }, ""), /* @__PURE__ */ a(Q, {
330
- tab: `未标注(${oe})`
331
- }, "nocode"), /* @__PURE__ */ a(Q, {
332
- tab: `已标注(${ne - oe})`
332
+ children: [/* @__PURE__ */ a(F, {
333
+ tab: `全部(${oe})`
334
+ }, ""), /* @__PURE__ */ a(F, {
335
+ tab: `未标注(${se})`
336
+ }, "nocode"), /* @__PURE__ */ a(F, {
337
+ tab: `已标注(${oe - se})`
333
338
  }, "hascode")]
334
339
  })
335
- }), h != null && h.length ? /* @__PURE__ */ R("div", {
340
+ }), h != null && h.length ? /* @__PURE__ */ $("div", {
336
341
  className: "sample-detail",
337
342
  children: [/* @__PURE__ */ a("div", {
338
343
  className: "content-mode-buttons",
339
- children: /* @__PURE__ */ R(ee, {
344
+ children: /* @__PURE__ */ $(ne, {
340
345
  activeKey: g,
341
- onChange: (e) => M(void 0, null, function* () {
342
- if (!(g === "attributeDefinition" && F.current && !(yield F.current.checkDirtyAndConfirm())) && !(g === "qaGeneration" && b.current && !(yield b.current.checkDirtyAndConfirm()))) {
343
- if (g === "textAnnotation" && D && W && (k.current || n)) {
344
- const t = k.current || n;
345
- if (!(yield D(t))) {
346
- V.error("保存失败,已阻止切换页签");
346
+ onChange: (e) => q(void 0, null, function* () {
347
+ var t;
348
+ if (!(g === "attributeDefinition" && Q.current && !(yield Q.current.checkDirtyAndConfirm())) && !(g === "qaGeneration" && A.current && !(yield A.current.checkDirtyAndConfirm()))) {
349
+ if (g === "textAnnotation" && M && J && (y.current || i)) {
350
+ const n = y.current || i;
351
+ if (!(yield M(n))) {
352
+ z.error("保存失败,已阻止切换页签");
347
353
  return;
348
354
  }
349
- P(void 0), A == null || A();
355
+ w(n), y.current = n, B(void 0), V == null || V(), !o && I === "nocode" && ((t = n == null ? void 0 : n.labels) != null && t.length) && (R([]), w(n), T(-1), O(n.id), D(G(U({}, d), {
356
+ current: 1,
357
+ total: void 0,
358
+ type: void 0
359
+ })), Z("hascode"));
350
360
  }
351
- e === "textAnnotation" && (n != null && n.id) && (yield ce()), O(e);
361
+ e === "textAnnotation" && (i != null && i.id) && (yield fe()), W(e);
352
362
  }
353
363
  }),
354
- children: [/* @__PURE__ */ a(Q, {
364
+ children: [/* @__PURE__ */ a(F, {
355
365
  tab: "属性定义",
356
- disabled: Z
357
- }, "attributeDefinition"), /* @__PURE__ */ a(Q, {
366
+ disabled: ee
367
+ }, "attributeDefinition"), /* @__PURE__ */ a(F, {
358
368
  tab: "文本标注",
359
- disabled: Z
360
- }, "textAnnotation"), /* @__PURE__ */ a(Q, {
369
+ disabled: ee
370
+ }, "textAnnotation"), /* @__PURE__ */ a(F, {
361
371
  tab: "QA生成",
362
- disabled: Z
372
+ disabled: ee
363
373
  }, "qaGeneration")]
364
374
  })
365
- }), g === "textAnnotation" && n && /* @__PURE__ */ a("div", {
375
+ }), g === "textAnnotation" && i && /* @__PURE__ */ a("div", {
366
376
  className: "container",
367
- children: /* @__PURE__ */ a(Le, {
368
- sample: n,
369
- labelDefinitions: Y,
377
+ children: /* @__PURE__ */ a(Re, {
378
+ sample: i,
379
+ labelDefinitions: _,
370
380
  onChange: (e) => {
371
- console.log("VLMAnnotation onChange", e), k.current = e, P(e);
381
+ console.log("VLMAnnotation onChange", e), y.current = e, B(e);
372
382
  },
373
- ocrRecognize: Se,
383
+ ocrRecognize: ve,
374
384
  coordinateType: "center"
375
385
  })
376
- }), g === "attributeDefinition" && /* @__PURE__ */ a(Me, {
377
- ref: F,
378
- datasetId: f,
379
- versionId: l,
386
+ }), g === "attributeDefinition" && /* @__PURE__ */ a(Le, {
387
+ ref: Q,
388
+ datasetId: u,
389
+ versionId: f,
380
390
  onAttributesChange: (e) => {
381
- se(e), e.length > 0 && Y.length === 0 && O("textAnnotation");
391
+ le(e), e.length > 0 && _.length === 0 && W("textAnnotation");
382
392
  },
383
393
  onLoadingChange: (e) => {
384
- he(e);
394
+ pe(e);
385
395
  }
386
- }), g === "qaGeneration" && /* @__PURE__ */ a(Ne, {
387
- ref: b,
388
- sample: n,
389
- labels: Y,
390
- datasetId: f,
391
- visionId: l
392
- }, `${(n == null ? void 0 : n.id) || "qa"}-${ge}`)]
393
- }) : /* @__PURE__ */ a(ze, {})]
396
+ }), g === "qaGeneration" && /* @__PURE__ */ a(qe, {
397
+ ref: A,
398
+ sample: i,
399
+ labels: _,
400
+ datasetId: u,
401
+ visionId: f
402
+ }, `${(i == null ? void 0 : i.id) || "qa"}-${me}`)]
403
+ }) : /* @__PURE__ */ a(Ne, {})]
394
404
  })
395
405
  });
396
406
  };
397
407
  export {
398
- Oe as default
408
+ Je as default
399
409
  };