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