@glodon-aiot/dataset-annotation 3.10.0-alpha.17 → 3.10.0-alpha.18
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 -188
- package/dist/es/index.mjs +1 -1
- package/dist/lib/index.js +3 -3
- package/package.json +2 -2
|
@@ -1,304 +1,307 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
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
6
|
for (var o in d || (d = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var o of
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
}, $ = (
|
|
13
|
-
var z = (
|
|
14
|
-
var
|
|
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) => {
|
|
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 = (
|
|
27
|
-
r((o = o.apply(
|
|
26
|
+
}, r = (N) => N.done ? x(N.value) : Promise.resolve(N.value).then(H, M);
|
|
27
|
+
r((o = o.apply(b, 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 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";
|
|
32
32
|
import "./style.less.mjs";
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
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";
|
|
39
39
|
const {
|
|
40
40
|
TabPane: Q
|
|
41
|
-
} =
|
|
41
|
+
} = ie, et = (b) => {
|
|
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:
|
|
50
|
-
} =
|
|
48
|
+
onClose: H,
|
|
49
|
+
onSave: M
|
|
50
|
+
} = b, {
|
|
51
51
|
services: {
|
|
52
52
|
cvforceDatahub: r
|
|
53
53
|
},
|
|
54
|
-
token:
|
|
54
|
+
token: N,
|
|
55
55
|
apiUrl: j
|
|
56
|
-
} =
|
|
56
|
+
} = Ue(Ge), B = F(null);
|
|
57
57
|
F(null), F({});
|
|
58
|
-
const [i,
|
|
58
|
+
const [i, I] = S(), w = F(void 0), [Ee, oe] = 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
|
+
}), [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");
|
|
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
|
+
te(!0);
|
|
72
|
+
const s = y || [], p = o || le;
|
|
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((v) => v.id === p);
|
|
92
|
+
if (A !== -1)
|
|
93
|
+
u = A, C = m[A];
|
|
93
94
|
else {
|
|
94
|
-
r == null || r.getDatasetsIdVersionsVidSsamplesSid(
|
|
95
|
-
|
|
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));
|
|
96
97
|
});
|
|
97
98
|
return;
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
|
-
C && (
|
|
101
|
+
C && (I(C), T(u), oe(m.length), le && K(void 0));
|
|
102
|
+
}).finally(() => {
|
|
103
|
+
te(!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
|
+
se(t ? t.count : 0), ce(n ? n.count : 0);
|
|
107
110
|
});
|
|
108
|
-
},
|
|
109
|
-
y &&
|
|
110
|
-
var f,
|
|
111
|
+
}, ne = () => {
|
|
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((v) => v.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
|
-
|
|
121
|
-
total:
|
|
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
|
|
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
|
+
T(p);
|
|
138
|
+
const A = a[p];
|
|
139
|
+
I(A);
|
|
137
140
|
}, 200);
|
|
138
|
-
return
|
|
141
|
+
return a;
|
|
139
142
|
});
|
|
140
|
-
},
|
|
141
|
-
var
|
|
143
|
+
}, fe = () => {
|
|
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
|
+
O(() => {
|
|
173
|
+
d && x && h && i && (r == null || r.getDatasetsIdVersionsVidSsamplesSid(x, h, i.id).then((e) => {
|
|
174
|
+
I(e);
|
|
172
175
|
}));
|
|
173
176
|
}, [d, i == null ? void 0 : i.id]);
|
|
174
|
-
const
|
|
175
|
-
|
|
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();
|
|
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 Ie = () => 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), fe(), V()) : L.error("保存失败");
|
|
189
|
+
}) : fe());
|
|
190
|
+
}), ke = () => 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), ne(), V()) : L.error("保存失败");
|
|
196
|
+
}) : ne());
|
|
194
197
|
});
|
|
195
|
-
|
|
198
|
+
O(() => {
|
|
196
199
|
w.current = i;
|
|
197
200
|
}, [i]);
|
|
198
|
-
const
|
|
201
|
+
const Ae = (e) => (console.log("ocrRecognize apiUrl", j), Be.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
|
+
})), De = () => z(void 0, null, function* () {
|
|
210
213
|
const e = w.current || i;
|
|
211
|
-
!e || !
|
|
214
|
+
!e || !x || !h || pe.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
|
+
}), ue = () => 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(pe, {
|
|
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: () => be(),
|
|
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(me, {
|
|
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
|
-
onClick:
|
|
277
|
+
onClick: Ie,
|
|
275
278
|
children: "上一张"
|
|
276
|
-
}, "prev"), !o && (y == null ? void 0 : y.length) > 0 && /* @__PURE__ */
|
|
279
|
+
}, "prev"), !o && (y == null ? void 0 : y.length) > 0 && /* @__PURE__ */ c(X, {
|
|
277
280
|
type: "default",
|
|
278
|
-
onClick:
|
|
281
|
+
onClick: ke,
|
|
279
282
|
children: "下一张"
|
|
280
283
|
}, "next")]
|
|
281
|
-
}), /* @__PURE__ */
|
|
284
|
+
}), /* @__PURE__ */ c("div", {
|
|
282
285
|
style: {
|
|
283
286
|
flex: 1,
|
|
284
287
|
display: "flex",
|
|
285
288
|
justifyContent: "flex-end"
|
|
286
289
|
},
|
|
287
|
-
children: /* @__PURE__ */
|
|
288
|
-
children:
|
|
289
|
-
children: [/* @__PURE__ */
|
|
290
|
+
children: /* @__PURE__ */ c(me, {
|
|
291
|
+
children: g === "textAnnotation" && (y == null ? void 0 : y.length) > 0 ? /* @__PURE__ */ P(Te, {
|
|
292
|
+
children: [/* @__PURE__ */ c(X, {
|
|
290
293
|
disabled: !i,
|
|
291
294
|
type: "primary",
|
|
292
295
|
onClick: () => {
|
|
293
296
|
const e = w.current || i;
|
|
294
|
-
e && (console.log("save currentSample", e),
|
|
295
|
-
t ? (
|
|
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("保存失败");
|
|
296
299
|
})));
|
|
297
300
|
},
|
|
298
301
|
children: "保存标注"
|
|
299
|
-
}, "save"), /* @__PURE__ */
|
|
302
|
+
}, "save"), /* @__PURE__ */ c(X, {
|
|
300
303
|
type: "default",
|
|
301
|
-
onClick:
|
|
304
|
+
onClick: De,
|
|
302
305
|
children: "删除数据"
|
|
303
306
|
})]
|
|
304
307
|
}) : null
|
|
@@ -307,111 +310,117 @@ const {
|
|
|
307
310
|
}) : null,
|
|
308
311
|
children: /* @__PURE__ */ P("div", {
|
|
309
312
|
className: "vlm-records-content",
|
|
310
|
-
children: [/* @__PURE__ */
|
|
313
|
+
children: [/* @__PURE__ */ c("div", {
|
|
311
314
|
className: "records-content-tabs-container",
|
|
312
|
-
children: !o && /* @__PURE__ */ P(
|
|
315
|
+
children: !o && /* @__PURE__ */ P(ie, {
|
|
313
316
|
className: "records-content-tabs",
|
|
314
|
-
activeKey:
|
|
317
|
+
activeKey: k,
|
|
315
318
|
onChange: (e) => z(void 0, null, function* () {
|
|
316
|
-
var n, s,
|
|
319
|
+
var n, s, p;
|
|
317
320
|
let t = !1;
|
|
318
|
-
if (!(
|
|
319
|
-
if (
|
|
320
|
-
const
|
|
321
|
-
if (
|
|
322
|
-
if (!(yield
|
|
323
|
-
|
|
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()))) {
|
|
322
|
+
if (g === "textAnnotation" && J) {
|
|
323
|
+
const a = w.current || i;
|
|
324
|
+
if (a && M) {
|
|
325
|
+
if (!(yield M(a))) {
|
|
326
|
+
L.error("保存失败,已阻止切换筛选");
|
|
324
327
|
return;
|
|
325
328
|
}
|
|
326
|
-
|
|
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), {
|
|
327
330
|
current: 1,
|
|
328
331
|
total: void 0,
|
|
329
332
|
type: void 0
|
|
330
333
|
})), Z("hascode"));
|
|
331
334
|
}
|
|
332
335
|
}
|
|
333
|
-
t &&
|
|
336
|
+
t && Ce(Date.now()), ve(Date.now()), g !== "attributeDefinition" && (te(!0), q([]), I(void 0), T(-1), K(void 0)), R($(U({}, l), {
|
|
334
337
|
current: 1,
|
|
335
338
|
total: void 0,
|
|
336
339
|
type: void 0
|
|
337
340
|
})), Z(e);
|
|
338
341
|
}
|
|
339
342
|
}),
|
|
340
|
-
children: [/* @__PURE__ */
|
|
341
|
-
tab: `全部(${
|
|
342
|
-
}, ""), /* @__PURE__ */
|
|
343
|
-
tab: `未标注(${
|
|
344
|
-
}, "nocode"), /* @__PURE__ */
|
|
345
|
-
tab: `已标注(${
|
|
343
|
+
children: [/* @__PURE__ */ c(Q, {
|
|
344
|
+
tab: `全部(${re})`
|
|
345
|
+
}, ""), /* @__PURE__ */ c(Q, {
|
|
346
|
+
tab: `未标注(${ae})`
|
|
347
|
+
}, "nocode"), /* @__PURE__ */ c(Q, {
|
|
348
|
+
tab: `已标注(${re - ae})`
|
|
346
349
|
}, "hascode")]
|
|
347
350
|
})
|
|
348
351
|
}), y != null && y.length ? /* @__PURE__ */ P("div", {
|
|
349
352
|
className: "sample-detail",
|
|
350
|
-
children: [/* @__PURE__ */
|
|
353
|
+
children: [/* @__PURE__ */ c("div", {
|
|
351
354
|
className: "content-mode-buttons",
|
|
352
|
-
children: /* @__PURE__ */ P(
|
|
353
|
-
activeKey:
|
|
355
|
+
children: /* @__PURE__ */ P(ie, {
|
|
356
|
+
activeKey: g,
|
|
354
357
|
onChange: (e) => z(void 0, null, function* () {
|
|
355
358
|
var t;
|
|
356
|
-
if (!(
|
|
357
|
-
if (
|
|
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)) {
|
|
358
361
|
const n = w.current || i;
|
|
359
|
-
if (!(yield
|
|
360
|
-
|
|
362
|
+
if (!(yield M(n))) {
|
|
363
|
+
L.error("保存失败,已阻止切换页签");
|
|
361
364
|
return;
|
|
362
365
|
}
|
|
363
|
-
|
|
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), {
|
|
364
367
|
current: 1,
|
|
365
368
|
total: void 0,
|
|
366
369
|
type: void 0
|
|
367
370
|
})), Z("hascode"));
|
|
368
371
|
}
|
|
369
|
-
e === "textAnnotation" && (i != null && i.id) && (yield
|
|
372
|
+
e === "textAnnotation" && (i != null && i.id) && (yield ue()), W(e);
|
|
370
373
|
}
|
|
371
374
|
}),
|
|
372
|
-
children: [/* @__PURE__ */
|
|
375
|
+
children: [/* @__PURE__ */ c(Q, {
|
|
373
376
|
tab: "属性定义",
|
|
374
377
|
disabled: ee
|
|
375
|
-
}, "attributeDefinition"), /* @__PURE__ */
|
|
378
|
+
}, "attributeDefinition"), /* @__PURE__ */ c(Q, {
|
|
376
379
|
tab: "文本标注",
|
|
377
380
|
disabled: ee
|
|
378
|
-
}, "textAnnotation"), /* @__PURE__ */
|
|
381
|
+
}, "textAnnotation"), /* @__PURE__ */ c(Q, {
|
|
379
382
|
tab: "QA生成",
|
|
380
383
|
disabled: ee
|
|
381
384
|
}, "qaGeneration")]
|
|
382
385
|
})
|
|
383
|
-
}),
|
|
386
|
+
}), g === "textAnnotation" && i && /* @__PURE__ */ c("div", {
|
|
384
387
|
className: "container",
|
|
385
|
-
children: /* @__PURE__ */
|
|
388
|
+
children: /* @__PURE__ */ c(je, {
|
|
386
389
|
sample: i,
|
|
387
390
|
labelDefinitions: _,
|
|
388
391
|
onChange: (e) => {
|
|
389
392
|
console.log("VLMAnnotation onChange", e), w.current = e, E(e);
|
|
390
393
|
},
|
|
391
|
-
ocrRecognize:
|
|
394
|
+
ocrRecognize: Ae,
|
|
392
395
|
coordinateType: "center"
|
|
393
396
|
})
|
|
394
|
-
}),
|
|
395
|
-
ref:
|
|
396
|
-
datasetId:
|
|
397
|
+
}), g === "attributeDefinition" && /* @__PURE__ */ c($e, {
|
|
398
|
+
ref: G,
|
|
399
|
+
datasetId: x,
|
|
397
400
|
versionId: h,
|
|
398
401
|
onAttributesChange: (e) => {
|
|
399
|
-
|
|
402
|
+
de(e), e.length > 0 && _.length === 0 && W("textAnnotation");
|
|
400
403
|
},
|
|
401
404
|
onLoadingChange: (e) => {
|
|
402
|
-
|
|
405
|
+
xe(e);
|
|
403
406
|
}
|
|
404
|
-
}, `attribute-${
|
|
407
|
+
}, `attribute-${Se}`), g === "qaGeneration" && /* @__PURE__ */ c(Pe, {
|
|
405
408
|
ref: D,
|
|
406
409
|
sample: i,
|
|
407
410
|
labels: _,
|
|
408
|
-
datasetId:
|
|
411
|
+
datasetId: x,
|
|
409
412
|
visionId: h
|
|
410
|
-
},
|
|
411
|
-
}) : /* @__PURE__ */
|
|
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, {})]
|
|
412
421
|
})
|
|
413
422
|
});
|
|
414
423
|
};
|
|
415
424
|
export {
|
|
416
|
-
|
|
425
|
+
et as default
|
|
417
426
|
};
|