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