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

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 (29) 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 +105 -106
  8. package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/AttributeDetail/index.mjs +21 -19
  9. package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/index.mjs +219 -227
  10. package/dist/es/components/VLMAnnotationDetail/VlmModal/index.mjs +64 -68
  11. package/dist/es/components/VLMAnnotationDetail/index.mjs +174 -177
  12. package/dist/es/index.mjs +1 -1
  13. package/dist/example/DatasetAnnotationDemo.d.ts +3 -0
  14. package/dist/example/DemoTabs.d.ts +3 -0
  15. package/dist/example/DetectionDatasetDemo.d.ts +5 -0
  16. package/dist/example/DetectionImageDemo.d.ts +5 -0
  17. package/dist/example/OcrDatasetDemo.d.ts +5 -0
  18. package/dist/example/OcrImageDemo.d.ts +5 -0
  19. package/dist/example/OcrkvcDatasetDemo.d.ts +5 -0
  20. package/dist/example/constant.local.d.ts +6 -0
  21. package/dist/example/index.d.ts +1 -0
  22. package/dist/lib/index.js +3 -3
  23. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/ImageDetail/index.d.ts +16 -0
  24. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/LabelEditorInput.d.ts +12 -0
  25. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/LabelEditorItem.d.ts +21 -0
  26. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/LableEditor.d.ts +16 -0
  27. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/index.d.ts +19 -0
  28. package/dist/src/utils/reactCompatibility.d.ts +5 -0
  29. package/package.json +8 -4
@@ -1,366 +1,358 @@
1
- var Ae = Object.defineProperty, De = Object.defineProperties;
2
- var Ve = Object.getOwnPropertyDescriptors;
1
+ var Ie = Object.defineProperty, ke = Object.defineProperties;
2
+ var be = Object.getOwnPropertyDescriptors;
3
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) => {
6
- for (var o in d || (d = {}))
7
- ze.call(d, o) && he(v, o, d[o]);
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
8
  if (ue)
9
- for (var o of ue(d))
10
- Me.call(d, o) && he(v, o, d[o]);
9
+ for (var o of ue(l))
10
+ Ve.call(l, o) && he(v, o, l[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
+ }, 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(T));
17
- } catch (j) {
18
- h(j);
16
+ r(o.next(N));
17
+ } catch (P) {
18
+ f(P);
19
19
  }
20
- }, N = (T) => {
20
+ }, M = (N) => {
21
21
  try {
22
- r(o.throw(T));
23
- } catch (j) {
24
- h(j);
22
+ r(o.throw(N));
23
+ } catch (P) {
24
+ f(P);
25
25
  }
26
- }, r = (T) => T.done ? m(T.value) : Promise.resolve(T.value).then(O, N);
27
- r((o = o.apply(v, 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 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 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 Le from "../../DataEmpty/index.mjs";
34
- import Re from "../../../DatasetContext/index.mjs";
35
- import Ue from "./AttributeDetail/index.mjs";
33
+ import Ne from "../../DataEmpty/index.mjs";
34
+ import Te from "../../../DatasetContext/index.mjs";
35
+ import Le from "./AttributeDetail/index.mjs";
36
36
  import qe from "./QADetail/index.mjs";
37
- import $e from "../../VLMAnnotation/index.mjs";
38
- import Ge from "axios";
37
+ import Re from "../../VLMAnnotation/index.mjs";
38
+ import Ue from "axios";
39
39
  const {
40
- TabPane: Q
41
- } = ne, Ye = (v) => {
40
+ TabPane: F
41
+ } = ne, Je = (v) => {
42
42
  const {
43
- visible: d,
43
+ visible: l,
44
44
  selectSampleId: o,
45
- datasetId: m,
46
- versionId: h,
45
+ datasetId: u,
46
+ versionId: f,
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,
55
- apiUrl: j
56
- } = Te(Re), B = F(null);
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({
54
+ token: N,
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
- }), [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());
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
- d && (!m || !h || r == null || r.getDatasetsIdVersionsVidConfigs(m, h).then((e) => {
64
+ l && (!u || !f || r == null || r.getDatasetsIdVersionsVidConfigs(u, f).then((e) => {
65
65
  le(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
+ }, [l]), K(() => {
68
+ const e = d.current || 1, t = d.pageSize || 100, n = d.type;
69
+ if (!u || !f)
70
70
  return;
71
- const s = y || [], g = o || ae;
72
- r == null || r.getDatasetsIdVersionsVidSamples(m, h, {
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((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), {
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: c.totalResults,
81
+ total: L.totalResults,
82
82
  type: void 0
83
83
  }));
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);
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
91
  if (k !== -1)
92
- u = k, C = p[k];
92
+ b = k, x = m[k];
93
93
  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));
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
- C && (A(C), U(u), ie(p.length), ae && H(void 0));
100
+ x && (w(x), T(b), ie(m.length), ae && O(void 0));
101
101
  }), V();
102
- }, [a.current, I, m, h]);
102
+ }, [d.current, I, u, f]);
103
103
  const V = () => {
104
- !m || !h || r == null || r.getDatasetsIdVersionsVidLabelcount(m, h).then((e) => {
105
- const t = e.find((s) => s.id === "allcodeid"), n = e.find((s) => s.id === "nocodeid");
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
106
  re(t ? t.count : 0), ce(n ? n.count : 0);
107
107
  });
108
108
  }, te = () => {
109
- y && G((e) => {
110
- var f, p, u, C;
111
- const t = w.current || i, n = [...e];
112
- let s;
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 k = n.findIndex((b) => b.id === t.id);
114
+ const k = n.findIndex((C) => C.id === t.id);
115
115
  k > -1 && n.splice(k, 1, t);
116
116
  }
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
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 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,
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
- U(g);
135
- const k = c[g];
136
- A(k);
134
+ T(s);
135
+ const k = L[s];
136
+ w(k);
137
137
  }, 200);
138
- return c;
138
+ return L;
139
139
  });
140
140
  }, de = () => {
141
- var c, f;
142
- if (!y)
141
+ var L, p;
142
+ if (!h)
143
143
  return;
144
- const e = w.current || i, t = [...y];
144
+ const e = y.current || i, t = [...h];
145
145
  let n;
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
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
152
152
  })));
153
153
  }
154
154
  }
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,
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,
160
160
  type: "prev"
161
161
  });
162
162
  else {
163
- U(g);
164
- const p = s[g];
165
- A(p);
163
+ T(s);
164
+ const m = c[s];
165
+ w(m);
166
166
  }
167
- n && G(n);
167
+ n && R(n);
168
168
  };
169
169
  K(() => {
170
- d && m && h && i && (r == null || r.getDatasetsIdVersionsVidSsamplesSid(m, h, i.id).then((e) => {
171
- A(e);
170
+ l && u && f && i && (r == null || r.getDatasetsIdVersionsVidSsamplesSid(u, f, i.id).then((e) => {
171
+ w(e);
172
172
  }));
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();
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
- B.current && (B.current.width = B.current.offsetWidth, B.current.height = B.current.offsetHeight);
179
- }, [B.current]);
180
- const be = () => z(void 0, null, function* () {
181
- if (x === "qaGeneration" && D.current && !(yield D.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 = 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("保存失败");
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
186
  }) : de());
187
- }), ve = () => z(void 0, null, function* () {
188
- if (x === "qaGeneration" && D.current && !(yield D.current.checkDirtyAndConfirm()))
187
+ }), Se = () => q(void 0, null, function* () {
188
+ if (g === "qaGeneration" && A.current && !(yield A.current.checkDirtyAndConfirm()))
189
189
  return;
190
- 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("保存失败");
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
193
  }) : te());
194
194
  });
195
195
  K(() => {
196
- w.current = i;
196
+ y.current = i;
197
197
  }, [i]);
198
- const Ie = (e) => (console.log("ocrRecognize apiUrl", j), Ge.post(`${j}/aishop/v2/infer?serviceId=Actpkb4pi3vxg`, {
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 ${T}`
205
+ Authorization: `Bearer ${N}`
206
206
  }
207
- }).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) => {
208
208
  console.error("ocrRecognize error", t);
209
- })), ke = () => z(void 0, null, function* () {
210
- const e = w.current || i;
211
- !e || !m || !h || ge.confirm({
212
- title: "确认要删除此数据吗?",
213
- content: "删除后不可恢复,请慎重操作",
214
- onOk: () => z(void 0, null, function* () {
215
- console.log("handleDeleteClick currentSample", e);
216
- try {
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
- if (n === -1)
221
- 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
- }), f ? {
226
- current: u.current + 1,
227
- pageSize: g,
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,
228
228
  type: "next"
229
- } : {
230
- type: f ? "next" : void 0
231
- })), s.length) {
232
- const u = Math.min(n, s.length - 1);
233
- U(u), A(s[u]);
234
- } else
235
- U(-1), A(void 0);
236
- return s;
237
- }), V();
238
- } catch (t) {
239
- M.error("删除失败");
240
- }
241
- })
242
- });
243
- }), fe = () => z(void 0, null, function* () {
244
- if (!m || !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))
245
238
  return;
246
- const e = yield r == null ? void 0 : r.getDatasetsIdVersionsVidSsamplesSid(m, h, i.id);
247
- e && (A(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);
248
241
  });
249
- return /* @__PURE__ */ l(ge, {
242
+ return /* @__PURE__ */ a(ze, {
250
243
  title: "标注",
251
244
  width: "100%",
252
245
  wrapClassName: "vlm-modal-wrap",
253
246
  className: "vlm-modal",
254
- open: d,
247
+ open: l,
255
248
  destroyOnClose: !0,
256
- onCancel: () => we(),
249
+ onCancel: () => ye(),
257
250
  maskClosable: !1,
258
251
  keyboard: !1,
259
252
  centered: !0,
260
- footer: x !== "attributeDefinition" ? /* @__PURE__ */ P("div", {
253
+ footer: g !== "attributeDefinition" ? /* @__PURE__ */ $("div", {
261
254
  style: {
262
255
  display: "flex",
263
256
  justifyContent: "space-between",
264
257
  alignItems: "center"
265
258
  },
266
- children: [/* @__PURE__ */ l("div", {
259
+ children: [/* @__PURE__ */ a("div", {
267
260
  style: {
268
261
  flex: 1
269
262
  }
270
- }), /* @__PURE__ */ P(pe, {
263
+ }), /* @__PURE__ */ $(ge, {
271
264
  size: 24,
272
- children: [!o && (y == null ? void 0 : y.length) > 0 && /* @__PURE__ */ l(X, {
265
+ children: [!o && (h == null ? void 0 : h.length) > 0 && /* @__PURE__ */ a(X, {
273
266
  type: "default",
274
- onClick: be,
267
+ onClick: Ce,
275
268
  children: "上一张"
276
- }, "prev"), !o && (y == null ? void 0 : y.length) > 0 && /* @__PURE__ */ l(X, {
269
+ }, "prev"), !o && (h == null ? void 0 : h.length) > 0 && /* @__PURE__ */ a(X, {
277
270
  type: "default",
278
- onClick: ve,
271
+ onClick: Se,
279
272
  children: "下一张"
280
273
  }, "next")]
281
- }), /* @__PURE__ */ l("div", {
274
+ }), /* @__PURE__ */ a("div", {
282
275
  style: {
283
276
  flex: 1,
284
277
  display: "flex",
285
278
  justifyContent: "flex-end"
286
279
  },
287
- children: /* @__PURE__ */ l(pe, {
288
- children: x === "textAnnotation" && (y == null ? void 0 : y.length) > 0 ? /* @__PURE__ */ P(Ne, {
289
- children: [/* @__PURE__ */ l(X, {
280
+ children: /* @__PURE__ */ a(ge, {
281
+ children: g === "textAnnotation" && (h == null ? void 0 : h.length) > 0 ? /* @__PURE__ */ $(De, {
282
+ children: [/* @__PURE__ */ a(X, {
290
283
  disabled: !i,
291
284
  type: "primary",
292
285
  onClick: () => {
293
- 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("保存失败");
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("保存失败");
296
289
  })));
297
290
  },
298
291
  children: "保存标注"
299
- }, "save"), /* @__PURE__ */ l(X, {
292
+ }, "save"), /* @__PURE__ */ a(X, {
300
293
  type: "default",
301
- onClick: ke,
294
+ onClick: we,
302
295
  children: "删除数据"
303
296
  })]
304
297
  }) : null
305
298
  })
306
299
  })]
307
300
  }) : null,
308
- children: /* @__PURE__ */ P("div", {
301
+ children: /* @__PURE__ */ $("div", {
309
302
  className: "vlm-records-content",
310
- children: [/* @__PURE__ */ l("div", {
303
+ children: [/* @__PURE__ */ a("div", {
311
304
  className: "records-content-tabs-container",
312
- children: !o && /* @__PURE__ */ P(ne, {
305
+ children: !o && /* @__PURE__ */ $(ne, {
313
306
  className: "records-content-tabs",
314
307
  activeKey: I,
315
- onChange: (e) => z(void 0, null, function* () {
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))) {
323
- M.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("保存失败,已阻止切换筛选");
324
316
  return;
325
317
  }
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), {
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), {
327
319
  current: 1,
328
320
  total: void 0,
329
321
  type: void 0
330
322
  })), Z("hascode"));
331
323
  }
332
324
  }
333
- t && ye(Date.now()), Se(Date.now()), L($(R({}, a), {
325
+ xe(Date.now()), R([]), w(void 0), T(-1), D(G(U({}, d), {
334
326
  current: 1,
335
327
  total: void 0,
336
328
  type: void 0
337
329
  })), Z(e);
338
330
  }
339
331
  }),
340
- children: [/* @__PURE__ */ l(Q, {
332
+ children: [/* @__PURE__ */ a(F, {
341
333
  tab: `全部(${oe})`
342
- }, ""), /* @__PURE__ */ l(Q, {
334
+ }, ""), /* @__PURE__ */ a(F, {
343
335
  tab: `未标注(${se})`
344
- }, "nocode"), /* @__PURE__ */ l(Q, {
336
+ }, "nocode"), /* @__PURE__ */ a(F, {
345
337
  tab: `已标注(${oe - se})`
346
338
  }, "hascode")]
347
339
  })
348
- }), y != null && y.length ? /* @__PURE__ */ P("div", {
340
+ }), h != null && h.length ? /* @__PURE__ */ $("div", {
349
341
  className: "sample-detail",
350
- children: [/* @__PURE__ */ l("div", {
342
+ children: [/* @__PURE__ */ a("div", {
351
343
  className: "content-mode-buttons",
352
- children: /* @__PURE__ */ P(ne, {
353
- activeKey: x,
354
- onChange: (e) => z(void 0, null, function* () {
344
+ children: /* @__PURE__ */ $(ne, {
345
+ activeKey: g,
346
+ onChange: (e) => q(void 0, null, function* () {
355
347
  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)) {
358
- const n = w.current || i;
359
- if (!(yield N(n))) {
360
- M.error("保存失败,已阻止切换页签");
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("保存失败,已阻止切换页签");
361
353
  return;
362
354
  }
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), {
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), {
364
356
  current: 1,
365
357
  total: void 0,
366
358
  type: void 0
@@ -369,49 +361,49 @@ const {
369
361
  e === "textAnnotation" && (i != null && i.id) && (yield fe()), W(e);
370
362
  }
371
363
  }),
372
- children: [/* @__PURE__ */ l(Q, {
364
+ children: [/* @__PURE__ */ a(F, {
373
365
  tab: "属性定义",
374
366
  disabled: ee
375
- }, "attributeDefinition"), /* @__PURE__ */ l(Q, {
367
+ }, "attributeDefinition"), /* @__PURE__ */ a(F, {
376
368
  tab: "文本标注",
377
369
  disabled: ee
378
- }, "textAnnotation"), /* @__PURE__ */ l(Q, {
370
+ }, "textAnnotation"), /* @__PURE__ */ a(F, {
379
371
  tab: "QA生成",
380
372
  disabled: ee
381
373
  }, "qaGeneration")]
382
374
  })
383
- }), x === "textAnnotation" && i && /* @__PURE__ */ l("div", {
375
+ }), g === "textAnnotation" && i && /* @__PURE__ */ a("div", {
384
376
  className: "container",
385
- children: /* @__PURE__ */ l($e, {
377
+ children: /* @__PURE__ */ a(Re, {
386
378
  sample: i,
387
379
  labelDefinitions: _,
388
380
  onChange: (e) => {
389
- console.log("VLMAnnotation onChange", e), w.current = e, E(e);
381
+ console.log("VLMAnnotation onChange", e), y.current = e, B(e);
390
382
  },
391
- ocrRecognize: Ie,
383
+ ocrRecognize: ve,
392
384
  coordinateType: "center"
393
385
  })
394
- }), x === "attributeDefinition" && /* @__PURE__ */ l(Ue, {
395
- ref: q,
396
- datasetId: m,
397
- versionId: h,
386
+ }), g === "attributeDefinition" && /* @__PURE__ */ a(Le, {
387
+ ref: Q,
388
+ datasetId: u,
389
+ versionId: f,
398
390
  onAttributesChange: (e) => {
399
391
  le(e), e.length > 0 && _.length === 0 && W("textAnnotation");
400
392
  },
401
393
  onLoadingChange: (e) => {
402
- me(e);
394
+ pe(e);
403
395
  }
404
- }, `attribute-${xe}`), x === "qaGeneration" && /* @__PURE__ */ l(qe, {
405
- ref: D,
396
+ }), g === "qaGeneration" && /* @__PURE__ */ a(qe, {
397
+ ref: A,
406
398
  sample: i,
407
399
  labels: _,
408
- datasetId: m,
409
- visionId: h
410
- }, `${(i == null ? void 0 : i.id) || "qa"}-${Ce}`)]
411
- }) : /* @__PURE__ */ l(Le, {})]
400
+ datasetId: u,
401
+ visionId: f
402
+ }, `${(i == null ? void 0 : i.id) || "qa"}-${me}`)]
403
+ }) : /* @__PURE__ */ a(Ne, {})]
412
404
  })
413
405
  });
414
406
  };
415
407
  export {
416
- Ye as default
408
+ Je as default
417
409
  };