@glodon-aiot/dataset-annotation 3.10.0-alpha.16 → 3.10.0-alpha.18

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,20 +1,20 @@
1
- var D = (f, u, i) => new Promise((c, a) => {
2
- var m = (n) => {
1
+ var D = (f, u, i) => new Promise((m, a) => {
2
+ var h = (n) => {
3
3
  try {
4
- l(i.next(n));
5
- } catch (d) {
6
- a(d);
4
+ d(i.next(n));
5
+ } catch (o) {
6
+ a(o);
7
7
  }
8
- }, h = (n) => {
8
+ }, l = (n) => {
9
9
  try {
10
- l(i.throw(n));
11
- } catch (d) {
12
- a(d);
10
+ d(i.throw(n));
11
+ } catch (o) {
12
+ a(o);
13
13
  }
14
- }, l = (n) => n.done ? c(n.value) : Promise.resolve(n.value).then(m, h);
15
- l((i = i.apply(f, u)).next());
14
+ }, d = (n) => n.done ? m(n.value) : Promise.resolve(n.value).then(h, l);
15
+ d((i = i.apply(f, u)).next());
16
16
  });
17
- import { jsx as e, jsxs as s, Fragment as b } from "react/jsx-runtime";
17
+ import { jsx as e, jsxs as r, Fragment as b } from "react/jsx-runtime";
18
18
  import { forwardRef as z, useState as g, useRef as O, useContext as _, useImperativeHandle as j, useEffect as S } from "react";
19
19
  import "./style.less.mjs";
20
20
  import { Row as E, Col as G, Table as K, Spin as B, Input as R } from "antd";
@@ -26,10 +26,10 @@ const M = z((f, u) => {
26
26
  var w, A;
27
27
  const {
28
28
  sample: i,
29
- visionId: c,
29
+ visionId: m,
30
30
  labels: a,
31
- datasetId: m
32
- } = f, [h, l] = g([]), [n, d] = g([]), [L, p] = g(!1), v = O(null), {
31
+ datasetId: h
32
+ } = f, [l, d] = g([]), [n, o] = g([]), [L, p] = g(!1), v = O(null), {
33
33
  services: {
34
34
  cvforceDatahub: N
35
35
  }
@@ -41,54 +41,54 @@ const M = z((f, u) => {
41
41
  })), S(() => {
42
42
  const t = (i == null ? void 0 : i.labels) || [];
43
43
  if (t.length && (a != null && a.length)) {
44
- const r = t.map((o, I) => {
44
+ const s = t.map((c, I) => {
45
45
  var Q, q;
46
46
  const x = {
47
- id: (Q = o.id) != null ? Q : String(I),
48
- regionId: (q = o.id) != null ? q : String(I),
49
- shape: o.shape
50
- }, T = o.content || {};
47
+ id: (Q = c.id) != null ? Q : String(I),
48
+ regionId: (q = c.id) != null ? q : String(I),
49
+ shape: c.shape
50
+ }, T = c.content || {};
51
51
  return a.forEach((C) => {
52
52
  x[C.id] = T[C.id] || "-";
53
53
  }), x;
54
54
  });
55
- l(r);
55
+ d(s);
56
56
  } else
57
- l([]), d([]);
57
+ d([]), o([]);
58
58
  }, [i == null ? void 0 : i.labels, a]), S(() => {
59
- h.length && y();
60
- }, [h]);
59
+ l.length && y();
60
+ }, [l]);
61
61
  const k = [{
62
62
  title: "序号",
63
63
  key: "index",
64
64
  width: 80,
65
65
  fixed: "left",
66
- render: (t, r, o) => o + 1
66
+ render: (t, s, c) => c + 1
67
67
  }, ...(a || []).map((t) => ({
68
68
  title: t.name,
69
69
  dataIndex: t.id,
70
70
  key: t.id,
71
71
  width: 150,
72
- render: (r) => /* @__PURE__ */ e("span", {
73
- children: r || "-"
72
+ render: (s) => /* @__PURE__ */ e("span", {
73
+ children: s || "-"
74
74
  })
75
75
  }))], y = () => {
76
- p(!0), !(!m || !c || !(i != null && i.id)) && (N == null || N.postGenerateVlmKieQa(m, c, {
76
+ p(!0), !(!h || !m || !(i != null && i.id)) && (N == null || N.postGenerateVlmKieQa(h, m, {
77
77
  sampleIds: [i.id]
78
78
  }).then((t) => {
79
- console.log("QA生成结果:", t), d(t), p(!1);
79
+ console.log("QA生成结果:", t), o(t), p(!1);
80
80
  }).catch((t) => {
81
81
  console.error("QA生成失败:", t), p(!1);
82
82
  }));
83
83
  };
84
- return /* @__PURE__ */ s("div", {
84
+ return /* @__PURE__ */ r("div", {
85
85
  className: "qa-detail",
86
- children: [/* @__PURE__ */ s(E, {
86
+ children: [/* @__PURE__ */ r(E, {
87
87
  className: "infos",
88
88
  gutter: 48,
89
89
  children: [/* @__PURE__ */ e(G, {
90
90
  span: 12,
91
- children: /* @__PURE__ */ s("div", {
91
+ children: /* @__PURE__ */ r("div", {
92
92
  className: "info-item",
93
93
  children: [/* @__PURE__ */ e("div", {
94
94
  className: "info-item-header",
@@ -100,7 +100,7 @@ const M = z((f, u) => {
100
100
  className: "info-item-content table-wrapper",
101
101
  children: /* @__PURE__ */ e(K, {
102
102
  columns: k,
103
- dataSource: h,
103
+ dataSource: l,
104
104
  rowKey: "id",
105
105
  pagination: !1,
106
106
  size: "small",
@@ -114,16 +114,16 @@ const M = z((f, u) => {
114
114
  span: 12,
115
115
  children: /* @__PURE__ */ e(F, {
116
116
  ref: v,
117
- datasetId: m,
118
- visionId: c,
117
+ datasetId: h,
118
+ visionId: m,
119
119
  afterChangeTemplates: () => {
120
- y();
120
+ l.length && y();
121
121
  }
122
122
  })
123
123
  })]
124
- }), /* @__PURE__ */ s("div", {
124
+ }), /* @__PURE__ */ r("div", {
125
125
  className: "qa-result",
126
- children: [/* @__PURE__ */ s("div", {
126
+ children: [/* @__PURE__ */ r("div", {
127
127
  className: "info-item-header",
128
128
  children: [/* @__PURE__ */ e("div", {
129
129
  className: "info-item-title",
@@ -145,10 +145,10 @@ const M = z((f, u) => {
145
145
  }), /* @__PURE__ */ e("div", {
146
146
  className: "result",
147
147
  children: n.length > 0 ? /* @__PURE__ */ e(b, {
148
- children: (A = (w = n[0]) == null ? void 0 : w.qas) != null && A.length ? n[0].qas.map((t, r) => /* @__PURE__ */ s("div", {
148
+ children: (A = (w = n[0]) == null ? void 0 : w.qas) != null && A.length ? n[0].qas.map((t, s) => /* @__PURE__ */ r("div", {
149
149
  className: "result-item-container",
150
150
  style: {
151
- borderBottom: r === n[0].qas.length - 1 ? "none" : "1px solid #D8D8D8"
151
+ borderBottom: s === n[0].qas.length - 1 ? "none" : "1px solid #D8D8D8"
152
152
  },
153
153
  children: [/* @__PURE__ */ e("div", {
154
154
  className: "result-item-header",
@@ -156,7 +156,7 @@ const M = z((f, u) => {
156
156
  className: "result-item-title",
157
157
  children: t.name
158
158
  })
159
- }), /* @__PURE__ */ s("div", {
159
+ }), /* @__PURE__ */ r("div", {
160
160
  className: "result-item-content",
161
161
  children: [/* @__PURE__ */ e("div", {
162
162
  className: "label",
@@ -169,7 +169,7 @@ const M = z((f, u) => {
169
169
  rows: 2
170
170
  })
171
171
  })]
172
- }), /* @__PURE__ */ s("div", {
172
+ }), /* @__PURE__ */ r("div", {
173
173
  className: "result-item-content",
174
174
  children: [/* @__PURE__ */ e("div", {
175
175
  className: "label",
@@ -183,7 +183,7 @@ const M = z((f, u) => {
183
183
  })
184
184
  })]
185
185
  })]
186
- }, r)) : /* @__PURE__ */ e("div", {
186
+ }, s)) : /* @__PURE__ */ e("div", {
187
187
  className: "result-empty",
188
188
  children: "暂无结果"
189
189
  })