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