@glodon-aiot/agent-cli-ui 3.4.2-beta.2 → 3.4.3-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 +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/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/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 +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,38 +1,38 @@
|
|
|
1
|
-
var
|
|
1
|
+
var ue = Object.defineProperty, he = Object.defineProperties;
|
|
2
2
|
var ye = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var G = Object.getOwnPropertySymbols;
|
|
4
|
-
var Ie = Object.prototype.hasOwnProperty,
|
|
5
|
-
var Q = (n, d,
|
|
6
|
-
for (var
|
|
7
|
-
Ie.call(d,
|
|
4
|
+
var Ie = Object.prototype.hasOwnProperty, xe = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Q = (n, d, c) => d in n ? ue(n, d, { enumerable: !0, configurable: !0, writable: !0, value: c }) : n[d] = c, V = (n, d) => {
|
|
6
|
+
for (var c in d || (d = {}))
|
|
7
|
+
Ie.call(d, c) && Q(n, c, d[c]);
|
|
8
8
|
if (G)
|
|
9
|
-
for (var
|
|
10
|
-
|
|
9
|
+
for (var c of G(d))
|
|
10
|
+
xe.call(d, c) && Q(n, c, d[c]);
|
|
11
11
|
return n;
|
|
12
12
|
}, X = (n, d) => he(n, ye(d));
|
|
13
|
-
var
|
|
14
|
-
var q = (
|
|
13
|
+
var C = (n, d, c) => new Promise((f, b) => {
|
|
14
|
+
var q = (g) => {
|
|
15
15
|
try {
|
|
16
|
-
|
|
17
|
-
} catch (
|
|
18
|
-
|
|
16
|
+
v(c.next(g));
|
|
17
|
+
} catch (S) {
|
|
18
|
+
b(S);
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, k = (g) => {
|
|
21
21
|
try {
|
|
22
|
-
|
|
23
|
-
} catch (
|
|
24
|
-
|
|
22
|
+
v(c.throw(g));
|
|
23
|
+
} catch (S) {
|
|
24
|
+
b(S);
|
|
25
25
|
}
|
|
26
|
-
},
|
|
27
|
-
|
|
26
|
+
}, v = (g) => g.done ? f(g.value) : Promise.resolve(g.value).then(q, k);
|
|
27
|
+
v((c = c.apply(n, d)).next());
|
|
28
28
|
});
|
|
29
|
-
import { jsxs as
|
|
30
|
-
import { useState as h, useRef as
|
|
31
|
-
import { Form as M, Collapse as _, Input as K, Button as
|
|
29
|
+
import { jsxs as P, jsx as o, Fragment as be } from "react/jsx-runtime";
|
|
30
|
+
import { useState as h, useRef as ke, useContext as ve, useEffect as N } from "react";
|
|
31
|
+
import { Form as M, Collapse as _, Input as K, Button as Se, message as w, notification as pe } from "antd";
|
|
32
32
|
import { PromptVariableType as y } from "@glodon-aiot/apis";
|
|
33
|
-
import { v4 as
|
|
34
|
-
import
|
|
35
|
-
import
|
|
33
|
+
import { v4 as Ce } from "uuid";
|
|
34
|
+
import Pe from "../../../context.mjs";
|
|
35
|
+
import we from "../../../components/KnowledgeList/KnowledgeSelect/index.mjs";
|
|
36
36
|
import "../../../packages/react-components/dist/es/index.mjs";
|
|
37
37
|
import Ne from "../../../Dialog/AgentChat/HistoryItem/SessionRefer/index.mjs";
|
|
38
38
|
import Te from "../../../node_modules/moment/dist/moment.mjs";
|
|
@@ -43,17 +43,17 @@ const {
|
|
|
43
43
|
} = _, Ee = ({
|
|
44
44
|
application: n,
|
|
45
45
|
sessionId: d,
|
|
46
|
-
docViewerUrl:
|
|
46
|
+
docViewerUrl: c
|
|
47
47
|
}) => {
|
|
48
|
-
const
|
|
49
|
-
service:
|
|
48
|
+
const f = n.id, [b, q] = h(""), [k, v] = h(""), [g, S] = h(), [L, T] = h(!1), D = ke(null), [H, ee] = h([]), [A, O] = h([]), [te, Y] = h(0), [$, j] = h(), [l, R] = h(), [E] = M.useForm(), [U, se] = h({}), [B, re] = h({}), [ne, ae] = h(0), {
|
|
49
|
+
service: u,
|
|
50
50
|
agentClient: I,
|
|
51
|
-
popupContainer:
|
|
51
|
+
popupContainer: p,
|
|
52
52
|
token: oe,
|
|
53
|
-
apiUrl:
|
|
54
|
-
} =
|
|
55
|
-
const
|
|
56
|
-
messageId:
|
|
53
|
+
apiUrl: le
|
|
54
|
+
} = ve(Pe), ce = (e, a, i, t) => {
|
|
55
|
+
const s = {
|
|
56
|
+
messageId: Ce(),
|
|
57
57
|
content: "",
|
|
58
58
|
role: 1,
|
|
59
59
|
sessionId: "",
|
|
@@ -61,16 +61,16 @@ const {
|
|
|
61
61
|
messageTime: "",
|
|
62
62
|
llmModel: "",
|
|
63
63
|
searchReference: []
|
|
64
|
-
},
|
|
64
|
+
}, r = X(V({}, i), {
|
|
65
65
|
stream: !0
|
|
66
66
|
});
|
|
67
|
-
Ae(`${
|
|
67
|
+
Ae(`${le}/chat/v2/chat?applicationId=${e}&sessionId=${a}`, {
|
|
68
68
|
method: "POST",
|
|
69
69
|
headers: {
|
|
70
70
|
Authorization: `Bearer ${oe}`,
|
|
71
71
|
"Content-Type": "application/json"
|
|
72
72
|
},
|
|
73
|
-
body: JSON.stringify(
|
|
73
|
+
body: JSON.stringify(r),
|
|
74
74
|
openWhenHidden: !0,
|
|
75
75
|
onopen(m) {
|
|
76
76
|
return console.log("onopen"), m.ok && t != null && t.onopen && t.onopen(), Promise.resolve();
|
|
@@ -79,34 +79,34 @@ const {
|
|
|
79
79
|
if (!m.id && !m.data && !m.event && !m.retry)
|
|
80
80
|
return;
|
|
81
81
|
if (!m.data.includes('{"code": ')) {
|
|
82
|
-
|
|
82
|
+
s.content = s.content + m.data;
|
|
83
83
|
const F = {
|
|
84
|
-
content:
|
|
84
|
+
content: s.content,
|
|
85
85
|
role: 1,
|
|
86
|
-
reference:
|
|
87
|
-
messageId:
|
|
86
|
+
reference: s.reference,
|
|
87
|
+
messageId: s.messageId,
|
|
88
88
|
sessionId: a,
|
|
89
89
|
messageTime: Te(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"),
|
|
90
90
|
searchReference: []
|
|
91
91
|
};
|
|
92
92
|
return (t == null ? void 0 : t.onmessage) && t.onmessage(F);
|
|
93
93
|
}
|
|
94
|
-
const
|
|
95
|
-
if (
|
|
94
|
+
const x = JSON.parse(m.data);
|
|
95
|
+
if (s.reference = x.data.reference, s.messageTime = x.data.messageTime, s.messageId = x.data.messageId, s.llmModel = x.data.llmModel, s.content = x.data.content, s.code = x.code, x.code === 200) {
|
|
96
96
|
const F = {
|
|
97
|
-
code:
|
|
98
|
-
content:
|
|
97
|
+
code: s.code,
|
|
98
|
+
content: s.content,
|
|
99
99
|
role: 1,
|
|
100
|
-
reference:
|
|
101
|
-
messageId:
|
|
100
|
+
reference: s.reference,
|
|
101
|
+
messageId: s.messageId,
|
|
102
102
|
sessionId: a,
|
|
103
|
-
messageTime:
|
|
103
|
+
messageTime: s.messageTime,
|
|
104
104
|
searchReference: []
|
|
105
105
|
};
|
|
106
106
|
t != null && t.onmessage && t.onmessage(F);
|
|
107
107
|
} else
|
|
108
|
-
return
|
|
109
|
-
message:
|
|
108
|
+
return pe.error({
|
|
109
|
+
message: x.message
|
|
110
110
|
});
|
|
111
111
|
},
|
|
112
112
|
onerror() {
|
|
@@ -115,13 +115,13 @@ const {
|
|
|
115
115
|
onclose() {
|
|
116
116
|
console.log("onclose");
|
|
117
117
|
const m = {
|
|
118
|
-
code:
|
|
119
|
-
content:
|
|
118
|
+
code: s.code,
|
|
119
|
+
content: s.content,
|
|
120
120
|
role: 1,
|
|
121
|
-
reference:
|
|
122
|
-
messageId:
|
|
121
|
+
reference: s.reference,
|
|
122
|
+
messageId: s.messageId,
|
|
123
123
|
sessionId: a,
|
|
124
|
-
messageTime:
|
|
124
|
+
messageTime: s.messageTime,
|
|
125
125
|
comment: {
|
|
126
126
|
isAgree: 0
|
|
127
127
|
},
|
|
@@ -139,7 +139,7 @@ const {
|
|
|
139
139
|
return;
|
|
140
140
|
const i = e[0].knowledges || [];
|
|
141
141
|
ee(i), Y(i.length);
|
|
142
|
-
const t = i.map((
|
|
142
|
+
const t = i.map((s) => s.id);
|
|
143
143
|
O(t);
|
|
144
144
|
}, [n]), N(() => {
|
|
145
145
|
if (!(n != null && n.id) || !I)
|
|
@@ -147,102 +147,106 @@ const {
|
|
|
147
147
|
const e = I.questionContextMaxLength || 4e3;
|
|
148
148
|
ae(e), de();
|
|
149
149
|
}, [n, I]);
|
|
150
|
-
const de = () =>
|
|
151
|
-
if (!
|
|
150
|
+
const de = () => C(void 0, null, function* () {
|
|
151
|
+
if (!u || !f)
|
|
152
152
|
return;
|
|
153
|
-
const e = yield
|
|
153
|
+
const e = yield u.postApplicationIdSession({
|
|
154
154
|
name: "AI 会话",
|
|
155
|
-
applicationId:
|
|
155
|
+
applicationId: f
|
|
156
156
|
});
|
|
157
157
|
j(e);
|
|
158
158
|
});
|
|
159
159
|
N(() => {
|
|
160
|
-
!
|
|
160
|
+
!f || !u || Promise.all([u.getApplicationIdPromptVariables(f, {
|
|
161
161
|
type: y.User,
|
|
162
162
|
status: 1
|
|
163
|
-
}),
|
|
163
|
+
}), u.getApplicationIdPromptVariables(f, {
|
|
164
164
|
type: y.System,
|
|
165
165
|
status: 1
|
|
166
166
|
})]).then(([e, a]) => {
|
|
167
|
-
const
|
|
168
|
-
id:
|
|
169
|
-
key:
|
|
170
|
-
name:
|
|
167
|
+
const s = [...e, ...a].filter((r) => !(r.type === y.User && r.key === "query") && !(r.type === y.System && r.key === "datetime")).map((r) => ({
|
|
168
|
+
id: r.id,
|
|
169
|
+
key: r.key,
|
|
170
|
+
name: r.name,
|
|
171
171
|
value: "",
|
|
172
|
-
type:
|
|
172
|
+
type: r.type
|
|
173
173
|
}));
|
|
174
|
-
R(
|
|
174
|
+
R(s);
|
|
175
175
|
});
|
|
176
|
-
}, [
|
|
177
|
-
if (!
|
|
176
|
+
}, [u, f]), N(() => {
|
|
177
|
+
if (!l)
|
|
178
178
|
return;
|
|
179
|
-
const e =
|
|
180
|
-
e == null || e.map((
|
|
181
|
-
|
|
179
|
+
const e = l.filter((s) => s.type === y.User), a = l.filter((s) => s.type === y.System), i = {};
|
|
180
|
+
e == null || e.map((s) => {
|
|
181
|
+
s.key && (i[s.key] = s.value);
|
|
182
182
|
});
|
|
183
183
|
const t = {};
|
|
184
|
-
a == null || a.map((
|
|
185
|
-
|
|
184
|
+
a == null || a.map((s) => {
|
|
185
|
+
s.key && (t[s.key] = s.value);
|
|
186
186
|
}), E.setFieldsValue({
|
|
187
187
|
userPrompts: i,
|
|
188
188
|
systemPrompts: t
|
|
189
|
-
}),
|
|
190
|
-
}, [
|
|
191
|
-
const ie = (e, a) =>
|
|
192
|
-
!$ || !
|
|
189
|
+
}), se(i), re(t);
|
|
190
|
+
}, [l]);
|
|
191
|
+
const ie = (e, a) => C(void 0, null, function* () {
|
|
192
|
+
!$ || !f || !u || (yield u.patchApplicationIdSessionpromptVariablesId(f, $.id, e, {
|
|
193
193
|
value: a
|
|
194
194
|
}));
|
|
195
195
|
}), me = (e) => {
|
|
196
196
|
q(e.target.value);
|
|
197
|
-
},
|
|
198
|
-
if (!
|
|
197
|
+
}, fe = () => C(void 0, null, function* () {
|
|
198
|
+
if (!f || !u || !I)
|
|
199
199
|
return;
|
|
200
200
|
T(!0);
|
|
201
201
|
for (const t in U)
|
|
202
|
-
U[t] || (
|
|
203
|
-
getContainer: () => (
|
|
204
|
-
|
|
205
|
-
|
|
202
|
+
U[t] || (w.config({
|
|
203
|
+
getContainer: () => (p == null ? void 0 : p.current) || document.body,
|
|
204
|
+
prefixCls: "gbot-message"
|
|
205
|
+
}), w.error("变量值不能为空"), w.config({
|
|
206
|
+
getContainer: void 0,
|
|
207
|
+
prefixCls: "gbot-message"
|
|
206
208
|
}));
|
|
207
209
|
for (const t in B)
|
|
208
|
-
B[t] || (
|
|
209
|
-
getContainer: () => (
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
B[t] || (w.config({
|
|
211
|
+
getContainer: () => (p == null ? void 0 : p.current) || document.body,
|
|
212
|
+
prefixCls: "gbot-message"
|
|
213
|
+
}), w.error("变量值不能为空"), w.config({
|
|
214
|
+
getContainer: void 0,
|
|
215
|
+
prefixCls: "gbot-message"
|
|
212
216
|
}));
|
|
213
|
-
const e = yield
|
|
217
|
+
const e = yield u.postApplicationIdSession({
|
|
214
218
|
name: "AI 会话",
|
|
215
|
-
applicationId:
|
|
219
|
+
applicationId: f
|
|
216
220
|
});
|
|
217
221
|
j(e);
|
|
218
222
|
const a = A == null ? void 0 : A.map((t) => t.toString());
|
|
219
|
-
yield
|
|
220
|
-
if (!
|
|
223
|
+
yield u.getApplicationIdSessionIdPromptVariables(f, e.id).then((t) => C(void 0, null, function* () {
|
|
224
|
+
if (!l)
|
|
221
225
|
return;
|
|
222
|
-
const
|
|
223
|
-
const m =
|
|
224
|
-
return
|
|
226
|
+
const s = t.filter((r) => r.key !== "query").map((r) => {
|
|
227
|
+
const m = l.filter((x) => x.key === r.key);
|
|
228
|
+
return r.value = m[0].value, r;
|
|
225
229
|
});
|
|
226
|
-
yield Promise.all(
|
|
230
|
+
yield Promise.all(s.map((r) => ie(r.id, r.value))), R(s);
|
|
227
231
|
})).catch((t) => {
|
|
228
232
|
console.log(t), T(!1);
|
|
229
233
|
});
|
|
230
234
|
const i = {
|
|
231
|
-
content:
|
|
235
|
+
content: b,
|
|
232
236
|
chatMode: 1,
|
|
233
237
|
knowledges: a,
|
|
234
238
|
promptVariables: U,
|
|
235
239
|
systemPromptVariables: B
|
|
236
240
|
};
|
|
237
|
-
|
|
241
|
+
ce(f, e.id, i, {
|
|
238
242
|
onmessage: (t) => {
|
|
239
|
-
|
|
243
|
+
S(void 0), v(t.content);
|
|
240
244
|
},
|
|
241
|
-
onclose: (t) =>
|
|
245
|
+
onclose: (t) => C(void 0, null, function* () {
|
|
242
246
|
if (T(!1), t.code == 200) {
|
|
243
|
-
|
|
244
|
-
const
|
|
245
|
-
t.reference = t.reference.map((
|
|
247
|
+
v(t.content);
|
|
248
|
+
const s = yield Promise.all(t.reference.map((r) => u.getKnowledgeIdFileId(r.knowledgeId, r.docId)));
|
|
249
|
+
t.reference = t.reference.map((r, m) => V(V({}, r), s[m])), S(t);
|
|
246
250
|
}
|
|
247
251
|
}),
|
|
248
252
|
onerror: () => {
|
|
@@ -251,23 +255,23 @@ const {
|
|
|
251
255
|
});
|
|
252
256
|
});
|
|
253
257
|
N(() => {
|
|
254
|
-
if (!
|
|
258
|
+
if (!k)
|
|
255
259
|
return;
|
|
256
260
|
const e = D.current;
|
|
257
261
|
e && (e.scrollTop = e.scrollHeight);
|
|
258
|
-
}, [
|
|
259
|
-
const
|
|
262
|
+
}, [k]);
|
|
263
|
+
const ge = (e) => {
|
|
260
264
|
O(e), Y(e.length);
|
|
261
265
|
}, z = (e, a) => {
|
|
262
|
-
|
|
266
|
+
l && (l.map((i) => {
|
|
263
267
|
i.id === e && (i.value = a.target.value);
|
|
264
|
-
}), R([...
|
|
265
|
-
}, J = (
|
|
266
|
-
return /* @__PURE__ */
|
|
268
|
+
}), R([...l]));
|
|
269
|
+
}, J = (l == null ? void 0 : l.filter((e) => e.type === y.System)) || [], W = (l == null ? void 0 : l.filter((e) => e.type === y.User)) || [];
|
|
270
|
+
return /* @__PURE__ */ P("div", {
|
|
267
271
|
className: "text-main",
|
|
268
|
-
children: [/* @__PURE__ */
|
|
272
|
+
children: [/* @__PURE__ */ P("div", {
|
|
269
273
|
className: "text-left-sider",
|
|
270
|
-
children: [!!(
|
|
274
|
+
children: [!!(l != null && l.length) && /* @__PURE__ */ o(M, {
|
|
271
275
|
autoComplete: "off",
|
|
272
276
|
form: E,
|
|
273
277
|
labelWrap: !0,
|
|
@@ -278,7 +282,7 @@ const {
|
|
|
278
282
|
}
|
|
279
283
|
},
|
|
280
284
|
className: "prompt-form",
|
|
281
|
-
children: /* @__PURE__ */
|
|
285
|
+
children: /* @__PURE__ */ P(_, {
|
|
282
286
|
bordered: !1,
|
|
283
287
|
ghost: !0,
|
|
284
288
|
className: "prompt-variables-collapse",
|
|
@@ -321,21 +325,21 @@ const {
|
|
|
321
325
|
}, e.key))
|
|
322
326
|
}, y.User)]
|
|
323
327
|
})
|
|
324
|
-
}), /* @__PURE__ */
|
|
328
|
+
}), /* @__PURE__ */ P("div", {
|
|
325
329
|
className: "sider-header",
|
|
326
330
|
children: [/* @__PURE__ */ o("span", {
|
|
327
331
|
className: "header-title",
|
|
328
332
|
children: "文本生成输入"
|
|
329
|
-
}), H.length !== 0 && /* @__PURE__ */ o(
|
|
333
|
+
}), H.length !== 0 && /* @__PURE__ */ o(we, {
|
|
330
334
|
checkedValues: A,
|
|
331
335
|
currKnowledgeList: H,
|
|
332
336
|
selectCount: te,
|
|
333
|
-
onSelectChange:
|
|
337
|
+
onSelectChange: ge,
|
|
334
338
|
disabled: !1
|
|
335
339
|
})]
|
|
336
340
|
}), /* @__PURE__ */ o("div", {
|
|
337
341
|
className: "sider-main",
|
|
338
|
-
children: /* @__PURE__ */
|
|
342
|
+
children: /* @__PURE__ */ P("div", {
|
|
339
343
|
className: "sider-text",
|
|
340
344
|
children: [/* @__PURE__ */ o(K.TextArea, {
|
|
341
345
|
style: {
|
|
@@ -347,12 +351,12 @@ const {
|
|
|
347
351
|
showCount: !0,
|
|
348
352
|
bordered: !1,
|
|
349
353
|
onChange: me,
|
|
350
|
-
value:
|
|
354
|
+
value: b,
|
|
351
355
|
className: "left-input"
|
|
352
|
-
}), /* @__PURE__ */ o(
|
|
356
|
+
}), /* @__PURE__ */ o(Se, {
|
|
353
357
|
type: "primary",
|
|
354
|
-
disabled: !
|
|
355
|
-
onClick:
|
|
358
|
+
disabled: !b || L,
|
|
359
|
+
onClick: fe,
|
|
356
360
|
className: "sider-btn",
|
|
357
361
|
loading: L,
|
|
358
362
|
children: L ? "生成中" : "确认生成"
|
|
@@ -366,16 +370,16 @@ const {
|
|
|
366
370
|
children: /* @__PURE__ */ o("div", {
|
|
367
371
|
className: "sider-text",
|
|
368
372
|
ref: D,
|
|
369
|
-
children:
|
|
373
|
+
children: k ? /* @__PURE__ */ P(be, {
|
|
370
374
|
children: [/* @__PURE__ */ o(Ve, {
|
|
371
|
-
children:
|
|
372
|
-
}),
|
|
375
|
+
children: k
|
|
376
|
+
}), g && (g == null ? void 0 : g.reference.length) !== 0 && /* @__PURE__ */ o("div", {
|
|
373
377
|
style: {
|
|
374
378
|
marginTop: 16
|
|
375
379
|
},
|
|
376
380
|
children: /* @__PURE__ */ o(Ne, {
|
|
377
|
-
history:
|
|
378
|
-
docViewerUrl:
|
|
381
|
+
history: g,
|
|
382
|
+
docViewerUrl: c
|
|
379
383
|
})
|
|
380
384
|
})]
|
|
381
385
|
}) : /* @__PURE__ */ o("div", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as d, jsx as
|
|
1
|
+
import { jsxs as d, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { useState as h, useContext as v, useEffect as y } from "react";
|
|
3
3
|
/* empty css */import { Space as N, message as a, Typography as p } from "antd";
|
|
4
4
|
import r from "classnames";
|
|
@@ -11,47 +11,49 @@ const j = (f) => {
|
|
|
11
11
|
item: e,
|
|
12
12
|
isRecommendClearing: g,
|
|
13
13
|
isOnlyQuestion: i,
|
|
14
|
-
question:
|
|
15
|
-
setQuestion:
|
|
16
|
-
onItemClick:
|
|
17
|
-
} = f, [n,
|
|
14
|
+
question: t,
|
|
15
|
+
setQuestion: m,
|
|
16
|
+
onItemClick: o
|
|
17
|
+
} = f, [n, c] = h(!1), {
|
|
18
18
|
popupContainer: l
|
|
19
19
|
} = v(x);
|
|
20
20
|
return y(() => {
|
|
21
|
-
e && (!e.icon && !e.file.url && !e.name ?
|
|
21
|
+
e && (!e.icon && !e.file.url && !e.name ? c(!0) : c(!1));
|
|
22
22
|
}, [e]), /* @__PURE__ */ d(N, {
|
|
23
23
|
direction: "vertical",
|
|
24
24
|
size: i || !i && n ? 0 : 4,
|
|
25
25
|
className: r({
|
|
26
26
|
"question-pannel": !0,
|
|
27
|
-
"question-pannel__active": (
|
|
27
|
+
"question-pannel__active": (t == null ? void 0 : t.id) === e.id,
|
|
28
28
|
"multiline-question-pannel": !i && n
|
|
29
29
|
}),
|
|
30
30
|
onClick: () => {
|
|
31
31
|
if (g) {
|
|
32
32
|
a.config({
|
|
33
|
-
getContainer: () => (l == null ? void 0 : l.current) || document.body
|
|
33
|
+
getContainer: () => (l == null ? void 0 : l.current) || document.body,
|
|
34
|
+
prefixCls: "gbot-message"
|
|
34
35
|
}), a.error("请稍后"), a.config({
|
|
35
|
-
getContainer: void 0
|
|
36
|
+
getContainer: void 0,
|
|
37
|
+
prefixCls: "gbot-message"
|
|
36
38
|
});
|
|
37
39
|
return;
|
|
38
40
|
}
|
|
39
|
-
(
|
|
41
|
+
(t == null ? void 0 : t.id) === e.id ? (m(void 0), o == null || o(void 0)) : (m(e), o == null || o(e));
|
|
40
42
|
},
|
|
41
43
|
children: [/* @__PURE__ */ d("div", {
|
|
42
44
|
className: r({
|
|
43
45
|
"question-top": !0,
|
|
44
46
|
"not-have-top": i || !i && n
|
|
45
47
|
}),
|
|
46
|
-
children: [!!(e != null && e.icon) && /* @__PURE__ */
|
|
48
|
+
children: [!!(e != null && e.icon) && /* @__PURE__ */ s("div", {
|
|
47
49
|
className: "question-top-tip",
|
|
48
|
-
children: /* @__PURE__ */
|
|
50
|
+
children: /* @__PURE__ */ s("img", {
|
|
49
51
|
src: e.icon,
|
|
50
52
|
alt: ""
|
|
51
53
|
})
|
|
52
|
-
}), /* @__PURE__ */
|
|
54
|
+
}), /* @__PURE__ */ s("div", {
|
|
53
55
|
className: "question-top-title",
|
|
54
|
-
children: /* @__PURE__ */
|
|
56
|
+
children: /* @__PURE__ */ s(p.Paragraph, {
|
|
55
57
|
style: {
|
|
56
58
|
margin: 0,
|
|
57
59
|
width: "100%"
|
|
@@ -62,22 +64,22 @@ const j = (f) => {
|
|
|
62
64
|
},
|
|
63
65
|
children: e.name
|
|
64
66
|
})
|
|
65
|
-
}), /* @__PURE__ */
|
|
67
|
+
}), /* @__PURE__ */ s("div", {
|
|
66
68
|
className: r({
|
|
67
69
|
"question-top-type": !0,
|
|
68
70
|
"question-only-plus-file": !i && !e.icon && !e.name
|
|
69
71
|
}),
|
|
70
|
-
children: !!((u = e.file) != null && u.url) && /* @__PURE__ */
|
|
72
|
+
children: !!((u = e.file) != null && u.url) && /* @__PURE__ */ s("img", {
|
|
71
73
|
className: "file-icon",
|
|
72
74
|
src: C[q(e.file.url) || ""]
|
|
73
75
|
})
|
|
74
76
|
})]
|
|
75
|
-
}), /* @__PURE__ */
|
|
77
|
+
}), /* @__PURE__ */ s("div", {
|
|
76
78
|
className: r({
|
|
77
79
|
"question-bottom": !0,
|
|
78
80
|
"multiline-question": !i && n
|
|
79
81
|
}),
|
|
80
|
-
children: /* @__PURE__ */
|
|
82
|
+
children: /* @__PURE__ */ s(p.Paragraph, {
|
|
81
83
|
style: {
|
|
82
84
|
margin: 0,
|
|
83
85
|
width: "100%"
|