@glodon-aiot/dataset-annotation 3.25.1-alpha.7 → 3.26.0-alpha.4
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.
- package/dist/dataset-annotation.js +123598 -0
- package/dist/dataset-annotation.umd.cjs +1017 -0
- package/dist/es/components/DetectionAnnotation/index.mjs +529 -535
- package/dist/es/components/OCRImageViewer/index.mjs +117 -130
- package/dist/es/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/index.mjs +65 -65
- package/dist/es/components/OcrAnnotation/OCRBoxDetail/index.mjs +92 -94
- package/dist/es/index.mjs +15 -21
- package/dist/example/DatasetAnnotationDemo.d.ts +3 -0
- package/dist/example/DemoTabs.d.ts +3 -0
- package/dist/example/DetectionDatasetDemo.d.ts +5 -0
- package/dist/example/DetectionImageDemo.d.ts +5 -0
- package/dist/example/OcrDatasetDemo.d.ts +5 -0
- package/dist/example/OcrImageDemo.d.ts +5 -0
- package/dist/example/OcrkvcDatasetDemo.d.ts +5 -0
- package/dist/example/constant.local.d.ts +6 -0
- package/dist/example/index.d.ts +1 -0
- package/dist/lib/index.js +4 -37
- package/dist/src/components/OCRImageViewer/index.d.ts +0 -1
- package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/ImageDetail/index.d.ts +16 -0
- package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/LabelEditorInput.d.ts +12 -0
- package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/LabelEditorItem.d.ts +21 -0
- package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/LableEditor.d.ts +16 -0
- package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/index.d.ts +19 -0
- package/dist/src/index.d.ts +0 -6
- package/dist/src/utils/reactCompatibility.d.ts +5 -0
- package/package.json +2 -2
- package/dist/es/_virtual/_commonjsHelpers.mjs +0 -8
- package/dist/es/_virtual/dayjs.min.mjs +0 -4
- package/dist/es/components/VersionCompare/VersionCompareSelectModal/index.mjs +0 -122
- package/dist/es/components/VersionCompare/adapter.mjs +0 -215
- package/dist/es/components/VersionCompare/components/DataChangeStatsCard.mjs +0 -68
- package/dist/es/components/VersionCompare/components/DiffValue.mjs +0 -31
- package/dist/es/components/VersionCompare/components/LabelComparisonCard.mjs +0 -130
- package/dist/es/components/VersionCompare/components/ModifiedSampleCompareModal.mjs +0 -207
- package/dist/es/components/VersionCompare/components/SampleChangeDetailsCard.mjs +0 -160
- package/dist/es/components/VersionCompare/components/SingleSampleDetailModal.mjs +0 -165
- package/dist/es/components/VersionCompare/components/VersionCompareHeader.mjs +0 -106
- package/dist/es/components/VersionCompare/components/VersionOverviewCard.mjs +0 -70
- package/dist/es/components/VersionCompare/index.mjs +0 -416
- package/dist/es/components/VersionCompare/mock.mjs +0 -571
- package/dist/es/components/VersionCompare/style.less.mjs +0 -4
- package/dist/es/components/VersionCompare/utils/labelColors.mjs +0 -45
- package/dist/es/createDatasetVersionCompare/index.mjs +0 -124
- package/dist/es/node_modules/dayjs/dayjs.min.mjs +0 -324
- package/dist/src/components/VersionCompare/VersionCompareSelectModal/index.d.ts +0 -16
- package/dist/src/components/VersionCompare/adapter.d.ts +0 -50
- package/dist/src/components/VersionCompare/components/DataChangeStatsCard.d.ts +0 -9
- package/dist/src/components/VersionCompare/components/DiffValue.d.ts +0 -23
- package/dist/src/components/VersionCompare/components/LabelComparisonCard.d.ts +0 -12
- package/dist/src/components/VersionCompare/components/ModifiedSampleCompareModal.d.ts +0 -48
- package/dist/src/components/VersionCompare/components/SampleChangeDetailsCard.d.ts +0 -21
- package/dist/src/components/VersionCompare/components/SingleSampleDetailModal.d.ts +0 -46
- package/dist/src/components/VersionCompare/components/VersionCompareHeader.d.ts +0 -13
- package/dist/src/components/VersionCompare/components/VersionOverviewCard.d.ts +0 -9
- package/dist/src/components/VersionCompare/index.d.ts +0 -34
- package/dist/src/components/VersionCompare/mock.d.ts +0 -25
- package/dist/src/components/VersionCompare/types.d.ts +0 -75
- package/dist/src/components/VersionCompare/utils/labelColors.d.ts +0 -13
- package/dist/src/createDatasetVersionCompare/index.d.ts +0 -26
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { Button as r } from "antd";
|
|
3
|
-
import { ArrowLeftOutlined as n, ArrowRightOutlined as t } from "@ant-design/icons";
|
|
4
|
-
const b = (l) => {
|
|
5
|
-
const {
|
|
6
|
-
datasetName: i,
|
|
7
|
-
baseVersionNo: d,
|
|
8
|
-
targetVersionNo: m,
|
|
9
|
-
formattedCompareTime: o,
|
|
10
|
-
showBreadcrumb: s = !0,
|
|
11
|
-
onBack: c,
|
|
12
|
-
onReselect: v
|
|
13
|
-
} = l;
|
|
14
|
-
return /* @__PURE__ */ a("div", {
|
|
15
|
-
className: "vc-top-bar-wrapper",
|
|
16
|
-
children: [s && /* @__PURE__ */ e("div", {
|
|
17
|
-
className: "vc-breadcrumb-bar",
|
|
18
|
-
children: /* @__PURE__ */ a("div", {
|
|
19
|
-
className: "vc-breadcrumb-left",
|
|
20
|
-
children: [/* @__PURE__ */ e(r, {
|
|
21
|
-
type: "link",
|
|
22
|
-
className: "vc-back-btn",
|
|
23
|
-
"aria-label": "返回",
|
|
24
|
-
icon: /* @__PURE__ */ e(n, {}),
|
|
25
|
-
onClick: c
|
|
26
|
-
}), /* @__PURE__ */ a("nav", {
|
|
27
|
-
className: "vc-breadcrumb-nav",
|
|
28
|
-
"aria-label": "面包屑",
|
|
29
|
-
children: [/* @__PURE__ */ e("span", {
|
|
30
|
-
className: "vc-breadcrumb-link",
|
|
31
|
-
onClick: c,
|
|
32
|
-
children: "数据集管理"
|
|
33
|
-
}), /* @__PURE__ */ e("span", {
|
|
34
|
-
className: "vc-breadcrumb-sep",
|
|
35
|
-
children: "/"
|
|
36
|
-
}), /* @__PURE__ */ e("span", {
|
|
37
|
-
className: "vc-breadcrumb-current",
|
|
38
|
-
children: "版本对比"
|
|
39
|
-
})]
|
|
40
|
-
})]
|
|
41
|
-
})
|
|
42
|
-
}), /* @__PURE__ */ a("div", {
|
|
43
|
-
className: "vc-header-bar",
|
|
44
|
-
children: [/* @__PURE__ */ a("div", {
|
|
45
|
-
className: "vc-header-left",
|
|
46
|
-
children: [/* @__PURE__ */ a("div", {
|
|
47
|
-
className: "vc-dataset-title-group",
|
|
48
|
-
children: [!s && /* @__PURE__ */ e(r, {
|
|
49
|
-
type: "link",
|
|
50
|
-
className: "vc-inline-back-btn",
|
|
51
|
-
"aria-label": "返回",
|
|
52
|
-
icon: /* @__PURE__ */ e(n, {}),
|
|
53
|
-
onClick: c
|
|
54
|
-
}), /* @__PURE__ */ e("span", {
|
|
55
|
-
className: "vc-dataset-name",
|
|
56
|
-
children: i || "-"
|
|
57
|
-
})]
|
|
58
|
-
}), /* @__PURE__ */ a("div", {
|
|
59
|
-
className: "vc-header-meta",
|
|
60
|
-
children: [/* @__PURE__ */ a("div", {
|
|
61
|
-
className: "vc-version-direction",
|
|
62
|
-
children: [/* @__PURE__ */ e("span", {
|
|
63
|
-
className: "vc-version-label",
|
|
64
|
-
children: "对比版本:"
|
|
65
|
-
}), /* @__PURE__ */ a("div", {
|
|
66
|
-
className: "vc-version-pair",
|
|
67
|
-
children: [/* @__PURE__ */ a("span", {
|
|
68
|
-
className: "vc-version-tag",
|
|
69
|
-
children: [/* @__PURE__ */ e("span", {
|
|
70
|
-
className: "vc-version-no",
|
|
71
|
-
children: d || "-"
|
|
72
|
-
}), /* @__PURE__ */ e("span", {
|
|
73
|
-
className: "vc-version-role",
|
|
74
|
-
children: "(基准版本)"
|
|
75
|
-
})]
|
|
76
|
-
}), /* @__PURE__ */ e("span", {
|
|
77
|
-
className: "vc-version-arrow",
|
|
78
|
-
"aria-label": "对比方向",
|
|
79
|
-
children: /* @__PURE__ */ e(t, {})
|
|
80
|
-
}), /* @__PURE__ */ a("span", {
|
|
81
|
-
className: "vc-version-tag",
|
|
82
|
-
children: [/* @__PURE__ */ e("span", {
|
|
83
|
-
className: "vc-version-no",
|
|
84
|
-
children: m || "-"
|
|
85
|
-
}), /* @__PURE__ */ e("span", {
|
|
86
|
-
className: "vc-version-role",
|
|
87
|
-
children: "(目标版本)"
|
|
88
|
-
})]
|
|
89
|
-
})]
|
|
90
|
-
})]
|
|
91
|
-
}), /* @__PURE__ */ a("span", {
|
|
92
|
-
className: "vc-compare-time",
|
|
93
|
-
children: ["对比时间:", o || "-"]
|
|
94
|
-
})]
|
|
95
|
-
})]
|
|
96
|
-
}), /* @__PURE__ */ e(r, {
|
|
97
|
-
className: "vc-reselect-btn",
|
|
98
|
-
onClick: v,
|
|
99
|
-
children: "重新选择"
|
|
100
|
-
})]
|
|
101
|
-
})]
|
|
102
|
-
});
|
|
103
|
-
};
|
|
104
|
-
export {
|
|
105
|
-
b as default
|
|
106
|
-
};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import n from "./DiffValue.mjs";
|
|
3
|
-
const h = (r) => {
|
|
4
|
-
const {
|
|
5
|
-
baseVersionNo: s,
|
|
6
|
-
targetVersionNo: i,
|
|
7
|
-
rows: l
|
|
8
|
-
} = r;
|
|
9
|
-
return /* @__PURE__ */ a("div", {
|
|
10
|
-
className: "vc-card vc-overview-card",
|
|
11
|
-
children: [/* @__PURE__ */ e("div", {
|
|
12
|
-
className: "vc-card-header",
|
|
13
|
-
children: /* @__PURE__ */ e("h3", {
|
|
14
|
-
className: "vc-card-title",
|
|
15
|
-
children: "版本数据概览"
|
|
16
|
-
})
|
|
17
|
-
}), /* @__PURE__ */ e("div", {
|
|
18
|
-
className: "vc-table-container",
|
|
19
|
-
children: /* @__PURE__ */ a("table", {
|
|
20
|
-
className: "vc-standard-table",
|
|
21
|
-
children: [/* @__PURE__ */ e("thead", {
|
|
22
|
-
children: /* @__PURE__ */ a("tr", {
|
|
23
|
-
children: [/* @__PURE__ */ e("th", {
|
|
24
|
-
children: "指标"
|
|
25
|
-
}), /* @__PURE__ */ e("th", {
|
|
26
|
-
children: /* @__PURE__ */ a("span", {
|
|
27
|
-
className: "vc-th-version-title",
|
|
28
|
-
children: [/* @__PURE__ */ e("span", {
|
|
29
|
-
className: "vc-th-version-no",
|
|
30
|
-
children: s || "-"
|
|
31
|
-
}), /* @__PURE__ */ e("span", {
|
|
32
|
-
className: "vc-th-version-desc",
|
|
33
|
-
children: "(基准版本)"
|
|
34
|
-
})]
|
|
35
|
-
})
|
|
36
|
-
}), /* @__PURE__ */ e("th", {
|
|
37
|
-
children: /* @__PURE__ */ a("span", {
|
|
38
|
-
className: "vc-th-version-title",
|
|
39
|
-
children: [/* @__PURE__ */ e("span", {
|
|
40
|
-
className: "vc-th-version-no",
|
|
41
|
-
children: i || "-"
|
|
42
|
-
}), /* @__PURE__ */ e("span", {
|
|
43
|
-
className: "vc-th-version-desc",
|
|
44
|
-
children: "(目标版本)"
|
|
45
|
-
})]
|
|
46
|
-
})
|
|
47
|
-
})]
|
|
48
|
-
})
|
|
49
|
-
}), /* @__PURE__ */ e("tbody", {
|
|
50
|
-
children: l.map((c) => /* @__PURE__ */ a("tr", {
|
|
51
|
-
children: [/* @__PURE__ */ e("td", {
|
|
52
|
-
children: c.metricLabel
|
|
53
|
-
}), /* @__PURE__ */ e("td", {
|
|
54
|
-
children: c.baseValue
|
|
55
|
-
}), /* @__PURE__ */ e("td", {
|
|
56
|
-
children: /* @__PURE__ */ e(n, {
|
|
57
|
-
value: c.targetValue,
|
|
58
|
-
diff: c.diff,
|
|
59
|
-
gap: 8
|
|
60
|
-
})
|
|
61
|
-
})]
|
|
62
|
-
}, c.key))
|
|
63
|
-
})]
|
|
64
|
-
})
|
|
65
|
-
})]
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
export {
|
|
69
|
-
h as default
|
|
70
|
-
};
|
|
@@ -1,416 +0,0 @@
|
|
|
1
|
-
var j = (ne, K, c) => new Promise((R, S) => {
|
|
2
|
-
var z = (d) => {
|
|
3
|
-
try {
|
|
4
|
-
B(c.next(d));
|
|
5
|
-
} catch (q) {
|
|
6
|
-
S(q);
|
|
7
|
-
}
|
|
8
|
-
}, L = (d) => {
|
|
9
|
-
try {
|
|
10
|
-
B(c.throw(d));
|
|
11
|
-
} catch (q) {
|
|
12
|
-
S(q);
|
|
13
|
-
}
|
|
14
|
-
}, B = (d) => d.done ? R(d.value) : Promise.resolve(d.value).then(z, L);
|
|
15
|
-
B((c = c.apply(ne, K)).next());
|
|
16
|
-
});
|
|
17
|
-
import { jsx as h, jsxs as me } from "react/jsx-runtime";
|
|
18
|
-
import { useContext as Ye, useState as i, useRef as P, useEffect as E, useCallback as oe } from "react";
|
|
19
|
-
import { message as ae, ConfigProvider as Ze, Spin as Je } from "antd";
|
|
20
|
-
import Qe from "antd/es/locale/zh_CN";
|
|
21
|
-
import Xe from "../../DatasetContext/index.mjs";
|
|
22
|
-
import et from "./components/VersionCompareHeader.mjs";
|
|
23
|
-
import tt from "./components/VersionOverviewCard.mjs";
|
|
24
|
-
import rt from "./components/DataChangeStatsCard.mjs";
|
|
25
|
-
import ot from "./components/LabelComparisonCard.mjs";
|
|
26
|
-
import at from "./components/SampleChangeDetailsCard.mjs";
|
|
27
|
-
import nt from "./components/SingleSampleDetailModal.mjs";
|
|
28
|
-
import lt from "./components/ModifiedSampleCompareModal.mjs";
|
|
29
|
-
import st from "./VersionCompareSelectModal/index.mjs";
|
|
30
|
-
import { PRELOAD_FORWARD as it, PRELOAD_BACKWARD as ct, ImagePreloader as dt } from "../DetectionAnnotation/utils/imagePreloader.mjs";
|
|
31
|
-
import { scrollSampleIntoView as pt } from "../../utils/scrollSampleIntoView.mjs";
|
|
32
|
-
import { fetchVersionCompareSummaryWithAdapter as ft, fetchVersionCompareSamplesWithAdapter as ut } from "./adapter.mjs";
|
|
33
|
-
import { adaptVersionCompareSampleItem as zt, adaptVersionCompareSamples as Lt, adaptVersionCompareSummary as Bt, formatCompareTimestamp as qt } from "./adapter.mjs";
|
|
34
|
-
import "./style.less.mjs";
|
|
35
|
-
import "@glodon-aiot/apis";
|
|
36
|
-
const gt = 20, yt = (ne) => {
|
|
37
|
-
var Pe, Ae, Oe;
|
|
38
|
-
const K = Ye(Xe), {
|
|
39
|
-
datasetId: c,
|
|
40
|
-
baseVersionId: R,
|
|
41
|
-
targetVersionId: S,
|
|
42
|
-
datasetName: z,
|
|
43
|
-
markType: L,
|
|
44
|
-
ocrMarkTmpl: B,
|
|
45
|
-
cvforceDatahub: d = (Pe = K.services) == null ? void 0 : Pe.cvforceDatahub,
|
|
46
|
-
imgProxy: q,
|
|
47
|
-
versions: ze,
|
|
48
|
-
showBreadcrumb: Le = !0,
|
|
49
|
-
useMock: k = !1,
|
|
50
|
-
fallbackToMockOnError: $ = !1,
|
|
51
|
-
mockScene: le,
|
|
52
|
-
onBack: Be,
|
|
53
|
-
onVersionsChange: se,
|
|
54
|
-
onSampleClick: ie
|
|
55
|
-
} = ne, [f, he] = i(R), [u, Ce] = i(S), [e, qe] = i(null), [Fe, be] = i(!1), [ce, de] = i(null), [s, Ie] = i("added"), [C, We] = i([]), [G, _e] = i(0), [M, Y] = i(1), [b, Se] = i(gt), [w, Me] = i(!1), [He, pe] = i(!1), [ve, Z] = i(!1), [Te, J] = i(!1), [n, v] = i(-1), [Ve, fe] = i(!1), Q = P(null), A = P(0), F = P(0), O = P(!1), T = P(void 0), W = P(!1), X = P(null);
|
|
56
|
-
E(() => {
|
|
57
|
-
he(R);
|
|
58
|
-
}, [R]), E(() => {
|
|
59
|
-
Ce(S);
|
|
60
|
-
}, [S]);
|
|
61
|
-
const _ = le != null ? le : L === "ocr" ? "ocr" : L === "detection" ? "detection" : void 0, Ne = oe((t, o, g) => j(void 0, null, function* () {
|
|
62
|
-
if (!c || !t || !o)
|
|
63
|
-
return null;
|
|
64
|
-
const a = ++A.current;
|
|
65
|
-
be(!0), de(null);
|
|
66
|
-
try {
|
|
67
|
-
const l = yield ft(c, {
|
|
68
|
-
baseVersionId: t,
|
|
69
|
-
targetVersionId: o
|
|
70
|
-
}, {
|
|
71
|
-
cvforceDatahub: d,
|
|
72
|
-
useMock: k,
|
|
73
|
-
fallbackToMockOnError: $,
|
|
74
|
-
mockScene: _,
|
|
75
|
-
mockDatasetName: z,
|
|
76
|
-
onAsyncTaskProgress: (r) => {
|
|
77
|
-
a === A.current && de(r);
|
|
78
|
-
},
|
|
79
|
-
signal: g
|
|
80
|
-
});
|
|
81
|
-
return a !== A.current ? null : (qe(l), de(null), l);
|
|
82
|
-
} catch (l) {
|
|
83
|
-
return (l == null ? void 0 : l.name) === "AbortError" || a === A.current && ae.error((l == null ? void 0 : l.message) || "获取版本对比概览失败"), null;
|
|
84
|
-
} finally {
|
|
85
|
-
a === A.current && be(!1);
|
|
86
|
-
}
|
|
87
|
-
}), [c, d, k, $, _, z]), D = oe((t) => j(void 0, null, function* () {
|
|
88
|
-
const {
|
|
89
|
-
baseId: o,
|
|
90
|
-
targetId: g,
|
|
91
|
-
changeType: a,
|
|
92
|
-
page: l,
|
|
93
|
-
size: r,
|
|
94
|
-
colorMap: m,
|
|
95
|
-
selectPosition: I
|
|
96
|
-
} = t;
|
|
97
|
-
if (!c || !o || !g)
|
|
98
|
-
return null;
|
|
99
|
-
const N = ++F.current;
|
|
100
|
-
Me(!0);
|
|
101
|
-
try {
|
|
102
|
-
const p = yield ut(c, {
|
|
103
|
-
baseVersionId: o,
|
|
104
|
-
targetVersionId: g,
|
|
105
|
-
changeType: a,
|
|
106
|
-
pageNo: l,
|
|
107
|
-
pageSize: r
|
|
108
|
-
}, m, {
|
|
109
|
-
cvforceDatahub: d,
|
|
110
|
-
useMock: k,
|
|
111
|
-
fallbackToMockOnError: $,
|
|
112
|
-
mockScene: _
|
|
113
|
-
});
|
|
114
|
-
return N !== F.current ? null : (We(p.items), _e(p.total), Y(p.pageNo), Se(p.pageSize), I === "first" ? v(p.items.length > 0 ? 0 : -1) : I === "last" && v(p.items.length > 0 ? p.items.length - 1 : -1), p);
|
|
115
|
-
} catch (p) {
|
|
116
|
-
return N === F.current && ae.error((p == null ? void 0 : p.message) || "获取版本对比样本列表失败"), null;
|
|
117
|
-
} finally {
|
|
118
|
-
N === F.current && Me(!1);
|
|
119
|
-
}
|
|
120
|
-
}), [c, d, k, $, _]);
|
|
121
|
-
E(() => {
|
|
122
|
-
if (f !== R || u !== S) {
|
|
123
|
-
A.current += 1, F.current += 1;
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
const t = new AbortController();
|
|
127
|
-
return Ie("added"), Y(1), Z(!1), J(!1), v(-1), Ne(f, u, t.signal).then((o) => {
|
|
128
|
-
!o || t.signal.aborted || D({
|
|
129
|
-
baseId: f,
|
|
130
|
-
targetId: u,
|
|
131
|
-
changeType: "added",
|
|
132
|
-
page: 1,
|
|
133
|
-
size: b,
|
|
134
|
-
colorMap: o.labelColorMap
|
|
135
|
-
});
|
|
136
|
-
}), () => {
|
|
137
|
-
t.abort();
|
|
138
|
-
};
|
|
139
|
-
}, [c, f, u, R, S, _, Ne]);
|
|
140
|
-
const je = (t) => {
|
|
141
|
-
Ie(t), Y(1), Z(!1), J(!1), v(-1), D({
|
|
142
|
-
baseId: f,
|
|
143
|
-
targetId: u,
|
|
144
|
-
changeType: t,
|
|
145
|
-
page: 1,
|
|
146
|
-
size: b,
|
|
147
|
-
colorMap: e == null ? void 0 : e.labelColorMap
|
|
148
|
-
});
|
|
149
|
-
}, Ke = (t, o) => {
|
|
150
|
-
Y(t), Se(o), v(-1), D({
|
|
151
|
-
baseId: f,
|
|
152
|
-
targetId: u,
|
|
153
|
-
changeType: s,
|
|
154
|
-
page: t,
|
|
155
|
-
size: o,
|
|
156
|
-
colorMap: e == null ? void 0 : e.labelColorMap
|
|
157
|
-
});
|
|
158
|
-
}, $e = (t, o) => {
|
|
159
|
-
W.current = !1, v(o), s === "modified" ? J(!0) : Z(!0), ie == null || ie(t, o, s);
|
|
160
|
-
}, ue = n >= 0 ? (M - 1) * b + n : -1, ee = ue > 0, te = ue >= 0 && ue < G - 1, V = n >= 0 && n < C.length ? C[n] : void 0, H = ve || Te;
|
|
161
|
-
E(() => {
|
|
162
|
-
if (H && V && n >= 0) {
|
|
163
|
-
const t = s === "deleted" && V.baseSample || V.sample;
|
|
164
|
-
X.current = {
|
|
165
|
-
id: (t == null ? void 0 : t.id) || V.fileKey,
|
|
166
|
-
index: n
|
|
167
|
-
};
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
if (!H && X.current) {
|
|
171
|
-
const t = X.current, o = W.current;
|
|
172
|
-
if (X.current = null, W.current = !1, fe(!1), !o)
|
|
173
|
-
return;
|
|
174
|
-
const g = requestAnimationFrame(() => {
|
|
175
|
-
var r;
|
|
176
|
-
let a = Q.current, l = null;
|
|
177
|
-
for (; a && a !== document.body && a !== document.documentElement; ) {
|
|
178
|
-
const {
|
|
179
|
-
overflowY: m
|
|
180
|
-
} = window.getComputedStyle(a);
|
|
181
|
-
if ((m === "auto" || m === "scroll" || m === "overlay") && a.scrollHeight > a.clientHeight) {
|
|
182
|
-
l = a;
|
|
183
|
-
break;
|
|
184
|
-
}
|
|
185
|
-
a = a.parentElement;
|
|
186
|
-
}
|
|
187
|
-
if (l)
|
|
188
|
-
pt(l, t.id, t.index);
|
|
189
|
-
else if (Q.current) {
|
|
190
|
-
const m = Array.from(Q.current.querySelectorAll("[data-sample-id]")), I = (r = m.find((N) => N.dataset.sampleId === String(t.id))) != null ? r : m[t.index];
|
|
191
|
-
I == null || I.scrollIntoView({
|
|
192
|
-
block: "center"
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
return () => cancelAnimationFrame(g);
|
|
197
|
-
}
|
|
198
|
-
}, [H, V, n, s]), E(() => {
|
|
199
|
-
var l;
|
|
200
|
-
if (!H) {
|
|
201
|
-
(l = T.current) == null || l.dispose(), T.current = void 0;
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
if (!Ve || n < 0)
|
|
205
|
-
return;
|
|
206
|
-
const t = (r) => {
|
|
207
|
-
var I, N, p, xe, ye, Ue;
|
|
208
|
-
if (!r)
|
|
209
|
-
return [];
|
|
210
|
-
if (s === "modified")
|
|
211
|
-
return [((I = r.baseSample) == null ? void 0 : I.fileUrl) || ((N = r.baseSample) == null ? void 0 : N.thumbnailUrl) || "", ((p = r.sample) == null ? void 0 : p.fileUrl) || ((xe = r.sample) == null ? void 0 : xe.thumbnailUrl) || ""].filter(Boolean);
|
|
212
|
-
if (s === "deleted") {
|
|
213
|
-
const U = r.baseSample || r.sample, Ee = (U == null ? void 0 : U.fileUrl) || (U == null ? void 0 : U.thumbnailUrl) || "";
|
|
214
|
-
return Ee ? [Ee] : [];
|
|
215
|
-
}
|
|
216
|
-
const m = ((ye = r.sample) == null ? void 0 : ye.fileUrl) || ((Ue = r.sample) == null ? void 0 : Ue.thumbnailUrl) || "";
|
|
217
|
-
return m ? [m] : [];
|
|
218
|
-
}, o = t(C[n]);
|
|
219
|
-
if (!o.length)
|
|
220
|
-
return;
|
|
221
|
-
const g = [], a = (r) => {
|
|
222
|
-
r < 0 || r >= C.length || g.push(...t(C[r]));
|
|
223
|
-
};
|
|
224
|
-
for (let r = 1; r <= it; r++)
|
|
225
|
-
a(n + r);
|
|
226
|
-
for (let r = 1; r <= ct; r++)
|
|
227
|
-
a(n - r);
|
|
228
|
-
T.current || (T.current = new dt()), T.current.pruneExcept([...o, ...g]), T.current.setTargets(g);
|
|
229
|
-
}, [H, Ve, n, C, s]), E(() => () => {
|
|
230
|
-
var t;
|
|
231
|
-
(t = T.current) == null || t.dispose(), T.current = void 0;
|
|
232
|
-
}, []);
|
|
233
|
-
const Re = oe(() => j(void 0, null, function* () {
|
|
234
|
-
if (!(w || O.current)) {
|
|
235
|
-
if (!ee) {
|
|
236
|
-
ae.error("已经是第一个了");
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
if (W.current = !0, n > 0) {
|
|
240
|
-
v((t) => t - 1);
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
if (M > 1) {
|
|
244
|
-
O.current = !0;
|
|
245
|
-
try {
|
|
246
|
-
yield D({
|
|
247
|
-
baseId: f,
|
|
248
|
-
targetId: u,
|
|
249
|
-
changeType: s,
|
|
250
|
-
page: M - 1,
|
|
251
|
-
size: b,
|
|
252
|
-
colorMap: e == null ? void 0 : e.labelColorMap,
|
|
253
|
-
selectPosition: "last"
|
|
254
|
-
});
|
|
255
|
-
} finally {
|
|
256
|
-
O.current = !1;
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
}), [ee, w, n, M, b, D, f, u, s, e == null ? void 0 : e.labelColorMap]), ke = oe(() => j(void 0, null, function* () {
|
|
261
|
-
if (!(w || O.current)) {
|
|
262
|
-
if (!te) {
|
|
263
|
-
ae.error("已经是最后一个了");
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
266
|
-
if (W.current = !0, n + 1 < C.length) {
|
|
267
|
-
v((t) => t + 1);
|
|
268
|
-
return;
|
|
269
|
-
}
|
|
270
|
-
if ((M - 1) * b + n + 1 < G) {
|
|
271
|
-
O.current = !0;
|
|
272
|
-
try {
|
|
273
|
-
yield D({
|
|
274
|
-
baseId: f,
|
|
275
|
-
targetId: u,
|
|
276
|
-
changeType: s,
|
|
277
|
-
page: M + 1,
|
|
278
|
-
size: b,
|
|
279
|
-
colorMap: e == null ? void 0 : e.labelColorMap,
|
|
280
|
-
selectPosition: "first"
|
|
281
|
-
});
|
|
282
|
-
} finally {
|
|
283
|
-
O.current = !1;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
}), [te, w, n, C.length, M, b, G, D, f, u, s, e == null ? void 0 : e.labelColorMap]), Ge = (t, o, g, a) => {
|
|
288
|
-
pe(!1), he(t), Ce(o), se == null || se(t, o, g, a);
|
|
289
|
-
}, we = z || (e == null ? void 0 : e.datasetName) || ((Ae = K.dataset) == null ? void 0 : Ae.name) || "-", De = L || (e == null ? void 0 : e.markType) || "detection", ge = B || (e == null ? void 0 : e.ocrMarkTmpl), re = (Oe = e == null ? void 0 : e.isOcrDetection) != null ? Oe : De === "ocr" && (!ge || ge === "DetectionOCR"), x = (e == null ? void 0 : e.baseVersionNo) || f || "-", y = (e == null ? void 0 : e.targetVersionNo) || u || "-";
|
|
290
|
-
return /* @__PURE__ */ h(Ze, {
|
|
291
|
-
locale: Qe,
|
|
292
|
-
children: /* @__PURE__ */ me("div", {
|
|
293
|
-
className: "dataset-version-compare-page",
|
|
294
|
-
ref: Q,
|
|
295
|
-
children: [/* @__PURE__ */ h(et, {
|
|
296
|
-
datasetName: we,
|
|
297
|
-
baseVersionNo: x,
|
|
298
|
-
targetVersionNo: y,
|
|
299
|
-
formattedCompareTime: (e == null ? void 0 : e.formattedCompareTime) || "-",
|
|
300
|
-
showBreadcrumb: Le,
|
|
301
|
-
onBack: Be,
|
|
302
|
-
onReselect: () => pe(!0)
|
|
303
|
-
}), /* @__PURE__ */ h("div", {
|
|
304
|
-
className: "vc-content-scroll",
|
|
305
|
-
children: /* @__PURE__ */ h(Je, {
|
|
306
|
-
spinning: Fe,
|
|
307
|
-
tip: ce ? `正在计算版本对比结果${ce.progress !== void 0 ? ` (${ce.progress}%)` : "..."}` : "正在加载对比数据...",
|
|
308
|
-
children: /* @__PURE__ */ me("div", {
|
|
309
|
-
className: "vc-content-body",
|
|
310
|
-
children: [/* @__PURE__ */ me("div", {
|
|
311
|
-
className: "vc-top-cards-row",
|
|
312
|
-
children: [/* @__PURE__ */ h(tt, {
|
|
313
|
-
baseVersionNo: x,
|
|
314
|
-
targetVersionNo: y,
|
|
315
|
-
rows: (e == null ? void 0 : e.overviewRows) || []
|
|
316
|
-
}), /* @__PURE__ */ h(rt, {
|
|
317
|
-
baseVersionNo: x,
|
|
318
|
-
targetVersionNo: y,
|
|
319
|
-
changeStats: (e == null ? void 0 : e.changeStats) || {
|
|
320
|
-
addedCount: 0,
|
|
321
|
-
deletedCount: 0,
|
|
322
|
-
modifiedCount: 0,
|
|
323
|
-
unchangedCount: 0
|
|
324
|
-
}
|
|
325
|
-
})]
|
|
326
|
-
}), /* @__PURE__ */ h(ot, {
|
|
327
|
-
markType: De,
|
|
328
|
-
ocrMarkTmpl: ge,
|
|
329
|
-
isOcrDetection: re,
|
|
330
|
-
baseVersionNo: x,
|
|
331
|
-
targetVersionNo: y,
|
|
332
|
-
labelComparisons: (e == null ? void 0 : e.labelComparisons) || []
|
|
333
|
-
}), /* @__PURE__ */ h(at, {
|
|
334
|
-
baseVersionNo: x,
|
|
335
|
-
targetVersionNo: y,
|
|
336
|
-
isOcrDetection: re,
|
|
337
|
-
changeStats: (e == null ? void 0 : e.changeStats) || {
|
|
338
|
-
addedCount: 0,
|
|
339
|
-
deletedCount: 0,
|
|
340
|
-
modifiedCount: 0,
|
|
341
|
-
unchangedCount: 0
|
|
342
|
-
},
|
|
343
|
-
activeTab: s,
|
|
344
|
-
items: C,
|
|
345
|
-
total: G,
|
|
346
|
-
pageNo: M,
|
|
347
|
-
pageSize: b,
|
|
348
|
-
loading: w,
|
|
349
|
-
imgProxy: q,
|
|
350
|
-
onTabChange: je,
|
|
351
|
-
onPageChange: Ke,
|
|
352
|
-
onSampleClick: $e
|
|
353
|
-
})]
|
|
354
|
-
})
|
|
355
|
-
})
|
|
356
|
-
}), /* @__PURE__ */ h(nt, {
|
|
357
|
-
open: ve && s !== "modified",
|
|
358
|
-
onCancel: () => Z(!1),
|
|
359
|
-
item: V,
|
|
360
|
-
changeType: s,
|
|
361
|
-
isOcrDetection: re,
|
|
362
|
-
datasetId: c,
|
|
363
|
-
baseVersionId: f,
|
|
364
|
-
targetVersionId: u,
|
|
365
|
-
labelColorMap: e == null ? void 0 : e.labelColorMap,
|
|
366
|
-
canPrev: ee,
|
|
367
|
-
canNext: te,
|
|
368
|
-
switching: w,
|
|
369
|
-
onPrev: Re,
|
|
370
|
-
onNext: ke,
|
|
371
|
-
onImageReadyChange: fe,
|
|
372
|
-
cvforceDatahub: d,
|
|
373
|
-
useMock: k
|
|
374
|
-
}), /* @__PURE__ */ h(lt, {
|
|
375
|
-
open: Te && s === "modified",
|
|
376
|
-
onCancel: () => J(!1),
|
|
377
|
-
item: V,
|
|
378
|
-
isOcrDetection: re,
|
|
379
|
-
datasetId: c,
|
|
380
|
-
baseVersionId: f,
|
|
381
|
-
baseVersionNo: x,
|
|
382
|
-
targetVersionId: u,
|
|
383
|
-
targetVersionNo: y,
|
|
384
|
-
labelColorMap: e == null ? void 0 : e.labelColorMap,
|
|
385
|
-
canPrev: ee,
|
|
386
|
-
canNext: te,
|
|
387
|
-
switching: w,
|
|
388
|
-
onPrev: Re,
|
|
389
|
-
onNext: ke,
|
|
390
|
-
onImageReadyChange: fe,
|
|
391
|
-
cvforceDatahub: d,
|
|
392
|
-
useMock: k
|
|
393
|
-
}), /* @__PURE__ */ h(st, {
|
|
394
|
-
open: He,
|
|
395
|
-
datasetId: c,
|
|
396
|
-
datasetName: we,
|
|
397
|
-
initialBaseVersionId: f,
|
|
398
|
-
initialTargetVersionId: u,
|
|
399
|
-
versions: ze,
|
|
400
|
-
cvforceDatahub: d,
|
|
401
|
-
useMock: k,
|
|
402
|
-
onCancel: () => pe(!1),
|
|
403
|
-
onConfirm: Ge
|
|
404
|
-
})]
|
|
405
|
-
})
|
|
406
|
-
});
|
|
407
|
-
};
|
|
408
|
-
export {
|
|
409
|
-
zt as adaptVersionCompareSampleItem,
|
|
410
|
-
Lt as adaptVersionCompareSamples,
|
|
411
|
-
Bt as adaptVersionCompareSummary,
|
|
412
|
-
yt as default,
|
|
413
|
-
ut as fetchVersionCompareSamplesWithAdapter,
|
|
414
|
-
ft as fetchVersionCompareSummaryWithAdapter,
|
|
415
|
-
qt as formatCompareTimestamp
|
|
416
|
-
};
|