@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.
- package/dist/es/components/PicZipImportModal/index.mjs +201 -203
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/index.mjs +43 -43
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/index.mjs +197 -186
- package/dist/es/components/VLMAnnotationDetail/index.mjs +175 -176
- package/dist/es/index.mjs +1 -1
- package/dist/lib/index.js +3 -3
- package/package.json +2 -2
|
@@ -1,304 +1,309 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
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
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var o of
|
|
10
|
-
|
|
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) =>
|
|
13
|
-
var z = (v, d, o) => new Promise((
|
|
14
|
-
var
|
|
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(
|
|
16
|
+
r(o.next(N));
|
|
17
17
|
} catch (j) {
|
|
18
18
|
h(j);
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, M = (N) => {
|
|
21
21
|
try {
|
|
22
|
-
r(o.throw(
|
|
22
|
+
r(o.throw(N));
|
|
23
23
|
} catch (j) {
|
|
24
24
|
h(j);
|
|
25
25
|
}
|
|
26
|
-
}, r = (
|
|
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
|
|
30
|
-
import { Modal as
|
|
31
|
-
import { useContext as
|
|
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
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
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
|
-
} =
|
|
41
|
+
} = oe, nt = (v) => {
|
|
42
42
|
const {
|
|
43
43
|
visible: d,
|
|
44
44
|
selectSampleId: o,
|
|
45
|
-
datasetId:
|
|
45
|
+
datasetId: x,
|
|
46
46
|
versionId: h,
|
|
47
47
|
// vmlMarkTmpl,
|
|
48
|
-
onClose:
|
|
49
|
-
onSave:
|
|
48
|
+
onClose: H,
|
|
49
|
+
onSave: M
|
|
50
50
|
} = v, {
|
|
51
51
|
services: {
|
|
52
52
|
cvforceDatahub: r
|
|
53
53
|
},
|
|
54
|
-
token:
|
|
54
|
+
token: N,
|
|
55
55
|
apiUrl: j
|
|
56
|
-
} =
|
|
56
|
+
} = Ge(Pe), B = F(null);
|
|
57
57
|
F(null), F({});
|
|
58
|
-
const [i,
|
|
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
|
-
}), [
|
|
63
|
-
|
|
64
|
-
d && (!
|
|
65
|
-
|
|
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]),
|
|
68
|
-
const e =
|
|
69
|
-
if (!
|
|
67
|
+
}, [d]), O(() => {
|
|
68
|
+
const e = l.current || 1, t = l.pageSize || 100, n = l.type;
|
|
69
|
+
if (!x || !h)
|
|
70
70
|
return;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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((
|
|
77
|
-
const f =
|
|
78
|
-
|
|
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:
|
|
82
|
+
total: a.totalResults,
|
|
82
83
|
type: void 0
|
|
83
84
|
}));
|
|
84
|
-
let u = 0, C =
|
|
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 (
|
|
90
|
-
const
|
|
91
|
-
if (
|
|
92
|
-
u =
|
|
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(
|
|
95
|
-
b && (
|
|
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 && (
|
|
101
|
+
C && (I(C), T(u), re(m.length), de && K(void 0));
|
|
102
|
+
}).finally(() => {
|
|
103
|
+
ne(!1);
|
|
101
104
|
}), V();
|
|
102
|
-
}, [
|
|
105
|
+
}, [l.current, k, x, h]);
|
|
103
106
|
const V = () => {
|
|
104
|
-
!
|
|
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
|
-
|
|
109
|
+
ae(t ? t.count : 0), le(n ? n.count : 0);
|
|
107
110
|
});
|
|
108
|
-
},
|
|
109
|
-
y &&
|
|
110
|
-
var f,
|
|
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
|
|
115
|
-
|
|
117
|
+
const A = n.findIndex((b) => b.id === t.id);
|
|
118
|
+
A > -1 && n.splice(A, 1, t);
|
|
116
119
|
}
|
|
117
|
-
const
|
|
118
|
-
if (t && ((u = t.labels) != null && u.length &&
|
|
119
|
-
const
|
|
120
|
-
|
|
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
|
|
125
|
-
if (
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
current:
|
|
129
|
-
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
|
-
|
|
135
|
-
const
|
|
136
|
-
A
|
|
137
|
-
},
|
|
138
|
-
return
|
|
137
|
+
T(p);
|
|
138
|
+
const A = a[p];
|
|
139
|
+
I(A);
|
|
140
|
+
}, 0);
|
|
141
|
+
return a;
|
|
139
142
|
});
|
|
140
|
-
},
|
|
141
|
-
var
|
|
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
|
|
148
|
-
if (
|
|
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],
|
|
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,
|
|
156
|
-
if (
|
|
157
|
-
(
|
|
158
|
-
current:
|
|
159
|
-
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
|
-
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
+
T(p);
|
|
167
|
+
const m = s[p];
|
|
168
|
+
I(m);
|
|
166
169
|
}
|
|
167
|
-
n &&
|
|
170
|
+
n && q(n);
|
|
168
171
|
};
|
|
169
|
-
|
|
170
|
-
d &&
|
|
171
|
-
|
|
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
|
|
175
|
-
|
|
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
|
-
|
|
180
|
+
O(() => {
|
|
178
181
|
B.current && (B.current.width = B.current.offsetWidth, B.current.height = B.current.offsetHeight);
|
|
179
182
|
}, [B.current]);
|
|
180
|
-
const
|
|
181
|
-
if (
|
|
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),
|
|
185
|
-
t ? (E(void 0),
|
|
186
|
-
}) :
|
|
187
|
-
}),
|
|
188
|
-
if (
|
|
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),
|
|
192
|
-
t ? (E(void 0),
|
|
193
|
-
}) :
|
|
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
|
-
|
|
198
|
+
O(() => {
|
|
196
199
|
w.current = i;
|
|
197
200
|
}, [i]);
|
|
198
|
-
const
|
|
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 ${
|
|
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
|
-
})),
|
|
212
|
+
})), ze = () => z(void 0, null, function* () {
|
|
210
213
|
const e = w.current || i;
|
|
211
|
-
!e || !
|
|
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(
|
|
218
|
-
var
|
|
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)],
|
|
223
|
-
if (
|
|
224
|
-
total:
|
|
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:
|
|
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
|
-
|
|
236
|
+
T(u), I(s[u]);
|
|
234
237
|
} else
|
|
235
|
-
|
|
238
|
+
T(-1), I(void 0);
|
|
236
239
|
return s;
|
|
237
240
|
}), V();
|
|
238
241
|
} catch (t) {
|
|
239
|
-
|
|
242
|
+
L.error("删除失败");
|
|
240
243
|
}
|
|
241
244
|
})
|
|
242
245
|
});
|
|
243
|
-
}),
|
|
244
|
-
if (!
|
|
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(
|
|
247
|
-
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__ */
|
|
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: () =>
|
|
259
|
+
onCancel: () => ke(),
|
|
257
260
|
maskClosable: !1,
|
|
258
261
|
keyboard: !1,
|
|
259
262
|
centered: !0,
|
|
260
|
-
footer:
|
|
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__ */
|
|
269
|
+
children: [/* @__PURE__ */ c("div", {
|
|
267
270
|
style: {
|
|
268
271
|
flex: 1
|
|
269
272
|
}
|
|
270
|
-
}), /* @__PURE__ */ P(
|
|
273
|
+
}), /* @__PURE__ */ P(Se, {
|
|
271
274
|
size: 24,
|
|
272
|
-
children: [!o && (y == null ? void 0 : y.length) > 0 && /* @__PURE__ */
|
|
275
|
+
children: [!o && (y == null ? void 0 : y.length) > 0 && /* @__PURE__ */ c(X, {
|
|
273
276
|
type: "default",
|
|
274
|
-
|
|
277
|
+
disabled: ue || te,
|
|
278
|
+
onClick: Ae,
|
|
275
279
|
children: "上一张"
|
|
276
|
-
}, "prev"), !o && (y == null ? void 0 : y.length) > 0 && /* @__PURE__ */
|
|
280
|
+
}, "prev"), !o && (y == null ? void 0 : y.length) > 0 && /* @__PURE__ */ c(X, {
|
|
277
281
|
type: "default",
|
|
278
|
-
|
|
282
|
+
disabled: ue || te,
|
|
283
|
+
onClick: De,
|
|
279
284
|
children: "下一张"
|
|
280
285
|
}, "next")]
|
|
281
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
288
|
-
children:
|
|
289
|
-
children: [/* @__PURE__ */
|
|
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),
|
|
295
|
-
t ? (
|
|
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__ */
|
|
304
|
+
}, "save"), /* @__PURE__ */ c(X, {
|
|
300
305
|
type: "default",
|
|
301
|
-
onClick:
|
|
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__ */
|
|
315
|
+
children: [/* @__PURE__ */ c("div", {
|
|
311
316
|
className: "records-content-tabs-container",
|
|
312
|
-
children: !o && /* @__PURE__ */ P(
|
|
317
|
+
children: !o && /* @__PURE__ */ P(oe, {
|
|
313
318
|
className: "records-content-tabs",
|
|
314
|
-
activeKey:
|
|
319
|
+
activeKey: k,
|
|
315
320
|
onChange: (e) => z(void 0, null, function* () {
|
|
316
|
-
var n, s,
|
|
321
|
+
var n, s, p;
|
|
317
322
|
let t = !1;
|
|
318
|
-
if (!(
|
|
319
|
-
if (
|
|
320
|
-
const
|
|
321
|
-
if (
|
|
322
|
-
if (!(yield
|
|
323
|
-
|
|
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
|
-
|
|
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 &&
|
|
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__ */
|
|
341
|
-
tab: `全部(${
|
|
342
|
-
}, ""), /* @__PURE__ */
|
|
343
|
-
tab: `未标注(${
|
|
344
|
-
}, "nocode"), /* @__PURE__ */
|
|
345
|
-
tab: `已标注(${
|
|
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__ */
|
|
355
|
+
children: [/* @__PURE__ */ c("div", {
|
|
351
356
|
className: "content-mode-buttons",
|
|
352
|
-
children: /* @__PURE__ */ P(
|
|
353
|
-
activeKey:
|
|
357
|
+
children: /* @__PURE__ */ P(oe, {
|
|
358
|
+
activeKey: g,
|
|
354
359
|
onChange: (e) => z(void 0, null, function* () {
|
|
355
360
|
var t;
|
|
356
|
-
if (!(
|
|
357
|
-
if (
|
|
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
|
|
360
|
-
|
|
364
|
+
if (!(yield M(n))) {
|
|
365
|
+
L.error("保存失败,已阻止切换页签");
|
|
361
366
|
return;
|
|
362
367
|
}
|
|
363
|
-
|
|
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
|
|
374
|
+
e === "textAnnotation" && (i != null && i.id) && (yield pe()), W(e);
|
|
370
375
|
}
|
|
371
376
|
}),
|
|
372
|
-
children: [/* @__PURE__ */
|
|
377
|
+
children: [/* @__PURE__ */ c(Q, {
|
|
373
378
|
tab: "属性定义",
|
|
374
379
|
disabled: ee
|
|
375
|
-
}, "attributeDefinition"), /* @__PURE__ */
|
|
380
|
+
}, "attributeDefinition"), /* @__PURE__ */ c(Q, {
|
|
376
381
|
tab: "文本标注",
|
|
377
382
|
disabled: ee
|
|
378
|
-
}, "textAnnotation"), /* @__PURE__ */
|
|
383
|
+
}, "textAnnotation"), /* @__PURE__ */ c(Q, {
|
|
379
384
|
tab: "QA生成",
|
|
380
385
|
disabled: ee
|
|
381
386
|
}, "qaGeneration")]
|
|
382
387
|
})
|
|
383
|
-
}),
|
|
388
|
+
}), g === "textAnnotation" && i && /* @__PURE__ */ c("div", {
|
|
384
389
|
className: "container",
|
|
385
|
-
children: /* @__PURE__ */
|
|
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:
|
|
396
|
+
ocrRecognize: Ve,
|
|
392
397
|
coordinateType: "center"
|
|
393
398
|
})
|
|
394
|
-
}),
|
|
395
|
-
ref:
|
|
396
|
-
datasetId:
|
|
399
|
+
}), g === "attributeDefinition" && /* @__PURE__ */ c(je, {
|
|
400
|
+
ref: G,
|
|
401
|
+
datasetId: x,
|
|
397
402
|
versionId: h,
|
|
398
403
|
onAttributesChange: (e) => {
|
|
399
|
-
|
|
404
|
+
fe(e), e.length > 0 && _.length === 0 && W("textAnnotation");
|
|
400
405
|
},
|
|
401
406
|
onLoadingChange: (e) => {
|
|
402
|
-
|
|
407
|
+
Ce(e);
|
|
403
408
|
}
|
|
404
|
-
}, `attribute-${
|
|
409
|
+
}, `attribute-${we}`), g === "qaGeneration" && /* @__PURE__ */ c(Be, {
|
|
405
410
|
ref: D,
|
|
406
411
|
sample: i,
|
|
407
412
|
labels: _,
|
|
408
|
-
datasetId:
|
|
413
|
+
datasetId: x,
|
|
409
414
|
visionId: h
|
|
410
|
-
},
|
|
411
|
-
}) : /* @__PURE__ */
|
|
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
|
-
|
|
427
|
+
nt as default
|
|
417
428
|
};
|