@glodon-aiot/dataset-annotation 3.14.0-alpha.32 → 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 -421
  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,149 +0,0 @@
1
- var N = (p, i, l) => new Promise((o, r) => {
2
- var u = (e) => {
3
- try {
4
- s(l.next(e));
5
- } catch (d) {
6
- r(d);
7
- }
8
- }, h = (e) => {
9
- try {
10
- s(l.throw(e));
11
- } catch (d) {
12
- r(d);
13
- }
14
- }, s = (e) => e.done ? o(e.value) : Promise.resolve(e.value).then(u, h);
15
- s((l = l.apply(p, i)).next());
16
- });
17
- import { jsxs as C, jsx as t } from "react/jsx-runtime";
18
- import { useRef as x, useState as m, useContext as D, useEffect as A } from "react";
19
- import { Modal as M, Button as f, Space as B, message as V } from "antd";
20
- import "./style.less.mjs";
21
- import { useKeyPress as I } from "ahooks";
22
- import E from "../../../DatasetContext/index.mjs";
23
- import K from "../../VLMAnnotation/index.mjs";
24
- import S from "../../Iconfont/index.mjs";
25
- const X = (p) => {
26
- const {
27
- isVlmModalVisible: i,
28
- setIsVlmModalVisible: l,
29
- record: o,
30
- onNextClick: r,
31
- onPrevClick: u,
32
- listLoading: h = !1,
33
- datasetId: s,
34
- versionId: e,
35
- ocrMarkTmpl: d,
36
- handleMarkClick: w,
37
- updateSampleList: L
38
- } = p;
39
- x(null);
40
- const j = x({});
41
- m("annotation");
42
- const [a, R] = m();
43
- m();
44
- const [b, g] = m(!1), {
45
- services: {
46
- cvforceDatahub: n
47
- },
48
- featuresConfig: {
49
- datasetManager: k
50
- } = {
51
- datasetManager: !1
52
- }
53
- } = D(E), c = !(b || h), v = () => {
54
- c && u();
55
- }, y = () => {
56
- c && r();
57
- };
58
- I("rightarrow", () => {
59
- y();
60
- }), I("leftarrow", () => {
61
- v();
62
- }), A(() => {
63
- i && s && e && (g(!0), n == null || n.getDatasetsIdVersionsVidSsamplesSid(s, e, o.id).then((z) => {
64
- R(z);
65
- }).finally(() => g(!1)));
66
- }, [i, o]);
67
- const O = () => {
68
- l(!1);
69
- }, P = () => {
70
- M.confirm({
71
- title: "确认要删除此数据吗?",
72
- content: "删除后不可恢复,请慎重操作",
73
- onOk: () => {
74
- !s || !e || !(a != null && a.id) || n == null || n.delDatasetsIdVersionsVidSamplesId(s, e, a.id).then(() => {
75
- V.success("删除成功"), l(!1), L();
76
- }).catch(() => V.error("删除失败"));
77
- }
78
- });
79
- };
80
- return /* @__PURE__ */ C(M, {
81
- title: /* @__PURE__ */ t("div", {
82
- className: "vlm-sample-detail-title",
83
- children: /* @__PURE__ */ t("span", {
84
- children: "详情"
85
- })
86
- }),
87
- width: "100%",
88
- wrapClassName: "vlm-modal-wrap",
89
- className: "vlm-modal",
90
- open: i,
91
- destroyOnClose: !0,
92
- onCancel: () => O(),
93
- maskClosable: !1,
94
- centered: !0,
95
- footer: null,
96
- children: [/* @__PURE__ */ t("div", {
97
- className: "vlm-detail",
98
- children: /* @__PURE__ */ C("div", {
99
- className: "detail-content",
100
- children: [/* @__PURE__ */ t(f, {
101
- className: "select-prev",
102
- icon: /* @__PURE__ */ t(S, {
103
- type: "icon-zuojiantou"
104
- }),
105
- type: "text",
106
- disabled: !c,
107
- onClick: () => v()
108
- }), /* @__PURE__ */ t("div", {
109
- className: "select-main",
110
- ref: j,
111
- children: a && /* @__PURE__ */ t(K, {
112
- sample: a,
113
- labelDefinitions: [],
114
- hideRightSide: !0,
115
- readOnly: !0,
116
- ocrRecognize: () => N(void 0, null, function* () {
117
- return [];
118
- })
119
- })
120
- }), /* @__PURE__ */ t(f, {
121
- className: "select-next",
122
- icon: /* @__PURE__ */ t(S, {
123
- type: "icon-youjiantou"
124
- }),
125
- type: "text",
126
- disabled: !c,
127
- onClick: () => y()
128
- })]
129
- })
130
- }), /* @__PURE__ */ t("div", {
131
- className: "vlm-mark-action",
132
- children: /* @__PURE__ */ C(B, {
133
- children: [/* @__PURE__ */ t(f, {
134
- type: "primary",
135
- onClick: () => w(a == null ? void 0 : a.id),
136
- children: "标注"
137
- }), k && k.delete && /* @__PURE__ */ t(f, {
138
- danger: !0,
139
- type: "ghost",
140
- onClick: P,
141
- children: "删除数据"
142
- })]
143
- })
144
- })]
145
- });
146
- };
147
- export {
148
- X as default
149
- };
@@ -1,4 +0,0 @@
1
- const t = "";
2
- export {
3
- t as default
4
- };
@@ -1,449 +0,0 @@
1
- var Ue = Object.defineProperty, Fe = Object.defineProperties;
2
- var He = Object.getOwnPropertyDescriptors;
3
- var de = Object.getOwnPropertySymbols;
4
- var Ke = Object.prototype.hasOwnProperty, Ze = Object.prototype.propertyIsEnumerable;
5
- var ue = (f, n, r) => n in f ? Ue(f, n, { enumerable: !0, configurable: !0, writable: !0, value: r }) : f[n] = r, d = (f, n) => {
6
- for (var r in n || (n = {}))
7
- Ke.call(n, r) && ue(f, r, n[r]);
8
- if (de)
9
- for (var r of de(n))
10
- Ze.call(n, r) && ue(f, r, n[r]);
11
- return f;
12
- }, g = (f, n) => Fe(f, He(n));
13
- import { jsx as o, jsxs as I, Fragment as $e } from "react/jsx-runtime";
14
- import { useState as s, useRef as je, useEffect as u } from "react";
15
- import { message as W, ConfigProvider as We, Space as A, Select as _e, Button as _, Tabs as qe, Col as Oe, Empty as Ge } from "antd";
16
- import Je from "antd/es/locale/zh_CN";
17
- import "./style.less.mjs";
18
- import Qe from "./VlmModal/index.mjs";
19
- import Xe from "./MarkVLMBoxModal/index.mjs";
20
- import Ye from "lodash/merge";
21
- import { UploadZipsStatus as x } from "@glodon-aiot/apis";
22
- import et from "rc-virtual-list";
23
- import tt from "../../Common/Page/index.mjs";
24
- import rt from "../Thumbnail/index.mjs";
25
- import ot from "../../DatasetContext/index.mjs";
26
- import { DEFAULT_FILTER_SWITCH as nt } from "../../constant.mjs";
27
- import lt from "../PageNav/index.mjs";
28
- import it from "../PicZipImportModal/index.mjs";
29
- import { Prompt as st } from "../hooks/Prompt.mjs";
30
- import ct from "../DetectionAnnotation/icon_item_empty.svg.mjs";
31
- const Tt = (f) => {
32
- var se;
33
- const {
34
- services: n,
35
- datasetId: r,
36
- versionId: L,
37
- backTo: fe,
38
- labelManager: me = !1,
39
- datasetManager: b = !1,
40
- annotation: he,
41
- header: a = {
42
- versionSelect: !1
43
- },
44
- exampleSrcRoot: pe,
45
- apiUrl: ge,
46
- token: ve
47
- } = f, [c, B] = s(), [t, k] = s(), [M, q] = s([]), [O, N] = s(!1), [be, G] = s(!1), [E, P] = s(!1), [U, J] = s(0), [h, Se] = s([]), [w, C] = s(), [ye, Q] = s(), [X, T] = s(-1), [l, V] = s({
48
- current: 0,
49
- pageSize: 100
50
- }), [Y, ee] = s(0), [F, Ie] = s(""), [te, H] = s(!1), [S, ke] = s(""), [Ce, Ve] = s(), [De, xe] = s(), [re, K] = s(!1), [oe, Le] = s(!1), [ne, Te] = s(!0), [Me, Ne] = s(!1), z = je(null), Z = d({}, nt);
51
- Ye(Z, f.filterSwitch);
52
- const we = () => {
53
- Q(void 0), H(!0);
54
- }, ze = (e) => {
55
- if (!h)
56
- return;
57
- T(e);
58
- const i = h[e];
59
- C(i), P(!0);
60
- };
61
- u(() => {
62
- n.cvforceDatahub && n.cvforceDatahub.getOptionsImgproxy().then((e) => Ve(e));
63
- }, [n.cvforceDatahub]), u(() => {
64
- r && n.cvforceDatahub.getS3Iam(r).then((e) => {
65
- xe(e);
66
- });
67
- }, [r]), u(() => {
68
- !r || t || (N(!0), Promise.all([
69
- // 数据集
70
- n.cvforceDatahub.getDatasetsId(r).then((e) => {
71
- B(e);
72
- }),
73
- // 版本列表
74
- n.cvforceDatahub.getDatasetsIdVersions(r, 1, 1e3).then((e) => {
75
- q(e.recordList), k(L ? e.recordList.find((i) => i.id === L) : e.recordList[0]);
76
- })
77
- ]).finally(() => N(!1)));
78
- }, [r, t == null ? void 0 : t.id]), u(() => {
79
- r && (N(!0), Promise.all([
80
- // 数据集
81
- n.cvforceDatahub.getDatasetsId(r).then((e) => {
82
- B(e);
83
- }),
84
- // 版本列表
85
- n.cvforceDatahub.getDatasetsIdVersions(r, 1, 1e3).then((e) => {
86
- q(e.recordList), k(L ? e.recordList.find((i) => i.id === L) : e.recordList[0]);
87
- })
88
- ]).finally(() => N(!1)));
89
- }, [r, L]), u(() => {
90
- r && n.cvforceDatahub.getDatasetsId(r).then((e) => {
91
- B(e);
92
- });
93
- }, []);
94
- const le = () => {
95
- !r || !t || n.cvforceDatahub.getDatasetsIdVersionsVid(r, t.id).then((e) => {
96
- k(e), ke(e.versionAsyncTask.state);
97
- });
98
- };
99
- u(() => {
100
- le();
101
- }, [r, t == null ? void 0 : t.id]), u(() => {
102
- S !== x.Pending && S !== x.Started || W.warning("文件导入中,请刷新页面再试");
103
- }, [S]), u(() => {
104
- Ne(!ne && oe);
105
- }, [ne, oe]);
106
- const D = () => {
107
- !r || !t || n.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(r, t.id).then((e) => {
108
- const i = e.find((p) => p.id === "allcodeid"), m = e.find((p) => p.id === "nocodeid");
109
- J(i ? i.count : 0), ee(m ? m.count : 0);
110
- });
111
- }, y = (e, i) => {
112
- const m = (e == null ? void 0 : e.current) || l.current, p = (e == null ? void 0 : e.pageSize) || l.pageSize, $ = (e == null ? void 0 : e.type) || l.type, j = i || h || [];
113
- if (!r || !t || !m)
114
- return Promise.resolve(!1);
115
- const Pe = () => {
116
- switch (F) {
117
- case "nocode":
118
- return "nocode";
119
- case "hascode":
120
- return "hascode";
121
- default:
122
- return;
123
- }
124
- };
125
- return m === 1 && ie(), V(g(d({}, l), {
126
- current: m,
127
- pageSize: p
128
- })), G(!0), n.cvforceDatahub.getDatasetsIdVersionsVidSamples(r, t.id, {
129
- pageNo: m,
130
- pageSize: p,
131
- labels: Pe()
132
- }).then((ce) => {
133
- const v = ce.recordList || [], ae = m === 1 ? v : $ === "prev" ? [...v, ...j] : [...j, ...v];
134
- if (Se(ae), V(g(d({}, l), {
135
- current: m,
136
- pageSize: p,
137
- type: void 0,
138
- total: ce.totalResults
139
- })), $ === "next" && v.length) {
140
- const R = j.length;
141
- T(R), C(v[0]);
142
- }
143
- if ($ === "prev" && v.length) {
144
- const R = v.length - 1;
145
- T(R), C(v[R]);
146
- }
147
- return ae;
148
- }).catch(() => !1).finally(() => G(!1));
149
- };
150
- u(() => {
151
- !t || !c || (y(g(d({}, l), {
152
- current: 1
153
- })).then((e) => {
154
- }), D());
155
- }, [c == null ? void 0 : c.id, t == null ? void 0 : t.id]), u(() => {
156
- y().then((e) => {
157
- }), D();
158
- }, [l.current]), u(() => {
159
- y(g(d({}, l), {
160
- current: 1,
161
- total: void 0
162
- })).then((e) => {
163
- });
164
- }, [F]);
165
- const Re = () => {
166
- if (!h)
167
- return;
168
- const e = X + 1;
169
- if (e >= h.length)
170
- l.total && e >= l.total ? W.error("已经是最后一个了") : V({
171
- current: l.current + 1,
172
- pageSize: l.pageSize,
173
- type: "next"
174
- });
175
- else {
176
- T(e);
177
- const i = h[e];
178
- C(i);
179
- }
180
- }, Ae = () => {
181
- if (!h)
182
- return;
183
- const e = X - 1;
184
- if (e < 0)
185
- e < 0 ? W.error("已经是第一个了") : V({
186
- current: l.current - 1,
187
- pageSize: l.pageSize,
188
- type: "prev"
189
- });
190
- else {
191
- T(e);
192
- const i = h[e];
193
- C(i);
194
- }
195
- }, Be = [{
196
- key: "",
197
- label: `全部(${U})`,
198
- children: null
199
- }, {
200
- key: "nocode",
201
- label: `未标注(${Y})`,
202
- children: null
203
- }, {
204
- key: "hascode",
205
- label: `已标注(${U - Y})`,
206
- children: null
207
- }];
208
- u(() => {
209
- E || C(void 0);
210
- }, [E]), u(() => {
211
- c && c.markType !== "vlm" && console.error(`当前数据集不是vlm类型,请检查数据集类型。
212
- 请检查markType是否为vlm。`);
213
- }, [c]);
214
- const ie = () => {
215
- var e, i;
216
- (i = (e = z.current) == null ? void 0 : e.getElementsByClassName("rc-virtual-list-holder")[0]) == null || i.scrollTo({
217
- top: 0
218
- });
219
- }, Ee = (e) => {
220
- var i;
221
- (!l.total || l.total > h.length) && e.currentTarget.scrollHeight - e.currentTarget.scrollTop === ((i = z.current) == null ? void 0 : i.clientHeight) && V(g(d({}, l), {
222
- current: l.current + 1
223
- }));
224
- };
225
- return /* @__PURE__ */ o(We, {
226
- locale: Je,
227
- children: /* @__PURE__ */ o(ot.Provider, {
228
- value: {
229
- datasetId: r,
230
- versionId: (t == null ? void 0 : t.id) || "",
231
- no: (t == null ? void 0 : t.no) || "",
232
- loading: O,
233
- version: t,
234
- versions: M,
235
- samples: h,
236
- pagination: l,
237
- services: n,
238
- token: ve,
239
- apiUrl: ge,
240
- featuresConfig: {
241
- labelManager: me,
242
- datasetManager: b,
243
- annotation: he,
244
- filterSwitch: Z,
245
- header: a,
246
- exampleSrcRoot: pe
247
- }
248
- },
249
- children: c ? c.markType === "vlm" ? /* @__PURE__ */ I("div", {
250
- className: "vlm-version-detail",
251
- children: [/* @__PURE__ */ I(tt, {
252
- className: "product-details-page",
253
- header: a === !1 ? void 0 : /* @__PURE__ */ o(lt, {
254
- backTo: fe,
255
- onBackClick: a != null && a.onBackClick ? () => {
256
- a.onBackClick && a.onBackClick();
257
- } : void 0,
258
- left: !O && /* @__PURE__ */ I(A, {
259
- children: [/* @__PURE__ */ o("span", {
260
- style: {
261
- fontWeight: "bold"
262
- },
263
- children: c == null ? void 0 : c.name
264
- }), /* @__PURE__ */ o(_e, {
265
- disabled: (a == null ? void 0 : a.versionSelect) === !1,
266
- value: t == null ? void 0 : t.id,
267
- style: {
268
- width: 70
269
- },
270
- options: M.map((e) => ({
271
- label: e.no,
272
- value: e.id
273
- })),
274
- onChange: (e) => {
275
- const i = M.find((p) => p.id === e);
276
- if (!c || !i)
277
- return;
278
- const m = M.find((p) => p.id === i.id);
279
- k(m), a != null && a.onVersionChange && a.onVersionChange(m);
280
- }
281
- })]
282
- }),
283
- right: /* @__PURE__ */ I(A, {
284
- children: [!w && b && b.add && // <DisabledTooltip
285
- // isPreLabel={false}
286
- // placement="bottom"
287
- // >
288
- /* @__PURE__ */ o(_, {
289
- type: "default",
290
- onClick: () => K(!0),
291
- disabled: S === x.Pending || S === x.Started,
292
- children: "导入数据"
293
- }, "del"), /* @__PURE__ */ o(st, {
294
- when: Me,
295
- content: "确认要离开此页面吗?",
296
- subContent: "离开此页面后,将结束导入,放弃未上传的文件,请谨慎操作!"
297
- }), re && /* @__PURE__ */ o(it, {
298
- datasetIam: De,
299
- datasetId: r,
300
- currentVersion: t,
301
- tenCode: c == null ? void 0 : c.tenantCode,
302
- markType: c.markType,
303
- isVisible: re,
304
- setIsVisible: K,
305
- getVersionListRequest: D,
306
- setIsConfirm: Te,
307
- onUploadStatusChange: (e) => {
308
- Le(e);
309
- },
310
- tableReload: () => {
311
- t != null && t.id && (ie(), y(g(d({}, l), {
312
- current: 1
313
- })));
314
- },
315
- loadVersionData: le
316
- })]
317
- })
318
- }),
319
- children: [/* @__PURE__ */ I("div", {
320
- className: "vlm-header",
321
- children: [/* @__PURE__ */ o(A, {
322
- children: Z.tabs && /* @__PURE__ */ o(qe, {
323
- className: "header-tab",
324
- defaultActiveKey: "",
325
- onChange: (e) => {
326
- V(g(d({}, l), {
327
- current: 1
328
- // total: 0,
329
- })), Ie(e);
330
- },
331
- items: Be
332
- })
333
- }), /* @__PURE__ */ o(A, {
334
- children: b && b.label && /* @__PURE__ */ o(_, {
335
- type: "primary",
336
- disabled: !U,
337
- onClick: we,
338
- style: {
339
- marginRight: "10px"
340
- },
341
- children: "标注"
342
- })
343
- })]
344
- }), /* @__PURE__ */ o("div", {
345
- className: "d-row",
346
- children: /* @__PURE__ */ o("div", {
347
- className: "d-right",
348
- ref: z,
349
- children: w ? /* @__PURE__ */ o("div", {}) : l.total !== void 0 && l.total > 0 ? /* @__PURE__ */ o($e, {
350
- children: /* @__PURE__ */ o(et, {
351
- innerProps: {
352
- className: "d-right-row"
353
- },
354
- data: h,
355
- itemKey: "id",
356
- height: (se = z.current) == null ? void 0 : se.clientHeight,
357
- onScroll: Ee,
358
- children: (e, i) => /* @__PURE__ */ o(Oe, {
359
- className: "d-right-col",
360
- onClick: () => ze(i),
361
- children: /* @__PURE__ */ o("div", {
362
- className: "right-col-wrapper",
363
- children: /* @__PURE__ */ o("div", {
364
- className: "right-col-img",
365
- children: /* @__PURE__ */ o(rt, {
366
- fileKey: e.fileKey,
367
- width: 124,
368
- imgProxy: Ce
369
- })
370
- })
371
- })
372
- }, e.id)
373
- })
374
- }) : /* @__PURE__ */ o("div", {
375
- className: "empty",
376
- children: l.total === 0 ? /* @__PURE__ */ o(Ge, {
377
- image: ct,
378
- description: /* @__PURE__ */ I("span", {
379
- children: ["暂无数据", F !== "hascode" && /* @__PURE__ */ o("span", {
380
- children: b && b.add && /* @__PURE__ */ I(_, {
381
- type: "link",
382
- size: "small",
383
- style: {
384
- padding: 0
385
- },
386
- onClick: () => K(!0),
387
- disabled: S === x.Pending || S === x.Started,
388
- children: [/* @__PURE__ */ o("span", {
389
- style: {
390
- color: "black"
391
- },
392
- children: ","
393
- }), " ", "立即导入 >"]
394
- })
395
- })]
396
- })
397
- }) : null
398
- })
399
- })
400
- })]
401
- }), w && /* @__PURE__ */ o(Qe, {
402
- isVlmModalVisible: E,
403
- setIsVlmModalVisible: P,
404
- record: w,
405
- onNextClick: () => Re(),
406
- onPrevClick: () => Ae(),
407
- listLoading: be,
408
- ocrMarkTmpl: c == null ? void 0 : c.ocrMarkTmpl,
409
- datasetId: r,
410
- versionId: t == null ? void 0 : t.id,
411
- handleMarkClick: (e) => {
412
- Q(e), P(!1), H(!0);
413
- },
414
- updateSampleList: () => {
415
- y(g(d({}, l), {
416
- current: 1
417
- })), D();
418
- }
419
- }), te && (t == null ? void 0 : t.id) && /* @__PURE__ */ o(Xe, {
420
- visible: te,
421
- selectSampleId: ye,
422
- datasetId: r,
423
- versionId: t.id,
424
- onClose: () => {
425
- y(g(d({}, l), {
426
- current: 1
427
- })), D(), H(!1);
428
- },
429
- onSave: (e) => {
430
- if (!r || !t)
431
- throw "datasetId or version is not exist.";
432
- return n.cvforceDatahub.updateSamples(r, t.id, [d({}, e)]).then(() => (y(g(d({}, l), {
433
- current: 1
434
- })), D(), !0));
435
- }
436
- })]
437
- }) : /* @__PURE__ */ o("div", {
438
- style: {
439
- color: "red",
440
- textAlign: "center"
441
- },
442
- children: "当前数据集不是vlm(视觉语言模型)类型,请检查数据集类型。"
443
- }) : null
444
- })
445
- });
446
- };
447
- export {
448
- Tt as default
449
- };
@@ -1,4 +0,0 @@
1
- const t = "";
2
- export {
3
- t as default
4
- };