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