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