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