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