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