@glodon-aiot/dataset-annotation 3.13.0-alpha.28 → 3.13.0-alpha.29
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.
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
var ft = Object.defineProperty,
|
|
2
|
-
var
|
|
1
|
+
var ft = Object.defineProperty, ht = Object.defineProperties;
|
|
2
|
+
var ut = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var Ae = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var Ee = (N, f, o) => f in N ? ft(N, f, { enumerable: !0, configurable: !0, writable: !0, value: o }) : N[f] = o,
|
|
4
|
+
var gt = Object.prototype.hasOwnProperty, mt = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Ee = (N, f, o) => f in N ? ft(N, f, { enumerable: !0, configurable: !0, writable: !0, value: o }) : N[f] = o, g = (N, f) => {
|
|
6
6
|
for (var o in f || (f = {}))
|
|
7
|
-
|
|
7
|
+
gt.call(f, o) && Ee(N, o, f[o]);
|
|
8
8
|
if (Ae)
|
|
9
9
|
for (var o of Ae(f))
|
|
10
|
-
|
|
10
|
+
mt.call(f, o) && Ee(N, o, f[o]);
|
|
11
11
|
return N;
|
|
12
|
-
}, S = (N, f) =>
|
|
12
|
+
}, S = (N, f) => ht(N, ut(f));
|
|
13
13
|
import { jsx as s, jsxs as V, Fragment as ze } from "react/jsx-runtime";
|
|
14
14
|
import { useRef as pt, useState as d, useEffect as u } from "react";
|
|
15
15
|
import { message as z, ConfigProvider as bt, Space as te, Select as vt, Button as ie, Tabs as St, Col as Ct, Tooltip as yt, Empty as It, Spin as Lt, Modal as Dt } from "antd";
|
|
16
16
|
import kt from "rc-virtual-list";
|
|
17
|
-
import { UploadZipsStatus as
|
|
17
|
+
import { UploadZipsStatus as K, PreLabelTaskStatus as Tt } from "@glodon-aiot/apis";
|
|
18
18
|
import xt from "antd/es/locale/zh_CN";
|
|
19
19
|
import Vt from "../../DatasetContext/index.mjs";
|
|
20
20
|
import Nt from "./icon_item_empty.svg.mjs";
|
|
@@ -22,15 +22,15 @@ import "./style.less.mjs";
|
|
|
22
22
|
import { tagColors as Me } from "../../utils/index.mjs";
|
|
23
23
|
import Pt from "./components/Labels/index.mjs";
|
|
24
24
|
import { useKeyPress as wt } from "ahooks";
|
|
25
|
-
import
|
|
25
|
+
import Fe from "./components/DisabledTooltip/index.mjs";
|
|
26
26
|
import At from "./PreSamplesPage/index.mjs";
|
|
27
27
|
import { SearchOutlined as Et } from "@ant-design/icons";
|
|
28
28
|
import zt from "../../Common/Page/index.mjs";
|
|
29
29
|
import Mt from "../PicZipImportModal/index.mjs";
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import { Prompt as
|
|
30
|
+
import Ft from "../PageNav/index.mjs";
|
|
31
|
+
import Rt from "../Thumbnail/index.mjs";
|
|
32
|
+
import Bt from "../CompositionInput/index.mjs";
|
|
33
|
+
import { Prompt as Ot } from "../hooks/Prompt.mjs";
|
|
34
34
|
import Ht from "../PreLabelOCR/index.mjs";
|
|
35
35
|
import Kt from "lodash/merge";
|
|
36
36
|
import { DEFAULT_FILTER_SWITCH as Ut } from "../../constant.mjs";
|
|
@@ -40,109 +40,109 @@ const bi = (N) => {
|
|
|
40
40
|
const {
|
|
41
41
|
services: f,
|
|
42
42
|
datasetId: o,
|
|
43
|
-
versionId:
|
|
44
|
-
backTo:
|
|
45
|
-
labelManager:
|
|
46
|
-
datasetManager:
|
|
47
|
-
annotation:
|
|
48
|
-
header:
|
|
43
|
+
versionId: X,
|
|
44
|
+
backTo: Re,
|
|
45
|
+
labelManager: he = !1,
|
|
46
|
+
datasetManager: D = !1,
|
|
47
|
+
annotation: Be,
|
|
48
|
+
header: k = {
|
|
49
49
|
versionSelect: !1
|
|
50
50
|
},
|
|
51
|
-
exampleSrcRoot:
|
|
52
|
-
} = N,
|
|
53
|
-
Kt(
|
|
54
|
-
const
|
|
51
|
+
exampleSrcRoot: Oe
|
|
52
|
+
} = N, U = g({}, Ut);
|
|
53
|
+
Kt(U, N.filterSwitch);
|
|
54
|
+
const j = pt(null), [C, ue] = d(), [i, Z] = d(), [Y, He] = d([]), [ge, me] = d(!1), [$, pe] = d(0), [y, ne] = d(""), [B, be] = d(0), [Ke, Ue] = d(), [ve, re] = d(!1), [Se, je] = d(!1), [Ce, Ze] = d(!0), [$e, We] = d(!1), [P, ye] = d([]), [p, E] = d([]), [W, q] = d(!1), [_, G] = d(!1), [M, b] = d(-1), [v, m] = d(), [c, I] = d(), [r, x] = d({
|
|
55
55
|
current: 0,
|
|
56
56
|
pageSize: 100
|
|
57
|
-
}), [F, oe] = d([]), [R, qe] = d(""), [_e, Ge] = d(!1), [Ie, Le] = d(), [ee, le] = d(null), [w, De] = d(!1), [Je, ke] = d(!1), [Qe, Xe] = d(0), [Zt, se] = d(""), [
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
}), [F, oe] = d([]), [R, qe] = d(""), [_e, Ge] = d(!1), [Ie, Le] = d(), [ee, le] = d(null), [w, De] = d(!1), [Je, ke] = d(!1), [Qe, Xe] = d(0), [Zt, se] = d(""), [J, Ye] = d(""), [et, tt] = d(), O = () => {
|
|
58
|
+
m(void 0), I(void 0), b(-1), q(!1), H(), setTimeout(() => {
|
|
59
|
+
x((e) => S(g({}, e), {
|
|
60
60
|
current: 1,
|
|
61
61
|
type: void 0
|
|
62
62
|
}));
|
|
63
63
|
}, 10);
|
|
64
64
|
};
|
|
65
|
-
wt("Esc",
|
|
65
|
+
wt("Esc", O), u(() => {
|
|
66
66
|
o && f.cvforceDatahub.getS3Iam(o).then((e) => {
|
|
67
67
|
Ue(e);
|
|
68
68
|
});
|
|
69
69
|
}, [o]), u(() => {
|
|
70
70
|
f.cvforceDatahub && f.cvforceDatahub.getOptionsImgproxy().then((e) => tt(e));
|
|
71
71
|
}, [f.cvforceDatahub]), u(() => {
|
|
72
|
-
|
|
72
|
+
T();
|
|
73
73
|
}, [i == null ? void 0 : i.id]), u(() => {
|
|
74
|
-
o && (
|
|
74
|
+
o && (me(!0), Promise.all([
|
|
75
75
|
// 数据集
|
|
76
76
|
f.cvforceDatahub.getDatasetsId(o).then((e) => {
|
|
77
|
-
|
|
77
|
+
ue(e);
|
|
78
78
|
}),
|
|
79
79
|
// 版本列表
|
|
80
80
|
f.cvforceDatahub.getDatasetsIdVersions(o, 1, 1e3).then((e) => {
|
|
81
|
-
He(e.recordList),
|
|
81
|
+
He(e.recordList), Z(X ? e.recordList.find((t) => t.id === X) : e.recordList[0]);
|
|
82
82
|
})
|
|
83
|
-
]).finally(() =>
|
|
84
|
-
}, [o,
|
|
83
|
+
]).finally(() => me(!1)));
|
|
84
|
+
}, [o, X]);
|
|
85
85
|
const Te = () => {
|
|
86
86
|
!o || !i || f.cvforceDatahub.getDatasetsIdVersionsVid(o, i.id).then((e) => {
|
|
87
|
-
|
|
87
|
+
Z(e), qe(e.versionAsyncTask.state);
|
|
88
88
|
});
|
|
89
89
|
};
|
|
90
90
|
u(() => {
|
|
91
|
-
R !==
|
|
91
|
+
R !== K.Pending && R !== K.Started || z.warning("文件导入中,请刷新页面再试");
|
|
92
92
|
}, [R]), u(() => {
|
|
93
|
-
|
|
93
|
+
Z(void 0), x(S(g({}, r), {
|
|
94
94
|
current: 1
|
|
95
95
|
})), E([]), Te();
|
|
96
|
-
}, [o,
|
|
96
|
+
}, [o, X]), u(() => {
|
|
97
97
|
o && f.cvforceDatahub.getDatasetsId(o).then((e) => {
|
|
98
|
-
|
|
98
|
+
ue(e);
|
|
99
99
|
});
|
|
100
100
|
}, [o]), u(() => {
|
|
101
|
-
|
|
101
|
+
H();
|
|
102
102
|
}, [F, i]), u(() => {
|
|
103
|
-
!i || !C || A(S(
|
|
103
|
+
!i || !C || A(S(g({}, r), {
|
|
104
104
|
current: 1
|
|
105
105
|
})).then((e) => {
|
|
106
106
|
});
|
|
107
107
|
}, [C == null ? void 0 : C.id, i == null ? void 0 : i.id, F]), u(() => {
|
|
108
108
|
A().then((e) => {
|
|
109
|
-
}),
|
|
110
|
-
}, [
|
|
111
|
-
w &&
|
|
109
|
+
}), T();
|
|
110
|
+
}, [r.current]), u(() => {
|
|
111
|
+
w && T();
|
|
112
112
|
}, [Ie]), u(() => {
|
|
113
|
-
A(S(
|
|
113
|
+
A(S(g({}, r), {
|
|
114
114
|
current: 1,
|
|
115
115
|
total: void 0
|
|
116
116
|
})).then((e) => {
|
|
117
|
-
e && v && (Array.isArray(e) && e.length ? (
|
|
118
|
-
|
|
117
|
+
e && (!v && !_ || (Array.isArray(e) && e.length ? (b(0), m(e[0]), I(void 0)) : (m(void 0), I(void 0), b(-1), H(), setTimeout(() => {
|
|
118
|
+
x((t) => S(g({}, t), {
|
|
119
119
|
current: 1,
|
|
120
120
|
type: void 0
|
|
121
121
|
}));
|
|
122
|
-
}, 10)));
|
|
122
|
+
}, 10))));
|
|
123
123
|
});
|
|
124
|
-
}, [
|
|
125
|
-
|
|
126
|
-
}, [
|
|
124
|
+
}, [y]), u(() => {
|
|
125
|
+
_ || (m(void 0), I(void 0), q(!1), b(-1), H(), T());
|
|
126
|
+
}, [_]), u(() => {
|
|
127
127
|
We(!Ce && Se);
|
|
128
128
|
}, [Ce, Se]), u(() => {
|
|
129
129
|
if (!o) {
|
|
130
130
|
ee && (clearTimeout(ee), le(null)), Le(void 0);
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
|
-
|
|
133
|
+
ae();
|
|
134
134
|
}, [o, i == null ? void 0 : i.id]), u(() => {
|
|
135
|
-
ce();
|
|
136
|
-
}, [_e]), u(() => {
|
|
137
135
|
ae();
|
|
136
|
+
}, [_e]), u(() => {
|
|
137
|
+
ce();
|
|
138
138
|
}, [w, o, i]), u(() => {
|
|
139
|
-
A(S(
|
|
139
|
+
A(S(g({}, r), {
|
|
140
140
|
current: 1
|
|
141
|
-
})),
|
|
142
|
-
}, [
|
|
141
|
+
})), T();
|
|
142
|
+
}, [J]), u(() => {
|
|
143
143
|
se("");
|
|
144
144
|
}, [v]);
|
|
145
|
-
const
|
|
145
|
+
const ce = () => {
|
|
146
146
|
i && f.cvforceDatahub.getDatasetsIdVersionsVidSamples(o, i.id, {
|
|
147
147
|
pageNo: 1,
|
|
148
148
|
pageSize: 1e3,
|
|
@@ -150,16 +150,16 @@ const bi = (N) => {
|
|
|
150
150
|
}).then((e) => {
|
|
151
151
|
Xe(e.recordList.length);
|
|
152
152
|
});
|
|
153
|
-
},
|
|
153
|
+
}, ae = () => {
|
|
154
154
|
!o || !i || f.cvforceDatahub.getPreLabelTask(o, i.id).then((e) => {
|
|
155
155
|
const t = e[0];
|
|
156
156
|
if (Le(t), ee && (clearTimeout(ee), le(null)), !(t != null && t.state) || t.state !== Tt.Started) {
|
|
157
|
-
De(!1),
|
|
157
|
+
De(!1), T();
|
|
158
158
|
return;
|
|
159
159
|
} else
|
|
160
160
|
De(!0);
|
|
161
161
|
le(setTimeout(() => {
|
|
162
|
-
|
|
162
|
+
ae();
|
|
163
163
|
}, 1e4));
|
|
164
164
|
});
|
|
165
165
|
};
|
|
@@ -167,178 +167,179 @@ const bi = (N) => {
|
|
|
167
167
|
C && C.markType !== "detection" && console.error("当前数据集不是detection(物体检测)类型,请检查数据集类型。");
|
|
168
168
|
}, [C]);
|
|
169
169
|
const A = (e, t) => {
|
|
170
|
-
const l = (e == null ? void 0 : e.current) ||
|
|
170
|
+
const l = (e == null ? void 0 : e.current) || r.current, n = (e == null ? void 0 : e.pageSize) || r.pageSize;
|
|
171
171
|
if (!o || !i || !l)
|
|
172
172
|
return Promise.resolve(!1);
|
|
173
|
-
const
|
|
174
|
-
switch (
|
|
173
|
+
const a = F.map((L) => L.label), h = () => {
|
|
174
|
+
switch (y) {
|
|
175
175
|
case "nocode":
|
|
176
176
|
return "nocode";
|
|
177
177
|
case "hascode":
|
|
178
|
-
return
|
|
178
|
+
return a.length ? a : "hascode";
|
|
179
179
|
default:
|
|
180
|
-
return
|
|
180
|
+
return a.length ? a : void 0;
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
|
-
return l === 1 &&
|
|
183
|
+
return l === 1 && ct(), x(S(g({}, r), {
|
|
184
184
|
current: l,
|
|
185
|
-
pageSize:
|
|
185
|
+
pageSize: n
|
|
186
186
|
})), f.cvforceDatahub.getDatasetsIdVersionsVidSamples(o, i.id, {
|
|
187
187
|
pageNo: l,
|
|
188
|
-
pageSize:
|
|
188
|
+
pageSize: n,
|
|
189
189
|
labels: h(),
|
|
190
|
-
searchName:
|
|
191
|
-
}).then((
|
|
192
|
-
const
|
|
193
|
-
if (E(we),
|
|
190
|
+
searchName: J
|
|
191
|
+
}).then((L) => {
|
|
192
|
+
const Q = L.recordList || [], we = l === 1 ? Q : [...t || p, ...Q];
|
|
193
|
+
if (E(we), x(S(g({}, r), {
|
|
194
194
|
current: l,
|
|
195
|
-
pageSize:
|
|
196
|
-
total:
|
|
197
|
-
})),
|
|
198
|
-
|
|
199
|
-
const fe =
|
|
200
|
-
|
|
195
|
+
pageSize: n,
|
|
196
|
+
total: L.totalResults
|
|
197
|
+
})), r.type === "next" && Q.length) {
|
|
198
|
+
b(0);
|
|
199
|
+
const fe = L.recordList[0];
|
|
200
|
+
m(fe);
|
|
201
201
|
}
|
|
202
|
-
if (
|
|
203
|
-
|
|
204
|
-
const fe =
|
|
205
|
-
|
|
202
|
+
if (r.type === "prev" && Q.length) {
|
|
203
|
+
b(r.pageSize - 1);
|
|
204
|
+
const fe = L.recordList[r.pageSize - 1];
|
|
205
|
+
m(fe);
|
|
206
206
|
}
|
|
207
|
-
return W && M < 0 && (
|
|
207
|
+
return W && M < 0 && (b(0), m(Q[0]), G(!0)), we;
|
|
208
208
|
}).catch(() => !1);
|
|
209
209
|
};
|
|
210
210
|
u(() => {
|
|
211
|
-
|
|
211
|
+
x(y === "nocode" ? S(g({}, r), {
|
|
212
|
+
total: $
|
|
213
|
+
}) : y === "" ? S(g({}, r), {
|
|
212
214
|
total: B
|
|
213
|
-
}) :
|
|
214
|
-
total:
|
|
215
|
-
}) : S(m({}, n), {
|
|
216
|
-
total: O - B
|
|
215
|
+
}) : S(g({}, r), {
|
|
216
|
+
total: B - $
|
|
217
217
|
}));
|
|
218
|
-
}, [B
|
|
219
|
-
const
|
|
218
|
+
}, [$, B]);
|
|
219
|
+
const T = () => {
|
|
220
220
|
!o || !i || f.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(o, i.id, {
|
|
221
221
|
label: "allcode",
|
|
222
|
-
searchName:
|
|
222
|
+
searchName: J
|
|
223
223
|
}).then((e) => {
|
|
224
|
-
const t = e.find((
|
|
224
|
+
const t = e.find((n) => n.id === "allcodeid"), l = e.find((n) => n.id === "nocodeid");
|
|
225
225
|
be(t ? t.count : 0), pe(l ? l.count : 0);
|
|
226
226
|
});
|
|
227
|
-
},
|
|
227
|
+
}, H = () => {
|
|
228
228
|
if (!(!o || !(i != null && i.id)))
|
|
229
229
|
return f.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(o, i.id).then((e) => {
|
|
230
|
-
const l = (e || []).filter((
|
|
231
|
-
label:
|
|
232
|
-
count:
|
|
233
|
-
id:
|
|
234
|
-
color: Me[
|
|
230
|
+
const l = (e || []).filter((n) => n.label !== "nocode").map((n, a) => ({
|
|
231
|
+
label: n.label,
|
|
232
|
+
count: n.count,
|
|
233
|
+
id: n.id,
|
|
234
|
+
color: Me[a % 40]
|
|
235
235
|
}));
|
|
236
236
|
return ye(l), e;
|
|
237
237
|
});
|
|
238
238
|
}, it = (e) => {
|
|
239
|
-
if (!
|
|
239
|
+
if (!p)
|
|
240
240
|
return;
|
|
241
|
-
q(!1),
|
|
242
|
-
const t =
|
|
243
|
-
|
|
241
|
+
q(!1), b(e);
|
|
242
|
+
const t = p[e];
|
|
243
|
+
m(t), I(void 0), G(!0);
|
|
244
244
|
};
|
|
245
245
|
u(() => {
|
|
246
|
-
|
|
247
|
-
}, [
|
|
248
|
-
if (!
|
|
246
|
+
r.type || A();
|
|
247
|
+
}, [r.type]), u(() => {
|
|
248
|
+
if (!c)
|
|
249
249
|
return;
|
|
250
250
|
const e = [];
|
|
251
|
-
|
|
251
|
+
c == null || c.labels.forEach((t) => {
|
|
252
252
|
P != null && P.find((l) => l.id === t.id) && e.push(t);
|
|
253
|
-
}),
|
|
253
|
+
}), c.labels = e, I(c);
|
|
254
254
|
}, [P]);
|
|
255
255
|
const xe = () => {
|
|
256
|
-
if (
|
|
256
|
+
if (p) {
|
|
257
257
|
if (!W) {
|
|
258
258
|
E((e) => {
|
|
259
|
+
var a;
|
|
259
260
|
if (!Array.isArray(e) || !e.length)
|
|
260
|
-
return
|
|
261
|
-
const t = M + 1;
|
|
262
|
-
return t >= e.length ?
|
|
263
|
-
current:
|
|
264
|
-
pageSize:
|
|
261
|
+
return O(), e;
|
|
262
|
+
const t = M + 1, n = !!F.length ? e.length : (a = r.total) != null ? a : e.length;
|
|
263
|
+
return t >= e.length ? t >= n ? z.error("已经是最后一个了") : A({
|
|
264
|
+
current: r.current + 1,
|
|
265
|
+
pageSize: r.pageSize,
|
|
265
266
|
type: "next"
|
|
266
|
-
}, e).then((
|
|
267
|
-
|
|
268
|
-
const
|
|
269
|
-
|
|
267
|
+
}, e).then((h) => {
|
|
268
|
+
b(t);
|
|
269
|
+
const L = h[t];
|
|
270
|
+
m(L), I(void 0);
|
|
270
271
|
}) : setTimeout(() => {
|
|
271
|
-
|
|
272
|
-
const
|
|
273
|
-
|
|
272
|
+
b(t);
|
|
273
|
+
const h = e[t];
|
|
274
|
+
m(h), I(void 0);
|
|
274
275
|
}, 200), e;
|
|
275
276
|
});
|
|
276
277
|
return;
|
|
277
278
|
}
|
|
278
|
-
return de().then((e) => (e && (
|
|
279
|
+
return de().then((e) => (e && (T(), E((t) => {
|
|
279
280
|
let l;
|
|
280
281
|
if (Array.isArray(t)) {
|
|
281
282
|
if (!t.length)
|
|
282
|
-
return
|
|
283
|
-
const
|
|
284
|
-
if (
|
|
285
|
-
const
|
|
286
|
-
|
|
283
|
+
return O(), t;
|
|
284
|
+
const n = !c || c.labels.length && y === "hascode" || !c.labels.length && y === "nocode" || y === "" ? M + 1 : M;
|
|
285
|
+
if (c && (c.labels.length && y === "nocode" || !c.labels.length && y === "hascode")) {
|
|
286
|
+
const a = t.findIndex((h) => h.id === c.id);
|
|
287
|
+
a > -1 && (t.splice(a, 1), l = [...t], r.total && (r.total = r.total - 1));
|
|
287
288
|
}
|
|
288
|
-
|
|
289
|
-
current:
|
|
290
|
-
pageSize:
|
|
289
|
+
n >= t.length ? r.total && n >= r.total ? z.error("已经是最后一个了") : A({
|
|
290
|
+
current: r.current + 1,
|
|
291
|
+
pageSize: r.pageSize,
|
|
291
292
|
type: "next"
|
|
292
|
-
}, t).then((
|
|
293
|
-
|
|
294
|
-
const h =
|
|
295
|
-
|
|
293
|
+
}, t).then((a) => {
|
|
294
|
+
b(n);
|
|
295
|
+
const h = a[n];
|
|
296
|
+
m(h), I(void 0);
|
|
296
297
|
}) : setTimeout(() => {
|
|
297
|
-
|
|
298
|
-
const
|
|
299
|
-
|
|
298
|
+
b(n);
|
|
299
|
+
const a = t[n];
|
|
300
|
+
m(a), I(void 0);
|
|
300
301
|
}, 200);
|
|
301
302
|
}
|
|
302
303
|
return l || t;
|
|
303
304
|
})), e));
|
|
304
305
|
}
|
|
305
306
|
}, nt = () => {
|
|
306
|
-
if (
|
|
307
|
+
if (p) {
|
|
307
308
|
if (!W) {
|
|
308
309
|
E((e) => {
|
|
309
310
|
if (!Array.isArray(e) || !e.length)
|
|
310
|
-
return
|
|
311
|
+
return O(), e;
|
|
311
312
|
const t = M - 1;
|
|
312
313
|
return t < 0 ? z.error("已经是第一个了") : setTimeout(() => {
|
|
313
|
-
|
|
314
|
+
b(t);
|
|
314
315
|
const l = e[t];
|
|
315
|
-
|
|
316
|
+
m(l), I(void 0);
|
|
316
317
|
}, 200), e;
|
|
317
318
|
});
|
|
318
319
|
return;
|
|
319
320
|
}
|
|
320
321
|
de().then((e) => {
|
|
321
|
-
e && (
|
|
322
|
+
e && (T(), E((t) => {
|
|
322
323
|
let l;
|
|
323
324
|
if (Array.isArray(t)) {
|
|
324
325
|
if (!t.length)
|
|
325
|
-
return
|
|
326
|
-
const
|
|
327
|
-
if (
|
|
328
|
-
|
|
329
|
-
current:
|
|
330
|
-
pageSize:
|
|
326
|
+
return O(), t;
|
|
327
|
+
const n = M - 1;
|
|
328
|
+
if (n < 0)
|
|
329
|
+
n < 0 ? z.error("已经是第一个了") : x({
|
|
330
|
+
current: r.current - 1,
|
|
331
|
+
pageSize: r.pageSize,
|
|
331
332
|
type: "prev"
|
|
332
333
|
});
|
|
333
334
|
else {
|
|
334
|
-
if (
|
|
335
|
-
const
|
|
336
|
-
|
|
335
|
+
if (c && (c.labels.length && y === "nocode" || !c.labels.length && y === "hascode")) {
|
|
336
|
+
const a = t.findIndex((h) => h.id === c.id);
|
|
337
|
+
a > -1 && (t.splice(a, 1), l = [...t], r.total && (r.total = r.total - 1));
|
|
337
338
|
}
|
|
338
339
|
setTimeout(() => {
|
|
339
|
-
|
|
340
|
-
const
|
|
341
|
-
|
|
340
|
+
b(n);
|
|
341
|
+
const a = t[n];
|
|
342
|
+
m(a), I(void 0);
|
|
342
343
|
}, 200);
|
|
343
344
|
}
|
|
344
345
|
}
|
|
@@ -347,20 +348,20 @@ const bi = (N) => {
|
|
|
347
348
|
});
|
|
348
349
|
}
|
|
349
350
|
}, rt = (e) => {
|
|
350
|
-
const t = Object.keys(e.labels.reduce((l,
|
|
351
|
+
const t = Object.keys(e.labels.reduce((l, n) => (l[n.label] ? ++l[n.label] : l[n.label] = 1, l), {})).length;
|
|
351
352
|
return t >= 2 ? `+${t - 1}` : null;
|
|
352
353
|
}, ot = (e) => {
|
|
353
354
|
var t;
|
|
354
|
-
(!
|
|
355
|
-
current:
|
|
355
|
+
(!r.total || r.total > p.length) && e.currentTarget.scrollHeight - e.currentTarget.scrollTop === ((t = j.current) == null ? void 0 : t.clientHeight) && x(S(g({}, r), {
|
|
356
|
+
current: r.current + 1
|
|
356
357
|
}));
|
|
357
|
-
}, de = () => i ?
|
|
358
|
+
}, de = () => i ? c && !w ? (c.labels && (c.labels = c.labels.filter((e) => !!e.id)), f.cvforceDatahub.updateSamples(o, i.id, [c], 0).then(() => (z.success({
|
|
358
359
|
content: "保存成功"
|
|
359
360
|
}), E((e) => {
|
|
360
|
-
const t = e.findIndex((l) => l.id === (
|
|
361
|
-
return t > -1 && (e[t] =
|
|
361
|
+
const t = e.findIndex((l) => l.id === (c == null ? void 0 : c.id));
|
|
362
|
+
return t > -1 && (e[t] = c), [...e];
|
|
362
363
|
}), !0)).catch(() => !1)) : Promise.resolve(!0) : Promise.resolve(!1), lt = () => {
|
|
363
|
-
if (
|
|
364
|
+
if (c && c.labels.some((e) => !e.id))
|
|
364
365
|
return z.error("所有标注需设置标签"), Promise.resolve(!1);
|
|
365
366
|
xe();
|
|
366
367
|
}, st = () => {
|
|
@@ -369,11 +370,13 @@ const bi = (N) => {
|
|
|
369
370
|
content: "数据包含当前标注的内容和图片,删除后无法恢复,请确认是否删除!",
|
|
370
371
|
onOk: () => {
|
|
371
372
|
!v || !i || f.cvforceDatahub.delDatasetsIdVersionsVidSamplesId(o, i.id, v.id).then(() => {
|
|
372
|
-
const e =
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
373
|
+
const e = p.findIndex((l) => l.id === v.id);
|
|
374
|
+
p.splice(e, 1);
|
|
375
|
+
const t = p.length;
|
|
376
|
+
E([...p]), x(S(g({}, r), {
|
|
377
|
+
total: r.total ? r.total - 1 : 0
|
|
378
|
+
})), e <= p.length - 1 ? m(p[e]) : (m(p[e - 1]), b(e - 1)), T(), I(void 0), (t === 0 || r.total && r.total - 1 === 0) && (m(void 0), I(void 0), b(-1), W || G(!1), setTimeout(() => {
|
|
379
|
+
x((l) => S(g({}, l), {
|
|
377
380
|
current: 1,
|
|
378
381
|
type: void 0
|
|
379
382
|
}));
|
|
@@ -383,29 +386,29 @@ const bi = (N) => {
|
|
|
383
386
|
});
|
|
384
387
|
}, Ve = [{
|
|
385
388
|
key: "",
|
|
386
|
-
label: `全部(${
|
|
389
|
+
label: `全部(${B})`,
|
|
387
390
|
children: null
|
|
388
391
|
}, {
|
|
389
392
|
key: "nocode",
|
|
390
|
-
label: `未标注(${
|
|
393
|
+
label: `未标注(${$})`,
|
|
391
394
|
children: null
|
|
392
395
|
}, {
|
|
393
396
|
key: "hascode",
|
|
394
|
-
label: `已标注(${
|
|
397
|
+
label: `已标注(${B - $})`,
|
|
395
398
|
children: null
|
|
396
|
-
}],
|
|
399
|
+
}], ct = () => {
|
|
397
400
|
var e, t;
|
|
398
|
-
(t = (e =
|
|
401
|
+
(t = (e = j.current) == null ? void 0 : e.getElementsByClassName("rc-virtual-list-holder")[0]) == null || t.scrollTo({
|
|
399
402
|
top: 0
|
|
400
403
|
});
|
|
401
|
-
},
|
|
404
|
+
}, at = () => {
|
|
402
405
|
ke(!0);
|
|
403
406
|
}, dt = (e) => {
|
|
404
407
|
Ye(e);
|
|
405
408
|
}, Ne = (e) => {
|
|
406
|
-
|
|
407
|
-
t ? (ne(e),
|
|
408
|
-
}) : (
|
|
409
|
+
c ? de().then((t) => {
|
|
410
|
+
t ? (ne(e), T()) : z.error("保存失败");
|
|
411
|
+
}) : (x(S(g({}, r), {
|
|
409
412
|
current: 1,
|
|
410
413
|
total: void 0
|
|
411
414
|
})), ne(e)), e === "nocode" && oe([]);
|
|
@@ -417,88 +420,88 @@ const bi = (N) => {
|
|
|
417
420
|
datasetId: o,
|
|
418
421
|
versionId: (i == null ? void 0 : i.id) || "",
|
|
419
422
|
no: (i == null ? void 0 : i.no) || "",
|
|
420
|
-
loading:
|
|
423
|
+
loading: ge,
|
|
421
424
|
version: i,
|
|
422
|
-
versions:
|
|
423
|
-
samples:
|
|
424
|
-
pagination:
|
|
425
|
+
versions: Y,
|
|
426
|
+
samples: p,
|
|
427
|
+
pagination: r,
|
|
425
428
|
services: f,
|
|
426
429
|
featuresConfig: {
|
|
427
|
-
labelManager:
|
|
428
|
-
datasetManager:
|
|
429
|
-
annotation:
|
|
430
|
-
filterSwitch:
|
|
431
|
-
header:
|
|
432
|
-
exampleSrcRoot:
|
|
430
|
+
labelManager: he,
|
|
431
|
+
datasetManager: D,
|
|
432
|
+
annotation: Be,
|
|
433
|
+
filterSwitch: U,
|
|
434
|
+
header: k,
|
|
435
|
+
exampleSrcRoot: Oe
|
|
433
436
|
}
|
|
434
437
|
},
|
|
435
438
|
children: C ? C.markType === "detection" ? /* @__PURE__ */ s("div", {
|
|
436
439
|
className: "detection-version-detail",
|
|
437
|
-
children: Je ? i != null && i.id &&
|
|
440
|
+
children: Je ? i != null && i.id && D && D.preLabel ? /* @__PURE__ */ s(At, {
|
|
438
441
|
datasetId: o,
|
|
439
442
|
versionId: i.id,
|
|
440
443
|
onClose: () => {
|
|
441
|
-
ke(!1),
|
|
444
|
+
ke(!1), ce(), H(), T(), A();
|
|
442
445
|
},
|
|
443
|
-
samples:
|
|
446
|
+
samples: p,
|
|
444
447
|
labels: P,
|
|
445
|
-
fetchLength:
|
|
448
|
+
fetchLength: ce
|
|
446
449
|
}) : null : /* @__PURE__ */ V(zt, {
|
|
447
450
|
className: "product-details-page",
|
|
448
|
-
header:
|
|
449
|
-
backTo:
|
|
450
|
-
onBackClick:
|
|
451
|
-
v &&
|
|
451
|
+
header: k === !1 ? void 0 : /* @__PURE__ */ s(Ft, {
|
|
452
|
+
backTo: Re,
|
|
453
|
+
onBackClick: k != null && k.onBackClick ? () => {
|
|
454
|
+
v && O(), k.onBackClick && k.onBackClick();
|
|
452
455
|
} : void 0,
|
|
453
|
-
left: !
|
|
456
|
+
left: !ge && /* @__PURE__ */ V(te, {
|
|
454
457
|
children: [/* @__PURE__ */ s("span", {
|
|
455
458
|
style: {
|
|
456
459
|
fontWeight: "bold"
|
|
457
460
|
},
|
|
458
461
|
children: C == null ? void 0 : C.name
|
|
459
462
|
}), /* @__PURE__ */ s(vt, {
|
|
460
|
-
disabled: (
|
|
463
|
+
disabled: (k == null ? void 0 : k.versionSelect) === !1,
|
|
461
464
|
value: i == null ? void 0 : i.id,
|
|
462
465
|
style: {
|
|
463
466
|
width: 70
|
|
464
467
|
},
|
|
465
|
-
options:
|
|
468
|
+
options: Y.map((e) => ({
|
|
466
469
|
label: e.no,
|
|
467
470
|
value: e.id
|
|
468
471
|
})),
|
|
469
472
|
onChange: (e) => {
|
|
470
|
-
const t =
|
|
473
|
+
const t = Y.find((n) => n.id === e);
|
|
471
474
|
if (!C || !t)
|
|
472
475
|
return;
|
|
473
|
-
const l =
|
|
474
|
-
|
|
476
|
+
const l = Y.find((n) => n.id === t.id);
|
|
477
|
+
Z(l), k != null && k.onVersionChange && k.onVersionChange(l);
|
|
475
478
|
}
|
|
476
479
|
})]
|
|
477
480
|
}),
|
|
478
481
|
right: /* @__PURE__ */ V(te, {
|
|
479
|
-
children: [!v &&
|
|
482
|
+
children: [!v && D && D.add && /* @__PURE__ */ s(Fe, {
|
|
480
483
|
isPreLabel: w,
|
|
481
484
|
placement: "bottom",
|
|
482
485
|
children: /* @__PURE__ */ s(ie, {
|
|
483
486
|
type: "default",
|
|
484
487
|
onClick: () => re(!0),
|
|
485
|
-
disabled: R ===
|
|
488
|
+
disabled: R === K.Pending || R === K.Started || w,
|
|
486
489
|
children: "导入数据"
|
|
487
490
|
}, "del")
|
|
488
|
-
}), !v &&
|
|
491
|
+
}), !v && D && D.preLabel && (i != null && i.id) ? /* @__PURE__ */ V(ze, {
|
|
489
492
|
children: [/* @__PURE__ */ s(Ht, {
|
|
490
493
|
datasetId: o,
|
|
491
494
|
versionId: i.id,
|
|
492
|
-
disabled: !
|
|
495
|
+
disabled: !p.length,
|
|
493
496
|
setIsTaskChange: Ge,
|
|
494
497
|
datasetType: "detection",
|
|
495
498
|
preLabelTask: Ie
|
|
496
499
|
}), /* @__PURE__ */ s(ie, {
|
|
497
500
|
disabled: w || !Qe,
|
|
498
|
-
onClick:
|
|
501
|
+
onClick: at,
|
|
499
502
|
children: "待确认标注"
|
|
500
503
|
})]
|
|
501
|
-
}) : null, /* @__PURE__ */ s(
|
|
504
|
+
}) : null, /* @__PURE__ */ s(Ot, {
|
|
502
505
|
when: $e,
|
|
503
506
|
content: "确认要离开此页面吗?",
|
|
504
507
|
subContent: "离开此页面后,将结束导入,放弃未上传的文件,请谨慎操作!"
|
|
@@ -509,16 +512,16 @@ const bi = (N) => {
|
|
|
509
512
|
tenCode: C == null ? void 0 : C.tenantCode,
|
|
510
513
|
isVisible: ve,
|
|
511
514
|
setIsVisible: re,
|
|
512
|
-
getVersionListRequest:
|
|
515
|
+
getVersionListRequest: T,
|
|
513
516
|
setIsConfirm: Ze,
|
|
514
517
|
onUploadStatusChange: (e) => {
|
|
515
518
|
je(e);
|
|
516
519
|
},
|
|
517
520
|
tableReload: () => {
|
|
518
521
|
var e, t;
|
|
519
|
-
i != null && i.id && ((t = (e =
|
|
522
|
+
i != null && i.id && ((t = (e = j.current) == null ? void 0 : e.getElementsByClassName("rc-virtual-list-holder")[0]) == null || t.scrollTo({
|
|
520
523
|
top: 0
|
|
521
|
-
}), A(S(
|
|
524
|
+
}), A(S(g({}, r), {
|
|
522
525
|
current: 1
|
|
523
526
|
})));
|
|
524
527
|
},
|
|
@@ -529,26 +532,26 @@ const bi = (N) => {
|
|
|
529
532
|
children: [/* @__PURE__ */ V("div", {
|
|
530
533
|
className: "detection-header",
|
|
531
534
|
children: [/* @__PURE__ */ V(te, {
|
|
532
|
-
children: [
|
|
535
|
+
children: [U.tabs && /* @__PURE__ */ s(St, {
|
|
533
536
|
className: "header-tab",
|
|
534
|
-
activeKey:
|
|
537
|
+
activeKey: y,
|
|
535
538
|
items: Ve,
|
|
536
539
|
onChange: Ne
|
|
537
|
-
}), !v &&
|
|
540
|
+
}), !v && U.search && /* @__PURE__ */ s(Bt, {
|
|
538
541
|
placeholder: "请输入图片名称搜索",
|
|
539
542
|
suffix: /* @__PURE__ */ s(Et, {}),
|
|
540
|
-
value:
|
|
543
|
+
value: J,
|
|
541
544
|
onChange: dt,
|
|
542
545
|
allowClear: !0
|
|
543
546
|
})]
|
|
544
|
-
}), /* @__PURE__ */ s(
|
|
547
|
+
}), /* @__PURE__ */ s(Fe, {
|
|
545
548
|
isPreLabel: w,
|
|
546
549
|
children: /* @__PURE__ */ s(te, {
|
|
547
|
-
children:
|
|
550
|
+
children: D && D.label && /* @__PURE__ */ s(ie, {
|
|
548
551
|
type: "primary",
|
|
549
|
-
disabled:
|
|
552
|
+
disabled: w,
|
|
550
553
|
onClick: () => {
|
|
551
|
-
v || ne("nocode"), q(!0),
|
|
554
|
+
v || ne("nocode"), q(!0), b(-1), y === "nocode" && (b(0), m(p[0])), G(!0);
|
|
552
555
|
},
|
|
553
556
|
children: "标注"
|
|
554
557
|
})
|
|
@@ -558,18 +561,18 @@ const bi = (N) => {
|
|
|
558
561
|
className: "d-row",
|
|
559
562
|
children: [/* @__PURE__ */ V("div", {
|
|
560
563
|
className: "d-right",
|
|
561
|
-
ref:
|
|
562
|
-
children: [
|
|
564
|
+
ref: j,
|
|
565
|
+
children: [_ && /* @__PURE__ */ s(jt, {
|
|
563
566
|
datasetId: o,
|
|
564
|
-
isImageDetailVisible:
|
|
565
|
-
setIsImageDetailVisible:
|
|
566
|
-
currentSample:
|
|
567
|
+
isImageDetailVisible: _,
|
|
568
|
+
setIsImageDetailVisible: G,
|
|
569
|
+
currentSample: c != null ? c : v,
|
|
567
570
|
labels: P,
|
|
568
571
|
previewMode: !W,
|
|
569
572
|
filterItems: Ve,
|
|
570
|
-
filterMode:
|
|
573
|
+
filterMode: y,
|
|
571
574
|
onFilterChange: Ne,
|
|
572
|
-
onChange:
|
|
575
|
+
onChange: I,
|
|
573
576
|
onNextClick: () => xe(),
|
|
574
577
|
onPrevClick: () => nt(),
|
|
575
578
|
onSave: () => lt(),
|
|
@@ -579,38 +582,38 @@ const bi = (N) => {
|
|
|
579
582
|
},
|
|
580
583
|
onRefresh: () => {
|
|
581
584
|
var e;
|
|
582
|
-
(e =
|
|
583
|
-
var l,
|
|
584
|
-
if (
|
|
585
|
-
const
|
|
586
|
-
(l =
|
|
587
|
-
t != null && t.find((
|
|
588
|
-
}),
|
|
585
|
+
(e = H()) == null || e.then((t) => {
|
|
586
|
+
var l, n;
|
|
587
|
+
if (c) {
|
|
588
|
+
const a = [];
|
|
589
|
+
(l = c.labels) == null || l.forEach((h) => {
|
|
590
|
+
t != null && t.find((L) => L.id === h.id) && a.push(h);
|
|
591
|
+
}), c.labels = a, I(g({}, c));
|
|
589
592
|
}
|
|
590
593
|
if (v) {
|
|
591
|
-
const
|
|
592
|
-
(
|
|
593
|
-
t != null && t.find((
|
|
594
|
-
}), v.labels =
|
|
594
|
+
const a = [];
|
|
595
|
+
(n = v.labels) == null || n.forEach((h) => {
|
|
596
|
+
t != null && t.find((L) => L.id === h.id) && a.push(h);
|
|
597
|
+
}), v.labels = a, m(g({}, v));
|
|
595
598
|
}
|
|
596
|
-
}),
|
|
599
|
+
}), T();
|
|
597
600
|
},
|
|
598
601
|
isPreLabel: w,
|
|
599
602
|
imgCount: {
|
|
600
|
-
total:
|
|
603
|
+
total: B,
|
|
601
604
|
index: M + 1
|
|
602
605
|
},
|
|
603
|
-
settingHide: !
|
|
604
|
-
canLabel: !!(
|
|
605
|
-
canDelete: !!(
|
|
606
|
-
}), v ? /* @__PURE__ */ s("div", {}) :
|
|
606
|
+
settingHide: !he,
|
|
607
|
+
canLabel: !!(D && D.label),
|
|
608
|
+
canDelete: !!(D && D.delete)
|
|
609
|
+
}), v ? /* @__PURE__ */ s("div", {}) : r.total !== void 0 && r.total > 0 ? /* @__PURE__ */ s(ze, {
|
|
607
610
|
children: /* @__PURE__ */ s(kt, {
|
|
608
611
|
innerProps: {
|
|
609
612
|
className: "d-right-row"
|
|
610
613
|
},
|
|
611
|
-
data:
|
|
614
|
+
data: p,
|
|
612
615
|
itemKey: "id",
|
|
613
|
-
height: (Pe =
|
|
616
|
+
height: (Pe = j.current) == null ? void 0 : Pe.clientHeight,
|
|
614
617
|
onScroll: ot,
|
|
615
618
|
children: (e, t) => {
|
|
616
619
|
var l;
|
|
@@ -623,7 +626,7 @@ const bi = (N) => {
|
|
|
623
626
|
onMouseLeave: () => se(""),
|
|
624
627
|
children: [/* @__PURE__ */ s("div", {
|
|
625
628
|
className: "right-col-img",
|
|
626
|
-
children: /* @__PURE__ */ s(
|
|
629
|
+
children: /* @__PURE__ */ s(Rt, {
|
|
627
630
|
fileKey: e.fileKey,
|
|
628
631
|
width: 124,
|
|
629
632
|
imgProxy: et
|
|
@@ -633,9 +636,9 @@ const bi = (N) => {
|
|
|
633
636
|
children: [(l = e.labels) != null && l.length ? /* @__PURE__ */ s(yt, {
|
|
634
637
|
placement: "top",
|
|
635
638
|
title: /* @__PURE__ */ s("div", {
|
|
636
|
-
children: Object.keys(e.labels.reduce((
|
|
637
|
-
children:
|
|
638
|
-
},
|
|
639
|
+
children: Object.keys(e.labels.reduce((n, a) => (n[a.label] ? ++n[a.label] : n[a.label] = 1, n), {})).map((n) => /* @__PURE__ */ s("div", {
|
|
640
|
+
children: n
|
|
641
|
+
}, n))
|
|
639
642
|
}),
|
|
640
643
|
children: /* @__PURE__ */ V("div", {
|
|
641
644
|
style: {
|
|
@@ -675,18 +678,18 @@ const bi = (N) => {
|
|
|
675
678
|
})
|
|
676
679
|
}) : /* @__PURE__ */ s("div", {
|
|
677
680
|
className: "empty",
|
|
678
|
-
children:
|
|
681
|
+
children: r.total === 0 ? /* @__PURE__ */ s(It, {
|
|
679
682
|
image: Nt,
|
|
680
683
|
description: /* @__PURE__ */ V("span", {
|
|
681
|
-
children: ["暂无数据",
|
|
682
|
-
children:
|
|
684
|
+
children: ["暂无数据", y !== "hascode" && !J && /* @__PURE__ */ s("span", {
|
|
685
|
+
children: D && D.add && /* @__PURE__ */ V(ie, {
|
|
683
686
|
type: "link",
|
|
684
687
|
size: "small",
|
|
685
688
|
style: {
|
|
686
689
|
padding: 0
|
|
687
690
|
},
|
|
688
691
|
onClick: () => re(!0),
|
|
689
|
-
disabled: R ===
|
|
692
|
+
disabled: R === K.Pending || R === K.Started,
|
|
690
693
|
children: [/* @__PURE__ */ s("span", {
|
|
691
694
|
style: {
|
|
692
695
|
color: "black"
|
|
@@ -698,7 +701,7 @@ const bi = (N) => {
|
|
|
698
701
|
})
|
|
699
702
|
}) : /* @__PURE__ */ s(Lt, {})
|
|
700
703
|
})]
|
|
701
|
-
}), !v &&
|
|
704
|
+
}), y !== "nocode" && !v && U.labels && /* @__PURE__ */ s("div", {
|
|
702
705
|
className: "d-sider",
|
|
703
706
|
children: /* @__PURE__ */ s(Pt, {
|
|
704
707
|
datasetId: o,
|
|
@@ -709,14 +712,14 @@ const bi = (N) => {
|
|
|
709
712
|
},
|
|
710
713
|
onListChange: (e) => {
|
|
711
714
|
i && (f.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(o, i.id).then((t) => {
|
|
712
|
-
const
|
|
715
|
+
const n = (t || []).filter((h) => h.label !== "nocode").map((h, L) => ({
|
|
713
716
|
label: h.label,
|
|
714
717
|
count: h.count,
|
|
715
718
|
id: h.id,
|
|
716
|
-
color: Me[
|
|
717
|
-
})),
|
|
718
|
-
ye(
|
|
719
|
-
}),
|
|
719
|
+
color: Me[L % 40]
|
|
720
|
+
})), a = F.filter((h) => n.some((L) => L.id === h.id));
|
|
721
|
+
ye(n), F.length !== a.length && oe(a);
|
|
722
|
+
}), T());
|
|
720
723
|
},
|
|
721
724
|
isPreLabel: w
|
|
722
725
|
})
|