@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.
Files changed (45) hide show
  1. package/dist/es/Dialog/AgentChat/index.mjs +418 -478
  2. package/dist/es/Dialog/HistoryItem/index.mjs +50 -52
  3. package/dist/es/Dialog/KnowledgeList/index.mjs +19 -19
  4. package/dist/es/Dialog/Recommend/RecommendItem.mjs +43 -52
  5. package/dist/es/Dialog/SearchReference/index.mjs +41 -68
  6. package/dist/es/Dialog/SessionAction/index.mjs +32 -34
  7. package/dist/es/Dialog/SessionListDrawer/HistorySessionList/index.mjs +69 -74
  8. package/dist/es/Dialog/UploadKnowledgeFiles/index.mjs +164 -198
  9. package/dist/es/Dialog/index.mjs +56 -56
  10. package/dist/es/FileItem/index.mjs +50 -63
  11. package/dist/es/Iconfont/index.mjs +2 -2
  12. package/dist/es/constant.mjs +2 -8
  13. package/dist/es/index.mjs +48 -49
  14. package/dist/es/src/style11.css +1 -1
  15. package/dist/es/src/style12.css +1 -1
  16. package/dist/es/src/style13.css +1 -1
  17. package/dist/es/src/style14.css +1 -1
  18. package/dist/es/src/style15.css +1 -1
  19. package/dist/es/src/style16.css +1 -1
  20. package/dist/es/src/style17.css +1 -1
  21. package/dist/es/src/style19.css +1 -1
  22. package/dist/es/src/style20.css +1 -1
  23. package/dist/es/src/style21.css +1 -0
  24. package/dist/es/src/style22.css +1 -1
  25. package/dist/es/src/style23.css +0 -1
  26. package/dist/es/src/style24.css +1 -1
  27. package/dist/es/src/style25.css +1 -1
  28. package/dist/es/src/style26.css +1 -1
  29. package/dist/es/src/style27.css +1 -1
  30. package/dist/es/src/style28.css +1 -1
  31. package/dist/es/src/style3.css +1 -1
  32. package/dist/es/src/style30.css +1 -1
  33. package/dist/es/src/style31.css +1 -1
  34. package/dist/es/src/style32.css +1 -1
  35. package/dist/es/src/style4.css +1 -1
  36. package/dist/es/src/style5.css +1 -1
  37. package/dist/es/src/style6.css +1 -1
  38. package/dist/es/src/style8.css +1 -1
  39. package/dist/es/src/style9.css +1 -1
  40. package/dist/lib/index.css +1 -1
  41. package/dist/lib/index.js +5 -5
  42. package/dist/src/Dialog/SearchReference/index.d.ts +1 -4
  43. package/dist/src/types.d.ts +1 -10
  44. package/package.json +3 -3
  45. package/dist/src/Iconfont/font_4108228_z72fskklg2.d.ts +0 -0
@@ -1,188 +1,174 @@
1
- var I = (L, P, g) => new Promise((a, N) => {
1
+ var z = (L, P, u) => new Promise((a, C) => {
2
2
  var R = (h) => {
3
3
  try {
4
- S(g.next(h));
5
- } catch (C) {
6
- N(C);
4
+ S(u.next(h));
5
+ } catch (F) {
6
+ C(F);
7
7
  }
8
- }, A = (h) => {
8
+ }, U = (h) => {
9
9
  try {
10
- S(g.throw(h));
11
- } catch (C) {
12
- N(C);
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, A);
15
- S((g = g.apply(L, P)).next());
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 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";
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 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) => {
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: g,
31
+ appId: u,
32
32
  sid: a,
33
- onStatusChange: N,
33
+ onStatusChange: C,
34
34
  createSession: R,
35
- disabled: A = !1,
35
+ disabled: U = !1,
36
36
  afterFileAdd: S,
37
37
  afterFileDelete: h,
38
- onFileListChange: C,
38
+ onFileListChange: F,
39
39
  shouldContinue: D = !0,
40
40
  afterFilesClear: K,
41
41
  docViewerUrl: q,
42
42
  isFirstSession: J
43
- } = L, [d, m] = E([]), f = G(d), [Q, U] = E([]), [Y, T] = E(!1), [F, k] = E(""), w = G(D), [$, B] = E(!1), {
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: c,
47
- popupContainer: n
48
- } = pe(ve);
49
- z(() => {
50
- w.current = D;
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
- })), z(() => {
55
- J || (U([]), m([]), H());
54
+ })), w(() => {
55
+ J || (k([]), f([]), H());
56
56
  }, [a]);
57
57
  const H = () => a ? new Promise((e, s) => {
58
- c == null || c.getApplicationIdSessionKnowledgeFiles(g, a, {
58
+ o == null || o.getApplicationIdSessionKnowledgeFiles(u, a, {
59
59
  enabled: 1
60
- }).then((r) => {
61
- U(r), m(r), ee(r);
60
+ }).then((n) => {
61
+ k(n), f(n), ee(n);
62
62
  }).finally(() => {
63
63
  e();
64
64
  });
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;
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 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);
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 (((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);
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
- z(() => {
83
- N && N(F);
84
- }, [F]);
85
- const O = (e) => I(void 0, null, function* () {
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 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)) {
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, m((l) => l.length >= 10 ? l : [...l, t]);
98
+ t.status = 1, f((d) => d.length >= 10 ? d : [...d, t]);
107
99
  } else
108
- ie("存在文件格式不正确的文件,已自动去除");
100
+ oe("存在文件格式不正确的文件,已自动去除");
109
101
  return !1;
110
102
  });
111
- z(() => {
112
- if (d.length < 10 ? T(!1) : T(!0), !d.length) {
113
- k("");
103
+ w(() => {
104
+ if (i.length < 10 ? T(!1) : T(!0), !i.length) {
105
+ v("");
114
106
  return;
115
107
  }
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);
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 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);
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 (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);
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 (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);
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
- }), te = () => a ? Promise.resolve(a) : R(), re = (e) => {
144
- e.length && te().then((s) => {
145
- e == null || e.forEach((r) => {
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
- w.current = !0, (t = de(s, r)) == null || t.then((l) => {
148
- var u;
149
- if (!l)
139
+ I.current = !0, (t = de(s, n)) == null || t.then((d) => {
140
+ var l;
141
+ if (!d)
150
142
  return;
151
- const p = {
152
- url: l,
153
- name: r.name,
154
- size: r.size,
143
+ const g = {
144
+ url: d,
145
+ name: n.name,
146
+ size: n.size,
155
147
  type: 1,
156
- origin: Fe.AECPILOT
148
+ origin: Ce.AECPILOT
157
149
  };
158
- w.current && ((u = oe(s, p)) == null || u.then((y) => ne(s, y, r)));
150
+ I.current && ((l = se(s, g)) == null || l.then((y) => te(s, y, n)));
159
151
  });
160
152
  });
161
153
  });
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);
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
- }, ce = /* @__PURE__ */ o(le, {
178
- children: /* @__PURE__ */ b("div", {
163
+ }, ae = /* @__PURE__ */ r(ce, {
164
+ children: /* @__PURE__ */ N("div", {
179
165
  className: "card-title",
180
- children: [/* @__PURE__ */ o("span", {
166
+ children: [/* @__PURE__ */ r("span", {
181
167
  className: "name",
182
168
  children: "上传列表"
183
- }), /* @__PURE__ */ b("div", {
169
+ }), /* @__PURE__ */ N("div", {
184
170
  className: "actions",
185
- children: [/* @__PURE__ */ o(W, {
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__ */ o(M, {
179
+ children: /* @__PURE__ */ r(M, {
194
180
  className: "action",
195
181
  type: "link",
196
182
  disabled: Y,
197
- children: /* @__PURE__ */ b("div", {
183
+ children: /* @__PURE__ */ N("div", {
198
184
  className: "detail",
199
- children: [/* @__PURE__ */ o(j, {
185
+ children: [/* @__PURE__ */ r(j, {
200
186
  type: "icon-tianjia",
201
187
  style: {
202
188
  fontSize: 16
203
189
  }
204
- }), /* @__PURE__ */ o("div", {
190
+ }), /* @__PURE__ */ r("div", {
205
191
  children: "添加"
206
192
  })]
207
193
  })
208
194
  })
209
- }), /* @__PURE__ */ o(M, {
195
+ }), /* @__PURE__ */ r(M, {
210
196
  className: "action",
211
197
  type: "link",
212
- disabled: !d.length,
198
+ disabled: !i.length,
213
199
  onClick: () => {
214
200
  B(!0);
215
201
  },
216
- children: /* @__PURE__ */ b("div", {
202
+ children: /* @__PURE__ */ N("div", {
217
203
  className: "detail",
218
- children: [/* @__PURE__ */ o(j, {
204
+ children: [/* @__PURE__ */ r(j, {
219
205
  type: "icon-shanchu",
220
206
  style: {
221
207
  fontSize: 16
222
208
  }
223
- }), /* @__PURE__ */ o("span", {
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 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, {
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: F === "successed" ? d.length : F === "process" ? /* @__PURE__ */ o(fe, {
225
+ count: b === "successed" ? i.length : b === "process" ? /* @__PURE__ */ r(fe, {
244
226
  className: "file-action file-process",
245
- indicator: /* @__PURE__ */ o(xe, {
227
+ indicator: /* @__PURE__ */ r(xe, {
246
228
  style: {
247
229
  fontSize: 14
248
230
  },
249
231
  spin: !0
250
232
  })
251
- }) : F === "failed" ? /* @__PURE__ */ o(Se, {
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__ */ o(j, {
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 = f.current;
247
+ const s = c.current;
266
248
  if (!a)
267
249
  return e();
268
- const r = [];
269
- s.filter((t) => t.id).forEach((t) => r.push({
250
+ const n = [];
251
+ s.filter((t) => t.id).forEach((t) => n.push({
270
252
  id: t.id,
271
253
  status: t.status
272
- })), c == null || c.delApplicationIdSessionKnowledgeFile(g, a, {
273
- files: r
254
+ })), o == null || o.delApplicationIdSessionKnowledgeFile(u, a, {
255
+ files: n
274
256
  }).then(() => {
275
- U([]), m([]), f.current = [], K && K(), w.current = !1, e();
257
+ k([]), f([]), c.current = [], K && K(), I.current = !1, e();
276
258
  });
277
259
  });
278
- return /* @__PURE__ */ b("div", {
260
+ return /* @__PURE__ */ N("div", {
279
261
  className: "footer-upload",
280
- children: [A ? V : /* @__PURE__ */ o(ge, {
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: () => (n == null ? void 0 : n.current) || document.body,
291
- content: /* @__PURE__ */ o("div", {
272
+ getPopupContainer: () => (m == null ? void 0 : m.current) || document.body,
273
+ content: /* @__PURE__ */ r("div", {
292
274
  className: "file-upload",
293
- children: d.length > 0 ? /* @__PURE__ */ o("div", {
275
+ children: i.length > 0 ? /* @__PURE__ */ r("div", {
294
276
  className: "upload-wrapper",
295
- children: /* @__PURE__ */ o("div", {
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: d == null ? void 0 : d.map((e, s) => /* @__PURE__ */ o(Ne, {
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
- 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
- }
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
- se(e);
294
+ ie(e);
325
295
  },
326
296
  download: () => {
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
- });
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 = r.url, t.download = r.name || "", t.click();
303
+ t.href = n.url, t.download = n.name || "", t.click();
338
304
  }));
339
305
  }
340
306
  }
341
307
  }, s))
342
308
  })
343
- }) : /* @__PURE__ */ b(Z, {
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__ */ o("span", {
317
+ children: [/* @__PURE__ */ r("span", {
352
318
  className: "file-upload-icon",
353
- children: /* @__PURE__ */ o(be, {})
354
- }), /* @__PURE__ */ b(me, {
319
+ children: /* @__PURE__ */ r(Ne, {})
320
+ }), /* @__PURE__ */ N(he, {
355
321
  className: "file-upload-action",
356
- children: ["拖拽文件至此,或者", /* @__PURE__ */ o(M, {
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__ */ b("div", {
329
+ }), /* @__PURE__ */ N("div", {
364
330
  className: "file-upload-desc",
365
- children: [/* @__PURE__ */ o("div", {
331
+ children: [/* @__PURE__ */ r("div", {
366
332
  className: "item-upload-desc",
367
- children: /* @__PURE__ */ o("span", {
333
+ children: /* @__PURE__ */ r("span", {
368
334
  children: "1.支持 doc、pdf、docx 格式;"
369
335
  })
370
- }), /* @__PURE__ */ o("div", {
336
+ }), /* @__PURE__ */ r("div", {
371
337
  className: "item-upload-desc",
372
338
  children: "2.单个文件不超过 50 M;"
373
- }), /* @__PURE__ */ o("div", {
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: ce,
346
+ title: ae,
381
347
  trigger: "click",
382
348
  children: V
383
- }), $ && /* @__PURE__ */ o(we, {
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
- Ue.displayName = "UploadFiles";
357
+ ke.displayName = "UploadFiles";
392
358
  export {
393
- Ue as default
359
+ ke as default
394
360
  };