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