@glodon-aiot/dataset-annotation 3.16.0-alpha.37 → 3.16.0-alpha.39

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,373 +1,394 @@
1
- var xe = Object.defineProperty, ye = Object.defineProperties;
2
- var Le = Object.getOwnPropertyDescriptors;
3
- var re = Object.getOwnPropertySymbols;
4
- var Ve = Object.prototype.hasOwnProperty, Pe = Object.prototype.propertyIsEnumerable;
5
- var oe = (f, n, r) => n in f ? xe(f, n, { enumerable: !0, configurable: !0, writable: !0, value: r }) : f[n] = r, h = (f, n) => {
6
- for (var r in n || (n = {}))
7
- Ve.call(n, r) && oe(f, r, n[r]);
8
- if (re)
9
- for (var r of re(n))
10
- Pe.call(n, r) && oe(f, r, n[r]);
11
- return f;
12
- }, C = (f, n) => ye(f, Le(n));
13
- import { jsx as c, jsxs as D } from "react/jsx-runtime";
14
- import { useState as a, useEffect as m } from "react";
15
- import { message as $, ConfigProvider as Re, Space as x, Select as Ne, Tabs as Oe, Tooltip as we, Button as ze, Row as Be, Col as Ke, Pagination as Ae } from "antd";
16
- import Ee from "antd/es/locale/zh_CN";
1
+ var Ve = Object.defineProperty, Le = Object.defineProperties;
2
+ var Re = Object.getOwnPropertyDescriptors;
3
+ var ie = Object.getOwnPropertySymbols;
4
+ var Oe = Object.prototype.hasOwnProperty, Pe = Object.prototype.propertyIsEnumerable;
5
+ var ne = (p, c, i) => c in p ? Ve(p, c, { enumerable: !0, configurable: !0, writable: !0, value: i }) : p[c] = i, m = (p, c) => {
6
+ for (var i in c || (c = {}))
7
+ Oe.call(c, i) && ne(p, i, c[i]);
8
+ if (ie)
9
+ for (var i of ie(c))
10
+ Pe.call(c, i) && ne(p, i, c[i]);
11
+ return p;
12
+ }, C = (p, c) => Le(p, Re(c));
13
+ import { jsx as l, jsxs as x } from "react/jsx-runtime";
14
+ import { useState as s, useEffect as h } from "react";
15
+ import { message as H, ConfigProvider as we, Space as y, Select as Ne, Tabs as ze, Tooltip as Ke, Button as Be, Row as Ee, Col as Ae, Pagination as Fe } from "antd";
16
+ import Ue from "antd/es/locale/zh_CN";
17
17
  import "./style.less.mjs";
18
- import Fe from "./OcrModal/index.mjs";
19
- import Ue from "./MarkKVOCRModal/index.mjs";
20
- import Ze from "./MarkOCRBoxModal/index.mjs";
21
- import $e from "./PreLabelOCR/index.mjs";
22
- import je from "lodash/merge";
23
- import { UploadZipsStatus as ie, PreLabelTaskStatus as We } from "@glodon-aiot/apis";
24
- import _e from "../../Common/Page/index.mjs";
25
- import He from "../Thumbnail/index.mjs";
26
- import Je from "../DataEmpty/index.mjs";
27
- import Qe from "../../DatasetContext/index.mjs";
28
- import { DEFAULT_FILTER_SWITCH as qe } from "../../constant.mjs";
29
- import Ge from "../PageNav/index.mjs";
30
- const gt = (f) => {
18
+ import Ze from "./OcrModal/index.mjs";
19
+ import $e from "./MarkKVOCRModal/index.mjs";
20
+ import je from "./MarkOCRBoxModal/index.mjs";
21
+ import We from "./PreLabelOCR/index.mjs";
22
+ import _e from "lodash/merge";
23
+ import { UploadZipsStatus as ce, PreLabelTaskStatus as He } from "@glodon-aiot/apis";
24
+ import Je from "../../Common/Page/index.mjs";
25
+ import Qe from "../Thumbnail/index.mjs";
26
+ import qe from "../DataEmpty/index.mjs";
27
+ import Ge from "../../DatasetContext/index.mjs";
28
+ import { DEFAULT_FILTER_SWITCH as Xe } from "../../constant.mjs";
29
+ import Ye from "../PageNav/index.mjs";
30
+ const Ct = (p) => {
31
31
  const {
32
- services: n,
33
- datasetId: r,
34
- versionId: S,
35
- backTo: ne,
36
- labelManager: ce = !1,
37
- datasetManager: T = !1,
38
- annotation: le,
39
- header: d = {
32
+ services: c,
33
+ datasetId: i,
34
+ versionId: z,
35
+ backTo: le,
36
+ labelManager: ae = !1,
37
+ datasetManager: v = !1,
38
+ annotation: se,
39
+ header: f = {
40
40
  versionSelect: !1
41
41
  },
42
- exampleSrcRoot: ae
43
- } = f, [i, R] = a(), [t, I] = a(), [y, j] = a([]), [W, L] = a(!1), [N, O] = a(!1), [g, _] = a(0), [u, H] = a(), [w, b] = a(), [se, J] = a(), [Q, M] = a(-1), [l, k] = a({
42
+ exampleSrcRoot: de
43
+ } = p, [o, ue] = s(), [t, K] = s(), [D, fe] = s([]), [J, Q] = s(!1), [V, L] = s(!1), [M, q] = s(0), [d, B] = s(), [I, g] = s(), [G, R] = s(), [E, T] = s(-1), [a, k] = s({
44
44
  current: 1,
45
45
  pageSize: 50
46
- }), [V, q] = a(0), [v, de] = a(""), [G, z] = a(!1), [X, Y] = a(), [B, ee] = a(!1), [P, K] = a(null), [ue, te] = a(!1), [fe, pe] = a(!1), [A, me] = a(""), [he, ge] = a(), E = h({}, qe);
47
- je(E, f.filterSwitch);
48
- const be = () => {
49
- J(void 0), z(!0);
50
- }, ke = (e, o) => {
46
+ }), [O, X] = s(0), [S, A] = s(""), [Y, F] = s(!1), [ee, te] = s(), [U, oe] = s(!1), [P, Z] = s(null), [pe, re] = s(!1), [me, he] = s(!1), [$, ge] = s(""), [be, Ce] = s(), [j, w] = s("preview"), W = m({}, Xe);
47
+ _e(W, p.filterSwitch);
48
+ const ke = () => {
49
+ R(void 0), (o == null ? void 0 : o.ocrMarkTmpl) === "StructKVCOCR" ? F(!0) : (w("annotation"), L(!0), A("nocode"));
50
+ }, Se = (e, r) => {
51
51
  k({
52
52
  current: e,
53
- pageSize: o
53
+ pageSize: r
54
54
  });
55
- }, Ce = (e) => {
56
- if (!u)
55
+ }, Me = (e) => {
56
+ if (!d)
57
57
  return;
58
- M(e);
59
- const o = u[e];
60
- b(o), O(!0);
58
+ T(e);
59
+ const r = d[e];
60
+ g(r), w("preview"), L(!0);
61
61
  };
62
- m(() => {
63
- n.cvforceDatahub && n.cvforceDatahub.getOptionsImgproxy().then((e) => ge(e));
64
- }, [n.cvforceDatahub]), m(() => {
65
- !r || t || (L(!0), Promise.all([
62
+ h(() => {
63
+ c.cvforceDatahub && c.cvforceDatahub.getOptionsImgproxy().then((e) => Ce(e));
64
+ }, [c.cvforceDatahub]), h(() => {
65
+ i && (Q(!0), Promise.all([
66
66
  // 数据集
67
- n.cvforceDatahub.getDatasetsId(r).then((e) => {
68
- R(e);
67
+ c.cvforceDatahub.getDatasetsId(i).then((e) => {
68
+ ue(e);
69
69
  }),
70
70
  // 版本列表
71
- n.cvforceDatahub.getDatasetsIdVersions(r, 1, 1e3).then((e) => {
72
- j(e.recordList), I(S ? e.recordList.find((o) => o.id === S) : e.recordList[0]);
71
+ c.cvforceDatahub.getDatasetsIdVersions(i, 1, 1e3).then((e) => {
72
+ fe(e.recordList), K(z ? e.recordList.find((r) => r.id === z) : e.recordList[0]);
73
73
  })
74
- ]).finally(() => L(!1)));
75
- }, [r, t == null ? void 0 : t.id]), m(() => {
76
- r && (L(!0), Promise.all([
77
- // 数据集
78
- n.cvforceDatahub.getDatasetsId(r).then((e) => {
79
- R(e);
80
- }),
81
- // 版本列表
82
- n.cvforceDatahub.getDatasetsIdVersions(r, 1, 1e3).then((e) => {
83
- j(e.recordList), I(S ? e.recordList.find((o) => o.id === S) : e.recordList[0]);
84
- })
85
- ]).finally(() => L(!1)));
86
- }, [r, S]), m(() => {
87
- r && n.cvforceDatahub.getDatasetsId(r).then((e) => {
88
- R(e);
89
- });
90
- }, []);
91
- const Se = () => {
92
- !r || !t || n.cvforceDatahub.getDatasetsIdVersionsVid(r, t.id).then((e) => {
93
- me(e.versionAsyncTask.state);
74
+ ]).finally(() => Q(!1)));
75
+ }, [i, z]);
76
+ const Te = () => {
77
+ !i || !t || c.cvforceDatahub.getDatasetsIdVersionsVid(i, t.id).then((e) => {
78
+ ge(e.versionAsyncTask.state);
94
79
  });
95
80
  };
96
- m(() => {
97
- Se();
98
- }, [r, t == null ? void 0 : t.id]), m(() => {
99
- A !== ie.Pending && A !== ie.Started || $.warning("文件导入中,请刷新页面再试");
100
- }, [A]);
101
- const Te = () => {
102
- !r || !t || n.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(r, t.id).then((e) => {
103
- const o = e.find((p) => p.id === "allcodeid"), s = e.find((p) => p.id === "nocodeid");
104
- _(o ? o.count : 0), q(s ? s.count : 0);
81
+ h(() => {
82
+ Te();
83
+ }, [i, t == null ? void 0 : t.id]), h(() => {
84
+ $ !== ce.Pending && $ !== ce.Started || H.warning("文件导入中,请刷新页面再试");
85
+ }, [$]);
86
+ const xe = () => {
87
+ !i || !t || c.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(i, t.id).then((e) => {
88
+ const r = e.find((u) => u.id === "allcodeid"), n = e.find((u) => u.id === "nocodeid");
89
+ q(r ? r.count : 0), X(n ? n.count : 0);
105
90
  });
106
- }, F = () => {
107
- const e = l.current || 1, o = l.pageSize || 50;
108
- !r || !t || (n.cvforceDatahub.getDatasetsIdVersionsVidSamples(r, t.id, {
109
- labels: v || void 0,
91
+ }, N = () => {
92
+ const e = a.current || 1, r = a.pageSize || 50;
93
+ !i || !t || (c.cvforceDatahub.getDatasetsIdVersionsVidSamples(i, t.id, {
94
+ labels: S || void 0,
110
95
  pageNo: e,
111
- pageSize: o
112
- }).then((s) => {
113
- const p = s.recordList || [];
114
- if (!p.length && s.totalResults > 0) {
115
- k(C(h({}, l), {
116
- current: Math.ceil(s.totalResults / o)
117
- })), Math.ceil(s.totalResults / o) === e && H([]);
96
+ pageSize: r
97
+ }).then((n) => {
98
+ const u = n.recordList || [];
99
+ if (!u.length && n.totalResults > 0) {
100
+ k(C(m({}, a), {
101
+ current: Math.ceil(n.totalResults / r)
102
+ })), Math.ceil(n.totalResults / r) === e && B([]);
118
103
  return;
119
104
  }
120
- if (H(p), k(C(h({}, l), {
121
- total: s.totalResults
122
- })), l.type === "next" && p.length) {
123
- M(0);
124
- const Z = s.recordList[0];
125
- b(Z);
105
+ if (B(u), k(C(m({}, a), {
106
+ total: n.totalResults
107
+ })), a.type === "next" && u.length) {
108
+ T(0);
109
+ const b = n.recordList[0];
110
+ g(b);
126
111
  }
127
- if (l.type === "prev" && p.length) {
128
- M(l.pageSize - 1);
129
- const Z = s.recordList[l.pageSize - 1];
130
- b(Z);
112
+ if (a.type === "prev" && u.length) {
113
+ T(a.pageSize - 1);
114
+ const b = n.recordList[a.pageSize - 1];
115
+ g(b);
131
116
  }
132
- }), Te());
117
+ }), xe());
133
118
  };
134
- m(F, [l.current, l.pageSize, v, X, t == null ? void 0 : t.id, r]);
135
- const Ie = () => {
136
- if (!u)
119
+ h(N, [a.current, a.pageSize, S, ee, t == null ? void 0 : t.id, i]);
120
+ const ve = () => {
121
+ if (!d)
137
122
  return;
138
- const e = Q + 1;
139
- if (e >= u.length) {
140
- let o = g;
141
- v === "hascode" && (o = g - V), v === "nocode" && (o = V), (l.current - 1) * l.pageSize + e >= o ? $.error("已经是最后一个了") : k({
142
- current: l.current + 1,
143
- pageSize: l.pageSize,
123
+ const e = E + 1;
124
+ if (e >= d.length) {
125
+ let r = M;
126
+ S === "hascode" && (r = M - O), S === "nocode" && (r = O), (a.current - 1) * a.pageSize + e >= r ? H.error("已经是最后一个了") : k({
127
+ current: a.current + 1,
128
+ pageSize: a.pageSize,
144
129
  type: "next"
145
130
  });
146
131
  } else {
147
- M(e);
148
- const o = u[e];
149
- b(o);
132
+ T(e);
133
+ const r = d[e];
134
+ g(r);
150
135
  }
151
- }, Me = () => {
152
- if (!u)
136
+ }, Ie = () => {
137
+ if (!d)
153
138
  return;
154
- const e = Q - 1;
139
+ const e = E - 1;
155
140
  if (e < 0)
156
- (l.current - 1) * l.pageSize + e < 0 ? $.error("已经是第一个了") : k({
157
- current: l.current - 1,
158
- pageSize: l.pageSize,
141
+ (a.current - 1) * a.pageSize + e < 0 ? H.error("已经是第一个了") : k({
142
+ current: a.current - 1,
143
+ pageSize: a.pageSize,
159
144
  type: "prev"
160
145
  });
161
146
  else {
162
- M(e);
163
- const o = u[e];
164
- b(o);
147
+ T(e);
148
+ const r = d[e];
149
+ g(r);
165
150
  }
166
151
  };
167
- m(() => {
168
- if (!r) {
169
- P && (clearTimeout(P), K(null)), Y(void 0);
152
+ h(() => {
153
+ if (!i) {
154
+ P && (clearTimeout(P), Z(null)), te(void 0);
170
155
  return;
171
156
  }
172
- U();
173
- }, [t == null ? void 0 : t.id]), m(() => {
174
- U();
175
- }, [fe]);
176
- const U = () => {
177
- !r || !t || n.cvforceDatahub.getPreLabelTask(r, t.id).then((e) => {
178
- const o = e[0];
179
- if (Y(o), P && (clearTimeout(P), K(null)), !(o != null && o.state) || o.state !== We.Started) {
180
- ee(!1);
157
+ _();
158
+ }, [t == null ? void 0 : t.id]), h(() => {
159
+ _();
160
+ }, [me]);
161
+ const _ = () => {
162
+ !i || !t || c.cvforceDatahub.getPreLabelTask(i, t.id).then((e) => {
163
+ const r = e[0];
164
+ if (te(r), P && (clearTimeout(P), Z(null)), !(r != null && r.state) || r.state !== He.Started) {
165
+ oe(!1);
181
166
  return;
182
167
  } else
183
- ee(!0);
184
- K(setTimeout(() => {
185
- U();
168
+ oe(!0);
169
+ Z(setTimeout(() => {
170
+ _();
186
171
  }, 1e4));
187
172
  });
188
- }, ve = [{
173
+ }, ye = [{
189
174
  key: "",
190
- label: `全部(${g})`,
175
+ label: `全部(${M})`,
191
176
  children: null
192
177
  }, {
193
178
  key: "nocode",
194
- label: `未标注(${V})`,
179
+ label: `未标注(${O})`,
195
180
  children: null
196
181
  }, {
197
182
  key: "hascode",
198
- label: `已标注(${g - V})`,
183
+ label: `已标注(${M - O})`,
199
184
  children: null
200
185
  }];
201
- m(() => {
202
- N || b(void 0);
203
- }, [N]), m(() => {
204
- i && (i.markType !== "ocr" || (i == null ? void 0 : i.ocrMarkTmpl) !== "DetectionOCR") && console.error(`当前数据集不是DetectionOCR(ocr检测)类型,请检查数据集类型。
186
+ h(() => {
187
+ V || ((o == null ? void 0 : o.ocrMarkTmpl) === "StructKVCOCR" ? g(void 0) : (j === "annotation" && N(), g(void 0), T(-1), R(void 0), w("preview")));
188
+ }, [V, j]), h(() => {
189
+ o && (o.markType !== "ocr" || (o == null ? void 0 : o.ocrMarkTmpl) !== "DetectionOCR") && console.error(`当前数据集不是DetectionOCR(ocr检测)类型,请检查数据集类型。
205
190
  请检查markType是否为ocr并且ocrMarkTmpl为DetectionOCR。`);
206
- }, [i]);
207
- const De = (i == null ? void 0 : i.ocrMarkTmpl) === "StructKVCOCR" ? Ue : Ze;
208
- return /* @__PURE__ */ c(Re, {
209
- locale: Ee,
210
- children: /* @__PURE__ */ c(Qe.Provider, {
191
+ }, [o]);
192
+ const De = (o == null ? void 0 : o.ocrMarkTmpl) === "StructKVCOCR" ? $e : je;
193
+ return /* @__PURE__ */ l(we, {
194
+ locale: Ue,
195
+ children: /* @__PURE__ */ l(Ge.Provider, {
211
196
  value: {
212
- datasetId: r,
197
+ datasetId: i,
213
198
  versionId: (t == null ? void 0 : t.id) || "",
214
199
  no: (t == null ? void 0 : t.no) || "",
215
- loading: W,
200
+ loading: J,
216
201
  version: t,
217
- versions: y,
218
- samples: u,
219
- pagination: l,
220
- services: n,
202
+ versions: D,
203
+ samples: d,
204
+ pagination: a,
205
+ services: c,
221
206
  featuresConfig: {
222
- labelManager: ce,
223
- datasetManager: T,
224
- annotation: le,
225
- filterSwitch: E,
226
- header: d,
227
- exampleSrcRoot: ae
207
+ labelManager: ae,
208
+ datasetManager: v,
209
+ annotation: se,
210
+ filterSwitch: W,
211
+ header: f,
212
+ exampleSrcRoot: de
228
213
  }
229
214
  },
230
- children: i ? i.markType === "ocr" ? /* @__PURE__ */ D("div", {
215
+ children: o ? o.markType === "ocr" ? /* @__PURE__ */ x("div", {
231
216
  className: "ocr-version-detail",
232
- children: [/* @__PURE__ */ D(_e, {
217
+ children: [/* @__PURE__ */ x(Je, {
233
218
  className: "product-details-page",
234
- header: d === !1 ? void 0 : /* @__PURE__ */ c(Ge, {
235
- backTo: ne,
236
- onBackClick: d != null && d.onBackClick ? () => {
237
- d.onBackClick && d.onBackClick();
219
+ header: f === !1 ? void 0 : /* @__PURE__ */ l(Ye, {
220
+ backTo: le,
221
+ onBackClick: f != null && f.onBackClick ? () => {
222
+ f.onBackClick && f.onBackClick();
238
223
  } : void 0,
239
- left: !W && /* @__PURE__ */ D(x, {
240
- children: [/* @__PURE__ */ c("span", {
224
+ left: !J && /* @__PURE__ */ x(y, {
225
+ children: [/* @__PURE__ */ l("span", {
241
226
  style: {
242
227
  fontWeight: "bold"
243
228
  },
244
- children: i == null ? void 0 : i.name
245
- }), /* @__PURE__ */ c(Ne, {
246
- disabled: (d == null ? void 0 : d.versionSelect) === !1,
229
+ children: o == null ? void 0 : o.name
230
+ }), /* @__PURE__ */ l(Ne, {
231
+ disabled: (f == null ? void 0 : f.versionSelect) === !1,
247
232
  value: t == null ? void 0 : t.id,
248
233
  style: {
249
234
  width: 70
250
235
  },
251
- options: y.map((e) => ({
236
+ options: D.map((e) => ({
252
237
  label: e.no,
253
238
  value: e.id
254
239
  })),
255
240
  onChange: (e) => {
256
- const o = y.find((p) => p.id === e);
257
- if (!i || !o)
241
+ const r = D.find((u) => u.id === e);
242
+ if (!o || !r)
258
243
  return;
259
- const s = y.find((p) => p.id === o.id);
260
- I(s), d != null && d.onVersionChange && d.onVersionChange(s);
244
+ const n = D.find((u) => u.id === r.id);
245
+ K(n), f != null && f.onVersionChange && f.onVersionChange(n);
261
246
  }
262
247
  })]
263
248
  }),
264
- right: /* @__PURE__ */ c(x, {
265
- children: !w && T && T.preLabel && (t != null && t.id) ? /* @__PURE__ */ c($e, {
266
- datasetId: r,
249
+ right: /* @__PURE__ */ l(y, {
250
+ children: !I && v && v.preLabel && (t != null && t.id) ? /* @__PURE__ */ l(We, {
251
+ datasetId: i,
267
252
  versionId: t.id,
268
- disabled: !g || (i == null ? void 0 : i.ocrMarkTmpl) !== "DetectionOCR",
269
- setIsTaskChange: pe,
270
- preLabelTask: X,
253
+ disabled: !M || (o == null ? void 0 : o.ocrMarkTmpl) !== "DetectionOCR",
254
+ setIsTaskChange: he,
255
+ preLabelTask: ee,
271
256
  datasetType: "ocr"
272
257
  }) : null
273
258
  })
274
259
  }),
275
- children: [/* @__PURE__ */ D("div", {
260
+ children: [/* @__PURE__ */ x("div", {
276
261
  className: "ocr-header",
277
- children: [/* @__PURE__ */ c(x, {
278
- children: E.tabs && /* @__PURE__ */ c(Oe, {
262
+ children: [/* @__PURE__ */ l(y, {
263
+ children: W.tabs && /* @__PURE__ */ l(ze, {
279
264
  className: "header-tab",
280
- defaultActiveKey: "",
265
+ activeKey: S,
281
266
  onChange: (e) => {
282
- k(C(h({}, l), {
267
+ k(C(m({}, a), {
283
268
  current: 1,
284
269
  total: 0
285
- })), de(e);
270
+ })), A(e);
286
271
  },
287
- items: ve
272
+ items: ye
288
273
  })
289
- }), /* @__PURE__ */ c(x, {
290
- children: T && T.label && /* @__PURE__ */ c(we, {
274
+ }), /* @__PURE__ */ l(y, {
275
+ children: v && v.label && /* @__PURE__ */ l(Ke, {
291
276
  title: "预标注进行中,请任务完成后再试",
292
- open: ue,
293
- children: /* @__PURE__ */ c(ze, {
277
+ open: pe,
278
+ children: /* @__PURE__ */ l(Be, {
294
279
  type: "primary",
295
- disabled: !g || (i == null ? void 0 : i.ocrMarkTmpl) !== "StructKVCOCR" && (i == null ? void 0 : i.ocrMarkTmpl) !== "DetectionOCR" || B,
296
- onClick: be,
297
- onMouseEnter: () => B && te(!0),
298
- onMouseLeave: () => te(!1),
280
+ disabled: !M || (o == null ? void 0 : o.ocrMarkTmpl) !== "StructKVCOCR" && (o == null ? void 0 : o.ocrMarkTmpl) !== "DetectionOCR" || U,
281
+ onClick: ke,
282
+ onMouseEnter: () => U && re(!0),
283
+ onMouseLeave: () => re(!1),
299
284
  style: {
300
285
  marginRight: "10px"
301
286
  },
302
- children: "单张标注"
287
+ children: "标注"
303
288
  })
304
289
  })
305
290
  })]
306
- }), /* @__PURE__ */ c("div", {
291
+ }), /* @__PURE__ */ l("div", {
307
292
  className: "d-row",
308
- children: u != null && u.length ? /* @__PURE__ */ D(x, {
293
+ children: d != null && d.length ? /* @__PURE__ */ x(y, {
309
294
  direction: "vertical",
310
295
  className: "d-right",
311
- children: [/* @__PURE__ */ c(Be, {
296
+ children: [/* @__PURE__ */ l(Ee, {
312
297
  gutter: [16, 16],
313
298
  wrap: !0,
314
299
  className: "d-right-row",
315
- children: u == null ? void 0 : u.map((e, o) => /* @__PURE__ */ c(Ke, {
300
+ children: d == null ? void 0 : d.map((e, r) => /* @__PURE__ */ l(Ae, {
316
301
  className: "d-right-col",
317
- onClick: () => Ce(o),
318
- children: /* @__PURE__ */ c("div", {
302
+ onClick: () => Me(r),
303
+ children: /* @__PURE__ */ x("div", {
319
304
  className: "right-col-wrapper",
320
- children: /* @__PURE__ */ c("div", {
305
+ children: [/* @__PURE__ */ l("div", {
321
306
  className: "right-col-img",
322
- children: /* @__PURE__ */ c(He, {
307
+ children: /* @__PURE__ */ l(Qe, {
323
308
  fileKey: e.fileKey,
324
309
  width: 124,
325
- imgProxy: he
310
+ imgProxy: be
326
311
  })
327
- })
312
+ }), /* @__PURE__ */ l("div", {
313
+ className: "right-col-text",
314
+ children: /* @__PURE__ */ l("div", {
315
+ children: r + 1
316
+ })
317
+ })]
328
318
  })
329
319
  }, e.id))
330
- }), /* @__PURE__ */ c(Ae, h({
331
- onChange: ke,
320
+ }), /* @__PURE__ */ l(Fe, m({
321
+ onChange: Se,
332
322
  className: "d-right-pageination",
333
323
  showQuickJumper: !0,
334
324
  showSizeChanger: !0
335
- }, l))]
336
- }) : /* @__PURE__ */ c(Je, {})
325
+ }, a))]
326
+ }) : /* @__PURE__ */ l(qe, {})
337
327
  })]
338
- }), w && /* @__PURE__ */ c(Fe, {
339
- isOcrModalVisible: N,
340
- setIsOcrModalVisible: O,
341
- record: w,
342
- onNextClick: () => Ie(),
343
- onPrevClick: () => Me(),
344
- ocrMarkTmpl: i == null ? void 0 : i.ocrMarkTmpl,
345
- datasetId: r,
328
+ }), V && /* @__PURE__ */ l(Ze, {
329
+ mode: j,
330
+ visible: V,
331
+ onClose: () => L(!1),
332
+ record: I,
333
+ onNextClick: () => ve(),
334
+ onPrevClick: () => Ie(),
335
+ ocrMarkTmpl: o == null ? void 0 : o.ocrMarkTmpl,
336
+ datasetId: i,
346
337
  versionId: t == null ? void 0 : t.id,
347
338
  handleMarkClick: (e) => {
348
- J(e), O(!1), z(!0);
339
+ R(e), (o == null ? void 0 : o.ocrMarkTmpl) === "StructKVCOCR" ? (L(!1), F(!0)) : w("annotation");
340
+ },
341
+ updateSampleList: N,
342
+ isPreLabel: U,
343
+ selectSampleId: G,
344
+ onSave: (e) => {
345
+ var r;
346
+ if (!i || !t)
347
+ throw "datasetId or version is not exist.";
348
+ return c.cvforceDatahub.updateSamples(i, t.id, [C(m({}, e), {
349
+ labels: (r = e.labels) == null ? void 0 : r.map((n) => C(m({}, n), {
350
+ box: n.box.length > 4 ? n.box.splice(0, 4) : n.box
351
+ }))
352
+ })]).then(() => (d && (I == null ? void 0 : I.id) === e.id && (B((n) => {
353
+ if (!n)
354
+ return n;
355
+ const u = n.findIndex((b) => b.id === e.id);
356
+ if (u > -1) {
357
+ const b = [...n];
358
+ return b[u] = e, b;
359
+ }
360
+ return n;
361
+ }), g(e)), !0));
362
+ },
363
+ filterMode: S,
364
+ onFilterModeChange: (e) => {
365
+ R(void 0), A(e);
366
+ },
367
+ onPaginationChange: (e) => {
368
+ k(e);
349
369
  },
350
- updateSampleList: F,
351
- isPreLabel: B
352
- }), G && (t == null ? void 0 : t.id) && /* @__PURE__ */ c(De, {
353
- visible: G,
354
- selectSampleId: se,
355
- ocrMarkTmpl: i == null ? void 0 : i.ocrMarkTmpl,
356
- datasetId: r,
370
+ samples: d,
371
+ pagination: a,
372
+ currentIndex: E
373
+ }), Y && (t == null ? void 0 : t.id) && /* @__PURE__ */ l(De, {
374
+ visible: Y,
375
+ selectSampleId: G,
376
+ ocrMarkTmpl: o == null ? void 0 : o.ocrMarkTmpl,
377
+ datasetId: i,
357
378
  versionId: t.id,
358
- onClose: () => z(!1),
379
+ onClose: () => F(!1),
359
380
  onSave: (e) => {
360
- var o;
361
- if (!r || !t)
381
+ var r;
382
+ if (!i || !t)
362
383
  throw "datasetId or version is not exist.";
363
- return n.cvforceDatahub.updateSamples(r, t.id, [C(h({}, e), {
364
- labels: (o = e.labels) == null ? void 0 : o.map((s) => C(h({}, s), {
365
- box: s.box.length > 4 ? s.box.splice(0, 4) : s.box
384
+ return c.cvforceDatahub.updateSamples(i, t.id, [C(m({}, e), {
385
+ labels: (r = e.labels) == null ? void 0 : r.map((n) => C(m({}, n), {
386
+ box: n.box.length > 4 ? n.box.splice(0, 4) : n.box
366
387
  }))
367
- })]).then(() => (F(), !0));
388
+ })]).then(() => (N(), !0));
368
389
  }
369
390
  })]
370
- }) : /* @__PURE__ */ c("div", {
391
+ }) : /* @__PURE__ */ l("div", {
371
392
  style: {
372
393
  color: "red",
373
394
  textAlign: "center"
@@ -378,5 +399,5 @@ const gt = (f) => {
378
399
  });
379
400
  };
380
401
  export {
381
- gt as default
402
+ Ct as default
382
403
  };