@glodon-aiot/dataset-annotation 3.2.2-beta.4 → 3.2.10-beta.10
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/PicZipImportModal/index.mjs +163 -163
- package/dist/es/index.mjs +1 -1
- package/dist/lib/index.js +2 -129
- package/package.json +5 -4
- package/dist/es/_virtual/_commonjsHelpers.mjs +0 -4
- package/dist/es/_virtual/minio.mjs +0 -4
- package/dist/es/node_modules/@glodon-aiot/minio/dist/minio.mjs +0 -28463
|
@@ -1,189 +1,189 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
1
|
+
var ol = Object.defineProperty;
|
|
2
|
+
var Be = Object.getOwnPropertySymbols;
|
|
3
|
+
var rl = Object.prototype.hasOwnProperty, cl = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var Le = (y, l, i) => l in y ? ol(y, l, { enumerable: !0, configurable: !0, writable: !0, value: i }) : y[l] = i, Ae = (y, l) => {
|
|
5
5
|
for (var i in l || (l = {}))
|
|
6
|
-
|
|
7
|
-
if (
|
|
8
|
-
for (var i of
|
|
9
|
-
|
|
6
|
+
rl.call(l, i) && Le(y, i, l[i]);
|
|
7
|
+
if (Be)
|
|
8
|
+
for (var i of Be(l))
|
|
9
|
+
cl.call(l, i) && Le(y, i, l[i]);
|
|
10
10
|
return y;
|
|
11
11
|
};
|
|
12
|
-
var
|
|
12
|
+
var re = (y, l, i) => new Promise((f, M) => {
|
|
13
13
|
var D = (w) => {
|
|
14
14
|
try {
|
|
15
15
|
F(i.next(w));
|
|
16
16
|
} catch (z) {
|
|
17
|
-
|
|
17
|
+
M(z);
|
|
18
18
|
}
|
|
19
19
|
}, Z = (w) => {
|
|
20
20
|
try {
|
|
21
21
|
F(i.throw(w));
|
|
22
22
|
} catch (z) {
|
|
23
|
-
|
|
23
|
+
M(z);
|
|
24
24
|
}
|
|
25
25
|
}, F = (w) => w.done ? f(w.value) : Promise.resolve(w.value).then(D, Z);
|
|
26
26
|
F((i = i.apply(y, l)).next());
|
|
27
27
|
});
|
|
28
|
-
import { jsxs as p, Fragment as
|
|
29
|
-
import { useContext as
|
|
30
|
-
import { Form as U, message as
|
|
28
|
+
import { jsxs as p, Fragment as ce, jsx as e } from "react/jsx-runtime";
|
|
29
|
+
import { useContext as dl, useState as r, useRef as pl, useEffect as A } from "react";
|
|
30
|
+
import { Form as U, message as R, Modal as H, Button as O, Radio as x, Space as Ue, Upload as ul, Row as de, Col as ml, Spin as fl, Result as Oe } from "antd";
|
|
31
31
|
import "./style.less.mjs";
|
|
32
|
-
import { CloudUploadOutlined as
|
|
33
|
-
import
|
|
34
|
-
import {
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import { GB as
|
|
39
|
-
import { fileSuffixToLowerCase as
|
|
40
|
-
import
|
|
41
|
-
import { EXAMPLE_SRC_ROOT as
|
|
32
|
+
import { CloudUploadOutlined as hl, PaperClipOutlined as gl, DeleteOutlined as Cl, PlusOutlined as bl } from "@ant-design/icons";
|
|
33
|
+
import yl from "browser-md5-file";
|
|
34
|
+
import { initMinio as Te, putObjectBuffer as Pe } from "@glodon-aiot/minio";
|
|
35
|
+
import Nl from "antd/lib/upload/Dragger";
|
|
36
|
+
import Sl from "./pic_zip.svg.mjs";
|
|
37
|
+
import wl from "./pic_zip_json.svg.mjs";
|
|
38
|
+
import { GB as zl, MB as jl } from "../../constant.mjs";
|
|
39
|
+
import { fileSuffixToLowerCase as kl } from "../../utils/index.mjs";
|
|
40
|
+
import vl from "../../DatasetContext/index.mjs";
|
|
41
|
+
import { EXAMPLE_SRC_ROOT as El } from "../../featuresConfig.mjs";
|
|
42
42
|
let m = 0, G = 0, T = 0, _ = 0;
|
|
43
|
-
const
|
|
43
|
+
const Wl = (y) => {
|
|
44
44
|
const {
|
|
45
45
|
datasetIam: l,
|
|
46
46
|
datasetId: i,
|
|
47
47
|
currentVersion: f,
|
|
48
|
-
tenCode:
|
|
48
|
+
tenCode: M,
|
|
49
49
|
isVisible: D,
|
|
50
50
|
markType: Z,
|
|
51
51
|
setIsVisible: F,
|
|
52
52
|
getVersionListRequest: w,
|
|
53
53
|
onUploadStatusChange: z,
|
|
54
|
-
setIsConfirm:
|
|
55
|
-
tableReload:
|
|
54
|
+
setIsConfirm: I,
|
|
55
|
+
tableReload: pe,
|
|
56
56
|
loadVersionData: q,
|
|
57
|
-
actionAfterFinish:
|
|
57
|
+
actionAfterFinish: ue
|
|
58
58
|
} = y, {
|
|
59
59
|
services: {
|
|
60
60
|
cvforceDatahub: u
|
|
61
61
|
},
|
|
62
62
|
featuresConfig: {
|
|
63
|
-
exampleSrcRoot:
|
|
63
|
+
exampleSrcRoot: me
|
|
64
64
|
} = {
|
|
65
|
-
exampleSrcRoot:
|
|
65
|
+
exampleSrcRoot: El
|
|
66
66
|
}
|
|
67
|
-
} =
|
|
67
|
+
} = dl(vl), [N, Ve] = r(0), [S, Me] = r(0), [Q, De] = r([]), [P, Ke] = r(), [fe, Rl] = r([]), [Y, J] = r(!1), [he, ee] = r(!1), [K, le] = r(!1), [te, Ge] = r(0), [ge, _e] = r(0), [W, Ce] = r(-1), [se, xl] = r([]), [be, Fl] = r([]), [ye, ie] = r(!1), Ze = new yl(), [X] = U.useForm(), n = U.useWatch("acceptType", X), v = U.useWatch("labelState", X), [h, Ne] = r([]), [k, Se] = r([]), [E, qe] = r(), [we, ze] = r(0), [je, ke] = r(!1), [$l, Je] = r(""), [We, ve] = r(!1), [Ee, Xe] = r(
|
|
68
68
|
"unlabeled"
|
|
69
69
|
/* Unlabeled */
|
|
70
|
-
),
|
|
70
|
+
), ne = pl(!0), ae = ["image/jpeg", "image/jpg", "image/png", "image/bmp"], oe = 14 * jl;
|
|
71
71
|
A(() => {
|
|
72
|
-
m = 0, G = 0, T = 0, _ = 0,
|
|
72
|
+
m = 0, G = 0, T = 0, _ = 0, le(!1), D && (ne.current = !1, q && q());
|
|
73
73
|
}, [D]);
|
|
74
74
|
const Re = (t, s) => {
|
|
75
75
|
var a;
|
|
76
76
|
if (n === "image") {
|
|
77
|
-
|
|
77
|
+
ie(!0);
|
|
78
78
|
let o = 0;
|
|
79
79
|
if (m = m + 1, G = G + 1, s.length === 0)
|
|
80
80
|
return;
|
|
81
81
|
let d = 0;
|
|
82
82
|
const [...c] = s, C = window.URL || window.webkitURL, b = new Image();
|
|
83
83
|
b.src = C.createObjectURL(t), b.onload = () => {
|
|
84
|
-
|
|
84
|
+
Q.push({
|
|
85
85
|
name: t.name,
|
|
86
86
|
src: b.src,
|
|
87
87
|
width: b.width,
|
|
88
88
|
height: b.height
|
|
89
|
-
}),
|
|
89
|
+
}), De(Q);
|
|
90
90
|
}, s.map((j) => {
|
|
91
|
-
const $ =
|
|
91
|
+
const $ = ae.some((L) => L === j.type), B = j.size <= oe;
|
|
92
92
|
$ ? B || (o = o + 1, c.splice(c.findIndex((L) => L.name === j.name), 1)) : (d = d + 1, c.splice(c.findIndex((L) => L.name === j.name), 1));
|
|
93
|
-
}), c.length > 100 && c.splice(100, c.length),
|
|
94
|
-
const g =
|
|
93
|
+
}), c.length > 100 && c.splice(100, c.length), Ve(d), Me(o), G === s.length && (ie(!0), G = 0);
|
|
94
|
+
const g = ae.some((j) => j === t.type), V = t.size <= oe;
|
|
95
95
|
if (g) {
|
|
96
|
-
if (!
|
|
96
|
+
if (!V)
|
|
97
97
|
return !1;
|
|
98
98
|
} else
|
|
99
99
|
return !1;
|
|
100
100
|
} else {
|
|
101
|
-
if (t.size > 2 *
|
|
102
|
-
return
|
|
101
|
+
if (t.size > 2 * zl)
|
|
102
|
+
return R.error(`${t.name}文件总大小不能超过2G`), !1;
|
|
103
103
|
const o = (a = t.name) == null ? void 0 : a.substring(t.name.lastIndexOf("."));
|
|
104
104
|
if (n === "zip" && o !== ".zip")
|
|
105
|
-
return
|
|
106
|
-
|
|
105
|
+
return R.error("存在格式不正确的文件,已自动去除"), !1;
|
|
106
|
+
Se((d) => d.length >= 1 ? d : [...d, t]);
|
|
107
107
|
}
|
|
108
108
|
return !1;
|
|
109
109
|
};
|
|
110
110
|
A(() => {
|
|
111
|
-
|
|
112
|
-
}, [
|
|
113
|
-
const
|
|
111
|
+
ye !== !1 && (!N && !S && !m || (m = m - _ - N - S, m < 101 ? N > 0 && S > 0 ? (R.error(`${N + S}个文件添加失败,格式、大小或数量不符合要求`), m = m - N - S) : N > 0 && S === 0 ? R.error(`${N}个文件添加失败,格式不符合要求`) : N === 0 && S > 0 ? R.error(`${S}个文件添加失败,单张图片超过14M`) : N === 0 && S === 0 && R.success("校验成功") : N + S === 0 ? (R.error(`${m - 100}个文件添加失败,超过数量限制`), m = 100) : (R.error(`${m - 100 + N + S}个文件添加失败,格式、大小或数量不符合要求`), m = m < 101 ? m : 100), ie(!1)));
|
|
112
|
+
}, [ye]);
|
|
113
|
+
const He = (t) => {
|
|
114
114
|
const s = t.originFileObj;
|
|
115
115
|
return new Promise((a, o) => {
|
|
116
|
-
|
|
117
|
-
d && o(d),
|
|
116
|
+
Ze.md5(s, (d, c) => {
|
|
117
|
+
d && o(d), Qe(c, s), a(c);
|
|
118
118
|
});
|
|
119
119
|
});
|
|
120
|
-
},
|
|
120
|
+
}, Ie = () => re(void 0, null, function* () {
|
|
121
121
|
if (!h)
|
|
122
122
|
return;
|
|
123
123
|
const t = [];
|
|
124
124
|
for (let s = 0; s < h.length; s++) {
|
|
125
|
-
const a = h[s], o = yield
|
|
125
|
+
const a = h[s], o = yield He(a);
|
|
126
126
|
t.push(o);
|
|
127
127
|
}
|
|
128
128
|
!i || t.length === 0 || u == null || u.getDeduplication(t, i).then((s) => {
|
|
129
|
-
|
|
129
|
+
Ke(s), ve(!1);
|
|
130
130
|
});
|
|
131
131
|
});
|
|
132
132
|
A(() => {
|
|
133
|
-
|
|
133
|
+
Ie();
|
|
134
134
|
}, [h]);
|
|
135
|
-
const
|
|
136
|
-
s.md5 = t,
|
|
137
|
-
},
|
|
135
|
+
const Qe = (t, s) => {
|
|
136
|
+
s.md5 = t, fe.push(s);
|
|
137
|
+
}, xe = ({
|
|
138
138
|
fileList: t
|
|
139
139
|
}) => {
|
|
140
140
|
if (n === "zip")
|
|
141
141
|
return;
|
|
142
142
|
ve(!0);
|
|
143
|
-
const s = t.filter((a) => a.size && a.size <=
|
|
144
|
-
s.splice(100, s.length), s.length < h.length ? (
|
|
145
|
-
},
|
|
146
|
-
n === "zip" && (
|
|
147
|
-
},
|
|
143
|
+
const s = t.filter((a) => a.size && a.size <= oe ? ae.some((o) => a.type === o) : !1);
|
|
144
|
+
s.splice(100, s.length), s.length < h.length ? (Ne(s), _++) : (T = T - _, _ = 0, T++, T == s.length && Ne(s), T > s.length && (T = s.length));
|
|
145
|
+
}, Fe = () => {
|
|
146
|
+
n === "zip" && (ne.current = !0), F(!1);
|
|
147
|
+
}, Ye = () => {
|
|
148
148
|
if (n === "image") {
|
|
149
|
-
if (!
|
|
149
|
+
if (!P)
|
|
150
150
|
return;
|
|
151
151
|
let t = 0, s = 0;
|
|
152
|
-
if (
|
|
152
|
+
if (P.duplicated.length !== 0 && P.duplicated.map((a, o) => {
|
|
153
153
|
var C;
|
|
154
|
-
const d =
|
|
154
|
+
const d = P.duplicatedMd5[o], c = ((C = h.find((b) => {
|
|
155
155
|
var g;
|
|
156
156
|
return ((g = b.originFileObj) == null ? void 0 : g.md5) === d;
|
|
157
157
|
})) == null ? void 0 : C.name) || "";
|
|
158
|
-
|
|
158
|
+
se.push({
|
|
159
159
|
labels: [],
|
|
160
160
|
fileKey: a,
|
|
161
161
|
sampleFileName: {
|
|
162
162
|
name: c
|
|
163
163
|
}
|
|
164
164
|
});
|
|
165
|
-
}),
|
|
166
|
-
const a =
|
|
167
|
-
const c =
|
|
165
|
+
}), P.unduplicated.length !== 0) {
|
|
166
|
+
const a = P.unduplicated.map((o) => new Promise((d) => {
|
|
167
|
+
const c = fe.find((B) => B.md5 === o);
|
|
168
168
|
if (!c)
|
|
169
169
|
return d();
|
|
170
|
-
const C = c.name, b = C.substring(C.indexOf(".")), g =
|
|
170
|
+
const C = c.name, b = C.substring(C.indexOf(".")), g = Q.find((B) => B.name === C), V = {
|
|
171
171
|
"Content-Type": "application/octet-stream",
|
|
172
172
|
"X-Amz-Meta-Width": g == null ? void 0 : g.width,
|
|
173
173
|
"X-Amz-Meta-Height": g == null ? void 0 : g.height
|
|
174
|
-
}, j = `dataset/${i}/sample/${o}${
|
|
174
|
+
}, j = `dataset/${i}/sample/${o}${kl(b)}`;
|
|
175
175
|
delete c.md5;
|
|
176
176
|
const $ = new FileReader();
|
|
177
177
|
$.readAsArrayBuffer(c), $.onload = (B) => {
|
|
178
|
-
|
|
178
|
+
Te({
|
|
179
179
|
endPoint: l == null ? void 0 : l.endpoints[0],
|
|
180
180
|
useSSL: l == null ? void 0 : l.useSSL,
|
|
181
181
|
accessKey: l == null ? void 0 : l.accessKey,
|
|
182
182
|
secretKey: l == null ? void 0 : l.secretKey
|
|
183
|
-
}),
|
|
184
|
-
J(!0), s += 1, L && (t += 1,
|
|
183
|
+
}), Pe(M, j, B.target.result, V, (L, Bl) => {
|
|
184
|
+
J(!0), s += 1, L && (t += 1, _e(t)), Ge(s), be.push({
|
|
185
185
|
labels: [],
|
|
186
|
-
fileKey: `${
|
|
186
|
+
fileKey: `${M}/${j}`,
|
|
187
187
|
sampleFileName: {
|
|
188
188
|
name: C
|
|
189
189
|
}
|
|
@@ -194,11 +194,11 @@ const Jl = (y) => {
|
|
|
194
194
|
Promise.all(a).then(() => {
|
|
195
195
|
!i || !f || setTimeout(() => {
|
|
196
196
|
u == null || u.postDatasetsIdVersionsVidSamples(i, f.id, {
|
|
197
|
-
samples:
|
|
197
|
+
samples: be.concat(se)
|
|
198
198
|
}).then(() => {
|
|
199
199
|
u.getDatasetsIdVersionsVid(i, f.id).then((o) => {
|
|
200
|
-
|
|
201
|
-
}),
|
|
200
|
+
Ce(o.samplesCount - f.samplesCount);
|
|
201
|
+
}), I(!0), z && z(!1);
|
|
202
202
|
});
|
|
203
203
|
}, 100);
|
|
204
204
|
});
|
|
@@ -206,16 +206,16 @@ const Jl = (y) => {
|
|
|
206
206
|
if (!i || !f)
|
|
207
207
|
return;
|
|
208
208
|
u == null || u.postDatasetsIdVersionsVidSamples(i, f.id, {
|
|
209
|
-
samples:
|
|
209
|
+
samples: se
|
|
210
210
|
}).then(() => {
|
|
211
211
|
u.getDatasetsIdVersionsVid(i, f.id).then((a) => {
|
|
212
|
-
|
|
213
|
-
}),
|
|
212
|
+
Ce(a.samplesCount - f.samplesCount);
|
|
213
|
+
}), I(!0), z && z(!1);
|
|
214
214
|
});
|
|
215
215
|
}
|
|
216
216
|
} else
|
|
217
|
-
|
|
218
|
-
},
|
|
217
|
+
el(k);
|
|
218
|
+
}, el = (t) => {
|
|
219
219
|
!i || !f || t.map((s, a) => {
|
|
220
220
|
var b;
|
|
221
221
|
const o = {
|
|
@@ -227,33 +227,33 @@ const Jl = (y) => {
|
|
|
227
227
|
secretKey: l == null ? void 0 : l.secretKey
|
|
228
228
|
}, c = (l == null ? void 0 : l.prefix) + ((b = t[0]) == null ? void 0 : b.name), C = new FileReader();
|
|
229
229
|
C.readAsArrayBuffer(s), C.onload = (g) => {
|
|
230
|
-
|
|
231
|
-
if (
|
|
232
|
-
console.log(
|
|
230
|
+
Te(d), Pe(l == null ? void 0 : l.bucket, c, g.target.result, o, (V, j) => {
|
|
231
|
+
if (V)
|
|
232
|
+
console.log(V);
|
|
233
233
|
else {
|
|
234
|
-
if (
|
|
234
|
+
if (ne.current)
|
|
235
235
|
return;
|
|
236
|
-
J(!0), u == null || u.postUploadPicsZip(i, f.id,
|
|
236
|
+
J(!0), u == null || u.postUploadPicsZip(i, f.id, Ae({
|
|
237
237
|
zipUrls: [(l == null ? void 0 : l.bucket) + "/" + c]
|
|
238
238
|
}, Z === "ocr" && {
|
|
239
|
-
type:
|
|
239
|
+
type: v === "labeled" ? 1 : 0
|
|
240
240
|
})).then(($) => {
|
|
241
|
-
|
|
241
|
+
ll($), Je($);
|
|
242
242
|
});
|
|
243
243
|
}
|
|
244
244
|
});
|
|
245
245
|
};
|
|
246
246
|
});
|
|
247
|
-
},
|
|
247
|
+
}, ll = (t) => re(void 0, null, function* () {
|
|
248
248
|
var s;
|
|
249
249
|
if (!(!i || !f || !u))
|
|
250
250
|
try {
|
|
251
251
|
const a = yield u.checkFileResult(i, f.id, {
|
|
252
252
|
taskId: t
|
|
253
253
|
}, 5e3, (o) => {
|
|
254
|
-
|
|
254
|
+
ze(o);
|
|
255
255
|
});
|
|
256
|
-
a &&
|
|
256
|
+
a && qe(JSON.parse(a));
|
|
257
257
|
} catch (a) {
|
|
258
258
|
if (((s = a.cause) == null ? void 0 : s.code) === -101) {
|
|
259
259
|
ke(!0);
|
|
@@ -262,58 +262,58 @@ const Jl = (y) => {
|
|
|
262
262
|
}
|
|
263
263
|
});
|
|
264
264
|
A(() => {
|
|
265
|
-
|
|
266
|
-
}, [
|
|
267
|
-
|
|
268
|
-
}, [
|
|
269
|
-
W !== -1 && (
|
|
265
|
+
E && (ze(100), ee(!0));
|
|
266
|
+
}, [E]), A(() => {
|
|
267
|
+
te !== 0 && (I(!1), z && z(!0));
|
|
268
|
+
}, [te]), A(() => {
|
|
269
|
+
W !== -1 && (ee(!0), le(!1));
|
|
270
270
|
}, [W]);
|
|
271
|
-
const
|
|
272
|
-
|
|
273
|
-
},
|
|
274
|
-
w(), J(!1), F(!1),
|
|
275
|
-
},
|
|
276
|
-
children: [/* @__PURE__ */ e(
|
|
271
|
+
const tl = () => {
|
|
272
|
+
$e(), ee(!1), ue && ue();
|
|
273
|
+
}, $e = () => {
|
|
274
|
+
w(), J(!1), F(!1), pe && pe(), q && q();
|
|
275
|
+
}, sl = /* @__PURE__ */ p("div", {
|
|
276
|
+
children: [/* @__PURE__ */ e(bl, {}), /* @__PURE__ */ e("div", {
|
|
277
277
|
style: {
|
|
278
278
|
marginTop: 8
|
|
279
279
|
},
|
|
280
280
|
children: "添加图片"
|
|
281
281
|
})]
|
|
282
|
-
}),
|
|
283
|
-
const s =
|
|
284
|
-
|
|
285
|
-
}, il = () => {
|
|
286
|
-
k === "labeled" ? window.location.href = `${fe}/%E6%A0%87%E6%B3%A8%E6%A0%BC%E5%BC%8F%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`;
|
|
282
|
+
}), il = (t) => {
|
|
283
|
+
const s = k.filter((a) => a.uid !== t.uid);
|
|
284
|
+
Se(s);
|
|
287
285
|
}, nl = () => {
|
|
286
|
+
v === "labeled" ? window.location.href = `${me}/%E6%A0%87%E6%B3%A8%E6%A0%BC%E5%BC%8F%E7%A4%BA%E4%BE%8B.zip` : window.location.href = `${me}/%E7%A4%BA%E4%BE%8B%E5%8E%8B%E7%BC%A9%E5%8C%85.zip`;
|
|
287
|
+
}, al = () => {
|
|
288
288
|
w(), ke(!1), J(!1), F(!1);
|
|
289
289
|
};
|
|
290
290
|
return A(() => {
|
|
291
|
-
|
|
291
|
+
Ee === "labeled" && X.setFieldsValue({
|
|
292
292
|
labelFormat: "json",
|
|
293
293
|
acceptType: "zip"
|
|
294
294
|
/* Zip */
|
|
295
295
|
});
|
|
296
|
-
}, [
|
|
296
|
+
}, [Ee]), /* @__PURE__ */ p(ce, {
|
|
297
297
|
children: [/* @__PURE__ */ e(H, {
|
|
298
298
|
className: "upload-pics",
|
|
299
299
|
width: 600,
|
|
300
300
|
title: "导入数据",
|
|
301
301
|
open: D,
|
|
302
302
|
destroyOnClose: !0,
|
|
303
|
-
onCancel: () =>
|
|
303
|
+
onCancel: () => Fe(),
|
|
304
304
|
maskClosable: !1,
|
|
305
305
|
centered: !0,
|
|
306
306
|
footer: [/* @__PURE__ */ e(O, {
|
|
307
|
-
onClick:
|
|
307
|
+
onClick: Fe,
|
|
308
308
|
children: "取消"
|
|
309
309
|
}, "cancel"), /* @__PURE__ */ e(O, {
|
|
310
310
|
type: "primary",
|
|
311
311
|
htmlType: "submit",
|
|
312
312
|
form: "importModal",
|
|
313
|
-
disabled: n === "image" && !h.length || n === "zip" && !
|
|
313
|
+
disabled: n === "image" && !h.length || n === "zip" && !k.length || Y && we == 0 || We,
|
|
314
314
|
loading: K == !0,
|
|
315
315
|
onClick: () => {
|
|
316
|
-
|
|
316
|
+
Ye(), le(!0);
|
|
317
317
|
},
|
|
318
318
|
children: "导入"
|
|
319
319
|
}, "confirm")],
|
|
@@ -340,29 +340,29 @@ const Jl = (y) => {
|
|
|
340
340
|
required: !0,
|
|
341
341
|
message: "请选择数据标注状态"
|
|
342
342
|
}],
|
|
343
|
-
children: /* @__PURE__ */ p(
|
|
343
|
+
children: /* @__PURE__ */ p(x.Group, {
|
|
344
344
|
disabled: K,
|
|
345
345
|
onChange: (t) => {
|
|
346
|
-
|
|
346
|
+
Xe(t.target.value);
|
|
347
347
|
},
|
|
348
|
-
children: [/* @__PURE__ */ e(
|
|
348
|
+
children: [/* @__PURE__ */ e(x, {
|
|
349
349
|
value: "unlabeled",
|
|
350
350
|
children: "无标注信息"
|
|
351
|
-
}), /* @__PURE__ */ e(
|
|
351
|
+
}), /* @__PURE__ */ e(x, {
|
|
352
352
|
value: "labeled",
|
|
353
353
|
children: "有标注信息"
|
|
354
354
|
})]
|
|
355
355
|
})
|
|
356
|
-
}),
|
|
356
|
+
}), v === "labeled" && /* @__PURE__ */ e(U.Item, {
|
|
357
357
|
label: "标注格式",
|
|
358
358
|
name: "labelFormat",
|
|
359
359
|
rules: [{
|
|
360
360
|
required: !0,
|
|
361
361
|
message: "请选择标注格式"
|
|
362
362
|
}],
|
|
363
|
-
children: /* @__PURE__ */ e(
|
|
363
|
+
children: /* @__PURE__ */ e(x.Group, {
|
|
364
364
|
disabled: K,
|
|
365
|
-
children: /* @__PURE__ */ e(
|
|
365
|
+
children: /* @__PURE__ */ e(x, {
|
|
366
366
|
value: "json",
|
|
367
367
|
children: "json"
|
|
368
368
|
})
|
|
@@ -374,38 +374,38 @@ const Jl = (y) => {
|
|
|
374
374
|
required: !0,
|
|
375
375
|
message: "请选择导入方式"
|
|
376
376
|
}],
|
|
377
|
-
children: /* @__PURE__ */ p(
|
|
377
|
+
children: /* @__PURE__ */ p(x.Group, {
|
|
378
378
|
disabled: K,
|
|
379
|
-
children: [
|
|
379
|
+
children: [v !== "labeled" && /* @__PURE__ */ e(x.Button, {
|
|
380
380
|
value: "image",
|
|
381
381
|
children: "上传图片"
|
|
382
|
-
}), /* @__PURE__ */ e(
|
|
382
|
+
}), /* @__PURE__ */ e(x.Button, {
|
|
383
383
|
value: "zip",
|
|
384
384
|
children: "上传压缩包"
|
|
385
385
|
})]
|
|
386
386
|
})
|
|
387
387
|
}), /* @__PURE__ */ p("div", {
|
|
388
388
|
className: "file-upload",
|
|
389
|
-
children: [(n === "image" && !h.length || n === "zip") && /* @__PURE__ */ p(
|
|
389
|
+
children: [(n === "image" && !h.length || n === "zip") && /* @__PURE__ */ p(Nl, {
|
|
390
390
|
name: "file",
|
|
391
391
|
showUploadList: !1,
|
|
392
392
|
multiple: !0,
|
|
393
393
|
beforeUpload: Re,
|
|
394
394
|
accept: n === "zip" ? ".zip" : "image/png, image/jpeg, image/jpg, image/bmp",
|
|
395
395
|
maxCount: n === "zip" ? 1 : void 0,
|
|
396
|
-
onChange:
|
|
397
|
-
disabled: n === "zip" ?
|
|
396
|
+
onChange: xe,
|
|
397
|
+
disabled: n === "zip" ? k.length === 1 : !1,
|
|
398
398
|
children: [/* @__PURE__ */ e("span", {
|
|
399
399
|
className: "file-upload-icon",
|
|
400
|
-
children: /* @__PURE__ */ e(
|
|
401
|
-
}), /* @__PURE__ */ p(
|
|
400
|
+
children: /* @__PURE__ */ e(hl, {})
|
|
401
|
+
}), /* @__PURE__ */ p(Ue, {
|
|
402
402
|
className: "file-upload-action",
|
|
403
403
|
children: [n === "image" && "拖拽图片至此,或者", n === "zip" && "拖拽包含“图片”的压缩包至此,或者", /* @__PURE__ */ e(O, {
|
|
404
404
|
type: "link",
|
|
405
405
|
style: {
|
|
406
406
|
padding: 0
|
|
407
407
|
},
|
|
408
|
-
disabled: n === "zip" ?
|
|
408
|
+
disabled: n === "zip" ? k.length === 1 : !1,
|
|
409
409
|
children: n === "image" ? "上传图片" : "上传压缩包"
|
|
410
410
|
})]
|
|
411
411
|
}), n === "image" && /* @__PURE__ */ p("div", {
|
|
@@ -428,7 +428,7 @@ const Jl = (y) => {
|
|
|
428
428
|
children: [/* @__PURE__ */ e("div", {
|
|
429
429
|
className: "item-upload-desc item-upload-desc__1",
|
|
430
430
|
children: "1. 仅支持.zip格式,单个压缩包不超过2G;"
|
|
431
|
-
}),
|
|
431
|
+
}), v === "labeled" ? /* @__PURE__ */ p(ce, {
|
|
432
432
|
children: [/* @__PURE__ */ e("div", {
|
|
433
433
|
className: "item-upload-desc",
|
|
434
434
|
children: "2. 压缩包内每张图片(jpg、png 、jpeg 、bmp格式)需要对应一个json文件,名称需一致,位置处在一级目录下;"
|
|
@@ -441,12 +441,12 @@ const Jl = (y) => {
|
|
|
441
441
|
children: "2. 压缩包内图片格式要求为:图片类型为jpg/png/bmp/jpeg,单张图片不超过14M;"
|
|
442
442
|
}), /* @__PURE__ */ p("div", {
|
|
443
443
|
className: "item-upload-desc",
|
|
444
|
-
children: [
|
|
444
|
+
children: [v === "labeled" ? 4 : 3, ". 单次仅可上传1个文件。"]
|
|
445
445
|
})]
|
|
446
446
|
})]
|
|
447
447
|
}), n === "image" && h.length ? /* @__PURE__ */ e("div", {
|
|
448
448
|
className: "picture-upload",
|
|
449
|
-
children: /* @__PURE__ */ e(
|
|
449
|
+
children: /* @__PURE__ */ e(ul, {
|
|
450
450
|
listType: "picture-card",
|
|
451
451
|
fileList: h,
|
|
452
452
|
multiple: !0,
|
|
@@ -455,27 +455,27 @@ const Jl = (y) => {
|
|
|
455
455
|
},
|
|
456
456
|
beforeUpload: Re,
|
|
457
457
|
accept: "image/png, image/jpeg, image/jpg, image/bmp",
|
|
458
|
-
onChange:
|
|
459
|
-
children: h.length < 100 ?
|
|
458
|
+
onChange: xe,
|
|
459
|
+
children: h.length < 100 ? sl : null
|
|
460
460
|
})
|
|
461
|
-
}) : /* @__PURE__ */ e(
|
|
461
|
+
}) : /* @__PURE__ */ e(ce, {}), n === "zip" && /* @__PURE__ */ p("div", {
|
|
462
462
|
className: "upload-wrapper",
|
|
463
|
-
children: [
|
|
463
|
+
children: [k != null && k.length ? /* @__PURE__ */ e("div", {
|
|
464
464
|
className: "upload-main",
|
|
465
|
-
children: /* @__PURE__ */ e(
|
|
465
|
+
children: /* @__PURE__ */ e(de, {
|
|
466
466
|
gutter: [24, 8],
|
|
467
467
|
className: "upload-pannel",
|
|
468
|
-
children:
|
|
468
|
+
children: k.map((t) => /* @__PURE__ */ e(ml, {
|
|
469
469
|
span: 24,
|
|
470
470
|
className: "upload-item",
|
|
471
|
-
children: /* @__PURE__ */ p(
|
|
471
|
+
children: /* @__PURE__ */ p(de, {
|
|
472
472
|
justify: "space-between",
|
|
473
473
|
align: "middle",
|
|
474
|
-
children: [/* @__PURE__ */ p(
|
|
474
|
+
children: [/* @__PURE__ */ p(de, {
|
|
475
475
|
align: "middle",
|
|
476
476
|
children: [/* @__PURE__ */ e("span", {
|
|
477
477
|
className: "upload-item-file-icon",
|
|
478
|
-
children: /* @__PURE__ */ e(
|
|
478
|
+
children: /* @__PURE__ */ e(gl, {})
|
|
479
479
|
}), /* @__PURE__ */ e("span", {
|
|
480
480
|
className: "upload-item-name",
|
|
481
481
|
children: t.name
|
|
@@ -484,8 +484,8 @@ const Jl = (y) => {
|
|
|
484
484
|
className: "upload-item-upload-delete",
|
|
485
485
|
type: "link",
|
|
486
486
|
disabled: K,
|
|
487
|
-
onClick: () =>
|
|
488
|
-
children: /* @__PURE__ */ e(
|
|
487
|
+
onClick: () => il(t),
|
|
488
|
+
children: /* @__PURE__ */ e(Cl, {})
|
|
489
489
|
})]
|
|
490
490
|
})
|
|
491
491
|
}, t.uid))
|
|
@@ -494,7 +494,7 @@ const Jl = (y) => {
|
|
|
494
494
|
className: "upload-example",
|
|
495
495
|
children: [/* @__PURE__ */ e("div", {
|
|
496
496
|
className: "upload-example-header",
|
|
497
|
-
children: /* @__PURE__ */ p(
|
|
497
|
+
children: /* @__PURE__ */ p(Ue, {
|
|
498
498
|
children: [/* @__PURE__ */ e("span", {
|
|
499
499
|
children: "数据示例:"
|
|
500
500
|
}), /* @__PURE__ */ e(O, {
|
|
@@ -504,7 +504,7 @@ const Jl = (y) => {
|
|
|
504
504
|
padding: 0
|
|
505
505
|
},
|
|
506
506
|
onClick: (t) => {
|
|
507
|
-
t.stopPropagation(),
|
|
507
|
+
t.stopPropagation(), nl();
|
|
508
508
|
},
|
|
509
509
|
children: "下载示例 >"
|
|
510
510
|
})]
|
|
@@ -512,66 +512,66 @@ const Jl = (y) => {
|
|
|
512
512
|
}), /* @__PURE__ */ e("div", {
|
|
513
513
|
className: "upload-example-main",
|
|
514
514
|
children: /* @__PURE__ */ e("img", {
|
|
515
|
-
src:
|
|
515
|
+
src: v === "labeled" ? wl : Sl
|
|
516
516
|
})
|
|
517
517
|
})]
|
|
518
518
|
})]
|
|
519
519
|
})]
|
|
520
520
|
})]
|
|
521
521
|
})
|
|
522
|
-
}),
|
|
522
|
+
}), Y && /* @__PURE__ */ e(H, {
|
|
523
523
|
className: "uploading-modal",
|
|
524
524
|
width: 404,
|
|
525
525
|
title: null,
|
|
526
|
-
open:
|
|
526
|
+
open: Y,
|
|
527
527
|
maskClosable: !1,
|
|
528
528
|
closable: n !== "image",
|
|
529
529
|
onCancel: () => {
|
|
530
|
-
|
|
530
|
+
$e();
|
|
531
531
|
},
|
|
532
532
|
footer: null,
|
|
533
533
|
children: /* @__PURE__ */ e("div", {
|
|
534
534
|
className: "upload-spin",
|
|
535
|
-
children: /* @__PURE__ */ e(
|
|
536
|
-
tip: n === "image" ? `数据导入中(${
|
|
535
|
+
children: /* @__PURE__ */ e(fl, {
|
|
536
|
+
tip: n === "image" ? `数据导入中(${te}/${h.length}),请耐心等待` : `处理中(${we}/100%),请耐心等待`,
|
|
537
537
|
size: "large",
|
|
538
538
|
children: /* @__PURE__ */ e("div", {
|
|
539
539
|
className: "content"
|
|
540
540
|
})
|
|
541
541
|
})
|
|
542
542
|
})
|
|
543
|
-
}),
|
|
543
|
+
}), he && /* @__PURE__ */ e(H, {
|
|
544
544
|
className: "result",
|
|
545
545
|
width: 424,
|
|
546
546
|
title: null,
|
|
547
|
-
open:
|
|
547
|
+
open: he,
|
|
548
548
|
closable: !1,
|
|
549
549
|
footer: null,
|
|
550
550
|
children: /* @__PURE__ */ e("div", {
|
|
551
551
|
className: "upload-result",
|
|
552
|
-
children: /* @__PURE__ */ e(
|
|
552
|
+
children: /* @__PURE__ */ e(Oe, {
|
|
553
553
|
status: "success",
|
|
554
|
-
title: n === "image" ? `数据导入完成,成功${W}个,失败${
|
|
554
|
+
title: n === "image" ? `数据导入完成,成功${W}个,失败${ge}个,去重${h.length - W - ge}个` : E && `数据导入完成,格式不符合的图片${E.formatErrorCount || 0}个,成功${E.successCount || 0}个,去重${E.repeatCount || 0}个,失败${E.failedCount || 0}个` + (v === "labeled" ? `(Json格式不符合${E.labelErrorCount}个)` : ""),
|
|
555
555
|
extra: [/* @__PURE__ */ e(O, {
|
|
556
|
-
onClick:
|
|
556
|
+
onClick: tl,
|
|
557
557
|
children: "关闭"
|
|
558
558
|
}, "close")]
|
|
559
559
|
})
|
|
560
560
|
})
|
|
561
|
-
}),
|
|
561
|
+
}), je && /* @__PURE__ */ e(H, {
|
|
562
562
|
className: "result",
|
|
563
563
|
width: 424,
|
|
564
564
|
title: null,
|
|
565
|
-
open:
|
|
565
|
+
open: je,
|
|
566
566
|
closable: !1,
|
|
567
567
|
footer: null,
|
|
568
568
|
children: /* @__PURE__ */ e("div", {
|
|
569
569
|
className: "upload-result",
|
|
570
|
-
children: /* @__PURE__ */ e(
|
|
570
|
+
children: /* @__PURE__ */ e(Oe, {
|
|
571
571
|
status: "error",
|
|
572
572
|
title: "文件处理失败",
|
|
573
573
|
extra: [/* @__PURE__ */ e(O, {
|
|
574
|
-
onClick:
|
|
574
|
+
onClick: al,
|
|
575
575
|
children: "关闭"
|
|
576
576
|
}, "close")]
|
|
577
577
|
})
|
|
@@ -580,5 +580,5 @@ const Jl = (y) => {
|
|
|
580
580
|
});
|
|
581
581
|
};
|
|
582
582
|
export {
|
|
583
|
-
|
|
583
|
+
Wl as default
|
|
584
584
|
};
|