@glodon-aiot/dataset-annotation 3.11.1-shapshot.1765331459 → 3.13.0-alpha.28

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 (118) hide show
  1. package/dist/es/DatasetContext/index.mjs +6 -3
  2. package/dist/es/components/DetectionAnnotation/components/ImageDetail/index.mjs +94 -91
  3. package/dist/es/components/DetectionAnnotation/components/ImageModal/index.mjs +129 -0
  4. package/dist/es/components/DetectionAnnotation/components/ImageModal/style.less.mjs +4 -0
  5. package/dist/es/components/DetectionAnnotation/components/LabelMaker/Drawable.mjs +37 -28
  6. package/dist/es/components/DetectionAnnotation/components/LabelMaker/RectLabel.mjs +136 -108
  7. package/dist/es/components/DetectionAnnotation/components/LabelMaker/index.mjs +197 -162
  8. package/dist/es/components/DetectionAnnotation/index.mjs +424 -395
  9. package/dist/es/components/Iconfont/index.mjs +2 -2
  10. package/dist/es/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/index.mjs +1 -1
  11. package/dist/es/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/index.mjs +1 -1
  12. package/dist/es/components/OcrAnnotation/OcrModal/index.mjs +43 -45
  13. package/dist/es/components/PicZipImportModal/config.mjs +47 -0
  14. package/dist/es/components/PicZipImportModal/index.mjs +308 -293
  15. package/dist/es/components/PicZipImportModal/pic_vlm_json_zip.svg.mjs +4 -0
  16. package/dist/es/components/PicZipImportModal/pic_vlm_zip.svg.mjs +4 -0
  17. package/dist/es/components/PreLabelOCR/index.mjs +1 -1
  18. package/dist/es/components/VLMAnnotation/RegionItem.mjs +94 -0
  19. package/dist/es/components/VLMAnnotation/TextAnnotationPanel.mjs +83 -0
  20. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasDrag.mjs +116 -0
  21. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasSetup.mjs +115 -0
  22. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasZoom.mjs +42 -0
  23. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useCropRegionImage.mjs +55 -0
  24. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useDeleteControl.mjs +51 -0
  25. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useDeleteRegion.mjs +47 -0
  26. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useDrawingMode.mjs +248 -0
  27. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRLoadingIcon.mjs +106 -0
  28. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRRecognition.mjs +68 -0
  29. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionHover.mjs +38 -0
  30. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionLoader.mjs +141 -0
  31. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionNameText.mjs +72 -0
  32. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionSelection.mjs +113 -0
  33. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionUpdate.mjs +103 -0
  34. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useTextLayouts.mjs +156 -0
  35. package/dist/es/components/VLMAnnotation/VLMLabelMaker/icons/del.png.mjs +4 -0
  36. package/dist/es/components/VLMAnnotation/VLMLabelMaker/index.mjs +526 -0
  37. package/dist/es/components/VLMAnnotation/VLMLabelMaker/style.less.mjs +4 -0
  38. package/dist/es/components/VLMAnnotation/VLMLabelMaker/utils/coordinateUtils.mjs +33 -0
  39. package/dist/es/components/VLMAnnotation/components/DragButton.mjs +18 -0
  40. package/dist/es/components/VLMAnnotation/components/FitToScreenButton.mjs +16 -0
  41. package/dist/es/components/VLMAnnotation/components/RectangleButton.mjs +30 -0
  42. package/dist/es/components/VLMAnnotation/components/Toolbar.mjs +40 -0
  43. package/dist/es/components/VLMAnnotation/components/ZoomControls.mjs +44 -0
  44. package/dist/es/components/VLMAnnotation/constants.mjs +50 -0
  45. package/dist/es/components/VLMAnnotation/index.mjs +242 -0
  46. package/dist/es/components/VLMAnnotation/style.less.mjs +4 -0
  47. package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/AttributeDetail/index.mjs +343 -0
  48. package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/AttributeDetail/style.less.mjs +4 -0
  49. package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/QAGenerationConfig.mjs +240 -0
  50. package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/index.mjs +201 -0
  51. package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/style.less.mjs +4 -0
  52. package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/index.mjs +455 -0
  53. package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/style.less.mjs +4 -0
  54. package/dist/es/components/VLMAnnotationDetail/VlmModal/index.mjs +149 -0
  55. package/dist/es/components/VLMAnnotationDetail/VlmModal/style.less.mjs +4 -0
  56. package/dist/es/components/VLMAnnotationDetail/index.mjs +449 -0
  57. package/dist/es/components/VLMAnnotationDetail/style.less.mjs +4 -0
  58. package/dist/es/constant.mjs +3 -3
  59. package/dist/es/createVlmtasetAnnotation/index.mjs +131 -0
  60. package/dist/es/featuresConfig.mjs +13 -9
  61. package/dist/es/index.mjs +11 -7
  62. package/dist/lib/index.js +4 -3
  63. package/dist/src/DatasetContext/index.d.ts +2 -0
  64. package/dist/src/components/DetectionAnnotation/components/ImageDetail/index.d.ts +1 -0
  65. package/dist/src/components/DetectionAnnotation/components/ImageModal/index.d.ts +34 -0
  66. package/dist/src/components/Iconfont/font_4439177_tgvowh6bmlb.d.ts +0 -0
  67. package/dist/src/components/PicZipImportModal/config.d.ts +23 -0
  68. package/dist/src/components/VLMAnnotation/ImageAnnotationDebugger.d.ts +4 -0
  69. package/dist/src/components/VLMAnnotation/RegionItem.d.ts +4 -0
  70. package/dist/src/components/VLMAnnotation/TextAnnotationPanel.d.ts +4 -0
  71. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasDrag.d.ts +13 -0
  72. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasSetup.d.ts +38 -0
  73. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasZoom.d.ts +18 -0
  74. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useCropRegionImage.d.ts +7 -0
  75. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useDeleteControl.d.ts +13 -0
  76. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useDeleteRegion.d.ts +21 -0
  77. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useDrawingMode.d.ts +32 -0
  78. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRLoadingIcon.d.ts +11 -0
  79. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRRecognition.d.ts +28 -0
  80. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionHover.d.ts +13 -0
  81. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionLoader.d.ts +37 -0
  82. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionNameText.d.ts +12 -0
  83. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionSelection.d.ts +15 -0
  84. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionUpdate.d.ts +32 -0
  85. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useTextLayouts.d.ts +25 -0
  86. package/dist/src/components/VLMAnnotation/VLMLabelMaker/index.d.ts +4 -0
  87. package/dist/src/components/VLMAnnotation/VLMLabelMaker/utils/coordinateUtils.d.ts +32 -0
  88. package/dist/src/components/VLMAnnotation/components/DragButton.d.ts +7 -0
  89. package/dist/src/components/VLMAnnotation/components/FitToScreenButton.d.ts +6 -0
  90. package/dist/src/components/VLMAnnotation/components/RectangleButton.d.ts +7 -0
  91. package/dist/src/components/VLMAnnotation/components/Toolbar.d.ts +4 -0
  92. package/dist/src/components/VLMAnnotation/components/ZoomControls.d.ts +4 -0
  93. package/dist/src/components/VLMAnnotation/constants.d.ts +97 -0
  94. package/dist/src/components/VLMAnnotation/index.d.ts +6 -0
  95. package/dist/src/components/VLMAnnotation/types.d.ts +172 -0
  96. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/AttributeDetail/index.d.ts +14 -0
  97. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/QAGenerationConfig.d.ts +12 -0
  98. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/index.d.ts +12 -0
  99. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/index.d.ts +12 -0
  100. package/dist/src/components/VLMAnnotationDetail/VlmModal/index.d.ts +17 -0
  101. package/dist/src/components/VLMAnnotationDetail/index.d.ts +6 -0
  102. package/dist/src/constant.d.ts +1 -1
  103. package/dist/src/createVlmtasetAnnotation/index.d.ts +16 -0
  104. package/dist/src/featuresConfig.d.ts +4 -0
  105. package/dist/src/index.d.ts +3 -0
  106. package/package.json +2 -2
  107. package/dist/dataset-annotation.js +0 -123598
  108. package/dist/dataset-annotation.umd.cjs +0 -1017
  109. package/dist/example/DatasetAnnotationDemo.d.ts +0 -3
  110. package/dist/example/DemoTabs.d.ts +0 -3
  111. package/dist/example/DetectionDatasetDemo.d.ts +0 -5
  112. package/dist/example/DetectionImageDemo.d.ts +0 -5
  113. package/dist/example/OcrDatasetDemo.d.ts +0 -5
  114. package/dist/example/OcrImageDemo.d.ts +0 -5
  115. package/dist/example/OcrkvcDatasetDemo.d.ts +0 -5
  116. package/dist/example/constant.local.d.ts +0 -6
  117. package/dist/example/index.d.ts +0 -1
  118. package/dist/src/utils/reactCompatibility.d.ts +0 -5
@@ -1,176 +1,177 @@
1
- var ft = Object.defineProperty, ht = Object.defineProperties;
2
- var ut = Object.getOwnPropertyDescriptors;
3
- var we = Object.getOwnPropertySymbols;
4
- var mt = Object.prototype.hasOwnProperty, pt = Object.prototype.propertyIsEnumerable;
5
- var Ee = (T, f, l) => f in T ? ft(T, f, { enumerable: !0, configurable: !0, writable: !0, value: l }) : T[f] = l, g = (T, f) => {
6
- for (var l in f || (f = {}))
7
- mt.call(f, l) && Ee(T, l, f[l]);
8
- if (we)
9
- for (var l of we(f))
10
- pt.call(f, l) && Ee(T, l, f[l]);
11
- return T;
12
- }, y = (T, f) => ht(T, ut(f));
13
- import { jsx as o, jsxs as v, Fragment as he } from "react/jsx-runtime";
14
- import { useRef as bt, useState as d, useEffect as h } from "react";
15
- import { message as K, ConfigProvider as gt, Space as ee, Select as vt, Button as M, Tabs as Ct, Col as St, Tooltip as yt, Empty as It, Spin as Lt, Modal as kt } from "antd";
16
- import Dt from "rc-virtual-list";
1
+ var ft = Object.defineProperty, ut = Object.defineProperties;
2
+ var ht = Object.getOwnPropertyDescriptors;
3
+ var Ae = Object.getOwnPropertySymbols;
4
+ var mt = Object.prototype.hasOwnProperty, gt = Object.prototype.propertyIsEnumerable;
5
+ var Ee = (N, f, o) => f in N ? ft(N, f, { enumerable: !0, configurable: !0, writable: !0, value: o }) : N[f] = o, m = (N, f) => {
6
+ for (var o in f || (f = {}))
7
+ mt.call(f, o) && Ee(N, o, f[o]);
8
+ if (Ae)
9
+ for (var o of Ae(f))
10
+ gt.call(f, o) && Ee(N, o, f[o]);
11
+ return N;
12
+ }, S = (N, f) => ut(N, ht(f));
13
+ import { jsx as s, jsxs as V, Fragment as ze } from "react/jsx-runtime";
14
+ import { useRef as pt, useState as d, useEffect as u } from "react";
15
+ import { message as z, ConfigProvider as bt, Space as te, Select as vt, Button as ie, Tabs as St, Col as Ct, Tooltip as yt, Empty as It, Spin as Lt, Modal as Dt } from "antd";
16
+ import kt from "rc-virtual-list";
17
17
  import { UploadZipsStatus as U, PreLabelTaskStatus as Tt } from "@glodon-aiot/apis";
18
- import Vt from "antd/es/locale/zh_CN";
19
- import xt from "../../DatasetContext/index.mjs";
18
+ import xt from "antd/es/locale/zh_CN";
19
+ import Vt from "../../DatasetContext/index.mjs";
20
20
  import Nt from "./icon_item_empty.svg.mjs";
21
21
  import "./style.less.mjs";
22
- import { tagColors as ze } from "../../utils/index.mjs";
23
- import Pt from "./components/ImageDetail/index.mjs";
24
- import wt from "./components/Labels/index.mjs";
25
- import { useKeyPress as Et } from "ahooks";
26
- import Ae from "./components/DisabledTooltip/index.mjs";
27
- import zt from "./PreSamplesPage/index.mjs";
28
- import { SearchOutlined as At } from "@ant-design/icons";
29
- import Mt from "../../Common/Page/index.mjs";
30
- import Rt from "../PicZipImportModal/index.mjs";
31
- import Bt from "../PageNav/index.mjs";
32
- import Ot from "../Thumbnail/index.mjs";
33
- import Ht from "../CompositionInput/index.mjs";
22
+ import { tagColors as Me } from "../../utils/index.mjs";
23
+ import Pt from "./components/Labels/index.mjs";
24
+ import { useKeyPress as wt } from "ahooks";
25
+ import Re from "./components/DisabledTooltip/index.mjs";
26
+ import At from "./PreSamplesPage/index.mjs";
27
+ import { SearchOutlined as Et } from "@ant-design/icons";
28
+ import zt from "../../Common/Page/index.mjs";
29
+ import Mt from "../PicZipImportModal/index.mjs";
30
+ import Rt from "../PageNav/index.mjs";
31
+ import Bt from "../Thumbnail/index.mjs";
32
+ import Ot from "../CompositionInput/index.mjs";
34
33
  import { Prompt as Ft } from "../hooks/Prompt.mjs";
35
- import Kt from "../PreLabelOCR/index.mjs";
36
- import Ut from "lodash/merge";
37
- import { DEFAULT_FILTER_SWITCH as jt } from "../../constant.mjs";
38
- const bi = (T) => {
39
- var Ne;
34
+ import Ht from "../PreLabelOCR/index.mjs";
35
+ import Kt from "lodash/merge";
36
+ import { DEFAULT_FILTER_SWITCH as Ut } from "../../constant.mjs";
37
+ import jt from "./components/ImageModal/index.mjs";
38
+ const bi = (N) => {
39
+ var Pe;
40
40
  const {
41
41
  services: f,
42
- datasetId: l,
43
- versionId: G,
44
- backTo: Me,
42
+ datasetId: o,
43
+ versionId: Q,
44
+ backTo: Be,
45
45
  labelManager: ue = !1,
46
- datasetManager: m = !1,
47
- annotation: Re,
48
- header: I = {
46
+ datasetManager: I = !1,
47
+ annotation: Oe,
48
+ header: D = {
49
49
  versionSelect: !1
50
50
  },
51
- exampleSrcRoot: Be
52
- } = T, j = g({}, jt);
53
- Ut(j, T.filterSwitch);
54
- const Z = bt(null), [C, me] = d(), [i, $] = d(), [J, Oe] = d([]), [pe, be] = d(!1), [B, ge] = d(0), [S, te] = d(""), [O, ve] = d(0), [He, Fe] = d(), [Ce, ie] = d(!1), [Se, Ke] = d(!1), [ye, Ue] = d(!0), [je, Ze] = d(!1), [P, Ie] = d([]), [b, H] = d([]), [w, Q] = d(!1), [ne, le] = d(!1), [W, V] = d(-1), [p, L] = d(), [a, E] = d(), [r, N] = d({
51
+ exampleSrcRoot: Fe
52
+ } = N, j = m({}, Ut);
53
+ Kt(j, N.filterSwitch);
54
+ const Z = pt(null), [C, he] = d(), [i, $] = d(), [X, He] = d([]), [me, ge] = d(!1), [B, pe] = d(0), [L, ne] = d(""), [O, be] = d(0), [Ke, Ue] = d(), [ve, re] = d(!1), [Se, je] = d(!1), [Ce, Ze] = d(!0), [$e, We] = d(!1), [P, ye] = d([]), [b, E] = d([]), [W, q] = d(!1), [Y, _] = d(!1), [M, p] = d(-1), [v, g] = d(), [a, y] = d(), [n, T] = d({
55
55
  current: 0,
56
56
  pageSize: 100
57
- }), [F, re] = d([]), [R, $e] = d(""), [We, qe] = d(!1), [Le, ke] = d(), [X, oe] = d(null), [x, De] = d(!1), [_e, Te] = d(!1), [Ge, Je] = d(0), [Qe, se] = d(""), [q, Xe] = d(""), [Ye, et] = d(), z = () => {
58
- L(void 0), E(void 0), V(-1), Q(!1), Y(), setTimeout(() => {
59
- N((e) => y(g({}, e), {
57
+ }), [F, oe] = d([]), [R, qe] = d(""), [_e, Ge] = d(!1), [Ie, Le] = d(), [ee, le] = d(null), [w, De] = d(!1), [Je, ke] = d(!1), [Qe, Xe] = d(0), [Zt, se] = d(""), [G, Ye] = d(""), [et, tt] = d(), H = () => {
58
+ g(void 0), y(void 0), p(-1), q(!1), K(), setTimeout(() => {
59
+ T((e) => S(m({}, e), {
60
60
  current: 1,
61
61
  type: void 0
62
62
  }));
63
63
  }, 10);
64
64
  };
65
- Et("Esc", z), h(() => {
66
- l && f.cvforceDatahub.getS3Iam(l).then((e) => {
67
- Fe(e);
65
+ wt("Esc", H), u(() => {
66
+ o && f.cvforceDatahub.getS3Iam(o).then((e) => {
67
+ Ue(e);
68
68
  });
69
- }, [l]), h(() => {
70
- f.cvforceDatahub && f.cvforceDatahub.getOptionsImgproxy().then((e) => et(e));
71
- }, [f.cvforceDatahub]), h(() => {
72
- D();
73
- }, [i == null ? void 0 : i.id]), h(() => {
74
- l && (be(!0), Promise.all([
69
+ }, [o]), u(() => {
70
+ f.cvforceDatahub && f.cvforceDatahub.getOptionsImgproxy().then((e) => tt(e));
71
+ }, [f.cvforceDatahub]), u(() => {
72
+ x();
73
+ }, [i == null ? void 0 : i.id]), u(() => {
74
+ o && (ge(!0), Promise.all([
75
75
  // 数据集
76
- f.cvforceDatahub.getDatasetsId(l).then((e) => {
77
- me(e);
76
+ f.cvforceDatahub.getDatasetsId(o).then((e) => {
77
+ he(e);
78
78
  }),
79
79
  // 版本列表
80
- f.cvforceDatahub.getDatasetsIdVersions(l, 1, 1e3).then((e) => {
81
- Oe(e.recordList), $(G ? e.recordList.find((t) => t.id === G) : e.recordList[0]);
80
+ f.cvforceDatahub.getDatasetsIdVersions(o, 1, 1e3).then((e) => {
81
+ He(e.recordList), $(Q ? e.recordList.find((t) => t.id === Q) : e.recordList[0]);
82
82
  })
83
- ]).finally(() => be(!1)));
84
- }, [l, G]);
85
- const Ve = () => {
86
- !l || !i || f.cvforceDatahub.getDatasetsIdVersionsVid(l, i.id).then((e) => {
87
- $(e), $e(e.versionAsyncTask.state);
83
+ ]).finally(() => ge(!1)));
84
+ }, [o, Q]);
85
+ const Te = () => {
86
+ !o || !i || f.cvforceDatahub.getDatasetsIdVersionsVid(o, i.id).then((e) => {
87
+ $(e), qe(e.versionAsyncTask.state);
88
88
  });
89
89
  };
90
- h(() => {
91
- R !== U.Pending && R !== U.Started || K.warning("文件导入中,请刷新页面再试");
92
- }, [R]), h(() => {
93
- $(void 0), N(y(g({}, r), {
90
+ u(() => {
91
+ R !== U.Pending && R !== U.Started || z.warning("文件导入中,请刷新页面再试");
92
+ }, [R]), u(() => {
93
+ $(void 0), T(S(m({}, n), {
94
94
  current: 1
95
- })), H([]), Ve();
96
- }, [l, G]), h(() => {
97
- l && f.cvforceDatahub.getDatasetsId(l).then((e) => {
98
- me(e);
95
+ })), E([]), Te();
96
+ }, [o, Q]), u(() => {
97
+ o && f.cvforceDatahub.getDatasetsId(o).then((e) => {
98
+ he(e);
99
99
  });
100
- }, [l]), h(() => {
101
- Y();
102
- }, [F, i]), h(() => {
103
- !i || !C || A(y(g({}, r), {
100
+ }, [o]), u(() => {
101
+ K();
102
+ }, [F, i]), u(() => {
103
+ !i || !C || A(S(m({}, n), {
104
104
  current: 1
105
105
  })).then((e) => {
106
106
  });
107
- }, [C == null ? void 0 : C.id, i == null ? void 0 : i.id, F]), h(() => {
107
+ }, [C == null ? void 0 : C.id, i == null ? void 0 : i.id, F]), u(() => {
108
108
  A().then((e) => {
109
- }), D();
110
- }, [r.current]), h(() => {
111
- x && D();
112
- }, [Le]), h(() => {
113
- A(y(g({}, r), {
109
+ }), x();
110
+ }, [n.current]), u(() => {
111
+ w && x();
112
+ }, [Ie]), u(() => {
113
+ A(S(m({}, n), {
114
114
  current: 1,
115
115
  total: void 0
116
116
  })).then((e) => {
117
- e && p && (Array.isArray(e) && e.length ? (V(0), L(e[0]), E(void 0)) : z());
117
+ e && v && (Array.isArray(e) && e.length ? (p(0), g(e[0]), y(void 0)) : (g(void 0), y(void 0), p(-1), K(), setTimeout(() => {
118
+ T((t) => S(m({}, t), {
119
+ current: 1,
120
+ type: void 0
121
+ }));
122
+ }, 10)));
118
123
  });
119
- }, [S]), h(() => {
120
- ne || L(void 0);
121
- }, [ne]), h(() => {
122
- !w && p && Q(!0);
123
- }, [p]), h(() => {
124
- !b.length && w && z();
125
- }, [b.length, w]), h(() => {
126
- Ze(!ye && Se);
127
- }, [ye, Se]), h(() => {
128
- if (!l) {
129
- X && (clearTimeout(X), oe(null)), ke(void 0);
124
+ }, [L]), u(() => {
125
+ Y || (g(void 0), y(void 0), q(!1), p(-1));
126
+ }, [Y]), u(() => {
127
+ We(!Ce && Se);
128
+ }, [Ce, Se]), u(() => {
129
+ if (!o) {
130
+ ee && (clearTimeout(ee), le(null)), Le(void 0);
130
131
  return;
131
132
  }
132
133
  ce();
133
- }, [l, i == null ? void 0 : i.id]), h(() => {
134
+ }, [o, i == null ? void 0 : i.id]), u(() => {
134
135
  ce();
135
- }, [We]), h(() => {
136
+ }, [_e]), u(() => {
136
137
  ae();
137
- }, [x, l, i]), h(() => {
138
- A(y(g({}, r), {
138
+ }, [w, o, i]), u(() => {
139
+ A(S(m({}, n), {
139
140
  current: 1
140
- })), D();
141
- }, [q]), h(() => {
141
+ })), x();
142
+ }, [G]), u(() => {
142
143
  se("");
143
- }, [p]);
144
+ }, [v]);
144
145
  const ae = () => {
145
- i && f.cvforceDatahub.getDatasetsIdVersionsVidSamples(l, i.id, {
146
+ i && f.cvforceDatahub.getDatasetsIdVersionsVidSamples(o, i.id, {
146
147
  pageNo: 1,
147
148
  pageSize: 1e3,
148
149
  confirmStatus: 1
149
150
  }).then((e) => {
150
- Je(e.recordList.length);
151
+ Xe(e.recordList.length);
151
152
  });
152
153
  }, ce = () => {
153
- !l || !i || f.cvforceDatahub.getPreLabelTask(l, i.id).then((e) => {
154
+ !o || !i || f.cvforceDatahub.getPreLabelTask(o, i.id).then((e) => {
154
155
  const t = e[0];
155
- if (ke(t), X && (clearTimeout(X), oe(null)), !(t != null && t.state) || t.state !== Tt.Started) {
156
- De(!1), D();
156
+ if (Le(t), ee && (clearTimeout(ee), le(null)), !(t != null && t.state) || t.state !== Tt.Started) {
157
+ De(!1), x();
157
158
  return;
158
159
  } else
159
160
  De(!0);
160
- oe(setTimeout(() => {
161
+ le(setTimeout(() => {
161
162
  ce();
162
163
  }, 1e4));
163
164
  });
164
165
  };
165
- h(() => {
166
+ u(() => {
166
167
  C && C.markType !== "detection" && console.error("当前数据集不是detection(物体检测)类型,请检查数据集类型。");
167
168
  }, [C]);
168
169
  const A = (e, t) => {
169
- const s = (e == null ? void 0 : e.current) || r.current, n = (e == null ? void 0 : e.pageSize) || r.pageSize;
170
- if (!l || !i || !s)
170
+ const l = (e == null ? void 0 : e.current) || n.current, r = (e == null ? void 0 : e.pageSize) || n.pageSize;
171
+ if (!o || !i || !l)
171
172
  return Promise.resolve(!1);
172
- const c = F.map((k) => k.label), u = () => {
173
- switch (S) {
173
+ const c = F.map((k) => k.label), h = () => {
174
+ switch (L) {
174
175
  case "nocode":
175
176
  return "nocode";
176
177
  case "hascode":
@@ -179,166 +180,208 @@ const bi = (T) => {
179
180
  return c.length ? c : void 0;
180
181
  }
181
182
  };
182
- return s === 1 && at(), N(y(g({}, r), {
183
- current: s,
184
- pageSize: n
185
- })), f.cvforceDatahub.getDatasetsIdVersionsVidSamples(l, i.id, {
186
- pageNo: s,
187
- pageSize: n,
188
- labels: u(),
189
- searchName: q
183
+ return l === 1 && at(), T(S(m({}, n), {
184
+ current: l,
185
+ pageSize: r
186
+ })), f.cvforceDatahub.getDatasetsIdVersionsVidSamples(o, i.id, {
187
+ pageNo: l,
188
+ pageSize: r,
189
+ labels: h(),
190
+ searchName: G
190
191
  }).then((k) => {
191
- const _ = k.recordList || [], Pe = s === 1 ? _ : [...t || b, ..._];
192
- if (H(Pe), N(y(g({}, r), {
193
- current: s,
194
- pageSize: n,
192
+ const J = k.recordList || [], we = l === 1 ? J : [...t || b, ...J];
193
+ if (E(we), T(S(m({}, n), {
194
+ current: l,
195
+ pageSize: r,
195
196
  total: k.totalResults
196
- })), r.type === "next" && _.length) {
197
- V(0);
197
+ })), n.type === "next" && J.length) {
198
+ p(0);
198
199
  const fe = k.recordList[0];
199
- L(fe);
200
+ g(fe);
200
201
  }
201
- if (r.type === "prev" && _.length) {
202
- V(r.pageSize - 1);
203
- const fe = k.recordList[r.pageSize - 1];
204
- L(fe);
202
+ if (n.type === "prev" && J.length) {
203
+ p(n.pageSize - 1);
204
+ const fe = k.recordList[n.pageSize - 1];
205
+ g(fe);
205
206
  }
206
- return w && W < 0 && (V(0), L(_[0]), le(!0)), Pe;
207
+ return W && M < 0 && (p(0), g(J[0]), _(!0)), we;
207
208
  }).catch(() => !1);
208
209
  };
209
- h(() => {
210
- N(S === "nocode" ? y(g({}, r), {
210
+ u(() => {
211
+ T(L === "nocode" ? S(m({}, n), {
211
212
  total: B
212
- }) : S === "" ? y(g({}, r), {
213
+ }) : L === "" ? S(m({}, n), {
213
214
  total: O
214
- }) : y(g({}, r), {
215
+ }) : S(m({}, n), {
215
216
  total: O - B
216
217
  }));
217
218
  }, [B, O]);
218
- const D = () => {
219
- !l || !i || f.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(l, i.id, {
219
+ const x = () => {
220
+ !o || !i || f.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(o, i.id, {
220
221
  label: "allcode",
221
- searchName: q
222
+ searchName: G
222
223
  }).then((e) => {
223
- const t = e.find((n) => n.id === "allcodeid"), s = e.find((n) => n.id === "nocodeid");
224
- ve(t ? t.count : 0), ge(s ? s.count : 0);
224
+ const t = e.find((r) => r.id === "allcodeid"), l = e.find((r) => r.id === "nocodeid");
225
+ be(t ? t.count : 0), pe(l ? l.count : 0);
225
226
  });
226
- }, Y = () => {
227
- if (!(!l || !(i != null && i.id)))
228
- return f.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(l, i.id).then((e) => {
229
- const s = (e || []).filter((n) => n.label !== "nocode").map((n, c) => ({
230
- label: n.label,
231
- count: n.count,
232
- id: n.id,
233
- color: ze[c % 40]
227
+ }, K = () => {
228
+ if (!(!o || !(i != null && i.id)))
229
+ return f.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(o, i.id).then((e) => {
230
+ const l = (e || []).filter((r) => r.label !== "nocode").map((r, c) => ({
231
+ label: r.label,
232
+ count: r.count,
233
+ id: r.id,
234
+ color: Me[c % 40]
234
235
  }));
235
- return Ie(s), e;
236
+ return ye(l), e;
236
237
  });
237
- }, tt = (e) => {
238
+ }, it = (e) => {
238
239
  if (!b)
239
240
  return;
240
- V(e);
241
+ q(!1), p(e);
241
242
  const t = b[e];
242
- L(t), le(!0);
243
+ g(t), y(void 0), _(!0);
243
244
  };
244
- h(() => {
245
- r.type || A();
246
- }, [r.type]), h(() => {
245
+ u(() => {
246
+ n.type || A();
247
+ }, [n.type]), u(() => {
247
248
  if (!a)
248
249
  return;
249
250
  const e = [];
250
251
  a == null || a.labels.forEach((t) => {
251
- P != null && P.find((s) => s.id === t.id) && e.push(t);
252
- }), a.labels = e, E(a);
252
+ P != null && P.find((l) => l.id === t.id) && e.push(t);
253
+ }), a.labels = e, y(a);
253
254
  }, [P]);
254
255
  const xe = () => {
255
- if (b)
256
- return de().then((e) => (e && (D(), H((t) => {
257
- let s;
256
+ if (b) {
257
+ if (!W) {
258
+ E((e) => {
259
+ if (!Array.isArray(e) || !e.length)
260
+ return H(), e;
261
+ const t = M + 1;
262
+ return t >= e.length ? n.total && t >= n.total ? z.error("已经是最后一个了") : A({
263
+ current: n.current + 1,
264
+ pageSize: n.pageSize,
265
+ type: "next"
266
+ }, e).then((l) => {
267
+ p(t);
268
+ const r = l[t];
269
+ g(r), y(void 0);
270
+ }) : setTimeout(() => {
271
+ p(t);
272
+ const l = e[t];
273
+ g(l), y(void 0);
274
+ }, 200), e;
275
+ });
276
+ return;
277
+ }
278
+ return de().then((e) => (e && (x(), E((t) => {
279
+ let l;
258
280
  if (Array.isArray(t)) {
259
281
  if (!t.length)
260
- return z(), t;
261
- const n = !a || a.labels.length && S === "hascode" || !a.labels.length && S === "nocode" || S === "" ? W + 1 : W;
262
- if (a && (a.labels.length && S === "nocode" || !a.labels.length && S === "hascode")) {
263
- const c = t.findIndex((u) => u.id === a.id);
264
- c > -1 && (t.splice(c, 1), s = [...t], r.total && (r.total = r.total - 1));
282
+ return H(), t;
283
+ const r = !a || a.labels.length && L === "hascode" || !a.labels.length && L === "nocode" || L === "" ? M + 1 : M;
284
+ if (a && (a.labels.length && L === "nocode" || !a.labels.length && L === "hascode")) {
285
+ const c = t.findIndex((h) => h.id === a.id);
286
+ c > -1 && (t.splice(c, 1), l = [...t], n.total && (n.total = n.total - 1));
265
287
  }
266
- n >= t.length ? r.total && n >= r.total ? K.error("已经是最后一个了") : A({
267
- current: r.current + 1,
268
- pageSize: r.pageSize,
288
+ r >= t.length ? n.total && r >= n.total ? z.error("已经是最后一个了") : A({
289
+ current: n.current + 1,
290
+ pageSize: n.pageSize,
269
291
  type: "next"
270
292
  }, t).then((c) => {
271
- V(n);
272
- const u = c[n];
273
- L(u), E(void 0);
293
+ p(r);
294
+ const h = c[r];
295
+ g(h), y(void 0);
274
296
  }) : setTimeout(() => {
275
- V(n);
276
- const c = t[n];
277
- L(c), E(void 0);
297
+ p(r);
298
+ const c = t[r];
299
+ g(c), y(void 0);
278
300
  }, 200);
279
301
  }
280
- return s || t;
302
+ return l || t;
281
303
  })), e));
282
- }, it = () => {
283
- b && de().then((e) => {
284
- e && (D(), H((t) => {
285
- let s;
286
- if (Array.isArray(t)) {
287
- if (!t.length)
288
- return z(), t;
289
- const n = W - 1;
290
- if (n < 0)
291
- n < 0 ? K.error("已经是第一个了") : N({
292
- current: r.current - 1,
293
- pageSize: r.pageSize,
294
- type: "prev"
295
- });
296
- else {
297
- if (a && (a.labels.length && S === "nocode" || !a.labels.length && S === "hascode")) {
298
- const c = t.findIndex((u) => u.id === a.id);
299
- c > -1 && (t.splice(c, 1), s = [...t], r.total && (r.total = r.total - 1));
304
+ }
305
+ }, nt = () => {
306
+ if (b) {
307
+ if (!W) {
308
+ E((e) => {
309
+ if (!Array.isArray(e) || !e.length)
310
+ return H(), e;
311
+ const t = M - 1;
312
+ return t < 0 ? z.error("已经是第一个了") : setTimeout(() => {
313
+ p(t);
314
+ const l = e[t];
315
+ g(l), y(void 0);
316
+ }, 200), e;
317
+ });
318
+ return;
319
+ }
320
+ de().then((e) => {
321
+ e && (x(), E((t) => {
322
+ let l;
323
+ if (Array.isArray(t)) {
324
+ if (!t.length)
325
+ return H(), t;
326
+ const r = M - 1;
327
+ if (r < 0)
328
+ r < 0 ? z.error("已经是第一个了") : T({
329
+ current: n.current - 1,
330
+ pageSize: n.pageSize,
331
+ type: "prev"
332
+ });
333
+ else {
334
+ if (a && (a.labels.length && L === "nocode" || !a.labels.length && L === "hascode")) {
335
+ const c = t.findIndex((h) => h.id === a.id);
336
+ c > -1 && (t.splice(c, 1), l = [...t], n.total && (n.total = n.total - 1));
337
+ }
338
+ setTimeout(() => {
339
+ p(r);
340
+ const c = t[r];
341
+ g(c), y(void 0);
342
+ }, 200);
300
343
  }
301
- setTimeout(() => {
302
- V(n);
303
- const c = t[n];
304
- L(c), E(void 0);
305
- }, 200);
306
344
  }
307
- }
308
- return s || t;
309
- }));
310
- });
311
- }, nt = (e) => {
312
- const t = Object.keys(e.labels.reduce((s, n) => (s[n.label] ? ++s[n.label] : s[n.label] = 1, s), {})).length;
345
+ return l || t;
346
+ }));
347
+ });
348
+ }
349
+ }, rt = (e) => {
350
+ const t = Object.keys(e.labels.reduce((l, r) => (l[r.label] ? ++l[r.label] : l[r.label] = 1, l), {})).length;
313
351
  return t >= 2 ? `+${t - 1}` : null;
314
- }, lt = (e) => {
352
+ }, ot = (e) => {
315
353
  var t;
316
- (!r.total || r.total > b.length) && e.currentTarget.scrollHeight - e.currentTarget.scrollTop === ((t = Z.current) == null ? void 0 : t.clientHeight) && N(y(g({}, r), {
317
- current: r.current + 1
354
+ (!n.total || n.total > b.length) && e.currentTarget.scrollHeight - e.currentTarget.scrollTop === ((t = Z.current) == null ? void 0 : t.clientHeight) && T(S(m({}, n), {
355
+ current: n.current + 1
318
356
  }));
319
- }, de = () => i ? a && !x ? (a.labels && (a.labels = a.labels.filter((e) => !!e.id)), f.cvforceDatahub.updateSamples(l, i.id, [a], 0).then(() => (K.success({
357
+ }, de = () => i ? a && !w ? (a.labels && (a.labels = a.labels.filter((e) => !!e.id)), f.cvforceDatahub.updateSamples(o, i.id, [a], 0).then(() => (z.success({
320
358
  content: "保存成功"
321
- }), H((e) => {
322
- const t = e.findIndex((s) => s.id === (a == null ? void 0 : a.id));
359
+ }), E((e) => {
360
+ const t = e.findIndex((l) => l.id === (a == null ? void 0 : a.id));
323
361
  return t > -1 && (e[t] = a), [...e];
324
- }), !0)).catch(() => !1)) : Promise.resolve(!0) : Promise.resolve(!1), rt = () => {
362
+ }), !0)).catch(() => !1)) : Promise.resolve(!0) : Promise.resolve(!1), lt = () => {
325
363
  if (a && a.labels.some((e) => !e.id))
326
- return K.error("所有标注需设置标签"), Promise.resolve(!1);
364
+ return z.error("所有标注需设置标签"), Promise.resolve(!1);
327
365
  xe();
328
- }, ot = () => {
329
- kt.confirm({
366
+ }, st = () => {
367
+ Dt.confirm({
330
368
  title: "确认要删除当前数据吗?",
331
369
  content: "数据包含当前标注的内容和图片,删除后无法恢复,请确认是否删除!",
332
370
  onOk: () => {
333
- !p || !i || f.cvforceDatahub.delDatasetsIdVersionsVidSamplesId(l, i.id, p.id).then(() => {
334
- const e = b.findIndex((t) => t.id === p.id);
335
- b.splice(e, 1), H([...b]), N(y(g({}, r), {
336
- total: r.total ? r.total - 1 : 0
337
- })), e <= b.length - 1 ? L(b[e]) : (L(b[e - 1]), V(e - 1)), D(), E(void 0), r.total && r.total - 1 === 0 && z();
371
+ !v || !i || f.cvforceDatahub.delDatasetsIdVersionsVidSamplesId(o, i.id, v.id).then(() => {
372
+ const e = b.findIndex((t) => t.id === v.id);
373
+ b.splice(e, 1), E([...b]), T(S(m({}, n), {
374
+ total: n.total ? n.total - 1 : 0
375
+ })), e <= b.length - 1 ? g(b[e]) : (g(b[e - 1]), p(e - 1)), x(), y(void 0), n.total && n.total - 1 === 0 && (g(void 0), y(void 0), p(-1), W || _(!1), K(), setTimeout(() => {
376
+ T((t) => S(m({}, t), {
377
+ current: 1,
378
+ type: void 0
379
+ }));
380
+ }, 10));
338
381
  });
339
382
  }
340
383
  });
341
- }, st = [{
384
+ }, Ve = [{
342
385
  key: "",
343
386
  label: `全部(${O})`,
344
387
  children: null
@@ -356,264 +399,250 @@ const bi = (T) => {
356
399
  top: 0
357
400
  });
358
401
  }, ct = () => {
359
- Te(!0);
402
+ ke(!0);
360
403
  }, dt = (e) => {
361
- Xe(e);
404
+ Ye(e);
405
+ }, Ne = (e) => {
406
+ a ? de().then((t) => {
407
+ t ? (ne(e), x()) : z.error("保存失败");
408
+ }) : (T(S(m({}, n), {
409
+ current: 1,
410
+ total: void 0
411
+ })), ne(e)), e === "nocode" && oe([]);
362
412
  };
363
- return /* @__PURE__ */ o(gt, {
364
- locale: Vt,
365
- children: /* @__PURE__ */ o(xt.Provider, {
413
+ return /* @__PURE__ */ s(bt, {
414
+ locale: xt,
415
+ children: /* @__PURE__ */ s(Vt.Provider, {
366
416
  value: {
367
- datasetId: l,
417
+ datasetId: o,
368
418
  versionId: (i == null ? void 0 : i.id) || "",
369
419
  no: (i == null ? void 0 : i.no) || "",
370
- loading: pe,
420
+ loading: me,
371
421
  version: i,
372
- versions: J,
422
+ versions: X,
373
423
  samples: b,
374
- pagination: r,
424
+ pagination: n,
375
425
  services: f,
376
426
  featuresConfig: {
377
427
  labelManager: ue,
378
- datasetManager: m,
379
- annotation: Re,
428
+ datasetManager: I,
429
+ annotation: Oe,
380
430
  filterSwitch: j,
381
- header: I,
382
- exampleSrcRoot: Be
431
+ header: D,
432
+ exampleSrcRoot: Fe
383
433
  }
384
434
  },
385
- children: C ? C.markType === "detection" ? /* @__PURE__ */ o("div", {
435
+ children: C ? C.markType === "detection" ? /* @__PURE__ */ s("div", {
386
436
  className: "detection-version-detail",
387
- children: _e ? i != null && i.id && m && m.preLabel ? /* @__PURE__ */ o(zt, {
388
- datasetId: l,
437
+ children: Je ? i != null && i.id && I && I.preLabel ? /* @__PURE__ */ s(At, {
438
+ datasetId: o,
389
439
  versionId: i.id,
390
440
  onClose: () => {
391
- Te(!1), ae(), Y(), D(), A();
441
+ ke(!1), ae(), K(), x(), A();
392
442
  },
393
443
  samples: b,
394
444
  labels: P,
395
445
  fetchLength: ae
396
- }) : null : /* @__PURE__ */ v(Mt, {
446
+ }) : null : /* @__PURE__ */ V(zt, {
397
447
  className: "product-details-page",
398
- header: I === !1 ? void 0 : /* @__PURE__ */ o(Bt, {
399
- backTo: Me,
400
- onBackClick: I != null && I.onBackClick ? () => {
401
- p && z(), I.onBackClick && I.onBackClick();
448
+ header: D === !1 ? void 0 : /* @__PURE__ */ s(Rt, {
449
+ backTo: Be,
450
+ onBackClick: D != null && D.onBackClick ? () => {
451
+ v && H(), D.onBackClick && D.onBackClick();
402
452
  } : void 0,
403
- left: !pe && /* @__PURE__ */ v(ee, {
404
- children: [/* @__PURE__ */ o("span", {
453
+ left: !me && /* @__PURE__ */ V(te, {
454
+ children: [/* @__PURE__ */ s("span", {
405
455
  style: {
406
456
  fontWeight: "bold"
407
457
  },
408
458
  children: C == null ? void 0 : C.name
409
- }), /* @__PURE__ */ o(vt, {
410
- disabled: w || (I == null ? void 0 : I.versionSelect) === !1,
459
+ }), /* @__PURE__ */ s(vt, {
460
+ disabled: (D == null ? void 0 : D.versionSelect) === !1,
411
461
  value: i == null ? void 0 : i.id,
412
462
  style: {
413
463
  width: 70
414
464
  },
415
- options: J.map((e) => ({
465
+ options: X.map((e) => ({
416
466
  label: e.no,
417
467
  value: e.id
418
468
  })),
419
469
  onChange: (e) => {
420
- const t = J.find((n) => n.id === e);
470
+ const t = X.find((r) => r.id === e);
421
471
  if (!C || !t)
422
472
  return;
423
- const s = J.find((n) => n.id === t.id);
424
- $(s), I != null && I.onVersionChange && I.onVersionChange(s);
473
+ const l = X.find((r) => r.id === t.id);
474
+ $(l), D != null && D.onVersionChange && D.onVersionChange(l);
425
475
  }
426
476
  })]
427
477
  }),
428
- right: /* @__PURE__ */ v(ee, {
429
- children: [!p && m && m.add && /* @__PURE__ */ o(Ae, {
430
- isPreLabel: x,
478
+ right: /* @__PURE__ */ V(te, {
479
+ children: [!v && I && I.add && /* @__PURE__ */ s(Re, {
480
+ isPreLabel: w,
431
481
  placement: "bottom",
432
- children: /* @__PURE__ */ o(M, {
482
+ children: /* @__PURE__ */ s(ie, {
433
483
  type: "default",
434
- onClick: () => ie(!0),
435
- disabled: R === U.Pending || R === U.Started || x,
484
+ onClick: () => re(!0),
485
+ disabled: R === U.Pending || R === U.Started || w,
436
486
  children: "导入数据"
437
487
  }, "del")
438
- }), !p && m && m.preLabel && (i != null && i.id) ? /* @__PURE__ */ v(he, {
439
- children: [/* @__PURE__ */ o(Kt, {
440
- datasetId: l,
488
+ }), !v && I && I.preLabel && (i != null && i.id) ? /* @__PURE__ */ V(ze, {
489
+ children: [/* @__PURE__ */ s(Ht, {
490
+ datasetId: o,
441
491
  versionId: i.id,
442
492
  disabled: !b.length,
443
- setIsTaskChange: qe,
493
+ setIsTaskChange: Ge,
444
494
  datasetType: "detection",
445
- preLabelTask: Le
446
- }), /* @__PURE__ */ o(M, {
447
- disabled: x || !Ge,
495
+ preLabelTask: Ie
496
+ }), /* @__PURE__ */ s(ie, {
497
+ disabled: w || !Qe,
448
498
  onClick: ct,
449
499
  children: "待确认标注"
450
500
  })]
451
- }) : null, /* @__PURE__ */ o(Ft, {
452
- when: je,
501
+ }) : null, /* @__PURE__ */ s(Ft, {
502
+ when: $e,
453
503
  content: "确认要离开此页面吗?",
454
504
  subContent: "离开此页面后,将结束导入,放弃未上传的文件,请谨慎操作!"
455
- }), Ce && /* @__PURE__ */ o(Rt, {
456
- datasetIam: He,
457
- datasetId: l,
505
+ }), ve && /* @__PURE__ */ s(Mt, {
506
+ datasetIam: Ke,
507
+ datasetId: o,
458
508
  currentVersion: i,
459
509
  tenCode: C == null ? void 0 : C.tenantCode,
460
- isVisible: Ce,
461
- setIsVisible: ie,
462
- getVersionListRequest: D,
463
- setIsConfirm: Ue,
510
+ isVisible: ve,
511
+ setIsVisible: re,
512
+ getVersionListRequest: x,
513
+ setIsConfirm: Ze,
464
514
  onUploadStatusChange: (e) => {
465
- Ke(e);
515
+ je(e);
466
516
  },
467
517
  tableReload: () => {
468
518
  var e, t;
469
519
  i != null && i.id && ((t = (e = Z.current) == null ? void 0 : e.getElementsByClassName("rc-virtual-list-holder")[0]) == null || t.scrollTo({
470
520
  top: 0
471
- }), A(y(g({}, r), {
521
+ }), A(S(m({}, n), {
472
522
  current: 1
473
523
  })));
474
524
  },
475
- loadVersionData: Ve
525
+ loadVersionData: Te
476
526
  })]
477
527
  })
478
528
  }),
479
- children: [/* @__PURE__ */ v("div", {
529
+ children: [/* @__PURE__ */ V("div", {
480
530
  className: "detection-header",
481
- children: [/* @__PURE__ */ v(ee, {
482
- children: [j.tabs && /* @__PURE__ */ o(Ct, {
531
+ children: [/* @__PURE__ */ V(te, {
532
+ children: [j.tabs && /* @__PURE__ */ s(St, {
483
533
  className: "header-tab",
484
- activeKey: S,
485
- items: st,
486
- onChange: (e) => {
487
- a ? (de().then((t) => {
488
- t ? (te(e), D()) : K.error("保存失败");
489
- }), Q(!1)) : (N(y(g({}, r), {
490
- current: 1,
491
- total: void 0
492
- })), te(e)), e === "nocode" && re([]);
493
- }
494
- }), !w && !p && j.search && /* @__PURE__ */ o(Ht, {
534
+ activeKey: L,
535
+ items: Ve,
536
+ onChange: Ne
537
+ }), !v && j.search && /* @__PURE__ */ s(Ot, {
495
538
  placeholder: "请输入图片名称搜索",
496
- suffix: /* @__PURE__ */ o(At, {}),
497
- value: q,
539
+ suffix: /* @__PURE__ */ s(Et, {}),
540
+ value: G,
498
541
  onChange: dt,
499
542
  allowClear: !0
500
543
  })]
501
- }), /* @__PURE__ */ o(Ae, {
502
- isPreLabel: x,
503
- children: /* @__PURE__ */ v(ee, {
504
- children: [w ? /* @__PURE__ */ v(he, {
505
- children: [m && m.label ? /* @__PURE__ */ o(M, {
506
- type: "primary",
507
- onClick: () => rt(),
508
- disabled: x,
509
- children: "保存"
510
- }) : null, /* @__PURE__ */ o(M, {
511
- onClick: z,
512
- children: "退出"
513
- })]
514
- }) : m && m.label && /* @__PURE__ */ o(M, {
544
+ }), /* @__PURE__ */ s(Re, {
545
+ isPreLabel: w,
546
+ children: /* @__PURE__ */ s(te, {
547
+ children: I && I.label && /* @__PURE__ */ s(ie, {
515
548
  type: "primary",
516
- disabled: !B || x,
549
+ disabled: !B || w,
517
550
  onClick: () => {
518
- p || te("nocode"), Q(!0), V(-1), S === "nocode" && (V(0), L(b[0]));
551
+ v || ne("nocode"), q(!0), p(-1), L === "nocode" && (p(0), g(b[0])), _(!0);
519
552
  },
520
- children: "单张标注"
521
- }), w && m && m.delete && /* @__PURE__ */ o(M, {
522
- onClick: ot,
523
- disabled: x,
524
- children: "删除数据"
525
- })]
553
+ children: "标注"
554
+ })
526
555
  })
527
556
  })]
528
- }), /* @__PURE__ */ v("div", {
557
+ }), /* @__PURE__ */ V("div", {
529
558
  className: "d-row",
530
- children: [/* @__PURE__ */ v("div", {
559
+ children: [/* @__PURE__ */ V("div", {
531
560
  className: "d-right",
532
561
  ref: Z,
533
- children: [p && /* @__PURE__ */ o(Pt, {
534
- datasetId: l,
535
- isImageDetailVisible: ne,
536
- setIsImageDetailVisible: le,
537
- currentSample: a != null ? a : p,
562
+ children: [Y && /* @__PURE__ */ s(jt, {
563
+ datasetId: o,
564
+ isImageDetailVisible: Y,
565
+ setIsImageDetailVisible: _,
566
+ currentSample: a != null ? a : v,
538
567
  labels: P,
539
- editing: w,
540
- onChange: E,
568
+ previewMode: !W,
569
+ filterItems: Ve,
570
+ filterMode: L,
571
+ onFilterChange: Ne,
572
+ onChange: y,
541
573
  onNextClick: () => xe(),
542
- onPrevClick: () => it(),
574
+ onPrevClick: () => nt(),
575
+ onSave: () => lt(),
576
+ onDeleteSample: () => st(),
577
+ onEnterEdit: () => {
578
+ q(!0);
579
+ },
543
580
  onRefresh: () => {
544
581
  var e;
545
- (e = Y()) == null || e.then((t) => {
546
- var s, n;
582
+ (e = K()) == null || e.then((t) => {
583
+ var l, r;
547
584
  if (a) {
548
585
  const c = [];
549
- (s = a.labels) == null || s.forEach((u) => {
550
- t != null && t.find((k) => k.id === u.id) && c.push(u);
551
- }), a.labels = c, E(g({}, a));
586
+ (l = a.labels) == null || l.forEach((h) => {
587
+ t != null && t.find((k) => k.id === h.id) && c.push(h);
588
+ }), a.labels = c, y(m({}, a));
552
589
  }
553
- if (p) {
590
+ if (v) {
554
591
  const c = [];
555
- (n = p.labels) == null || n.forEach((u) => {
556
- t != null && t.find((k) => k.id === u.id) && c.push(u);
557
- }), p.labels = c, L(g({}, p));
592
+ (r = v.labels) == null || r.forEach((h) => {
593
+ t != null && t.find((k) => k.id === h.id) && c.push(h);
594
+ }), v.labels = c, g(m({}, v));
558
595
  }
559
- }), D();
596
+ }), x();
560
597
  },
561
- isPreLabel: x,
598
+ isPreLabel: w,
562
599
  imgCount: {
563
600
  total: O,
564
- index: W + 1
601
+ index: M + 1
565
602
  },
566
603
  settingHide: !ue,
567
- readonly: m === !1 || m && m.label === !1
568
- }), p ? /* @__PURE__ */ o("div", {}) : r.total !== void 0 && r.total > 0 ? /* @__PURE__ */ o(he, {
569
- children: /* @__PURE__ */ o(Dt, {
604
+ canLabel: !!(I && I.label),
605
+ canDelete: !!(I && I.delete)
606
+ }), v ? /* @__PURE__ */ s("div", {}) : n.total !== void 0 && n.total > 0 ? /* @__PURE__ */ s(ze, {
607
+ children: /* @__PURE__ */ s(kt, {
570
608
  innerProps: {
571
609
  className: "d-right-row"
572
610
  },
573
611
  data: b,
574
612
  itemKey: "id",
575
- height: (Ne = Z.current) == null ? void 0 : Ne.clientHeight,
576
- onScroll: lt,
613
+ height: (Pe = Z.current) == null ? void 0 : Pe.clientHeight,
614
+ onScroll: ot,
577
615
  children: (e, t) => {
578
- var s;
579
- return /* @__PURE__ */ o(St, {
616
+ var l;
617
+ return /* @__PURE__ */ s(Ct, {
580
618
  className: "d-right-col",
581
- children: /* @__PURE__ */ v("div", {
619
+ onClick: () => it(t),
620
+ children: /* @__PURE__ */ V("div", {
582
621
  className: "right-col-wrapper",
583
622
  onMouseEnter: () => se(e.id),
584
623
  onMouseLeave: () => se(""),
585
- children: [/* @__PURE__ */ v("div", {
624
+ children: [/* @__PURE__ */ s("div", {
586
625
  className: "right-col-img",
587
- children: [/* @__PURE__ */ o(Ot, {
626
+ children: /* @__PURE__ */ s(Bt, {
588
627
  fileKey: e.fileKey,
589
628
  width: 124,
590
- imgProxy: Ye
591
- }), Qe === e.id && /* @__PURE__ */ v("div", {
592
- className: "img-mask",
593
- children: [/* @__PURE__ */ o("div", {
594
- className: "img-file-name",
595
- children: e.sampleFileName.name
596
- }), /* @__PURE__ */ o(M, {
597
- type: "default",
598
- onClick: () => tt(t),
599
- children: m && m.label ? "标注" : "查看"
600
- })]
601
- })]
602
- }), /* @__PURE__ */ v("div", {
629
+ imgProxy: et
630
+ })
631
+ }), /* @__PURE__ */ V("div", {
603
632
  className: "right-col-text",
604
- children: [(s = e.labels) != null && s.length ? /* @__PURE__ */ o(yt, {
633
+ children: [(l = e.labels) != null && l.length ? /* @__PURE__ */ s(yt, {
605
634
  placement: "top",
606
- title: /* @__PURE__ */ o("div", {
607
- children: Object.keys(e.labels.reduce((n, c) => (n[c.label] ? ++n[c.label] : n[c.label] = 1, n), {})).map((n) => /* @__PURE__ */ o("div", {
608
- children: n
609
- }, n))
635
+ title: /* @__PURE__ */ s("div", {
636
+ children: Object.keys(e.labels.reduce((r, c) => (r[c.label] ? ++r[c.label] : r[c.label] = 1, r), {})).map((r) => /* @__PURE__ */ s("div", {
637
+ children: r
638
+ }, r))
610
639
  }),
611
- children: /* @__PURE__ */ v("div", {
640
+ children: /* @__PURE__ */ V("div", {
612
641
  style: {
613
642
  width: "100%",
614
643
  display: "flex"
615
644
  },
616
- children: [/* @__PURE__ */ o("span", {
645
+ children: [/* @__PURE__ */ s("span", {
617
646
  style: {
618
647
  display: "inline-block",
619
648
  maxWidth: "calc(100% - 25px)",
@@ -622,21 +651,21 @@ const bi = (T) => {
622
651
  whiteSpace: "nowrap"
623
652
  },
624
653
  children: e.labels[0].label
625
- }), e.labels.length > 1 ? /* @__PURE__ */ o("span", {
654
+ }), e.labels.length > 1 ? /* @__PURE__ */ s("span", {
626
655
  style: {
627
656
  color: "rgba(0,0,0,0.45)",
628
657
  marginLeft: 5
629
658
  },
630
- children: nt(e)
659
+ children: rt(e)
631
660
  }) : null]
632
661
  })
633
- }) : /* @__PURE__ */ o("span", {
662
+ }) : /* @__PURE__ */ s("span", {
634
663
  style: {
635
664
  color: "rgba(0,0,0,0.45)",
636
665
  width: "100%"
637
666
  },
638
667
  children: "无标签"
639
- }), /* @__PURE__ */ o("div", {
668
+ }), /* @__PURE__ */ s("div", {
640
669
  children: t + 1
641
670
  })]
642
671
  })]
@@ -644,21 +673,21 @@ const bi = (T) => {
644
673
  }, e.id);
645
674
  }
646
675
  })
647
- }) : /* @__PURE__ */ o("div", {
676
+ }) : /* @__PURE__ */ s("div", {
648
677
  className: "empty",
649
- children: r.total === 0 ? /* @__PURE__ */ o(It, {
678
+ children: n.total === 0 ? /* @__PURE__ */ s(It, {
650
679
  image: Nt,
651
- description: /* @__PURE__ */ v("span", {
652
- children: ["暂无数据", S !== "hascode" && !q && /* @__PURE__ */ o("span", {
653
- children: m && m.add && /* @__PURE__ */ v(M, {
680
+ description: /* @__PURE__ */ V("span", {
681
+ children: ["暂无数据", L !== "hascode" && !G && /* @__PURE__ */ s("span", {
682
+ children: I && I.add && /* @__PURE__ */ V(ie, {
654
683
  type: "link",
655
684
  size: "small",
656
685
  style: {
657
686
  padding: 0
658
687
  },
659
- onClick: () => ie(!0),
688
+ onClick: () => re(!0),
660
689
  disabled: R === U.Pending || R === U.Started,
661
- children: [/* @__PURE__ */ o("span", {
690
+ children: [/* @__PURE__ */ s("span", {
662
691
  style: {
663
692
  color: "black"
664
693
  },
@@ -667,34 +696,34 @@ const bi = (T) => {
667
696
  })
668
697
  })]
669
698
  })
670
- }) : /* @__PURE__ */ o(Lt, {})
699
+ }) : /* @__PURE__ */ s(Lt, {})
671
700
  })]
672
- }), S !== "nocode" && !p && j.labels && /* @__PURE__ */ o("div", {
701
+ }), !v && j.labels && /* @__PURE__ */ s("div", {
673
702
  className: "d-sider",
674
- children: /* @__PURE__ */ o(wt, {
675
- datasetId: l,
703
+ children: /* @__PURE__ */ s(Pt, {
704
+ datasetId: o,
676
705
  data: P || [],
677
706
  selected: F,
678
707
  onSelectedChange: (e) => {
679
- re((P == null ? void 0 : P.filter((t) => e.find((s) => s.label === t.label))) || []);
708
+ oe((P == null ? void 0 : P.filter((t) => e.find((l) => l.label === t.label))) || []);
680
709
  },
681
710
  onListChange: (e) => {
682
- i && (f.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(l, i.id).then((t) => {
683
- const n = (t || []).filter((u) => u.label !== "nocode").map((u, k) => ({
684
- label: u.label,
685
- count: u.count,
686
- id: u.id,
687
- color: ze[k % 40]
688
- })), c = F.filter((u) => n.some((k) => k.id === u.id));
689
- Ie(n), F.length !== c.length && re(c);
690
- }), D());
711
+ i && (f.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(o, i.id).then((t) => {
712
+ const r = (t || []).filter((h) => h.label !== "nocode").map((h, k) => ({
713
+ label: h.label,
714
+ count: h.count,
715
+ id: h.id,
716
+ color: Me[k % 40]
717
+ })), c = F.filter((h) => r.some((k) => k.id === h.id));
718
+ ye(r), F.length !== c.length && oe(c);
719
+ }), x());
691
720
  },
692
- isPreLabel: x
721
+ isPreLabel: w
693
722
  })
694
723
  })]
695
724
  })]
696
725
  })
697
- }) : /* @__PURE__ */ o("div", {
726
+ }) : /* @__PURE__ */ s("div", {
698
727
  style: {
699
728
  color: "red",
700
729
  textAlign: "center"