@glodon-aiot/agent-cli-ui 3.5.0-alpha.3 → 3.5.0-beta.1
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/Dialog/AgentChat/HistoryItem/FileItem/index.mjs +52 -48
- package/dist/es/Dialog/AgentChat/HistoryItem/SessionAction/index.mjs +112 -94
- package/dist/es/Dialog/AgentChat/HistoryItem/index.mjs +26 -24
- package/dist/es/Dialog/AgentChat/Tools/SessionListDrawer/HistorySessionList/index.mjs +65 -59
- package/dist/es/Dialog/AgentChat/Tools/UploadKnowledgeFiles/index.mjs +179 -161
- package/dist/es/Dialog/AgentChat/index.mjs +520 -465
- package/dist/es/QuillEditor/index.mjs +72 -65
- package/dist/es/ReactTextGenerationUI/components/TextSiders/index.mjs +182 -170
- package/dist/es/components/Recommend/RecommendItem.mjs +20 -18
- package/dist/es/index.mjs +223 -214
- package/dist/es/packages/agent-cli-ui/package.json.mjs +3 -3
- package/dist/es/packages/react-components/dist/es/index.mjs +1 -1
- package/dist/es/src/style.css +1 -1
- package/dist/es/src/style10.css +1 -1
- package/dist/es/src/style11.css +1 -1
- package/dist/es/src/style12.css +1 -1
- package/dist/es/src/style13.css +1 -1
- package/dist/es/src/style14.css +1 -1
- package/dist/es/src/style15.css +1 -1
- package/dist/es/src/style16.css +1 -1
- package/dist/es/src/style17.css +1 -1
- package/dist/es/src/style18.css +1 -1
- package/dist/es/src/style19.css +1 -1
- package/dist/es/src/style20.css +1 -1
- package/dist/es/src/style21.css +1 -1
- package/dist/es/src/style23.css +1 -1
- package/dist/es/src/style24.css +1 -1
- package/dist/es/src/style25.css +1 -1
- package/dist/es/src/style26.css +1 -1
- package/dist/es/src/style27.css +1 -1
- package/dist/es/src/style28.css +1 -1
- package/dist/es/src/style3.css +1 -1
- package/dist/es/src/style30.css +1 -1
- package/dist/es/src/style31.css +1 -1
- package/dist/es/src/style32.css +1 -1
- package/dist/es/src/style33.css +1 -1
- package/dist/es/src/style4.css +1 -1
- package/dist/es/src/style5.css +1 -1
- package/dist/es/src/style6.css +1 -1
- package/dist/es/src/style7.css +1 -1
- package/dist/es/src/style8.css +1 -1
- package/dist/es/src/style9.css +1 -1
- package/dist/es/utils/antdConfig.mjs +15 -0
- package/dist/lib/index.css +1 -1
- package/dist/lib/index.js +57 -57
- package/dist/src/utils/antdConfig.d.ts +7 -0
- package/dist/src/utils/testAntdPrefix.d.ts +3 -0
- package/package.json +3 -3
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
var I = (L, P, g) => new Promise((
|
|
1
|
+
var I = (L, P, g) => new Promise((d, N) => {
|
|
2
2
|
var R = (h) => {
|
|
3
3
|
try {
|
|
4
|
-
|
|
5
|
-
} catch (
|
|
6
|
-
|
|
4
|
+
C(g.next(h));
|
|
5
|
+
} catch (S) {
|
|
6
|
+
N(S);
|
|
7
7
|
}
|
|
8
8
|
}, A = (h) => {
|
|
9
9
|
try {
|
|
10
|
-
|
|
11
|
-
} catch (
|
|
12
|
-
|
|
10
|
+
C(g.throw(h));
|
|
11
|
+
} catch (S) {
|
|
12
|
+
N(S);
|
|
13
13
|
}
|
|
14
|
-
},
|
|
15
|
-
|
|
14
|
+
}, C = (h) => h.done ? d(h.value) : Promise.resolve(h.value).then(R, A);
|
|
15
|
+
C((g = g.apply(L, P)).next());
|
|
16
16
|
});
|
|
17
|
-
import { jsx as
|
|
18
|
-
import { Upload as W, Button as M, message as
|
|
19
|
-
import { forwardRef as he, useState as E, useRef as G, useContext as pe, useEffect as z, useImperativeHandle as
|
|
20
|
-
import { LoadingOutlined as
|
|
21
|
-
/* empty css */import
|
|
22
|
-
import
|
|
17
|
+
import { jsx as r, Fragment as le, jsxs as b } from "react/jsx-runtime";
|
|
18
|
+
import { Upload as W, Button as M, message as o, Badge as ue, Spin as fe, Popover as ge, Space as me } from "antd";
|
|
19
|
+
import { forwardRef as he, useState as E, useRef as G, useContext as pe, useEffect as z, useImperativeHandle as xe } from "react";
|
|
20
|
+
import { LoadingOutlined as ye, CloseCircleFilled as Ce, CloudUploadOutlined as be } from "@ant-design/icons";
|
|
21
|
+
/* empty css */import Se from "lodash/debounce";
|
|
22
|
+
import Ne from "./FileCard/index.mjs";
|
|
23
23
|
import { IFileOrigin as Fe } from "@glodon-aiot/apis";
|
|
24
24
|
import we from "./ClearModal/index.mjs";
|
|
25
25
|
import j from "../../../../components/Iconfont/index.mjs";
|
|
@@ -29,51 +29,51 @@ import { MB as Ae } from "../../../../constant.mjs";
|
|
|
29
29
|
const Ue = he((L, P) => {
|
|
30
30
|
const {
|
|
31
31
|
appId: g,
|
|
32
|
-
sid:
|
|
33
|
-
onStatusChange:
|
|
32
|
+
sid: d,
|
|
33
|
+
onStatusChange: N,
|
|
34
34
|
createSession: R,
|
|
35
35
|
disabled: A = !1,
|
|
36
|
-
afterFileAdd:
|
|
36
|
+
afterFileAdd: C,
|
|
37
37
|
afterFileDelete: h,
|
|
38
|
-
onFileListChange:
|
|
38
|
+
onFileListChange: S,
|
|
39
39
|
shouldContinue: D = !0,
|
|
40
40
|
afterFilesClear: K,
|
|
41
41
|
docViewerUrl: q,
|
|
42
42
|
isFirstSession: J
|
|
43
|
-
} = L, [
|
|
43
|
+
} = L, [c, m] = E([]), f = G(c), [Q, U] = E([]), [Y, T] = E(!1), [F, k] = E(""), w = G(D), [$, B] = E(!1), {
|
|
44
44
|
Dragger: Z
|
|
45
45
|
} = W, {
|
|
46
|
-
service:
|
|
47
|
-
popupContainer:
|
|
46
|
+
service: a,
|
|
47
|
+
popupContainer: t
|
|
48
48
|
} = pe(ve);
|
|
49
49
|
z(() => {
|
|
50
50
|
w.current = D;
|
|
51
|
-
}, [D]),
|
|
51
|
+
}, [D]), xe(P, () => ({
|
|
52
52
|
update: H,
|
|
53
53
|
clear: _
|
|
54
54
|
})), z(() => {
|
|
55
55
|
J || (U([]), m([]), H());
|
|
56
|
-
}, [
|
|
57
|
-
const H = () =>
|
|
58
|
-
|
|
56
|
+
}, [d]);
|
|
57
|
+
const H = () => d ? new Promise((e, i) => {
|
|
58
|
+
a == null || a.getApplicationIdSessionKnowledgeFiles(g, d, {
|
|
59
59
|
//1是未开启
|
|
60
60
|
enabled: 1
|
|
61
|
-
}).then((
|
|
62
|
-
U(
|
|
61
|
+
}).then((s) => {
|
|
62
|
+
U(s), m(s), ee(s);
|
|
63
63
|
}).finally(() => {
|
|
64
64
|
e();
|
|
65
65
|
});
|
|
66
66
|
}) : Promise.resolve(), ee = (e) => I(void 0, null, function* () {
|
|
67
|
-
|
|
68
|
-
var
|
|
67
|
+
d && (e == null || e.map((i) => I(void 0, null, function* () {
|
|
68
|
+
var s;
|
|
69
69
|
try {
|
|
70
|
-
if (yield
|
|
71
|
-
const l = [...f.current], p = e.findIndex((u) => u.id ===
|
|
72
|
-
p !== -1 && (l[p].status = 2), m(l),
|
|
70
|
+
if (yield a == null ? void 0 : a.checkFileReady(g, d, i.id)) {
|
|
71
|
+
const l = [...f.current], p = e.findIndex((u) => u.id === i.id);
|
|
72
|
+
p !== -1 && (l[p].status = 2), m(l), C && C(i, d);
|
|
73
73
|
}
|
|
74
|
-
} catch (
|
|
75
|
-
if (((
|
|
76
|
-
const l = [...f.current], p = e.findIndex((u) => u.id ===
|
|
74
|
+
} catch (n) {
|
|
75
|
+
if (((s = n.cause) == null ? void 0 : s.code) === -101) {
|
|
76
|
+
const l = [...f.current], p = e.findIndex((u) => u.id === i.id);
|
|
77
77
|
p !== -1 && (l[p].status = 3), m(l);
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
@@ -81,109 +81,119 @@ const Ue = he((L, P) => {
|
|
|
81
81
|
})));
|
|
82
82
|
});
|
|
83
83
|
z(() => {
|
|
84
|
-
|
|
84
|
+
N && N(F);
|
|
85
85
|
}, [F]);
|
|
86
86
|
const O = (e) => I(void 0, null, function* () {
|
|
87
87
|
if (e.size <= 0)
|
|
88
|
-
return
|
|
89
|
-
getContainer: () => (
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
return o.config({
|
|
89
|
+
getContainer: () => (t == null ? void 0 : t.current) || document.body,
|
|
90
|
+
prefixCls: "gbot-message"
|
|
91
|
+
}), o.error("该文件为空,请重新上传文档"), o.config({
|
|
92
|
+
getContainer: void 0,
|
|
93
|
+
prefixCls: "gbot-message"
|
|
92
94
|
}), !1;
|
|
93
95
|
if (Ee(e.name).length > X)
|
|
94
|
-
return
|
|
95
|
-
getContainer: () => (
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
return o.config({
|
|
97
|
+
getContainer: () => (t == null ? void 0 : t.current) || document.body,
|
|
98
|
+
prefixCls: "gbot-message"
|
|
99
|
+
}), o.error(`文件名称不能超过${X}字符`), o.config({
|
|
100
|
+
getContainer: void 0,
|
|
101
|
+
prefixCls: "gbot-message"
|
|
98
102
|
}), !1;
|
|
99
103
|
if (e.size > 50 * Ae)
|
|
100
|
-
return
|
|
101
|
-
getContainer: () => (
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
return o.config({
|
|
105
|
+
getContainer: () => (t == null ? void 0 : t.current) || document.body,
|
|
106
|
+
prefixCls: "gbot-message"
|
|
107
|
+
}), o.error(`${e.name}文件大小不能超过 50M`), o.config({
|
|
108
|
+
getContainer: void 0,
|
|
109
|
+
prefixCls: "gbot-message"
|
|
104
110
|
}), !1;
|
|
105
|
-
if (ze.some((
|
|
106
|
-
const
|
|
107
|
-
|
|
111
|
+
if (ze.some((n) => n === e.type)) {
|
|
112
|
+
const n = e;
|
|
113
|
+
n.status = 1, m((l) => l.length >= 10 ? l : [...l, n]);
|
|
108
114
|
} else
|
|
109
|
-
|
|
115
|
+
oe("存在文件格式不正确的文件,已自动去除");
|
|
110
116
|
return !1;
|
|
111
117
|
});
|
|
112
118
|
z(() => {
|
|
113
|
-
if (
|
|
119
|
+
if (c.length < 10 ? T(!1) : T(!0), !c.length) {
|
|
114
120
|
k("");
|
|
115
121
|
return;
|
|
116
122
|
}
|
|
117
|
-
const e =
|
|
118
|
-
|
|
119
|
-
}, [
|
|
120
|
-
f.current =
|
|
121
|
-
const e =
|
|
122
|
-
|
|
123
|
-
}, [
|
|
124
|
-
const
|
|
123
|
+
const e = c.find((n) => n.status === 1), i = c.find((n) => n.status === 3);
|
|
124
|
+
c.every((n) => n.status === 2) ? k("successed") : e ? k("process") : i && k("failed"), S && S(c);
|
|
125
|
+
}, [c]), z(() => {
|
|
126
|
+
f.current = c;
|
|
127
|
+
const e = c.filter((i) => !Q.includes(i));
|
|
128
|
+
se(e), U(c);
|
|
129
|
+
}, [c]);
|
|
130
|
+
const te = (e, i, s) => I(void 0, null, function* () {
|
|
125
131
|
var p;
|
|
126
|
-
const
|
|
127
|
-
l !== -1 && (
|
|
132
|
+
const n = [...f.current], l = f.current.findIndex((u) => u === s);
|
|
133
|
+
l !== -1 && (n[l].id = i), m(n);
|
|
128
134
|
try {
|
|
129
|
-
const u = yield
|
|
130
|
-
const
|
|
131
|
-
|
|
135
|
+
const u = yield a == null ? void 0 : a.checkFileReady(g, e, i, () => w.current, void 0, (x) => {
|
|
136
|
+
const y = [...f.current], v = f.current.findIndex((de) => de === s);
|
|
137
|
+
y[v].url = x.url, m(y);
|
|
132
138
|
});
|
|
133
139
|
if (u) {
|
|
134
|
-
const
|
|
135
|
-
|
|
140
|
+
const x = [...f.current], y = f.current.findIndex((v) => v === s);
|
|
141
|
+
y !== -1 && (x[y].status = 2, x[y].url = u.url), m(x), C && C(u, e);
|
|
136
142
|
}
|
|
137
143
|
} catch (u) {
|
|
138
144
|
if (((p = u.cause) == null ? void 0 : p.code) === -101) {
|
|
139
|
-
const
|
|
140
|
-
|
|
145
|
+
const x = [...f.current], y = f.current.findIndex((v) => v === s);
|
|
146
|
+
y !== -1 && (x[y].status = 3), m(x);
|
|
141
147
|
return;
|
|
142
148
|
}
|
|
143
149
|
}
|
|
144
|
-
}),
|
|
145
|
-
e.length &&
|
|
146
|
-
e == null || e.forEach((
|
|
147
|
-
var
|
|
148
|
-
w.current = !0, (
|
|
150
|
+
}), ne = () => d ? Promise.resolve(d) : R(), se = (e) => {
|
|
151
|
+
e.length && ne().then((i) => {
|
|
152
|
+
e == null || e.forEach((s) => {
|
|
153
|
+
var n;
|
|
154
|
+
w.current = !0, (n = ce(i, s)) == null || n.then((l) => {
|
|
149
155
|
var u;
|
|
150
156
|
if (!l)
|
|
151
157
|
return;
|
|
152
158
|
const p = {
|
|
153
159
|
url: l,
|
|
154
|
-
name:
|
|
155
|
-
size:
|
|
160
|
+
name: s.name,
|
|
161
|
+
size: s.size,
|
|
156
162
|
type: 1,
|
|
157
163
|
origin: Fe.AECPILOT
|
|
158
164
|
};
|
|
159
|
-
w.current && ((u =
|
|
165
|
+
w.current && ((u = re(i, p)) == null || u.then((x) => te(i, x, s)));
|
|
160
166
|
});
|
|
161
167
|
});
|
|
162
168
|
});
|
|
163
|
-
},
|
|
164
|
-
|
|
165
|
-
getContainer: () => (
|
|
166
|
-
|
|
167
|
-
|
|
169
|
+
}, re = (e, i) => a == null ? void 0 : a.postApplicationIdSessionKnowledgeSessionFile(g, e, i), oe = Se((e) => {
|
|
170
|
+
o.config({
|
|
171
|
+
getContainer: () => (t == null ? void 0 : t.current) || document.body,
|
|
172
|
+
prefixCls: "gbot-message"
|
|
173
|
+
}), o.error(e), o.config({
|
|
174
|
+
getContainer: void 0,
|
|
175
|
+
prefixCls: "gbot-message"
|
|
168
176
|
});
|
|
169
|
-
}, 300),
|
|
170
|
-
|
|
171
|
-
const
|
|
172
|
-
m(
|
|
173
|
-
getContainer: () => (
|
|
174
|
-
|
|
175
|
-
|
|
177
|
+
}, 300), ie = (e) => {
|
|
178
|
+
d && e != null && e.id && (a == null || a.delApplicationIdSessionKnowledgeFileId(g, d, e.id).then((i) => {
|
|
179
|
+
const s = c.filter((n) => n.id !== e.id);
|
|
180
|
+
m(s), o.config({
|
|
181
|
+
getContainer: () => (t == null ? void 0 : t.current) || document.body,
|
|
182
|
+
prefixCls: "gbot-message"
|
|
183
|
+
}), o.success("删除成功"), o.config({
|
|
184
|
+
getContainer: void 0,
|
|
185
|
+
prefixCls: "gbot-message"
|
|
176
186
|
}), h && h(e.id);
|
|
177
187
|
}));
|
|
178
|
-
},
|
|
179
|
-
children: /* @__PURE__ */
|
|
188
|
+
}, ae = /* @__PURE__ */ r(le, {
|
|
189
|
+
children: /* @__PURE__ */ b("div", {
|
|
180
190
|
className: "card-title",
|
|
181
|
-
children: [/* @__PURE__ */
|
|
191
|
+
children: [/* @__PURE__ */ r("span", {
|
|
182
192
|
className: "name",
|
|
183
193
|
children: "上传列表"
|
|
184
|
-
}), /* @__PURE__ */
|
|
194
|
+
}), /* @__PURE__ */ b("div", {
|
|
185
195
|
className: "actions",
|
|
186
|
-
children: [/* @__PURE__ */
|
|
196
|
+
children: [/* @__PURE__ */ r(W, {
|
|
187
197
|
accept: ".doc, .docx, .pdf",
|
|
188
198
|
beforeUpload: O,
|
|
189
199
|
showUploadList: !1,
|
|
@@ -191,71 +201,73 @@ const Ue = he((L, P) => {
|
|
|
191
201
|
margin: 0
|
|
192
202
|
},
|
|
193
203
|
multiple: !0,
|
|
194
|
-
children: /* @__PURE__ */
|
|
204
|
+
children: /* @__PURE__ */ r(M, {
|
|
195
205
|
className: "action",
|
|
196
206
|
type: "link",
|
|
197
207
|
disabled: Y,
|
|
198
|
-
children: /* @__PURE__ */
|
|
208
|
+
children: /* @__PURE__ */ b("div", {
|
|
199
209
|
className: "detail",
|
|
200
|
-
children: [/* @__PURE__ */
|
|
210
|
+
children: [/* @__PURE__ */ r(j, {
|
|
201
211
|
type: "icon-tianjia",
|
|
202
212
|
style: {
|
|
203
213
|
fontSize: 16
|
|
204
214
|
}
|
|
205
|
-
}), /* @__PURE__ */
|
|
215
|
+
}), /* @__PURE__ */ r("div", {
|
|
206
216
|
children: "添加"
|
|
207
217
|
})]
|
|
208
218
|
})
|
|
209
219
|
})
|
|
210
|
-
}), /* @__PURE__ */
|
|
220
|
+
}), /* @__PURE__ */ r(M, {
|
|
211
221
|
className: "action",
|
|
212
222
|
type: "link",
|
|
213
|
-
disabled: !
|
|
223
|
+
disabled: !c.length,
|
|
214
224
|
onClick: () => {
|
|
215
225
|
B(!0);
|
|
216
226
|
},
|
|
217
|
-
children: /* @__PURE__ */
|
|
227
|
+
children: /* @__PURE__ */ b("div", {
|
|
218
228
|
className: "detail",
|
|
219
|
-
children: [/* @__PURE__ */
|
|
229
|
+
children: [/* @__PURE__ */ r(j, {
|
|
220
230
|
type: "icon-shanchu",
|
|
221
231
|
style: {
|
|
222
232
|
fontSize: 16
|
|
223
233
|
}
|
|
224
|
-
}), /* @__PURE__ */
|
|
234
|
+
}), /* @__PURE__ */ r("span", {
|
|
225
235
|
children: "清空"
|
|
226
236
|
})]
|
|
227
237
|
})
|
|
228
238
|
})]
|
|
229
239
|
})]
|
|
230
240
|
})
|
|
231
|
-
}),
|
|
241
|
+
}), ce = (e, i) => {
|
|
232
242
|
if (!e)
|
|
233
243
|
throw Error("session is not exist.");
|
|
234
|
-
return
|
|
235
|
-
getContainer: () => (
|
|
236
|
-
|
|
237
|
-
|
|
244
|
+
return a == null ? void 0 : a.uploadFile(e, i).catch(() => (o.config({
|
|
245
|
+
getContainer: () => (t == null ? void 0 : t.current) || document.body,
|
|
246
|
+
prefixCls: "gbot-message"
|
|
247
|
+
}), o.error("服务异常,请稍后再试"), o.config({
|
|
248
|
+
getContainer: void 0,
|
|
249
|
+
prefixCls: "gbot-message"
|
|
238
250
|
}), ""));
|
|
239
|
-
}, V = /* @__PURE__ */
|
|
251
|
+
}, V = /* @__PURE__ */ r("div", {
|
|
240
252
|
className: `upload-enter ${A ? "disabled" : ""}`,
|
|
241
|
-
children: /* @__PURE__ */
|
|
253
|
+
children: /* @__PURE__ */ r(ue, {
|
|
242
254
|
size: "small",
|
|
243
255
|
color: "#9C24F2",
|
|
244
|
-
count: F === "successed" ?
|
|
256
|
+
count: F === "successed" ? c.length : F === "process" ? /* @__PURE__ */ r(fe, {
|
|
245
257
|
className: "file-action file-process",
|
|
246
|
-
indicator: /* @__PURE__ */
|
|
258
|
+
indicator: /* @__PURE__ */ r(ye, {
|
|
247
259
|
style: {
|
|
248
260
|
fontSize: 14
|
|
249
261
|
},
|
|
250
262
|
spin: !0
|
|
251
263
|
})
|
|
252
|
-
}) : F === "failed" ? /* @__PURE__ */
|
|
264
|
+
}) : F === "failed" ? /* @__PURE__ */ r(Ce, {
|
|
253
265
|
style: {
|
|
254
266
|
color: "#dc4446",
|
|
255
267
|
fontSize: 14
|
|
256
268
|
}
|
|
257
269
|
}) : 0,
|
|
258
|
-
children: /* @__PURE__ */
|
|
270
|
+
children: /* @__PURE__ */ r(j, {
|
|
259
271
|
type: "icon-shangchuanwenjian",
|
|
260
272
|
style: {
|
|
261
273
|
fontSize: 24
|
|
@@ -263,22 +275,22 @@ const Ue = he((L, P) => {
|
|
|
263
275
|
})
|
|
264
276
|
})
|
|
265
277
|
}), _ = () => new Promise((e) => {
|
|
266
|
-
const
|
|
267
|
-
if (!
|
|
278
|
+
const i = f.current;
|
|
279
|
+
if (!d)
|
|
268
280
|
return e();
|
|
269
|
-
const
|
|
270
|
-
|
|
271
|
-
id:
|
|
272
|
-
status:
|
|
273
|
-
})),
|
|
274
|
-
files:
|
|
281
|
+
const s = [];
|
|
282
|
+
i.filter((n) => n.id).forEach((n) => s.push({
|
|
283
|
+
id: n.id,
|
|
284
|
+
status: n.status
|
|
285
|
+
})), a == null || a.delApplicationIdSessionKnowledgeFile(g, d, {
|
|
286
|
+
files: s
|
|
275
287
|
}).then(() => {
|
|
276
288
|
U([]), m([]), f.current = [], K && K(), w.current = !1, e();
|
|
277
289
|
});
|
|
278
290
|
});
|
|
279
|
-
return /* @__PURE__ */
|
|
291
|
+
return /* @__PURE__ */ b("div", {
|
|
280
292
|
className: "footer-upload",
|
|
281
|
-
children: [A ? V : /* @__PURE__ */
|
|
293
|
+
children: [A ? V : /* @__PURE__ */ r(ge, {
|
|
282
294
|
overlayClassName: "upload-popover",
|
|
283
295
|
overlayInnerStyle: {
|
|
284
296
|
width: 264,
|
|
@@ -288,60 +300,66 @@ const Ue = he((L, P) => {
|
|
|
288
300
|
zIndex: 1
|
|
289
301
|
},
|
|
290
302
|
placement: "topLeft",
|
|
291
|
-
getPopupContainer: () => (
|
|
292
|
-
content: /* @__PURE__ */
|
|
303
|
+
getPopupContainer: () => (t == null ? void 0 : t.current) || document.body,
|
|
304
|
+
content: /* @__PURE__ */ r("div", {
|
|
293
305
|
className: "file-upload",
|
|
294
|
-
children:
|
|
306
|
+
children: c.length > 0 ? /* @__PURE__ */ r("div", {
|
|
295
307
|
className: "upload-wrapper",
|
|
296
|
-
children: /* @__PURE__ */
|
|
308
|
+
children: /* @__PURE__ */ r("div", {
|
|
297
309
|
className: "input-files",
|
|
298
310
|
style: {
|
|
299
311
|
display: "flex",
|
|
300
312
|
flexDirection: "column"
|
|
301
313
|
},
|
|
302
|
-
children:
|
|
314
|
+
children: c == null ? void 0 : c.map((e, i) => /* @__PURE__ */ r(Ne, {
|
|
303
315
|
file: e,
|
|
304
316
|
actions: {
|
|
305
317
|
preview: () => {
|
|
306
318
|
if (!(e != null && e.url)) {
|
|
307
|
-
|
|
308
|
-
getContainer: () => (
|
|
309
|
-
|
|
310
|
-
|
|
319
|
+
o.config({
|
|
320
|
+
getContainer: () => (t == null ? void 0 : t.current) || document.body,
|
|
321
|
+
prefixCls: "gbot-message"
|
|
322
|
+
}), o.error("正在上传中"), o.config({
|
|
323
|
+
getContainer: void 0,
|
|
324
|
+
prefixCls: "gbot-message"
|
|
311
325
|
});
|
|
312
326
|
return;
|
|
313
327
|
}
|
|
314
328
|
if (!Ie(e.url)) {
|
|
315
|
-
|
|
316
|
-
getContainer: () => (
|
|
317
|
-
|
|
318
|
-
|
|
329
|
+
o.config({
|
|
330
|
+
getContainer: () => (t == null ? void 0 : t.current) || document.body,
|
|
331
|
+
prefixCls: "gbot-message"
|
|
332
|
+
}), o.error("链接格式不正确"), o.config({
|
|
333
|
+
getContainer: void 0,
|
|
334
|
+
prefixCls: "gbot-message"
|
|
319
335
|
});
|
|
320
336
|
return;
|
|
321
337
|
}
|
|
322
338
|
window.open(`${q}#/doc?url=${encodeURIComponent(e == null ? void 0 : e.url)}`);
|
|
323
339
|
},
|
|
324
340
|
remove: () => {
|
|
325
|
-
|
|
341
|
+
ie(e);
|
|
326
342
|
},
|
|
327
343
|
download: () => {
|
|
328
|
-
|
|
329
|
-
if (!(
|
|
330
|
-
|
|
331
|
-
getContainer: () => (
|
|
332
|
-
|
|
333
|
-
|
|
344
|
+
d && (a == null || a.getApplicationIdSessionKnowledgeFileId(g, d, e.id).then((s) => {
|
|
345
|
+
if (!(s != null && s.url)) {
|
|
346
|
+
o.config({
|
|
347
|
+
getContainer: () => (t == null ? void 0 : t.current) || document.body,
|
|
348
|
+
prefixCls: "gbot-message"
|
|
349
|
+
}), o.error("下载失败"), o.config({
|
|
350
|
+
getContainer: void 0,
|
|
351
|
+
prefixCls: "gbot-message"
|
|
334
352
|
});
|
|
335
353
|
return;
|
|
336
354
|
}
|
|
337
|
-
const
|
|
338
|
-
|
|
355
|
+
const n = document.createElement("a");
|
|
356
|
+
n.href = s.url, n.download = s.name || "", n.click();
|
|
339
357
|
}));
|
|
340
358
|
}
|
|
341
359
|
}
|
|
342
|
-
},
|
|
360
|
+
}, i))
|
|
343
361
|
})
|
|
344
|
-
}) : /* @__PURE__ */
|
|
362
|
+
}) : /* @__PURE__ */ b(Z, {
|
|
345
363
|
name: "file",
|
|
346
364
|
showUploadList: !1,
|
|
347
365
|
multiple: !0,
|
|
@@ -349,39 +367,39 @@ const Ue = he((L, P) => {
|
|
|
349
367
|
accept: ".pdf, .doc, .docx",
|
|
350
368
|
maxCount: 10,
|
|
351
369
|
listType: "picture",
|
|
352
|
-
children: [/* @__PURE__ */
|
|
370
|
+
children: [/* @__PURE__ */ r("span", {
|
|
353
371
|
className: "file-upload-icon",
|
|
354
|
-
children: /* @__PURE__ */
|
|
355
|
-
}), /* @__PURE__ */
|
|
372
|
+
children: /* @__PURE__ */ r(be, {})
|
|
373
|
+
}), /* @__PURE__ */ b(me, {
|
|
356
374
|
className: "file-upload-action",
|
|
357
|
-
children: ["拖拽文件至此,或者", /* @__PURE__ */
|
|
375
|
+
children: ["拖拽文件至此,或者", /* @__PURE__ */ r(M, {
|
|
358
376
|
type: "link",
|
|
359
377
|
style: {
|
|
360
378
|
padding: 0
|
|
361
379
|
},
|
|
362
380
|
children: "上传文件"
|
|
363
381
|
})]
|
|
364
|
-
}), /* @__PURE__ */
|
|
382
|
+
}), /* @__PURE__ */ b("div", {
|
|
365
383
|
className: "file-upload-desc",
|
|
366
|
-
children: [/* @__PURE__ */
|
|
384
|
+
children: [/* @__PURE__ */ r("div", {
|
|
367
385
|
className: "item-upload-desc",
|
|
368
|
-
children: /* @__PURE__ */
|
|
386
|
+
children: /* @__PURE__ */ r("span", {
|
|
369
387
|
children: "1.支持 doc、pdf、docx 格式;"
|
|
370
388
|
})
|
|
371
|
-
}), /* @__PURE__ */
|
|
389
|
+
}), /* @__PURE__ */ r("div", {
|
|
372
390
|
className: "item-upload-desc",
|
|
373
391
|
children: "2.单个文件不超过 50 M;"
|
|
374
|
-
}), /* @__PURE__ */
|
|
392
|
+
}), /* @__PURE__ */ r("div", {
|
|
375
393
|
className: "item-upload-desc",
|
|
376
394
|
children: "3.最多上传 10 个文件。"
|
|
377
395
|
})]
|
|
378
396
|
})]
|
|
379
397
|
})
|
|
380
398
|
}),
|
|
381
|
-
title:
|
|
399
|
+
title: ae,
|
|
382
400
|
trigger: "click",
|
|
383
401
|
children: V
|
|
384
|
-
}), $ && /* @__PURE__ */
|
|
402
|
+
}), $ && /* @__PURE__ */ r(we, {
|
|
385
403
|
isvisible: $,
|
|
386
404
|
onClose: (e) => {
|
|
387
405
|
e === "clear" && _(), B(!1);
|