@glodon-aiot/dataset-annotation 3.0.10-beta.1 → 3.0.10-beta.11

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 (121) hide show
  1. package/dist/es/Common/Page/index.mjs +28 -0
  2. package/dist/es/Common/PageContent/index.mjs +18 -0
  3. package/dist/es/Common/PageHeader/index.mjs +38 -0
  4. package/dist/es/DatasetContext/index.mjs +11 -0
  5. package/dist/es/_virtual/_commonjsHelpers.mjs +6 -0
  6. package/dist/es/_virtual/index.mjs +4 -0
  7. package/dist/es/access/images/data_empty.svg.mjs +4 -0
  8. package/dist/es/components/CompositionInput/index.mjs +53 -0
  9. package/dist/es/components/DataEmpty/index.mjs +50 -0
  10. package/dist/es/components/DetectionAnnotation/PreSamplesPage/index.mjs +291 -0
  11. package/dist/es/components/DetectionAnnotation/components/DisabledTooltip/index.mjs +23 -0
  12. package/dist/es/components/DetectionAnnotation/components/ImageDetail/index.mjs +165 -0
  13. package/dist/es/components/DetectionAnnotation/components/LabelMaker/Drawable.mjs +51 -0
  14. package/dist/es/components/DetectionAnnotation/components/LabelMaker/FabricCustomize.mjs +42 -0
  15. package/dist/es/components/DetectionAnnotation/components/LabelMaker/RectLabel.mjs +283 -0
  16. package/dist/es/components/DetectionAnnotation/components/LabelMaker/icons/delete-icon.svg.mjs +4 -0
  17. package/dist/es/components/DetectionAnnotation/components/LabelMaker/index.mjs +314 -0
  18. package/dist/es/components/DetectionAnnotation/components/Labels/index.mjs +200 -0
  19. package/dist/es/components/DetectionAnnotation/components/TagItem/index.mjs +143 -0
  20. package/dist/es/components/DetectionAnnotation/icon_item_empty.svg.mjs +4 -0
  21. package/dist/es/components/DetectionAnnotation/index.mjs +712 -0
  22. package/dist/es/components/DetectionImageAnnotation/index.mjs +61 -0
  23. package/dist/es/components/Iconfont/index.mjs +16 -0
  24. package/dist/es/components/MarkDescriptions/index.mjs +65 -0
  25. package/dist/es/components/OCRImageViewer/index.mjs +212 -0
  26. package/dist/es/components/OcrAnnotation/MarkKVOCRModal/CategoryDrawer.mjs +136 -0
  27. package/dist/es/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/LabelEditorInput.mjs +57 -0
  28. package/dist/es/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/LabelEditorItem.mjs +72 -0
  29. package/dist/es/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/LableEditor.mjs +54 -0
  30. package/dist/es/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/index.mjs +366 -0
  31. package/dist/es/components/OcrAnnotation/MarkKVOCRModal/index.mjs +254 -0
  32. package/dist/es/components/OcrAnnotation/MarkOCRBoxModal/ImageDetail/index.mjs +100 -0
  33. package/dist/es/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/images/delete.png.mjs +4 -0
  34. package/dist/es/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/index.mjs +755 -0
  35. package/dist/es/components/OcrAnnotation/MarkOCRBoxModal/index.mjs +230 -0
  36. package/dist/es/components/OcrAnnotation/OcrModal/index.mjs +179 -0
  37. package/dist/es/components/OcrAnnotation/PreLabelOCR/PreLabelModal.mjs +280 -0
  38. package/dist/es/components/OcrAnnotation/PreLabelOCR/index.mjs +43 -0
  39. package/dist/es/components/OcrAnnotation/constant.mjs +5 -0
  40. package/dist/es/components/OcrAnnotation/index.mjs +381 -0
  41. package/dist/es/components/OcrImageAnnotation/index.mjs +39 -0
  42. package/dist/es/components/PageNav/index.mjs +29 -0
  43. package/dist/es/components/PicZipImportModal/index.mjs +583 -0
  44. package/dist/es/components/PicZipImportModal/pic_zip.svg.mjs +4 -0
  45. package/dist/es/components/PicZipImportModal/pic_zip_json.svg.mjs +4 -0
  46. package/dist/es/components/PreLabelOCR/PreLabelModal.mjs +275 -0
  47. package/dist/es/components/PreLabelOCR/index.mjs +43 -0
  48. package/dist/es/components/ScanTable/index.mjs +96 -0
  49. package/dist/es/components/Thumbnail/default.png.mjs +4 -0
  50. package/dist/es/components/Thumbnail/index.mjs +30 -0
  51. package/dist/es/components/hooks/Prompt.mjs +33 -0
  52. package/dist/es/constant.mjs +13 -0
  53. package/dist/es/createDatasetAnnotation/index.mjs +133 -0
  54. package/dist/es/createDetectionDatasetAnnotation/index.mjs +129 -0
  55. package/dist/es/createDetectionImageAnnotation/index.mjs +31 -0
  56. package/dist/es/createOcrDatasetAnnotation/index.mjs +129 -0
  57. package/dist/es/createOcrImageAnnotation/index.mjs +33 -0
  58. package/dist/es/featuresConfig.mjs +79 -0
  59. package/dist/es/index.mjs +35 -0
  60. package/dist/es/node_modules/classnames/index.mjs +42 -0
  61. package/dist/es/utils/color.mjs +30 -0
  62. package/dist/es/utils/index.mjs +22 -0
  63. package/dist/es/utils/sign.mjs +33 -0
  64. package/dist/lib/index.js +7 -0
  65. package/dist/src/Common/Page/index.d.ts +1 -2
  66. package/dist/src/Common/PageHeader/index.d.ts +0 -1
  67. package/dist/src/DatasetContext/index.d.ts +3 -4
  68. package/dist/src/components/CompositionInput/index.d.ts +2 -2
  69. package/dist/src/components/DataEmpty/index.d.ts +1 -2
  70. package/dist/src/components/DetectionAnnotation/PreSamplesPage/index.d.ts +1 -2
  71. package/dist/src/components/DetectionAnnotation/components/DisabledTooltip/index.d.ts +2 -2
  72. package/dist/src/components/DetectionAnnotation/components/ImageDetail/index.d.ts +1 -2
  73. package/dist/src/components/DetectionAnnotation/components/LabelMaker/Drawable.d.ts +2 -2
  74. package/dist/src/components/DetectionAnnotation/components/LabelMaker/RectLabel.d.ts +2 -2
  75. package/dist/src/components/DetectionAnnotation/components/LabelMaker/index.d.ts +0 -1
  76. package/dist/src/components/DetectionAnnotation/components/Labels/index.d.ts +0 -1
  77. package/dist/src/components/DetectionAnnotation/components/TagItem/index.d.ts +1 -2
  78. package/dist/src/components/DetectionAnnotation/index.d.ts +1 -2
  79. package/dist/src/components/DetectionImageAnnotation/index.d.ts +0 -2
  80. package/dist/src/components/Iconfont/font_3140028_iptomfpgyu.d.ts +0 -0
  81. package/dist/src/components/Iconfont/font_3454453_gu5ijeufyng.d.ts +0 -0
  82. package/dist/src/components/Iconfont/font_4108228_3slzqhoow93.d.ts +0 -0
  83. package/dist/src/components/Iconfont/font_4439177_k3mjwv7kzfd.d.ts +0 -0
  84. package/dist/src/components/Iconfont/index.d.ts +1 -1
  85. package/dist/src/components/MarkDescriptions/index.d.ts +0 -1
  86. package/dist/src/components/OCRImageViewer/index.d.ts +1 -2
  87. package/dist/src/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/LabelEditorInput.d.ts +2 -2
  88. package/dist/src/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/LabelEditorItem.d.ts +1 -2
  89. package/dist/src/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/LableEditor.d.ts +0 -1
  90. package/dist/src/components/OcrAnnotation/MarkKVOCRModal/index.d.ts +0 -1
  91. package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/ImageDetail/index.d.ts +1 -2
  92. package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/LabelEditorInput.d.ts +2 -2
  93. package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/LabelEditorItem.d.ts +0 -1
  94. package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/LableEditor.d.ts +0 -1
  95. package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/index.d.ts +0 -1
  96. package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/index.d.ts +0 -1
  97. package/dist/src/components/OcrAnnotation/OcrModal/index.d.ts +1 -2
  98. package/dist/src/components/OcrAnnotation/PreLabelOCR/PreLabelModal.d.ts +1 -2
  99. package/dist/src/components/OcrAnnotation/PreLabelOCR/index.d.ts +1 -2
  100. package/dist/src/components/OcrAnnotation/index.d.ts +1 -2
  101. package/dist/src/components/OcrImageAnnotation/index.d.ts +0 -2
  102. package/dist/src/components/PageNav/index.d.ts +1 -2
  103. package/dist/src/components/PicZipImportModal/index.d.ts +1 -2
  104. package/dist/src/components/PreLabelOCR/PreLabelModal.d.ts +1 -2
  105. package/dist/src/components/PreLabelOCR/index.d.ts +1 -2
  106. package/dist/src/components/ScanTable/index.d.ts +1 -2
  107. package/dist/src/components/Thumbnail/index.d.ts +1 -2
  108. package/dist/src/components/hooks/useBlocker.d.ts +1 -1
  109. package/dist/src/featuresConfig.d.ts +1 -1
  110. package/package.json +22 -15
  111. package/dist/dataset-annotation.js +0 -97736
  112. package/dist/dataset-annotation.umd.cjs +0 -905
  113. package/dist/example/DatasetAnnotationDemo.d.ts +0 -3
  114. package/dist/example/DemoTabs.d.ts +0 -3
  115. package/dist/example/DetectionDatasetDemo.d.ts +0 -5
  116. package/dist/example/DetectionImageDemo.d.ts +0 -5
  117. package/dist/example/OcrDatasetDemo.d.ts +0 -5
  118. package/dist/example/OcrImageDemo.d.ts +0 -5
  119. package/dist/example/OcrkvcDatasetDemo.d.ts +0 -5
  120. package/dist/example/constant.local.d.ts +0 -6
  121. package/dist/example/index.d.ts +0 -1
@@ -0,0 +1,28 @@
1
+ import { jsxs as a, jsx as o } from "react/jsx-runtime";
2
+ import { Layout as m } from "antd";
3
+ import n from "../PageContent/index.mjs";
4
+ import l from "../PageHeader/index.mjs";
5
+ /* empty css */const g = (e) => {
6
+ const {
7
+ title: t,
8
+ header: r,
9
+ className: i
10
+ } = e;
11
+ return /* @__PURE__ */ a(m, {
12
+ style: {
13
+ height: "100%",
14
+ width: "100%",
15
+ overflow: "hidden"
16
+ },
17
+ className: i,
18
+ children: [r, !r && t && /* @__PURE__ */ o(l, {
19
+ className: "content-title",
20
+ title: t
21
+ }), /* @__PURE__ */ o(n, {
22
+ children: e.children
23
+ })]
24
+ });
25
+ };
26
+ export {
27
+ g as default
28
+ };
@@ -0,0 +1,18 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ function r(o) {
3
+ const {
4
+ children: e
5
+ } = o;
6
+ return /* @__PURE__ */ n("div", {
7
+ style: {
8
+ padding: 16,
9
+ backgroundColor: "#F7F7F9",
10
+ overflow: "hidden",
11
+ height: "100%"
12
+ },
13
+ children: e
14
+ });
15
+ }
16
+ export {
17
+ r as default
18
+ };
@@ -0,0 +1,38 @@
1
+ import { jsxs as c, jsx as a } from "react/jsx-runtime";
2
+ import d from "../../node_modules/classnames/index.mjs";
3
+ /* empty css */function u(l) {
4
+ const {
5
+ breadcrumb: e,
6
+ title: i,
7
+ icon: o,
8
+ actions: s,
9
+ className: m,
10
+ children: n
11
+ } = l, t = !!n, r = d({
12
+ "page-header bg-white h-auto leading-none content-title": !0
13
+ });
14
+ return /* @__PURE__ */ c("div", {
15
+ className: r,
16
+ style: {
17
+ padding: `${t ? "16" : "24"}px 22px ${t ? "0" : "24"}px 22px`
18
+ },
19
+ children: [e && /* @__PURE__ */ a("div", {
20
+ children: e
21
+ }), /* @__PURE__ */ c("div", {
22
+ className: "title-bar flex justify-between items-center",
23
+ style: {
24
+ marginTop: `${t && e ? "16" : "0"}px`
25
+ },
26
+ children: [i && /* @__PURE__ */ a("div", {
27
+ className: "title",
28
+ children: i
29
+ }), s && /* @__PURE__ */ a("div", {
30
+ className: "actions",
31
+ children: s
32
+ })]
33
+ }), n]
34
+ });
35
+ }
36
+ export {
37
+ u as default
38
+ };
@@ -0,0 +1,11 @@
1
+ import { createContext as t } from "react";
2
+ const a = t({
3
+ datasetId: "",
4
+ versionId: "",
5
+ no: "",
6
+ loading: !1,
7
+ services: {}
8
+ });
9
+ export {
10
+ a as default
11
+ };
@@ -0,0 +1,6 @@
1
+ function e(t) {
2
+ return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
3
+ }
4
+ export {
5
+ e as getDefaultExportFromCjs
6
+ };
@@ -0,0 +1,4 @@
1
+ var s = { exports: {} };
2
+ export {
3
+ s as __module
4
+ };
@@ -0,0 +1,4 @@
1
+ const N = "data:image/svg+xml;base64,PHN2ZyB3a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xNzk5IDU5IDI2LjczOTkgNTlDMjguNjE5OSA1OSAyOC42MTk5IDYwLjMyIDI4LjYxOTkgNjFDMjguNjE5OSA2Ny42MyAzNC4xMTk5IDczIDQwLjg5OTkgNzNDNDcuNjc5OSA3MyA1My4xNjk5IDY3LjYzIDUzLjE2OTkgNjFDNTMuMTY5OSA2MC4zMiA1My4xNjk5IDU5IDU1LjA0OTkgNTlINzkuOTk5OSIgc3Ryb2tlPSIjOTY5OUI3IiBzdHJva2Utd2lkdGg9IjIuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CjxwYXRoIGQ9Ik00MC4xIDE4Ljc2VjJNMjUuMSAxOC43NkwxNCA2LjMwMDA1TTY2LjEgNi4zMDAwNUw1NSAxOC43NiIgc3Ryb2tlPSIjOUMyNEYyIiBzdHJva2Utd2lkdGg9IjIuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CjxkZWZzPgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MF9saW5lYXJfNDc4M18xNTE4NSIgeDE9IjU4LjM1NzMiIHkxPSI3NSIgeDI9IjcwLjYyNTIiIHkyPSI3NSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjMjA1RUY5Ii8+CjxzdG9wIG9mZnNldD0iMC42IiBzdG9wLWNvbG9yPSIjODM1QUZFIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI0ZENjJEOSIvPgo8L2xpbmVhckdyYWRpZW50Pgo8L2RlZnM+Cjwvc3ZnPgo=";
2
+ export {
3
+ N as default
4
+ };
@@ -0,0 +1,53 @@
1
+ var V = Object.defineProperty, b = Object.defineProperties;
2
+ var j = Object.getOwnPropertyDescriptors;
3
+ var n = Object.getOwnPropertySymbols;
4
+ var c = Object.prototype.hasOwnProperty, l = Object.prototype.propertyIsEnumerable;
5
+ var p = (o, e, t) => e in o ? V(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, f = (o, e) => {
6
+ for (var t in e || (e = {}))
7
+ c.call(e, t) && p(o, t, e[t]);
8
+ if (n)
9
+ for (var t of n(e))
10
+ l.call(e, t) && p(o, t, e[t]);
11
+ return o;
12
+ }, C = (o, e) => b(o, j(e));
13
+ var d = (o, e) => {
14
+ var t = {};
15
+ for (var s in o)
16
+ c.call(o, s) && e.indexOf(s) < 0 && (t[s] = o[s]);
17
+ if (o != null && n)
18
+ for (var s of n(o))
19
+ e.indexOf(s) < 0 && l.call(o, s) && (t[s] = o[s]);
20
+ return t;
21
+ };
22
+ import { jsx as w } from "react/jsx-runtime";
23
+ import { Input as A } from "antd";
24
+ import K, { useState as g, useEffect as O } from "react";
25
+ const P = (o) => {
26
+ const u = o, {
27
+ value: e,
28
+ onChange: t
29
+ } = u, s = d(u, [
30
+ "value",
31
+ "onChange"
32
+ ]), [v, r] = g(e), [h, a] = g(!1), x = navigator.userAgent.indexOf("WebKit") > -1;
33
+ O(() => {
34
+ r(e);
35
+ }, [e]);
36
+ const E = () => {
37
+ a(!0);
38
+ }, I = (i) => {
39
+ a(!1), x && (t == null || t(i.currentTarget.value));
40
+ }, S = (i) => {
41
+ const m = i.target.value;
42
+ r(m), h || t == null || t(m);
43
+ };
44
+ return /* @__PURE__ */ w(A, C(f({}, s), {
45
+ value: v,
46
+ onChange: S,
47
+ onCompositionStart: E,
48
+ onCompositionEnd: I
49
+ }));
50
+ }, k = K.memo(P);
51
+ export {
52
+ k as default
53
+ };
@@ -0,0 +1,50 @@
1
+ var y = Object.defineProperty;
2
+ var a = Object.getOwnPropertySymbols;
3
+ var h = Object.prototype.hasOwnProperty, N = Object.prototype.propertyIsEnumerable;
4
+ var c = (s, t, e) => t in s ? y(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, m = (s, t) => {
5
+ for (var e in t || (t = {}))
6
+ h.call(t, e) && c(s, e, t[e]);
7
+ if (a)
8
+ for (var e of a(t))
9
+ N.call(t, e) && c(s, e, t[e]);
10
+ return s;
11
+ };
12
+ import { jsx as i, jsxs as x } from "react/jsx-runtime";
13
+ import { Empty as f, Button as u } from "antd";
14
+ import k from "../../access/images/data_empty.svg.mjs";
15
+ /* empty css */const b = (s) => {
16
+ const {
17
+ emptyClassName: t,
18
+ emptyStyle: e,
19
+ image: n,
20
+ description: l,
21
+ showBtn: o,
22
+ btnText: r,
23
+ children: p,
24
+ handleClick: d
25
+ } = s;
26
+ return /* @__PURE__ */ i(f, {
27
+ className: `unit-empty ${t || ""}`,
28
+ style: m({}, e),
29
+ image: n || k,
30
+ description: /* @__PURE__ */ x("div", {
31
+ className: "descriptions",
32
+ children: [/* @__PURE__ */ i("span", {
33
+ className: "desc",
34
+ children: l || "暂无数据"
35
+ }), o && /* @__PURE__ */ i(u, {
36
+ className: "action",
37
+ type: "link",
38
+ onClick: d,
39
+ children: /* @__PURE__ */ i("span", {
40
+ className: "action-text",
41
+ children: r
42
+ })
43
+ })]
44
+ }),
45
+ children: p || ""
46
+ });
47
+ };
48
+ export {
49
+ b as default
50
+ };
@@ -0,0 +1,291 @@
1
+ var Y = Object.defineProperty, Z = Object.defineProperties;
2
+ var _ = Object.getOwnPropertyDescriptors;
3
+ var B = Object.getOwnPropertySymbols;
4
+ var $ = Object.prototype.hasOwnProperty, ee = Object.prototype.propertyIsEnumerable;
5
+ var H = (h, s, a) => s in h ? Y(h, s, { enumerable: !0, configurable: !0, writable: !0, value: a }) : h[s] = a, y = (h, s) => {
6
+ for (var a in s || (s = {}))
7
+ $.call(s, a) && H(h, a, s[a]);
8
+ if (B)
9
+ for (var a of B(s))
10
+ ee.call(s, a) && H(h, a, s[a]);
11
+ return h;
12
+ }, D = (h, s) => Z(h, _(s));
13
+ import { jsxs as E, jsx as m } from "react/jsx-runtime";
14
+ import { useContext as te, useRef as re, useState as b, useEffect as k } from "react";
15
+ import { Button as V, Space as ne, message as L, Modal as K } from "antd";
16
+ /* empty css */import { useKeyPress as ie } from "ahooks";
17
+ import le from "../components/ImageDetail/index.mjs";
18
+ import se from "../../../DatasetContext/index.mjs";
19
+ import { tagColors as oe } from "../../../utils/index.mjs";
20
+ import ce from "../../../Common/Page/index.mjs";
21
+ const be = (h) => {
22
+ const {
23
+ datasetId: s,
24
+ versionId: a,
25
+ onClose: S,
26
+ samples: M,
27
+ labels: q,
28
+ fetchLength: F
29
+ } = h, {
30
+ services: {
31
+ cvforceDatahub: p
32
+ },
33
+ featuresConfig: {
34
+ datasetManager: R
35
+ } = {
36
+ datasetManager: !1
37
+ }
38
+ } = te(se), G = re(null), [N, J] = b(!1), [Q, j] = b(!1), [C, v] = b(0), [d, g] = b(), [f, x] = b(), [c, P] = b({
39
+ current: 1,
40
+ pageSize: 1e4
41
+ }), [u, z] = b([]), A = (t) => {
42
+ if (!p)
43
+ return Promise.resolve(!1);
44
+ const e = (t == null ? void 0 : t.current) || c.current, r = (t == null ? void 0 : t.pageSize) || c.pageSize;
45
+ return !s || !a || !e ? Promise.resolve(!1) : (P(D(y({}, c), {
46
+ current: e,
47
+ pageSize: r
48
+ })), p.getDatasetsIdVersionsVidSamples(s, a, {
49
+ pageNo: e,
50
+ pageSize: r,
51
+ confirmStatus: 1
52
+ }).then((l) => {
53
+ const o = l.recordList || [];
54
+ if (o.length === 0)
55
+ return S(), !1;
56
+ const n = e === 1 ? o : [...M, ...o];
57
+ if (z(n), P(D(y({}, c), {
58
+ current: e,
59
+ pageSize: r,
60
+ total: l.totalResults
61
+ })), c.type === "next" && o.length) {
62
+ v(0);
63
+ const i = l.recordList[0];
64
+ g(i);
65
+ }
66
+ if (c.type === "prev" && o.length) {
67
+ v(c.pageSize - 1);
68
+ const i = l.recordList[c.pageSize - 1];
69
+ g(i);
70
+ }
71
+ return N && C < 0 && (v(0), g(o[0]), j(!0)), n;
72
+ }).catch(() => !1));
73
+ };
74
+ k(() => {
75
+ !d && !C && g(u[0]);
76
+ }, [u]), ie("Esc", S), k(() => {
77
+ A(c).then((t) => {
78
+ });
79
+ }, [c.current]), k(() => {
80
+ !N && d && J(!0);
81
+ }, [d]);
82
+ const U = () => {
83
+ if (!(!s || !a) && p)
84
+ return p.getDatasetsIdVersionsVidLabelcount(s, a).then((t) => ((t || []).filter((r) => r.label !== "nocode").map((r, l) => ({
85
+ label: r.label,
86
+ count: r.count,
87
+ id: r.id,
88
+ color: oe[l % 40]
89
+ })), t));
90
+ };
91
+ k(() => {
92
+ c.type || A();
93
+ }, [c.type]);
94
+ const O = (t) => {
95
+ if (u)
96
+ return T(t).then((e) => (e && z((r) => {
97
+ var o;
98
+ let l;
99
+ if (Array.isArray(r)) {
100
+ if (!r.length)
101
+ return S(), r;
102
+ const n = t ? C + 1 : C;
103
+ if (f || d) {
104
+ const i = f || d;
105
+ if (i && ((o = i.labels) != null && o.length) && t === 0) {
106
+ const I = r.findIndex((w) => w.id === i.id);
107
+ I > -1 && (r.splice(I, 1), l = [...r]);
108
+ }
109
+ }
110
+ n >= r.length ? n === u.length ? L.error("已经是最后一个了") : A({
111
+ current: c.current,
112
+ pageSize: c.pageSize,
113
+ type: "next"
114
+ }).then((i) => {
115
+ if (Array.isArray(i)) {
116
+ v(n >= i.length ? n - 1 : n);
117
+ const I = i[n >= i.length ? n - 1 : n];
118
+ g(I), x(void 0);
119
+ }
120
+ }) : setTimeout(() => {
121
+ v(n);
122
+ const i = r[n];
123
+ g(i), x(void 0);
124
+ }, 200);
125
+ }
126
+ return l || r;
127
+ }), e));
128
+ }, W = (t) => {
129
+ if (M)
130
+ return T(t).then((e) => {
131
+ e && z((r) => {
132
+ var o;
133
+ let l;
134
+ if (Array.isArray(r)) {
135
+ if (!r.length)
136
+ return S(), r;
137
+ const n = C - 1;
138
+ if (n < 0)
139
+ (c.current - 1) * c.pageSize + n < 0 ? L.error("已经是第一个了") : P({
140
+ current: c.current - 1,
141
+ pageSize: c.pageSize,
142
+ type: "prev"
143
+ });
144
+ else {
145
+ if (f || d) {
146
+ const i = f || d;
147
+ if (i && ((o = i.labels) != null && o.length) && t === 0) {
148
+ const I = r.findIndex((w) => w.id === i.id);
149
+ I > -1 && (r.splice(I, 1), l = [...r]);
150
+ }
151
+ }
152
+ setTimeout(() => {
153
+ v(n);
154
+ const i = r[n];
155
+ g(i), x(void 0);
156
+ }, 200);
157
+ }
158
+ }
159
+ return l || r;
160
+ });
161
+ });
162
+ }, T = (t) => {
163
+ var r;
164
+ if (!p)
165
+ return Promise.resolve(!1);
166
+ const e = f || (t === 0 ? d : void 0);
167
+ if (e) {
168
+ if (e.labels)
169
+ e.labels = e.labels.filter((l) => !!l.id);
170
+ else if (t === 0)
171
+ return L.error("图片没有标注信息,无法保存"), Promise.resolve(!1);
172
+ return delete e.confirmStatus, p.updateSamples(s, a, [e], (r = e.labels) != null && r.length ? t : 1).then(() => (L.success({
173
+ content: "保存成功"
174
+ }), z((l) => {
175
+ if (l.length === 0)
176
+ return S(), [];
177
+ {
178
+ const o = l.findIndex((n) => n.id === (e == null ? void 0 : e.id));
179
+ return o > -1 && (l[o] = e), [...l];
180
+ }
181
+ }), !0)).catch(() => !1);
182
+ } else
183
+ return Promise.resolve(!0);
184
+ }, X = () => {
185
+ if (!p)
186
+ return Promise.resolve(!1);
187
+ K.confirm({
188
+ title: "确认要删除当前数据吗?",
189
+ content: "数据包含当前标注的内容和图片,删除后无法恢复,请确认是否删除!",
190
+ onOk: () => {
191
+ d && p.delDatasetsIdVersionsVidSamplesId(s, a, d.id).then(() => {
192
+ const t = u.findIndex((e) => e.id === d.id);
193
+ u.splice(t, 1), z([...u]), u.length || S(), t <= u.length - 1 ? g(u[t]) : (g(u[t - 1]), v(t - 1)), x(void 0), F();
194
+ });
195
+ }
196
+ });
197
+ };
198
+ return /* @__PURE__ */ E(ce, {
199
+ className: "preLabels-details-page",
200
+ header: /* @__PURE__ */ E("div", {
201
+ className: "preLabels-page-header",
202
+ children: [/* @__PURE__ */ m("div", {
203
+ className: "header-title",
204
+ children: "待确认标注"
205
+ }), /* @__PURE__ */ m(V, {
206
+ onClick: S,
207
+ children: "退出"
208
+ })]
209
+ }),
210
+ children: [/* @__PURE__ */ m("div", {
211
+ className: "preLabels-action",
212
+ children: /* @__PURE__ */ E(ne, {
213
+ children: [/* @__PURE__ */ m(V, {
214
+ type: "primary",
215
+ onClick: () => {
216
+ if (f && f.labels.some((t) => !t.id))
217
+ return L.error("所有标注需设置标签"), Promise.resolve(!1);
218
+ x(d), O(0);
219
+ },
220
+ children: "保存当前标注"
221
+ }), /* @__PURE__ */ m(V, {
222
+ onClick: () => {
223
+ if (!p)
224
+ return Promise.resolve(!1);
225
+ K.confirm({
226
+ title: "一键保存所有标注?",
227
+ content: "待确认的所有带预标注信息的图片将保存至已标注页签下",
228
+ onOk: () => {
229
+ p.getAllConfirmSamples(s, a).then((t) => {
230
+ L.success("保存成功"), A(D(y({}, c), {
231
+ current: 1,
232
+ type: "next"
233
+ })).then((e) => {
234
+ Array.isArray(e) && e.length && (v(0), g(e[0]));
235
+ });
236
+ });
237
+ }
238
+ });
239
+ },
240
+ children: "一键保存所有标注"
241
+ }), R && R.delete && /* @__PURE__ */ m(V, {
242
+ onClick: X,
243
+ children: "删除数据"
244
+ })]
245
+ })
246
+ }), /* @__PURE__ */ m("div", {
247
+ className: "d-row",
248
+ children: !!u.length && /* @__PURE__ */ m("div", {
249
+ className: "d-right",
250
+ ref: G,
251
+ children: d && /* @__PURE__ */ m(le, {
252
+ datasetId: s,
253
+ isImageDetailVisible: Q,
254
+ setIsImageDetailVisible: j,
255
+ currentSample: f != null ? f : d,
256
+ labels: q,
257
+ editing: N,
258
+ onChange: x,
259
+ onNextClick: () => O(1),
260
+ onPrevClick: () => W(1),
261
+ onRefresh: () => {
262
+ var t;
263
+ (t = U()) == null || t.then((e) => {
264
+ var r, l;
265
+ if (f) {
266
+ const o = [];
267
+ (r = f.labels) == null || r.forEach((n) => {
268
+ e != null && e.find((i) => i.id === n.id) && o.push(n);
269
+ }), f.labels = o, x(y({}, f));
270
+ }
271
+ if (d) {
272
+ const o = [];
273
+ (l = d.labels) == null || l.forEach((n) => {
274
+ e != null && e.find((i) => i.id === n.id) && o.push(n);
275
+ }), d.labels = o, g(y({}, d));
276
+ }
277
+ });
278
+ },
279
+ settingHide: !0,
280
+ imgCount: {
281
+ total: u.length,
282
+ index: C + 1
283
+ }
284
+ })
285
+ })
286
+ })]
287
+ });
288
+ };
289
+ export {
290
+ be as default
291
+ };
@@ -0,0 +1,23 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { useState as p } from "react";
3
+ import { Tooltip as r } from "antd";
4
+ const f = (t) => {
5
+ const {
6
+ isPreLabel: s,
7
+ placement: i,
8
+ children: l
9
+ } = t, [n, e] = p(!1);
10
+ return /* @__PURE__ */ o(r, {
11
+ title: "预标注进行中,请任务完成后再试",
12
+ open: n,
13
+ placement: i || "top",
14
+ children: /* @__PURE__ */ o("div", {
15
+ onMouseEnter: () => s && e(!0),
16
+ onMouseLeave: () => e(!1),
17
+ children: l
18
+ })
19
+ });
20
+ };
21
+ export {
22
+ f as default
23
+ };