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