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