@glodon-aiot/dataset-annotation 3.23.0-alpha.4 → 3.24.0-alpha.4
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 +373 -369
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/AttributeDetail/index.mjs +144 -137
- package/dist/es/components/VLMAnnotationDetail/VLMDetail/index.mjs +85 -80
- package/dist/es/index.mjs +1 -1
- package/dist/lib/index.js +3 -3
- 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,56 +1,61 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var ie = Object.defineProperty, ne = Object.defineProperties;
|
|
2
|
+
var re = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var H = Object.getOwnPropertySymbols;
|
|
4
|
+
var se = Object.prototype.hasOwnProperty, ae = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var J = (l, s, n) => s in l ? ie(l, s, { enumerable: !0, configurable: !0, writable: !0, value: n }) : l[s] = n, k = (l, s) => {
|
|
6
6
|
for (var n in s || (s = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var n of
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var
|
|
7
|
+
se.call(s, n) && J(l, n, s[n]);
|
|
8
|
+
if (H)
|
|
9
|
+
for (var n of H(s))
|
|
10
|
+
ae.call(s, n) && J(l, n, s[n]);
|
|
11
|
+
return l;
|
|
12
|
+
}, C = (l, s) => ne(l, re(s));
|
|
13
|
+
var O = (l, s, n) => new Promise((p, b) => {
|
|
14
|
+
var a = (d) => {
|
|
15
15
|
try {
|
|
16
|
-
|
|
17
|
-
} catch (
|
|
18
|
-
h
|
|
16
|
+
m(n.next(d));
|
|
17
|
+
} catch (h) {
|
|
18
|
+
b(h);
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, y = (d) => {
|
|
21
21
|
try {
|
|
22
|
-
|
|
23
|
-
} catch (
|
|
24
|
-
h
|
|
22
|
+
m(n.throw(d));
|
|
23
|
+
} catch (h) {
|
|
24
|
+
b(h);
|
|
25
25
|
}
|
|
26
|
-
},
|
|
27
|
-
|
|
26
|
+
}, m = (d) => d.done ? p(d.value) : Promise.resolve(d.value).then(a, y);
|
|
27
|
+
m((n = n.apply(l, s)).next());
|
|
28
28
|
});
|
|
29
29
|
import { jsxs as u, jsx as i } from "react/jsx-runtime";
|
|
30
|
-
import { forwardRef as
|
|
31
|
-
import { Row as
|
|
32
|
-
import
|
|
30
|
+
import { forwardRef as le, useContext as ce, useState as w, useRef as oe, useImperativeHandle as de, useEffect as R } from "react";
|
|
31
|
+
import { Row as ue, Col as K, Input as W, Select as D, Space as U, Button as N, Table as me, Modal as he, message as S } from "antd";
|
|
32
|
+
import fe from "../../../../DatasetContext/index.mjs";
|
|
33
33
|
import "./style.less.mjs";
|
|
34
|
-
import
|
|
35
|
-
const
|
|
34
|
+
import V from "../../../Iconfont/index.mjs";
|
|
35
|
+
const pe = le((l, s) => {
|
|
36
36
|
const {
|
|
37
37
|
datasetId: n,
|
|
38
|
-
versionId:
|
|
39
|
-
onAttributesChange:
|
|
40
|
-
onLoadingChange:
|
|
41
|
-
} =
|
|
38
|
+
versionId: p,
|
|
39
|
+
onAttributesChange: b,
|
|
40
|
+
onLoadingChange: a
|
|
41
|
+
} = l, {
|
|
42
42
|
services: {
|
|
43
|
-
cvforceDatahub:
|
|
43
|
+
cvforceDatahub: y
|
|
44
|
+
},
|
|
45
|
+
featuresConfig: {
|
|
46
|
+
labelManager: m
|
|
47
|
+
} = {
|
|
48
|
+
labelManager: !1
|
|
44
49
|
}
|
|
45
|
-
} =
|
|
46
|
-
const t = [...e].sort((r,
|
|
50
|
+
} = ce(fe), d = !!(m && m.add), h = !!(m && m.edit), A = !!(m && m.delete), $ = d || h || A, [c, v] = w([]), [_, x] = w(!1), [I, E] = w(""), [g, T] = w(!1), [j, f] = w(null), M = oe(""), B = (e) => {
|
|
51
|
+
const t = [...e].sort((r, o) => r.id.localeCompare(o.id));
|
|
47
52
|
return JSON.stringify(t);
|
|
48
|
-
},
|
|
49
|
-
if (!
|
|
53
|
+
}, q = () => B(c) !== M.current, G = () => new Promise((e) => {
|
|
54
|
+
if (!q()) {
|
|
50
55
|
e(!0);
|
|
51
56
|
return;
|
|
52
57
|
}
|
|
53
|
-
|
|
58
|
+
he.confirm({
|
|
54
59
|
title: "提示",
|
|
55
60
|
content: "属性列表有未保存的更改,确定要离开吗?",
|
|
56
61
|
okText: "确定",
|
|
@@ -63,90 +68,92 @@ const de = ie((o, s) => {
|
|
|
63
68
|
}
|
|
64
69
|
});
|
|
65
70
|
});
|
|
66
|
-
|
|
67
|
-
hasUnsavedChanges:
|
|
68
|
-
checkDirtyAndConfirm:
|
|
71
|
+
de(s, () => ({
|
|
72
|
+
hasUnsavedChanges: q,
|
|
73
|
+
checkDirtyAndConfirm: G
|
|
69
74
|
}));
|
|
70
|
-
const
|
|
71
|
-
|
|
75
|
+
const F = () => O(void 0, null, function* () {
|
|
76
|
+
x(!0), a == null || a(!0);
|
|
72
77
|
try {
|
|
73
|
-
if (n &&
|
|
74
|
-
const t = (yield
|
|
75
|
-
return
|
|
78
|
+
if (n && p && y) {
|
|
79
|
+
const t = (yield y.getDatasetsIdVersionsVidConfigs(n, p)) || [];
|
|
80
|
+
return v(t), M.current = B(t), t;
|
|
76
81
|
}
|
|
77
82
|
} catch (e) {
|
|
78
83
|
console.error("获取属性列表失败:", e);
|
|
79
84
|
} finally {
|
|
80
|
-
|
|
85
|
+
x(!1), a == null || a(!1);
|
|
81
86
|
}
|
|
82
87
|
});
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}, []),
|
|
88
|
+
R(() => {
|
|
89
|
+
F();
|
|
90
|
+
}, []), R(() => {
|
|
91
|
+
h || (T(!1), f(null));
|
|
92
|
+
}, [h]), R(() => {
|
|
86
93
|
const e = (t) => {
|
|
87
|
-
if (
|
|
94
|
+
if (B(c) !== M.current)
|
|
88
95
|
return t.preventDefault(), t.returnValue = "", "";
|
|
89
96
|
};
|
|
90
97
|
return window.addEventListener("beforeunload", e), () => {
|
|
91
98
|
window.removeEventListener("beforeunload", e);
|
|
92
99
|
};
|
|
93
|
-
}, [
|
|
94
|
-
const
|
|
95
|
-
if (!
|
|
96
|
-
|
|
100
|
+
}, [c]);
|
|
101
|
+
const P = () => {
|
|
102
|
+
if (!I.trim()) {
|
|
103
|
+
S.error("属性名称不能为空");
|
|
97
104
|
return;
|
|
98
105
|
}
|
|
99
106
|
const e = {
|
|
100
107
|
id: `attr-${Date.now()}`,
|
|
101
|
-
name:
|
|
108
|
+
name: I.trim(),
|
|
102
109
|
type: "text"
|
|
103
|
-
}, t = [...
|
|
104
|
-
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
},
|
|
108
|
-
const t =
|
|
109
|
-
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
},
|
|
113
|
-
if (
|
|
114
|
-
|
|
110
|
+
}, t = [...c, e];
|
|
111
|
+
v(t), E("");
|
|
112
|
+
}, L = () => {
|
|
113
|
+
E("");
|
|
114
|
+
}, Q = (e) => {
|
|
115
|
+
const t = c.filter((r) => r.id !== e);
|
|
116
|
+
v(t);
|
|
117
|
+
}, X = () => {
|
|
118
|
+
v([]), T(!1), f(null);
|
|
119
|
+
}, Y = () => {
|
|
120
|
+
if (c.filter((t) => !t.name || !t.name.trim()).length > 0) {
|
|
121
|
+
S.error("属性名称不能为空");
|
|
115
122
|
return;
|
|
116
123
|
}
|
|
117
|
-
|
|
118
|
-
},
|
|
119
|
-
const r =
|
|
124
|
+
T(!g), f(null);
|
|
125
|
+
}, Z = (e, t) => {
|
|
126
|
+
const r = c.map((o) => o.id === e ? C(k({}, o), {
|
|
120
127
|
name: t
|
|
121
|
-
}) :
|
|
122
|
-
|
|
123
|
-
},
|
|
124
|
-
const r =
|
|
128
|
+
}) : o);
|
|
129
|
+
v(r);
|
|
130
|
+
}, ee = (e, t) => {
|
|
131
|
+
const r = c.map((o) => o.id === e ? C(k({}, o), {
|
|
125
132
|
type: t
|
|
126
|
-
}) :
|
|
127
|
-
|
|
128
|
-
},
|
|
129
|
-
if (!(!n || !
|
|
130
|
-
|
|
133
|
+
}) : o);
|
|
134
|
+
v(r);
|
|
135
|
+
}, te = () => O(void 0, null, function* () {
|
|
136
|
+
if (!(!n || !p || !y)) {
|
|
137
|
+
x(!0), a == null || a(!0);
|
|
131
138
|
try {
|
|
132
|
-
const e =
|
|
133
|
-
var
|
|
134
|
-
return
|
|
135
|
-
id: (
|
|
139
|
+
const e = c.map((r) => {
|
|
140
|
+
var o;
|
|
141
|
+
return C(k({}, r), {
|
|
142
|
+
id: (o = r.id) != null && o.startsWith("attr-") ? "" : r.id
|
|
136
143
|
});
|
|
137
144
|
});
|
|
138
|
-
console.log("attributes",
|
|
145
|
+
console.log("attributes", c), yield y.saveVisionLabelConfigs(n, p, {
|
|
139
146
|
data: e
|
|
140
147
|
});
|
|
141
|
-
const t = yield
|
|
142
|
-
|
|
148
|
+
const t = yield F();
|
|
149
|
+
S.success("保存成功"), b == null || b(t || c);
|
|
143
150
|
} catch (e) {
|
|
144
|
-
throw console.error("保存属性列表失败:", e),
|
|
151
|
+
throw console.error("保存属性列表失败:", e), S.error("保存失败"), e;
|
|
145
152
|
} finally {
|
|
146
|
-
|
|
153
|
+
x(!1), a == null || a(!1);
|
|
147
154
|
}
|
|
148
155
|
}
|
|
149
|
-
}),
|
|
156
|
+
}), z = [{
|
|
150
157
|
title: "序号",
|
|
151
158
|
key: "index",
|
|
152
159
|
width: 80,
|
|
@@ -155,18 +162,18 @@ const de = ie((o, s) => {
|
|
|
155
162
|
title: "属性名称",
|
|
156
163
|
dataIndex: "name",
|
|
157
164
|
key: "name",
|
|
158
|
-
render: (e, t) =>
|
|
165
|
+
render: (e, t) => g ? /* @__PURE__ */ i(W, {
|
|
159
166
|
value: e,
|
|
160
167
|
showCount: !0,
|
|
161
168
|
maxLength: 32,
|
|
162
169
|
onChange: (r) => {
|
|
163
|
-
|
|
170
|
+
Z(t.id, r.target.value);
|
|
164
171
|
},
|
|
165
172
|
onBlur: () => {
|
|
166
|
-
|
|
173
|
+
j === t.id && f(null);
|
|
167
174
|
},
|
|
168
175
|
onFocus: () => {
|
|
169
|
-
|
|
176
|
+
f(t.id);
|
|
170
177
|
}
|
|
171
178
|
}) : /* @__PURE__ */ i("span", {
|
|
172
179
|
children: e
|
|
@@ -175,39 +182,39 @@ const de = ie((o, s) => {
|
|
|
175
182
|
title: "属性类型",
|
|
176
183
|
dataIndex: "type",
|
|
177
184
|
key: "type",
|
|
178
|
-
render: (e, t) =>
|
|
185
|
+
render: (e, t) => g ? /* @__PURE__ */ i(D, {
|
|
179
186
|
value: e || "text",
|
|
180
187
|
onChange: (r) => {
|
|
181
|
-
|
|
188
|
+
ee(t.id, r);
|
|
182
189
|
},
|
|
183
190
|
style: {
|
|
184
191
|
width: "100%"
|
|
185
192
|
},
|
|
186
193
|
onBlur: () => {
|
|
187
|
-
|
|
194
|
+
j === t.id && f(null);
|
|
188
195
|
},
|
|
189
196
|
onFocus: () => {
|
|
190
|
-
|
|
197
|
+
f(t.id);
|
|
191
198
|
},
|
|
192
199
|
disabled: !0,
|
|
193
|
-
children: /* @__PURE__ */ i(
|
|
200
|
+
children: /* @__PURE__ */ i(D.Option, {
|
|
194
201
|
value: "text",
|
|
195
202
|
children: "文本"
|
|
196
203
|
})
|
|
197
204
|
}) : /* @__PURE__ */ i("span", {
|
|
198
205
|
children: "文本"
|
|
199
206
|
})
|
|
200
|
-
}
|
|
207
|
+
}];
|
|
208
|
+
return A && z.push({
|
|
201
209
|
title: "操作",
|
|
202
210
|
key: "action",
|
|
203
211
|
width: 100,
|
|
204
|
-
render: (e, t) => /* @__PURE__ */ i(
|
|
212
|
+
render: (e, t) => /* @__PURE__ */ i(N, {
|
|
205
213
|
type: "link",
|
|
206
|
-
onClick: () =>
|
|
214
|
+
onClick: () => Q(t.id),
|
|
207
215
|
children: "删除"
|
|
208
216
|
})
|
|
209
|
-
}
|
|
210
|
-
return /* @__PURE__ */ u("div", {
|
|
217
|
+
}), /* @__PURE__ */ u("div", {
|
|
211
218
|
className: "attribute-detail",
|
|
212
219
|
children: [/* @__PURE__ */ i("div", {
|
|
213
220
|
className: "use-tips",
|
|
@@ -216,10 +223,10 @@ const de = ie((o, s) => {
|
|
|
216
223
|
})
|
|
217
224
|
}), /* @__PURE__ */ u("div", {
|
|
218
225
|
className: "lists",
|
|
219
|
-
children: [/* @__PURE__ */ u(
|
|
226
|
+
children: [/* @__PURE__ */ u(ue, {
|
|
220
227
|
className: "lists-content",
|
|
221
228
|
gutter: 48,
|
|
222
|
-
children: [/* @__PURE__ */ i(
|
|
229
|
+
children: [d && /* @__PURE__ */ i(K, {
|
|
223
230
|
span: 12,
|
|
224
231
|
children: /* @__PURE__ */ u("div", {
|
|
225
232
|
className: "list-item",
|
|
@@ -236,47 +243,47 @@ const de = ie((o, s) => {
|
|
|
236
243
|
children: [/* @__PURE__ */ i("div", {
|
|
237
244
|
className: "form-label",
|
|
238
245
|
children: "属性名称"
|
|
239
|
-
}), /* @__PURE__ */ i(
|
|
246
|
+
}), /* @__PURE__ */ i(W, {
|
|
240
247
|
showCount: !0,
|
|
241
248
|
maxLength: 32,
|
|
242
|
-
value:
|
|
243
|
-
onChange: (e) =>
|
|
249
|
+
value: I,
|
|
250
|
+
onChange: (e) => E(e.target.value),
|
|
244
251
|
placeholder: "请输入属性名称",
|
|
245
|
-
onPressEnter:
|
|
252
|
+
onPressEnter: P
|
|
246
253
|
})]
|
|
247
254
|
}), /* @__PURE__ */ u("div", {
|
|
248
255
|
className: "form-item",
|
|
249
256
|
children: [/* @__PURE__ */ i("div", {
|
|
250
257
|
className: "form-label",
|
|
251
258
|
children: "属性类型"
|
|
252
|
-
}), /* @__PURE__ */ i(
|
|
259
|
+
}), /* @__PURE__ */ i(D, {
|
|
253
260
|
value: "text",
|
|
254
261
|
disabled: !0,
|
|
255
262
|
style: {
|
|
256
263
|
width: "100%"
|
|
257
264
|
},
|
|
258
|
-
children: /* @__PURE__ */ i(
|
|
265
|
+
children: /* @__PURE__ */ i(D.Option, {
|
|
259
266
|
value: "text",
|
|
260
267
|
children: "文本"
|
|
261
268
|
})
|
|
262
269
|
})]
|
|
263
270
|
}), /* @__PURE__ */ i("div", {
|
|
264
271
|
className: "form-actions",
|
|
265
|
-
children: /* @__PURE__ */ u(
|
|
266
|
-
children: [/* @__PURE__ */ i(
|
|
272
|
+
children: /* @__PURE__ */ u(U, {
|
|
273
|
+
children: [/* @__PURE__ */ i(N, {
|
|
267
274
|
type: "primary",
|
|
268
|
-
onClick:
|
|
275
|
+
onClick: P,
|
|
269
276
|
children: "添加属性"
|
|
270
|
-
}), /* @__PURE__ */ i(
|
|
271
|
-
onClick:
|
|
277
|
+
}), /* @__PURE__ */ i(N, {
|
|
278
|
+
onClick: L,
|
|
272
279
|
children: "取消"
|
|
273
280
|
})]
|
|
274
281
|
})
|
|
275
282
|
})]
|
|
276
283
|
})]
|
|
277
284
|
})
|
|
278
|
-
}), /* @__PURE__ */ i(
|
|
279
|
-
span: 12,
|
|
285
|
+
}), /* @__PURE__ */ i(K, {
|
|
286
|
+
span: d ? 12 : 24,
|
|
280
287
|
children: /* @__PURE__ */ u("div", {
|
|
281
288
|
className: "list-item",
|
|
282
289
|
children: [/* @__PURE__ */ u("div", {
|
|
@@ -284,34 +291,34 @@ const de = ie((o, s) => {
|
|
|
284
291
|
children: [/* @__PURE__ */ i("div", {
|
|
285
292
|
className: "list-item-title",
|
|
286
293
|
children: "属性列表"
|
|
287
|
-
}), /* @__PURE__ */ u(
|
|
294
|
+
}), (h || A) && /* @__PURE__ */ u(U, {
|
|
288
295
|
style: {
|
|
289
296
|
height: 32
|
|
290
297
|
},
|
|
291
|
-
children: [/* @__PURE__ */ i(
|
|
298
|
+
children: [h && /* @__PURE__ */ i(N, {
|
|
292
299
|
type: "text",
|
|
293
|
-
icon:
|
|
300
|
+
icon: g ? /* @__PURE__ */ i(V, {
|
|
294
301
|
type: "icon-queding",
|
|
295
302
|
className: "self-icon"
|
|
296
|
-
}) : /* @__PURE__ */ i(
|
|
303
|
+
}) : /* @__PURE__ */ i(V, {
|
|
297
304
|
type: "icon-editing",
|
|
298
305
|
className: "self-icon"
|
|
299
306
|
}),
|
|
300
|
-
onClick:
|
|
301
|
-
}), /* @__PURE__ */ i(
|
|
307
|
+
onClick: Y
|
|
308
|
+
}), A && /* @__PURE__ */ i(N, {
|
|
302
309
|
type: "text",
|
|
303
|
-
icon: /* @__PURE__ */ i(
|
|
310
|
+
icon: /* @__PURE__ */ i(V, {
|
|
304
311
|
type: "icon-qingchujiyi",
|
|
305
312
|
className: "self-icon"
|
|
306
313
|
}),
|
|
307
|
-
onClick:
|
|
314
|
+
onClick: X
|
|
308
315
|
})]
|
|
309
316
|
})]
|
|
310
317
|
}), /* @__PURE__ */ i("div", {
|
|
311
318
|
className: "list-item-content table-wrapper",
|
|
312
|
-
children: /* @__PURE__ */ i(
|
|
313
|
-
columns:
|
|
314
|
-
dataSource:
|
|
319
|
+
children: /* @__PURE__ */ i(me, {
|
|
320
|
+
columns: z,
|
|
321
|
+
dataSource: c,
|
|
315
322
|
rowKey: "id",
|
|
316
323
|
pagination: !1,
|
|
317
324
|
size: "small",
|
|
@@ -322,14 +329,14 @@ const de = ie((o, s) => {
|
|
|
322
329
|
})]
|
|
323
330
|
})
|
|
324
331
|
})]
|
|
325
|
-
}), /* @__PURE__ */ i("div", {
|
|
332
|
+
}), $ && /* @__PURE__ */ i("div", {
|
|
326
333
|
className: "attribute-detail-footer",
|
|
327
|
-
children: /* @__PURE__ */ i(
|
|
328
|
-
children: /* @__PURE__ */ i(
|
|
334
|
+
children: /* @__PURE__ */ i(U, {
|
|
335
|
+
children: /* @__PURE__ */ i(N, {
|
|
329
336
|
type: "primary",
|
|
330
|
-
loading:
|
|
331
|
-
disabled:
|
|
332
|
-
onClick:
|
|
337
|
+
loading: _,
|
|
338
|
+
disabled: _,
|
|
339
|
+
onClick: te,
|
|
333
340
|
children: "保存"
|
|
334
341
|
})
|
|
335
342
|
})
|
|
@@ -337,7 +344,7 @@ const de = ie((o, s) => {
|
|
|
337
344
|
})]
|
|
338
345
|
});
|
|
339
346
|
});
|
|
340
|
-
|
|
347
|
+
pe.displayName = "AttributeDetail";
|
|
341
348
|
export {
|
|
342
|
-
|
|
349
|
+
pe as default
|
|
343
350
|
};
|