@glodon-aiot/agent-cli-ui 2.4.7 → 3.0.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/es/AgentClientUI.mjs +97 -110
- package/dist/es/Dialog/AgentChat/index.mjs +516 -467
- package/dist/es/Dialog/ConnectToNetwork/index.mjs +25 -24
- package/dist/es/Dialog/FileCard/index.mjs +48 -55
- package/dist/es/Dialog/FilePreview/index.mjs +35 -42
- package/dist/es/Dialog/HistoryItem/index.mjs +48 -53
- package/dist/es/Dialog/KnowledgeList/index.mjs +55 -48
- package/dist/es/Dialog/PromptManager/index.mjs +29 -36
- package/dist/es/Dialog/PromptSetting/index.mjs +53 -66
- package/dist/es/Dialog/SessionAction/index.mjs +92 -91
- package/dist/es/Dialog/SessionList/index.mjs +135 -121
- package/dist/es/Dialog/SessionListDrawer/index.mjs +8 -7
- package/dist/es/Dialog/SessionRefer/ReferItem/index.mjs +29 -36
- package/dist/es/Dialog/SessionRefer/index.mjs +29 -36
- package/dist/es/Dialog/SessionRelated/index.mjs +17 -14
- package/dist/es/Dialog/UploadKnowledgeFiles/index.mjs +125 -132
- package/dist/es/Dialog/index.mjs +125 -93
- package/dist/es/QuillEditor/index.mjs +91 -86
- package/dist/es/_virtual/index.mjs +2 -2
- package/dist/es/components/Markdown/Image/index.mjs +20 -20
- package/dist/es/components/Markdown/index.mjs +27 -22
- package/dist/es/constant.mjs +8 -5
- package/dist/es/index.mjs +178 -152
- package/dist/es/node_modules/classnames/index.mjs +1 -1
- package/dist/es/node_modules/comma-separated-tokens/index.mjs +13 -0
- package/dist/es/node_modules/devlop/lib/default.mjs +5 -0
- package/dist/es/node_modules/hast-util-from-dom/lib/index.mjs +93 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/create-h.mjs +126 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/index.mjs +8 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/svg-case-sensitive-tag-names.mjs +4 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/index.mjs +12 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/aria.mjs +61 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/find.mjs +33 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/html.mjs +368 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/normalize.mjs +6 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/svg.mjs +566 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/case-insensitive-transform.mjs +7 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/case-sensitive-transform.mjs +6 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/create.mjs +14 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/defined-info.mjs +36 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/info.mjs +28 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/merge.mjs +10 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/schema.mjs +21 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/types.mjs +15 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xlink.mjs +19 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xml.mjs +15 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xmlns.mjs +16 -0
- package/dist/es/node_modules/hast-util-from-html-isomorphic/lib/browser.mjs +16 -0
- package/dist/es/node_modules/hast-util-is-element/lib/index.mjs +61 -0
- package/dist/es/node_modules/hast-util-parse-selector/lib/index.mjs +20 -0
- package/dist/es/node_modules/hast-util-to-text/lib/index.mjs +223 -0
- package/dist/es/node_modules/katex/dist/katex.min.css.mjs +4 -0
- package/dist/es/node_modules/katex/dist/katex.mjs +11700 -0
- package/dist/es/node_modules/longest-streak/index.mjs +12 -0
- package/dist/es/node_modules/mdast-util-math/lib/index.mjs +170 -0
- package/dist/es/node_modules/micromark-extension-math/lib/math-flow.mjs +76 -0
- package/dist/es/node_modules/micromark-extension-math/lib/math-text.mjs +48 -0
- package/dist/es/node_modules/micromark-extension-math/lib/syntax.mjs +15 -0
- package/dist/es/node_modules/micromark-factory-space/index.mjs +15 -0
- package/dist/es/node_modules/micromark-util-character/index.mjs +10 -0
- package/dist/es/node_modules/rehype-katex/lib/index.mjs +83 -0
- package/dist/es/node_modules/remark-math/lib/index.mjs +13 -0
- package/dist/es/node_modules/space-separated-tokens/index.mjs +7 -0
- package/dist/es/node_modules/unist-util-find-after/lib/index.mjs +32 -0
- package/dist/es/node_modules/unist-util-is/lib/index.mjs +81 -0
- package/dist/es/node_modules/unist-util-visit-parents/lib/color.mjs +6 -0
- package/dist/es/node_modules/unist-util-visit-parents/lib/index.mjs +56 -0
- package/dist/es/node_modules/web-namespaces/index.mjs +11 -0
- package/dist/es/utils/index.mjs +44 -27
- package/dist/lib/index.js +278 -138
- package/dist/src/Dialog/AgentChat/index.d.ts +4 -2
- package/dist/src/Dialog/ConnectToNetwork/index.d.ts +1 -0
- package/dist/src/Dialog/KnowledgeList/KnowledgeSelect/index.d.ts +1 -1
- package/dist/src/Dialog/KnowledgeList/index.d.ts +2 -3
- package/dist/src/Dialog/PromptSetting/index.d.ts +1 -0
- package/dist/src/Dialog/SessionAction/index.d.ts +2 -0
- package/dist/src/Dialog/SessionList/index.d.ts +5 -4
- package/dist/src/QuillEditor/index.d.ts +1 -0
- package/dist/src/components/Markdown/Text/index.d.ts +8 -0
- package/dist/src/components/MathJaxLoader/index.d.ts +7 -0
- package/dist/src/components/MathJaxRender/index.d.ts +6 -0
- package/dist/src/constant.d.ts +1 -1
- package/dist/src/contexts/MathJaxContext.d.ts +12 -0
- package/dist/src/index.d.ts +4 -1
- package/dist/src/types.d.ts +26 -6
- package/dist/src/utils/index.d.ts +15 -0
- package/package.json +18 -17
- package/dist/es/_virtual/index2.mjs +0 -4
- package/dist/es/_virtual/index3.mjs +0 -4
- package/dist/es/_virtual/index4.mjs +0 -4
- package/dist/es/_virtual/minio-zj.mjs +0 -4
- package/dist/es/node_modules/@glodon-aiot/minio/dist/minio-zj.mjs +0 -26485
- package/dist/es/node_modules/@socket.io/component-emitter/lib/esm/index.mjs +0 -54
- package/dist/es/node_modules/base64-js/index.mjs +0 -47
- package/dist/es/node_modules/buffer/index.mjs +0 -927
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/has-cors.mjs +0 -9
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseqs.mjs +0 -18
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseuri.mjs +0 -24
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/yeast.mjs +0 -19
- package/dist/es/node_modules/engine.io-client/build/esm/globalThis.browser.mjs +0 -4
- package/dist/es/node_modules/engine.io-client/build/esm/socket.mjs +0 -317
- package/dist/es/node_modules/engine.io-client/build/esm/transport.mjs +0 -113
- package/dist/es/node_modules/engine.io-client/build/esm/transports/index.mjs +0 -11
- package/dist/es/node_modules/engine.io-client/build/esm/transports/polling.mjs +0 -273
- package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket-constructor.browser.mjs +0 -8
- package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket.mjs +0 -87
- package/dist/es/node_modules/engine.io-client/build/esm/transports/webtransport.mjs +0 -52
- package/dist/es/node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.mjs +0 -21
- package/dist/es/node_modules/engine.io-client/build/esm/util.mjs +0 -23
- package/dist/es/node_modules/engine.io-parser/build/esm/commons.mjs +0 -21
- package/dist/es/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.mjs +0 -14
- package/dist/es/node_modules/engine.io-parser/build/esm/decodePacket.browser.mjs +0 -39
- package/dist/es/node_modules/engine.io-parser/build/esm/encodePacket.browser.mjs +0 -28
- package/dist/es/node_modules/engine.io-parser/build/esm/index.mjs +0 -105
- package/dist/es/node_modules/ieee754/index.mjs +0 -28
- package/dist/es/node_modules/js-base64/base64.mjs +0 -31
- package/dist/es/node_modules/socket.io-client/build/esm/contrib/backo2.mjs +0 -26
- package/dist/es/node_modules/socket.io-client/build/esm/index.mjs +0 -25
- package/dist/es/node_modules/socket.io-client/build/esm/manager.mjs +0 -242
- package/dist/es/node_modules/socket.io-client/build/esm/on.mjs +0 -8
- package/dist/es/node_modules/socket.io-client/build/esm/socket.mjs +0 -608
- package/dist/es/node_modules/socket.io-client/build/esm/url.mjs +0 -19
- package/dist/es/node_modules/socket.io-parser/build/esm/binary.mjs +0 -52
- package/dist/es/node_modules/socket.io-parser/build/esm/index.mjs +0 -203
- package/dist/es/node_modules/socket.io-parser/build/esm/is-binary.mjs +0 -26
- package/dist/es/packages/agent-cli-sdk/src/AgentSession.mjs +0 -243
- package/dist/es/packages/agent-cli-sdk/src/BotClient.mjs +0 -242
- package/dist/es/packages/agent-cli-sdk/src/Config.mjs +0 -34
- package/dist/es/packages/agent-cli-sdk/src/DialogSession.mjs +0 -281
- package/dist/es/packages/agent-cli-sdk/src/EventBus.mjs +0 -64
- package/dist/es/packages/agent-cli-sdk/src/Logger.mjs +0 -31
- package/dist/es/packages/agent-cli-sdk/src/PayloadTypes.mjs +0 -4
- package/dist/es/packages/agent-cli-sdk/src/Session.mjs +0 -527
- package/dist/es/packages/agent-cli-sdk/src/api/fetchEventSource/fetch.mjs +0 -112
- package/dist/es/packages/agent-cli-sdk/src/api/fetchEventSource/parse.mjs +0 -97
- package/dist/es/packages/agent-cli-sdk/src/api/index.mjs +0 -48
- package/dist/es/packages/agent-cli-sdk/src/utils.mjs +0 -11
- package/dist/es/packages/apis/dist/es/aecpilot/cosntant.mjs +0 -5
- package/dist/es/packages/apis/dist/es/aecpilot/model.mjs +0 -9
- package/dist/es/packages/apis/dist/es/aecpilotui/index.mjs +0 -8
- package/dist/es/packages/apis/dist/es/agentcliui/index.mjs +0 -414
- package/dist/es/packages/apis/dist/es/base/index.mjs +0 -154
- package/dist/es/packages/apis/dist/es/cvforce/index.mjs +0 -431
- package/dist/es/packages/apis/dist/es/cvforce/model.mjs +0 -6
- package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/native.mjs +0 -6
- package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/rng.mjs +0 -10
- package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs +0 -9
- package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/v4.mjs +0 -19
- package/dist/es/packages/apis/dist/es/utils/fetchEventSource/fetch.mjs +0 -106
- package/dist/es/packages/apis/dist/es/utils/fetchEventSource/parse.mjs +0 -97
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { jsx as e, Fragment as g, jsxs as
|
|
2
|
-
import { useState as l, useEffect as
|
|
1
|
+
import { jsx as e, Fragment as g, jsxs as c } from "../../_virtual/jsx-runtime.mjs";
|
|
2
|
+
import { useState as l, useEffect as d } from "react";
|
|
3
3
|
import "./style.less.mjs";
|
|
4
4
|
import { Button as k } from "antd";
|
|
5
5
|
import { CloseOutlined as v } from "@ant-design/icons";
|
|
6
|
-
import
|
|
7
|
-
const
|
|
6
|
+
import f from "../../Iconfont/index.mjs";
|
|
7
|
+
const F = (p) => {
|
|
8
8
|
const {
|
|
9
9
|
sessionId: u,
|
|
10
10
|
netStatus: s,
|
|
11
11
|
enable: t,
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
disabledTip: a = "上传文件后,该会话自动停止网络访问",
|
|
13
|
+
onNetStatusChange: m
|
|
14
|
+
} = p, [h, i] = l(!1), [o, r] = l(!1), [C, n] = l(
|
|
14
15
|
"#070C14"
|
|
15
16
|
/* default */
|
|
16
17
|
);
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
d(() => {
|
|
19
|
+
r(!t), t || n(
|
|
19
20
|
"#070C14"
|
|
20
21
|
/* default */
|
|
21
22
|
);
|
|
22
23
|
}, [u, t]);
|
|
23
|
-
const
|
|
24
|
-
|
|
24
|
+
const S = () => {
|
|
25
|
+
r(!1);
|
|
25
26
|
};
|
|
26
|
-
|
|
27
|
+
d(() => {
|
|
27
28
|
i(o);
|
|
28
29
|
}, [o]);
|
|
29
|
-
const
|
|
30
|
-
|
|
30
|
+
const y = (b) => {
|
|
31
|
+
m(b);
|
|
31
32
|
};
|
|
32
33
|
return /* @__PURE__ */ e(g, {
|
|
33
|
-
children: /* @__PURE__ */
|
|
34
|
+
children: /* @__PURE__ */ c("div", {
|
|
34
35
|
className: "connect",
|
|
35
36
|
onMouseEnter: () => {
|
|
36
37
|
i(!0);
|
|
@@ -40,17 +41,17 @@ const E = (f) => {
|
|
|
40
41
|
},
|
|
41
42
|
children: [/* @__PURE__ */ e(k, {
|
|
42
43
|
type: "link",
|
|
43
|
-
icon: s ? /* @__PURE__ */ e(
|
|
44
|
+
icon: s ? /* @__PURE__ */ e(f, {
|
|
44
45
|
className: "link-btn",
|
|
45
46
|
type: "icon-yilianwang",
|
|
46
47
|
style: {
|
|
47
48
|
fontSize: 22
|
|
48
49
|
}
|
|
49
|
-
}) : /* @__PURE__ */ e(
|
|
50
|
+
}) : /* @__PURE__ */ e(f, {
|
|
50
51
|
className: "link-not-btn",
|
|
51
52
|
type: "icon-lianwangguanbi",
|
|
52
53
|
style: {
|
|
53
|
-
color:
|
|
54
|
+
color: C,
|
|
54
55
|
fontSize: 22
|
|
55
56
|
},
|
|
56
57
|
onMouseEnter: () => {
|
|
@@ -66,27 +67,27 @@ const E = (f) => {
|
|
|
66
67
|
}),
|
|
67
68
|
disabled: !t,
|
|
68
69
|
onClick: () => {
|
|
69
|
-
|
|
70
|
+
y(!s);
|
|
70
71
|
}
|
|
71
|
-
}),
|
|
72
|
+
}), h && /* @__PURE__ */ e("div", {
|
|
72
73
|
className: "net-tip",
|
|
73
|
-
children: t ? s ? "网络访问已开启" : "网络访问已关闭" : o ? /* @__PURE__ */
|
|
74
|
+
children: t ? s ? "网络访问已开启" : "网络访问已关闭" : o ? /* @__PURE__ */ c("div", {
|
|
74
75
|
style: {
|
|
75
76
|
display: "flex",
|
|
76
77
|
gap: 6
|
|
77
78
|
},
|
|
78
79
|
children: [/* @__PURE__ */ e("span", {
|
|
79
|
-
children:
|
|
80
|
+
children: a
|
|
80
81
|
}), /* @__PURE__ */ e("div", {
|
|
81
82
|
children: /* @__PURE__ */ e(v, {
|
|
82
|
-
onClick:
|
|
83
|
+
onClick: S
|
|
83
84
|
})
|
|
84
85
|
})]
|
|
85
|
-
}) :
|
|
86
|
+
}) : a
|
|
86
87
|
})]
|
|
87
88
|
})
|
|
88
89
|
});
|
|
89
90
|
};
|
|
90
91
|
export {
|
|
91
|
-
|
|
92
|
+
F as default
|
|
92
93
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as r, jsx as i, Fragment as U } from "../../_virtual/jsx-runtime.mjs";
|
|
2
2
|
import { useState as d, useEffect as a } from "react";
|
|
3
3
|
import "./style.less.mjs";
|
|
4
4
|
import z from "./doc-icons/pdf.svg.mjs";
|
|
@@ -6,137 +6,130 @@ import j from "./doc-icons/doc.svg.mjs";
|
|
|
6
6
|
import O from "./doc-icons/docx.svg.mjs";
|
|
7
7
|
import { Typography as P, Spin as T } from "antd";
|
|
8
8
|
import { LoadingOutlined as K, CloseCircleFilled as L, CloseOutlined as N } from "@ant-design/icons";
|
|
9
|
-
import "
|
|
10
|
-
import "../../node_modules/@glodon-aiot/minio/dist/minio-zj.mjs";
|
|
11
|
-
import "dayjs";
|
|
12
|
-
import "../../packages/apis/dist/es/node_modules/uuid/dist/esm-browser/native.mjs";
|
|
13
|
-
import "../../packages/apis/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs";
|
|
14
|
-
import "../../packages/apis/dist/es/agentcliui/index.mjs";
|
|
15
|
-
import "../../packages/apis/dist/es/aecpilotui/index.mjs";
|
|
16
|
-
import { KnowledgeFileStatus as F } from "../../packages/apis/dist/es/cvforce/model.mjs";
|
|
9
|
+
import { KnowledgeFileStatus as F } from "@glodon-aiot/apis";
|
|
17
10
|
import $ from "../../Iconfont/index.mjs";
|
|
18
11
|
import { getFileExtension as b } from "../../utils/index.mjs";
|
|
19
12
|
const q = {
|
|
20
13
|
doc: j,
|
|
21
14
|
docx: O,
|
|
22
15
|
pdf: z
|
|
23
|
-
},
|
|
16
|
+
}, Y = (n) => {
|
|
24
17
|
const {
|
|
25
18
|
className: k,
|
|
26
19
|
style: S,
|
|
27
|
-
id:
|
|
28
|
-
file:
|
|
20
|
+
id: o,
|
|
21
|
+
file: e,
|
|
29
22
|
actions: {
|
|
30
23
|
upload: m,
|
|
31
24
|
remove: l,
|
|
32
|
-
download:
|
|
25
|
+
download: p,
|
|
33
26
|
checkStatus: f,
|
|
34
27
|
preview: u
|
|
35
28
|
} = {},
|
|
36
29
|
onUrlChange: g,
|
|
37
30
|
onStatusChange: v
|
|
38
|
-
} =
|
|
31
|
+
} = n, y = b((e == null ? void 0 : e.name) || ""), [w, s] = d(n.uploading), [A, E] = d(!1);
|
|
39
32
|
a(() => {
|
|
40
|
-
s(
|
|
41
|
-
}, [
|
|
42
|
-
const [x, C] = d(
|
|
33
|
+
s(n.uploading);
|
|
34
|
+
}, [n.uploading]);
|
|
35
|
+
const [x, C] = d(n.url);
|
|
43
36
|
a(() => {
|
|
44
|
-
C(
|
|
45
|
-
}, [
|
|
46
|
-
m &&
|
|
37
|
+
C(n.url);
|
|
38
|
+
}, [n.url]), a(() => {
|
|
39
|
+
m && e instanceof File && (x || (s(!0), setTimeout(() => {
|
|
47
40
|
s(!1);
|
|
48
|
-
}, 2e3), m(
|
|
41
|
+
}, 2e3), m(e).then((t) => {
|
|
49
42
|
C(t), g && g(t);
|
|
50
43
|
}).catch((t) => E(t)).finally(() => {
|
|
51
44
|
s(!1);
|
|
52
45
|
})));
|
|
53
|
-
}, [m, x,
|
|
54
|
-
const [
|
|
46
|
+
}, [m, x, e]);
|
|
47
|
+
const [c, h] = d(e instanceof File || e == null ? void 0 : e.status);
|
|
55
48
|
a(() => {
|
|
56
|
-
|
|
57
|
-
}, [
|
|
49
|
+
h(e instanceof File || e == null ? void 0 : e.status);
|
|
50
|
+
}, [e]);
|
|
58
51
|
const I = () => {
|
|
59
|
-
|
|
60
|
-
t !==
|
|
61
|
-
}).catch((t) =>
|
|
52
|
+
o && f && c === F.Processing && f(o).then((t) => {
|
|
53
|
+
t !== c && (c !== void 0 && v && v(t), h(t));
|
|
54
|
+
}).catch((t) => h(F.Failed));
|
|
62
55
|
};
|
|
63
56
|
return a(() => {
|
|
64
57
|
I();
|
|
65
|
-
}, [
|
|
58
|
+
}, [o, f, c]), e ? /* @__PURE__ */ r("div", {
|
|
66
59
|
className: `file-card ${k}`,
|
|
67
60
|
style: S,
|
|
68
|
-
children: [y && /* @__PURE__ */
|
|
61
|
+
children: [y && /* @__PURE__ */ i("img", {
|
|
69
62
|
className: "file-icon",
|
|
70
63
|
src: q[y]
|
|
71
|
-
}), /* @__PURE__ */
|
|
64
|
+
}), /* @__PURE__ */ i("div", {
|
|
72
65
|
className: "file-desc",
|
|
73
|
-
children: /* @__PURE__ */
|
|
66
|
+
children: /* @__PURE__ */ i("div", {
|
|
74
67
|
className: "file-desc-name",
|
|
75
|
-
onClick: () => u == null ? void 0 : u(
|
|
76
|
-
children: /* @__PURE__ */
|
|
68
|
+
onClick: () => u == null ? void 0 : u(e),
|
|
69
|
+
children: /* @__PURE__ */ i(P.Paragraph, {
|
|
77
70
|
style: {
|
|
78
71
|
margin: 0
|
|
79
72
|
},
|
|
80
73
|
ellipsis: {
|
|
81
74
|
rows: 1,
|
|
82
|
-
tooltip:
|
|
75
|
+
tooltip: e.name
|
|
83
76
|
},
|
|
84
|
-
children:
|
|
77
|
+
children: e.name
|
|
85
78
|
})
|
|
86
79
|
})
|
|
87
|
-
}), (
|
|
80
|
+
}), (e == null ? void 0 : e.status) === 1 ? /* @__PURE__ */ r("div", {
|
|
88
81
|
className: "analysis",
|
|
89
|
-
children: [/* @__PURE__ */
|
|
90
|
-
indicator: /* @__PURE__ */
|
|
82
|
+
children: [/* @__PURE__ */ i(T, {
|
|
83
|
+
indicator: /* @__PURE__ */ i(K, {
|
|
91
84
|
style: {
|
|
92
85
|
fontSize: 16
|
|
93
86
|
},
|
|
94
87
|
spin: !0
|
|
95
88
|
})
|
|
96
|
-
}), /* @__PURE__ */
|
|
89
|
+
}), /* @__PURE__ */ i("span", {
|
|
97
90
|
children: "解析中"
|
|
98
91
|
})]
|
|
99
|
-
}) : (
|
|
92
|
+
}) : (e == null ? void 0 : e.status) === 3 ? l && /* @__PURE__ */ r("div", {
|
|
100
93
|
style: {
|
|
101
94
|
display: "flex",
|
|
102
95
|
gap: 6
|
|
103
96
|
},
|
|
104
|
-
children: [/* @__PURE__ */
|
|
97
|
+
children: [/* @__PURE__ */ i("div", {
|
|
105
98
|
className: "file-action file-failed",
|
|
106
|
-
children: /* @__PURE__ */
|
|
107
|
-
}), /* @__PURE__ */
|
|
99
|
+
children: /* @__PURE__ */ i(L, {})
|
|
100
|
+
}), /* @__PURE__ */ i("div", {
|
|
108
101
|
className: "file-action file-remove",
|
|
109
102
|
onClick: () => {
|
|
110
|
-
l(
|
|
103
|
+
l(e, o);
|
|
111
104
|
},
|
|
112
|
-
children: /* @__PURE__ */
|
|
105
|
+
children: /* @__PURE__ */ i(N, {})
|
|
113
106
|
})]
|
|
114
|
-
}) : l &&
|
|
107
|
+
}) : l && p && /* @__PURE__ */ r("div", {
|
|
115
108
|
style: {
|
|
116
109
|
display: "flex",
|
|
117
110
|
gap: 6
|
|
118
111
|
},
|
|
119
|
-
children: [/* @__PURE__ */
|
|
112
|
+
children: [/* @__PURE__ */ i("div", {
|
|
120
113
|
className: "file-action file-remove",
|
|
121
114
|
onClick: () => {
|
|
122
|
-
|
|
115
|
+
p(e, o);
|
|
123
116
|
},
|
|
124
|
-
children: /* @__PURE__ */
|
|
117
|
+
children: /* @__PURE__ */ i($, {
|
|
125
118
|
type: "icon-xiazai",
|
|
126
119
|
style: {
|
|
127
120
|
fontSize: 16
|
|
128
121
|
}
|
|
129
122
|
})
|
|
130
|
-
}), /* @__PURE__ */
|
|
123
|
+
}), /* @__PURE__ */ i("div", {
|
|
131
124
|
className: "file-action file-remove",
|
|
132
125
|
onClick: () => {
|
|
133
|
-
l(
|
|
126
|
+
l(e, o);
|
|
134
127
|
},
|
|
135
|
-
children: /* @__PURE__ */
|
|
128
|
+
children: /* @__PURE__ */ i(N, {})
|
|
136
129
|
})]
|
|
137
130
|
})]
|
|
138
|
-
}) : /* @__PURE__ */
|
|
131
|
+
}) : /* @__PURE__ */ i(U, {});
|
|
139
132
|
};
|
|
140
133
|
export {
|
|
141
|
-
|
|
134
|
+
Y as default
|
|
142
135
|
};
|
|
@@ -1,63 +1,56 @@
|
|
|
1
1
|
import { jsxs as x, jsx as o, Fragment as U } from "../../_virtual/jsx-runtime.mjs";
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as s, useEffect as n } from "react";
|
|
3
3
|
import "./style.less.mjs";
|
|
4
4
|
import { Image as k, Spin as E, Tooltip as j, Button as z } from "antd";
|
|
5
5
|
import { LoadingOutlined as B } from "@ant-design/icons";
|
|
6
6
|
import I from "../../Iconfont/index.mjs";
|
|
7
|
-
import "
|
|
8
|
-
import "../../
|
|
9
|
-
|
|
10
|
-
import "dayjs";
|
|
11
|
-
import "../../packages/apis/dist/es/node_modules/uuid/dist/esm-browser/native.mjs";
|
|
12
|
-
import "../../packages/apis/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs";
|
|
13
|
-
import "../../packages/apis/dist/es/agentcliui/index.mjs";
|
|
14
|
-
import "../../packages/apis/dist/es/aecpilotui/index.mjs";
|
|
15
|
-
import { getBase64 as b } from "../../utils/index.mjs";
|
|
16
|
-
const V = (i) => {
|
|
7
|
+
import { AecKnowledgeFileStatus as F } from "@glodon-aiot/apis";
|
|
8
|
+
import { getBase64 as A } from "../../utils/index.mjs";
|
|
9
|
+
const D = (i) => {
|
|
17
10
|
const {
|
|
18
11
|
className: y,
|
|
19
12
|
style: N,
|
|
20
|
-
id:
|
|
21
|
-
file:
|
|
13
|
+
id: a,
|
|
14
|
+
file: e,
|
|
22
15
|
actions: {
|
|
23
|
-
upload:
|
|
24
|
-
remove:
|
|
25
|
-
checkStatus:
|
|
16
|
+
upload: l,
|
|
17
|
+
remove: h,
|
|
18
|
+
checkStatus: c
|
|
26
19
|
} = {},
|
|
27
|
-
onUrlChange:
|
|
20
|
+
onUrlChange: p,
|
|
28
21
|
onStatusChange: v
|
|
29
|
-
} = i, [f, u] =
|
|
30
|
-
|
|
22
|
+
} = i, [f, u] = s(i.uploading), [K, S] = s(!1);
|
|
23
|
+
n(() => {
|
|
31
24
|
u(i.uploading);
|
|
32
25
|
}, [i.uploading]);
|
|
33
|
-
const [
|
|
34
|
-
|
|
26
|
+
const [m, d] = s(i.url);
|
|
27
|
+
n(() => {
|
|
35
28
|
d(i.url);
|
|
36
|
-
}, [i.url]),
|
|
37
|
-
|
|
38
|
-
d(
|
|
39
|
-
}).catch((
|
|
40
|
-
}, [
|
|
41
|
-
const [
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}, [
|
|
29
|
+
}, [i.url]), n(() => {
|
|
30
|
+
l && e instanceof File && (m || f || (u(!0), l(e).then((t) => {
|
|
31
|
+
d(t), p && p(t);
|
|
32
|
+
}).catch((t) => S(t)).finally(() => u(!1))));
|
|
33
|
+
}, [l, m, e]);
|
|
34
|
+
const [r, g] = s(e instanceof File || e == null ? void 0 : e.status);
|
|
35
|
+
n(() => {
|
|
36
|
+
g(e instanceof File || e == null ? void 0 : e.status);
|
|
37
|
+
}, [e]);
|
|
45
38
|
const C = () => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}).catch((
|
|
39
|
+
a && c && r === F.Processing && c(a).then((t) => {
|
|
40
|
+
t !== r && (r !== void 0 && v && v(t), g(t));
|
|
41
|
+
}).catch((t) => g(F.Failed));
|
|
49
42
|
};
|
|
50
|
-
return
|
|
43
|
+
return n(() => {
|
|
51
44
|
C();
|
|
52
|
-
}, [
|
|
53
|
-
|
|
54
|
-
d(
|
|
45
|
+
}, [a, c, r]), n(() => {
|
|
46
|
+
A(e).then((t) => {
|
|
47
|
+
d(t);
|
|
55
48
|
});
|
|
56
|
-
}, [
|
|
49
|
+
}, [e]), e ? /* @__PURE__ */ x("div", {
|
|
57
50
|
className: `file-preview ${y}`,
|
|
58
51
|
style: N,
|
|
59
52
|
children: [/* @__PURE__ */ o(k, {
|
|
60
|
-
src:
|
|
53
|
+
src: m,
|
|
61
54
|
className: "file-icon"
|
|
62
55
|
}), f && /* @__PURE__ */ o(E, {
|
|
63
56
|
className: "file-action file-process",
|
|
@@ -67,7 +60,7 @@ const V = (i) => {
|
|
|
67
60
|
},
|
|
68
61
|
spin: !0
|
|
69
62
|
})
|
|
70
|
-
}), !f &&
|
|
63
|
+
}), !f && h && /* @__PURE__ */ o(j, {
|
|
71
64
|
overlayClassName: "file-remove-tooltip",
|
|
72
65
|
title: "删除文件",
|
|
73
66
|
children: /* @__PURE__ */ o(z, {
|
|
@@ -79,12 +72,12 @@ const V = (i) => {
|
|
|
79
72
|
type: "icon-shanchu"
|
|
80
73
|
}),
|
|
81
74
|
onClick: () => {
|
|
82
|
-
|
|
75
|
+
h(e, a);
|
|
83
76
|
}
|
|
84
77
|
})
|
|
85
78
|
})]
|
|
86
79
|
}) : /* @__PURE__ */ o(U, {});
|
|
87
80
|
};
|
|
88
81
|
export {
|
|
89
|
-
|
|
82
|
+
D as default
|
|
90
83
|
};
|