@glodon-aiot/dataset-annotation 3.14.0-alpha.31 → 3.15.0-alpha.1

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