@glodon-aiot/dataset-annotation 3.10.0-alpha.18 → 3.10.0-snapshot.16

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