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

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