@glodon-aiot/dataset-annotation 3.22.2-alpha.4 → 3.23.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/components/DetectionAnnotation/components/ImageDetail/index.mjs +93 -95
- package/dist/es/components/DetectionAnnotation/components/ImageModal/index.mjs +94 -85
- package/dist/es/components/DetectionAnnotation/hooks/useSamplePreload.mjs +40 -0
- package/dist/es/components/DetectionAnnotation/index.mjs +473 -449
- package/dist/es/components/DetectionAnnotation/utils/imagePreloader.mjs +71 -0
- package/dist/es/index.mjs +1 -1
- package/dist/lib/index.js +4 -4
- package/dist/src/components/DetectionAnnotation/components/ImageDetail/index.d.ts +1 -1
- package/dist/src/components/DetectionAnnotation/components/ImageModal/index.d.ts +3 -0
- package/dist/src/components/DetectionAnnotation/hooks/useSamplePreload.d.ts +25 -0
- package/dist/src/components/DetectionAnnotation/utils/imagePreloader.d.ts +40 -0
- package/package.json +2 -2
|
@@ -1,152 +1,150 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var $ = Object.defineProperty, V = Object.defineProperties;
|
|
2
|
+
var S = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var M = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var A = (
|
|
6
|
-
for (var
|
|
7
|
-
|
|
4
|
+
var ee = Object.prototype.hasOwnProperty, ie = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var A = (d, o, a) => o in d ? $(d, o, { enumerable: !0, configurable: !0, writable: !0, value: a }) : d[o] = a, b = (d, o) => {
|
|
6
|
+
for (var a in o || (o = {}))
|
|
7
|
+
ee.call(o, a) && A(d, a, o[a]);
|
|
8
8
|
if (M)
|
|
9
|
-
for (var
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
import { jsxs as
|
|
14
|
-
import { useRef as B, useState as h, useEffect as
|
|
9
|
+
for (var a of M(o))
|
|
10
|
+
ie.call(o, a) && A(d, a, o[a]);
|
|
11
|
+
return d;
|
|
12
|
+
}, U = (d, o) => V(d, S(o));
|
|
13
|
+
import { jsxs as m, jsx as n } from "react/jsx-runtime";
|
|
14
|
+
import { useRef as B, useState as h, useEffect as w } from "react";
|
|
15
15
|
import { Button as H } from "antd";
|
|
16
16
|
import { useKeyPress as K } from "ahooks";
|
|
17
17
|
import "./style.less.mjs";
|
|
18
|
-
import
|
|
19
|
-
import
|
|
18
|
+
import se from "../Labels/index.mjs";
|
|
19
|
+
import le from "../LabelMaker/index.mjs";
|
|
20
20
|
import O from "../../../Iconfont/index.mjs";
|
|
21
|
-
import
|
|
22
|
-
const
|
|
23
|
-
var
|
|
21
|
+
import oe from "../../../DetectionStatus/index.mjs";
|
|
22
|
+
const ge = (d) => {
|
|
23
|
+
var u, z, F;
|
|
24
24
|
const {
|
|
25
|
-
datasetId:
|
|
26
|
-
isImageDetailVisible:
|
|
25
|
+
datasetId: o,
|
|
26
|
+
isImageDetailVisible: a = !0,
|
|
27
27
|
currentSample: e,
|
|
28
|
-
onNextClick:
|
|
29
|
-
onPrevClick:
|
|
28
|
+
onNextClick: g,
|
|
29
|
+
onPrevClick: v,
|
|
30
30
|
labels: r = [],
|
|
31
31
|
editing: q,
|
|
32
|
-
onRefresh:
|
|
33
|
-
onChange:
|
|
34
|
-
isPreLabel:
|
|
35
|
-
settingHide:
|
|
36
|
-
imgCount:
|
|
32
|
+
onRefresh: L,
|
|
33
|
+
onChange: C,
|
|
34
|
+
isPreLabel: p,
|
|
35
|
+
settingHide: D,
|
|
36
|
+
imgCount: f,
|
|
37
37
|
readonly: G,
|
|
38
|
-
showLabelList:
|
|
38
|
+
showLabelList: E = !0,
|
|
39
39
|
renderLabelItem: J,
|
|
40
|
-
onLoadingChange:
|
|
41
|
-
} =
|
|
40
|
+
onLoadingChange: I
|
|
41
|
+
} = d, Q = B(null), T = B({}), [P, W] = h({}), [y, N] = h(), [t, R] = h(), [X, Y] = h(!1), [Z, j] = h(), x = !!(e != null && e.fileUrl) && Z !== e.fileUrl;
|
|
42
42
|
K("rightarrow", () => {
|
|
43
|
-
|
|
43
|
+
g && g();
|
|
44
44
|
}), K("leftarrow", () => {
|
|
45
|
-
|
|
46
|
-
}),
|
|
47
|
-
X &&
|
|
48
|
-
}, []),
|
|
49
|
-
var s,
|
|
50
|
-
if (
|
|
45
|
+
v && v();
|
|
46
|
+
}), w(() => () => {
|
|
47
|
+
X && L && L();
|
|
48
|
+
}, []), w(() => {
|
|
49
|
+
var s, l;
|
|
50
|
+
if (N(void 0), (e == null ? void 0 : e.id) !== (t == null ? void 0 : t.id) && R(void 0), !a || !((s = e == null ? void 0 : e.labels) != null && s.length))
|
|
51
51
|
return;
|
|
52
|
-
const i = (
|
|
52
|
+
const i = (l = t || e) == null ? void 0 : l.labels.reduce((c, k) => (c[k.id] ? ++c[k.id] : c[k.id] = 1, c), {});
|
|
53
53
|
W(i || {});
|
|
54
|
-
}, [
|
|
55
|
-
e
|
|
56
|
-
}, [e == null ? void 0 : e.fileUrl]),
|
|
57
|
-
|
|
58
|
-
}, [x, w]), g(() => {
|
|
59
|
-
if (a != null && a.labels) {
|
|
54
|
+
}, [a, e, t]), w(() => {
|
|
55
|
+
I && I(x, e == null ? void 0 : e.fileUrl);
|
|
56
|
+
}, [x, e == null ? void 0 : e.fileUrl, I]), w(() => {
|
|
57
|
+
if (t != null && t.labels) {
|
|
60
58
|
const i = [];
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
label:
|
|
59
|
+
t.labels.forEach((s) => {
|
|
60
|
+
const l = r.find((c) => c.id === s.id);
|
|
61
|
+
l && i.push(U(b({}, s), {
|
|
62
|
+
label: l.label
|
|
65
63
|
}));
|
|
66
|
-
}),
|
|
64
|
+
}), t.labels = i, R(b({}, t));
|
|
67
65
|
}
|
|
68
66
|
}, [r]);
|
|
69
|
-
const
|
|
70
|
-
Q.current &&
|
|
67
|
+
const _ = () => {
|
|
68
|
+
Q.current && j(e == null ? void 0 : e.fileUrl);
|
|
71
69
|
};
|
|
72
|
-
return window.onresize =
|
|
70
|
+
return window.onresize = _, /* @__PURE__ */ m("div", {
|
|
73
71
|
className: "detection-image-detail",
|
|
74
|
-
children: [/* @__PURE__ */
|
|
72
|
+
children: [/* @__PURE__ */ m("div", {
|
|
75
73
|
className: "detail-image",
|
|
76
|
-
children: [
|
|
74
|
+
children: [D ? /* @__PURE__ */ m("div", {
|
|
77
75
|
className: "img-detail-info",
|
|
78
|
-
children: ["第 ",
|
|
79
|
-
}) : /* @__PURE__ */
|
|
76
|
+
children: ["第 ", f == null ? void 0 : f.index, " 张 / 共 ", f == null ? void 0 : f.total, " 张"]
|
|
77
|
+
}) : /* @__PURE__ */ n("div", {
|
|
80
78
|
className: "img-detail-info",
|
|
81
|
-
children:
|
|
82
|
-
}), /* @__PURE__ */
|
|
79
|
+
children: f == null ? void 0 : f.index
|
|
80
|
+
}), /* @__PURE__ */ m("div", {
|
|
83
81
|
className: "detail-content",
|
|
84
|
-
children: [
|
|
82
|
+
children: [v && /* @__PURE__ */ n(H, {
|
|
85
83
|
className: "select-prev",
|
|
86
|
-
icon: /* @__PURE__ */
|
|
84
|
+
icon: /* @__PURE__ */ n(O, {
|
|
87
85
|
type: "icon-zuojiantou"
|
|
88
86
|
}),
|
|
89
87
|
type: "text",
|
|
90
88
|
disabled: x,
|
|
91
|
-
onClick: () =>
|
|
89
|
+
onClick: () => v(),
|
|
92
90
|
tabIndex: 0
|
|
93
|
-
}), /* @__PURE__ */
|
|
91
|
+
}), /* @__PURE__ */ m("div", {
|
|
94
92
|
className: "select-main",
|
|
95
93
|
ref: T,
|
|
96
|
-
children: [((
|
|
94
|
+
children: [((u = e == null ? void 0 : e.sampleFileName) == null ? void 0 : u.name) && /* @__PURE__ */ n("div", {
|
|
97
95
|
className: "img-detail-name-overlay",
|
|
98
96
|
children: e.sampleFileName.name
|
|
99
|
-
}), /* @__PURE__ */
|
|
97
|
+
}), /* @__PURE__ */ n("div", {
|
|
100
98
|
className: "detection-status-wrapper",
|
|
101
|
-
children: /* @__PURE__ */
|
|
99
|
+
children: /* @__PURE__ */ n(oe, {
|
|
102
100
|
sample: e
|
|
103
101
|
})
|
|
104
|
-
}), /* @__PURE__ */
|
|
102
|
+
}), /* @__PURE__ */ n(le, {
|
|
105
103
|
disabled: G,
|
|
106
104
|
imageUrl: (e == null ? void 0 : e.fileUrl) || "",
|
|
107
105
|
pen: y,
|
|
108
|
-
labels: ((z =
|
|
106
|
+
labels: ((z = t ? t.labels : e == null ? void 0 : e.labels) == null ? void 0 : z.map((i) => {
|
|
109
107
|
var s;
|
|
110
|
-
return
|
|
111
|
-
color: ((s = r.find((
|
|
108
|
+
return U(b({}, i), {
|
|
109
|
+
color: ((s = r.find((l) => l.id === i.id)) == null ? void 0 : s.color) || ""
|
|
112
110
|
});
|
|
113
111
|
})) || [],
|
|
114
|
-
onImageLoad: () =>
|
|
115
|
-
onImageError: () =>
|
|
112
|
+
onImageLoad: () => j(e == null ? void 0 : e.fileUrl),
|
|
113
|
+
onImageError: () => j(e == null ? void 0 : e.fileUrl),
|
|
116
114
|
onChange: (i) => {
|
|
117
|
-
if (
|
|
115
|
+
if (N(void 0), !e)
|
|
118
116
|
return;
|
|
119
|
-
const s =
|
|
120
|
-
labels: i.map((
|
|
121
|
-
id:
|
|
122
|
-
label:
|
|
123
|
-
box:
|
|
117
|
+
const s = U(b({}, e), {
|
|
118
|
+
labels: i.map((l) => ({
|
|
119
|
+
id: l.id,
|
|
120
|
+
label: l.label,
|
|
121
|
+
box: l.box
|
|
124
122
|
}))
|
|
125
123
|
});
|
|
126
|
-
R(s),
|
|
124
|
+
R(s), C && C(s);
|
|
127
125
|
},
|
|
128
|
-
isPreLabel:
|
|
126
|
+
isPreLabel: p,
|
|
129
127
|
renderLabelItem: J
|
|
130
|
-
},
|
|
131
|
-
}),
|
|
128
|
+
}, E ? "with-slide" : "no-slide")]
|
|
129
|
+
}), g && /* @__PURE__ */ n(H, {
|
|
132
130
|
className: "select-next",
|
|
133
|
-
icon: /* @__PURE__ */
|
|
131
|
+
icon: /* @__PURE__ */ n(O, {
|
|
134
132
|
type: "icon-youjiantou"
|
|
135
133
|
}),
|
|
136
134
|
type: "text",
|
|
137
135
|
disabled: x,
|
|
138
|
-
onClick: () =>
|
|
136
|
+
onClick: () => g()
|
|
139
137
|
})]
|
|
140
138
|
})]
|
|
141
|
-
}), (!!(r != null && r.length) || q) &&
|
|
139
|
+
}), (!!(r != null && r.length) || q) && E && /* @__PURE__ */ n("div", {
|
|
142
140
|
className: "detail-slide",
|
|
143
|
-
children: /* @__PURE__ */
|
|
144
|
-
datasetId:
|
|
141
|
+
children: /* @__PURE__ */ n(se, {
|
|
142
|
+
datasetId: o,
|
|
145
143
|
selectMode: "single",
|
|
146
|
-
data: ((F = Object.keys(
|
|
147
|
-
const s = r.find((
|
|
144
|
+
data: ((F = Object.keys(P)) == null ? void 0 : F.map((i) => {
|
|
145
|
+
const s = r.find((l) => l.id === i);
|
|
148
146
|
if (s)
|
|
149
|
-
return s.count =
|
|
147
|
+
return s.count = P[i], s;
|
|
150
148
|
}).filter((i) => !!i)) || [],
|
|
151
149
|
shortcut: !0,
|
|
152
150
|
selected: y ? [y] : [],
|
|
@@ -156,21 +154,21 @@ const he = (n) => {
|
|
|
156
154
|
return;
|
|
157
155
|
}
|
|
158
156
|
if (!i.length) {
|
|
159
|
-
|
|
157
|
+
N(void 0);
|
|
160
158
|
return;
|
|
161
159
|
}
|
|
162
|
-
const s = r == null ? void 0 : r.find((
|
|
163
|
-
|
|
160
|
+
const s = r == null ? void 0 : r.find((l) => i[0].label === l.label);
|
|
161
|
+
N(s);
|
|
164
162
|
},
|
|
165
163
|
onListChange: () => {
|
|
166
|
-
Y(!0),
|
|
164
|
+
Y(!0), L && L();
|
|
167
165
|
},
|
|
168
|
-
isPreLabel:
|
|
169
|
-
settingHide:
|
|
166
|
+
isPreLabel: p,
|
|
167
|
+
settingHide: D
|
|
170
168
|
})
|
|
171
169
|
})]
|
|
172
170
|
});
|
|
173
171
|
};
|
|
174
172
|
export {
|
|
175
|
-
|
|
173
|
+
ge as default
|
|
176
174
|
};
|
|
@@ -1,51 +1,60 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Modal as
|
|
4
|
-
import { useKeyPress as
|
|
5
|
-
import
|
|
1
|
+
import { jsxs as d, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useState as x, useCallback as z } from "react";
|
|
3
|
+
import { Modal as N, Button as l, Tabs as F, Space as H, Tooltip as R } from "antd";
|
|
4
|
+
import { useKeyPress as k } from "ahooks";
|
|
5
|
+
import q from "../ImageDetail/index.mjs";
|
|
6
6
|
import "./style.less.mjs";
|
|
7
|
-
import
|
|
8
|
-
import { ISampleActionType as
|
|
9
|
-
const
|
|
7
|
+
import G from "../../../DataEmpty/index.mjs";
|
|
8
|
+
import { ISampleActionType as h } from "../../index.mjs";
|
|
9
|
+
const _ = (w) => {
|
|
10
10
|
const {
|
|
11
|
-
datasetId:
|
|
12
|
-
setIsImageDetailVisible:
|
|
13
|
-
isImageDetailVisible:
|
|
11
|
+
datasetId: D,
|
|
12
|
+
setIsImageDetailVisible: b,
|
|
13
|
+
isImageDetailVisible: p = !0,
|
|
14
14
|
currentSample: e,
|
|
15
15
|
onNextClick: o,
|
|
16
|
-
onPrevClick:
|
|
16
|
+
onPrevClick: s,
|
|
17
17
|
onSave: a,
|
|
18
|
-
onDeleteSample:
|
|
19
|
-
labels:
|
|
20
|
-
onRefresh:
|
|
21
|
-
onChange:
|
|
22
|
-
isPreLabel:
|
|
23
|
-
settingHide:
|
|
24
|
-
imgCount:
|
|
25
|
-
showLabelList:
|
|
26
|
-
renderLabelItem:
|
|
27
|
-
onEnterEdit:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
18
|
+
onDeleteSample: g,
|
|
19
|
+
labels: v = [],
|
|
20
|
+
onRefresh: M,
|
|
21
|
+
onChange: T,
|
|
22
|
+
isPreLabel: n,
|
|
23
|
+
settingHide: E,
|
|
24
|
+
imgCount: J,
|
|
25
|
+
showLabelList: j = !0,
|
|
26
|
+
renderLabelItem: A,
|
|
27
|
+
onEnterEdit: y,
|
|
28
|
+
onBackToDetail: C,
|
|
29
|
+
onLoadingChange: c,
|
|
30
|
+
filterItems: u,
|
|
31
|
+
filterMode: B,
|
|
32
|
+
onFilterChange: I,
|
|
31
33
|
previewMode: t = !0,
|
|
32
|
-
canLabel:
|
|
33
|
-
canDelete:
|
|
34
|
-
} =
|
|
35
|
-
|
|
34
|
+
canLabel: r = !1,
|
|
35
|
+
canDelete: L = !1
|
|
36
|
+
} = w, [f, K] = x(!1), O = z((m, V) => {
|
|
37
|
+
K(m), c == null || c(m, V);
|
|
38
|
+
}, [c]);
|
|
39
|
+
return k("rightarrow", () => {
|
|
36
40
|
t || o && o(e == null ? void 0 : e.confirmStatus);
|
|
37
|
-
}),
|
|
38
|
-
t ||
|
|
39
|
-
}), /* @__PURE__ */
|
|
40
|
-
title: /* @__PURE__ */
|
|
41
|
+
}), k("leftarrow", () => {
|
|
42
|
+
t || s && s(e == null ? void 0 : e.confirmStatus);
|
|
43
|
+
}), /* @__PURE__ */ d(N, {
|
|
44
|
+
title: /* @__PURE__ */ d("div", {
|
|
41
45
|
className: "detection-sample-detail-title",
|
|
42
|
-
children: /* @__PURE__ */ i("span", {
|
|
46
|
+
children: [/* @__PURE__ */ i("span", {
|
|
43
47
|
children: t ? "详情" : "标注"
|
|
44
|
-
})
|
|
48
|
+
}), !t && r && e && C && /* @__PURE__ */ i(l, {
|
|
49
|
+
size: "small",
|
|
50
|
+
onClick: () => C(e.confirmStatus),
|
|
51
|
+
disabled: f,
|
|
52
|
+
children: "返回详情"
|
|
53
|
+
})]
|
|
45
54
|
}),
|
|
46
55
|
width: "100%",
|
|
47
|
-
open:
|
|
48
|
-
onCancel: () =>
|
|
56
|
+
open: p,
|
|
57
|
+
onCancel: () => b(!1),
|
|
49
58
|
footer: null,
|
|
50
59
|
centered: !0,
|
|
51
60
|
wrapClassName: "detection-modal-wrap",
|
|
@@ -56,61 +65,61 @@ const W = (L) => {
|
|
|
56
65
|
destroyOnClose: !1,
|
|
57
66
|
children: [/* @__PURE__ */ i("div", {
|
|
58
67
|
className: "detail-tabs",
|
|
59
|
-
children: !t &&
|
|
60
|
-
activeKey:
|
|
61
|
-
items:
|
|
62
|
-
onChange: (
|
|
68
|
+
children: !t && u && /* @__PURE__ */ i(F, {
|
|
69
|
+
activeKey: B,
|
|
70
|
+
items: u,
|
|
71
|
+
onChange: (m) => I && I(m)
|
|
63
72
|
})
|
|
64
|
-
}), e ? /* @__PURE__ */ i(
|
|
65
|
-
datasetId:
|
|
66
|
-
isImageDetailVisible:
|
|
67
|
-
setIsImageDetailVisible:
|
|
73
|
+
}), e ? /* @__PURE__ */ i(q, {
|
|
74
|
+
datasetId: D,
|
|
75
|
+
isImageDetailVisible: p,
|
|
76
|
+
setIsImageDetailVisible: b,
|
|
68
77
|
currentSample: e,
|
|
69
78
|
onNextClick: t ? () => o == null ? void 0 : o(e == null ? void 0 : e.confirmStatus) : void 0,
|
|
70
|
-
onPrevClick: t ? () =>
|
|
71
|
-
labels:
|
|
79
|
+
onPrevClick: t ? () => s == null ? void 0 : s(e == null ? void 0 : e.confirmStatus) : void 0,
|
|
80
|
+
labels: v,
|
|
72
81
|
editing: !t,
|
|
73
|
-
onRefresh:
|
|
74
|
-
onChange:
|
|
75
|
-
isPreLabel:
|
|
76
|
-
settingHide:
|
|
77
|
-
readonly: t || !
|
|
78
|
-
showLabelList: t ? !1 :
|
|
79
|
-
renderLabelItem:
|
|
80
|
-
onLoadingChange:
|
|
81
|
-
}) : /* @__PURE__ */ i(
|
|
82
|
+
onRefresh: M,
|
|
83
|
+
onChange: T,
|
|
84
|
+
isPreLabel: n,
|
|
85
|
+
settingHide: E,
|
|
86
|
+
readonly: t || !r,
|
|
87
|
+
showLabelList: t ? !1 : j,
|
|
88
|
+
renderLabelItem: A,
|
|
89
|
+
onLoadingChange: O
|
|
90
|
+
}) : /* @__PURE__ */ i(G, {}), e && /* @__PURE__ */ i("div", {
|
|
82
91
|
className: "detail-footer",
|
|
83
|
-
children: t ? /* @__PURE__ */
|
|
84
|
-
children: [
|
|
92
|
+
children: t ? /* @__PURE__ */ d(H, {
|
|
93
|
+
children: [y && r && /* @__PURE__ */ i("div", {
|
|
85
94
|
className: "detail-actions",
|
|
86
|
-
children: /* @__PURE__ */ i(
|
|
95
|
+
children: /* @__PURE__ */ i(l, {
|
|
87
96
|
type: "primary",
|
|
88
|
-
onClick:
|
|
97
|
+
onClick: y,
|
|
89
98
|
children: "标注"
|
|
90
99
|
})
|
|
91
|
-
}),
|
|
100
|
+
}), L && /* @__PURE__ */ i(l, {
|
|
92
101
|
danger: !0,
|
|
93
|
-
onClick:
|
|
102
|
+
onClick: g,
|
|
94
103
|
children: "删除数据"
|
|
95
104
|
})]
|
|
96
|
-
}) : /* @__PURE__ */
|
|
105
|
+
}) : /* @__PURE__ */ d("div", {
|
|
97
106
|
className: "footer-bar",
|
|
98
107
|
children: [/* @__PURE__ */ i("div", {
|
|
99
108
|
className: "footer-left"
|
|
100
|
-
}), /* @__PURE__ */
|
|
109
|
+
}), /* @__PURE__ */ d("div", {
|
|
101
110
|
className: "footer-center",
|
|
102
|
-
children: [/* @__PURE__ */ i(
|
|
103
|
-
onClick: () =>
|
|
104
|
-
disabled:
|
|
111
|
+
children: [/* @__PURE__ */ i(l, {
|
|
112
|
+
onClick: () => s == null ? void 0 : s(e == null ? void 0 : e.confirmStatus),
|
|
113
|
+
disabled: f,
|
|
105
114
|
children: "上一张"
|
|
106
|
-
}), /* @__PURE__ */ i(
|
|
115
|
+
}), /* @__PURE__ */ i(l, {
|
|
107
116
|
onClick: () => o == null ? void 0 : o(e == null ? void 0 : e.confirmStatus),
|
|
108
|
-
disabled:
|
|
117
|
+
disabled: f,
|
|
109
118
|
children: "下一张"
|
|
110
119
|
})]
|
|
111
|
-
}), /* @__PURE__ */
|
|
120
|
+
}), /* @__PURE__ */ d("div", {
|
|
112
121
|
className: "footer-right",
|
|
113
|
-
children: [
|
|
122
|
+
children: [r && e.confirmStatus === 1 && /* @__PURE__ */ i(R, {
|
|
114
123
|
title: /* @__PURE__ */ i("span", {
|
|
115
124
|
style: {
|
|
116
125
|
color: "#ff9800"
|
|
@@ -118,36 +127,36 @@ const W = (L) => {
|
|
|
118
127
|
children: 'AI预标注数据,请"确认标注"完成审核'
|
|
119
128
|
}),
|
|
120
129
|
placement: "top",
|
|
121
|
-
children: /* @__PURE__ */ i(
|
|
130
|
+
children: /* @__PURE__ */ i(l, {
|
|
122
131
|
type: "primary",
|
|
123
132
|
onClick: () => {
|
|
124
|
-
|
|
133
|
+
N.confirm({
|
|
125
134
|
title: "确认",
|
|
126
135
|
content: "是否确认当前标注?",
|
|
127
136
|
onOk: () => {
|
|
128
|
-
a == null || a(0,
|
|
137
|
+
a == null || a(0, h.Confirm);
|
|
129
138
|
}
|
|
130
139
|
});
|
|
131
140
|
},
|
|
132
|
-
disabled:
|
|
141
|
+
disabled: n,
|
|
133
142
|
className: "confirm-label-btn",
|
|
134
143
|
children: "确认标注"
|
|
135
144
|
})
|
|
136
|
-
}),
|
|
145
|
+
}), r && e.confirmStatus === 1 && /* @__PURE__ */ i(l, {
|
|
137
146
|
type: "primary",
|
|
138
|
-
onClick: () => a == null ? void 0 : a(1,
|
|
139
|
-
disabled:
|
|
147
|
+
onClick: () => a == null ? void 0 : a(1, h.Save),
|
|
148
|
+
disabled: n,
|
|
140
149
|
children: "保存标注"
|
|
141
|
-
}),
|
|
150
|
+
}), r && e.confirmStatus !== 1 && /* @__PURE__ */ i(l, {
|
|
142
151
|
type: "primary",
|
|
143
152
|
onClick: () => {
|
|
144
|
-
a == null || a(0,
|
|
153
|
+
a == null || a(0, h.Confirm);
|
|
145
154
|
},
|
|
146
|
-
disabled:
|
|
155
|
+
disabled: n,
|
|
147
156
|
children: "保存标注"
|
|
148
|
-
}),
|
|
149
|
-
onClick:
|
|
150
|
-
disabled:
|
|
157
|
+
}), L && /* @__PURE__ */ i(l, {
|
|
158
|
+
onClick: g,
|
|
159
|
+
disabled: n,
|
|
151
160
|
children: "删除数据"
|
|
152
161
|
})]
|
|
153
162
|
})]
|
|
@@ -156,5 +165,5 @@ const W = (L) => {
|
|
|
156
165
|
});
|
|
157
166
|
};
|
|
158
167
|
export {
|
|
159
|
-
|
|
168
|
+
_ as default
|
|
160
169
|
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useRef as D, useEffect as a } from "react";
|
|
2
|
+
import { PRELOAD_FORWARD as E, PRELOAD_BACKWARD as P, ImagePreloader as d } from "../utils/imagePreloader.mjs";
|
|
3
|
+
const v = ({
|
|
4
|
+
samples: f,
|
|
5
|
+
currentIndex: o,
|
|
6
|
+
active: i,
|
|
7
|
+
loadedImageUrl: s
|
|
8
|
+
}) => {
|
|
9
|
+
var c;
|
|
10
|
+
const t = D(void 0), u = o >= 0 ? (c = f[o]) == null ? void 0 : c.fileUrl : void 0;
|
|
11
|
+
a(() => {
|
|
12
|
+
var p;
|
|
13
|
+
if (!i) {
|
|
14
|
+
(p = t.current) == null || p.dispose(), t.current = void 0;
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if (!u || s !== u)
|
|
18
|
+
return;
|
|
19
|
+
const e = [], n = (r) => {
|
|
20
|
+
var A;
|
|
21
|
+
if (r < 0 || r >= f.length)
|
|
22
|
+
return;
|
|
23
|
+
const R = (A = f[r]) == null ? void 0 : A.fileUrl;
|
|
24
|
+
R && e.push(R);
|
|
25
|
+
};
|
|
26
|
+
for (let r = 1; r <= E; r++)
|
|
27
|
+
n(o + r);
|
|
28
|
+
for (let r = 1; r <= P; r++)
|
|
29
|
+
n(o - r);
|
|
30
|
+
t.current || (t.current = new d());
|
|
31
|
+
const l = t.current;
|
|
32
|
+
l.pruneExcept([u, ...e]), l.setTargets(e);
|
|
33
|
+
}, [i, s, u, o, f]), a(() => () => {
|
|
34
|
+
var e;
|
|
35
|
+
(e = t.current) == null || e.dispose(), t.current = void 0;
|
|
36
|
+
}, []);
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
v as default
|
|
40
|
+
};
|