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