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