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