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