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