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