@glodon-aiot/dataset-annotation 3.16.0-alpha.37 → 3.16.0-alpha.39
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/LabelMaker/index.mjs +61 -53
- 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 +268 -247
- package/dist/es/components/PreLabelOCR/PreLabelModal.mjs +60 -60
- 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
|
@@ -1,373 +1,394 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var
|
|
10
|
-
Pe.call(
|
|
11
|
-
return
|
|
12
|
-
}, C = (
|
|
13
|
-
import { jsx as
|
|
14
|
-
import { useState as
|
|
15
|
-
import { message as
|
|
16
|
-
import
|
|
1
|
+
var Ve = Object.defineProperty, Le = Object.defineProperties;
|
|
2
|
+
var Re = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var ie = Object.getOwnPropertySymbols;
|
|
4
|
+
var Oe = Object.prototype.hasOwnProperty, Pe = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var ne = (p, c, i) => c in p ? Ve(p, c, { enumerable: !0, configurable: !0, writable: !0, value: i }) : p[c] = i, m = (p, c) => {
|
|
6
|
+
for (var i in c || (c = {}))
|
|
7
|
+
Oe.call(c, i) && ne(p, i, c[i]);
|
|
8
|
+
if (ie)
|
|
9
|
+
for (var i of ie(c))
|
|
10
|
+
Pe.call(c, i) && ne(p, i, c[i]);
|
|
11
|
+
return p;
|
|
12
|
+
}, C = (p, c) => Le(p, Re(c));
|
|
13
|
+
import { jsx as l, jsxs as x } from "react/jsx-runtime";
|
|
14
|
+
import { useState as s, useEffect as h } from "react";
|
|
15
|
+
import { message as H, ConfigProvider as we, Space as y, Select as Ne, Tabs as ze, Tooltip as Ke, Button as Be, Row as Ee, Col as Ae, Pagination as Fe } from "antd";
|
|
16
|
+
import Ue from "antd/es/locale/zh_CN";
|
|
17
17
|
import "./style.less.mjs";
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import { UploadZipsStatus as
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import { DEFAULT_FILTER_SWITCH as
|
|
29
|
-
import
|
|
30
|
-
const
|
|
18
|
+
import Ze from "./OcrModal/index.mjs";
|
|
19
|
+
import $e from "./MarkKVOCRModal/index.mjs";
|
|
20
|
+
import je from "./MarkOCRBoxModal/index.mjs";
|
|
21
|
+
import We from "./PreLabelOCR/index.mjs";
|
|
22
|
+
import _e from "lodash/merge";
|
|
23
|
+
import { UploadZipsStatus as ce, PreLabelTaskStatus as He } from "@glodon-aiot/apis";
|
|
24
|
+
import Je from "../../Common/Page/index.mjs";
|
|
25
|
+
import Qe from "../Thumbnail/index.mjs";
|
|
26
|
+
import qe from "../DataEmpty/index.mjs";
|
|
27
|
+
import Ge from "../../DatasetContext/index.mjs";
|
|
28
|
+
import { DEFAULT_FILTER_SWITCH as Xe } from "../../constant.mjs";
|
|
29
|
+
import Ye from "../PageNav/index.mjs";
|
|
30
|
+
const Ct = (p) => {
|
|
31
31
|
const {
|
|
32
|
-
services:
|
|
33
|
-
datasetId:
|
|
34
|
-
versionId:
|
|
35
|
-
backTo:
|
|
36
|
-
labelManager:
|
|
37
|
-
datasetManager:
|
|
38
|
-
annotation:
|
|
39
|
-
header:
|
|
32
|
+
services: c,
|
|
33
|
+
datasetId: i,
|
|
34
|
+
versionId: z,
|
|
35
|
+
backTo: le,
|
|
36
|
+
labelManager: ae = !1,
|
|
37
|
+
datasetManager: v = !1,
|
|
38
|
+
annotation: se,
|
|
39
|
+
header: f = {
|
|
40
40
|
versionSelect: !1
|
|
41
41
|
},
|
|
42
|
-
exampleSrcRoot:
|
|
43
|
-
} =
|
|
42
|
+
exampleSrcRoot: de
|
|
43
|
+
} = p, [o, ue] = s(), [t, K] = s(), [D, fe] = s([]), [J, Q] = s(!1), [V, L] = s(!1), [M, q] = s(0), [d, B] = s(), [I, g] = s(), [G, R] = s(), [E, T] = s(-1), [a, k] = s({
|
|
44
44
|
current: 1,
|
|
45
45
|
pageSize: 50
|
|
46
|
-
}), [
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
},
|
|
46
|
+
}), [O, X] = s(0), [S, A] = s(""), [Y, F] = s(!1), [ee, te] = s(), [U, oe] = s(!1), [P, Z] = s(null), [pe, re] = s(!1), [me, he] = s(!1), [$, ge] = s(""), [be, Ce] = s(), [j, w] = s("preview"), W = m({}, Xe);
|
|
47
|
+
_e(W, p.filterSwitch);
|
|
48
|
+
const ke = () => {
|
|
49
|
+
R(void 0), (o == null ? void 0 : o.ocrMarkTmpl) === "StructKVCOCR" ? F(!0) : (w("annotation"), L(!0), A("nocode"));
|
|
50
|
+
}, Se = (e, r) => {
|
|
51
51
|
k({
|
|
52
52
|
current: e,
|
|
53
|
-
pageSize:
|
|
53
|
+
pageSize: r
|
|
54
54
|
});
|
|
55
|
-
},
|
|
56
|
-
if (!
|
|
55
|
+
}, Me = (e) => {
|
|
56
|
+
if (!d)
|
|
57
57
|
return;
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
|
|
58
|
+
T(e);
|
|
59
|
+
const r = d[e];
|
|
60
|
+
g(r), w("preview"), L(!0);
|
|
61
61
|
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}, [
|
|
65
|
-
|
|
62
|
+
h(() => {
|
|
63
|
+
c.cvforceDatahub && c.cvforceDatahub.getOptionsImgproxy().then((e) => Ce(e));
|
|
64
|
+
}, [c.cvforceDatahub]), h(() => {
|
|
65
|
+
i && (Q(!0), Promise.all([
|
|
66
66
|
// 数据集
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
c.cvforceDatahub.getDatasetsId(i).then((e) => {
|
|
68
|
+
ue(e);
|
|
69
69
|
}),
|
|
70
70
|
// 版本列表
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
c.cvforceDatahub.getDatasetsIdVersions(i, 1, 1e3).then((e) => {
|
|
72
|
+
fe(e.recordList), K(z ? e.recordList.find((r) => r.id === z) : e.recordList[0]);
|
|
73
73
|
})
|
|
74
|
-
]).finally(() =>
|
|
75
|
-
}, [
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
R(e);
|
|
80
|
-
}),
|
|
81
|
-
// 版本列表
|
|
82
|
-
n.cvforceDatahub.getDatasetsIdVersions(r, 1, 1e3).then((e) => {
|
|
83
|
-
j(e.recordList), I(S ? e.recordList.find((o) => o.id === S) : e.recordList[0]);
|
|
84
|
-
})
|
|
85
|
-
]).finally(() => L(!1)));
|
|
86
|
-
}, [r, S]), m(() => {
|
|
87
|
-
r && n.cvforceDatahub.getDatasetsId(r).then((e) => {
|
|
88
|
-
R(e);
|
|
89
|
-
});
|
|
90
|
-
}, []);
|
|
91
|
-
const Se = () => {
|
|
92
|
-
!r || !t || n.cvforceDatahub.getDatasetsIdVersionsVid(r, t.id).then((e) => {
|
|
93
|
-
me(e.versionAsyncTask.state);
|
|
74
|
+
]).finally(() => Q(!1)));
|
|
75
|
+
}, [i, z]);
|
|
76
|
+
const Te = () => {
|
|
77
|
+
!i || !t || c.cvforceDatahub.getDatasetsIdVersionsVid(i, t.id).then((e) => {
|
|
78
|
+
ge(e.versionAsyncTask.state);
|
|
94
79
|
});
|
|
95
80
|
};
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}, [
|
|
99
|
-
|
|
100
|
-
}, [
|
|
101
|
-
const
|
|
102
|
-
!
|
|
103
|
-
const
|
|
104
|
-
|
|
81
|
+
h(() => {
|
|
82
|
+
Te();
|
|
83
|
+
}, [i, t == null ? void 0 : t.id]), h(() => {
|
|
84
|
+
$ !== ce.Pending && $ !== ce.Started || H.warning("文件导入中,请刷新页面再试");
|
|
85
|
+
}, [$]);
|
|
86
|
+
const xe = () => {
|
|
87
|
+
!i || !t || c.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(i, t.id).then((e) => {
|
|
88
|
+
const r = e.find((u) => u.id === "allcodeid"), n = e.find((u) => u.id === "nocodeid");
|
|
89
|
+
q(r ? r.count : 0), X(n ? n.count : 0);
|
|
105
90
|
});
|
|
106
|
-
},
|
|
107
|
-
const e =
|
|
108
|
-
!
|
|
109
|
-
labels:
|
|
91
|
+
}, N = () => {
|
|
92
|
+
const e = a.current || 1, r = a.pageSize || 50;
|
|
93
|
+
!i || !t || (c.cvforceDatahub.getDatasetsIdVersionsVidSamples(i, t.id, {
|
|
94
|
+
labels: S || void 0,
|
|
110
95
|
pageNo: e,
|
|
111
|
-
pageSize:
|
|
112
|
-
}).then((
|
|
113
|
-
const
|
|
114
|
-
if (!
|
|
115
|
-
k(C(
|
|
116
|
-
current: Math.ceil(
|
|
117
|
-
})), Math.ceil(
|
|
96
|
+
pageSize: r
|
|
97
|
+
}).then((n) => {
|
|
98
|
+
const u = n.recordList || [];
|
|
99
|
+
if (!u.length && n.totalResults > 0) {
|
|
100
|
+
k(C(m({}, a), {
|
|
101
|
+
current: Math.ceil(n.totalResults / r)
|
|
102
|
+
})), Math.ceil(n.totalResults / r) === e && B([]);
|
|
118
103
|
return;
|
|
119
104
|
}
|
|
120
|
-
if (
|
|
121
|
-
total:
|
|
122
|
-
})),
|
|
123
|
-
|
|
124
|
-
const
|
|
125
|
-
b
|
|
105
|
+
if (B(u), k(C(m({}, a), {
|
|
106
|
+
total: n.totalResults
|
|
107
|
+
})), a.type === "next" && u.length) {
|
|
108
|
+
T(0);
|
|
109
|
+
const b = n.recordList[0];
|
|
110
|
+
g(b);
|
|
126
111
|
}
|
|
127
|
-
if (
|
|
128
|
-
|
|
129
|
-
const
|
|
130
|
-
b
|
|
112
|
+
if (a.type === "prev" && u.length) {
|
|
113
|
+
T(a.pageSize - 1);
|
|
114
|
+
const b = n.recordList[a.pageSize - 1];
|
|
115
|
+
g(b);
|
|
131
116
|
}
|
|
132
|
-
}),
|
|
117
|
+
}), xe());
|
|
133
118
|
};
|
|
134
|
-
|
|
135
|
-
const
|
|
136
|
-
if (!
|
|
119
|
+
h(N, [a.current, a.pageSize, S, ee, t == null ? void 0 : t.id, i]);
|
|
120
|
+
const ve = () => {
|
|
121
|
+
if (!d)
|
|
137
122
|
return;
|
|
138
|
-
const e =
|
|
139
|
-
if (e >=
|
|
140
|
-
let
|
|
141
|
-
|
|
142
|
-
current:
|
|
143
|
-
pageSize:
|
|
123
|
+
const e = E + 1;
|
|
124
|
+
if (e >= d.length) {
|
|
125
|
+
let r = M;
|
|
126
|
+
S === "hascode" && (r = M - O), S === "nocode" && (r = O), (a.current - 1) * a.pageSize + e >= r ? H.error("已经是最后一个了") : k({
|
|
127
|
+
current: a.current + 1,
|
|
128
|
+
pageSize: a.pageSize,
|
|
144
129
|
type: "next"
|
|
145
130
|
});
|
|
146
131
|
} else {
|
|
147
|
-
|
|
148
|
-
const
|
|
149
|
-
|
|
132
|
+
T(e);
|
|
133
|
+
const r = d[e];
|
|
134
|
+
g(r);
|
|
150
135
|
}
|
|
151
|
-
},
|
|
152
|
-
if (!
|
|
136
|
+
}, Ie = () => {
|
|
137
|
+
if (!d)
|
|
153
138
|
return;
|
|
154
|
-
const e =
|
|
139
|
+
const e = E - 1;
|
|
155
140
|
if (e < 0)
|
|
156
|
-
(
|
|
157
|
-
current:
|
|
158
|
-
pageSize:
|
|
141
|
+
(a.current - 1) * a.pageSize + e < 0 ? H.error("已经是第一个了") : k({
|
|
142
|
+
current: a.current - 1,
|
|
143
|
+
pageSize: a.pageSize,
|
|
159
144
|
type: "prev"
|
|
160
145
|
});
|
|
161
146
|
else {
|
|
162
|
-
|
|
163
|
-
const
|
|
164
|
-
|
|
147
|
+
T(e);
|
|
148
|
+
const r = d[e];
|
|
149
|
+
g(r);
|
|
165
150
|
}
|
|
166
151
|
};
|
|
167
|
-
|
|
168
|
-
if (!
|
|
169
|
-
P && (clearTimeout(P),
|
|
152
|
+
h(() => {
|
|
153
|
+
if (!i) {
|
|
154
|
+
P && (clearTimeout(P), Z(null)), te(void 0);
|
|
170
155
|
return;
|
|
171
156
|
}
|
|
172
|
-
|
|
173
|
-
}, [t == null ? void 0 : t.id]),
|
|
174
|
-
|
|
175
|
-
}, [
|
|
176
|
-
const
|
|
177
|
-
!
|
|
178
|
-
const
|
|
179
|
-
if (
|
|
180
|
-
|
|
157
|
+
_();
|
|
158
|
+
}, [t == null ? void 0 : t.id]), h(() => {
|
|
159
|
+
_();
|
|
160
|
+
}, [me]);
|
|
161
|
+
const _ = () => {
|
|
162
|
+
!i || !t || c.cvforceDatahub.getPreLabelTask(i, t.id).then((e) => {
|
|
163
|
+
const r = e[0];
|
|
164
|
+
if (te(r), P && (clearTimeout(P), Z(null)), !(r != null && r.state) || r.state !== He.Started) {
|
|
165
|
+
oe(!1);
|
|
181
166
|
return;
|
|
182
167
|
} else
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
168
|
+
oe(!0);
|
|
169
|
+
Z(setTimeout(() => {
|
|
170
|
+
_();
|
|
186
171
|
}, 1e4));
|
|
187
172
|
});
|
|
188
|
-
},
|
|
173
|
+
}, ye = [{
|
|
189
174
|
key: "",
|
|
190
|
-
label: `全部(${
|
|
175
|
+
label: `全部(${M})`,
|
|
191
176
|
children: null
|
|
192
177
|
}, {
|
|
193
178
|
key: "nocode",
|
|
194
|
-
label: `未标注(${
|
|
179
|
+
label: `未标注(${O})`,
|
|
195
180
|
children: null
|
|
196
181
|
}, {
|
|
197
182
|
key: "hascode",
|
|
198
|
-
label: `已标注(${
|
|
183
|
+
label: `已标注(${M - O})`,
|
|
199
184
|
children: null
|
|
200
185
|
}];
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}, [
|
|
204
|
-
|
|
186
|
+
h(() => {
|
|
187
|
+
V || ((o == null ? void 0 : o.ocrMarkTmpl) === "StructKVCOCR" ? g(void 0) : (j === "annotation" && N(), g(void 0), T(-1), R(void 0), w("preview")));
|
|
188
|
+
}, [V, j]), h(() => {
|
|
189
|
+
o && (o.markType !== "ocr" || (o == null ? void 0 : o.ocrMarkTmpl) !== "DetectionOCR") && console.error(`当前数据集不是DetectionOCR(ocr检测)类型,请检查数据集类型。
|
|
205
190
|
请检查markType是否为ocr并且ocrMarkTmpl为DetectionOCR。`);
|
|
206
|
-
}, [
|
|
207
|
-
const De = (
|
|
208
|
-
return /* @__PURE__ */
|
|
209
|
-
locale:
|
|
210
|
-
children: /* @__PURE__ */
|
|
191
|
+
}, [o]);
|
|
192
|
+
const De = (o == null ? void 0 : o.ocrMarkTmpl) === "StructKVCOCR" ? $e : je;
|
|
193
|
+
return /* @__PURE__ */ l(we, {
|
|
194
|
+
locale: Ue,
|
|
195
|
+
children: /* @__PURE__ */ l(Ge.Provider, {
|
|
211
196
|
value: {
|
|
212
|
-
datasetId:
|
|
197
|
+
datasetId: i,
|
|
213
198
|
versionId: (t == null ? void 0 : t.id) || "",
|
|
214
199
|
no: (t == null ? void 0 : t.no) || "",
|
|
215
|
-
loading:
|
|
200
|
+
loading: J,
|
|
216
201
|
version: t,
|
|
217
|
-
versions:
|
|
218
|
-
samples:
|
|
219
|
-
pagination:
|
|
220
|
-
services:
|
|
202
|
+
versions: D,
|
|
203
|
+
samples: d,
|
|
204
|
+
pagination: a,
|
|
205
|
+
services: c,
|
|
221
206
|
featuresConfig: {
|
|
222
|
-
labelManager:
|
|
223
|
-
datasetManager:
|
|
224
|
-
annotation:
|
|
225
|
-
filterSwitch:
|
|
226
|
-
header:
|
|
227
|
-
exampleSrcRoot:
|
|
207
|
+
labelManager: ae,
|
|
208
|
+
datasetManager: v,
|
|
209
|
+
annotation: se,
|
|
210
|
+
filterSwitch: W,
|
|
211
|
+
header: f,
|
|
212
|
+
exampleSrcRoot: de
|
|
228
213
|
}
|
|
229
214
|
},
|
|
230
|
-
children:
|
|
215
|
+
children: o ? o.markType === "ocr" ? /* @__PURE__ */ x("div", {
|
|
231
216
|
className: "ocr-version-detail",
|
|
232
|
-
children: [/* @__PURE__ */
|
|
217
|
+
children: [/* @__PURE__ */ x(Je, {
|
|
233
218
|
className: "product-details-page",
|
|
234
|
-
header:
|
|
235
|
-
backTo:
|
|
236
|
-
onBackClick:
|
|
237
|
-
|
|
219
|
+
header: f === !1 ? void 0 : /* @__PURE__ */ l(Ye, {
|
|
220
|
+
backTo: le,
|
|
221
|
+
onBackClick: f != null && f.onBackClick ? () => {
|
|
222
|
+
f.onBackClick && f.onBackClick();
|
|
238
223
|
} : void 0,
|
|
239
|
-
left: !
|
|
240
|
-
children: [/* @__PURE__ */
|
|
224
|
+
left: !J && /* @__PURE__ */ x(y, {
|
|
225
|
+
children: [/* @__PURE__ */ l("span", {
|
|
241
226
|
style: {
|
|
242
227
|
fontWeight: "bold"
|
|
243
228
|
},
|
|
244
|
-
children:
|
|
245
|
-
}), /* @__PURE__ */
|
|
246
|
-
disabled: (
|
|
229
|
+
children: o == null ? void 0 : o.name
|
|
230
|
+
}), /* @__PURE__ */ l(Ne, {
|
|
231
|
+
disabled: (f == null ? void 0 : f.versionSelect) === !1,
|
|
247
232
|
value: t == null ? void 0 : t.id,
|
|
248
233
|
style: {
|
|
249
234
|
width: 70
|
|
250
235
|
},
|
|
251
|
-
options:
|
|
236
|
+
options: D.map((e) => ({
|
|
252
237
|
label: e.no,
|
|
253
238
|
value: e.id
|
|
254
239
|
})),
|
|
255
240
|
onChange: (e) => {
|
|
256
|
-
const
|
|
257
|
-
if (!
|
|
241
|
+
const r = D.find((u) => u.id === e);
|
|
242
|
+
if (!o || !r)
|
|
258
243
|
return;
|
|
259
|
-
const
|
|
260
|
-
|
|
244
|
+
const n = D.find((u) => u.id === r.id);
|
|
245
|
+
K(n), f != null && f.onVersionChange && f.onVersionChange(n);
|
|
261
246
|
}
|
|
262
247
|
})]
|
|
263
248
|
}),
|
|
264
|
-
right: /* @__PURE__ */
|
|
265
|
-
children: !
|
|
266
|
-
datasetId:
|
|
249
|
+
right: /* @__PURE__ */ l(y, {
|
|
250
|
+
children: !I && v && v.preLabel && (t != null && t.id) ? /* @__PURE__ */ l(We, {
|
|
251
|
+
datasetId: i,
|
|
267
252
|
versionId: t.id,
|
|
268
|
-
disabled: !
|
|
269
|
-
setIsTaskChange:
|
|
270
|
-
preLabelTask:
|
|
253
|
+
disabled: !M || (o == null ? void 0 : o.ocrMarkTmpl) !== "DetectionOCR",
|
|
254
|
+
setIsTaskChange: he,
|
|
255
|
+
preLabelTask: ee,
|
|
271
256
|
datasetType: "ocr"
|
|
272
257
|
}) : null
|
|
273
258
|
})
|
|
274
259
|
}),
|
|
275
|
-
children: [/* @__PURE__ */
|
|
260
|
+
children: [/* @__PURE__ */ x("div", {
|
|
276
261
|
className: "ocr-header",
|
|
277
|
-
children: [/* @__PURE__ */
|
|
278
|
-
children:
|
|
262
|
+
children: [/* @__PURE__ */ l(y, {
|
|
263
|
+
children: W.tabs && /* @__PURE__ */ l(ze, {
|
|
279
264
|
className: "header-tab",
|
|
280
|
-
|
|
265
|
+
activeKey: S,
|
|
281
266
|
onChange: (e) => {
|
|
282
|
-
k(C(
|
|
267
|
+
k(C(m({}, a), {
|
|
283
268
|
current: 1,
|
|
284
269
|
total: 0
|
|
285
|
-
})),
|
|
270
|
+
})), A(e);
|
|
286
271
|
},
|
|
287
|
-
items:
|
|
272
|
+
items: ye
|
|
288
273
|
})
|
|
289
|
-
}), /* @__PURE__ */
|
|
290
|
-
children:
|
|
274
|
+
}), /* @__PURE__ */ l(y, {
|
|
275
|
+
children: v && v.label && /* @__PURE__ */ l(Ke, {
|
|
291
276
|
title: "预标注进行中,请任务完成后再试",
|
|
292
|
-
open:
|
|
293
|
-
children: /* @__PURE__ */
|
|
277
|
+
open: pe,
|
|
278
|
+
children: /* @__PURE__ */ l(Be, {
|
|
294
279
|
type: "primary",
|
|
295
|
-
disabled: !
|
|
296
|
-
onClick:
|
|
297
|
-
onMouseEnter: () =>
|
|
298
|
-
onMouseLeave: () =>
|
|
280
|
+
disabled: !M || (o == null ? void 0 : o.ocrMarkTmpl) !== "StructKVCOCR" && (o == null ? void 0 : o.ocrMarkTmpl) !== "DetectionOCR" || U,
|
|
281
|
+
onClick: ke,
|
|
282
|
+
onMouseEnter: () => U && re(!0),
|
|
283
|
+
onMouseLeave: () => re(!1),
|
|
299
284
|
style: {
|
|
300
285
|
marginRight: "10px"
|
|
301
286
|
},
|
|
302
|
-
children: "
|
|
287
|
+
children: "标注"
|
|
303
288
|
})
|
|
304
289
|
})
|
|
305
290
|
})]
|
|
306
|
-
}), /* @__PURE__ */
|
|
291
|
+
}), /* @__PURE__ */ l("div", {
|
|
307
292
|
className: "d-row",
|
|
308
|
-
children:
|
|
293
|
+
children: d != null && d.length ? /* @__PURE__ */ x(y, {
|
|
309
294
|
direction: "vertical",
|
|
310
295
|
className: "d-right",
|
|
311
|
-
children: [/* @__PURE__ */
|
|
296
|
+
children: [/* @__PURE__ */ l(Ee, {
|
|
312
297
|
gutter: [16, 16],
|
|
313
298
|
wrap: !0,
|
|
314
299
|
className: "d-right-row",
|
|
315
|
-
children:
|
|
300
|
+
children: d == null ? void 0 : d.map((e, r) => /* @__PURE__ */ l(Ae, {
|
|
316
301
|
className: "d-right-col",
|
|
317
|
-
onClick: () =>
|
|
318
|
-
children: /* @__PURE__ */
|
|
302
|
+
onClick: () => Me(r),
|
|
303
|
+
children: /* @__PURE__ */ x("div", {
|
|
319
304
|
className: "right-col-wrapper",
|
|
320
|
-
children: /* @__PURE__ */
|
|
305
|
+
children: [/* @__PURE__ */ l("div", {
|
|
321
306
|
className: "right-col-img",
|
|
322
|
-
children: /* @__PURE__ */
|
|
307
|
+
children: /* @__PURE__ */ l(Qe, {
|
|
323
308
|
fileKey: e.fileKey,
|
|
324
309
|
width: 124,
|
|
325
|
-
imgProxy:
|
|
310
|
+
imgProxy: be
|
|
326
311
|
})
|
|
327
|
-
})
|
|
312
|
+
}), /* @__PURE__ */ l("div", {
|
|
313
|
+
className: "right-col-text",
|
|
314
|
+
children: /* @__PURE__ */ l("div", {
|
|
315
|
+
children: r + 1
|
|
316
|
+
})
|
|
317
|
+
})]
|
|
328
318
|
})
|
|
329
319
|
}, e.id))
|
|
330
|
-
}), /* @__PURE__ */
|
|
331
|
-
onChange:
|
|
320
|
+
}), /* @__PURE__ */ l(Fe, m({
|
|
321
|
+
onChange: Se,
|
|
332
322
|
className: "d-right-pageination",
|
|
333
323
|
showQuickJumper: !0,
|
|
334
324
|
showSizeChanger: !0
|
|
335
|
-
},
|
|
336
|
-
}) : /* @__PURE__ */
|
|
325
|
+
}, a))]
|
|
326
|
+
}) : /* @__PURE__ */ l(qe, {})
|
|
337
327
|
})]
|
|
338
|
-
}),
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
328
|
+
}), V && /* @__PURE__ */ l(Ze, {
|
|
329
|
+
mode: j,
|
|
330
|
+
visible: V,
|
|
331
|
+
onClose: () => L(!1),
|
|
332
|
+
record: I,
|
|
333
|
+
onNextClick: () => ve(),
|
|
334
|
+
onPrevClick: () => Ie(),
|
|
335
|
+
ocrMarkTmpl: o == null ? void 0 : o.ocrMarkTmpl,
|
|
336
|
+
datasetId: i,
|
|
346
337
|
versionId: t == null ? void 0 : t.id,
|
|
347
338
|
handleMarkClick: (e) => {
|
|
348
|
-
|
|
339
|
+
R(e), (o == null ? void 0 : o.ocrMarkTmpl) === "StructKVCOCR" ? (L(!1), F(!0)) : w("annotation");
|
|
340
|
+
},
|
|
341
|
+
updateSampleList: N,
|
|
342
|
+
isPreLabel: U,
|
|
343
|
+
selectSampleId: G,
|
|
344
|
+
onSave: (e) => {
|
|
345
|
+
var r;
|
|
346
|
+
if (!i || !t)
|
|
347
|
+
throw "datasetId or version is not exist.";
|
|
348
|
+
return c.cvforceDatahub.updateSamples(i, t.id, [C(m({}, e), {
|
|
349
|
+
labels: (r = e.labels) == null ? void 0 : r.map((n) => C(m({}, n), {
|
|
350
|
+
box: n.box.length > 4 ? n.box.splice(0, 4) : n.box
|
|
351
|
+
}))
|
|
352
|
+
})]).then(() => (d && (I == null ? void 0 : I.id) === e.id && (B((n) => {
|
|
353
|
+
if (!n)
|
|
354
|
+
return n;
|
|
355
|
+
const u = n.findIndex((b) => b.id === e.id);
|
|
356
|
+
if (u > -1) {
|
|
357
|
+
const b = [...n];
|
|
358
|
+
return b[u] = e, b;
|
|
359
|
+
}
|
|
360
|
+
return n;
|
|
361
|
+
}), g(e)), !0));
|
|
362
|
+
},
|
|
363
|
+
filterMode: S,
|
|
364
|
+
onFilterModeChange: (e) => {
|
|
365
|
+
R(void 0), A(e);
|
|
366
|
+
},
|
|
367
|
+
onPaginationChange: (e) => {
|
|
368
|
+
k(e);
|
|
349
369
|
},
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
370
|
+
samples: d,
|
|
371
|
+
pagination: a,
|
|
372
|
+
currentIndex: E
|
|
373
|
+
}), Y && (t == null ? void 0 : t.id) && /* @__PURE__ */ l(De, {
|
|
374
|
+
visible: Y,
|
|
375
|
+
selectSampleId: G,
|
|
376
|
+
ocrMarkTmpl: o == null ? void 0 : o.ocrMarkTmpl,
|
|
377
|
+
datasetId: i,
|
|
357
378
|
versionId: t.id,
|
|
358
|
-
onClose: () =>
|
|
379
|
+
onClose: () => F(!1),
|
|
359
380
|
onSave: (e) => {
|
|
360
|
-
var
|
|
361
|
-
if (!
|
|
381
|
+
var r;
|
|
382
|
+
if (!i || !t)
|
|
362
383
|
throw "datasetId or version is not exist.";
|
|
363
|
-
return
|
|
364
|
-
labels: (
|
|
365
|
-
box:
|
|
384
|
+
return c.cvforceDatahub.updateSamples(i, t.id, [C(m({}, e), {
|
|
385
|
+
labels: (r = e.labels) == null ? void 0 : r.map((n) => C(m({}, n), {
|
|
386
|
+
box: n.box.length > 4 ? n.box.splice(0, 4) : n.box
|
|
366
387
|
}))
|
|
367
|
-
})]).then(() => (
|
|
388
|
+
})]).then(() => (N(), !0));
|
|
368
389
|
}
|
|
369
390
|
})]
|
|
370
|
-
}) : /* @__PURE__ */
|
|
391
|
+
}) : /* @__PURE__ */ l("div", {
|
|
371
392
|
style: {
|
|
372
393
|
color: "red",
|
|
373
394
|
textAlign: "center"
|
|
@@ -378,5 +399,5 @@ const gt = (f) => {
|
|
|
378
399
|
});
|
|
379
400
|
};
|
|
380
401
|
export {
|
|
381
|
-
|
|
402
|
+
Ct as default
|
|
382
403
|
};
|