@glodon-aiot/dataset-annotation 3.25.0-alpha.9 → 3.25.0
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/index.mjs +410 -398
- package/dist/es/components/VLMAnnotationDetail/VLMDetail/index.mjs +235 -234
- package/dist/es/components/VLMAnnotationDetail/VlmModal/index.mjs +52 -51
- package/dist/es/components/VLMAnnotationDetail/index.mjs +318 -285
- package/dist/es/index.mjs +1 -1
- package/dist/lib/index.js +3 -3
- package/dist/src/components/VLMAnnotationDetail/VLMDetail/index.d.ts +1 -0
- package/dist/src/components/VLMAnnotationDetail/VlmModal/index.d.ts +1 -1
- 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,135 +1,135 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
import { jsx as
|
|
14
|
-
import { useState as
|
|
15
|
-
import { message as
|
|
16
|
-
import
|
|
1
|
+
var We = Object.defineProperty, Ge = Object.defineProperties;
|
|
2
|
+
var Je = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var ve = Object.getOwnPropertySymbols;
|
|
4
|
+
var Qe = Object.prototype.hasOwnProperty, Xe = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Se = (S, d, n) => d in S ? We(S, d, { enumerable: !0, configurable: !0, writable: !0, value: n }) : S[d] = n, f = (S, d) => {
|
|
6
|
+
for (var n in d || (d = {}))
|
|
7
|
+
Qe.call(d, n) && Se(S, n, d[n]);
|
|
8
|
+
if (ve)
|
|
9
|
+
for (var n of ve(d))
|
|
10
|
+
Xe.call(d, n) && Se(S, n, d[n]);
|
|
11
|
+
return S;
|
|
12
|
+
}, p = (S, d) => Ge(S, Je(d));
|
|
13
|
+
import { jsx as a, jsxs as T, Fragment as Ye } from "react/jsx-runtime";
|
|
14
|
+
import { useState as u, useRef as $, useLayoutEffect as et, useEffect as v } from "react";
|
|
15
|
+
import { message as ee, ConfigProvider as tt, Space as j, Select as rt, Button as te, Tabs as nt, Col as it, Empty as ot } from "antd";
|
|
16
|
+
import lt from "antd/es/locale/zh_CN";
|
|
17
17
|
import "./style.less.mjs";
|
|
18
|
-
import
|
|
19
|
-
import
|
|
18
|
+
import st from "./VlmModal/index.mjs";
|
|
19
|
+
import ct from "lodash/merge";
|
|
20
20
|
import { UploadZipsStatus as F } from "@glodon-aiot/apis";
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import { DEFAULT_FILTER_SWITCH as
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import { Prompt as
|
|
29
|
-
import
|
|
30
|
-
import { scrollSampleIntoView as
|
|
31
|
-
import { checkVlmSampleLabeled as
|
|
32
|
-
const
|
|
21
|
+
import at from "rc-virtual-list";
|
|
22
|
+
import dt from "../../Common/Page/index.mjs";
|
|
23
|
+
import ut from "../Thumbnail/index.mjs";
|
|
24
|
+
import mt from "../../DatasetContext/index.mjs";
|
|
25
|
+
import { DEFAULT_FILTER_SWITCH as ft } from "../../constant.mjs";
|
|
26
|
+
import ht from "../PageNav/index.mjs";
|
|
27
|
+
import pt from "../PicZipImportModal/index.mjs";
|
|
28
|
+
import { Prompt as gt } from "../hooks/Prompt.mjs";
|
|
29
|
+
import vt from "../DetectionAnnotation/icon_item_empty.svg.mjs";
|
|
30
|
+
import { scrollSampleIntoView as be, getVirtualListHolder as Ie } from "../../utils/scrollSampleIntoView.mjs";
|
|
31
|
+
import { checkVlmSampleLabeled as St } from "../../utils/checkVlmSampleLabeled.mjs";
|
|
32
|
+
const Bt = (S) => {
|
|
33
33
|
const {
|
|
34
|
-
services:
|
|
35
|
-
datasetId:
|
|
34
|
+
services: d,
|
|
35
|
+
datasetId: n,
|
|
36
36
|
versionId: H,
|
|
37
|
-
backTo:
|
|
37
|
+
backTo: ke,
|
|
38
38
|
labelManager: ye = !1,
|
|
39
|
-
datasetManager:
|
|
40
|
-
annotation:
|
|
41
|
-
header:
|
|
39
|
+
datasetManager: b = !1,
|
|
40
|
+
annotation: Ce,
|
|
41
|
+
header: g = {
|
|
42
42
|
versionSelect: !1
|
|
43
43
|
},
|
|
44
|
-
exampleSrcRoot:
|
|
45
|
-
apiUrl:
|
|
44
|
+
exampleSrcRoot: xe,
|
|
45
|
+
apiUrl: Te,
|
|
46
46
|
token: Le,
|
|
47
|
-
getToken:
|
|
48
|
-
} =
|
|
47
|
+
getToken: Ve
|
|
48
|
+
} = S, [s, W] = u(), [i, w] = u(), [B, re] = u([]), [ne, P] = u(!1), [ie, oe] = u(!1), [D, q] = u(!1), [Me, K] = u("preview"), [G, le] = u(0), [h, J] = u([]), [y, N] = u(), [we, se] = u(), [z, A] = u(-1), [o, I] = u({
|
|
49
49
|
current: 0,
|
|
50
50
|
pageSize: 100
|
|
51
|
-
}), [
|
|
52
|
-
|
|
51
|
+
}), [ce, ae] = u(0), [L, Q] = u(""), [V, De] = u(""), [Ne, ze] = u(), [de, X] = u(!1), [ue, Ae] = u(!1), [me, Re] = u(!0), [Ee, Fe] = u(!1), U = $(null), C = $(void 0), Z = $(void 0), [He, Ue] = u(0), fe = $(-1), Y = f({}, ft);
|
|
52
|
+
ct(Y, S.filterSwitch), et(() => {
|
|
53
53
|
const e = U.current;
|
|
54
54
|
if (!e)
|
|
55
55
|
return;
|
|
56
56
|
let t = 0;
|
|
57
|
-
const
|
|
57
|
+
const l = () => {
|
|
58
58
|
cancelAnimationFrame(t), t = requestAnimationFrame(() => {
|
|
59
|
-
const
|
|
60
|
-
|
|
59
|
+
const c = e.clientHeight, k = Math.max(1, Math.round(c));
|
|
60
|
+
k !== fe.current && (fe.current = k, Ue(k));
|
|
61
61
|
});
|
|
62
62
|
};
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
return
|
|
68
|
-
cancelAnimationFrame(t),
|
|
63
|
+
l();
|
|
64
|
+
const r = typeof ResizeObserver != "undefined" ? new ResizeObserver(l) : null;
|
|
65
|
+
r == null || r.observe(e);
|
|
66
|
+
const m = window.visualViewport;
|
|
67
|
+
return m == null || m.addEventListener("resize", l), window.addEventListener("resize", l), () => {
|
|
68
|
+
cancelAnimationFrame(t), r == null || r.disconnect(), m == null || m.removeEventListener("resize", l), window.removeEventListener("resize", l);
|
|
69
69
|
};
|
|
70
|
-
}, [
|
|
70
|
+
}, [s]);
|
|
71
71
|
const Be = () => {
|
|
72
|
-
|
|
72
|
+
Q("nocode"), K("annotation"), q(!0);
|
|
73
73
|
}, Pe = (e) => {
|
|
74
|
-
if (!
|
|
74
|
+
if (!h)
|
|
75
75
|
return;
|
|
76
76
|
A(e);
|
|
77
|
-
const t =
|
|
78
|
-
|
|
77
|
+
const t = h[e];
|
|
78
|
+
N(t), K("preview"), q(!0);
|
|
79
79
|
};
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
v(() => {
|
|
81
|
+
n && d.cvforceDatahub.getS3Iam(n).then((e) => {
|
|
82
|
+
ze(e);
|
|
83
83
|
});
|
|
84
|
-
}, [
|
|
85
|
-
!
|
|
84
|
+
}, [n]), v(() => {
|
|
85
|
+
!n || i || (P(!0), Promise.all([
|
|
86
86
|
// 数据集
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
d.cvforceDatahub.getDatasetsId(n).then((e) => {
|
|
88
|
+
W(e);
|
|
89
89
|
}),
|
|
90
90
|
// 版本列表
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
d.cvforceDatahub.getDatasetsIdVersions(n, 1, 1e3).then((e) => {
|
|
92
|
+
re(e.recordList), w(H ? e.recordList.find((t) => t.id === H) : e.recordList[0]);
|
|
93
93
|
})
|
|
94
|
-
]).finally(() =>
|
|
95
|
-
}, [
|
|
96
|
-
|
|
94
|
+
]).finally(() => P(!1)));
|
|
95
|
+
}, [n, i == null ? void 0 : i.id]), v(() => {
|
|
96
|
+
n && (P(!0), Promise.all([
|
|
97
97
|
// 数据集
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
d.cvforceDatahub.getDatasetsId(n).then((e) => {
|
|
99
|
+
W(e);
|
|
100
100
|
}),
|
|
101
101
|
// 版本列表
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
d.cvforceDatahub.getDatasetsIdVersions(n, 1, 1e3).then((e) => {
|
|
103
|
+
re(e.recordList), w(H ? e.recordList.find((t) => t.id === H) : e.recordList[0]);
|
|
104
104
|
})
|
|
105
|
-
]).finally(() =>
|
|
106
|
-
}, [
|
|
107
|
-
|
|
108
|
-
|
|
105
|
+
]).finally(() => P(!1)));
|
|
106
|
+
}, [n, H]), v(() => {
|
|
107
|
+
n && d.cvforceDatahub.getDatasetsId(n).then((e) => {
|
|
108
|
+
W(e);
|
|
109
109
|
});
|
|
110
110
|
}, []);
|
|
111
|
-
const
|
|
112
|
-
!
|
|
113
|
-
|
|
111
|
+
const he = () => {
|
|
112
|
+
!n || !i || d.cvforceDatahub.getDatasetsIdVersionsVid(n, i.id).then((e) => {
|
|
113
|
+
w(e), De(e.versionAsyncTask.state);
|
|
114
114
|
});
|
|
115
115
|
};
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}, [
|
|
119
|
-
|
|
120
|
-
}, [
|
|
121
|
-
Fe(!
|
|
122
|
-
}, [
|
|
116
|
+
v(() => {
|
|
117
|
+
he();
|
|
118
|
+
}, [n, i == null ? void 0 : i.id]), v(() => {
|
|
119
|
+
V !== F.Pending && V !== F.Started || ee.warning("文件导入中,请刷新页面再试");
|
|
120
|
+
}, [V]), v(() => {
|
|
121
|
+
Fe(!me && ue);
|
|
122
|
+
}, [me, ue]);
|
|
123
123
|
const R = () => {
|
|
124
|
-
!
|
|
125
|
-
const t = e.find((
|
|
126
|
-
|
|
124
|
+
!n || !i || d.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(n, i.id).then((e) => {
|
|
125
|
+
const t = e.find((r) => r.id === "allcodeid"), l = e.find((r) => r.id === "nocodeid");
|
|
126
|
+
le(t ? t.count : 0), ae(l ? l.count : 0);
|
|
127
127
|
});
|
|
128
|
-
},
|
|
129
|
-
const
|
|
130
|
-
if (!
|
|
128
|
+
}, M = (e, t, l) => {
|
|
129
|
+
const r = (e == null ? void 0 : e.current) || o.current, m = (e == null ? void 0 : e.pageSize) || o.pageSize, c = (e == null ? void 0 : e.type) || o.type, k = t || h || [];
|
|
130
|
+
if (!n || !i || !r)
|
|
131
131
|
return Promise.resolve(!1);
|
|
132
|
-
const
|
|
132
|
+
const _ = () => {
|
|
133
133
|
switch (L) {
|
|
134
134
|
case "nocode":
|
|
135
135
|
return "nocode";
|
|
@@ -139,278 +139,313 @@ const Ut = (v) => {
|
|
|
139
139
|
return;
|
|
140
140
|
}
|
|
141
141
|
};
|
|
142
|
-
return
|
|
143
|
-
current:
|
|
144
|
-
pageSize:
|
|
145
|
-
})),
|
|
146
|
-
pageNo:
|
|
147
|
-
pageSize:
|
|
148
|
-
labels:
|
|
149
|
-
}).then((
|
|
150
|
-
const
|
|
151
|
-
if (
|
|
142
|
+
return r === 1 && !(l != null && l.skipScrollToTop) && pe(), I((O) => p(f({}, O), {
|
|
143
|
+
current: r,
|
|
144
|
+
pageSize: m
|
|
145
|
+
})), oe(!0), d.cvforceDatahub.getDatasetsIdVersionsVidSamples(n, i.id, {
|
|
146
|
+
pageNo: r,
|
|
147
|
+
pageSize: m,
|
|
148
|
+
labels: _()
|
|
149
|
+
}).then((O) => {
|
|
150
|
+
const x = O.recordList || [], ge = r === 1 ? x : c === "prev" ? [...x, ...k] : [...k, ...x];
|
|
151
|
+
if (J(ge), I((E) => p(f({}, E), {
|
|
152
152
|
type: void 0,
|
|
153
|
-
total:
|
|
154
|
-
})),
|
|
155
|
-
const
|
|
156
|
-
A(
|
|
153
|
+
total: O.totalResults
|
|
154
|
+
})), c === "next" && x.length) {
|
|
155
|
+
const E = k.length;
|
|
156
|
+
A(E), N(x[0]);
|
|
157
157
|
}
|
|
158
|
-
if (
|
|
159
|
-
const
|
|
160
|
-
A(
|
|
158
|
+
if (c === "prev" && x.length) {
|
|
159
|
+
const E = x.length - 1;
|
|
160
|
+
A(E), N(x[E]);
|
|
161
161
|
}
|
|
162
|
-
return
|
|
163
|
-
}).catch(() => !1).finally(() =>
|
|
162
|
+
return ge;
|
|
163
|
+
}).catch(() => !1).finally(() => oe(!1));
|
|
164
164
|
};
|
|
165
|
-
|
|
166
|
-
!
|
|
165
|
+
v(() => {
|
|
166
|
+
!i || !s || (M(p(f({}, o), {
|
|
167
167
|
current: 1
|
|
168
168
|
})).then((e) => {
|
|
169
169
|
}), R());
|
|
170
|
-
}, [
|
|
171
|
-
if (
|
|
172
|
-
|
|
170
|
+
}, [s == null ? void 0 : s.id, i == null ? void 0 : i.id]), v(() => {
|
|
171
|
+
if (Z.current === o.current) {
|
|
172
|
+
Z.current = void 0, R();
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
|
-
|
|
175
|
+
M().then((e) => {
|
|
176
176
|
}), R();
|
|
177
|
-
}, [
|
|
178
|
-
|
|
177
|
+
}, [o.current]), v(() => {
|
|
178
|
+
M(p(f({}, o), {
|
|
179
179
|
current: 1,
|
|
180
180
|
total: void 0
|
|
181
181
|
})).then((e) => {
|
|
182
182
|
});
|
|
183
183
|
}, [L]);
|
|
184
184
|
const qe = () => {
|
|
185
|
-
if (!
|
|
185
|
+
if (!h)
|
|
186
186
|
return;
|
|
187
|
-
const e =
|
|
188
|
-
if (e >=
|
|
189
|
-
|
|
190
|
-
current:
|
|
191
|
-
pageSize:
|
|
187
|
+
const e = z + 1;
|
|
188
|
+
if (e >= h.length)
|
|
189
|
+
o.total && e >= o.total ? ee.error("已经是最后一个了") : I({
|
|
190
|
+
current: o.current + 1,
|
|
191
|
+
pageSize: o.pageSize,
|
|
192
192
|
type: "next"
|
|
193
193
|
});
|
|
194
194
|
else {
|
|
195
195
|
A(e);
|
|
196
|
-
const t =
|
|
197
|
-
|
|
196
|
+
const t = h[e];
|
|
197
|
+
N(t);
|
|
198
198
|
}
|
|
199
199
|
}, Ke = () => {
|
|
200
|
-
if (!
|
|
200
|
+
if (!h)
|
|
201
201
|
return;
|
|
202
|
-
const e =
|
|
202
|
+
const e = z - 1;
|
|
203
203
|
if (e < 0)
|
|
204
|
-
e < 0 ?
|
|
205
|
-
current:
|
|
206
|
-
pageSize:
|
|
204
|
+
e < 0 ? ee.error("已经是第一个了") : I({
|
|
205
|
+
current: o.current - 1,
|
|
206
|
+
pageSize: o.pageSize,
|
|
207
207
|
type: "prev"
|
|
208
208
|
});
|
|
209
209
|
else {
|
|
210
210
|
A(e);
|
|
211
|
-
const t =
|
|
212
|
-
|
|
211
|
+
const t = h[e];
|
|
212
|
+
N(t);
|
|
213
213
|
}
|
|
214
214
|
}, Ze = [{
|
|
215
215
|
key: "",
|
|
216
|
-
label: `全部(${
|
|
216
|
+
label: `全部(${G})`,
|
|
217
217
|
children: null
|
|
218
218
|
}, {
|
|
219
219
|
key: "nocode",
|
|
220
|
-
label: `未标注(${
|
|
220
|
+
label: `未标注(${ce})`,
|
|
221
221
|
children: null
|
|
222
222
|
}, {
|
|
223
223
|
key: "hascode",
|
|
224
|
-
label: `已标注(${
|
|
224
|
+
label: `已标注(${G - ce})`,
|
|
225
225
|
children: null
|
|
226
226
|
}];
|
|
227
|
-
|
|
228
|
-
!D || !(y != null && y.id) ||
|
|
227
|
+
v(() => {
|
|
228
|
+
!D || !(y != null && y.id) || z < 0 || (C.current = {
|
|
229
229
|
id: y.id,
|
|
230
|
-
index:
|
|
231
|
-
page:
|
|
230
|
+
index: z,
|
|
231
|
+
page: o.current || 1
|
|
232
232
|
});
|
|
233
|
-
}, [D, y == null ? void 0 : y.id,
|
|
233
|
+
}, [D, y == null ? void 0 : y.id, z]);
|
|
234
234
|
const _e = (e) => {
|
|
235
|
-
if (!
|
|
235
|
+
if (!h.some((r) => r.id === e.id))
|
|
236
236
|
return;
|
|
237
|
-
const t =
|
|
238
|
-
|
|
239
|
-
const
|
|
240
|
-
if (
|
|
241
|
-
return
|
|
242
|
-
if (!
|
|
243
|
-
const
|
|
244
|
-
return
|
|
237
|
+
const t = St(e, s == null ? void 0 : s.vlmMarkTmpl), l = L === "nocode" && t || L === "hascode" && !t;
|
|
238
|
+
J((r) => {
|
|
239
|
+
const m = r.findIndex((c) => c.id === e.id);
|
|
240
|
+
if (m === -1)
|
|
241
|
+
return r;
|
|
242
|
+
if (!l) {
|
|
243
|
+
const c = [...r];
|
|
244
|
+
return c[m] = f(f({}, c[m]), e), c;
|
|
245
245
|
}
|
|
246
|
-
return [...
|
|
247
|
-
}),
|
|
248
|
-
total:
|
|
246
|
+
return [...r.slice(0, m), ...r.slice(m + 1)];
|
|
247
|
+
}), l && I((r) => p(f({}, r), {
|
|
248
|
+
total: r.total != null ? Math.max(0, r.total - 1) : r.total
|
|
249
249
|
}));
|
|
250
250
|
}, Oe = (e) => {
|
|
251
|
-
|
|
252
|
-
|
|
251
|
+
var m;
|
|
252
|
+
if (R(), !e) {
|
|
253
|
+
M(p(f({}, o), {
|
|
254
|
+
current: 1
|
|
255
|
+
}));
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
const t = h.findIndex((c) => c.id === e);
|
|
259
|
+
if (t === -1) {
|
|
260
|
+
I((c) => p(f({}, c), {
|
|
261
|
+
total: c.total != null ? Math.max(0, c.total - 1) : c.total
|
|
262
|
+
}));
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
const l = [...h.slice(0, t), ...h.slice(t + 1)], r = o.total != null ? Math.max(0, o.total - 1) : l.length;
|
|
266
|
+
if (l.length === 0 && r > 0) {
|
|
267
|
+
M(p(f({}, o), {
|
|
268
|
+
current: 1
|
|
269
|
+
}));
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
if (J(l), I((c) => p(f({}, c), {
|
|
273
|
+
total: c.total != null ? Math.max(0, c.total - 1) : c.total
|
|
274
|
+
})), ((m = C.current) == null ? void 0 : m.id) === e)
|
|
275
|
+
if (l.length > 0) {
|
|
276
|
+
const c = Math.min(t, l.length - 1);
|
|
277
|
+
C.current = {
|
|
278
|
+
id: l[c].id,
|
|
279
|
+
index: c,
|
|
280
|
+
page: C.current.page || o.current || 1
|
|
281
|
+
};
|
|
282
|
+
} else
|
|
283
|
+
C.current = void 0;
|
|
284
|
+
}, $e = (e) => {
|
|
285
|
+
const t = o.pageSize || 100;
|
|
286
|
+
e.page <= 1 || (o.current !== 1 && (Z.current = 1), M(p(f({}, o), {
|
|
253
287
|
current: 1,
|
|
254
288
|
pageSize: e.page * t,
|
|
255
289
|
total: void 0
|
|
256
|
-
})
|
|
257
|
-
|
|
290
|
+
}), void 0, {
|
|
291
|
+
skipScrollToTop: !0
|
|
292
|
+
}).then((l) => {
|
|
293
|
+
Array.isArray(l) && (Z.current = e.page, I((r) => p(f({}, r), {
|
|
258
294
|
current: e.page,
|
|
259
295
|
pageSize: t
|
|
260
296
|
})), requestAnimationFrame(() => {
|
|
261
|
-
|
|
297
|
+
be(Ie(U.current), e.id, e.index);
|
|
262
298
|
}));
|
|
263
|
-
});
|
|
299
|
+
}));
|
|
264
300
|
};
|
|
265
|
-
|
|
301
|
+
v(() => {
|
|
266
302
|
let e;
|
|
267
303
|
if (!D) {
|
|
268
|
-
const t =
|
|
269
|
-
|
|
270
|
-
|
|
304
|
+
const t = C.current;
|
|
305
|
+
C.current = void 0, N(void 0), A(-1), se(void 0), K("preview"), t && (e = requestAnimationFrame(() => {
|
|
306
|
+
be(Ie(U.current), t.id, t.index) || $e(t);
|
|
271
307
|
}));
|
|
272
308
|
}
|
|
273
309
|
return () => {
|
|
274
310
|
e !== void 0 && cancelAnimationFrame(e);
|
|
275
311
|
};
|
|
276
|
-
}, [D]),
|
|
277
|
-
|
|
312
|
+
}, [D]), v(() => {
|
|
313
|
+
s && s.markType !== "vlm" && console.error(`当前数据集不是vlm类型,请检查数据集类型。
|
|
278
314
|
请检查markType是否为vlm。`);
|
|
279
|
-
}, [
|
|
280
|
-
const
|
|
315
|
+
}, [s]);
|
|
316
|
+
const pe = () => {
|
|
281
317
|
var e, t;
|
|
282
318
|
(t = (e = U.current) == null ? void 0 : e.getElementsByClassName("rc-virtual-list-holder")[0]) == null || t.scrollTo({
|
|
283
319
|
top: 0
|
|
284
320
|
});
|
|
285
|
-
},
|
|
286
|
-
var b, B;
|
|
321
|
+
}, je = (e) => {
|
|
287
322
|
const {
|
|
288
323
|
scrollTop: t,
|
|
289
|
-
scrollHeight:
|
|
290
|
-
clientHeight:
|
|
291
|
-
} = e.currentTarget,
|
|
292
|
-
|
|
293
|
-
var
|
|
294
|
-
return
|
|
295
|
-
current: ((
|
|
324
|
+
scrollHeight: l,
|
|
325
|
+
clientHeight: r
|
|
326
|
+
} = e.currentTarget, m = l - t - r, c = 3;
|
|
327
|
+
ie || (!o.total || o.total > h.length) && m <= c && I((k) => {
|
|
328
|
+
var _;
|
|
329
|
+
return p(f({}, k), {
|
|
330
|
+
current: ((_ = k.current) != null ? _ : 0) + 1
|
|
296
331
|
});
|
|
297
332
|
});
|
|
298
333
|
};
|
|
299
|
-
return /* @__PURE__ */
|
|
300
|
-
locale:
|
|
301
|
-
children: /* @__PURE__ */
|
|
334
|
+
return /* @__PURE__ */ a(tt, {
|
|
335
|
+
locale: lt,
|
|
336
|
+
children: /* @__PURE__ */ a(mt.Provider, {
|
|
302
337
|
value: {
|
|
303
|
-
datasetId:
|
|
304
|
-
versionId: (
|
|
305
|
-
no: (
|
|
306
|
-
loading:
|
|
307
|
-
version:
|
|
308
|
-
versions:
|
|
309
|
-
samples:
|
|
310
|
-
pagination:
|
|
311
|
-
services:
|
|
338
|
+
datasetId: n,
|
|
339
|
+
versionId: (i == null ? void 0 : i.id) || "",
|
|
340
|
+
no: (i == null ? void 0 : i.no) || "",
|
|
341
|
+
loading: ne,
|
|
342
|
+
version: i,
|
|
343
|
+
versions: B,
|
|
344
|
+
samples: h,
|
|
345
|
+
pagination: o,
|
|
346
|
+
services: d,
|
|
312
347
|
token: Le,
|
|
313
|
-
getToken:
|
|
314
|
-
apiUrl:
|
|
348
|
+
getToken: Ve,
|
|
349
|
+
apiUrl: Te,
|
|
315
350
|
featuresConfig: {
|
|
316
351
|
labelManager: ye,
|
|
317
|
-
datasetManager:
|
|
318
|
-
annotation:
|
|
319
|
-
filterSwitch:
|
|
320
|
-
header:
|
|
321
|
-
exampleSrcRoot:
|
|
352
|
+
datasetManager: b,
|
|
353
|
+
annotation: Ce,
|
|
354
|
+
filterSwitch: Y,
|
|
355
|
+
header: g,
|
|
356
|
+
exampleSrcRoot: xe
|
|
322
357
|
}
|
|
323
358
|
},
|
|
324
|
-
children:
|
|
359
|
+
children: s ? s.markType === "vlm" ? /* @__PURE__ */ T("div", {
|
|
325
360
|
className: "vlm-version-detail",
|
|
326
|
-
children: [/* @__PURE__ */
|
|
361
|
+
children: [/* @__PURE__ */ T(dt, {
|
|
327
362
|
className: "product-details-page",
|
|
328
|
-
header:
|
|
329
|
-
backTo:
|
|
330
|
-
onBackClick:
|
|
331
|
-
|
|
363
|
+
header: g === !1 ? void 0 : /* @__PURE__ */ a(ht, {
|
|
364
|
+
backTo: ke,
|
|
365
|
+
onBackClick: g != null && g.onBackClick ? () => {
|
|
366
|
+
g.onBackClick && g.onBackClick();
|
|
332
367
|
} : void 0,
|
|
333
|
-
left: !
|
|
334
|
-
children: [/* @__PURE__ */
|
|
368
|
+
left: !ne && /* @__PURE__ */ T(j, {
|
|
369
|
+
children: [/* @__PURE__ */ a("span", {
|
|
335
370
|
style: {
|
|
336
371
|
fontWeight: "bold"
|
|
337
372
|
},
|
|
338
|
-
children:
|
|
339
|
-
}), /* @__PURE__ */
|
|
340
|
-
disabled: (
|
|
341
|
-
value:
|
|
373
|
+
children: s == null ? void 0 : s.name
|
|
374
|
+
}), /* @__PURE__ */ a(rt, {
|
|
375
|
+
disabled: (g == null ? void 0 : g.versionSelect) === !1,
|
|
376
|
+
value: i == null ? void 0 : i.id,
|
|
342
377
|
style: {
|
|
343
378
|
width: 70
|
|
344
379
|
},
|
|
345
|
-
options:
|
|
380
|
+
options: B.map((e) => ({
|
|
346
381
|
label: e.no,
|
|
347
382
|
value: e.id
|
|
348
383
|
})),
|
|
349
384
|
onChange: (e) => {
|
|
350
|
-
const t =
|
|
351
|
-
if (!
|
|
385
|
+
const t = B.find((r) => r.id === e);
|
|
386
|
+
if (!s || !t)
|
|
352
387
|
return;
|
|
353
|
-
const
|
|
354
|
-
|
|
388
|
+
const l = B.find((r) => r.id === t.id);
|
|
389
|
+
w(l), g != null && g.onVersionChange && g.onVersionChange(l);
|
|
355
390
|
}
|
|
356
391
|
})]
|
|
357
392
|
}),
|
|
358
|
-
right: /* @__PURE__ */
|
|
359
|
-
children: [!y &&
|
|
393
|
+
right: /* @__PURE__ */ T(j, {
|
|
394
|
+
children: [!y && b && b.add && // <DisabledTooltip
|
|
360
395
|
// isPreLabel={false}
|
|
361
396
|
// placement="bottom"
|
|
362
397
|
// >
|
|
363
|
-
/* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ a(te, {
|
|
364
399
|
type: "default",
|
|
365
|
-
onClick: () =>
|
|
366
|
-
disabled:
|
|
400
|
+
onClick: () => X(!0),
|
|
401
|
+
disabled: V === F.Pending || V === F.Started,
|
|
367
402
|
children: "导入数据"
|
|
368
|
-
}, "del"), /* @__PURE__ */
|
|
403
|
+
}, "del"), /* @__PURE__ */ a(gt, {
|
|
369
404
|
when: Ee,
|
|
370
405
|
content: "确认要离开此页面吗?",
|
|
371
406
|
subContent: "离开此页面后,将结束导入,放弃未上传的文件,请谨慎操作!"
|
|
372
|
-
}),
|
|
373
|
-
datasetIam:
|
|
374
|
-
datasetId:
|
|
375
|
-
currentVersion:
|
|
376
|
-
tenCode:
|
|
377
|
-
markType:
|
|
378
|
-
vlmMarkTmpl:
|
|
379
|
-
isVisible:
|
|
380
|
-
setIsVisible:
|
|
407
|
+
}), de && /* @__PURE__ */ a(pt, {
|
|
408
|
+
datasetIam: Ne,
|
|
409
|
+
datasetId: n,
|
|
410
|
+
currentVersion: i,
|
|
411
|
+
tenCode: s == null ? void 0 : s.tenantCode,
|
|
412
|
+
markType: s.markType,
|
|
413
|
+
vlmMarkTmpl: s == null ? void 0 : s.vlmMarkTmpl,
|
|
414
|
+
isVisible: de,
|
|
415
|
+
setIsVisible: X,
|
|
381
416
|
getVersionListRequest: R,
|
|
382
417
|
setIsConfirm: Re,
|
|
383
418
|
onUploadStatusChange: (e) => {
|
|
384
419
|
Ae(e);
|
|
385
420
|
},
|
|
386
421
|
tableReload: () => {
|
|
387
|
-
|
|
422
|
+
i != null && i.id && (pe(), M(p(f({}, o), {
|
|
388
423
|
current: 1
|
|
389
424
|
})));
|
|
390
425
|
},
|
|
391
|
-
loadVersionData:
|
|
392
|
-
vlmDwgImport:
|
|
426
|
+
loadVersionData: he,
|
|
427
|
+
vlmDwgImport: b && b.vlmDwgImport ? b.vlmDwgImport : !1
|
|
393
428
|
})]
|
|
394
429
|
})
|
|
395
430
|
}),
|
|
396
|
-
children: [/* @__PURE__ */
|
|
431
|
+
children: [/* @__PURE__ */ T("div", {
|
|
397
432
|
className: "vlm-header",
|
|
398
|
-
children: [/* @__PURE__ */
|
|
399
|
-
children:
|
|
433
|
+
children: [/* @__PURE__ */ a(j, {
|
|
434
|
+
children: Y.tabs && /* @__PURE__ */ a(nt, {
|
|
400
435
|
className: "header-tab",
|
|
401
436
|
activeKey: L,
|
|
402
437
|
onChange: (e) => {
|
|
403
|
-
|
|
438
|
+
I(p(f({}, o), {
|
|
404
439
|
current: 1
|
|
405
440
|
// total: 0,
|
|
406
|
-
})),
|
|
441
|
+
})), Q(e);
|
|
407
442
|
},
|
|
408
443
|
items: Ze
|
|
409
444
|
})
|
|
410
|
-
}), /* @__PURE__ */
|
|
411
|
-
children:
|
|
445
|
+
}), /* @__PURE__ */ a(j, {
|
|
446
|
+
children: b && b.label && /* @__PURE__ */ a(te, {
|
|
412
447
|
type: "primary",
|
|
413
|
-
disabled: !
|
|
448
|
+
disabled: !G,
|
|
414
449
|
onClick: Be,
|
|
415
450
|
style: {
|
|
416
451
|
marginRight: "10px"
|
|
@@ -418,57 +453,57 @@ const Ut = (v) => {
|
|
|
418
453
|
children: "标注"
|
|
419
454
|
})
|
|
420
455
|
})]
|
|
421
|
-
}), /* @__PURE__ */
|
|
456
|
+
}), /* @__PURE__ */ a("div", {
|
|
422
457
|
className: "d-row",
|
|
423
|
-
children: /* @__PURE__ */
|
|
458
|
+
children: /* @__PURE__ */ a("div", {
|
|
424
459
|
className: "d-right",
|
|
425
460
|
ref: U,
|
|
426
|
-
children:
|
|
427
|
-
children: /* @__PURE__ */
|
|
461
|
+
children: o.total !== void 0 && o.total > 0 ? /* @__PURE__ */ a(Ye, {
|
|
462
|
+
children: /* @__PURE__ */ a(at, {
|
|
428
463
|
innerProps: {
|
|
429
464
|
className: "d-right-row"
|
|
430
465
|
},
|
|
431
|
-
data:
|
|
466
|
+
data: h,
|
|
432
467
|
itemKey: "id",
|
|
433
468
|
height: Math.max(He, 1),
|
|
434
|
-
onScroll:
|
|
435
|
-
children: (e, t) => /* @__PURE__ */
|
|
469
|
+
onScroll: je,
|
|
470
|
+
children: (e, t) => /* @__PURE__ */ a(it, {
|
|
436
471
|
className: "d-right-col",
|
|
437
472
|
"data-sample-id": e.id,
|
|
438
473
|
onClick: () => Pe(t),
|
|
439
|
-
children: /* @__PURE__ */
|
|
474
|
+
children: /* @__PURE__ */ T("div", {
|
|
440
475
|
className: "right-col-wrapper",
|
|
441
|
-
children: [/* @__PURE__ */
|
|
476
|
+
children: [/* @__PURE__ */ a("div", {
|
|
442
477
|
className: "right-col-img",
|
|
443
|
-
children: /* @__PURE__ */
|
|
478
|
+
children: /* @__PURE__ */ a(ut, {
|
|
444
479
|
fileKey: e.fileKey,
|
|
445
480
|
width: 124,
|
|
446
481
|
thumbnailUrl: e.thumbnailUrl
|
|
447
482
|
})
|
|
448
|
-
}), /* @__PURE__ */
|
|
483
|
+
}), /* @__PURE__ */ a("div", {
|
|
449
484
|
className: "right-col-text",
|
|
450
|
-
children: /* @__PURE__ */
|
|
485
|
+
children: /* @__PURE__ */ a("div", {
|
|
451
486
|
children: t + 1
|
|
452
487
|
})
|
|
453
488
|
})]
|
|
454
489
|
})
|
|
455
490
|
}, e.id)
|
|
456
491
|
})
|
|
457
|
-
}) : /* @__PURE__ */
|
|
492
|
+
}) : /* @__PURE__ */ a("div", {
|
|
458
493
|
className: "empty",
|
|
459
|
-
children:
|
|
460
|
-
image:
|
|
461
|
-
description: /* @__PURE__ */
|
|
462
|
-
children: ["暂无数据", L !== "hascode" && /* @__PURE__ */
|
|
463
|
-
children:
|
|
494
|
+
children: o.total === 0 ? /* @__PURE__ */ a(ot, {
|
|
495
|
+
image: vt,
|
|
496
|
+
description: /* @__PURE__ */ T("span", {
|
|
497
|
+
children: ["暂无数据", L !== "hascode" && /* @__PURE__ */ a("span", {
|
|
498
|
+
children: b && b.add && /* @__PURE__ */ T(te, {
|
|
464
499
|
type: "link",
|
|
465
500
|
size: "small",
|
|
466
501
|
style: {
|
|
467
502
|
padding: 0
|
|
468
503
|
},
|
|
469
|
-
onClick: () =>
|
|
470
|
-
disabled:
|
|
471
|
-
children: [/* @__PURE__ */
|
|
504
|
+
onClick: () => X(!0),
|
|
505
|
+
disabled: V === F.Pending || V === F.Started,
|
|
506
|
+
children: [/* @__PURE__ */ a("span", {
|
|
472
507
|
style: {
|
|
473
508
|
color: "black"
|
|
474
509
|
},
|
|
@@ -481,47 +516,45 @@ const Ut = (v) => {
|
|
|
481
516
|
})
|
|
482
517
|
})
|
|
483
518
|
})]
|
|
484
|
-
}), D && /* @__PURE__ */
|
|
485
|
-
vlmMarkTmpl:
|
|
519
|
+
}), D && /* @__PURE__ */ a(st, {
|
|
520
|
+
vlmMarkTmpl: s == null ? void 0 : s.vlmMarkTmpl,
|
|
486
521
|
isVlmModalVisible: D,
|
|
487
|
-
setIsVlmModalVisible:
|
|
522
|
+
setIsVlmModalVisible: q,
|
|
488
523
|
record: y,
|
|
489
524
|
onNextClick: () => qe(),
|
|
490
525
|
onPrevClick: () => Ke(),
|
|
491
|
-
listLoading:
|
|
492
|
-
ocrMarkTmpl:
|
|
493
|
-
datasetId:
|
|
494
|
-
versionId:
|
|
495
|
-
initialMode:
|
|
526
|
+
listLoading: ie,
|
|
527
|
+
ocrMarkTmpl: s == null ? void 0 : s.ocrMarkTmpl,
|
|
528
|
+
datasetId: n,
|
|
529
|
+
versionId: i == null ? void 0 : i.id,
|
|
530
|
+
initialMode: Me,
|
|
496
531
|
filterMode: L,
|
|
497
532
|
onFilterModeChange: (e) => {
|
|
498
|
-
|
|
533
|
+
Q(e);
|
|
499
534
|
},
|
|
500
535
|
onCurrentSampleChange: (e) => {
|
|
501
|
-
|
|
536
|
+
C.current = e;
|
|
502
537
|
},
|
|
503
|
-
samples:
|
|
504
|
-
pagination:
|
|
505
|
-
currentIndex:
|
|
538
|
+
samples: h,
|
|
539
|
+
pagination: o,
|
|
540
|
+
currentIndex: z,
|
|
506
541
|
handleMarkClick: (e) => {
|
|
507
|
-
|
|
542
|
+
se(e), K("annotation");
|
|
508
543
|
},
|
|
509
|
-
updateSampleList: () => {
|
|
510
|
-
|
|
511
|
-
current: 1
|
|
512
|
-
})), R();
|
|
544
|
+
updateSampleList: (e) => {
|
|
545
|
+
Oe(e);
|
|
513
546
|
},
|
|
514
|
-
selectSampleId:
|
|
547
|
+
selectSampleId: we,
|
|
515
548
|
onClose: () => {
|
|
516
|
-
R(),
|
|
549
|
+
R(), q(!1);
|
|
517
550
|
},
|
|
518
551
|
onSave: (e) => {
|
|
519
|
-
if (!
|
|
552
|
+
if (!n || !i)
|
|
520
553
|
throw "datasetId or version is not exist.";
|
|
521
|
-
return
|
|
554
|
+
return d.cvforceDatahub.updateSamples(n, i.id, [f({}, e)]).then(() => (_e(e), !0));
|
|
522
555
|
}
|
|
523
556
|
})]
|
|
524
|
-
}) : /* @__PURE__ */
|
|
557
|
+
}) : /* @__PURE__ */ a("div", {
|
|
525
558
|
style: {
|
|
526
559
|
color: "red",
|
|
527
560
|
textAlign: "center"
|
|
@@ -532,5 +565,5 @@ const Ut = (v) => {
|
|
|
532
565
|
});
|
|
533
566
|
};
|
|
534
567
|
export {
|
|
535
|
-
|
|
568
|
+
Bt as default
|
|
536
569
|
};
|