@glodon-aiot/dataset-annotation 3.25.1-alpha.6 → 3.26.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.
Files changed (57) hide show
  1. package/dist/dataset-annotation.js +123598 -0
  2. package/dist/dataset-annotation.umd.cjs +1017 -0
  3. package/dist/es/components/OCRImageViewer/index.mjs +117 -130
  4. package/dist/es/components/OcrAnnotation/OCRBoxDetail/index.mjs +92 -94
  5. package/dist/es/index.mjs +15 -21
  6. package/dist/example/DatasetAnnotationDemo.d.ts +3 -0
  7. package/dist/example/DemoTabs.d.ts +3 -0
  8. package/dist/example/DetectionDatasetDemo.d.ts +5 -0
  9. package/dist/example/DetectionImageDemo.d.ts +5 -0
  10. package/dist/example/OcrDatasetDemo.d.ts +5 -0
  11. package/dist/example/OcrImageDemo.d.ts +5 -0
  12. package/dist/example/OcrkvcDatasetDemo.d.ts +5 -0
  13. package/dist/example/constant.local.d.ts +6 -0
  14. package/dist/example/index.d.ts +1 -0
  15. package/dist/lib/index.js +4 -37
  16. package/dist/src/components/OCRImageViewer/index.d.ts +0 -1
  17. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/ImageDetail/index.d.ts +16 -0
  18. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/LabelEditorInput.d.ts +12 -0
  19. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/LabelEditorItem.d.ts +21 -0
  20. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/LableEditor.d.ts +16 -0
  21. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/index.d.ts +19 -0
  22. package/dist/src/index.d.ts +0 -6
  23. package/dist/src/utils/reactCompatibility.d.ts +5 -0
  24. package/package.json +2 -2
  25. package/dist/es/_virtual/_commonjsHelpers.mjs +0 -8
  26. package/dist/es/_virtual/dayjs.min.mjs +0 -4
  27. package/dist/es/components/VersionCompare/VersionCompareSelectModal/index.mjs +0 -122
  28. package/dist/es/components/VersionCompare/adapter.mjs +0 -215
  29. package/dist/es/components/VersionCompare/components/DataChangeStatsCard.mjs +0 -68
  30. package/dist/es/components/VersionCompare/components/DiffValue.mjs +0 -31
  31. package/dist/es/components/VersionCompare/components/LabelComparisonCard.mjs +0 -130
  32. package/dist/es/components/VersionCompare/components/ModifiedSampleCompareModal.mjs +0 -207
  33. package/dist/es/components/VersionCompare/components/SampleChangeDetailsCard.mjs +0 -160
  34. package/dist/es/components/VersionCompare/components/SingleSampleDetailModal.mjs +0 -165
  35. package/dist/es/components/VersionCompare/components/VersionCompareHeader.mjs +0 -106
  36. package/dist/es/components/VersionCompare/components/VersionOverviewCard.mjs +0 -70
  37. package/dist/es/components/VersionCompare/index.mjs +0 -416
  38. package/dist/es/components/VersionCompare/mock.mjs +0 -571
  39. package/dist/es/components/VersionCompare/style.less.mjs +0 -4
  40. package/dist/es/components/VersionCompare/utils/labelColors.mjs +0 -45
  41. package/dist/es/createDatasetVersionCompare/index.mjs +0 -124
  42. package/dist/es/node_modules/dayjs/dayjs.min.mjs +0 -324
  43. package/dist/src/components/VersionCompare/VersionCompareSelectModal/index.d.ts +0 -16
  44. package/dist/src/components/VersionCompare/adapter.d.ts +0 -50
  45. package/dist/src/components/VersionCompare/components/DataChangeStatsCard.d.ts +0 -9
  46. package/dist/src/components/VersionCompare/components/DiffValue.d.ts +0 -23
  47. package/dist/src/components/VersionCompare/components/LabelComparisonCard.d.ts +0 -12
  48. package/dist/src/components/VersionCompare/components/ModifiedSampleCompareModal.d.ts +0 -48
  49. package/dist/src/components/VersionCompare/components/SampleChangeDetailsCard.d.ts +0 -21
  50. package/dist/src/components/VersionCompare/components/SingleSampleDetailModal.d.ts +0 -46
  51. package/dist/src/components/VersionCompare/components/VersionCompareHeader.d.ts +0 -13
  52. package/dist/src/components/VersionCompare/components/VersionOverviewCard.d.ts +0 -9
  53. package/dist/src/components/VersionCompare/index.d.ts +0 -34
  54. package/dist/src/components/VersionCompare/mock.d.ts +0 -25
  55. package/dist/src/components/VersionCompare/types.d.ts +0 -75
  56. package/dist/src/components/VersionCompare/utils/labelColors.d.ts +0 -13
  57. package/dist/src/createDatasetVersionCompare/index.d.ts +0 -26
@@ -1,130 +0,0 @@
1
- import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
- import r from "./DiffValue.mjs";
3
- const p = (d) => {
4
- const {
5
- markType: t,
6
- ocrMarkTmpl: s,
7
- isOcrDetection: c,
8
- baseVersionNo: i,
9
- targetVersionNo: h,
10
- labelComparisons: n
11
- } = d;
12
- return (c != null ? c : t === "ocr" && (!s || s === "DetectionOCR")) || t !== "detection" ? null : /* @__PURE__ */ a("div", {
13
- className: "vc-card vc-label-compare-card",
14
- children: [/* @__PURE__ */ e("div", {
15
- className: "vc-card-header",
16
- children: /* @__PURE__ */ e("h3", {
17
- className: "vc-card-title",
18
- children: "标签明细对比"
19
- })
20
- }), /* @__PURE__ */ e("div", {
21
- className: "vc-table-container",
22
- children: /* @__PURE__ */ a("table", {
23
- className: "vc-standard-table",
24
- children: [/* @__PURE__ */ a("thead", {
25
- children: [/* @__PURE__ */ a("tr", {
26
- children: [/* @__PURE__ */ e("th", {
27
- rowSpan: 2,
28
- style: {
29
- width: "20%"
30
- },
31
- children: "标签名称"
32
- }), /* @__PURE__ */ e("th", {
33
- colSpan: 2,
34
- className: "vc-th-center",
35
- style: {
36
- width: "40%"
37
- },
38
- children: /* @__PURE__ */ a("span", {
39
- className: "vc-th-version-title",
40
- children: [/* @__PURE__ */ e("span", {
41
- className: "vc-th-version-no",
42
- children: i || "-"
43
- }), /* @__PURE__ */ e("span", {
44
- className: "vc-th-version-desc",
45
- children: "(基准版本)"
46
- })]
47
- })
48
- }), /* @__PURE__ */ e("th", {
49
- colSpan: 2,
50
- className: "vc-th-center",
51
- style: {
52
- width: "40%"
53
- },
54
- children: /* @__PURE__ */ a("span", {
55
- className: "vc-th-version-title",
56
- children: [/* @__PURE__ */ e("span", {
57
- className: "vc-th-version-no",
58
- children: h || "-"
59
- }), /* @__PURE__ */ e("span", {
60
- className: "vc-th-version-desc",
61
- children: "(目标版本)"
62
- })]
63
- })
64
- })]
65
- }), /* @__PURE__ */ a("tr", {
66
- children: [/* @__PURE__ */ e("th", {
67
- className: "vc-th-sub",
68
- style: {
69
- width: "20%"
70
- },
71
- children: "标注框数"
72
- }), /* @__PURE__ */ e("th", {
73
- className: "vc-th-sub",
74
- style: {
75
- width: "20%"
76
- },
77
- children: "图片数"
78
- }), /* @__PURE__ */ e("th", {
79
- className: "vc-th-sub",
80
- style: {
81
- width: "20%"
82
- },
83
- children: "标注框数"
84
- }), /* @__PURE__ */ e("th", {
85
- className: "vc-th-sub",
86
- style: {
87
- width: "20%"
88
- },
89
- children: "图片数"
90
- })]
91
- })]
92
- }), /* @__PURE__ */ e("tbody", {
93
- children: n.length > 0 ? n.map((l) => /* @__PURE__ */ a("tr", {
94
- children: [/* @__PURE__ */ e("td", {
95
- children: l.label
96
- }), /* @__PURE__ */ e("td", {
97
- children: l.baseBoxCount
98
- }), /* @__PURE__ */ e("td", {
99
- children: l.baseSampleCount
100
- }), /* @__PURE__ */ e("td", {
101
- children: /* @__PURE__ */ e(r, {
102
- value: l.targetBoxCount,
103
- diff: l.boxDiff,
104
- gap: 16
105
- })
106
- }), /* @__PURE__ */ e("td", {
107
- children: /* @__PURE__ */ e(r, {
108
- value: l.targetSampleCount,
109
- diff: l.sampleDiff,
110
- gap: 16
111
- })
112
- })]
113
- }, l.label)) : /* @__PURE__ */ e("tr", {
114
- children: /* @__PURE__ */ e("td", {
115
- colSpan: 5,
116
- style: {
117
- textAlign: "center",
118
- color: "rgba(0, 0, 0, 0.45)"
119
- },
120
- children: "暂无标签对比数据"
121
- })
122
- })
123
- })]
124
- })
125
- })]
126
- });
127
- };
128
- export {
129
- p as default
130
- };
@@ -1,207 +0,0 @@
1
- import { jsx as l, jsxs as d } from "react/jsx-runtime";
2
- import { useState as b, useRef as fl, useEffect as E, useMemo as y } from "react";
3
- import { Modal as hl, Tag as Nl, Button as w, Spin as D } from "antd";
4
- import { useKeyPress as T } from "ahooks";
5
- import S from "../../Iconfont/index.mjs";
6
- import ll from "../../DetectionStatus/index.mjs";
7
- import el from "../../DetectionAnnotation/components/LabelMaker/index.mjs";
8
- import sl from "../../OCRImageViewer/index.mjs";
9
- import { injectSampleLabelColors as I } from "../utils/labelColors.mjs";
10
- const El = ({
11
- open: t,
12
- onCancel: al,
13
- item: e,
14
- isOcrDetection: u,
15
- datasetId: L,
16
- baseVersionId: z,
17
- baseVersionNo: nl,
18
- targetVersionId: k,
19
- targetVersionNo: ol,
20
- labelColorMap: v,
21
- canPrev: bl,
22
- canNext: Ll,
23
- switching: P = !1,
24
- onPrev: M,
25
- onNext: A,
26
- onImageReadyChange: g,
27
- cvforceDatahub: m,
28
- useMock: V = !1
29
- }) => {
30
- var J, Q, W, X, Y, Z;
31
- const [U, q] = b(null), [x, B] = b(null), [j, F] = b(!1), [dl, h] = b(), [cl, N] = b(), C = fl(0);
32
- E(() => {
33
- t || (h(void 0), N(void 0));
34
- }, [t]);
35
- const n = (e == null ? void 0 : e.baseSample) || void 0, o = (e == null ? void 0 : e.sample) || void 0;
36
- E(() => {
37
- if (q(null), B(null), !t || !e) {
38
- F(!1);
39
- return;
40
- }
41
- const i = !V && !!(m != null && m.getDatasetsIdVersionsVidSsamplesSid) && !!L, _ = i && !!z && !!(n != null && n.id) && (!(n != null && n.fileUrl) || !Array.isArray(n == null ? void 0 : n.labels)), $ = i && !!k && !!(o != null && o.id) && (!(o != null && o.fileUrl) || !Array.isArray(o == null ? void 0 : o.labels));
42
- if (!_ && !$) {
43
- F(!1);
44
- return;
45
- }
46
- const R = ++C.current;
47
- F(!0), Promise.all([_ && (n != null && n.id) ? m.getDatasetsIdVersionsVidSsamplesSid(L, z, n.id).catch(() => null) : Promise.resolve(null), $ && (o != null && o.id) ? m.getDatasetsIdVersionsVidSsamplesSid(L, k, o.id).catch(() => null) : Promise.resolve(null)]).then(([p, O]) => {
48
- R === C.current && (p && q(p), O && B(O));
49
- }).finally(() => {
50
- R === C.current && F(!1);
51
- });
52
- }, [t, e, n, o, V, m, L, z, k]);
53
- const s = U || n, a = x || o, rl = y(() => {
54
- var i;
55
- return U ? I(U, v) : (i = e == null ? void 0 : e.baseColorLabels) != null && i.length ? e.baseColorLabels : I(s, v);
56
- }, [U, e, s, v]), tl = y(() => {
57
- var i;
58
- return x ? I(x, v) : (i = e == null ? void 0 : e.targetColorLabels) != null && i.length ? e.targetColorLabels : I(a, v);
59
- }, [x, e, a, v]), K = (e == null ? void 0 : e.displayFileName) || ((J = a == null ? void 0 : a.sampleFileName) == null ? void 0 : J.name) || (a == null ? void 0 : a.fileName) || ((Q = s == null ? void 0 : s.sampleFileName) == null ? void 0 : Q.name) || (s == null ? void 0 : s.fileName) || "-", c = (s == null ? void 0 : s.fileUrl) || (s == null ? void 0 : s.thumbnailUrl) || "", r = (a == null ? void 0 : a.fileUrl) || (a == null ? void 0 : a.thumbnailUrl) || "", il = (X = (W = s == null ? void 0 : s.labels) == null ? void 0 : W.length) != null ? X : 0, ul = (Z = (Y = a == null ? void 0 : a.labels) == null ? void 0 : Y.length) != null ? Z : 0, G = !!c && dl !== c, H = !!r && cl !== r, f = P || j || (G || H), vl = P || j || u && G, ml = P || j || u && H;
60
- return E(() => {
61
- g == null || g(t && !f && !!(c || r));
62
- }, [t, f, c, r, g]), T("leftarrow", () => {
63
- !t || f || M();
64
- }), T("rightarrow", () => {
65
- !t || f || A();
66
- }), /* @__PURE__ */ l(hl, {
67
- open: t,
68
- onCancel: al,
69
- footer: null,
70
- centered: !0,
71
- width: 1920,
72
- destroyOnClose: !0,
73
- wrapClassName: "vc-dual-detail-modal-wrap",
74
- className: "vc-dual-detail-modal",
75
- title: /* @__PURE__ */ d("div", {
76
- className: "vc-detail-modal-header",
77
- children: [/* @__PURE__ */ d("div", {
78
- className: "vc-detail-modal-header-left",
79
- children: [/* @__PURE__ */ l("span", {
80
- className: "vc-detail-modal-title",
81
- children: "图片详情"
82
- }), /* @__PURE__ */ l(Nl, {
83
- className: "vc-detail-change-tag is-modified",
84
- children: "修改"
85
- })]
86
- }), /* @__PURE__ */ l("span", {
87
- className: "vc-detail-modal-filename",
88
- title: K,
89
- children: K
90
- })]
91
- }),
92
- children: /* @__PURE__ */ d("div", {
93
- className: "vc-dual-detail-body",
94
- children: [/* @__PURE__ */ l(w, {
95
- className: "vc-detail-nav-btn select-prev",
96
- icon: /* @__PURE__ */ l(S, {
97
- type: "icon-zuojiantou"
98
- }),
99
- type: "text",
100
- disabled: f,
101
- onClick: M
102
- }), /* @__PURE__ */ d("div", {
103
- className: "vc-dual-detail-panels",
104
- children: [/* @__PURE__ */ d("div", {
105
- className: "vc-dual-version-panel",
106
- children: [/* @__PURE__ */ d("div", {
107
- className: "vc-dual-panel-header",
108
- children: [/* @__PURE__ */ d("div", {
109
- className: "vc-dual-panel-version-info",
110
- children: [/* @__PURE__ */ l("span", {
111
- className: "vc-dual-panel-version-no",
112
- children: nl
113
- }), /* @__PURE__ */ l("span", {
114
- className: "vc-dual-panel-version-role",
115
- children: "(基准版本)"
116
- })]
117
- }), u && /* @__PURE__ */ d("span", {
118
- className: "vc-dual-panel-box-count",
119
- children: ["标注框数量:", il]
120
- })]
121
- }), /* @__PURE__ */ d("div", {
122
- className: "vc-dual-panel-canvas",
123
- children: [s && /* @__PURE__ */ l("div", {
124
- className: "vc-modal-detection-status",
125
- children: /* @__PURE__ */ l(ll, {
126
- sample: s
127
- })
128
- }), s && (u ? /* @__PURE__ */ l(sl, {
129
- zoomMin: 0.1,
130
- zoomMax: 10,
131
- zoomStep: 0.1,
132
- url: c,
133
- labels: s.labels || [],
134
- onImageLoad: () => h(c),
135
- onImageError: () => h(c)
136
- }, "vc-dual-ocr-base") : /* @__PURE__ */ l(el, {
137
- disabled: !0,
138
- isPreLabel: !0,
139
- imageUrl: c,
140
- labels: rl,
141
- onImageLoad: () => h(c),
142
- onImageError: () => h(c)
143
- }, "vc-dual-det-base")), vl && /* @__PURE__ */ l("div", {
144
- className: "vc-detail-loading-mask",
145
- children: /* @__PURE__ */ l(D, {})
146
- })]
147
- })]
148
- }), /* @__PURE__ */ d("div", {
149
- className: "vc-dual-version-panel",
150
- children: [/* @__PURE__ */ d("div", {
151
- className: "vc-dual-panel-header",
152
- children: [/* @__PURE__ */ d("div", {
153
- className: "vc-dual-panel-version-info",
154
- children: [/* @__PURE__ */ l("span", {
155
- className: "vc-dual-panel-version-no",
156
- children: ol
157
- }), /* @__PURE__ */ l("span", {
158
- className: "vc-dual-panel-version-role",
159
- children: "(目标版本)"
160
- })]
161
- }), u && /* @__PURE__ */ d("span", {
162
- className: "vc-dual-panel-box-count",
163
- children: ["标注框数量:", ul]
164
- })]
165
- }), /* @__PURE__ */ d("div", {
166
- className: "vc-dual-panel-canvas",
167
- children: [a && /* @__PURE__ */ l("div", {
168
- className: "vc-modal-detection-status",
169
- children: /* @__PURE__ */ l(ll, {
170
- sample: a
171
- })
172
- }), a && (u ? /* @__PURE__ */ l(sl, {
173
- zoomMin: 0.1,
174
- zoomMax: 10,
175
- zoomStep: 0.1,
176
- url: r,
177
- labels: a.labels || [],
178
- onImageLoad: () => N(r),
179
- onImageError: () => N(r)
180
- }, "vc-dual-ocr-target") : /* @__PURE__ */ l(el, {
181
- disabled: !0,
182
- isPreLabel: !0,
183
- imageUrl: r,
184
- labels: tl,
185
- onImageLoad: () => N(r),
186
- onImageError: () => N(r)
187
- }, "vc-dual-det-target")), ml && /* @__PURE__ */ l("div", {
188
- className: "vc-detail-loading-mask",
189
- children: /* @__PURE__ */ l(D, {})
190
- })]
191
- })]
192
- })]
193
- }), /* @__PURE__ */ l(w, {
194
- className: "vc-detail-nav-btn select-next",
195
- icon: /* @__PURE__ */ l(S, {
196
- type: "icon-youjiantou"
197
- }),
198
- type: "text",
199
- disabled: f,
200
- onClick: A
201
- })]
202
- })
203
- });
204
- };
205
- export {
206
- El as default
207
- };
@@ -1,160 +0,0 @@
1
- import { jsxs as c, jsx as a, Fragment as j } from "react/jsx-runtime";
2
- import { Tabs as q, Spin as x, Tooltip as E, Pagination as O } from "antd";
3
- import V from "classnames";
4
- import A from "../../Thumbnail/index.mjs";
5
- import F from "../../DetectionStatus/index.mjs";
6
- import I from "../../DataEmpty/index.mjs";
7
- const J = (i) => {
8
- var o;
9
- if (!((o = i == null ? void 0 : i.labels) != null && o.length))
10
- return [];
11
- const t = /* @__PURE__ */ new Set();
12
- return i.labels.forEach((r) => {
13
- var s;
14
- const l = (s = r == null ? void 0 : r.label) == null ? void 0 : s.trim();
15
- l && t.add(l);
16
- }), Array.from(t);
17
- }, W = (i) => {
18
- var b, p, N, g;
19
- const {
20
- baseVersionNo: t,
21
- targetVersionNo: o,
22
- isOcrDetection: r,
23
- changeStats: l,
24
- activeTab: s,
25
- items: v,
26
- total: T,
27
- pageNo: u,
28
- pageSize: f,
29
- loading: $ = !1,
30
- imgProxy: D,
31
- onTabChange: U,
32
- onPageChange: z,
33
- onSampleClick: h
34
- } = i, L = [{
35
- key: "added",
36
- label: "新增",
37
- count: (b = l == null ? void 0 : l.addedCount) != null ? b : 0
38
- }, {
39
- key: "deleted",
40
- label: "删除",
41
- count: (p = l == null ? void 0 : l.deletedCount) != null ? p : 0
42
- }, {
43
- key: "modified",
44
- label: "修改",
45
- count: (N = l == null ? void 0 : l.modifiedCount) != null ? N : 0
46
- }, {
47
- key: "unchanged",
48
- label: "无变动",
49
- count: (g = l == null ? void 0 : l.unchangedCount) != null ? g : 0
50
- }];
51
- return /* @__PURE__ */ c("div", {
52
- className: "vc-card vc-sample-details-card",
53
- children: [/* @__PURE__ */ c("div", {
54
- children: [/* @__PURE__ */ c("div", {
55
- className: "vc-card-header",
56
- children: [/* @__PURE__ */ a("h3", {
57
- className: "vc-card-title",
58
- children: "数据变更详情"
59
- }), /* @__PURE__ */ c("span", {
60
- className: "vc-card-subtitle",
61
- children: ["(", t || "-", " → ", o || "-", ")"]
62
- })]
63
- }), /* @__PURE__ */ a(q, {
64
- className: "vc-sample-tabs",
65
- activeKey: s,
66
- onChange: (n) => {
67
- n !== s && U(n);
68
- },
69
- items: L.map((n) => ({
70
- key: n.key,
71
- label: `${n.label} (${n.count})`
72
- }))
73
- })]
74
- }), /* @__PURE__ */ a(x, {
75
- spinning: $,
76
- children: v.length > 0 ? /* @__PURE__ */ c(j, {
77
- children: [/* @__PURE__ */ a("div", {
78
- className: "vc-sample-grid",
79
- children: v.map((n, d) => {
80
- var y, k;
81
- const e = n.sample, P = (u - 1) * f + d + 1, m = r ? [] : J(e), C = ((k = (y = e == null ? void 0 : e.labels) == null ? void 0 : y[0]) == null ? void 0 : k.label) || m[0] || "", w = m.length >= 2 ? `+${m.length - 1}` : null;
82
- return /* @__PURE__ */ c("div", {
83
- className: "vc-sample-card",
84
- "data-sample-id": (e == null ? void 0 : e.id) || n.fileKey || String(d),
85
- onClick: () => h == null ? void 0 : h(n, d),
86
- children: [/* @__PURE__ */ a("div", {
87
- className: "vc-detection-status-wrapper",
88
- children: /* @__PURE__ */ a(F, {
89
- sample: e
90
- })
91
- }), /* @__PURE__ */ a("div", {
92
- className: "vc-sample-card-img",
93
- children: /* @__PURE__ */ a(A, {
94
- fileKey: (e == null ? void 0 : e.fileKey) || n.fileKey,
95
- width: 124,
96
- thumbnailUrl: (e == null ? void 0 : e.thumbnailUrl) || (e == null ? void 0 : e.fileUrl),
97
- imgProxy: D
98
- })
99
- }), /* @__PURE__ */ c("div", {
100
- className: V("vc-sample-card-footer", {
101
- "is-ocr": r
102
- }),
103
- children: [!r && /* @__PURE__ */ a("div", {
104
- className: "vc-sample-label-info",
105
- children: C ? /* @__PURE__ */ a(E, {
106
- placement: "top",
107
- title: /* @__PURE__ */ a("div", {
108
- children: m.map((K) => /* @__PURE__ */ a("div", {
109
- children: K
110
- }, K))
111
- }),
112
- children: /* @__PURE__ */ c("div", {
113
- style: {
114
- width: "100%",
115
- display: "flex",
116
- alignItems: "center"
117
- },
118
- children: [/* @__PURE__ */ a("span", {
119
- className: "vc-sample-first-label",
120
- children: C
121
- }), w && /* @__PURE__ */ a("span", {
122
- className: "vc-sample-more-count",
123
- children: w
124
- })]
125
- })
126
- }) : /* @__PURE__ */ a("span", {
127
- className: "vc-sample-no-label",
128
- children: "无标签"
129
- })
130
- }), /* @__PURE__ */ a("div", {
131
- className: "vc-sample-serial",
132
- children: P
133
- })]
134
- })]
135
- }, `${n.changeType}-${n.fileKey || (e == null ? void 0 : e.id) || d}`);
136
- })
137
- }), /* @__PURE__ */ a("div", {
138
- className: "vc-sample-pagination",
139
- children: /* @__PURE__ */ a(O, {
140
- current: u,
141
- pageSize: f,
142
- total: T,
143
- showQuickJumper: !0,
144
- showSizeChanger: !0,
145
- pageSizeOptions: ["10", "20", "50", "100"],
146
- onChange: z
147
- })
148
- })]
149
- }) : /* @__PURE__ */ a("div", {
150
- className: "vc-sample-empty-wrapper",
151
- children: /* @__PURE__ */ a(I, {
152
- description: "当前分类下暂无图片数据"
153
- })
154
- })
155
- })]
156
- });
157
- };
158
- export {
159
- W as default
160
- };
@@ -1,165 +0,0 @@
1
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
2
- import { useState as w, useRef as R, useEffect as U, useMemo as P } from "react";
3
- import { Modal as T, Tag as D, Button as q, Spin as y } from "antd";
4
- import { useKeyPress as _ } from "ahooks";
5
- import $ from "../../Iconfont/index.mjs";
6
- import ee from "../../DetectionStatus/index.mjs";
7
- import le from "../../DetectionAnnotation/components/LabelMaker/index.mjs";
8
- import se from "../../OCRImageViewer/index.mjs";
9
- import { injectSampleLabelColors as G } from "../utils/labelColors.mjs";
10
- const H = {
11
- added: {
12
- text: "新增",
13
- className: "is-added"
14
- },
15
- deleted: {
16
- text: "删除",
17
- className: "is-deleted"
18
- },
19
- modified: {
20
- text: "修改",
21
- className: "is-modified"
22
- },
23
- unchanged: {
24
- text: "无变动",
25
- className: "is-unchanged"
26
- }
27
- }, ve = ({
28
- open: t,
29
- onCancel: K,
30
- item: l,
31
- changeType: o,
32
- isOcrDetection: b,
33
- datasetId: g,
34
- baseVersionId: Y,
35
- targetVersionId: J,
36
- labelColorMap: h,
37
- canPrev: ae,
38
- canNext: te,
39
- switching: E = !1,
40
- onPrev: M,
41
- onNext: S,
42
- onImageReadyChange: m,
43
- cvforceDatahub: n,
44
- useMock: V = !1
45
- }) => {
46
- var I, k, z;
47
- const [u, j] = w(null), [A, f] = w(!1), [O, i] = w(), x = R(0);
48
- U(() => {
49
- t || i(void 0);
50
- }, [t]);
51
- const r = P(() => {
52
- if (l)
53
- return o === "deleted" && l.baseSample || l.sample;
54
- }, [l, o]), L = o === "deleted" ? Y : J;
55
- U(() => {
56
- if (j(null), !t || !r) {
57
- f(!1);
58
- return;
59
- }
60
- const v = !!r.fileUrl, N = Array.isArray(r.labels);
61
- if (V || !(n != null && n.getDatasetsIdVersionsVidSsamplesSid) || !g || !L || !r.id || v && N) {
62
- f(!1);
63
- return;
64
- }
65
- const p = ++x.current;
66
- f(!0), n.getDatasetsIdVersionsVidSsamplesSid(g, L, r.id).then((Z) => {
67
- p === x.current && j(Z);
68
- }).catch(() => {
69
- }).finally(() => {
70
- p === x.current && f(!1);
71
- });
72
- }, [t, r, V, n, g, L]);
73
- const e = u || r, Q = P(() => {
74
- var v, N;
75
- return u ? G(u, h) : o === "deleted" && ((v = l == null ? void 0 : l.baseColorLabels) != null && v.length) ? l.baseColorLabels : (N = l == null ? void 0 : l.targetColorLabels) != null && N.length ? l.targetColorLabels : G(e, h);
76
- }, [u, l, o, e, h]), B = H[o] || H.added, C = (l == null ? void 0 : l.displayFileName) || ((I = e == null ? void 0 : e.sampleFileName) == null ? void 0 : I.name) || (e == null ? void 0 : e.fileName) || "-", a = (e == null ? void 0 : e.fileUrl) || (e == null ? void 0 : e.thumbnailUrl) || "", W = (z = (k = e == null ? void 0 : e.labels) == null ? void 0 : k.length) != null ? z : 0, F = !!a && O !== a, d = E || A || F, X = E || A || b && F;
77
- return U(() => {
78
- m == null || m(t && !d && !!a);
79
- }, [t, d, a, m]), _("leftarrow", () => {
80
- !t || d || M();
81
- }), _("rightarrow", () => {
82
- !t || d || S();
83
- }), /* @__PURE__ */ s(T, {
84
- open: t,
85
- onCancel: K,
86
- footer: null,
87
- centered: !0,
88
- width: 1151,
89
- destroyOnClose: !0,
90
- wrapClassName: "vc-single-detail-modal-wrap",
91
- className: "vc-single-detail-modal",
92
- title: /* @__PURE__ */ c("div", {
93
- className: "vc-detail-modal-header",
94
- children: [/* @__PURE__ */ c("div", {
95
- className: "vc-detail-modal-header-left",
96
- children: [/* @__PURE__ */ s("span", {
97
- className: "vc-detail-modal-title",
98
- children: "图片详情"
99
- }), /* @__PURE__ */ s(D, {
100
- className: `vc-detail-change-tag ${B.className}`,
101
- children: B.text
102
- })]
103
- }), /* @__PURE__ */ s("span", {
104
- className: "vc-detail-modal-filename",
105
- title: C,
106
- children: C
107
- })]
108
- }),
109
- children: /* @__PURE__ */ c("div", {
110
- className: "vc-single-detail-body",
111
- children: [/* @__PURE__ */ s(q, {
112
- className: "vc-detail-nav-btn select-prev",
113
- icon: /* @__PURE__ */ s($, {
114
- type: "icon-zuojiantou"
115
- }),
116
- type: "text",
117
- disabled: d,
118
- onClick: M
119
- }), /* @__PURE__ */ c("div", {
120
- className: "vc-single-detail-center",
121
- children: [/* @__PURE__ */ s("div", {
122
- className: "vc-ocr-box-count-bar",
123
- children: b ? `标注框数量:${W}` : null
124
- }), /* @__PURE__ */ c("div", {
125
- className: "vc-single-detail-canvas",
126
- children: [e && /* @__PURE__ */ s("div", {
127
- className: "vc-modal-detection-status",
128
- children: /* @__PURE__ */ s(ee, {
129
- sample: e
130
- })
131
- }), e && (b ? /* @__PURE__ */ s(se, {
132
- zoomMin: 0.1,
133
- zoomMax: 10,
134
- zoomStep: 0.1,
135
- url: a,
136
- labels: e.labels || [],
137
- onImageLoad: () => i(a),
138
- onImageError: () => i(a)
139
- }, "vc-single-ocr") : /* @__PURE__ */ s(le, {
140
- disabled: !0,
141
- isPreLabel: !0,
142
- imageUrl: a,
143
- labels: Q,
144
- onImageLoad: () => i(a),
145
- onImageError: () => i(a)
146
- }, "vc-single-det")), X && /* @__PURE__ */ s("div", {
147
- className: "vc-detail-loading-mask",
148
- children: /* @__PURE__ */ s(y, {})
149
- })]
150
- })]
151
- }), /* @__PURE__ */ s(q, {
152
- className: "vc-detail-nav-btn select-next",
153
- icon: /* @__PURE__ */ s($, {
154
- type: "icon-youjiantou"
155
- }),
156
- type: "text",
157
- disabled: d,
158
- onClick: S
159
- })]
160
- })
161
- });
162
- };
163
- export {
164
- ve as default
165
- };