@glodon-aiot/dataset-annotation 3.16.0-alpha.38 → 3.16.0-alpha.40
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/OcrAnnotation/OCRBoxDetail/index.mjs +239 -0
- package/dist/es/components/OcrAnnotation/OCRBoxDetail/style.less.mjs +4 -0
- package/dist/es/components/OcrAnnotation/OcrModal/index.mjs +175 -142
- package/dist/es/components/OcrAnnotation/index.mjs +266 -245
- package/dist/es/index.mjs +1 -1
- package/dist/lib/index.js +4 -4
- package/dist/src/components/OcrAnnotation/OCRBoxDetail/index.d.ts +20 -0
- package/dist/src/components/OcrAnnotation/OcrModal/index.d.ts +14 -5
- package/package.json +2 -2
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
var de = Object.defineProperty, ae = Object.defineProperties;
|
|
2
|
+
var fe = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var ne = Object.getOwnPropertySymbols;
|
|
4
|
+
var ue = Object.prototype.hasOwnProperty, ge = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var re = (f, c, n) => c in f ? de(f, c, { enumerable: !0, configurable: !0, writable: !0, value: n }) : f[c] = n, w = (f, c) => {
|
|
6
|
+
for (var n in c || (c = {}))
|
|
7
|
+
ue.call(c, n) && re(f, n, c[n]);
|
|
8
|
+
if (ne)
|
|
9
|
+
for (var n of ne(c))
|
|
10
|
+
ge.call(c, n) && re(f, n, c[n]);
|
|
11
|
+
return f;
|
|
12
|
+
}, K = (f, c) => ae(f, fe(c));
|
|
13
|
+
import { jsxs as T, Fragment as he, jsx as C } from "react/jsx-runtime";
|
|
14
|
+
import { Tabs as oe, Button as O, message as y } from "antd";
|
|
15
|
+
import { useContext as pe, useRef as ie, useState as x, useEffect as W } from "react";
|
|
16
|
+
import "./style.less.mjs";
|
|
17
|
+
import xe from "../../DataEmpty/index.mjs";
|
|
18
|
+
import Ie from "../../../DatasetContext/index.mjs";
|
|
19
|
+
import me from "../MarkOCRBoxModal/ImageDetail/index.mjs";
|
|
20
|
+
const {
|
|
21
|
+
TabPane: q
|
|
22
|
+
} = oe, De = (f) => {
|
|
23
|
+
var te;
|
|
24
|
+
const {
|
|
25
|
+
visible: c,
|
|
26
|
+
selectSampleId: n,
|
|
27
|
+
datasetId: m,
|
|
28
|
+
versionId: S,
|
|
29
|
+
ocrMarkTmpl: Se,
|
|
30
|
+
onClose: be,
|
|
31
|
+
onSave: E,
|
|
32
|
+
categories: se,
|
|
33
|
+
externalSamples: I,
|
|
34
|
+
externalPagination: L,
|
|
35
|
+
externalCurrentIndex: F,
|
|
36
|
+
externalFilterMode: A,
|
|
37
|
+
onFilterModeChange: M,
|
|
38
|
+
onPaginationChange: $
|
|
39
|
+
} = f, {
|
|
40
|
+
services: {
|
|
41
|
+
cvforceDatahub: h
|
|
42
|
+
}
|
|
43
|
+
} = pe(Ie), z = ie(null), [r, a] = x(), [Ce, v] = x(0), [p, D] = x(() => n && (I != null && I.length) ? I : []), [j, b] = x(() => n && F !== void 0 ? F : -1), [i, P] = x(() => n && L ? w({}, L) : !n && L ? {
|
|
44
|
+
current: 1,
|
|
45
|
+
pageSize: L.pageSize
|
|
46
|
+
} : {
|
|
47
|
+
current: 1,
|
|
48
|
+
pageSize: 50
|
|
49
|
+
}), [G, J] = x(0), [Q, U] = x(0), [u, le] = x(() => n && A ? A : n ? "" : "nocode"), X = ie(!1), [B, R] = x(!1), [H, Y] = x(!1);
|
|
50
|
+
W(() => {
|
|
51
|
+
if (!m || !S)
|
|
52
|
+
return;
|
|
53
|
+
const e = i.current || 1, l = i.pageSize || 50;
|
|
54
|
+
if (!X.current && n && (I != null && I.length) && L && F !== void 0) {
|
|
55
|
+
const o = I.find((t) => t.id === n);
|
|
56
|
+
if (o) {
|
|
57
|
+
X.current = !0, a(o), v(I.length), k();
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
h == null || h.getDatasetsIdVersionsVidSamples(m, S, {
|
|
62
|
+
labels: u ? [u] : void 0,
|
|
63
|
+
pageNo: e,
|
|
64
|
+
pageSize: l
|
|
65
|
+
}).then((o) => {
|
|
66
|
+
const t = o.recordList || [];
|
|
67
|
+
D(t);
|
|
68
|
+
const g = K(w({}, i), {
|
|
69
|
+
current: e,
|
|
70
|
+
pageSize: l,
|
|
71
|
+
total: o.totalResults
|
|
72
|
+
});
|
|
73
|
+
if (P(g), $ == null || $(g), i.type === "next" && t.length) {
|
|
74
|
+
const d = n ? t.find((s) => s.id === n) : null;
|
|
75
|
+
if (d) {
|
|
76
|
+
const s = t.findIndex((V) => V.id === n);
|
|
77
|
+
b(s), a(d), v(t.length);
|
|
78
|
+
return;
|
|
79
|
+
} else {
|
|
80
|
+
b(0);
|
|
81
|
+
const s = o.recordList[0];
|
|
82
|
+
a(s), v(t.length);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (i.type === "prev" && t.length) {
|
|
87
|
+
const d = n ? t.find((s) => s.id === n) : null;
|
|
88
|
+
if (d) {
|
|
89
|
+
const s = t.findIndex((V) => V.id === n);
|
|
90
|
+
b(s), a(d), v(t.length);
|
|
91
|
+
return;
|
|
92
|
+
} else {
|
|
93
|
+
b(i.pageSize - 1);
|
|
94
|
+
const s = o.recordList[i.pageSize - 1];
|
|
95
|
+
a(s), v(t.length);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
t.find((d) => d.id === n) ? (a(n ? t.find((d) => d.id === n) : t[0]), b(0), v(t.length)) : n ? h.getDatasetsIdVersionsVidSsamplesSid(m, S, n).then((d) => {
|
|
100
|
+
a(d);
|
|
101
|
+
}) : (a(t[0]), b(0), v(t.length));
|
|
102
|
+
}), k();
|
|
103
|
+
}, [i.current, u, m, S]);
|
|
104
|
+
const k = () => {
|
|
105
|
+
!m || !S || h == null || h.getDatasetsIdVersionsVidLabelcount(m, S).then((e) => {
|
|
106
|
+
const l = e.find((t) => t.id === "allcodeid"), o = e.find((t) => t.id === "nocodeid");
|
|
107
|
+
J(l ? l.count : 0), U(o ? o.count : 0);
|
|
108
|
+
});
|
|
109
|
+
}, Z = () => {
|
|
110
|
+
p && D((e) => {
|
|
111
|
+
var t, g, N, d;
|
|
112
|
+
let l;
|
|
113
|
+
const o = !r || (t = r.labels) != null && t.length && u === "hascode" || !((g = r.labels) != null && g.length) && u === "nocode" || u === "" ? j + 1 : j;
|
|
114
|
+
if (r && ((N = r.labels) != null && N.length && u === "nocode" || !((d = r.labels) != null && d.length) && u === "hascode")) {
|
|
115
|
+
const s = e.findIndex((V) => V.id === r.id);
|
|
116
|
+
s > -1 && (e.splice(s, 1), l = [...e], i.total && (i.total = i.total - 1));
|
|
117
|
+
}
|
|
118
|
+
if (o >= e.length) {
|
|
119
|
+
const s = (i.current - 1) * i.pageSize + o;
|
|
120
|
+
i.total && s >= i.total ? y.error("已经是最后一个了") : P({
|
|
121
|
+
current: i.current + 1,
|
|
122
|
+
pageSize: i.pageSize,
|
|
123
|
+
type: "next"
|
|
124
|
+
});
|
|
125
|
+
} else
|
|
126
|
+
setTimeout(() => {
|
|
127
|
+
b(o);
|
|
128
|
+
const s = e[o];
|
|
129
|
+
a(s);
|
|
130
|
+
}, 200);
|
|
131
|
+
return l || e;
|
|
132
|
+
});
|
|
133
|
+
}, ce = () => {
|
|
134
|
+
var o, t;
|
|
135
|
+
if (!p)
|
|
136
|
+
return;
|
|
137
|
+
let e;
|
|
138
|
+
if (r && p && ((o = r.labels) != null && o.length && u === "nocode" || !((t = r.labels) != null && t.length) && u === "hascode")) {
|
|
139
|
+
const g = p.findIndex((N) => N.id === r.id);
|
|
140
|
+
g > -1 && (p.splice(g, 1), e = [...p], i.total && (i.total = i.total - 1));
|
|
141
|
+
}
|
|
142
|
+
const l = j - 1;
|
|
143
|
+
if (l < 0)
|
|
144
|
+
(i.current - 1) * i.pageSize + l < 0 ? y.error("已经是第一个了") : P({
|
|
145
|
+
current: i.current - 1,
|
|
146
|
+
pageSize: i.pageSize,
|
|
147
|
+
type: "prev"
|
|
148
|
+
});
|
|
149
|
+
else {
|
|
150
|
+
b(l);
|
|
151
|
+
const g = p[l];
|
|
152
|
+
a(g);
|
|
153
|
+
}
|
|
154
|
+
e && D(e);
|
|
155
|
+
};
|
|
156
|
+
W(() => {
|
|
157
|
+
c && m && S && r && (h == null || h.getDatasetsIdVersionsVidSsamplesSid(m, S, r.id).then((e) => {
|
|
158
|
+
a(e);
|
|
159
|
+
}));
|
|
160
|
+
}, [r == null ? void 0 : r.id]), W(() => {
|
|
161
|
+
z.current && (z.current.width = z.current.offsetWidth, z.current.height = z.current.offsetHeight);
|
|
162
|
+
}, [z.current]);
|
|
163
|
+
const _ = () => {
|
|
164
|
+
r && (R(!0), E(r).then((e) => {
|
|
165
|
+
e ? (ce(), k()) : y.error("保存失败");
|
|
166
|
+
}).finally(() => {
|
|
167
|
+
R(!1);
|
|
168
|
+
}));
|
|
169
|
+
}, ee = () => {
|
|
170
|
+
r && (R(!0), E(r).then((e) => {
|
|
171
|
+
e ? (Z(), k()) : y.error("保存失败");
|
|
172
|
+
}).finally(() => {
|
|
173
|
+
R(!1);
|
|
174
|
+
}));
|
|
175
|
+
};
|
|
176
|
+
return /* @__PURE__ */ T(he, {
|
|
177
|
+
children: [/* @__PURE__ */ T("div", {
|
|
178
|
+
className: "ocr-box-detail-records-content",
|
|
179
|
+
children: [/* @__PURE__ */ T(oe, {
|
|
180
|
+
className: "ocr-box-detail-records-content-tabs",
|
|
181
|
+
activeKey: u,
|
|
182
|
+
onChange: (e) => {
|
|
183
|
+
P(K(w({}, i), {
|
|
184
|
+
current: 1
|
|
185
|
+
})), le(e), M == null || M(e);
|
|
186
|
+
},
|
|
187
|
+
children: [/* @__PURE__ */ C(q, {
|
|
188
|
+
tab: `全部(${G})`
|
|
189
|
+
}, ""), /* @__PURE__ */ C(q, {
|
|
190
|
+
tab: `未标注(${Q})`
|
|
191
|
+
}, "nocode"), /* @__PURE__ */ C(q, {
|
|
192
|
+
tab: `已标注(${G - Q})`
|
|
193
|
+
}, "hascode")]
|
|
194
|
+
}), p != null && p.length ? /* @__PURE__ */ C(me, {
|
|
195
|
+
currentSample: r,
|
|
196
|
+
categories: se,
|
|
197
|
+
onChange: (e) => {
|
|
198
|
+
a(e), D((l) => {
|
|
199
|
+
const o = l.findIndex((t) => t.id === e.id);
|
|
200
|
+
return l[o] = e, [...l];
|
|
201
|
+
});
|
|
202
|
+
},
|
|
203
|
+
onNextClick: ee,
|
|
204
|
+
onPrevClick: _
|
|
205
|
+
}) : /* @__PURE__ */ C(xe, {})]
|
|
206
|
+
}), /* @__PURE__ */ T("div", {
|
|
207
|
+
className: "ocr-box-detail-footer",
|
|
208
|
+
children: [/* @__PURE__ */ T("span", {
|
|
209
|
+
className: "ocr-modal-label-count",
|
|
210
|
+
children: ["当前图片标注框数量:", ((te = r == null ? void 0 : r.labels) == null ? void 0 : te.length) || 0]
|
|
211
|
+
}), /* @__PURE__ */ C(O, {
|
|
212
|
+
disabled: !r || B,
|
|
213
|
+
type: "primary",
|
|
214
|
+
loading: H,
|
|
215
|
+
onClick: () => {
|
|
216
|
+
r && (Y(!0), E(r).then((e) => {
|
|
217
|
+
e ? (y.success("保存成功"), Z(), k()) : y.error("保存失败");
|
|
218
|
+
}).finally(() => {
|
|
219
|
+
Y(!1);
|
|
220
|
+
}));
|
|
221
|
+
},
|
|
222
|
+
children: "保存标注"
|
|
223
|
+
}, "save"), /* @__PURE__ */ C(O, {
|
|
224
|
+
type: "default",
|
|
225
|
+
onClick: _,
|
|
226
|
+
disabled: B || H,
|
|
227
|
+
children: "上一张"
|
|
228
|
+
}, "prev"), /* @__PURE__ */ C(O, {
|
|
229
|
+
type: "default",
|
|
230
|
+
onClick: ee,
|
|
231
|
+
disabled: B || H,
|
|
232
|
+
children: "下一张"
|
|
233
|
+
}, "next")]
|
|
234
|
+
})]
|
|
235
|
+
});
|
|
236
|
+
};
|
|
237
|
+
export {
|
|
238
|
+
De as default
|
|
239
|
+
};
|
|
@@ -1,178 +1,211 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { Modal as
|
|
1
|
+
import { jsx as t, jsxs as a, Fragment as k } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as u, useState as r, useContext as oe, useEffect as R } from "react";
|
|
3
|
+
import { Modal as I, Button as c, Tabs as z, Tooltip as se, Space as ie, message as w } from "antd";
|
|
4
4
|
import "./style.less.mjs";
|
|
5
|
-
import
|
|
6
|
-
import { useKeyPress as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
import T from "react-json-view";
|
|
6
|
+
import { useKeyPress as j } from "ahooks";
|
|
7
|
+
import ne from "../../MarkDescriptions/index.mjs";
|
|
8
|
+
import P from "../../Iconfont/index.mjs";
|
|
9
|
+
import le from "../../../DatasetContext/index.mjs";
|
|
10
|
+
import re from "../../OCRImageViewer/index.mjs";
|
|
11
|
+
import de from "../../ScanTable/index.mjs";
|
|
12
|
+
import ce from "../OCRBoxDetail/index.mjs";
|
|
13
|
+
const me = T.default || T, {
|
|
14
|
+
TabPane: V
|
|
15
|
+
} = z, ke = (D) => {
|
|
16
|
+
var x, M, O;
|
|
16
17
|
const {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
mode: m = "preview",
|
|
19
|
+
visible: d,
|
|
20
|
+
onClose: C,
|
|
21
|
+
record: f,
|
|
22
|
+
onNextClick: g,
|
|
21
23
|
onPrevClick: b,
|
|
22
24
|
datasetId: i,
|
|
23
|
-
versionId:
|
|
24
|
-
ocrMarkTmpl:
|
|
25
|
-
handleMarkClick:
|
|
26
|
-
updateSampleList:
|
|
27
|
-
isPreLabel:
|
|
28
|
-
|
|
25
|
+
versionId: l,
|
|
26
|
+
ocrMarkTmpl: n,
|
|
27
|
+
handleMarkClick: F,
|
|
28
|
+
updateSampleList: J,
|
|
29
|
+
isPreLabel: p,
|
|
30
|
+
selectSampleId: K,
|
|
31
|
+
onSave: L,
|
|
32
|
+
filterMode: B,
|
|
33
|
+
pagination: E,
|
|
34
|
+
currentIndex: q,
|
|
35
|
+
onFilterModeChange: A,
|
|
36
|
+
onPaginationChange: U,
|
|
37
|
+
samples: W
|
|
38
|
+
} = D, G = u(null), H = u({}), [h, Q] = r("annotation"), [e, X] = r(), [Y, Z] = r(), [y, _] = r([]), [$, v] = r(!1), {
|
|
29
39
|
services: {
|
|
30
|
-
cvforceDatahub:
|
|
40
|
+
cvforceDatahub: o
|
|
31
41
|
},
|
|
32
42
|
featuresConfig: {
|
|
33
|
-
datasetManager:
|
|
43
|
+
datasetManager: N
|
|
34
44
|
} = {
|
|
35
45
|
datasetManager: !1
|
|
36
46
|
}
|
|
37
|
-
} =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}),
|
|
47
|
+
} = oe(le);
|
|
48
|
+
j("rightarrow", () => {
|
|
49
|
+
g();
|
|
50
|
+
}), j("leftarrow", () => {
|
|
41
51
|
b();
|
|
42
|
-
}),
|
|
43
|
-
i && (
|
|
44
|
-
}, [i]),
|
|
45
|
-
|
|
46
|
-
|
|
52
|
+
}), R(() => {
|
|
53
|
+
i && (o == null || o.listCategory(i).then((s) => _(s || [])));
|
|
54
|
+
}, [i]), R(() => {
|
|
55
|
+
d && i && l && f && m === "preview" && (o == null || o.getDatasetsIdVersionsVidSsamplesSid(i, l, f.id).then((s) => {
|
|
56
|
+
X(s);
|
|
47
57
|
}));
|
|
48
|
-
}, [
|
|
49
|
-
const
|
|
50
|
-
C(
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
|
|
58
|
+
}, [d, f]);
|
|
59
|
+
const S = () => {
|
|
60
|
+
C();
|
|
61
|
+
}, ee = (s) => {
|
|
62
|
+
Q(s);
|
|
63
|
+
}, te = (s) => {
|
|
64
|
+
Z(s);
|
|
65
|
+
}, ae = () => {
|
|
66
|
+
I.confirm({
|
|
57
67
|
title: "确认要删除此数据吗?",
|
|
58
68
|
content: "删除后不可恢复,请慎重操作",
|
|
59
69
|
onOk: () => {
|
|
60
|
-
!i || !
|
|
61
|
-
|
|
62
|
-
}).catch(() =>
|
|
70
|
+
!i || !l || !(e != null && e.id) || o == null || o.delDatasetsIdVersionsVidSamplesId(i, l, e.id).then(() => {
|
|
71
|
+
w.success("删除成功"), C(), J();
|
|
72
|
+
}).catch(() => w.error("删除失败"));
|
|
63
73
|
}
|
|
64
74
|
});
|
|
65
75
|
};
|
|
66
|
-
return /* @__PURE__ */
|
|
67
|
-
title: /* @__PURE__ */ a("div", {
|
|
76
|
+
return /* @__PURE__ */ t(I, {
|
|
77
|
+
title: m === "preview" ? /* @__PURE__ */ a("div", {
|
|
68
78
|
children: ["详情", /* @__PURE__ */ a("span", {
|
|
69
79
|
className: "ocr-modal-label-count",
|
|
70
|
-
children: ["标注框数量:", (
|
|
80
|
+
children: ["标注框数量:", (x = e == null ? void 0 : e.labels) == null ? void 0 : x.length]
|
|
71
81
|
})]
|
|
72
|
-
}),
|
|
82
|
+
}) : "标注",
|
|
73
83
|
width: "100%",
|
|
74
84
|
wrapClassName: "ocr-modal-wrap",
|
|
75
85
|
className: "ocr-modal",
|
|
76
|
-
|
|
86
|
+
style: {
|
|
87
|
+
padding: 12
|
|
88
|
+
},
|
|
89
|
+
open: d,
|
|
77
90
|
destroyOnClose: !0,
|
|
78
|
-
onCancel: () =>
|
|
91
|
+
onCancel: () => S(),
|
|
79
92
|
maskClosable: !1,
|
|
80
93
|
centered: !0,
|
|
81
94
|
footer: null,
|
|
82
|
-
children:
|
|
83
|
-
className: "ocr-detail",
|
|
95
|
+
children: m === "preview" ? /* @__PURE__ */ a(k, {
|
|
84
96
|
children: [/* @__PURE__ */ a("div", {
|
|
85
|
-
className: "detail
|
|
86
|
-
children: [/* @__PURE__ */
|
|
87
|
-
className: "
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
children: /* @__PURE__ */ a(V, {
|
|
117
|
-
className: "header-tab",
|
|
118
|
-
onChange: U,
|
|
119
|
-
activeKey: f,
|
|
120
|
-
children: [/* @__PURE__ */ s(I, {
|
|
121
|
-
tab: "标注信息"
|
|
122
|
-
}, "annotation"), /* @__PURE__ */ s(I, {
|
|
123
|
-
tab: "JSON"
|
|
124
|
-
}, "json")]
|
|
125
|
-
})
|
|
126
|
-
}), /* @__PURE__ */ a("div", {
|
|
127
|
-
className: "slide-main",
|
|
128
|
-
children: [f === "annotation" && /* @__PURE__ */ s(H, {
|
|
129
|
-
children: l === "TableOCR" ? /* @__PURE__ */ s(S, {
|
|
130
|
-
currentInfer: e == null ? void 0 : e.labels,
|
|
131
|
-
onCellSelect: (o) => W(o),
|
|
132
|
-
currentCell: L
|
|
133
|
-
}) : (M = e == null ? void 0 : e.labels) != null && M.length ? /* @__PURE__ */ s(Z, {
|
|
134
|
-
labels: e == null ? void 0 : e.labels,
|
|
135
|
-
catagories: q
|
|
136
|
-
}) : "暂无标注信息"
|
|
137
|
-
}), f === "json" && /* @__PURE__ */ s(ee, {
|
|
138
|
-
name: !1,
|
|
139
|
-
iconStyle: "square",
|
|
140
|
-
indentWidth: 2,
|
|
141
|
-
displayDataTypes: !1,
|
|
142
|
-
displayObjectSize: !1,
|
|
143
|
-
enableClipboard: !1,
|
|
144
|
-
src: l === "TableOCR" ? e == null ? void 0 : e.labels : (e == null ? void 0 : e.ocrJson) || {}
|
|
97
|
+
className: "ocr-detail",
|
|
98
|
+
children: [/* @__PURE__ */ a("div", {
|
|
99
|
+
className: "detail-content",
|
|
100
|
+
children: [/* @__PURE__ */ t(c, {
|
|
101
|
+
className: "select-prev",
|
|
102
|
+
icon: /* @__PURE__ */ t(P, {
|
|
103
|
+
type: "icon-zuojiantou"
|
|
104
|
+
}),
|
|
105
|
+
type: "text",
|
|
106
|
+
onClick: () => b()
|
|
107
|
+
}), /* @__PURE__ */ a("div", {
|
|
108
|
+
className: "select-main",
|
|
109
|
+
ref: H,
|
|
110
|
+
children: [((M = e == null ? void 0 : e.sampleFileName) == null ? void 0 : M.name) && /* @__PURE__ */ t("div", {
|
|
111
|
+
className: "img-detail-name-overlay",
|
|
112
|
+
children: e.sampleFileName.name
|
|
113
|
+
}), /* @__PURE__ */ t(re, {
|
|
114
|
+
zoomMin: 0.1,
|
|
115
|
+
zoomMax: 10,
|
|
116
|
+
zoomStep: 0.1,
|
|
117
|
+
url: (e == null ? void 0 : e.fileUrl) || "",
|
|
118
|
+
ref: G,
|
|
119
|
+
labels: e == null ? void 0 : e.labels
|
|
120
|
+
})]
|
|
121
|
+
}), /* @__PURE__ */ t(c, {
|
|
122
|
+
className: "select-next",
|
|
123
|
+
icon: /* @__PURE__ */ t(P, {
|
|
124
|
+
type: "icon-youjiantou"
|
|
125
|
+
}),
|
|
126
|
+
type: "text",
|
|
127
|
+
onClick: () => g()
|
|
145
128
|
})]
|
|
146
|
-
})
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
129
|
+
}), n !== "DetectionOCR" && /* @__PURE__ */ a("div", {
|
|
130
|
+
className: "detail-slide",
|
|
131
|
+
children: [/* @__PURE__ */ t("div", {
|
|
132
|
+
className: "slide-header",
|
|
133
|
+
children: /* @__PURE__ */ a(z, {
|
|
134
|
+
className: "header-tab",
|
|
135
|
+
onChange: ee,
|
|
136
|
+
activeKey: h,
|
|
137
|
+
children: [/* @__PURE__ */ t(V, {
|
|
138
|
+
tab: "标注信息"
|
|
139
|
+
}, "annotation"), /* @__PURE__ */ t(V, {
|
|
140
|
+
tab: "JSON"
|
|
141
|
+
}, "json")]
|
|
142
|
+
})
|
|
143
|
+
}), /* @__PURE__ */ a("div", {
|
|
144
|
+
className: "slide-main",
|
|
145
|
+
children: [h === "annotation" && /* @__PURE__ */ t(k, {
|
|
146
|
+
children: n === "TableOCR" ? /* @__PURE__ */ t(de, {
|
|
147
|
+
currentInfer: e == null ? void 0 : e.labels,
|
|
148
|
+
onCellSelect: (s) => te(s),
|
|
149
|
+
currentCell: Y
|
|
150
|
+
}) : (O = e == null ? void 0 : e.labels) != null && O.length ? /* @__PURE__ */ t(ne, {
|
|
151
|
+
labels: e == null ? void 0 : e.labels,
|
|
152
|
+
catagories: y
|
|
153
|
+
}) : "暂无标注信息"
|
|
154
|
+
}), h === "json" && /* @__PURE__ */ t(me, {
|
|
155
|
+
name: !1,
|
|
156
|
+
iconStyle: "square",
|
|
157
|
+
indentWidth: 2,
|
|
158
|
+
displayDataTypes: !1,
|
|
159
|
+
displayObjectSize: !1,
|
|
160
|
+
enableClipboard: !1,
|
|
161
|
+
src: n === "TableOCR" ? e == null ? void 0 : e.labels : (e == null ? void 0 : e.ocrJson) || {}
|
|
162
|
+
})]
|
|
170
163
|
})]
|
|
164
|
+
})]
|
|
165
|
+
}), /* @__PURE__ */ t("div", {
|
|
166
|
+
className: "ocr-mark-action",
|
|
167
|
+
style: n === "DetectionOCR" ? {
|
|
168
|
+
width: "100%"
|
|
169
|
+
} : void 0,
|
|
170
|
+
children: /* @__PURE__ */ t(se, {
|
|
171
|
+
title: "预标注进行中,请任务完成后再试",
|
|
172
|
+
open: $,
|
|
173
|
+
children: /* @__PURE__ */ a(ie, {
|
|
174
|
+
onMouseEnter: () => p && v(!0),
|
|
175
|
+
onMouseLeave: () => v(!1),
|
|
176
|
+
children: [/* @__PURE__ */ t(c, {
|
|
177
|
+
type: "primary",
|
|
178
|
+
disabled: n !== "StructKVCOCR" && n !== "DetectionOCR" || p,
|
|
179
|
+
onClick: () => F(e == null ? void 0 : e.id),
|
|
180
|
+
children: "标注"
|
|
181
|
+
}), N && N.delete && /* @__PURE__ */ t(c, {
|
|
182
|
+
danger: !0,
|
|
183
|
+
type: "ghost",
|
|
184
|
+
onClick: ae,
|
|
185
|
+
disabled: p,
|
|
186
|
+
children: "删除数据"
|
|
187
|
+
})]
|
|
188
|
+
})
|
|
171
189
|
})
|
|
172
|
-
})
|
|
173
|
-
})
|
|
190
|
+
})]
|
|
191
|
+
}) : /* @__PURE__ */ t(ce, {
|
|
192
|
+
visible: d,
|
|
193
|
+
selectSampleId: K,
|
|
194
|
+
ocrMarkTmpl: n,
|
|
195
|
+
datasetId: i,
|
|
196
|
+
versionId: l,
|
|
197
|
+
onClose: C,
|
|
198
|
+
onSave: L,
|
|
199
|
+
categories: y,
|
|
200
|
+
externalFilterMode: B,
|
|
201
|
+
onFilterModeChange: A,
|
|
202
|
+
onPaginationChange: U,
|
|
203
|
+
externalSamples: W,
|
|
204
|
+
externalPagination: E,
|
|
205
|
+
externalCurrentIndex: q
|
|
206
|
+
})
|
|
174
207
|
});
|
|
175
208
|
};
|
|
176
209
|
export {
|
|
177
|
-
|
|
210
|
+
ke as default
|
|
178
211
|
};
|