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