@glodon-aiot/dataset-annotation 3.10.0-alpha.17 → 3.10.0-snapshot.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/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 +105 -106
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/AttributeDetail/index.mjs +21 -19
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/index.mjs +219 -227
- 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 -4
|
@@ -1,51 +1,52 @@
|
|
|
1
|
-
var
|
|
1
|
+
var pl = Object.defineProperty;
|
|
2
2
|
var Ve = Object.getOwnPropertySymbols;
|
|
3
|
-
var
|
|
4
|
-
var Pe = (z, e,
|
|
5
|
-
for (var
|
|
6
|
-
|
|
3
|
+
var ul = Object.prototype.hasOwnProperty, ml = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var Pe = (z, e, s) => e in z ? pl(z, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : z[e] = s, Me = (z, e) => {
|
|
5
|
+
for (var s in e || (e = {}))
|
|
6
|
+
ul.call(e, s) && Pe(z, s, e[s]);
|
|
7
7
|
if (Ve)
|
|
8
|
-
for (var
|
|
9
|
-
|
|
8
|
+
for (var s of Ve(e))
|
|
9
|
+
ml.call(e, s) && Pe(z, s, e[s]);
|
|
10
10
|
return z;
|
|
11
11
|
};
|
|
12
|
-
var ce = (z, e,
|
|
12
|
+
var ce = (z, e, s) => new Promise((m, K) => {
|
|
13
13
|
var _ = (N) => {
|
|
14
14
|
try {
|
|
15
|
-
T(
|
|
15
|
+
T(s.next(N));
|
|
16
16
|
} catch (v) {
|
|
17
17
|
K(v);
|
|
18
18
|
}
|
|
19
19
|
}, h = (N) => {
|
|
20
20
|
try {
|
|
21
|
-
T(
|
|
21
|
+
T(s.throw(N));
|
|
22
22
|
} catch (v) {
|
|
23
23
|
K(v);
|
|
24
24
|
}
|
|
25
25
|
}, T = (N) => N.done ? m(N.value) : Promise.resolve(N.value).then(_, h);
|
|
26
|
-
T((
|
|
26
|
+
T((s = s.apply(z, e)).next());
|
|
27
27
|
});
|
|
28
28
|
import { jsxs as d, Fragment as de, jsx as l } from "react/jsx-runtime";
|
|
29
|
-
import { useContext as
|
|
30
|
-
import { Form as V, message as $, Modal as H, Button as P, Radio as k, Tooltip as
|
|
29
|
+
import { useContext as fl, useState as r, useRef as hl, useEffect as O } from "react";
|
|
30
|
+
import { Form as V, message as $, Modal as H, Button as P, Radio as k, Tooltip as gl, Space as je, Upload as Cl, Row as pe, Col as bl, Spin as yl, Result as De } from "antd";
|
|
31
31
|
import "./style.less.mjs";
|
|
32
|
-
import { InfoCircleOutlined as
|
|
33
|
-
import
|
|
34
|
-
import { initMinio as
|
|
32
|
+
import { InfoCircleOutlined as Sl, CloudUploadOutlined as zl, PaperClipOutlined as wl, DeleteOutlined as El, PlusOutlined as Nl } from "@ant-design/icons";
|
|
33
|
+
import vl from "browser-md5-file";
|
|
34
|
+
import { initMinio as Ke, putObjectBuffer as _e } from "@glodon-aiot/minio";
|
|
35
|
+
import xl from "antd/lib/upload/Dragger";
|
|
35
36
|
import Al from "./pic_zip.svg.mjs";
|
|
36
37
|
import Fl from "./pic_zip_json.svg.mjs";
|
|
37
38
|
import Rl from "./pic_vlm_json_zip.svg.mjs";
|
|
38
39
|
import Bl from "./pic_vlm_zip.svg.mjs";
|
|
39
|
-
import { MB as
|
|
40
|
+
import { MB as Ze, GB as $l } from "../../constant.mjs";
|
|
40
41
|
import { fileSuffixToLowerCase as kl } from "../../utils/index.mjs";
|
|
41
42
|
import Tl from "../../DatasetContext/index.mjs";
|
|
42
43
|
import { EXAMPLE_SRC_ROOT as Ul, VLM_EXAMPLE_SRC_ROOT as Ll } from "../../featuresConfig.mjs";
|
|
43
44
|
import { getImportConfig as Ol } from "./config.mjs";
|
|
44
45
|
let f = 0, G = 0, M = 0, I = 0;
|
|
45
|
-
const
|
|
46
|
+
const ot = (z) => {
|
|
46
47
|
const {
|
|
47
48
|
datasetIam: e,
|
|
48
|
-
datasetId:
|
|
49
|
+
datasetId: s,
|
|
49
50
|
currentVersion: m,
|
|
50
51
|
tenCode: K,
|
|
51
52
|
isVisible: _,
|
|
@@ -68,35 +69,33 @@ const nt = (z) => {
|
|
|
68
69
|
exampleSrcRoot: Ul,
|
|
69
70
|
vlmExampleSrcRoot: Ll
|
|
70
71
|
}
|
|
71
|
-
} =
|
|
72
|
+
} = fl(Tl), [w, Ge] = r(0), [E, Ie] = r(0), [Y, qe] = r([]), [j, Xe] = r(), [ge, Vl] = r([]), [ee, X] = r(!1), [Ce, le] = r(!1), [Z, te] = r(!1), [ie, Je] = r(0), [be, We] = r(0), [J, ye] = r(-1), [se, Pl] = r([]), [Se, Ml] = r([]), [ze, ne] = r(!1), He = new vl(), [W] = V.useForm(), n = V.useWatch("acceptType", W), F = V.useWatch("labelState", W), [C, we] = r([]), [R, Ee] = r([]), [B, Qe] = r(), [Ne, ve] = r(0), [xe, Ae] = r(!1), [jl, Fe] = r(""), [Ye, Re] = r(!1), [Be, el] = r(
|
|
72
73
|
"unlabeled"
|
|
73
74
|
/* Unlabeled */
|
|
74
|
-
), oe =
|
|
75
|
-
Dragger: tl
|
|
76
|
-
} = De, g = Ol(h), ae = g.imageMimeTypes, $e = g.imageAccept, re = g.maxImageSize;
|
|
75
|
+
), oe = hl(!0), g = Ol(h), ae = g.imageMimeTypes, $e = g.imageAccept, re = g.maxImageSize;
|
|
77
76
|
O(() => {
|
|
78
77
|
f = 0, G = 0, M = 0, I = 0, te(!1), _ && (oe.current = !1, q && q());
|
|
79
78
|
}, [_]);
|
|
80
|
-
const ke = (t,
|
|
79
|
+
const ke = (t, i) => {
|
|
81
80
|
var o;
|
|
82
81
|
if (n === "image") {
|
|
83
82
|
ne(!0);
|
|
84
83
|
let a = 0;
|
|
85
|
-
if (f = f + 1, G = G + 1,
|
|
84
|
+
if (f = f + 1, G = G + 1, i.length === 0)
|
|
86
85
|
return;
|
|
87
86
|
let u = 0;
|
|
88
|
-
const [...c] =
|
|
87
|
+
const [...c] = i, y = window.URL || window.webkitURL, S = new Image();
|
|
89
88
|
S.src = y.createObjectURL(t), S.onload = () => {
|
|
90
89
|
Y.push({
|
|
91
90
|
name: t.name,
|
|
92
91
|
src: S.src,
|
|
93
92
|
width: S.width,
|
|
94
93
|
height: S.height
|
|
95
|
-
}),
|
|
96
|
-
},
|
|
94
|
+
}), qe(Y);
|
|
95
|
+
}, i.map((x) => {
|
|
97
96
|
const A = ae.some((L) => L === x.type), U = x.size <= re;
|
|
98
97
|
A ? U || (a = a + 1, c.splice(c.findIndex((L) => L.name === x.name), 1)) : (u = u + 1, c.splice(c.findIndex((L) => L.name === x.name), 1));
|
|
99
|
-
}), c.length > 100 && c.splice(100, c.length),
|
|
98
|
+
}), c.length > 100 && c.splice(100, c.length), Ge(u), Ie(a), G === i.length && (ne(!0), G = 0);
|
|
100
99
|
const b = ae.some((x) => x === t.type), D = t.size <= re;
|
|
101
100
|
if (b) {
|
|
102
101
|
if (!D)
|
|
@@ -114,54 +113,54 @@ const nt = (z) => {
|
|
|
114
113
|
return !1;
|
|
115
114
|
};
|
|
116
115
|
O(() => {
|
|
117
|
-
ze !== !1 && (!w && !E && !f || (f = f - I - w - E, f < 101 ? w > 0 && E > 0 ? ($.error(`${w + E}个文件添加失败,格式、大小或数量不符合要求`), f = f - w - E) : w > 0 && E === 0 ? $.error(`${w}个文件添加失败,格式不符合要求`) : w === 0 && E > 0 ? $.error(`${E}个文件添加失败,单张图片超过${g.maxImageSize /
|
|
116
|
+
ze !== !1 && (!w && !E && !f || (f = f - I - w - E, f < 101 ? w > 0 && E > 0 ? ($.error(`${w + E}个文件添加失败,格式、大小或数量不符合要求`), f = f - w - E) : w > 0 && E === 0 ? $.error(`${w}个文件添加失败,格式不符合要求`) : w === 0 && E > 0 ? $.error(`${E}个文件添加失败,单张图片超过${g.maxImageSize / Ze}M`) : w === 0 && E === 0 && $.success("校验成功") : w + E === 0 ? ($.error(`${f - 100}个文件添加失败,超过数量限制`), f = 100) : ($.error(`${f - 100 + w + E}个文件添加失败,格式、大小或数量不符合要求`), f = f < 101 ? f : 100), ne(!1)));
|
|
118
117
|
}, [ze]);
|
|
119
|
-
const
|
|
120
|
-
const
|
|
118
|
+
const ll = (t) => {
|
|
119
|
+
const i = t.originFileObj;
|
|
121
120
|
return new Promise((o, a) => {
|
|
122
|
-
|
|
123
|
-
u && a(u),
|
|
121
|
+
He.md5(i, (u, c) => {
|
|
122
|
+
u && a(u), il(c, i), o(c);
|
|
124
123
|
});
|
|
125
124
|
});
|
|
126
|
-
},
|
|
125
|
+
}, tl = () => ce(void 0, null, function* () {
|
|
127
126
|
if (!C)
|
|
128
127
|
return;
|
|
129
128
|
const t = [];
|
|
130
|
-
for (let
|
|
131
|
-
const o = C[
|
|
129
|
+
for (let i = 0; i < C.length; i++) {
|
|
130
|
+
const o = C[i], a = yield ll(o);
|
|
132
131
|
t.push(a);
|
|
133
132
|
}
|
|
134
|
-
!
|
|
135
|
-
|
|
133
|
+
!s || t.length === 0 || p == null || p.getDeduplication(t, s).then((i) => {
|
|
134
|
+
Xe(i), Re(!1);
|
|
136
135
|
});
|
|
137
136
|
});
|
|
138
137
|
O(() => {
|
|
139
|
-
|
|
138
|
+
tl();
|
|
140
139
|
}, [C]);
|
|
141
|
-
const
|
|
142
|
-
|
|
140
|
+
const il = (t, i) => {
|
|
141
|
+
i.md5 = t, ge.push(i);
|
|
143
142
|
}, Te = ({
|
|
144
143
|
fileList: t
|
|
145
144
|
}) => {
|
|
146
145
|
if (n === "zip")
|
|
147
146
|
return;
|
|
148
147
|
Re(!0);
|
|
149
|
-
const
|
|
150
|
-
|
|
148
|
+
const i = t.filter((o) => o.size && o.size <= re ? ae.some((a) => o.type === a) : !1);
|
|
149
|
+
i.splice(100, i.length), i.length < C.length ? (we(i), I++) : (M = M - I, I = 0, M++, M == i.length && we(i), M > i.length && (M = i.length));
|
|
151
150
|
}, Ue = () => {
|
|
152
151
|
n === "zip" && (oe.current = !0), T(!1);
|
|
153
|
-
},
|
|
152
|
+
}, sl = () => {
|
|
154
153
|
if (n === "image") {
|
|
155
154
|
if (!j)
|
|
156
155
|
return;
|
|
157
|
-
let t = 0,
|
|
156
|
+
let t = 0, i = 0;
|
|
158
157
|
if (j.duplicated.length !== 0 && j.duplicated.map((o, a) => {
|
|
159
158
|
var y;
|
|
160
159
|
const u = j.duplicatedMd5[a], c = ((y = C.find((S) => {
|
|
161
160
|
var b;
|
|
162
161
|
return ((b = S.originFileObj) == null ? void 0 : b.md5) === u;
|
|
163
162
|
})) == null ? void 0 : y.name) || "";
|
|
164
|
-
|
|
163
|
+
se.push({
|
|
165
164
|
labels: [],
|
|
166
165
|
fileKey: o,
|
|
167
166
|
sampleFileName: {
|
|
@@ -177,17 +176,17 @@ const nt = (z) => {
|
|
|
177
176
|
"Content-Type": "application/octet-stream",
|
|
178
177
|
"X-Amz-Meta-Width": b == null ? void 0 : b.width,
|
|
179
178
|
"X-Amz-Meta-Height": b == null ? void 0 : b.height
|
|
180
|
-
}, x = `dataset/${
|
|
179
|
+
}, x = `dataset/${s}/sample/${a}${kl(S)}`;
|
|
181
180
|
delete c.md5;
|
|
182
181
|
const A = new FileReader();
|
|
183
182
|
A.readAsArrayBuffer(c), A.onload = (U) => {
|
|
184
|
-
|
|
183
|
+
Ke({
|
|
185
184
|
endPoint: e == null ? void 0 : e.endpoints[0],
|
|
186
185
|
useSSL: e == null ? void 0 : e.useSSL,
|
|
187
186
|
accessKey: e == null ? void 0 : e.accessKey,
|
|
188
187
|
secretKey: e == null ? void 0 : e.secretKey
|
|
189
|
-
}),
|
|
190
|
-
X(!0),
|
|
188
|
+
}), _e(K, x, U.target.result, D, (L, Dl) => {
|
|
189
|
+
X(!0), i += 1, L && (t += 1, We(t)), Je(i), Se.push({
|
|
191
190
|
labels: [],
|
|
192
191
|
fileKey: `${K}/${x}`,
|
|
193
192
|
sampleFileName: {
|
|
@@ -198,31 +197,31 @@ const nt = (z) => {
|
|
|
198
197
|
};
|
|
199
198
|
}));
|
|
200
199
|
Promise.all(o).then(() => {
|
|
201
|
-
!
|
|
202
|
-
p == null || p.postDatasetsIdVersionsVidSamples(
|
|
203
|
-
samples: Se.concat(
|
|
200
|
+
!s || !m || setTimeout(() => {
|
|
201
|
+
p == null || p.postDatasetsIdVersionsVidSamples(s, m.id, {
|
|
202
|
+
samples: Se.concat(se)
|
|
204
203
|
}).then(() => {
|
|
205
|
-
p.getDatasetsIdVersionsVid(
|
|
204
|
+
p.getDatasetsIdVersionsVid(s, m.id).then((a) => {
|
|
206
205
|
ye(a.samplesCount - m.samplesCount);
|
|
207
206
|
}), Q(!0), v && v(!1);
|
|
208
207
|
});
|
|
209
208
|
}, 100);
|
|
210
209
|
});
|
|
211
210
|
} else {
|
|
212
|
-
if (!
|
|
211
|
+
if (!s || !m)
|
|
213
212
|
return;
|
|
214
|
-
p == null || p.postDatasetsIdVersionsVidSamples(
|
|
215
|
-
samples:
|
|
213
|
+
p == null || p.postDatasetsIdVersionsVidSamples(s, m.id, {
|
|
214
|
+
samples: se
|
|
216
215
|
}).then(() => {
|
|
217
|
-
p.getDatasetsIdVersionsVid(
|
|
216
|
+
p.getDatasetsIdVersionsVid(s, m.id).then((o) => {
|
|
218
217
|
ye(o.samplesCount - m.samplesCount);
|
|
219
218
|
}), Q(!0), v && v(!1);
|
|
220
219
|
});
|
|
221
220
|
}
|
|
222
221
|
} else
|
|
223
|
-
|
|
224
|
-
},
|
|
225
|
-
!
|
|
222
|
+
nl(R);
|
|
223
|
+
}, nl = (t) => {
|
|
224
|
+
!s || !m || t.map((i, o) => {
|
|
226
225
|
var S;
|
|
227
226
|
const a = {
|
|
228
227
|
"Content-Type": "application/octet-stream"
|
|
@@ -232,19 +231,19 @@ const nt = (z) => {
|
|
|
232
231
|
accessKey: e == null ? void 0 : e.accessKey,
|
|
233
232
|
secretKey: e == null ? void 0 : e.secretKey
|
|
234
233
|
}, c = (e == null ? void 0 : e.prefix) + ((S = t[0]) == null ? void 0 : S.name), y = new FileReader();
|
|
235
|
-
y.readAsArrayBuffer(
|
|
236
|
-
|
|
234
|
+
y.readAsArrayBuffer(i), y.onload = (b) => {
|
|
235
|
+
Ke(u), _e(e == null ? void 0 : e.bucket, c, b.target.result, a, (D, x) => {
|
|
237
236
|
if (D)
|
|
238
237
|
console.log(D);
|
|
239
238
|
else {
|
|
240
239
|
if (oe.current)
|
|
241
240
|
return;
|
|
242
|
-
X(!0), h === "vlm" ? p == null || p.postVlmUploadPicsZip(
|
|
241
|
+
X(!0), h === "vlm" ? p == null || p.postVlmUploadPicsZip(s, m.id, {
|
|
243
242
|
zipUrl: (e == null ? void 0 : e.bucket) + "/" + c,
|
|
244
243
|
type: F === "labeled" ? 2 : 1
|
|
245
244
|
}).then((A) => {
|
|
246
245
|
Le(A), Fe(A);
|
|
247
|
-
}) : p == null || p.postUploadPicsZip(
|
|
246
|
+
}) : p == null || p.postUploadPicsZip(s, m.id, Me({
|
|
248
247
|
zipUrls: [(e == null ? void 0 : e.bucket) + "/" + c]
|
|
249
248
|
}, (h === "ocr" || h === "vlm") && {
|
|
250
249
|
type: F === "labeled" ? 1 : 0
|
|
@@ -256,17 +255,17 @@ const nt = (z) => {
|
|
|
256
255
|
};
|
|
257
256
|
});
|
|
258
257
|
}, Le = (t) => ce(void 0, null, function* () {
|
|
259
|
-
var
|
|
260
|
-
if (!(!
|
|
258
|
+
var i;
|
|
259
|
+
if (!(!s || !m || !p))
|
|
261
260
|
try {
|
|
262
|
-
const o = yield p.checkFileResult(
|
|
261
|
+
const o = yield p.checkFileResult(s, m.id, {
|
|
263
262
|
taskId: t
|
|
264
263
|
}, 5e3, h, (a) => {
|
|
265
264
|
ve(a);
|
|
266
265
|
});
|
|
267
|
-
o &&
|
|
266
|
+
o && Qe(JSON.parse(o));
|
|
268
267
|
} catch (o) {
|
|
269
|
-
if (((
|
|
268
|
+
if (((i = o.cause) == null ? void 0 : i.code) === -101) {
|
|
270
269
|
Ae(!0);
|
|
271
270
|
return;
|
|
272
271
|
}
|
|
@@ -275,27 +274,27 @@ const nt = (z) => {
|
|
|
275
274
|
O(() => {
|
|
276
275
|
B && (ve(100), le(!0));
|
|
277
276
|
}, [B]), O(() => {
|
|
278
|
-
|
|
279
|
-
}, [
|
|
277
|
+
ie !== 0 && (Q(!1), v && v(!0));
|
|
278
|
+
}, [ie]), O(() => {
|
|
280
279
|
J !== -1 && (le(!0), te(!1));
|
|
281
280
|
}, [J]);
|
|
282
|
-
const
|
|
281
|
+
const ol = () => {
|
|
283
282
|
Oe(), le(!1), me && me();
|
|
284
283
|
}, Oe = () => {
|
|
285
284
|
N(), X(!1), T(!1), ue && ue(), q && q();
|
|
286
|
-
},
|
|
287
|
-
children: [/* @__PURE__ */ l(
|
|
285
|
+
}, al = /* @__PURE__ */ d("div", {
|
|
286
|
+
children: [/* @__PURE__ */ l(Nl, {}), /* @__PURE__ */ l("div", {
|
|
288
287
|
style: {
|
|
289
288
|
marginTop: 8
|
|
290
289
|
},
|
|
291
290
|
children: "添加图片"
|
|
292
291
|
})]
|
|
293
|
-
}),
|
|
294
|
-
const
|
|
295
|
-
Ee(
|
|
296
|
-
},
|
|
292
|
+
}), rl = (t) => {
|
|
293
|
+
const i = R.filter((o) => o.uid !== t.uid);
|
|
294
|
+
Ee(i);
|
|
295
|
+
}, cl = () => {
|
|
297
296
|
F === "labeled" ? h === "vlm" ? window.location.href = `${he}/%E6%9C%89%E6%A0%87%E6%B3%A8%E7%A4%BA%E4%BE%8B.zip` : window.location.href = `${fe}/%E6%A0%87%E6%B3%A8%E6%A0%BC%E5%BC%8F%E7%A4%BA%E4%BE%8B.zip` : h === "vlm" ? window.location.href = `${he}/%E6%97%A0%E6%A0%87%E6%B3%A8%E7%A4%BA%E4%BE%8B.zip` : window.location.href = `${fe}/%E7%A4%BA%E4%BE%8B%E5%8E%8B%E7%BC%A9%E5%8C%85.zip`;
|
|
298
|
-
},
|
|
297
|
+
}, dl = () => {
|
|
299
298
|
N(), Ae(!1), X(!1), T(!1);
|
|
300
299
|
};
|
|
301
300
|
return O(() => {
|
|
@@ -321,10 +320,10 @@ const nt = (z) => {
|
|
|
321
320
|
type: "primary",
|
|
322
321
|
htmlType: "submit",
|
|
323
322
|
form: "importModal",
|
|
324
|
-
disabled: n === "image" && !C.length || n === "zip" && !R.length || ee && Ne == 0 ||
|
|
323
|
+
disabled: n === "image" && !C.length || n === "zip" && !R.length || ee && Ne == 0 || Ye,
|
|
325
324
|
loading: Z == !0,
|
|
326
325
|
onClick: () => {
|
|
327
|
-
|
|
326
|
+
sl(), te(!0);
|
|
328
327
|
},
|
|
329
328
|
children: "导入"
|
|
330
329
|
}, "confirm")],
|
|
@@ -354,16 +353,16 @@ const nt = (z) => {
|
|
|
354
353
|
children: /* @__PURE__ */ d(k.Group, {
|
|
355
354
|
disabled: Z,
|
|
356
355
|
onChange: (t) => {
|
|
357
|
-
|
|
356
|
+
el(t.target.value);
|
|
358
357
|
},
|
|
359
358
|
children: [/* @__PURE__ */ l(k, {
|
|
360
359
|
value: "unlabeled",
|
|
361
360
|
children: "无标注信息"
|
|
362
361
|
}), /* @__PURE__ */ d(k, {
|
|
363
362
|
value: "labeled",
|
|
364
|
-
children: ["有标注信息", h === "vlm" && /* @__PURE__ */ l(
|
|
363
|
+
children: ["有标注信息", h === "vlm" && /* @__PURE__ */ l(gl, {
|
|
365
364
|
title: "支持上传带OCR标注信息的数据",
|
|
366
|
-
children: /* @__PURE__ */ l(
|
|
365
|
+
children: /* @__PURE__ */ l(Sl, {
|
|
367
366
|
style: {
|
|
368
367
|
cursor: "pointer",
|
|
369
368
|
marginLeft: 4,
|
|
@@ -406,7 +405,7 @@ const nt = (z) => {
|
|
|
406
405
|
})
|
|
407
406
|
}), /* @__PURE__ */ d("div", {
|
|
408
407
|
className: "file-upload",
|
|
409
|
-
children: [(n === "image" && !C.length || n === "zip") && /* @__PURE__ */ d(
|
|
408
|
+
children: [(n === "image" && !C.length || n === "zip") && /* @__PURE__ */ d(xl, {
|
|
410
409
|
name: "file",
|
|
411
410
|
showUploadList: !1,
|
|
412
411
|
multiple: !0,
|
|
@@ -417,7 +416,7 @@ const nt = (z) => {
|
|
|
417
416
|
disabled: n === "zip" ? R.length === 1 : !1,
|
|
418
417
|
children: [/* @__PURE__ */ l("span", {
|
|
419
418
|
className: "file-upload-icon",
|
|
420
|
-
children: /* @__PURE__ */ l(
|
|
419
|
+
children: /* @__PURE__ */ l(zl, {})
|
|
421
420
|
}), /* @__PURE__ */ d(je, {
|
|
422
421
|
className: "file-upload-action",
|
|
423
422
|
children: [n === "image" && "拖拽图片至此,或者", n === "zip" && "拖拽包含“图片”的压缩包至此,或者", /* @__PURE__ */ l(P, {
|
|
@@ -435,7 +434,7 @@ const nt = (z) => {
|
|
|
435
434
|
},
|
|
436
435
|
children: [/* @__PURE__ */ d("div", {
|
|
437
436
|
className: "item-upload-desc item-upload-desc__1",
|
|
438
|
-
children: ["1. 支持", g.imageFormatsText, "格式,单张图片不超过", g.maxImageSize /
|
|
437
|
+
children: ["1. 支持", g.imageFormatsText, "格式,单张图片不超过", g.maxImageSize / Ze, "M;"]
|
|
439
438
|
}), /* @__PURE__ */ l("div", {
|
|
440
439
|
className: "item-upload-desc",
|
|
441
440
|
children: "2. 单次上传最多可选择100个文件。"
|
|
@@ -449,10 +448,10 @@ const nt = (z) => {
|
|
|
449
448
|
className: "item-upload-desc item-upload-desc__1",
|
|
450
449
|
children: "1. 仅支持.zip格式,单个压缩包不超过2G;"
|
|
451
450
|
}), F === "labeled" ? /* @__PURE__ */ l(de, {
|
|
452
|
-
children: g.zipUploadTexts.labeled.description.map((t,
|
|
451
|
+
children: g.zipUploadTexts.labeled.description.map((t, i) => /* @__PURE__ */ d("div", {
|
|
453
452
|
className: "item-upload-desc",
|
|
454
|
-
children: [
|
|
455
|
-
},
|
|
453
|
+
children: [i + 2, ". ", t]
|
|
454
|
+
}, i))
|
|
456
455
|
}) : /* @__PURE__ */ d("div", {
|
|
457
456
|
className: "item-upload-desc",
|
|
458
457
|
children: ["2. ", g.zipUploadTexts.unlabeled.description[0]]
|
|
@@ -463,7 +462,7 @@ const nt = (z) => {
|
|
|
463
462
|
})]
|
|
464
463
|
}), n === "image" && C.length ? /* @__PURE__ */ l("div", {
|
|
465
464
|
className: "picture-upload",
|
|
466
|
-
children: /* @__PURE__ */ l(
|
|
465
|
+
children: /* @__PURE__ */ l(Cl, {
|
|
467
466
|
listType: "picture-card",
|
|
468
467
|
fileList: C,
|
|
469
468
|
multiple: !0,
|
|
@@ -473,7 +472,7 @@ const nt = (z) => {
|
|
|
473
472
|
beforeUpload: ke,
|
|
474
473
|
accept: $e,
|
|
475
474
|
onChange: Te,
|
|
476
|
-
children: C.length < 100 ?
|
|
475
|
+
children: C.length < 100 ? al : null
|
|
477
476
|
})
|
|
478
477
|
}) : /* @__PURE__ */ l(de, {}), n === "zip" && /* @__PURE__ */ d("div", {
|
|
479
478
|
className: "upload-wrapper",
|
|
@@ -482,7 +481,7 @@ const nt = (z) => {
|
|
|
482
481
|
children: /* @__PURE__ */ l(pe, {
|
|
483
482
|
gutter: [24, 8],
|
|
484
483
|
className: "upload-pannel",
|
|
485
|
-
children: R.map((t) => /* @__PURE__ */ l(
|
|
484
|
+
children: R.map((t) => /* @__PURE__ */ l(bl, {
|
|
486
485
|
span: 24,
|
|
487
486
|
className: "upload-item",
|
|
488
487
|
children: /* @__PURE__ */ d(pe, {
|
|
@@ -492,7 +491,7 @@ const nt = (z) => {
|
|
|
492
491
|
align: "middle",
|
|
493
492
|
children: [/* @__PURE__ */ l("span", {
|
|
494
493
|
className: "upload-item-file-icon",
|
|
495
|
-
children: /* @__PURE__ */ l(
|
|
494
|
+
children: /* @__PURE__ */ l(wl, {})
|
|
496
495
|
}), /* @__PURE__ */ l("span", {
|
|
497
496
|
className: "upload-item-name",
|
|
498
497
|
children: t.name
|
|
@@ -501,8 +500,8 @@ const nt = (z) => {
|
|
|
501
500
|
className: "upload-item-upload-delete",
|
|
502
501
|
type: "link",
|
|
503
502
|
disabled: Z,
|
|
504
|
-
onClick: () =>
|
|
505
|
-
children: /* @__PURE__ */ l(
|
|
503
|
+
onClick: () => rl(t),
|
|
504
|
+
children: /* @__PURE__ */ l(El, {})
|
|
506
505
|
})]
|
|
507
506
|
})
|
|
508
507
|
}, t.uid))
|
|
@@ -521,7 +520,7 @@ const nt = (z) => {
|
|
|
521
520
|
padding: 0
|
|
522
521
|
},
|
|
523
522
|
onClick: (t) => {
|
|
524
|
-
t.stopPropagation(),
|
|
523
|
+
t.stopPropagation(), cl();
|
|
525
524
|
},
|
|
526
525
|
children: "下载示例 >"
|
|
527
526
|
})]
|
|
@@ -549,8 +548,8 @@ const nt = (z) => {
|
|
|
549
548
|
footer: null,
|
|
550
549
|
children: /* @__PURE__ */ l("div", {
|
|
551
550
|
className: "upload-spin",
|
|
552
|
-
children: /* @__PURE__ */ l(
|
|
553
|
-
tip: n === "image" ? `数据导入中(${
|
|
551
|
+
children: /* @__PURE__ */ l(yl, {
|
|
552
|
+
tip: n === "image" ? `数据导入中(${ie}/${C.length}),请耐心等待` : `处理中(${Ne}/100%),请耐心等待`,
|
|
554
553
|
size: "large",
|
|
555
554
|
children: /* @__PURE__ */ l("div", {
|
|
556
555
|
className: "content"
|
|
@@ -566,11 +565,11 @@ const nt = (z) => {
|
|
|
566
565
|
footer: null,
|
|
567
566
|
children: /* @__PURE__ */ l("div", {
|
|
568
567
|
className: "upload-result",
|
|
569
|
-
children: /* @__PURE__ */ l(
|
|
568
|
+
children: /* @__PURE__ */ l(De, {
|
|
570
569
|
status: "success",
|
|
571
570
|
title: n === "image" ? `数据导入完成,成功${J}个,失败${be}个,去重${C.length - J - be}个` : B && `数据导入完成,格式不符合的图片${B.formatErrorCount || 0}个,成功${B.successCount || 0}个,去重${B.repeatCount || 0}个,失败${B.failedCount || 0}个` + (F === "labeled" ? `(${(g.labelFormat || "json").toUpperCase()}格式不符合${B.labelErrorCount}个)` : ""),
|
|
572
571
|
extra: [/* @__PURE__ */ l(P, {
|
|
573
|
-
onClick:
|
|
572
|
+
onClick: ol,
|
|
574
573
|
children: "关闭"
|
|
575
574
|
}, "close")]
|
|
576
575
|
})
|
|
@@ -584,11 +583,11 @@ const nt = (z) => {
|
|
|
584
583
|
footer: null,
|
|
585
584
|
children: /* @__PURE__ */ l("div", {
|
|
586
585
|
className: "upload-result",
|
|
587
|
-
children: /* @__PURE__ */ l(
|
|
586
|
+
children: /* @__PURE__ */ l(De, {
|
|
588
587
|
status: "error",
|
|
589
588
|
title: "文件处理失败",
|
|
590
589
|
extra: [/* @__PURE__ */ l(P, {
|
|
591
|
-
onClick:
|
|
590
|
+
onClick: dl,
|
|
592
591
|
children: "关闭"
|
|
593
592
|
}, "close")]
|
|
594
593
|
})
|
|
@@ -597,5 +596,5 @@ const nt = (z) => {
|
|
|
597
596
|
});
|
|
598
597
|
};
|
|
599
598
|
export {
|
|
600
|
-
|
|
599
|
+
ot as default
|
|
601
600
|
};
|
|
@@ -10,20 +10,20 @@ var M = (o, s, n) => s in o ? X(o, s, { enumerable: !0, configurable: !0, writab
|
|
|
10
10
|
te.call(s, n) && M(o, n, s[n]);
|
|
11
11
|
return o;
|
|
12
12
|
}, A = (o, s) => Y(o, Z(s));
|
|
13
|
-
var E = (o, s, n) => new Promise((
|
|
13
|
+
var E = (o, s, n) => new Promise((h, f) => {
|
|
14
14
|
var l = (c) => {
|
|
15
15
|
try {
|
|
16
16
|
a(n.next(c));
|
|
17
|
-
} catch (
|
|
18
|
-
|
|
17
|
+
} catch (m) {
|
|
18
|
+
f(m);
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, p = (c) => {
|
|
21
21
|
try {
|
|
22
22
|
a(n.throw(c));
|
|
23
|
-
} catch (
|
|
24
|
-
|
|
23
|
+
} catch (m) {
|
|
24
|
+
f(m);
|
|
25
25
|
}
|
|
26
|
-
}, a = (c) => c.done ?
|
|
26
|
+
}, a = (c) => c.done ? h(c.value) : Promise.resolve(c.value).then(l, p);
|
|
27
27
|
a((n = n.apply(o, s)).next());
|
|
28
28
|
});
|
|
29
29
|
import { jsxs as u, jsx as i } from "react/jsx-runtime";
|
|
@@ -35,14 +35,14 @@ import B from "../../../Iconfont/index.mjs";
|
|
|
35
35
|
const de = ie((o, s) => {
|
|
36
36
|
const {
|
|
37
37
|
datasetId: n,
|
|
38
|
-
versionId:
|
|
39
|
-
onAttributesChange:
|
|
38
|
+
versionId: h,
|
|
39
|
+
onAttributesChange: f,
|
|
40
40
|
onLoadingChange: l
|
|
41
41
|
} = o, {
|
|
42
42
|
services: {
|
|
43
|
-
cvforceDatahub:
|
|
43
|
+
cvforceDatahub: p
|
|
44
44
|
}
|
|
45
|
-
} = ne(oe), [a, c] = b([]), [
|
|
45
|
+
} = ne(oe), [a, c] = b([]), [m, N] = b(!1), [D, g] = b(""), [w, O] = b(!1), [R, y] = b(null), I = re(""), S = (e) => {
|
|
46
46
|
const t = [...e].sort((r, d) => r.id.localeCompare(d.id));
|
|
47
47
|
return JSON.stringify(t);
|
|
48
48
|
}, U = () => S(a) !== I.current, z = () => new Promise((e) => {
|
|
@@ -70,8 +70,8 @@ const de = ie((o, s) => {
|
|
|
70
70
|
const V = () => E(void 0, null, function* () {
|
|
71
71
|
N(!0), l == null || l(!0);
|
|
72
72
|
try {
|
|
73
|
-
if (n &&
|
|
74
|
-
const t = (yield
|
|
73
|
+
if (n && h && p) {
|
|
74
|
+
const t = (yield p.getDatasetsIdVersionsVidConfigs(n, h)) || [];
|
|
75
75
|
return c(t), I.current = S(t), t;
|
|
76
76
|
}
|
|
77
77
|
} catch (e) {
|
|
@@ -126,7 +126,7 @@ const de = ie((o, s) => {
|
|
|
126
126
|
}) : d);
|
|
127
127
|
c(r);
|
|
128
128
|
}, L = () => E(void 0, null, function* () {
|
|
129
|
-
if (!(!n || !
|
|
129
|
+
if (!(!n || !h || !p)) {
|
|
130
130
|
N(!0), l == null || l(!0);
|
|
131
131
|
try {
|
|
132
132
|
const e = a.map((r) => {
|
|
@@ -135,11 +135,11 @@ const de = ie((o, s) => {
|
|
|
135
135
|
id: (d = r.id) != null && d.startsWith("attr-") ? "" : r.id
|
|
136
136
|
});
|
|
137
137
|
});
|
|
138
|
-
console.log("attributes", a), yield
|
|
138
|
+
console.log("attributes", a), yield p.saveVisionLabelConfigs(n, h, {
|
|
139
139
|
data: e
|
|
140
140
|
});
|
|
141
141
|
const t = yield V();
|
|
142
|
-
C.success("保存成功"),
|
|
142
|
+
C.success("保存成功"), f == null || f(t || a);
|
|
143
143
|
} catch (e) {
|
|
144
144
|
throw console.error("保存属性列表失败:", e), C.error("保存失败"), e;
|
|
145
145
|
} finally {
|
|
@@ -209,7 +209,9 @@ const de = ie((o, s) => {
|
|
|
209
209
|
}];
|
|
210
210
|
return /* @__PURE__ */ u("div", {
|
|
211
211
|
className: "attribute-detail",
|
|
212
|
-
children: [/* @__PURE__ */ i("div", {
|
|
212
|
+
children: [m && /* @__PURE__ */ i("div", {
|
|
213
|
+
children: "加载中..."
|
|
214
|
+
}), /* @__PURE__ */ i("div", {
|
|
213
215
|
className: "use-tips",
|
|
214
216
|
children: /* @__PURE__ */ i("div", {
|
|
215
217
|
children: "使用须知:用户需清楚能从图纸中提取出所有类型的信息,图片中的标注信息(如“零件名称”、“规格型号”),属性定义对应全局"
|
|
@@ -327,8 +329,8 @@ const de = ie((o, s) => {
|
|
|
327
329
|
children: /* @__PURE__ */ i(T, {
|
|
328
330
|
children: /* @__PURE__ */ i(v, {
|
|
329
331
|
type: "primary",
|
|
330
|
-
loading:
|
|
331
|
-
disabled:
|
|
332
|
+
loading: m,
|
|
333
|
+
disabled: m,
|
|
332
334
|
onClick: L,
|
|
333
335
|
children: "保存"
|
|
334
336
|
})
|