@glodon-aiot/dataset-annotation 3.22.2-alpha.4 → 3.23.0-alpha.2
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/components/ImageDetail/index.mjs +93 -95
- package/dist/es/components/DetectionAnnotation/components/ImageModal/index.mjs +94 -85
- package/dist/es/components/DetectionAnnotation/hooks/useSamplePreload.mjs +40 -0
- package/dist/es/components/DetectionAnnotation/index.mjs +473 -449
- package/dist/es/components/DetectionAnnotation/utils/imagePreloader.mjs +71 -0
- package/dist/es/index.mjs +1 -1
- package/dist/lib/index.js +4 -4
- package/dist/src/components/DetectionAnnotation/components/ImageDetail/index.d.ts +1 -1
- package/dist/src/components/DetectionAnnotation/components/ImageModal/index.d.ts +3 -0
- package/dist/src/components/DetectionAnnotation/hooks/useSamplePreload.d.ts +25 -0
- package/dist/src/components/DetectionAnnotation/utils/imagePreloader.d.ts +40 -0
- package/package.json +2 -2
|
@@ -1,86 +1,87 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var
|
|
10
|
-
|
|
1
|
+
var Wt = Object.defineProperty, $t = Object.defineProperties;
|
|
2
|
+
var jt = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var it = Object.getOwnPropertySymbols;
|
|
4
|
+
var Gt = Object.prototype.hasOwnProperty, Zt = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var rt = (L, g, c) => g in L ? Wt(L, g, { enumerable: !0, configurable: !0, writable: !0, value: c }) : L[g] = c, b = (L, g) => {
|
|
6
|
+
for (var c in g || (g = {}))
|
|
7
|
+
Gt.call(g, c) && rt(L, c, g[c]);
|
|
8
|
+
if (it)
|
|
9
|
+
for (var c of it(g))
|
|
10
|
+
Zt.call(g, c) && rt(L, c, g[c]);
|
|
11
11
|
return L;
|
|
12
|
-
}, y = (L, g) =>
|
|
13
|
-
var
|
|
12
|
+
}, y = (L, g) => $t(L, jt(g));
|
|
13
|
+
var Be = (L, g, c) => new Promise((J, me) => {
|
|
14
14
|
var be = (I) => {
|
|
15
15
|
try {
|
|
16
|
-
|
|
17
|
-
} catch (
|
|
18
|
-
me(
|
|
16
|
+
oe(c.next(I));
|
|
17
|
+
} catch (le) {
|
|
18
|
+
me(le);
|
|
19
19
|
}
|
|
20
20
|
}, N = (I) => {
|
|
21
21
|
try {
|
|
22
|
-
|
|
23
|
-
} catch (
|
|
24
|
-
me(
|
|
22
|
+
oe(c.throw(I));
|
|
23
|
+
} catch (le) {
|
|
24
|
+
me(le);
|
|
25
25
|
}
|
|
26
|
-
},
|
|
27
|
-
|
|
26
|
+
}, oe = (I) => I.done ? J(I.value) : Promise.resolve(I.value).then(be, N);
|
|
27
|
+
oe((c = c.apply(L, g)).next());
|
|
28
28
|
});
|
|
29
|
-
import { jsx as
|
|
30
|
-
import { useRef as $, useState as p, useLayoutEffect as
|
|
31
|
-
import { message as D, ConfigProvider as
|
|
32
|
-
import
|
|
33
|
-
import { UploadZipsStatus as
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
29
|
+
import { jsx as a, jsxs as m, Fragment as ot } from "react/jsx-runtime";
|
|
30
|
+
import { useRef as $, useState as p, useLayoutEffect as _t, useEffect as C, useCallback as Xt } from "react";
|
|
31
|
+
import { message as D, ConfigProvider as Jt, Space as pe, Select as Qt, Button as ie, Dropdown as lt, Tabs as Yt, Checkbox as st, Col as en, Tooltip as tn, Empty as nn, Spin as rn, Modal as ke } from "antd";
|
|
32
|
+
import on from "rc-virtual-list";
|
|
33
|
+
import { UploadZipsStatus as re, PreLabelTaskStatus as ln } from "@glodon-aiot/apis";
|
|
34
|
+
import sn from "antd/es/locale/zh_CN";
|
|
35
|
+
import an from "../../DatasetContext/index.mjs";
|
|
36
|
+
import cn from "./icon_item_empty.svg.mjs";
|
|
37
37
|
import "./style.less.mjs";
|
|
38
|
-
import { tagColors as
|
|
39
|
-
import
|
|
40
|
-
import { useKeyPress as
|
|
38
|
+
import { tagColors as at } from "../../utils/index.mjs";
|
|
39
|
+
import dn from "./components/Labels/index.mjs";
|
|
40
|
+
import { useKeyPress as fn } from "ahooks";
|
|
41
41
|
import ct from "./components/DisabledTooltip/index.mjs";
|
|
42
|
-
import
|
|
43
|
-
import { DownOutlined as
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import
|
|
48
|
-
import
|
|
49
|
-
import { Prompt as
|
|
50
|
-
import
|
|
51
|
-
import
|
|
52
|
-
import { DEFAULT_FILTER_SWITCH as
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
|
|
56
|
-
|
|
42
|
+
import hn from "./PreSamplesPage/index.mjs";
|
|
43
|
+
import { DownOutlined as dt, SearchOutlined as un } from "@ant-design/icons";
|
|
44
|
+
import gn from "../../Common/Page/index.mjs";
|
|
45
|
+
import pn from "../PicZipImportModal/index.mjs";
|
|
46
|
+
import mn from "../PageNav/index.mjs";
|
|
47
|
+
import bn from "../Thumbnail/index.mjs";
|
|
48
|
+
import vn from "../CompositionInput/index.mjs";
|
|
49
|
+
import { Prompt as yn } from "../hooks/Prompt.mjs";
|
|
50
|
+
import Sn from "../PreLabelOCR/index.mjs";
|
|
51
|
+
import Cn from "lodash/merge";
|
|
52
|
+
import { DEFAULT_FILTER_SWITCH as In } from "../../constant.mjs";
|
|
53
|
+
import xn from "../DetectionStatus/index.mjs";
|
|
54
|
+
import kn from "./components/ImageModal/index.mjs";
|
|
55
|
+
import Ln from "./hooks/useSamplePreload.mjs";
|
|
56
|
+
var wn = /* @__PURE__ */ ((L) => (L.Next = "NEXT", L.Prev = "PREV", L.Confirm = "CONFIRM", L.Save = "Save", L))(wn || {});
|
|
57
|
+
const ii = (L) => {
|
|
57
58
|
const {
|
|
58
59
|
services: g,
|
|
59
|
-
datasetId:
|
|
60
|
-
versionId:
|
|
60
|
+
datasetId: c,
|
|
61
|
+
versionId: J,
|
|
61
62
|
backTo: me,
|
|
62
63
|
labelManager: be = !1,
|
|
63
64
|
datasetManager: N = !1,
|
|
64
|
-
annotation:
|
|
65
|
+
annotation: oe,
|
|
65
66
|
header: I = {
|
|
66
67
|
versionSelect: !1
|
|
67
68
|
},
|
|
68
|
-
exampleSrcRoot:
|
|
69
|
-
} = L,
|
|
70
|
-
|
|
71
|
-
const
|
|
69
|
+
exampleSrcRoot: le
|
|
70
|
+
} = L, se = b({}, In);
|
|
71
|
+
Cn(se, L.filterSwitch);
|
|
72
|
+
const ae = $(null), Le = $(null), [ft, ht] = p(0), [x, Me] = p(), [o, ce] = p(), [ve, ut] = p([]), [Fe, Oe] = p(!1), [de, He] = p(0), [fe, Ue] = p(0), [h, we] = p(""), [Q, qe] = p(0), [gt, pt] = p(), [Ke, De] = p(!1), [We, mt] = p(!1), [$e, bt] = p(!0), [vt, yt] = p(!1), [O, je] = p([]), [v, U] = p([]), [he, j] = p(!1), [Y, ue] = p(!1), [M, V] = p(-1), [u, R] = p(), [St, Ge] = p(), [d, z] = p(), [l, T] = p({
|
|
72
73
|
current: 0,
|
|
73
74
|
pageSize: 100
|
|
74
|
-
}), [
|
|
75
|
-
|
|
76
|
-
const e =
|
|
75
|
+
}), [W, Ne] = p([]), [G, Ct] = p(""), [It, xt] = p(!1), [Ze, _e] = p(), [ye, Re] = p(null), [H, Xe] = p(!1), [kt, Lt] = p(!1), [Dn, wt] = p(0), [Nn, Te] = p(""), [ee, Dt] = p(""), ge = $({}), Pe = $(!1), Se = $(0), Ce = $(0), Z = $(0), [P, Ve] = p(/* @__PURE__ */ new Set()), [Nt, Ie] = p(!1), Je = $(-1);
|
|
76
|
+
_t(() => {
|
|
77
|
+
const e = ae.current;
|
|
77
78
|
if (!e)
|
|
78
79
|
return;
|
|
79
80
|
let t = 0;
|
|
80
81
|
const n = () => {
|
|
81
82
|
cancelAnimationFrame(t), t = requestAnimationFrame(() => {
|
|
82
|
-
const s = e.clientHeight,
|
|
83
|
-
|
|
83
|
+
const s = e.clientHeight, f = Math.max(1, Math.round(s));
|
|
84
|
+
f !== Je.current && (Je.current = f, ht(f));
|
|
84
85
|
});
|
|
85
86
|
};
|
|
86
87
|
n();
|
|
@@ -91,170 +92,179 @@ const Xn = (L) => {
|
|
|
91
92
|
cancelAnimationFrame(t), i == null || i.disconnect(), r == null || r.removeEventListener("resize", n), window.removeEventListener("resize", n);
|
|
92
93
|
};
|
|
93
94
|
}, [x]);
|
|
94
|
-
const
|
|
95
|
-
R(void 0),
|
|
95
|
+
const te = () => {
|
|
96
|
+
R(void 0), z(void 0), V(-1), j(!1), q(), setTimeout(() => {
|
|
96
97
|
T((e) => y(b({}, e), {
|
|
97
98
|
current: 1,
|
|
98
99
|
type: void 0
|
|
99
100
|
}));
|
|
100
101
|
}, 10);
|
|
101
102
|
};
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
fn("Esc", te), C(() => {
|
|
104
|
+
c && g.cvforceDatahub.getS3Iam(c).then((e) => {
|
|
105
|
+
pt(e);
|
|
105
106
|
});
|
|
106
|
-
}, [
|
|
107
|
+
}, [c]), C(() => {
|
|
107
108
|
w();
|
|
108
109
|
}, [o == null ? void 0 : o.id]), C(() => {
|
|
109
|
-
|
|
110
|
+
c && (Oe(!0), Promise.all([
|
|
110
111
|
// 数据集
|
|
111
|
-
g.cvforceDatahub.getDatasetsId(
|
|
112
|
-
|
|
112
|
+
g.cvforceDatahub.getDatasetsId(c).then((e) => {
|
|
113
|
+
Me(e);
|
|
113
114
|
}),
|
|
114
115
|
// 版本列表
|
|
115
|
-
g.cvforceDatahub.getDatasetsIdVersions(
|
|
116
|
-
|
|
116
|
+
g.cvforceDatahub.getDatasetsIdVersions(c, 1, 1e3).then((e) => {
|
|
117
|
+
ut(e.recordList), ce(J ? e.recordList.find((t) => t.id === J) : e.recordList[0]);
|
|
117
118
|
})
|
|
118
119
|
]).finally(() => Oe(!1)));
|
|
119
|
-
}, [
|
|
120
|
-
const
|
|
121
|
-
!
|
|
122
|
-
|
|
120
|
+
}, [c, J]);
|
|
121
|
+
const Qe = () => {
|
|
122
|
+
!c || !o || g.cvforceDatahub.getDatasetsIdVersionsVid(c, o.id).then((e) => {
|
|
123
|
+
ce(e), Ct(e.versionAsyncTask.state);
|
|
123
124
|
});
|
|
124
125
|
};
|
|
125
126
|
C(() => {
|
|
126
|
-
|
|
127
|
-
}, [
|
|
128
|
-
|
|
127
|
+
G !== re.Pending && G !== re.Started || D.warning("文件导入中,请刷新页面再试");
|
|
128
|
+
}, [G]), C(() => {
|
|
129
|
+
ce(void 0), T(y(b({}, l), {
|
|
129
130
|
current: 1
|
|
130
|
-
})),
|
|
131
|
-
}, [
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
})), U([]), Qe();
|
|
132
|
+
}, [c, J]), C(() => {
|
|
133
|
+
c && g.cvforceDatahub.getDatasetsId(c).then((e) => {
|
|
134
|
+
Me(e);
|
|
134
135
|
});
|
|
135
|
-
}, [
|
|
136
|
-
Se.current++, Ce.current++,
|
|
137
|
-
}, [x == null ? void 0 : x.id, o == null ? void 0 : o.id,
|
|
138
|
-
|
|
139
|
-
}, [
|
|
140
|
-
!o || !x ||
|
|
136
|
+
}, [c]), C(() => {
|
|
137
|
+
Se.current++, Ce.current++, Z.current++;
|
|
138
|
+
}, [x == null ? void 0 : x.id, o == null ? void 0 : o.id, h, W, ee]), C(() => {
|
|
139
|
+
q();
|
|
140
|
+
}, [W, o, h]), C(() => {
|
|
141
|
+
!o || !x || A(y(b({}, l), {
|
|
141
142
|
current: 1
|
|
142
143
|
})).then((e) => {
|
|
143
144
|
});
|
|
144
|
-
}, [x == null ? void 0 : x.id, o == null ? void 0 : o.id,
|
|
145
|
-
if (
|
|
146
|
-
|
|
145
|
+
}, [x == null ? void 0 : x.id, o == null ? void 0 : o.id, W]), C(() => {
|
|
146
|
+
if (Pe.current) {
|
|
147
|
+
Pe.current = !1, w();
|
|
147
148
|
return;
|
|
148
149
|
}
|
|
149
|
-
|
|
150
|
+
A().then((e) => {
|
|
150
151
|
}), w();
|
|
151
152
|
}, [l.current]), C(() => {
|
|
152
153
|
H && w();
|
|
153
|
-
}, [
|
|
154
|
-
const e = ge.current[
|
|
154
|
+
}, [Ze]), C(() => {
|
|
155
|
+
const e = ge.current[h];
|
|
155
156
|
let t;
|
|
156
|
-
e && e.page > 1 ? t =
|
|
157
|
+
e && e.page > 1 ? t = A(y(b({}, l), {
|
|
157
158
|
current: 1,
|
|
158
159
|
pageSize: e.page * 100,
|
|
159
160
|
// 假设默认pageSize为100
|
|
160
161
|
total: void 0
|
|
161
|
-
})).then((n) => (
|
|
162
|
+
})).then((n) => (Pe.current = !0, T((i) => y(b({}, i), {
|
|
162
163
|
current: e.page,
|
|
163
164
|
pageSize: 100
|
|
164
|
-
})), n)) : t =
|
|
165
|
+
})), n)) : t = A(y(b({}, l), {
|
|
165
166
|
current: 1,
|
|
166
167
|
total: void 0
|
|
167
168
|
})), t.then((n) => {
|
|
168
|
-
if (n && !(!u && !
|
|
169
|
+
if (n && !(!u && !Y))
|
|
169
170
|
if (Array.isArray(n) && n.length) {
|
|
170
|
-
const i = ge.current[
|
|
171
|
-
|
|
171
|
+
const i = ge.current[h], r = i == null ? void 0 : i.index, s = r !== void 0 && r >= 0 && r < n.length ? r : 0;
|
|
172
|
+
V(s), R(n[s]), z(void 0);
|
|
172
173
|
} else
|
|
173
|
-
R(void 0),
|
|
174
|
+
R(void 0), z(void 0), V(-1), q(), setTimeout(() => {
|
|
174
175
|
T((i) => y(b({}, i), {
|
|
175
176
|
current: 1,
|
|
176
177
|
type: void 0
|
|
177
178
|
}));
|
|
178
179
|
}, 10);
|
|
179
180
|
});
|
|
180
|
-
}, [
|
|
181
|
+
}, [h]), C(() => {
|
|
181
182
|
var t;
|
|
182
183
|
let e;
|
|
183
|
-
if (!
|
|
184
|
-
const n = u !== void 0, i = u == null ? void 0 : u.id, r =
|
|
185
|
-
R(void 0),
|
|
186
|
-
var
|
|
187
|
-
const s = (
|
|
184
|
+
if (!Y) {
|
|
185
|
+
const n = u !== void 0, i = u == null ? void 0 : u.id, r = M;
|
|
186
|
+
R(void 0), z(void 0), j(!1), V(-1), Ge(void 0), q(), n && ((t = Le.current) == null || t.fetchLabels()), w(), i !== void 0 && (e = requestAnimationFrame(() => {
|
|
187
|
+
var F, X;
|
|
188
|
+
const s = (F = ae.current) == null ? void 0 : F.getElementsByClassName("rc-virtual-list-holder")[0];
|
|
188
189
|
if (!s)
|
|
189
190
|
return;
|
|
190
|
-
const
|
|
191
|
+
const f = Array.from(s.querySelectorAll("[data-sample-id]")), S = (X = f.find((B) => B.dataset.sampleId === String(i))) != null ? X : r >= 0 ? f[r] : void 0;
|
|
191
192
|
if (!S)
|
|
192
193
|
return;
|
|
193
|
-
const k = s.getBoundingClientRect(),
|
|
194
|
+
const k = s.getBoundingClientRect(), E = S.getBoundingClientRect(), K = s.scrollTop + E.top - k.top - Math.max(0, (s.clientHeight - E.height) / 2);
|
|
194
195
|
s.scrollTo({
|
|
195
|
-
top: Math.max(0,
|
|
196
|
+
top: Math.max(0, K)
|
|
196
197
|
});
|
|
197
198
|
}));
|
|
198
199
|
}
|
|
199
200
|
return () => {
|
|
200
201
|
e !== void 0 && cancelAnimationFrame(e);
|
|
201
202
|
};
|
|
202
|
-
}, [
|
|
203
|
-
|
|
203
|
+
}, [Y]);
|
|
204
|
+
const Rt = Xt((e, t) => {
|
|
205
|
+
Ge(e ? void 0 : t);
|
|
206
|
+
}, []);
|
|
207
|
+
Ln({
|
|
208
|
+
samples: v,
|
|
209
|
+
currentIndex: M,
|
|
210
|
+
active: Y,
|
|
211
|
+
loadedImageUrl: St
|
|
212
|
+
}), C(() => {
|
|
213
|
+
yt(!$e && We);
|
|
204
214
|
}, [$e, We]), C(() => {
|
|
205
|
-
if (!
|
|
206
|
-
ye && (clearTimeout(ye),
|
|
215
|
+
if (!c) {
|
|
216
|
+
ye && (clearTimeout(ye), Re(null)), _e(void 0);
|
|
207
217
|
return;
|
|
208
218
|
}
|
|
209
|
-
|
|
210
|
-
}, [
|
|
211
|
-
|
|
212
|
-
}, [
|
|
219
|
+
Ae();
|
|
220
|
+
}, [c, o == null ? void 0 : o.id]), C(() => {
|
|
221
|
+
Ae();
|
|
222
|
+
}, [It]), C(() => {
|
|
213
223
|
ze();
|
|
214
|
-
}, [H,
|
|
215
|
-
|
|
224
|
+
}, [H, c, o]), C(() => {
|
|
225
|
+
A(y(b({}, l), {
|
|
216
226
|
current: 1
|
|
217
227
|
})), w();
|
|
218
|
-
}, [
|
|
219
|
-
|
|
228
|
+
}, [ee]), C(() => {
|
|
229
|
+
Te("");
|
|
220
230
|
}, [u]), C(() => {
|
|
221
231
|
if (v.length === 0) {
|
|
222
232
|
Ie(!1);
|
|
223
233
|
return;
|
|
224
234
|
}
|
|
225
|
-
const e = v.every((t) =>
|
|
235
|
+
const e = v.every((t) => P.has(t.id));
|
|
226
236
|
Ie(e);
|
|
227
|
-
}, [v,
|
|
237
|
+
}, [v, P]);
|
|
228
238
|
const ze = () => {
|
|
229
|
-
o && g.cvforceDatahub.getDatasetsIdVersionsVidSamples(
|
|
239
|
+
o && g.cvforceDatahub.getDatasetsIdVersionsVidSamples(c, o.id, {
|
|
230
240
|
pageNo: 1,
|
|
231
241
|
pageSize: 1e3,
|
|
232
242
|
confirmStatus: 1
|
|
233
243
|
}).then((e) => {
|
|
234
|
-
|
|
244
|
+
wt(e.recordList.length);
|
|
235
245
|
});
|
|
236
|
-
},
|
|
237
|
-
!
|
|
246
|
+
}, Ae = () => {
|
|
247
|
+
!c || !o || g.cvforceDatahub.getPreLabelTask(c, o.id).then((e) => {
|
|
238
248
|
const t = e[0];
|
|
239
|
-
if (
|
|
240
|
-
|
|
249
|
+
if (_e(t), ye && (clearTimeout(ye), Re(null)), !(t != null && t.state) || t.state !== ln.Started) {
|
|
250
|
+
Xe(!1), w();
|
|
241
251
|
return;
|
|
242
252
|
} else
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
253
|
+
Xe(!0);
|
|
254
|
+
Re(setTimeout(() => {
|
|
255
|
+
Ae();
|
|
246
256
|
}, 1e4));
|
|
247
257
|
});
|
|
248
258
|
};
|
|
249
259
|
C(() => {
|
|
250
260
|
x && x.markType !== "detection" && console.error("当前数据集不是detection(物体检测)类型,请检查数据集类型。");
|
|
251
261
|
}, [x]);
|
|
252
|
-
const
|
|
262
|
+
const A = (e, t) => {
|
|
253
263
|
const n = (e == null ? void 0 : e.current) || l.current, i = (e == null ? void 0 : e.pageSize) || l.pageSize;
|
|
254
|
-
if (!
|
|
264
|
+
if (!c || !o || !n)
|
|
255
265
|
return Promise.resolve(!1);
|
|
256
|
-
const r = Se.current, s =
|
|
257
|
-
switch (
|
|
266
|
+
const r = Se.current, s = W.map((k) => k.label), f = () => {
|
|
267
|
+
switch (h) {
|
|
258
268
|
case "nocode":
|
|
259
269
|
return "nocode";
|
|
260
270
|
case "pending":
|
|
@@ -265,7 +275,7 @@ const Xn = (L) => {
|
|
|
265
275
|
return s.length ? s : void 0;
|
|
266
276
|
}
|
|
267
277
|
}, S = () => {
|
|
268
|
-
switch (
|
|
278
|
+
switch (h) {
|
|
269
279
|
case "nocode":
|
|
270
280
|
case "hascode":
|
|
271
281
|
return 0;
|
|
@@ -275,179 +285,179 @@ const Xn = (L) => {
|
|
|
275
285
|
return 2;
|
|
276
286
|
}
|
|
277
287
|
};
|
|
278
|
-
return n === 1 &&
|
|
288
|
+
return n === 1 && Mt(), T(y(b({}, l), {
|
|
279
289
|
current: n,
|
|
280
290
|
pageSize: i
|
|
281
|
-
})), g.cvforceDatahub.getDatasetsIdVersionsVidSamples(
|
|
291
|
+
})), g.cvforceDatahub.getDatasetsIdVersionsVidSamples(c, o.id, {
|
|
282
292
|
pageNo: n,
|
|
283
293
|
pageSize: i,
|
|
284
|
-
labels:
|
|
294
|
+
labels: f(),
|
|
285
295
|
confirmStatus: S(),
|
|
286
|
-
searchName:
|
|
296
|
+
searchName: ee
|
|
287
297
|
}).then((k) => {
|
|
288
298
|
if (r !== Se.current)
|
|
289
299
|
return !1;
|
|
290
|
-
const
|
|
291
|
-
if (
|
|
300
|
+
const E = k.recordList || [], K = n === 1 ? E : [...t || v, ...E];
|
|
301
|
+
if (U(K), T(y(b({}, l), {
|
|
292
302
|
current: n,
|
|
293
303
|
pageSize: i,
|
|
294
304
|
total: k.totalResults
|
|
295
|
-
})), l.type === "next" &&
|
|
296
|
-
|
|
297
|
-
const
|
|
298
|
-
R(
|
|
305
|
+
})), l.type === "next" && E.length) {
|
|
306
|
+
V(0);
|
|
307
|
+
const F = k.recordList[0];
|
|
308
|
+
R(F);
|
|
299
309
|
}
|
|
300
|
-
if (l.type === "prev" &&
|
|
301
|
-
|
|
302
|
-
const
|
|
303
|
-
R(
|
|
310
|
+
if (l.type === "prev" && E.length) {
|
|
311
|
+
V(l.pageSize - 1);
|
|
312
|
+
const F = k.recordList[l.pageSize - 1];
|
|
313
|
+
R(F);
|
|
304
314
|
}
|
|
305
|
-
return
|
|
315
|
+
return he && M < 0 && (V(0), R(E[0]), ue(!0)), K;
|
|
306
316
|
}).catch(() => !1);
|
|
307
317
|
};
|
|
308
318
|
C(() => {
|
|
309
|
-
T(
|
|
310
|
-
total:
|
|
311
|
-
}) :
|
|
312
|
-
total:
|
|
313
|
-
}) :
|
|
314
|
-
total:
|
|
319
|
+
T(h === "nocode" ? y(b({}, l), {
|
|
320
|
+
total: de
|
|
321
|
+
}) : h === "" ? y(b({}, l), {
|
|
322
|
+
total: Q
|
|
323
|
+
}) : h === "pending" ? y(b({}, l), {
|
|
324
|
+
total: fe
|
|
315
325
|
}) : y(b({}, l), {
|
|
316
|
-
total:
|
|
326
|
+
total: Q - de - fe
|
|
317
327
|
}));
|
|
318
|
-
}, [
|
|
328
|
+
}, [de, Q, fe]);
|
|
319
329
|
const w = () => {
|
|
320
|
-
!
|
|
330
|
+
!c || !o || g.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(c, o.id, {
|
|
321
331
|
label: "allcode",
|
|
322
332
|
confirmStatus: 2,
|
|
323
|
-
searchName:
|
|
333
|
+
searchName: ee
|
|
324
334
|
}).then((e) => {
|
|
325
335
|
const t = e.find((r) => r.id === "allcodeid"), n = e.find((r) => r.id === "nocodeid"), i = e.find((r) => r.id === "pendingid");
|
|
326
|
-
|
|
336
|
+
qe(t ? t.count : 0), He(n ? n.count : 0), Ue(i ? i.count : 0);
|
|
327
337
|
});
|
|
328
|
-
},
|
|
329
|
-
if (!
|
|
338
|
+
}, q = () => {
|
|
339
|
+
if (!c || !(o != null && o.id))
|
|
330
340
|
return;
|
|
331
341
|
const e = Ce.current;
|
|
332
342
|
let t = 2;
|
|
333
|
-
return
|
|
343
|
+
return h === "pending" ? t = 1 : h === "hascode" && (t = 0), g.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(c, o.id, {
|
|
334
344
|
confirmStatus: t
|
|
335
345
|
}).then((n) => {
|
|
336
346
|
if (e !== Ce.current)
|
|
337
347
|
return;
|
|
338
|
-
const r = (n || []).filter((s) => s.label !== "nocode").map((s,
|
|
348
|
+
const r = (n || []).filter((s) => s.label !== "nocode").map((s, f) => ({
|
|
339
349
|
label: s.label,
|
|
340
350
|
count: s.count,
|
|
341
351
|
id: s.id,
|
|
342
|
-
color:
|
|
352
|
+
color: at[f % 40]
|
|
343
353
|
}));
|
|
344
354
|
return je(r), n;
|
|
345
355
|
});
|
|
346
|
-
},
|
|
356
|
+
}, Tt = (e) => {
|
|
347
357
|
if (!v)
|
|
348
358
|
return;
|
|
349
|
-
|
|
359
|
+
j(!1), V(e);
|
|
350
360
|
const t = v[e];
|
|
351
|
-
R(t),
|
|
361
|
+
R(t), z(void 0), ue(!0), h !== void 0 && (ge.current[h] = {
|
|
352
362
|
index: e,
|
|
353
363
|
page: l.current || 1
|
|
354
364
|
});
|
|
355
365
|
};
|
|
356
366
|
C(() => {
|
|
357
|
-
l.type ||
|
|
367
|
+
l.type || A();
|
|
358
368
|
}, [l.type]), C(() => {
|
|
359
|
-
if (!
|
|
369
|
+
if (!d)
|
|
360
370
|
return;
|
|
361
371
|
const e = [];
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
}), e.length !==
|
|
372
|
+
d == null || d.labels.forEach((t) => {
|
|
373
|
+
O != null && O.find((n) => n.id === t.id) && e.push(t);
|
|
374
|
+
}), e.length !== d.labels.length && z(y(b({}, d), {
|
|
365
375
|
labels: e
|
|
366
376
|
}));
|
|
367
|
-
}, [
|
|
368
|
-
const
|
|
377
|
+
}, [O]);
|
|
378
|
+
const _ = (e, t, n, i) => {
|
|
369
379
|
setTimeout(() => {
|
|
370
|
-
i ===
|
|
380
|
+
i === Z.current && (V(t), R(e[t]), z(void 0), h !== void 0 && (ge.current[h] = {
|
|
371
381
|
index: t,
|
|
372
382
|
page: n
|
|
373
383
|
}));
|
|
374
384
|
}, 0);
|
|
375
|
-
},
|
|
385
|
+
}, Ye = (e, t) => {
|
|
376
386
|
if (!v)
|
|
377
387
|
return;
|
|
378
|
-
const n = ++
|
|
379
|
-
if (!
|
|
380
|
-
|
|
388
|
+
const n = ++Z.current;
|
|
389
|
+
if (!he) {
|
|
390
|
+
U((i) => {
|
|
381
391
|
var S;
|
|
382
392
|
if (!Array.isArray(i) || !i.length)
|
|
383
|
-
return
|
|
384
|
-
const r =
|
|
385
|
-
return r >= i.length ? r >=
|
|
393
|
+
return te(), i;
|
|
394
|
+
const r = M + 1, f = !!W.length ? i.length : (S = l.total) != null ? S : i.length;
|
|
395
|
+
return r >= i.length ? r >= f ? D.error("已经是最后一个了") : A({
|
|
386
396
|
current: l.current + 1,
|
|
387
397
|
pageSize: l.pageSize,
|
|
388
398
|
type: "next"
|
|
389
399
|
}, i).then((k) => {
|
|
390
|
-
Array.isArray(k) &&
|
|
391
|
-
}) :
|
|
400
|
+
Array.isArray(k) && _(k, r, l.current + 1, n);
|
|
401
|
+
}) : _(i, r, l.current || 1, n), i;
|
|
392
402
|
});
|
|
393
403
|
return;
|
|
394
404
|
}
|
|
395
|
-
return
|
|
396
|
-
var
|
|
405
|
+
return xe(e, t).then((i) => (i && n === Z.current && (console.log("action", t, "changedSample", d), w(), U((r) => {
|
|
406
|
+
var f, S;
|
|
397
407
|
let s;
|
|
398
408
|
if (Array.isArray(r)) {
|
|
399
409
|
if (!r.length)
|
|
400
|
-
return
|
|
401
|
-
const k =
|
|
402
|
-
if (
|
|
403
|
-
if (
|
|
404
|
-
const
|
|
405
|
-
|
|
410
|
+
return te(), r;
|
|
411
|
+
const k = h === "", E = (!((f = d == null ? void 0 : d.labels) != null && f.length) || !d) && h === "nocode", K = t !== "CONFIRM" && h === "pending", F = (((S = d == null ? void 0 : d.labels) == null ? void 0 : S.length) || !d) && h === "hascode", X = k || K || F || E ? M + 1 : M;
|
|
412
|
+
if (d) {
|
|
413
|
+
if (d.labels.length && h === "nocode" || !d.labels.length && h === "hascode" || t === "CONFIRM" && h === "pending") {
|
|
414
|
+
const B = r.findIndex((Ee) => Ee.id === d.id);
|
|
415
|
+
B > -1 && (r.splice(B, 1), s = [...r], l.total && (l.total = l.total - 1));
|
|
406
416
|
}
|
|
407
|
-
} else if (t === "CONFIRM" &&
|
|
408
|
-
const
|
|
409
|
-
|
|
417
|
+
} else if (t === "CONFIRM" && h === "pending") {
|
|
418
|
+
const B = r.findIndex((Ee) => Ee.id === (u == null ? void 0 : u.id));
|
|
419
|
+
B > -1 && (r.splice(B, 1), s = [...r], l.total && (l.total = l.total - 1));
|
|
410
420
|
}
|
|
411
|
-
if (
|
|
412
|
-
if (l.total &&
|
|
421
|
+
if (X >= r.length)
|
|
422
|
+
if (l.total && X >= l.total) {
|
|
413
423
|
if (r.length > 0) {
|
|
414
|
-
const
|
|
415
|
-
|
|
424
|
+
const B = r.length - 1;
|
|
425
|
+
_(r, B, l.current || 1, n);
|
|
416
426
|
}
|
|
417
427
|
D.error("已经是最后一个了");
|
|
418
428
|
} else
|
|
419
|
-
|
|
429
|
+
A({
|
|
420
430
|
current: l.current + 1,
|
|
421
431
|
pageSize: l.pageSize,
|
|
422
432
|
type: "next"
|
|
423
|
-
}, r).then((
|
|
424
|
-
Array.isArray(
|
|
433
|
+
}, r).then((B) => {
|
|
434
|
+
Array.isArray(B) && _(B, X, l.current + 1, n);
|
|
425
435
|
});
|
|
426
436
|
else
|
|
427
|
-
|
|
437
|
+
_(r, X, l.current || 1, n);
|
|
428
438
|
}
|
|
429
439
|
return s || r;
|
|
430
440
|
})), i));
|
|
431
|
-
},
|
|
441
|
+
}, Pt = (e) => {
|
|
432
442
|
if (!v)
|
|
433
443
|
return;
|
|
434
|
-
const t = ++
|
|
435
|
-
if (!
|
|
436
|
-
|
|
444
|
+
const t = ++Z.current;
|
|
445
|
+
if (!he) {
|
|
446
|
+
U((n) => {
|
|
437
447
|
if (!Array.isArray(n) || !n.length)
|
|
438
|
-
return
|
|
439
|
-
const i =
|
|
440
|
-
return i < 0 ? D.error("已经是第一个了") :
|
|
448
|
+
return te(), n;
|
|
449
|
+
const i = M - 1;
|
|
450
|
+
return i < 0 ? D.error("已经是第一个了") : _(n, i, l.current || 1, t), n;
|
|
441
451
|
});
|
|
442
452
|
return;
|
|
443
453
|
}
|
|
444
|
-
|
|
445
|
-
n && t ===
|
|
454
|
+
xe(e).then((n) => {
|
|
455
|
+
n && t === Z.current && (w(), U((i) => {
|
|
446
456
|
let r;
|
|
447
457
|
if (Array.isArray(i)) {
|
|
448
458
|
if (!i.length)
|
|
449
|
-
return
|
|
450
|
-
const s =
|
|
459
|
+
return te(), i;
|
|
460
|
+
const s = M - 1;
|
|
451
461
|
if (s < 0)
|
|
452
462
|
s < 0 ? D.error("已经是第一个了") : T({
|
|
453
463
|
current: l.current - 1,
|
|
@@ -455,79 +465,91 @@ const Xn = (L) => {
|
|
|
455
465
|
type: "prev"
|
|
456
466
|
});
|
|
457
467
|
else {
|
|
458
|
-
if (
|
|
459
|
-
const
|
|
460
|
-
|
|
468
|
+
if (d && (d.labels.length && h === "nocode" || !d.labels.length && h === "hascode")) {
|
|
469
|
+
const f = i.findIndex((S) => S.id === d.id);
|
|
470
|
+
f > -1 && (i.splice(f, 1), r = [...i], l.total && (l.total = l.total - 1));
|
|
461
471
|
}
|
|
462
|
-
|
|
472
|
+
_(i, s, l.current || 1, t);
|
|
463
473
|
}
|
|
464
474
|
}
|
|
465
475
|
return r || i;
|
|
466
476
|
}));
|
|
467
477
|
});
|
|
468
|
-
},
|
|
478
|
+
}, Vt = (e) => {
|
|
469
479
|
const t = Object.keys(e.labels.reduce((n, i) => (n[i.label] ? ++n[i.label] : n[i.label] = 1, n), {})).length;
|
|
470
480
|
return t >= 2 ? `+${t - 1}` : null;
|
|
471
|
-
},
|
|
472
|
-
var k,
|
|
481
|
+
}, zt = (e) => {
|
|
482
|
+
var k, E;
|
|
473
483
|
const {
|
|
474
484
|
scrollTop: t,
|
|
475
485
|
scrollHeight: n,
|
|
476
486
|
clientHeight: i
|
|
477
|
-
} = e.currentTarget, r = n - t - i, s = 3,
|
|
478
|
-
S >= 1 && v.length > 0 && v.length < S *
|
|
479
|
-
var
|
|
480
|
-
return y(b({},
|
|
481
|
-
current: ((
|
|
487
|
+
} = e.currentTarget, r = n - t - i, s = 3, f = (k = l.pageSize) != null ? k : 100, S = (E = l.current) != null ? E : 0;
|
|
488
|
+
S >= 1 && v.length > 0 && v.length < S * f || (!l.total || l.total > v.length) && r <= s && T((K) => {
|
|
489
|
+
var F;
|
|
490
|
+
return y(b({}, K), {
|
|
491
|
+
current: ((F = K.current) != null ? F : 0) + 1
|
|
482
492
|
});
|
|
483
493
|
});
|
|
484
|
-
},
|
|
494
|
+
}, xe = (e, t) => {
|
|
485
495
|
var n, i;
|
|
486
496
|
if (!o)
|
|
487
497
|
return Promise.resolve(!1);
|
|
488
|
-
if (
|
|
489
|
-
const r = y(b({},
|
|
490
|
-
labels:
|
|
498
|
+
if (d && !H) {
|
|
499
|
+
const r = y(b({}, d), {
|
|
500
|
+
labels: d.labels ? [...d.labels] : []
|
|
491
501
|
});
|
|
492
|
-
return r.labels && (r.labels = r.labels.filter((s) => !!s.id)), e !== void 0 && (r.confirmStatus = e, r.isLabeled = ((n = r.labels) == null ? void 0 : n.length) > 0), g.cvforceDatahub.updateSamples(
|
|
502
|
+
return r.labels && (r.labels = r.labels.filter((s) => !!s.id)), e !== void 0 && (r.confirmStatus = e, r.isLabeled = ((n = r.labels) == null ? void 0 : n.length) > 0), g.cvforceDatahub.updateSamples(c, o.id, [r], e).then(() => {
|
|
493
503
|
D.success({
|
|
494
504
|
content: "保存成功"
|
|
495
505
|
});
|
|
496
506
|
const s = y(b({}, r), {
|
|
497
507
|
labels: r.labels ? [...r.labels] : []
|
|
498
508
|
});
|
|
499
|
-
return
|
|
500
|
-
const S =
|
|
509
|
+
return U((f) => {
|
|
510
|
+
const S = f.findIndex((k) => k.id === (s == null ? void 0 : s.id));
|
|
501
511
|
if (S > -1) {
|
|
502
|
-
const k = [...
|
|
512
|
+
const k = [...f];
|
|
503
513
|
return k[S] = s, k;
|
|
504
514
|
}
|
|
505
|
-
return
|
|
506
|
-
}), R(s),
|
|
515
|
+
return f;
|
|
516
|
+
}), R(s), z(s), !0;
|
|
507
517
|
}).catch(() => !1);
|
|
508
518
|
} else
|
|
509
|
-
return !
|
|
519
|
+
return !d && !H && u ? t !== "CONFIRM" && h === "pending" || h === "nocode" || h === "hascode" || h === "" && (u.confirmStatus !== 1 || t !== "CONFIRM") ? Promise.resolve(!0) : (u.labels && (u.labels = u.labels.filter((r) => !!r.id)), e !== void 0 && (u.confirmStatus = e, u.isLabeled = ((i = u.labels) == null ? void 0 : i.length) > 0), g.cvforceDatahub.updateSamples(c, o.id, [u], e).then(() => (D.success({
|
|
510
520
|
content: "保存成功"
|
|
511
|
-
}),
|
|
512
|
-
const s = r.findIndex((
|
|
521
|
+
}), U((r) => {
|
|
522
|
+
const s = r.findIndex((f) => f.id === (u == null ? void 0 : u.id));
|
|
513
523
|
return s > -1 && (r[s] = u), [...r];
|
|
514
524
|
}), R(b({}, u)), !0)).catch(() => !1)) : Promise.resolve(!0);
|
|
515
|
-
},
|
|
516
|
-
if (
|
|
525
|
+
}, At = (e, t) => {
|
|
526
|
+
if (d && d.labels.some((n) => !n.id))
|
|
517
527
|
return D.error("所有标注需设置标签"), Promise.resolve(!1);
|
|
518
|
-
|
|
519
|
-
},
|
|
520
|
-
|
|
528
|
+
Ye(e, t);
|
|
529
|
+
}, Et = (e) => {
|
|
530
|
+
if (d && d.labels.some((t) => !t.id)) {
|
|
531
|
+
D.error("所有标注需设置标签");
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
534
|
+
if (!d) {
|
|
535
|
+
j(!1);
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
xe(e).then((t) => {
|
|
539
|
+
t && (z(void 0), j(!1), w(), q());
|
|
540
|
+
});
|
|
541
|
+
}, Bt = () => {
|
|
542
|
+
ke.confirm({
|
|
521
543
|
title: "确认要删除当前数据吗?",
|
|
522
544
|
content: "数据包含当前标注的内容和图片,删除后无法恢复,请确认是否删除!",
|
|
523
545
|
onOk: () => {
|
|
524
|
-
!u || !o || g.cvforceDatahub.delDatasetsIdVersionsVidSamplesId(
|
|
546
|
+
!u || !o || g.cvforceDatahub.delDatasetsIdVersionsVidSamplesId(c, o.id, u.id).then(() => {
|
|
525
547
|
const e = v.findIndex((n) => n.id === u.id);
|
|
526
548
|
v.splice(e, 1);
|
|
527
549
|
const t = v.length;
|
|
528
|
-
|
|
550
|
+
U([...v]), T(y(b({}, l), {
|
|
529
551
|
total: l.total ? l.total - 1 : 0
|
|
530
|
-
})), e <= v.length - 1 ? R(v[e]) : (R(v[e - 1]),
|
|
552
|
+
})), e <= v.length - 1 ? R(v[e]) : (R(v[e - 1]), V(e - 1)), w(), z(void 0), (t === 0 || l.total && l.total - 1 === 0) && (R(void 0), z(void 0), V(-1), he || ue(!1), setTimeout(() => {
|
|
531
553
|
T((n) => y(b({}, n), {
|
|
532
554
|
current: 1,
|
|
533
555
|
type: void 0
|
|
@@ -536,67 +558,67 @@ const Xn = (L) => {
|
|
|
536
558
|
});
|
|
537
559
|
}
|
|
538
560
|
});
|
|
539
|
-
},
|
|
561
|
+
}, et = [{
|
|
540
562
|
key: "",
|
|
541
|
-
label: `全部(${
|
|
563
|
+
label: `全部(${Q})`,
|
|
542
564
|
children: null
|
|
543
565
|
}, {
|
|
544
566
|
key: "nocode",
|
|
545
|
-
label: `未标注(${
|
|
567
|
+
label: `未标注(${de})`,
|
|
546
568
|
children: null
|
|
547
569
|
}, {
|
|
548
570
|
key: "pending",
|
|
549
|
-
label: `待确认(${
|
|
571
|
+
label: `待确认(${fe})`,
|
|
550
572
|
children: null
|
|
551
573
|
}, {
|
|
552
574
|
key: "hascode",
|
|
553
|
-
label: `已标注(${
|
|
575
|
+
label: `已标注(${Q - de - fe})`,
|
|
554
576
|
children: null
|
|
555
|
-
}],
|
|
577
|
+
}], Mt = () => {
|
|
556
578
|
var e, t;
|
|
557
|
-
(t = (e =
|
|
579
|
+
(t = (e = ae.current) == null ? void 0 : e.getElementsByClassName("rc-virtual-list-holder")[0]) == null || t.scrollTo({
|
|
558
580
|
top: 0
|
|
559
581
|
});
|
|
560
|
-
},
|
|
561
|
-
|
|
562
|
-
},
|
|
563
|
-
Se.current++, Ce.current++,
|
|
564
|
-
index:
|
|
582
|
+
}, Ft = (e) => {
|
|
583
|
+
Dt(e), ne();
|
|
584
|
+
}, tt = (e) => {
|
|
585
|
+
Se.current++, Ce.current++, Z.current++, M >= 0 && h !== void 0 && h !== null && (ge.current[h] = {
|
|
586
|
+
index: M,
|
|
565
587
|
page: l.current || 1
|
|
566
|
-
}),
|
|
567
|
-
t ? (
|
|
588
|
+
}), ne(), d ? xe(d == null ? void 0 : d.confirmStatus).then((t) => {
|
|
589
|
+
t ? (we(e), w()) : D.error("保存失败");
|
|
568
590
|
}) : (T(y(b({}, l), {
|
|
569
591
|
current: 1,
|
|
570
592
|
total: void 0
|
|
571
|
-
})),
|
|
572
|
-
},
|
|
593
|
+
})), we(e)), e === "nocode" && Ne([]);
|
|
594
|
+
}, Ot = () => {
|
|
573
595
|
if (console.log("一键确认", g, o), !(g != null && g.cvforceDatahub) || !(o != null && o.id))
|
|
574
596
|
return Promise.resolve(!1);
|
|
575
|
-
|
|
597
|
+
ke.confirm({
|
|
576
598
|
title: "一键保存所有标注?",
|
|
577
599
|
content: "待确认的所有带预标注信息的图片将保存至已标注页签下",
|
|
578
600
|
onOk: () => {
|
|
579
|
-
g.cvforceDatahub.getAllConfirmSamples(
|
|
580
|
-
D.success("保存成功"),
|
|
601
|
+
g.cvforceDatahub.getAllConfirmSamples(c, o.id).then((e) => {
|
|
602
|
+
D.success("保存成功"), A(y(b({}, l), {
|
|
581
603
|
current: 1
|
|
582
604
|
})), w();
|
|
583
605
|
});
|
|
584
606
|
}
|
|
585
607
|
});
|
|
586
|
-
},
|
|
587
|
-
const n = new Set(
|
|
608
|
+
}, Ht = (e, t) => {
|
|
609
|
+
const n = new Set(P);
|
|
588
610
|
t ? n.add(e) : n.delete(e), Ve(n);
|
|
589
|
-
},
|
|
590
|
-
const t = new Set(
|
|
611
|
+
}, Ut = (e) => {
|
|
612
|
+
const t = new Set(P);
|
|
591
613
|
e ? v.forEach((n) => {
|
|
592
614
|
t.add(n.id);
|
|
593
615
|
}) : v.forEach((n) => {
|
|
594
616
|
t.delete(n.id);
|
|
595
617
|
}), Ve(t), Ie(e);
|
|
596
|
-
},
|
|
618
|
+
}, ne = () => {
|
|
597
619
|
Ve(/* @__PURE__ */ new Set()), Ie(!1);
|
|
598
|
-
},
|
|
599
|
-
const e = v.filter((n) =>
|
|
620
|
+
}, nt = () => {
|
|
621
|
+
const e = v.filter((n) => P.has(n.id)), t = {
|
|
600
622
|
nocode: 0,
|
|
601
623
|
pending: 0,
|
|
602
624
|
hascode: 0
|
|
@@ -604,13 +626,13 @@ const Xn = (L) => {
|
|
|
604
626
|
return e.forEach((n) => {
|
|
605
627
|
n.confirmStatus === 1 ? t.pending++ : !n.labels || n.labels.length === 0 ? t.nocode++ : t.hascode++;
|
|
606
628
|
}), t;
|
|
607
|
-
},
|
|
608
|
-
if (
|
|
629
|
+
}, qt = () => {
|
|
630
|
+
if (P.size === 0) {
|
|
609
631
|
D.warning("请先选择要删除的图片");
|
|
610
632
|
return;
|
|
611
633
|
}
|
|
612
|
-
const e =
|
|
613
|
-
children: [/* @__PURE__ */
|
|
634
|
+
const e = nt(), t = e.nocode > 0, n = e.pending > 0, i = e.hascode > 0, r = /* @__PURE__ */ m("div", {
|
|
635
|
+
children: [/* @__PURE__ */ a("p", {
|
|
614
636
|
style: {
|
|
615
637
|
marginBottom: 16
|
|
616
638
|
},
|
|
@@ -625,7 +647,7 @@ const Xn = (L) => {
|
|
|
625
647
|
alignItems: "center",
|
|
626
648
|
marginBottom: 4
|
|
627
649
|
},
|
|
628
|
-
children: [/* @__PURE__ */
|
|
650
|
+
children: [/* @__PURE__ */ a("span", {
|
|
629
651
|
style: {
|
|
630
652
|
display: "inline-block",
|
|
631
653
|
padding: "2px 8px",
|
|
@@ -645,7 +667,7 @@ const Xn = (L) => {
|
|
|
645
667
|
alignItems: "center",
|
|
646
668
|
marginBottom: 4
|
|
647
669
|
},
|
|
648
|
-
children: [/* @__PURE__ */
|
|
670
|
+
children: [/* @__PURE__ */ a("span", {
|
|
649
671
|
style: {
|
|
650
672
|
display: "inline-block",
|
|
651
673
|
padding: "2px 8px",
|
|
@@ -665,7 +687,7 @@ const Xn = (L) => {
|
|
|
665
687
|
alignItems: "center",
|
|
666
688
|
marginBottom: 4
|
|
667
689
|
},
|
|
668
|
-
children: [/* @__PURE__ */
|
|
690
|
+
children: [/* @__PURE__ */ a("span", {
|
|
669
691
|
style: {
|
|
670
692
|
display: "inline-block",
|
|
671
693
|
padding: "2px 8px",
|
|
@@ -680,43 +702,43 @@ const Xn = (L) => {
|
|
|
680
702
|
children: [e.hascode, "张"]
|
|
681
703
|
})]
|
|
682
704
|
})]
|
|
683
|
-
}), /* @__PURE__ */
|
|
705
|
+
}), /* @__PURE__ */ a("p", {
|
|
684
706
|
style: {
|
|
685
707
|
color: "red"
|
|
686
708
|
},
|
|
687
709
|
children: "彻底移除选中的图片文件及其关联的所有标注坐标、标签信息。数据不可恢复。"
|
|
688
710
|
})]
|
|
689
711
|
});
|
|
690
|
-
|
|
712
|
+
ke.confirm({
|
|
691
713
|
title: "删除操作确认",
|
|
692
714
|
content: r,
|
|
693
715
|
okText: "确定",
|
|
694
716
|
cancelText: "取消",
|
|
695
717
|
width: 500,
|
|
696
|
-
onOk: () =>
|
|
718
|
+
onOk: () => Be(void 0, null, function* () {
|
|
697
719
|
if (!o)
|
|
698
720
|
return;
|
|
699
|
-
const s = Array.from(
|
|
721
|
+
const s = Array.from(P);
|
|
700
722
|
if (s.length === 0) {
|
|
701
723
|
D.warning("没有选中的图片");
|
|
702
724
|
return;
|
|
703
725
|
}
|
|
704
726
|
try {
|
|
705
|
-
yield g.cvforceDatahub.delDatasetsIdVersionsVidSamples(
|
|
727
|
+
yield g.cvforceDatahub.delDatasetsIdVersionsVidSamples(c, o.id, s), D.success("删除成功"), ne(), A(y(b({}, l), {
|
|
706
728
|
current: 1
|
|
707
|
-
})), w(),
|
|
708
|
-
} catch (
|
|
729
|
+
})), w(), q();
|
|
730
|
+
} catch (f) {
|
|
709
731
|
D.error("删除失败");
|
|
710
732
|
}
|
|
711
733
|
})
|
|
712
734
|
});
|
|
713
|
-
},
|
|
714
|
-
if (
|
|
735
|
+
}, Kt = () => {
|
|
736
|
+
if (P.size === 0) {
|
|
715
737
|
D.warning("请先选择要清除标注的图片");
|
|
716
738
|
return;
|
|
717
739
|
}
|
|
718
|
-
const e =
|
|
719
|
-
children: [/* @__PURE__ */
|
|
740
|
+
const e = nt(), t = e.nocode > 0, n = e.pending > 0, i = e.hascode > 0, r = /* @__PURE__ */ m("div", {
|
|
741
|
+
children: [/* @__PURE__ */ a("p", {
|
|
720
742
|
style: {
|
|
721
743
|
marginBottom: 16
|
|
722
744
|
},
|
|
@@ -731,7 +753,7 @@ const Xn = (L) => {
|
|
|
731
753
|
alignItems: "center",
|
|
732
754
|
marginBottom: 4
|
|
733
755
|
},
|
|
734
|
-
children: [/* @__PURE__ */
|
|
756
|
+
children: [/* @__PURE__ */ a("span", {
|
|
735
757
|
style: {
|
|
736
758
|
display: "inline-block",
|
|
737
759
|
padding: "2px 8px",
|
|
@@ -751,7 +773,7 @@ const Xn = (L) => {
|
|
|
751
773
|
alignItems: "center",
|
|
752
774
|
marginBottom: 4
|
|
753
775
|
},
|
|
754
|
-
children: [/* @__PURE__ */
|
|
776
|
+
children: [/* @__PURE__ */ a("span", {
|
|
755
777
|
style: {
|
|
756
778
|
display: "inline-block",
|
|
757
779
|
padding: "2px 8px",
|
|
@@ -771,7 +793,7 @@ const Xn = (L) => {
|
|
|
771
793
|
alignItems: "center",
|
|
772
794
|
marginBottom: 4
|
|
773
795
|
},
|
|
774
|
-
children: [/* @__PURE__ */
|
|
796
|
+
children: [/* @__PURE__ */ a("span", {
|
|
775
797
|
style: {
|
|
776
798
|
display: "inline-block",
|
|
777
799
|
padding: "2px 8px",
|
|
@@ -786,44 +808,44 @@ const Xn = (L) => {
|
|
|
786
808
|
children: [e.hascode, "张"]
|
|
787
809
|
})]
|
|
788
810
|
})]
|
|
789
|
-
}), /* @__PURE__ */
|
|
811
|
+
}), /* @__PURE__ */ a("p", {
|
|
790
812
|
children: '保留图片文件,仅删除其内部的标注框(含 AI 预标注)。删除后图片状态变更为"未标注"。'
|
|
791
813
|
})]
|
|
792
814
|
});
|
|
793
|
-
|
|
815
|
+
ke.confirm({
|
|
794
816
|
title: "删除操作确认",
|
|
795
817
|
content: r,
|
|
796
818
|
okText: "确定",
|
|
797
819
|
cancelText: "取消",
|
|
798
820
|
width: 500,
|
|
799
|
-
onOk: () =>
|
|
821
|
+
onOk: () => Be(void 0, null, function* () {
|
|
800
822
|
if (!o)
|
|
801
823
|
return;
|
|
802
|
-
const s = v.filter((
|
|
824
|
+
const s = v.filter((f) => P.has(f.id));
|
|
803
825
|
if (s.length === 0) {
|
|
804
826
|
D.warning("没有选中的图片");
|
|
805
827
|
return;
|
|
806
828
|
}
|
|
807
829
|
try {
|
|
808
|
-
const
|
|
830
|
+
const f = s.map((S) => y(b({}, S), {
|
|
809
831
|
labels: [],
|
|
810
832
|
confirmStatus: 0,
|
|
811
833
|
isLabeled: !1
|
|
812
834
|
}));
|
|
813
|
-
yield g.cvforceDatahub.updateSamples(
|
|
835
|
+
yield g.cvforceDatahub.updateSamples(c, o.id, f, 0), D.success("清除标注成功"), ne(), A(y(b({}, l), {
|
|
814
836
|
current: 1
|
|
815
|
-
})), w(),
|
|
816
|
-
} catch (
|
|
837
|
+
})), w(), q();
|
|
838
|
+
} catch (f) {
|
|
817
839
|
D.error("清除标注失败");
|
|
818
840
|
}
|
|
819
841
|
})
|
|
820
842
|
});
|
|
821
843
|
};
|
|
822
|
-
return /* @__PURE__ */
|
|
823
|
-
locale:
|
|
824
|
-
children: /* @__PURE__ */
|
|
844
|
+
return /* @__PURE__ */ a(Jt, {
|
|
845
|
+
locale: sn,
|
|
846
|
+
children: /* @__PURE__ */ a(an.Provider, {
|
|
825
847
|
value: {
|
|
826
|
-
datasetId:
|
|
848
|
+
datasetId: c,
|
|
827
849
|
versionId: (o == null ? void 0 : o.id) || "",
|
|
828
850
|
no: (o == null ? void 0 : o.no) || "",
|
|
829
851
|
loading: Fe,
|
|
@@ -835,37 +857,37 @@ const Xn = (L) => {
|
|
|
835
857
|
featuresConfig: {
|
|
836
858
|
labelManager: be,
|
|
837
859
|
datasetManager: N,
|
|
838
|
-
annotation:
|
|
839
|
-
filterSwitch:
|
|
860
|
+
annotation: oe,
|
|
861
|
+
filterSwitch: se,
|
|
840
862
|
header: I,
|
|
841
|
-
exampleSrcRoot:
|
|
863
|
+
exampleSrcRoot: le
|
|
842
864
|
}
|
|
843
865
|
},
|
|
844
|
-
children: x ? x.markType === "detection" ? /* @__PURE__ */
|
|
866
|
+
children: x ? x.markType === "detection" ? /* @__PURE__ */ a("div", {
|
|
845
867
|
className: "detection-version-detail",
|
|
846
|
-
children:
|
|
847
|
-
datasetId:
|
|
868
|
+
children: kt ? o != null && o.id && N && N.preLabel ? /* @__PURE__ */ a(hn, {
|
|
869
|
+
datasetId: c,
|
|
848
870
|
versionId: o.id,
|
|
849
871
|
onClose: () => {
|
|
850
|
-
|
|
872
|
+
Lt(!1), ze(), q(), w(), A();
|
|
851
873
|
},
|
|
852
874
|
samples: v,
|
|
853
|
-
labels:
|
|
875
|
+
labels: O,
|
|
854
876
|
fetchLength: ze
|
|
855
|
-
}) : null : /* @__PURE__ */ m(
|
|
877
|
+
}) : null : /* @__PURE__ */ m(gn, {
|
|
856
878
|
className: "product-details-page",
|
|
857
|
-
header: I === !1 ? void 0 : /* @__PURE__ */
|
|
879
|
+
header: I === !1 ? void 0 : /* @__PURE__ */ a(mn, {
|
|
858
880
|
backTo: me,
|
|
859
881
|
onBackClick: I != null && I.onBackClick ? () => {
|
|
860
|
-
u &&
|
|
882
|
+
u && te(), I.onBackClick && I.onBackClick();
|
|
861
883
|
} : void 0,
|
|
862
884
|
left: !Fe && /* @__PURE__ */ m(pe, {
|
|
863
|
-
children: [/* @__PURE__ */
|
|
885
|
+
children: [/* @__PURE__ */ a("span", {
|
|
864
886
|
style: {
|
|
865
887
|
fontWeight: "bold"
|
|
866
888
|
},
|
|
867
889
|
children: x == null ? void 0 : x.name
|
|
868
|
-
}), /* @__PURE__ */
|
|
890
|
+
}), /* @__PURE__ */ a(Qt, {
|
|
869
891
|
disabled: (I == null ? void 0 : I.versionSelect) === !1,
|
|
870
892
|
value: o == null ? void 0 : o.id,
|
|
871
893
|
style: {
|
|
@@ -880,32 +902,32 @@ const Xn = (L) => {
|
|
|
880
902
|
if (!x || !t)
|
|
881
903
|
return;
|
|
882
904
|
const n = ve.find((i) => i.id === t.id);
|
|
883
|
-
|
|
905
|
+
ce(n), ne(), I != null && I.onVersionChange && I.onVersionChange(n);
|
|
884
906
|
}
|
|
885
907
|
})]
|
|
886
908
|
}),
|
|
887
909
|
right: /* @__PURE__ */ m(pe, {
|
|
888
|
-
children: [!u && N && N.add && /* @__PURE__ */
|
|
910
|
+
children: [!u && N && N.add && /* @__PURE__ */ a(ct, {
|
|
889
911
|
isPreLabel: H,
|
|
890
912
|
placement: "bottom",
|
|
891
|
-
children: /* @__PURE__ */
|
|
913
|
+
children: /* @__PURE__ */ a(ie, {
|
|
892
914
|
type: "default",
|
|
893
|
-
onClick: () =>
|
|
894
|
-
disabled:
|
|
915
|
+
onClick: () => De(!0),
|
|
916
|
+
disabled: G === re.Pending || G === re.Started || H,
|
|
895
917
|
children: "导入数据"
|
|
896
918
|
}, "del")
|
|
897
|
-
}), /* @__PURE__ */
|
|
919
|
+
}), /* @__PURE__ */ a(lt, {
|
|
898
920
|
menu: {
|
|
899
921
|
items: [{
|
|
900
922
|
key: "manual",
|
|
901
|
-
label: /* @__PURE__ */
|
|
923
|
+
label: /* @__PURE__ */ a(ct, {
|
|
902
924
|
isPreLabel: H,
|
|
903
|
-
children: /* @__PURE__ */
|
|
904
|
-
children: N && N.label && /* @__PURE__ */
|
|
925
|
+
children: /* @__PURE__ */ a(pe, {
|
|
926
|
+
children: N && N.label && /* @__PURE__ */ a(ie, {
|
|
905
927
|
type: "text",
|
|
906
928
|
disabled: H,
|
|
907
929
|
onClick: () => {
|
|
908
|
-
u ||
|
|
930
|
+
u || we("nocode"), j(!0), V(-1), h === "nocode" && (V(0), R(v[0])), ue(!0);
|
|
909
931
|
},
|
|
910
932
|
children: "人工标注"
|
|
911
933
|
})
|
|
@@ -913,47 +935,47 @@ const Xn = (L) => {
|
|
|
913
935
|
})
|
|
914
936
|
}, !u && N && N.preLabel && (o != null && o.id) ? {
|
|
915
937
|
key: "auto",
|
|
916
|
-
label: /* @__PURE__ */
|
|
938
|
+
label: /* @__PURE__ */ a(Sn, {
|
|
917
939
|
buttonType: "text",
|
|
918
|
-
datasetId:
|
|
940
|
+
datasetId: c,
|
|
919
941
|
versionId: o.id,
|
|
920
942
|
disabled: !v.length,
|
|
921
|
-
setIsTaskChange:
|
|
943
|
+
setIsTaskChange: xt,
|
|
922
944
|
datasetType: "detection",
|
|
923
|
-
preLabelTask:
|
|
945
|
+
preLabelTask: Ze
|
|
924
946
|
})
|
|
925
947
|
} : null]
|
|
926
948
|
},
|
|
927
949
|
placement: "bottom",
|
|
928
|
-
children: /* @__PURE__ */ m(
|
|
950
|
+
children: /* @__PURE__ */ m(ie, {
|
|
929
951
|
type: "primary",
|
|
930
|
-
children: ["开始标注", /* @__PURE__ */
|
|
952
|
+
children: ["开始标注", /* @__PURE__ */ a(dt, {})]
|
|
931
953
|
})
|
|
932
|
-
}), /* @__PURE__ */
|
|
933
|
-
when:
|
|
954
|
+
}), /* @__PURE__ */ a(yn, {
|
|
955
|
+
when: vt,
|
|
934
956
|
content: "确认要离开此页面吗?",
|
|
935
957
|
subContent: "离开此页面后,将结束导入,放弃未上传的文件,请谨慎操作!"
|
|
936
|
-
}), Ke && /* @__PURE__ */
|
|
937
|
-
datasetIam:
|
|
938
|
-
datasetId:
|
|
958
|
+
}), Ke && /* @__PURE__ */ a(pn, {
|
|
959
|
+
datasetIam: gt,
|
|
960
|
+
datasetId: c,
|
|
939
961
|
currentVersion: o,
|
|
940
962
|
tenCode: x == null ? void 0 : x.tenantCode,
|
|
941
963
|
isVisible: Ke,
|
|
942
|
-
setIsVisible:
|
|
964
|
+
setIsVisible: De,
|
|
943
965
|
getVersionListRequest: w,
|
|
944
|
-
setIsConfirm:
|
|
966
|
+
setIsConfirm: bt,
|
|
945
967
|
onUploadStatusChange: (e) => {
|
|
946
|
-
|
|
968
|
+
mt(e);
|
|
947
969
|
},
|
|
948
970
|
tableReload: () => {
|
|
949
971
|
var e, t, n;
|
|
950
|
-
o != null && o.id && ((t = (e =
|
|
972
|
+
o != null && o.id && ((t = (e = ae.current) == null ? void 0 : e.getElementsByClassName("rc-virtual-list-holder")[0]) == null || t.scrollTo({
|
|
951
973
|
top: 0
|
|
952
|
-
}),
|
|
974
|
+
}), A(y(b({}, l), {
|
|
953
975
|
current: 1
|
|
954
|
-
})), (n =
|
|
976
|
+
})), (n = Le.current) == null || n.fetchLabels());
|
|
955
977
|
},
|
|
956
|
-
loadVersionData:
|
|
978
|
+
loadVersionData: Qe,
|
|
957
979
|
markType: x.markType
|
|
958
980
|
})]
|
|
959
981
|
})
|
|
@@ -961,55 +983,55 @@ const Xn = (L) => {
|
|
|
961
983
|
children: [/* @__PURE__ */ m("div", {
|
|
962
984
|
className: "detection-header",
|
|
963
985
|
children: [/* @__PURE__ */ m(pe, {
|
|
964
|
-
children: [
|
|
986
|
+
children: [se.tabs && /* @__PURE__ */ a(Yt, {
|
|
965
987
|
className: "header-tab",
|
|
966
|
-
activeKey:
|
|
967
|
-
items:
|
|
968
|
-
onChange:
|
|
969
|
-
}), !u &&
|
|
988
|
+
activeKey: h,
|
|
989
|
+
items: et,
|
|
990
|
+
onChange: tt
|
|
991
|
+
}), !u && se.search && /* @__PURE__ */ a(vn, {
|
|
970
992
|
placeholder: "请输入图片名称搜索",
|
|
971
993
|
style: {
|
|
972
994
|
width: 200
|
|
973
995
|
},
|
|
974
|
-
suffix: /* @__PURE__ */
|
|
975
|
-
value:
|
|
976
|
-
onChange:
|
|
996
|
+
suffix: /* @__PURE__ */ a(un, {}),
|
|
997
|
+
value: ee,
|
|
998
|
+
onChange: Ft,
|
|
977
999
|
allowClear: !0
|
|
978
|
-
}), !u && /* @__PURE__ */
|
|
1000
|
+
}), !u && /* @__PURE__ */ a(lt, {
|
|
979
1001
|
menu: {
|
|
980
1002
|
items: [{
|
|
981
1003
|
key: "deleteWithAnnotations",
|
|
982
1004
|
label: "删除所选图片(含标注)",
|
|
983
|
-
onClick:
|
|
1005
|
+
onClick: qt
|
|
984
1006
|
}, {
|
|
985
1007
|
key: "clearAnnotations",
|
|
986
1008
|
label: "仅清除所选图片内的标注",
|
|
987
|
-
onClick:
|
|
1009
|
+
onClick: Kt
|
|
988
1010
|
}]
|
|
989
1011
|
},
|
|
990
|
-
disabled:
|
|
991
|
-
children: /* @__PURE__ */ m(
|
|
1012
|
+
disabled: P.size === 0,
|
|
1013
|
+
children: /* @__PURE__ */ m(ie, {
|
|
992
1014
|
size: "middle",
|
|
993
|
-
disabled:
|
|
994
|
-
children: ["删除", /* @__PURE__ */
|
|
1015
|
+
disabled: P.size === 0,
|
|
1016
|
+
children: ["删除", /* @__PURE__ */ a(dt, {})]
|
|
995
1017
|
})
|
|
996
|
-
}), !u && /* @__PURE__ */ m(
|
|
997
|
-
children: [/* @__PURE__ */
|
|
998
|
-
checked:
|
|
999
|
-
onChange: (e) =>
|
|
1018
|
+
}), !u && /* @__PURE__ */ m(ot, {
|
|
1019
|
+
children: [/* @__PURE__ */ a(st, {
|
|
1020
|
+
checked: Nt,
|
|
1021
|
+
onChange: (e) => Ut(e.target.checked),
|
|
1000
1022
|
children: "选择当前页"
|
|
1001
|
-
}),
|
|
1023
|
+
}), P.size > 0 && /* @__PURE__ */ m("span", {
|
|
1002
1024
|
style: {
|
|
1003
1025
|
color: "#666"
|
|
1004
1026
|
},
|
|
1005
|
-
children: ["已选中",
|
|
1027
|
+
children: ["已选中", P.size, "张,共", l.total || 0, "张"]
|
|
1006
1028
|
})]
|
|
1007
1029
|
})]
|
|
1008
|
-
}), /* @__PURE__ */
|
|
1009
|
-
children:
|
|
1030
|
+
}), /* @__PURE__ */ a(pe, {
|
|
1031
|
+
children: h === "pending" && /* @__PURE__ */ a(ie, {
|
|
1010
1032
|
type: "primary",
|
|
1011
1033
|
className: "pending-confirm-button",
|
|
1012
|
-
onClick:
|
|
1034
|
+
onClick: Ot,
|
|
1013
1035
|
children: "一键确认"
|
|
1014
1036
|
})
|
|
1015
1037
|
})]
|
|
@@ -1017,97 +1039,99 @@ const Xn = (L) => {
|
|
|
1017
1039
|
className: "d-row",
|
|
1018
1040
|
children: [/* @__PURE__ */ m("div", {
|
|
1019
1041
|
className: "d-right",
|
|
1020
|
-
ref:
|
|
1021
|
-
children: [
|
|
1022
|
-
datasetId:
|
|
1023
|
-
isImageDetailVisible:
|
|
1042
|
+
ref: ae,
|
|
1043
|
+
children: [Y && /* @__PURE__ */ a(kn, {
|
|
1044
|
+
datasetId: c,
|
|
1045
|
+
isImageDetailVisible: Y,
|
|
1024
1046
|
setIsImageDetailVisible: ue,
|
|
1025
|
-
currentSample:
|
|
1026
|
-
labels:
|
|
1027
|
-
previewMode: !
|
|
1028
|
-
filterItems:
|
|
1029
|
-
filterMode:
|
|
1030
|
-
onFilterChange:
|
|
1031
|
-
onChange:
|
|
1032
|
-
onNextClick: (e) =>
|
|
1033
|
-
onPrevClick: (e) =>
|
|
1034
|
-
onSave: (e, t) =>
|
|
1035
|
-
onDeleteSample: () =>
|
|
1047
|
+
currentSample: d != null ? d : u,
|
|
1048
|
+
labels: O,
|
|
1049
|
+
previewMode: !he,
|
|
1050
|
+
filterItems: et,
|
|
1051
|
+
filterMode: h,
|
|
1052
|
+
onFilterChange: tt,
|
|
1053
|
+
onChange: z,
|
|
1054
|
+
onNextClick: (e) => Ye(e),
|
|
1055
|
+
onPrevClick: (e) => Pt(e),
|
|
1056
|
+
onSave: (e, t) => At(e, t),
|
|
1057
|
+
onDeleteSample: () => Bt(),
|
|
1036
1058
|
onEnterEdit: () => {
|
|
1037
|
-
|
|
1059
|
+
j(!0);
|
|
1038
1060
|
},
|
|
1061
|
+
onBackToDetail: (e) => Et(e),
|
|
1062
|
+
onLoadingChange: Rt,
|
|
1039
1063
|
onRefresh: () => {
|
|
1040
1064
|
var e;
|
|
1041
|
-
(e =
|
|
1065
|
+
(e = q()) == null || e.then((t) => {
|
|
1042
1066
|
var n, i;
|
|
1043
|
-
if (
|
|
1067
|
+
if (d) {
|
|
1044
1068
|
const r = [];
|
|
1045
|
-
(n =
|
|
1046
|
-
t != null && t.find((
|
|
1047
|
-
}),
|
|
1069
|
+
(n = d.labels) == null || n.forEach((s) => {
|
|
1070
|
+
t != null && t.find((f) => f.id === s.id) && r.push(s);
|
|
1071
|
+
}), d.labels = r, z(b({}, d));
|
|
1048
1072
|
}
|
|
1049
1073
|
if (u) {
|
|
1050
1074
|
const r = [];
|
|
1051
1075
|
(i = u.labels) == null || i.forEach((s) => {
|
|
1052
|
-
t != null && t.find((
|
|
1076
|
+
t != null && t.find((f) => f.id === s.id) && r.push(s);
|
|
1053
1077
|
}), u.labels = r, R(b({}, u));
|
|
1054
1078
|
}
|
|
1055
1079
|
}), w();
|
|
1056
1080
|
},
|
|
1057
1081
|
isPreLabel: H,
|
|
1058
1082
|
imgCount: {
|
|
1059
|
-
total:
|
|
1060
|
-
index:
|
|
1083
|
+
total: Q,
|
|
1084
|
+
index: M + 1
|
|
1061
1085
|
},
|
|
1062
1086
|
settingHide: !be,
|
|
1063
1087
|
canLabel: !!(N && N.label),
|
|
1064
1088
|
canDelete: !!(N && N.delete)
|
|
1065
|
-
}), l.total !== void 0 && l.total > 0 ? /* @__PURE__ */
|
|
1066
|
-
children: /* @__PURE__ */
|
|
1089
|
+
}), l.total !== void 0 && l.total > 0 ? /* @__PURE__ */ a(ot, {
|
|
1090
|
+
children: /* @__PURE__ */ a(on, {
|
|
1067
1091
|
innerProps: {
|
|
1068
1092
|
className: "d-right-row"
|
|
1069
1093
|
},
|
|
1070
1094
|
data: v,
|
|
1071
1095
|
itemKey: "id",
|
|
1072
|
-
height: Math.max(
|
|
1073
|
-
onScroll:
|
|
1096
|
+
height: Math.max(ft, 1),
|
|
1097
|
+
onScroll: zt,
|
|
1074
1098
|
children: (e, t) => {
|
|
1075
1099
|
var n;
|
|
1076
|
-
return /* @__PURE__ */
|
|
1100
|
+
return /* @__PURE__ */ a(en, {
|
|
1077
1101
|
className: "d-right-col",
|
|
1078
1102
|
"data-sample-id": e.id,
|
|
1079
1103
|
children: /* @__PURE__ */ m("div", {
|
|
1080
1104
|
className: "right-col-wrapper",
|
|
1081
|
-
onMouseEnter: () =>
|
|
1082
|
-
onMouseLeave: () =>
|
|
1083
|
-
children: [/* @__PURE__ */
|
|
1105
|
+
onMouseEnter: () => Te(e.id),
|
|
1106
|
+
onMouseLeave: () => Te(""),
|
|
1107
|
+
children: [/* @__PURE__ */ a("div", {
|
|
1084
1108
|
className: "detection-status-wrapper",
|
|
1085
|
-
children: /* @__PURE__ */
|
|
1109
|
+
children: /* @__PURE__ */ a(xn, {
|
|
1086
1110
|
sample: e
|
|
1087
1111
|
})
|
|
1088
|
-
}), /* @__PURE__ */
|
|
1112
|
+
}), /* @__PURE__ */ a("div", {
|
|
1089
1113
|
className: "sample-checkbox-wrapper",
|
|
1090
|
-
children: /* @__PURE__ */
|
|
1091
|
-
checked:
|
|
1114
|
+
children: /* @__PURE__ */ a(st, {
|
|
1115
|
+
checked: P.has(e.id),
|
|
1092
1116
|
onChange: (i) => {
|
|
1093
|
-
i.stopPropagation(),
|
|
1117
|
+
i.stopPropagation(), Ht(e.id, i.target.checked);
|
|
1094
1118
|
},
|
|
1095
1119
|
onClick: (i) => i.stopPropagation()
|
|
1096
1120
|
})
|
|
1097
|
-
}), /* @__PURE__ */
|
|
1121
|
+
}), /* @__PURE__ */ a("div", {
|
|
1098
1122
|
className: "right-col-img",
|
|
1099
|
-
onClick: () =>
|
|
1100
|
-
children: /* @__PURE__ */
|
|
1123
|
+
onClick: () => Tt(t),
|
|
1124
|
+
children: /* @__PURE__ */ a(bn, {
|
|
1101
1125
|
fileKey: e.fileKey,
|
|
1102
1126
|
width: 124,
|
|
1103
1127
|
thumbnailUrl: e.thumbnailUrl
|
|
1104
1128
|
})
|
|
1105
1129
|
}), /* @__PURE__ */ m("div", {
|
|
1106
1130
|
className: "right-col-text",
|
|
1107
|
-
children: [(n = e.labels) != null && n.length ? /* @__PURE__ */
|
|
1131
|
+
children: [(n = e.labels) != null && n.length ? /* @__PURE__ */ a(tn, {
|
|
1108
1132
|
placement: "top",
|
|
1109
|
-
title: /* @__PURE__ */
|
|
1110
|
-
children: Object.keys(e.labels.reduce((i, r) => (i[r.label] ? ++i[r.label] : i[r.label] = 1, i), {})).map((i) => /* @__PURE__ */
|
|
1133
|
+
title: /* @__PURE__ */ a("div", {
|
|
1134
|
+
children: Object.keys(e.labels.reduce((i, r) => (i[r.label] ? ++i[r.label] : i[r.label] = 1, i), {})).map((i) => /* @__PURE__ */ a("div", {
|
|
1111
1135
|
children: i
|
|
1112
1136
|
}, i))
|
|
1113
1137
|
}),
|
|
@@ -1116,7 +1140,7 @@ const Xn = (L) => {
|
|
|
1116
1140
|
width: "100%",
|
|
1117
1141
|
display: "flex"
|
|
1118
1142
|
},
|
|
1119
|
-
children: [/* @__PURE__ */
|
|
1143
|
+
children: [/* @__PURE__ */ a("span", {
|
|
1120
1144
|
style: {
|
|
1121
1145
|
display: "inline-block",
|
|
1122
1146
|
maxWidth: "calc(100% - 25px)",
|
|
@@ -1125,21 +1149,21 @@ const Xn = (L) => {
|
|
|
1125
1149
|
whiteSpace: "nowrap"
|
|
1126
1150
|
},
|
|
1127
1151
|
children: e.labels[0].label
|
|
1128
|
-
}), e.labels.length > 1 ? /* @__PURE__ */
|
|
1152
|
+
}), e.labels.length > 1 ? /* @__PURE__ */ a("span", {
|
|
1129
1153
|
style: {
|
|
1130
1154
|
color: "rgba(0,0,0,0.45)",
|
|
1131
1155
|
marginLeft: 5
|
|
1132
1156
|
},
|
|
1133
|
-
children:
|
|
1157
|
+
children: Vt(e)
|
|
1134
1158
|
}) : null]
|
|
1135
1159
|
})
|
|
1136
|
-
}) : /* @__PURE__ */
|
|
1160
|
+
}) : /* @__PURE__ */ a("span", {
|
|
1137
1161
|
style: {
|
|
1138
1162
|
color: "rgba(0,0,0,0.45)",
|
|
1139
1163
|
width: "100%"
|
|
1140
1164
|
},
|
|
1141
1165
|
children: "无标签"
|
|
1142
|
-
}), /* @__PURE__ */
|
|
1166
|
+
}), /* @__PURE__ */ a("div", {
|
|
1143
1167
|
children: t + 1
|
|
1144
1168
|
})]
|
|
1145
1169
|
})]
|
|
@@ -1147,21 +1171,21 @@ const Xn = (L) => {
|
|
|
1147
1171
|
}, e.id);
|
|
1148
1172
|
}
|
|
1149
1173
|
})
|
|
1150
|
-
}) : /* @__PURE__ */
|
|
1174
|
+
}) : /* @__PURE__ */ a("div", {
|
|
1151
1175
|
className: "empty",
|
|
1152
|
-
children: l.total === 0 ? /* @__PURE__ */
|
|
1153
|
-
image:
|
|
1176
|
+
children: l.total === 0 ? /* @__PURE__ */ a(nn, {
|
|
1177
|
+
image: cn,
|
|
1154
1178
|
description: /* @__PURE__ */ m("span", {
|
|
1155
|
-
children: ["暂无数据",
|
|
1156
|
-
children: N && N.add && /* @__PURE__ */ m(
|
|
1179
|
+
children: ["暂无数据", h !== "hascode" && !ee && /* @__PURE__ */ a("span", {
|
|
1180
|
+
children: N && N.add && /* @__PURE__ */ m(ie, {
|
|
1157
1181
|
type: "link",
|
|
1158
1182
|
size: "small",
|
|
1159
1183
|
style: {
|
|
1160
1184
|
padding: 0
|
|
1161
1185
|
},
|
|
1162
|
-
onClick: () =>
|
|
1163
|
-
disabled:
|
|
1164
|
-
children: [/* @__PURE__ */
|
|
1186
|
+
onClick: () => De(!0),
|
|
1187
|
+
disabled: G === re.Pending || G === re.Started,
|
|
1188
|
+
children: [/* @__PURE__ */ a("span", {
|
|
1165
1189
|
style: {
|
|
1166
1190
|
color: "black"
|
|
1167
1191
|
},
|
|
@@ -1170,32 +1194,32 @@ const Xn = (L) => {
|
|
|
1170
1194
|
})
|
|
1171
1195
|
})]
|
|
1172
1196
|
})
|
|
1173
|
-
}) : /* @__PURE__ */
|
|
1197
|
+
}) : /* @__PURE__ */ a(rn, {})
|
|
1174
1198
|
})]
|
|
1175
|
-
}),
|
|
1199
|
+
}), h !== "nocode" && se.labels && /* @__PURE__ */ a("div", {
|
|
1176
1200
|
className: "d-sider",
|
|
1177
|
-
children: /* @__PURE__ */
|
|
1178
|
-
ref:
|
|
1179
|
-
datasetId:
|
|
1180
|
-
data:
|
|
1181
|
-
selected:
|
|
1201
|
+
children: /* @__PURE__ */ a(dn, {
|
|
1202
|
+
ref: Le,
|
|
1203
|
+
datasetId: c,
|
|
1204
|
+
data: O || [],
|
|
1205
|
+
selected: W,
|
|
1182
1206
|
onSelectedChange: (e) => {
|
|
1183
|
-
|
|
1207
|
+
ne(), Ne((O == null ? void 0 : O.filter((t) => e.find((n) => n.label === t.label))) || []);
|
|
1184
1208
|
},
|
|
1185
1209
|
onListChange: (e) => {
|
|
1186
1210
|
if (!o)
|
|
1187
1211
|
return;
|
|
1188
1212
|
let t = 2;
|
|
1189
|
-
|
|
1213
|
+
h === "pending" ? t = 1 : h === "hascode" && (t = 0), g.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(c, o.id, {
|
|
1190
1214
|
confirmStatus: t
|
|
1191
1215
|
}).then((n) => {
|
|
1192
|
-
const r = (n || []).filter((
|
|
1193
|
-
label:
|
|
1194
|
-
count:
|
|
1195
|
-
id:
|
|
1196
|
-
color:
|
|
1197
|
-
})), s =
|
|
1198
|
-
je(r),
|
|
1216
|
+
const r = (n || []).filter((f) => f.label !== "nocode").map((f, S) => ({
|
|
1217
|
+
label: f.label,
|
|
1218
|
+
count: f.count,
|
|
1219
|
+
id: f.id,
|
|
1220
|
+
color: at[S % 40]
|
|
1221
|
+
})), s = W.filter((f) => r.some((S) => S.id === f.id));
|
|
1222
|
+
je(r), W.length !== s.length && Ne(s);
|
|
1199
1223
|
}), w();
|
|
1200
1224
|
},
|
|
1201
1225
|
isPreLabel: H
|
|
@@ -1203,7 +1227,7 @@ const Xn = (L) => {
|
|
|
1203
1227
|
})]
|
|
1204
1228
|
})]
|
|
1205
1229
|
})
|
|
1206
|
-
}) : /* @__PURE__ */
|
|
1230
|
+
}) : /* @__PURE__ */ a("div", {
|
|
1207
1231
|
style: {
|
|
1208
1232
|
color: "red",
|
|
1209
1233
|
textAlign: "center"
|
|
@@ -1214,6 +1238,6 @@ const Xn = (L) => {
|
|
|
1214
1238
|
});
|
|
1215
1239
|
};
|
|
1216
1240
|
export {
|
|
1217
|
-
|
|
1218
|
-
|
|
1241
|
+
wn as ISampleActionType,
|
|
1242
|
+
ii as default
|
|
1219
1243
|
};
|