@glodon-aiot/dataset-annotation 3.10.0-alpha.25 → 3.10.0-alpha.26

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,136 +1,143 @@
1
- var k = (f, o, l) => new Promise((c, r) => {
2
- var m = (a) => {
1
+ var N = (p, i, l) => new Promise((o, r) => {
2
+ var u = (e) => {
3
3
  try {
4
- s(l.next(a));
4
+ s(l.next(e));
5
5
  } catch (d) {
6
6
  r(d);
7
7
  }
8
- }, i = (a) => {
8
+ }, h = (e) => {
9
9
  try {
10
- s(l.throw(a));
10
+ s(l.throw(e));
11
11
  } catch (d) {
12
12
  r(d);
13
13
  }
14
- }, s = (a) => a.done ? c(a.value) : Promise.resolve(a.value).then(m, i);
15
- s((l = l.apply(f, o)).next());
14
+ }, s = (e) => e.done ? o(e.value) : Promise.resolve(e.value).then(u, h);
15
+ s((l = l.apply(p, i)).next());
16
16
  });
17
- import { jsxs as u, jsx as e } from "react/jsx-runtime";
18
- import { useRef as y, useState as h, useContext as R, useEffect as O } from "react";
19
- import { Modal as v, Button as p, Space as z, message as g } from "antd";
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
20
  import "./style.less.mjs";
21
- import { useKeyPress as M } from "ahooks";
22
- import D from "../../../DatasetContext/index.mjs";
23
- import L from "../../VLMAnnotation/index.mjs";
24
- import N from "../../Iconfont/index.mjs";
25
- const G = (f) => {
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
26
  const {
27
- isVlmModalVisible: o,
27
+ isVlmModalVisible: i,
28
28
  setIsVlmModalVisible: l,
29
- record: c,
29
+ record: o,
30
30
  onNextClick: r,
31
- onPrevClick: m,
32
- datasetId: i,
33
- versionId: s,
34
- ocrMarkTmpl: a,
35
- handleMarkClick: d,
36
- updateSampleList: V
37
- } = f;
38
- y(null);
39
- const x = y({});
40
- h("annotation");
41
- const [t, I] = h();
42
- h();
43
- const {
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), {
44
45
  services: {
45
46
  cvforceDatahub: n
46
47
  },
47
48
  featuresConfig: {
48
- datasetManager: C
49
+ datasetManager: k
49
50
  } = {
50
51
  datasetManager: !1
51
52
  }
52
- } = R(D);
53
- M("rightarrow", () => {
54
- r();
55
- }), M("leftarrow", () => {
56
- m();
57
- }), O(() => {
58
- o && i && s && (n == null || n.getDatasetsIdVersionsVidSsamplesSid(i, s, c.id).then((j) => {
59
- I(j);
60
- }));
61
- }, [o, c]);
62
- const w = () => {
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 = () => {
63
68
  l(!1);
64
- }, S = () => {
65
- v.confirm({
69
+ }, P = () => {
70
+ M.confirm({
66
71
  title: "确认要删除此数据吗?",
67
72
  content: "删除后不可恢复,请慎重操作",
68
73
  onOk: () => {
69
- !i || !s || !(t != null && t.id) || n == null || n.delDatasetsIdVersionsVidSamplesId(i, s, t.id).then(() => {
70
- g.success("删除成功"), l(!1), V();
71
- }).catch(() => g.error("删除失败"));
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("删除失败"));
72
77
  }
73
78
  });
74
79
  };
75
- return /* @__PURE__ */ u(v, {
76
- title: /* @__PURE__ */ e("div", {
80
+ return /* @__PURE__ */ C(M, {
81
+ title: /* @__PURE__ */ t("div", {
77
82
  className: "vlm-sample-detail-title",
78
- children: /* @__PURE__ */ e("span", {
83
+ children: /* @__PURE__ */ t("span", {
79
84
  children: "详情"
80
85
  })
81
86
  }),
82
87
  width: "100%",
83
88
  wrapClassName: "vlm-modal-wrap",
84
89
  className: "vlm-modal",
85
- open: o,
90
+ open: i,
86
91
  destroyOnClose: !0,
87
- onCancel: () => w(),
92
+ onCancel: () => O(),
88
93
  maskClosable: !1,
89
94
  centered: !0,
90
95
  footer: null,
91
- children: [/* @__PURE__ */ e("div", {
96
+ children: [/* @__PURE__ */ t("div", {
92
97
  className: "vlm-detail",
93
- children: /* @__PURE__ */ u("div", {
98
+ children: /* @__PURE__ */ C("div", {
94
99
  className: "detail-content",
95
- children: [/* @__PURE__ */ e(p, {
100
+ children: [/* @__PURE__ */ t(f, {
96
101
  className: "select-prev",
97
- icon: /* @__PURE__ */ e(N, {
102
+ icon: /* @__PURE__ */ t(S, {
98
103
  type: "icon-zuojiantou"
99
104
  }),
100
105
  type: "text",
101
- onClick: () => m()
102
- }), /* @__PURE__ */ e("div", {
106
+ disabled: !c,
107
+ onClick: () => v()
108
+ }), /* @__PURE__ */ t("div", {
103
109
  className: "select-main",
104
- ref: x,
105
- children: t && /* @__PURE__ */ e(L, {
106
- sample: t,
110
+ ref: j,
111
+ children: a && /* @__PURE__ */ t(K, {
112
+ sample: a,
107
113
  labelDefinitions: [],
108
114
  hideRightSide: !0,
109
115
  readOnly: !0,
110
- ocrRecognize: () => k(void 0, null, function* () {
116
+ ocrRecognize: () => N(void 0, null, function* () {
111
117
  return [];
112
118
  })
113
119
  })
114
- }), /* @__PURE__ */ e(p, {
120
+ }), /* @__PURE__ */ t(f, {
115
121
  className: "select-next",
116
- icon: /* @__PURE__ */ e(N, {
122
+ icon: /* @__PURE__ */ t(S, {
117
123
  type: "icon-youjiantou"
118
124
  }),
119
125
  type: "text",
120
- onClick: () => r()
126
+ disabled: !c,
127
+ onClick: () => y()
121
128
  })]
122
129
  })
123
- }), /* @__PURE__ */ e("div", {
130
+ }), /* @__PURE__ */ t("div", {
124
131
  className: "vlm-mark-action",
125
- children: /* @__PURE__ */ u(z, {
126
- children: [/* @__PURE__ */ e(p, {
132
+ children: /* @__PURE__ */ C(B, {
133
+ children: [/* @__PURE__ */ t(f, {
127
134
  type: "primary",
128
- onClick: () => d(t == null ? void 0 : t.id),
135
+ onClick: () => w(a == null ? void 0 : a.id),
129
136
  children: "标注"
130
- }), C && C.delete && /* @__PURE__ */ e(p, {
137
+ }), k && k.delete && /* @__PURE__ */ t(f, {
131
138
  danger: !0,
132
139
  type: "ghost",
133
- onClick: S,
140
+ onClick: P,
134
141
  children: "删除数据"
135
142
  })]
136
143
  })
@@ -138,5 +145,5 @@ const G = (f) => {
138
145
  });
139
146
  };
140
147
  export {
141
- G as default
148
+ X as default
142
149
  };