@glodon-aiot/dataset-annotation 3.10.0-alpha.15 → 3.10.0-alpha.17

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