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

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