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