@glodon-aiot/dataset-annotation 3.18.0-alpha.8 → 3.18.0-alpha.9

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.
@@ -1,153 +1,153 @@
1
- var Xe = Object.defineProperty, Ye = Object.defineProperties;
2
- var et = Object.getOwnPropertyDescriptors;
3
- var xe = Object.getOwnPropertySymbols;
4
- var tt = Object.prototype.hasOwnProperty, ot = Object.prototype.propertyIsEnumerable;
5
- var De = (L, c, l) => c in L ? Xe(L, c, { enumerable: !0, configurable: !0, writable: !0, value: l }) : L[c] = l, f = (L, c) => {
6
- for (var l in c || (c = {}))
7
- tt.call(c, l) && De(L, l, c[l]);
8
- if (xe)
9
- for (var l of xe(c))
10
- ot.call(c, l) && De(L, l, c[l]);
11
- return L;
12
- }, u = (L, c) => Ye(L, et(c));
1
+ var tt = Object.defineProperty, ot = Object.defineProperties;
2
+ var lt = Object.getOwnPropertyDescriptors;
3
+ var Ne = Object.getOwnPropertySymbols;
4
+ var it = Object.prototype.hasOwnProperty, nt = Object.prototype.propertyIsEnumerable;
5
+ var ke = (V, c, i) => c in V ? tt(V, c, { enumerable: !0, configurable: !0, writable: !0, value: i }) : V[c] = i, u = (V, c) => {
6
+ for (var i in c || (c = {}))
7
+ it.call(c, i) && ke(V, i, c[i]);
8
+ if (Ne)
9
+ for (var i of Ne(c))
10
+ nt.call(c, i) && ke(V, i, c[i]);
11
+ return V;
12
+ }, h = (V, c) => ot(V, lt(c));
13
13
  import { jsx as n, jsxs as E } from "react/jsx-runtime";
14
- import { useRef as ie, useState as a, useEffect as D } from "react";
15
- import { message as Z, ConfigProvider as it, Space as le, Select as lt, Button as Le, Tabs as nt, Col as rt, Tooltip as st, Empty as Ve, Spin as Ne, Modal as ct } from "antd";
16
- import at from "rc-virtual-list";
17
- import { UploadZipsStatus as G } from "@glodon-aiot/apis";
18
- import dt from "antd/es/locale/zh_CN";
19
- import ft from "../../DatasetContext/index.mjs";
20
- import ut from "../DetectionAnnotation/icon_item_empty.svg.mjs";
14
+ import { useRef as se, useState as a, useEffect as D } from "react";
15
+ import { message as j, ConfigProvider as rt, Space as ce, Select as st, Button as Te, Tabs as ct, Col as at, Tooltip as dt, Empty as we, Spin as Ee, Modal as ft } from "antd";
16
+ import ut from "rc-virtual-list";
17
+ import { UploadZipsStatus as Y } from "@glodon-aiot/apis";
18
+ import ht from "antd/es/locale/zh_CN";
19
+ import mt from "../../DatasetContext/index.mjs";
20
+ import bt from "../DetectionAnnotation/icon_item_empty.svg.mjs";
21
21
  import "./style.less.mjs";
22
- import { tagColors as ke } from "../../utils/index.mjs";
23
- import { useKeyPress as ht } from "ahooks";
24
- import { SearchOutlined as mt } from "@ant-design/icons";
25
- import bt from "../../Common/Page/index.mjs";
26
- import gt from "../PageNav/index.mjs";
27
- import pt from "../Thumbnail/index.mjs";
28
- import vt from "../CompositionInput/index.mjs";
29
- import Ct from "lodash/merge";
30
- import { DEFAULT_FILTER_SWITCH as It } from "../../constant.mjs";
31
- import yt from "../DetectionStatus/index.mjs";
32
- import St from "./components/ClassificationImageModal/index.mjs";
33
- import xt from "../DetectionAnnotation/components/Labels/index.mjs";
34
- import Dt from "../PicZipImportModal/index.mjs";
35
- import { Prompt as Lt } from "../hooks/Prompt.mjs";
36
- const Jt = (L) => {
37
- var Ie, ye;
22
+ import { tagColors as Me } from "../../utils/index.mjs";
23
+ import { useKeyPress as gt } from "ahooks";
24
+ import { SearchOutlined as vt } from "@ant-design/icons";
25
+ import pt from "../../Common/Page/index.mjs";
26
+ import Ct from "../PageNav/index.mjs";
27
+ import It from "../Thumbnail/index.mjs";
28
+ import xt from "../CompositionInput/index.mjs";
29
+ import St from "lodash/merge";
30
+ import { DEFAULT_FILTER_SWITCH as yt } from "../../constant.mjs";
31
+ import Lt from "../DetectionStatus/index.mjs";
32
+ import Dt from "./components/ClassificationImageModal/index.mjs";
33
+ import Vt from "../DetectionAnnotation/components/Labels/index.mjs";
34
+ import Nt from "../PicZipImportModal/index.mjs";
35
+ import { Prompt as kt } from "../hooks/Prompt.mjs";
36
+ const Yt = (V) => {
37
+ var Le, De;
38
38
  const {
39
39
  services: c,
40
- datasetId: l,
41
- versionId: J,
42
- backTo: Te,
43
- labelManager: ne = !1,
40
+ datasetId: i,
41
+ versionId: ee,
42
+ backTo: Re,
43
+ labelManager: ae = !1,
44
44
  datasetManager: T = !1,
45
- annotation: we,
46
- header: h = {
45
+ annotation: Ae,
46
+ header: m = {
47
47
  versionSelect: !1
48
48
  }
49
- } = L, W = Ct(f({}, It), L.filterSwitch), $ = ie(null), Q = ie(null), [p, Ee] = a(), [i, j] = a(), [X, Re] = a([]), [re, se] = a(!1), [z, Me] = a(0), [q, Ae] = a(0), [d, Y] = a(""), [R, ze] = a(0), [w, ce] = a([]), [m, ee] = a([]), [ae, P] = a(!1), [B, F] = a(!1), [M, y] = a(-1), [v, S] = a(), [C, V] = a(), [I, N] = a({
49
+ } = V, q = St(u({}, yt), V.filterSwitch), _ = se(null), te = se(null), [C, ze] = a(), [l, G] = a(), [oe, Fe] = a([]), [de, fe] = a(!1), [H, Pe] = a(0), [J, Be] = a(0), [d, le] = a(""), [A, He] = a(0), [w, ue] = a([]), [b, ie] = a([]), [he, K] = a(!1), [U, z] = a(!1), [M, v] = a(-1), [I, p] = a(), [x, y] = a(), [S, N] = a({
50
50
  current: 0,
51
51
  pageSize: 100
52
- }), [H, te] = a([]), [K, Pe] = a(""), [Be, Fe] = a(), A = ie({}), [He, Ke] = a(), [de, fe] = a(!1), [ue, Ue] = a(!1), [he, Oe] = a(!0), [Ze, We] = a(!1), [U, $e] = a(""), me = () => {
53
- S(void 0), V(void 0), y(-1), P(!1), _(), setTimeout(() => {
54
- N((e) => u(f({}, e), {
52
+ }), [O, ne] = a([]), [Z, Ke] = a(""), [Ue, Oe] = a(), F = se({}), [Ze, We] = a(), [me, be] = a(!1), [ge, $e] = a(!1), [ve, je] = a(!0), [qe, _e] = a(!1), [W, Ge] = a(""), pe = () => {
53
+ p(void 0), y(void 0), v(-1), K(!1), Q(), setTimeout(() => {
54
+ N((e) => h(u({}, e), {
55
55
  current: 1,
56
56
  type: void 0
57
57
  }));
58
58
  }, 10);
59
59
  };
60
- ht("Esc", me), D(() => {
61
- l && c.cvforceDatahub.getS3Iam(l).then((e) => {
62
- Ke(e);
60
+ gt("Esc", pe), D(() => {
61
+ i && c.cvforceDatahub.getS3Iam(i).then((e) => {
62
+ We(e);
63
63
  });
64
- }, [l, c.cvforceDatahub]), D(() => {
65
- c.cvforceDatahub && c.cvforceDatahub.getOptionsImgproxy().then((e) => Fe(e));
64
+ }, [i, c.cvforceDatahub]), D(() => {
65
+ c.cvforceDatahub && c.cvforceDatahub.getOptionsImgproxy().then((e) => Oe(e));
66
66
  }, [c.cvforceDatahub]), D(() => {
67
- l && (se(!0), Promise.all([c.cvforceDatahub.getDatasetsId(l).then(Ee), c.cvforceDatahub.getDatasetsIdVersions(l, 1, 1e3).then((e) => {
68
- Re(e.recordList), j(J ? e.recordList.find((t) => t.id === J) : e.recordList[0]);
69
- })]).finally(() => se(!1)));
70
- }, [l, J]), D(() => {
67
+ i && (fe(!0), Promise.all([c.cvforceDatahub.getDatasetsId(i).then(ze), c.cvforceDatahub.getDatasetsIdVersions(i, 1, 1e3).then((e) => {
68
+ Fe(e.recordList), G(ee ? e.recordList.find((t) => t.id === ee) : e.recordList[0]);
69
+ })]).finally(() => fe(!1)));
70
+ }, [i, ee]), D(() => {
71
71
  k();
72
- }, [i == null ? void 0 : i.id, K]), D(() => {
73
- _();
74
- }, [i, d]), D(() => {
75
- !i || !p || O(u(f({}, I), {
72
+ }, [l == null ? void 0 : l.id, Z]), D(() => {
73
+ Q();
74
+ }, [l, d]), D(() => {
75
+ !l || !C || $(h(u({}, S), {
76
76
  current: 1
77
77
  }));
78
- }, [p == null ? void 0 : p.id, i == null ? void 0 : i.id, H, K]), D(() => {
79
- O().then(() => {
78
+ }, [C == null ? void 0 : C.id, l == null ? void 0 : l.id, O, Z]), D(() => {
79
+ $().then(() => {
80
80
  }), k();
81
- }, [I.current]), D(() => {
82
- B || (S(void 0), V(void 0), P(!1), y(-1), _(), k());
83
- }, [B]), D(() => {
84
- !i || !p || O(u(f({}, I), {
81
+ }, [S.current]), D(() => {
82
+ U || (p(void 0), y(void 0), K(!1), v(-1), Q(), k());
83
+ }, [U]), D(() => {
84
+ !l || !C || $(h(u({}, S), {
85
85
  current: 1,
86
86
  total: void 0
87
87
  })).then((e) => {
88
- if (!(!e || !Array.isArray(e)) && !(!v && !B))
88
+ if (!(!e || !Array.isArray(e)) && !(!I && !U))
89
89
  if (e.length > 0) {
90
- const t = A.current[d], o = t !== void 0 && t >= 0 && t < e.length ? t : 0;
91
- y(o), S(e[o]), V(void 0);
90
+ const t = F.current[d], o = t !== void 0 && t >= 0 && t < e.length ? t : 0;
91
+ v(o), p(e[o]), y(void 0);
92
92
  } else
93
- S(void 0), V(void 0), y(-1), N((t) => u(f({}, t), {
93
+ p(void 0), y(void 0), v(-1), N((t) => h(u({}, t), {
94
94
  current: 1
95
95
  }));
96
96
  });
97
97
  }, [d]), D(() => {
98
- N(d === "nocode" ? (e) => u(f({}, e), {
99
- total: z
100
- }) : d === "" ? (e) => u(f({}, e), {
101
- total: R
102
- }) : d === "pending" ? (e) => u(f({}, e), {
103
- total: q
104
- }) : (e) => u(f({}, e), {
105
- total: R - z - q
98
+ N(d === "nocode" ? (e) => h(u({}, e), {
99
+ total: H
100
+ }) : d === "" ? (e) => h(u({}, e), {
101
+ total: A
102
+ }) : d === "pending" ? (e) => h(u({}, e), {
103
+ total: J
104
+ }) : (e) => h(u({}, e), {
105
+ total: A - H - J
106
106
  }));
107
- }, [z, R, q]);
108
- const be = () => {
107
+ }, [H, A, J]);
108
+ const Ce = () => {
109
109
  var e, t;
110
- (t = (e = $.current) == null ? void 0 : e.getElementsByClassName("rc-virtual-list-holder")[0]) == null || t.scrollTo({
110
+ (t = (e = _.current) == null ? void 0 : e.getElementsByClassName("rc-virtual-list-holder")[0]) == null || t.scrollTo({
111
111
  top: 0
112
112
  });
113
- }, ge = () => {
114
- !l || !i || c.cvforceDatahub.getDatasetsIdVersionsVid(l, i.id).then((e) => {
113
+ }, Ie = () => {
114
+ !i || !l || c.cvforceDatahub.getDatasetsIdVersionsVid(i, l.id).then((e) => {
115
115
  var t, o;
116
- j(e), $e((o = (t = e.versionAsyncTask) == null ? void 0 : t.state) != null ? o : "");
116
+ G(e), Ge((o = (t = e.versionAsyncTask) == null ? void 0 : t.state) != null ? o : "");
117
117
  });
118
118
  };
119
119
  D(() => {
120
- U !== G.Pending && U !== G.Started || Z.warning("文件导入中,请刷新页面再试");
121
- }, [U]), D(() => {
122
- We(!he && ue);
123
- }, [he, ue]), D(() => {
124
- l && (i != null && i.id) && ge();
125
- }, [l, i == null ? void 0 : i.id]);
120
+ W !== Y.Pending && W !== Y.Started || j.warning("文件导入中,请刷新页面再试");
121
+ }, [W]), D(() => {
122
+ _e(!ve && ge);
123
+ }, [ve, ge]), D(() => {
124
+ i && (l != null && l.id) && Ie();
125
+ }, [i, l == null ? void 0 : l.id]);
126
126
  const k = () => {
127
- !l || !i || c.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(l, i.id, {
127
+ !i || !l || c.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(i, l.id, {
128
128
  label: "allcode",
129
- searchName: K
129
+ searchName: Z
130
130
  }).then((e) => {
131
- var s, b, g;
132
- const t = e == null ? void 0 : e.find((x) => x.id === "allcodeid"), o = e == null ? void 0 : e.find((x) => x.id === "nocodeid"), r = e == null ? void 0 : e.find((x) => x.id === "pendingid");
133
- ze((s = t == null ? void 0 : t.count) != null ? s : 0), Me((b = o == null ? void 0 : o.count) != null ? b : 0), Ae((g = r == null ? void 0 : r.count) != null ? g : 0);
131
+ var s, g, L;
132
+ const t = e == null ? void 0 : e.find((f) => f.id === "allcodeid"), o = e == null ? void 0 : e.find((f) => f.id === "nocodeid"), r = e == null ? void 0 : e.find((f) => f.id === "pendingid");
133
+ He((s = t == null ? void 0 : t.count) != null ? s : 0), Pe((g = o == null ? void 0 : o.count) != null ? g : 0), Be((L = r == null ? void 0 : r.count) != null ? L : 0);
134
134
  });
135
- }, _ = () => {
136
- if (!(!l || !(i != null && i.id)))
137
- return c.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(l, i.id, {}).then((e) => {
135
+ }, Q = () => {
136
+ if (!(!i || !(l != null && l.id)))
137
+ return c.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(i, l.id, {}).then((e) => {
138
138
  const o = (e || []).filter((r) => r.label !== "nocode").map((r, s) => ({
139
139
  label: r.label,
140
140
  count: r.count,
141
141
  id: r.id,
142
- color: ke[s % 40]
142
+ color: Me[s % 40]
143
143
  }));
144
- return ce(o), e;
144
+ return ue(o), e;
145
145
  });
146
- }, O = (e, t) => {
147
- const o = (e == null ? void 0 : e.current) || I.current, r = (e == null ? void 0 : e.pageSize) || I.pageSize;
148
- if (!l || !i || !o)
146
+ }, $ = (e, t) => {
147
+ const o = (e == null ? void 0 : e.current) || S.current, r = (e == null ? void 0 : e.pageSize) || S.pageSize;
148
+ if (!i || !l || !o)
149
149
  return Promise.resolve(!1);
150
- const s = H.map((g) => g.label), b = () => {
150
+ const s = O.map((L) => L.label), g = () => {
151
151
  switch (d) {
152
152
  case "nocode":
153
153
  return "nocode";
@@ -157,250 +157,267 @@ const Jt = (L) => {
157
157
  return s.length ? s : void 0;
158
158
  }
159
159
  };
160
- return o === 1 && be(), N((g) => u(f({}, g), {
160
+ return o === 1 && Ce(), N((L) => h(u({}, L), {
161
161
  current: o,
162
162
  pageSize: r
163
- })), c.cvforceDatahub.getDatasetsIdVersionsVidSamples(l, i.id, {
163
+ })), c.cvforceDatahub.getDatasetsIdVersionsVidSamples(i, l.id, {
164
164
  pageNo: o,
165
165
  pageSize: r,
166
- labels: b(),
167
- searchName: K
168
- }).then((g) => {
169
- const x = g.recordList || [], Se = o === 1 ? x : [...t || m, ...x];
170
- return ee(Se), N((Qe) => u(f({}, Qe), {
166
+ labels: g(),
167
+ searchName: Z
168
+ }).then((L) => {
169
+ const f = L.recordList || [], R = o === 1 ? f : [...t || b, ...f];
170
+ return ie(R), N((X) => h(u({}, X), {
171
171
  current: o,
172
172
  pageSize: r,
173
- total: g.totalResults
174
- })), (e == null ? void 0 : e.type) === "next" && x.length && (y(0), S(x[0])), (e == null ? void 0 : e.type) === "prev" && x.length && (y(r - 1), S(x[x.length - 1])), ae && M < 0 && x.length && (y(0), S(x[0]), F(!0)), Se;
173
+ total: L.totalResults
174
+ })), (e == null ? void 0 : e.type) === "next" && f.length && (v(0), p(f[0])), (e == null ? void 0 : e.type) === "prev" && f.length && (v(r - 1), p(f[f.length - 1])), he && M < 0 && f.length && (v(0), p(f[0]), z(!0)), R;
175
175
  }).catch(() => !1);
176
- }, je = (e) => {
177
- m && (P(!1), y(e), S(m[e]), V(void 0), F(!0), d !== void 0 && (A.current[d] = e));
176
+ }, Je = (e) => {
177
+ b && (K(!1), v(e), p(b[e]), y(void 0), z(!0), d !== void 0 && (F.current[d] = e));
178
178
  };
179
179
  D(() => {
180
180
  var t, o, r;
181
- if (!C)
181
+ if (!x)
182
182
  return;
183
183
  const e = [];
184
- (t = C.labels) == null || t.forEach((s) => {
185
- w != null && w.find((b) => b.id === s.id) && e.push(s);
186
- }), e.length !== ((r = (o = C.labels) == null ? void 0 : o.length) != null ? r : 0) && V(u(f({}, C), {
184
+ (t = x.labels) == null || t.forEach((s) => {
185
+ w != null && w.find((g) => g.id === s.id) && e.push(s);
186
+ }), e.length !== ((r = (o = x.labels) == null ? void 0 : o.length) != null ? r : 0) && y(h(u({}, x), {
187
187
  labels: e
188
188
  }));
189
189
  }, [w]);
190
- const oe = () => {
191
- if (!i)
190
+ const re = () => {
191
+ if (!l)
192
192
  return Promise.resolve(!1);
193
- const e = C != null ? C : v;
194
- if (!e || !C)
193
+ const e = x != null ? x : I;
194
+ if (!e || !x)
195
195
  return Promise.resolve(!0);
196
- const t = (v == null ? void 0 : v.labels) || [], o = (C.labels || []).filter((s) => !!s.id);
197
- if (t.length === o.length && o.every((s, b) => {
198
- var g;
199
- return ((g = t[b]) == null ? void 0 : g.id) === s.id;
196
+ const t = (I == null ? void 0 : I.labels) || [], o = (x.labels || []).filter((s) => !!s.id);
197
+ if (t.length === o.length && o.every((s, g) => {
198
+ var L;
199
+ return ((L = t[g]) == null ? void 0 : L.id) === s.id;
200
200
  }))
201
201
  return Promise.resolve(!0);
202
- const r = u(f({}, e), {
202
+ const r = h(u({}, e), {
203
203
  labels: o.map((s) => {
204
- var b;
205
- return u(f({}, s), {
206
- box: (b = s.box) != null ? b : []
204
+ var g;
205
+ return h(u({}, s), {
206
+ box: (g = s.box) != null ? g : []
207
207
  });
208
- })
208
+ }),
209
+ isLabeled: o.length > 0
209
210
  });
210
- return c.cvforceDatahub.updateSamples(l, i.id, [r]).then(() => (Z.success({
211
- content: "保存成功"
212
- }), ee((s) => {
213
- const b = s.findIndex((g) => g.id === r.id);
214
- if (b > -1) {
215
- const g = [...s];
216
- return g[b] = r, g;
217
- }
218
- return s;
219
- }), S(r), V(r), !0)).catch(() => !1);
220
- }, pe = () => {
221
- m && oe().then((e) => {
211
+ return c.cvforceDatahub.updateSamples(i, l.id, [r]).then(() => {
212
+ var g, L;
213
+ j.success({
214
+ content: "保存成功"
215
+ });
216
+ const s = d === "nocode" && ((g = r.labels) == null ? void 0 : g.length) || d === "hascode" && !((L = r.labels) != null && L.length);
217
+ return ie((f) => {
218
+ const R = f.findIndex((P) => P.id === r.id);
219
+ if (R === -1)
220
+ return f;
221
+ if (s) {
222
+ const P = f.slice(0, R).concat(f.slice(R + 1));
223
+ if (N((B) => h(u({}, B), {
224
+ total: B.total != null ? Math.max(0, B.total - 1) : void 0
225
+ })), P.length === 0)
226
+ p(void 0), y(void 0), v(-1), z(!1);
227
+ else {
228
+ const B = Math.min(M, P.length - 1), Ve = P[B];
229
+ Ve != null && (p(Ve), v(B), y(void 0));
230
+ }
231
+ return P;
232
+ }
233
+ const X = [...f];
234
+ return X[R] = r, X;
235
+ }), s || (p(r), y(r)), !0;
236
+ }).catch(() => !1);
237
+ }, xe = () => {
238
+ b && re().then((e) => {
222
239
  if (!e)
223
240
  return;
224
241
  k();
225
242
  const t = M + 1;
226
- t >= m.length ? I.total != null && t >= I.total ? Z.error("已经是最后一个了") : O({
227
- current: I.current + 1,
228
- pageSize: I.pageSize,
243
+ t >= b.length ? S.total != null && t >= S.total ? j.error("已经是最后一个了") : $({
244
+ current: S.current + 1,
245
+ pageSize: S.pageSize,
229
246
  type: "next"
230
- }, m).then((o) => {
231
- Array.isArray(o) && (y(t), S(o[t]), V(void 0), d !== void 0 && (A.current[d] = t));
247
+ }, b).then((o) => {
248
+ Array.isArray(o) && (v(t), p(o[t]), y(void 0), d !== void 0 && (F.current[d] = t));
232
249
  }) : setTimeout(() => {
233
- y(t), S(m[t]), V(void 0), d !== void 0 && (A.current[d] = t);
250
+ v(t), p(b[t]), y(void 0), d !== void 0 && (F.current[d] = t);
234
251
  }, 200);
235
252
  });
236
- }, qe = () => {
237
- m && oe().then((e) => {
253
+ }, Qe = () => {
254
+ b && re().then((e) => {
238
255
  if (!e)
239
256
  return;
240
257
  k();
241
258
  const t = M - 1;
242
- t < 0 ? Z.error("已经是第一个了") : setTimeout(() => {
243
- y(t), S(m[t]), V(void 0), d !== void 0 && (A.current[d] = t);
259
+ t < 0 ? j.error("已经是第一个了") : setTimeout(() => {
260
+ v(t), p(b[t]), y(void 0), d !== void 0 && (F.current[d] = t);
244
261
  }, 200);
245
262
  });
246
- }, _e = () => {
263
+ }, Xe = () => {
247
264
  var e;
248
- if ((e = C == null ? void 0 : C.labels) != null && e.some((t) => !t.id))
249
- return Z.error("请选择标签"), Promise.resolve(!1);
250
- pe();
251
- }, Ge = () => {
252
- ct.confirm({
265
+ if ((e = x == null ? void 0 : x.labels) != null && e.some((t) => !t.id))
266
+ return j.error("请选择标签"), Promise.resolve(!1);
267
+ xe();
268
+ }, Ye = () => {
269
+ ft.confirm({
253
270
  title: "确认要删除当前数据吗?",
254
271
  content: "数据包含当前标注的内容和图片,删除后无法恢复,请确认是否删除!",
255
272
  onOk: () => {
256
- !v || !i || c.cvforceDatahub.delDatasetsIdVersionsVidSamplesId(l, i.id, v.id).then(() => {
257
- const e = m.findIndex((o) => o.id === v.id), t = [...m];
258
- if (t.splice(e, 1), ee(t), N((o) => u(f({}, o), {
273
+ !I || !l || c.cvforceDatahub.delDatasetsIdVersionsVidSamplesId(i, l.id, I.id).then(() => {
274
+ const e = b.findIndex((o) => o.id === I.id), t = [...b];
275
+ if (t.splice(e, 1), ie(t), N((o) => h(u({}, o), {
259
276
  total: o.total != null ? o.total - 1 : 0
260
277
  })), t.length > 0) {
261
278
  const o = e < t.length ? e : e - 1;
262
- S(t[o]), y(o);
279
+ p(t[o]), v(o);
263
280
  } else
264
- S(void 0), V(void 0), y(-1), F(!1), N((o) => u(f({}, o), {
281
+ p(void 0), y(void 0), v(-1), z(!1), N((o) => h(u({}, o), {
265
282
  current: 1
266
283
  }));
267
- V(void 0), k();
284
+ y(void 0), k();
268
285
  });
269
286
  }
270
287
  });
271
- }, ve = (e) => {
272
- M >= 0 && d !== void 0 && d !== null && (A.current[d] = M), C ? oe().then((t) => {
273
- t && (Y(e), k());
274
- }) : (N((t) => u(f({}, t), {
288
+ }, Se = (e) => {
289
+ M >= 0 && d !== void 0 && d !== null && (F.current[d] = M), x ? re().then((t) => {
290
+ t && (le(e), k());
291
+ }) : (N((t) => h(u({}, t), {
275
292
  current: 1,
276
293
  total: void 0
277
- })), Y(e)), e === "nocode" && te([]);
278
- }, Ce = [{
294
+ })), le(e)), e === "nocode" && ne([]);
295
+ }, ye = [{
279
296
  key: "",
280
- label: `全部(${R})`,
297
+ label: `全部(${A})`,
281
298
  children: null
282
299
  }, {
283
300
  key: "nocode",
284
- label: `未标注(${z})`,
301
+ label: `未标注(${H})`,
285
302
  children: null
286
303
  }, {
287
304
  key: "hascode",
288
- label: `已标注(${R - z - q})`,
305
+ label: `已标注(${A - H - J})`,
289
306
  children: null
290
- }], Je = (e) => {
307
+ }], et = (e) => {
291
308
  var o;
292
309
  const t = e.currentTarget;
293
- (I.total == null || I.total > m.length) && t.scrollHeight - t.scrollTop === ((o = $.current) == null ? void 0 : o.clientHeight) && N((r) => u(f({}, r), {
310
+ (S.total == null || S.total > b.length) && t.scrollHeight - t.scrollTop === ((o = _.current) == null ? void 0 : o.clientHeight) && N((r) => h(u({}, r), {
294
311
  current: r.current + 1
295
312
  }));
296
313
  };
297
- return /* @__PURE__ */ n(it, {
298
- locale: dt,
299
- children: /* @__PURE__ */ n(ft.Provider, {
314
+ return /* @__PURE__ */ n(rt, {
315
+ locale: ht,
316
+ children: /* @__PURE__ */ n(mt.Provider, {
300
317
  value: {
301
- datasetId: l,
302
- versionId: (i == null ? void 0 : i.id) || "",
303
- no: (i == null ? void 0 : i.no) || "",
304
- loading: re,
305
- version: i,
306
- versions: X,
307
- samples: m,
308
- pagination: I,
318
+ datasetId: i,
319
+ versionId: (l == null ? void 0 : l.id) || "",
320
+ no: (l == null ? void 0 : l.no) || "",
321
+ loading: de,
322
+ version: l,
323
+ versions: oe,
324
+ samples: b,
325
+ pagination: S,
309
326
  services: c,
310
327
  featuresConfig: {
311
- labelManager: ne,
328
+ labelManager: ae,
312
329
  datasetManager: T,
313
- annotation: we,
314
- filterSwitch: W,
315
- header: h,
316
- exampleSrcRoot: L.exampleSrcRoot
330
+ annotation: Ae,
331
+ filterSwitch: q,
332
+ header: m,
333
+ exampleSrcRoot: V.exampleSrcRoot
317
334
  }
318
335
  },
319
- children: p ? p.markType === "classification" ? /* @__PURE__ */ n("div", {
336
+ children: C ? C.markType === "classification" ? /* @__PURE__ */ n("div", {
320
337
  className: "classification-version-detail",
321
- children: /* @__PURE__ */ E(bt, {
338
+ children: /* @__PURE__ */ E(pt, {
322
339
  className: "product-details-page",
323
- header: h !== !1 ? /* @__PURE__ */ n(gt, {
324
- backTo: Te,
325
- onBackClick: h != null && h.onBackClick ? () => {
340
+ header: m !== !1 ? /* @__PURE__ */ n(Ct, {
341
+ backTo: Re,
342
+ onBackClick: m != null && m.onBackClick ? () => {
326
343
  var e;
327
- v && me(), (e = h == null ? void 0 : h.onBackClick) == null || e.call(h);
344
+ I && pe(), (e = m == null ? void 0 : m.onBackClick) == null || e.call(m);
328
345
  } : void 0,
329
- left: !re && /* @__PURE__ */ E(le, {
346
+ left: !de && /* @__PURE__ */ E(ce, {
330
347
  children: [/* @__PURE__ */ n("span", {
331
348
  style: {
332
349
  fontWeight: "bold"
333
350
  },
334
- children: p == null ? void 0 : p.name
335
- }), /* @__PURE__ */ n(lt, {
336
- disabled: (h == null ? void 0 : h.versionSelect) === !1,
337
- value: i == null ? void 0 : i.id,
351
+ children: C == null ? void 0 : C.name
352
+ }), /* @__PURE__ */ n(st, {
353
+ disabled: (m == null ? void 0 : m.versionSelect) === !1,
354
+ value: l == null ? void 0 : l.id,
338
355
  style: {
339
356
  width: 70
340
357
  },
341
- options: X.map((e) => ({
358
+ options: oe.map((e) => ({
342
359
  label: e.no,
343
360
  value: e.id
344
361
  })),
345
362
  onChange: (e) => {
346
363
  var o;
347
- const t = X.find((r) => r.id === e);
348
- t && (j(t), (o = h == null ? void 0 : h.onVersionChange) == null || o.call(h, t));
364
+ const t = oe.find((r) => r.id === e);
365
+ t && (G(t), (o = m == null ? void 0 : m.onVersionChange) == null || o.call(m, t));
349
366
  }
350
367
  })]
351
368
  }),
352
- right: /* @__PURE__ */ E(le, {
353
- children: [!v && T && T.add && /* @__PURE__ */ n(Le, {
369
+ right: /* @__PURE__ */ E(ce, {
370
+ children: [!I && T && T.add && /* @__PURE__ */ n(Te, {
354
371
  type: "default",
355
- onClick: () => fe(!0),
356
- disabled: U === G.Pending || U === G.Started,
372
+ onClick: () => be(!0),
373
+ disabled: W === Y.Pending || W === Y.Started,
357
374
  children: "导入数据"
358
- }), !v && T && T.label && /* @__PURE__ */ n(Le, {
375
+ }), !I && T && T.label && /* @__PURE__ */ n(Te, {
359
376
  type: "primary",
360
377
  onClick: () => {
361
- v || Y("nocode"), P(!0), y(-1), d === "nocode" && (m != null && m.length) && (y(0), S(m[0])), F(!0);
378
+ I || le("nocode"), K(!0), v(-1), d === "nocode" && (b != null && b.length) && (v(0), p(b[0])), z(!0);
362
379
  },
363
380
  children: "开始标注"
364
- }), /* @__PURE__ */ n(Lt, {
365
- when: Ze,
381
+ }), /* @__PURE__ */ n(kt, {
382
+ when: qe,
366
383
  content: "确认要离开此页面吗?",
367
384
  subContent: "离开此页面后,将结束导入,放弃未上传的文件,请谨慎操作!"
368
- }), de && /* @__PURE__ */ n(Dt, {
369
- datasetIam: He,
370
- datasetId: l,
371
- currentVersion: i,
372
- tenCode: p == null ? void 0 : p.tenantCode,
373
- isVisible: de,
374
- setIsVisible: fe,
385
+ }), me && /* @__PURE__ */ n(Nt, {
386
+ datasetIam: Ze,
387
+ datasetId: i,
388
+ currentVersion: l,
389
+ tenCode: C == null ? void 0 : C.tenantCode,
390
+ isVisible: me,
391
+ setIsVisible: be,
375
392
  getVersionListRequest: k,
376
- setIsConfirm: Oe,
393
+ setIsConfirm: je,
377
394
  onUploadStatusChange: (e) => {
378
- Ue(e);
395
+ $e(e);
379
396
  },
380
397
  tableReload: () => {
381
398
  var e;
382
- i != null && i.id && (be(), O(u(f({}, I), {
399
+ l != null && l.id && (Ce(), $(h(u({}, S), {
383
400
  current: 1
384
- })), (e = Q.current) == null || e.fetchLabels());
401
+ })), (e = te.current) == null || e.fetchLabels());
385
402
  },
386
- loadVersionData: ge,
387
- markType: p == null ? void 0 : p.markType
403
+ loadVersionData: Ie,
404
+ markType: C == null ? void 0 : C.markType
388
405
  })]
389
406
  })
390
407
  }) : void 0,
391
408
  children: [/* @__PURE__ */ n("div", {
392
409
  className: "detection-header",
393
- children: /* @__PURE__ */ E(le, {
394
- children: [W.tabs && /* @__PURE__ */ n(nt, {
410
+ children: /* @__PURE__ */ E(ce, {
411
+ children: [q.tabs && /* @__PURE__ */ n(ct, {
395
412
  className: "header-tab",
396
413
  activeKey: d,
397
- items: Ce,
398
- onChange: ve
399
- }), !v && W.search && /* @__PURE__ */ n(vt, {
414
+ items: ye,
415
+ onChange: Se
416
+ }), !I && q.search && /* @__PURE__ */ n(xt, {
400
417
  placeholder: "请输入图片名称搜索",
401
- suffix: /* @__PURE__ */ n(mt, {}),
402
- value: K,
403
- onChange: Pe,
418
+ suffix: /* @__PURE__ */ n(vt, {}),
419
+ value: Z,
420
+ onChange: Ke,
404
421
  allowClear: !0
405
422
  })]
406
423
  })
@@ -408,65 +425,65 @@ const Jt = (L) => {
408
425
  className: "d-row",
409
426
  children: [/* @__PURE__ */ E("div", {
410
427
  className: "d-right",
411
- ref: $,
412
- children: [B && /* @__PURE__ */ n(St, {
413
- datasetId: l,
414
- isImageDetailVisible: B,
415
- setIsImageDetailVisible: F,
416
- currentSample: C != null ? C : v,
428
+ ref: _,
429
+ children: [U && /* @__PURE__ */ n(Dt, {
430
+ datasetId: i,
431
+ isImageDetailVisible: U,
432
+ setIsImageDetailVisible: z,
433
+ currentSample: x != null ? x : I,
417
434
  labels: w,
418
- previewMode: !ae,
419
- filterItems: Ce,
435
+ previewMode: !he,
436
+ filterItems: ye,
420
437
  filterMode: d,
421
- onFilterChange: ve,
422
- onChange: V,
423
- onNextClick: pe,
424
- onPrevClick: qe,
425
- onSave: _e,
426
- onEnterEdit: () => P(!0),
427
- onDeleteSample: Ge,
438
+ onFilterChange: Se,
439
+ onChange: y,
440
+ onNextClick: xe,
441
+ onPrevClick: Qe,
442
+ onSave: Xe,
443
+ onEnterEdit: () => K(!0),
444
+ onDeleteSample: Ye,
428
445
  onRefresh: () => {
429
446
  var e, t;
430
- (e = _()) == null || e.then(() => k()), (t = Q.current) == null || t.fetchLabels();
447
+ (e = Q()) == null || e.then(() => k()), (t = te.current) == null || t.fetchLabels();
431
448
  },
432
449
  isPreLabel: !1,
433
450
  imgCount: {
434
- total: R,
451
+ total: A,
435
452
  index: M + 1
436
453
  },
437
- settingHide: !ne,
454
+ settingHide: !ae,
438
455
  canLabel: !!(T && T.label),
439
456
  canDelete: !!(T && T.delete)
440
- }), v ? /* @__PURE__ */ n("div", {}) : I.total !== void 0 && I.total > 0 ? /* @__PURE__ */ n(at, {
457
+ }), I ? /* @__PURE__ */ n("div", {}) : S.total !== void 0 && S.total > 0 ? /* @__PURE__ */ n(ut, {
441
458
  innerProps: {
442
459
  className: "d-right-row"
443
460
  },
444
- data: m,
461
+ data: b,
445
462
  itemKey: "id",
446
- height: (ye = (Ie = $.current) == null ? void 0 : Ie.clientHeight) != null ? ye : 600,
447
- onScroll: Je,
463
+ height: (De = (Le = _.current) == null ? void 0 : Le.clientHeight) != null ? De : 600,
464
+ onScroll: et,
448
465
  children: (e, t) => {
449
466
  var o;
450
- return /* @__PURE__ */ n(rt, {
467
+ return /* @__PURE__ */ n(at, {
451
468
  className: "d-right-col",
452
- onClick: () => je(t),
469
+ onClick: () => Je(t),
453
470
  children: /* @__PURE__ */ E("div", {
454
471
  className: "right-col-wrapper",
455
472
  children: [/* @__PURE__ */ n("div", {
456
473
  className: "detection-status-wrapper",
457
- children: /* @__PURE__ */ n(yt, {
474
+ children: /* @__PURE__ */ n(Lt, {
458
475
  sample: e
459
476
  })
460
477
  }), /* @__PURE__ */ n("div", {
461
478
  className: "right-col-img",
462
- children: /* @__PURE__ */ n(pt, {
479
+ children: /* @__PURE__ */ n(It, {
463
480
  fileKey: e.fileKey,
464
481
  width: 124,
465
- imgProxy: Be
482
+ imgProxy: Ue
466
483
  })
467
484
  }), /* @__PURE__ */ E("div", {
468
485
  className: "right-col-text",
469
- children: [(o = e.labels) != null && o.length ? /* @__PURE__ */ n(st, {
486
+ children: [(o = e.labels) != null && o.length ? /* @__PURE__ */ n(dt, {
470
487
  placement: "top",
471
488
  title: e.labels[0].label,
472
489
  children: /* @__PURE__ */ n("span", {
@@ -494,30 +511,30 @@ const Jt = (L) => {
494
511
  }
495
512
  }) : /* @__PURE__ */ n("div", {
496
513
  className: "empty",
497
- children: I.total === 0 ? /* @__PURE__ */ n(Ve, {
498
- image: ut,
514
+ children: S.total === 0 ? /* @__PURE__ */ n(we, {
515
+ image: bt,
499
516
  description: "暂无数据"
500
- }) : /* @__PURE__ */ n(Ne, {})
517
+ }) : /* @__PURE__ */ n(Ee, {})
501
518
  })]
502
- }), d !== "nocode" && !v && W.labels && /* @__PURE__ */ n("div", {
519
+ }), d !== "nocode" && !I && q.labels && /* @__PURE__ */ n("div", {
503
520
  className: "d-sider",
504
- children: /* @__PURE__ */ n(xt, {
505
- ref: Q,
506
- datasetId: l,
521
+ children: /* @__PURE__ */ n(Vt, {
522
+ ref: te,
523
+ datasetId: i,
507
524
  data: w || [],
508
- selected: H,
525
+ selected: O,
509
526
  onSelectedChange: (e) => {
510
- te((w == null ? void 0 : w.filter((t) => e.find((o) => o.label === t.label))) || []);
527
+ ne((w == null ? void 0 : w.filter((t) => e.find((o) => o.label === t.label))) || []);
511
528
  },
512
529
  onListChange: () => {
513
- i && (c.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(l, i.id, {}).then((e) => {
514
- const o = (e || []).filter((s) => s.label !== "nocode").map((s, b) => ({
530
+ l && (c.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(i, l.id, {}).then((e) => {
531
+ const o = (e || []).filter((s) => s.label !== "nocode").map((s, g) => ({
515
532
  label: s.label,
516
533
  count: s.count,
517
534
  id: s.id,
518
- color: ke[b % 40]
519
- })), r = H.filter((s) => o.some((b) => b.id === s.id));
520
- ce(o), H.length !== r.length && te(r);
535
+ color: Me[g % 40]
536
+ })), r = O.filter((s) => o.some((g) => g.id === s.id));
537
+ ue(o), O.length !== r.length && ne(r);
521
538
  }), k());
522
539
  },
523
540
  isPreLabel: !1
@@ -527,16 +544,16 @@ const Jt = (L) => {
527
544
  })
528
545
  }) : /* @__PURE__ */ n("div", {
529
546
  className: "empty",
530
- children: /* @__PURE__ */ n(Ve, {
547
+ children: /* @__PURE__ */ n(we, {
531
548
  description: "当前数据集不是 classification(图像分类) 类型"
532
549
  })
533
550
  }) : /* @__PURE__ */ n("div", {
534
551
  className: "empty",
535
- children: /* @__PURE__ */ n(Ne, {})
552
+ children: /* @__PURE__ */ n(Ee, {})
536
553
  })
537
554
  })
538
555
  });
539
556
  };
540
557
  export {
541
- Jt as default
558
+ Yt as default
542
559
  };