@glodon-aiot/agent-cli-ui 3.2.10-beta.6 → 3.2.10-beta.8
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/HistoryItem/index.mjs +46 -44
- package/dist/es/Dialog/SessionAction/index.mjs +35 -33
- package/dist/es/Dialog/SessionListDrawer/HistorySessionList/index.mjs +78 -74
- package/dist/es/Dialog/UploadKnowledgeFiles/index.mjs +161 -143
- 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/style15.css +1 -1
- package/dist/es/src/style16.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 -0
- package/dist/es/src/style21.css +1 -1
- package/dist/es/src/style24.css +0 -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/style29.css +1 -1
- package/dist/es/src/style31.css +1 -1
- package/dist/es/src/style32.css +1 -1
- package/dist/es/src/style7.css +1 -1
- package/dist/es/src/style9.css +1 -1
- package/dist/lib/index.js +5 -5
- package/package.json +3 -3
|
@@ -3,9 +3,9 @@ import { memo as d, useContext as re, useState as ae } from "react";
|
|
|
3
3
|
import c from "../../InputProgress/index.mjs";
|
|
4
4
|
import oe from "../SessionRefer/index.mjs";
|
|
5
5
|
import de from "../SessionAction/index.mjs";
|
|
6
|
-
import { IHistoryRole as
|
|
6
|
+
import { IHistoryRole as q, IThinkingStatus as D } from "@glodon-aiot/apis";
|
|
7
7
|
import ce from "../../FileItem/index.mjs";
|
|
8
|
-
import { Popover as pe, Space as
|
|
8
|
+
import { Popover as pe, Space as V, Button as W, Row as me, Col as ue, Collapse as G, Divider as he, message as C } from "antd";
|
|
9
9
|
import ge from "../SearchReference/index.mjs";
|
|
10
10
|
/* empty css */import Ne from "../HistoryContent/index.mjs";
|
|
11
11
|
import fe from "../../components/Markdown/index.mjs";
|
|
@@ -27,7 +27,7 @@ const ke = (o) => {
|
|
|
27
27
|
} catch (l) {
|
|
28
28
|
return o;
|
|
29
29
|
}
|
|
30
|
-
}, Te = d(ge), Y = d(oe),
|
|
30
|
+
}, Te = d(ge), Y = d(oe), L = d(fe);
|
|
31
31
|
d(Ne);
|
|
32
32
|
const Ae = d(ce);
|
|
33
33
|
d(Re);
|
|
@@ -45,7 +45,7 @@ const u = (o) => {
|
|
|
45
45
|
const l = JSON.parse(JSON.stringify(o)) || [], a = (n = l == null ? void 0 : l.pop()) == null ? void 0 : n.pop();
|
|
46
46
|
return a ? (a == null ? void 0 : a.type) === "BEFORE_CALL" || (a == null ? void 0 : a.type) === "FUNCTION_CALL" : !1;
|
|
47
47
|
}, Ze = (o) => {
|
|
48
|
-
var
|
|
48
|
+
var b, E, k, T, A, O, x, F, _, I;
|
|
49
49
|
const {
|
|
50
50
|
application: l,
|
|
51
51
|
currentSession: a,
|
|
@@ -58,23 +58,25 @@ const u = (o) => {
|
|
|
58
58
|
onEditClick: N,
|
|
59
59
|
actions: ne = !0
|
|
60
60
|
} = o, {
|
|
61
|
-
debug:
|
|
61
|
+
debug: v,
|
|
62
62
|
transform: i,
|
|
63
63
|
popupContainer: f
|
|
64
|
-
} = re(Le),
|
|
64
|
+
} = re(Le), R = n.role === q.User, S = n.role === q.Robot, {
|
|
65
65
|
Panel: te
|
|
66
|
-
} =
|
|
67
|
-
|
|
66
|
+
} = G, [y, ie] = ae(!0), le = () => {
|
|
67
|
+
C.config({
|
|
68
68
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
69
|
-
}), Se(n.content),
|
|
69
|
+
}), Se(n.content), C.success("复制成功"), C.config({
|
|
70
|
+
getContainer: () => document.body
|
|
71
|
+
});
|
|
70
72
|
};
|
|
71
73
|
return /* @__PURE__ */ r("div", {
|
|
72
74
|
className: ye({
|
|
73
75
|
"history-item": !0,
|
|
74
|
-
"history-item__user":
|
|
75
|
-
"history-item__bot":
|
|
76
|
+
"history-item__user": R,
|
|
77
|
+
"history-item__bot": S
|
|
76
78
|
}),
|
|
77
|
-
children: [
|
|
79
|
+
children: [R && /* @__PURE__ */ r("div", {
|
|
78
80
|
className: "history-item-user",
|
|
79
81
|
children: [/* @__PURE__ */ e("div", {
|
|
80
82
|
className: "item-user-panel",
|
|
@@ -85,13 +87,13 @@ const u = (o) => {
|
|
|
85
87
|
},
|
|
86
88
|
overlayClassName: "session-item-overlay-popover",
|
|
87
89
|
getPopupContainer: (t) => t.parentNode,
|
|
88
|
-
content: i != null && i.userEdit || i != null && i.userCopy ? /* @__PURE__ */ r(
|
|
90
|
+
content: i != null && i.userEdit || i != null && i.userCopy ? /* @__PURE__ */ r(V, {
|
|
89
91
|
className: "item-user-popover",
|
|
90
92
|
size: 4,
|
|
91
93
|
children: [(i == null ? void 0 : i.userEdit) && /* @__PURE__ */ e("div", {
|
|
92
94
|
className: "user-pannel-item",
|
|
93
95
|
onClick: () => N == null ? void 0 : N(n.content),
|
|
94
|
-
children: /* @__PURE__ */ e(
|
|
96
|
+
children: /* @__PURE__ */ e(W, {
|
|
95
97
|
type: "link",
|
|
96
98
|
size: "small",
|
|
97
99
|
icon: /* @__PURE__ */ e(p, {
|
|
@@ -101,7 +103,7 @@ const u = (o) => {
|
|
|
101
103
|
}), (i == null ? void 0 : i.userCopy) && /* @__PURE__ */ e("div", {
|
|
102
104
|
className: "user-pannel-item",
|
|
103
105
|
onClick: le,
|
|
104
|
-
children: /* @__PURE__ */ e(
|
|
106
|
+
children: /* @__PURE__ */ e(W, {
|
|
105
107
|
type: "link",
|
|
106
108
|
size: "small",
|
|
107
109
|
icon: /* @__PURE__ */ e(p, {
|
|
@@ -117,7 +119,7 @@ const u = (o) => {
|
|
|
117
119
|
className: "user-panel-main",
|
|
118
120
|
children: /* @__PURE__ */ e("span", {
|
|
119
121
|
className: "item-user-content",
|
|
120
|
-
children: /* @__PURE__ */ e(
|
|
122
|
+
children: /* @__PURE__ */ e(L, {
|
|
121
123
|
showLatex: !1,
|
|
122
124
|
children: Ee(n.content)
|
|
123
125
|
})
|
|
@@ -130,7 +132,7 @@ const u = (o) => {
|
|
|
130
132
|
gutter: [12, 12],
|
|
131
133
|
justify: "end",
|
|
132
134
|
wrap: !0,
|
|
133
|
-
children: (
|
|
135
|
+
children: (b = n.files) == null ? void 0 : b.map((t) => /* @__PURE__ */ e(ue, {
|
|
134
136
|
className: "user-file-col",
|
|
135
137
|
children: /* @__PURE__ */ e(Ae, {
|
|
136
138
|
docViewerUrl: g,
|
|
@@ -140,34 +142,34 @@ const u = (o) => {
|
|
|
140
142
|
}, t.id))
|
|
141
143
|
})
|
|
142
144
|
})]
|
|
143
|
-
}),
|
|
145
|
+
}), S && /* @__PURE__ */ e("div", {
|
|
144
146
|
className: "history-item-bot",
|
|
145
147
|
children: /* @__PURE__ */ r("div", {
|
|
146
148
|
className: "bot-content-wrapper",
|
|
147
149
|
children: [l.type === 2 && /* @__PURE__ */ r("div", {
|
|
148
150
|
className: "item-bot-plugin",
|
|
149
|
-
children: [/* @__PURE__ */ e(
|
|
151
|
+
children: [/* @__PURE__ */ e(G, {
|
|
150
152
|
ghost: !0,
|
|
151
153
|
expandIconPosition: "right",
|
|
152
|
-
children: (
|
|
153
|
-
var
|
|
154
|
+
children: (E = n.actions) == null ? void 0 : E.map((t, se) => {
|
|
155
|
+
var U, z, j, B, w, M, J, P, Q, H;
|
|
154
156
|
return /* @__PURE__ */ r(te, {
|
|
155
|
-
collapsible:
|
|
156
|
-
showArrow:
|
|
157
|
-
header: /* @__PURE__ */ r(
|
|
157
|
+
collapsible: v ? "header" : "icon",
|
|
158
|
+
showArrow: v,
|
|
159
|
+
header: /* @__PURE__ */ r(V, {
|
|
158
160
|
size: 8,
|
|
159
161
|
style: {
|
|
160
162
|
width: "100%"
|
|
161
163
|
},
|
|
162
164
|
children: [/* @__PURE__ */ r("span", {
|
|
163
165
|
className: "bot-plugin-status",
|
|
164
|
-
children: [(t[t.length - 1].type === "RESULT" || t[t.length - 1].type === "AFTER_CALL") && u((
|
|
166
|
+
children: [(t[t.length - 1].type === "RESULT" || t[t.length - 1].type === "AFTER_CALL") && u((U = t.find((s) => s.type === "RESULT")) == null ? void 0 : U.data.result) && /* @__PURE__ */ e("span", {
|
|
165
167
|
className: "plugin-status-success",
|
|
166
168
|
children: /* @__PURE__ */ e(K, {})
|
|
167
169
|
}), t[t.length - 1].type === "ABORT" && /* @__PURE__ */ e("span", {
|
|
168
170
|
className: "plugin-status-error",
|
|
169
171
|
children: /* @__PURE__ */ e(X, {})
|
|
170
|
-
}), (t[t.length - 1].type === "RESULT" || t[t.length - 1].type === "AFTER_CALL") && !u((
|
|
172
|
+
}), (t[t.length - 1].type === "RESULT" || t[t.length - 1].type === "AFTER_CALL") && !u((z = t.find((s) => s.type === "RESULT")) == null ? void 0 : z.data.result) && /* @__PURE__ */ e("span", {
|
|
171
173
|
className: "plugin-status-error",
|
|
172
174
|
children: /* @__PURE__ */ e(X, {})
|
|
173
175
|
}), (t[t.length - 1].type === "BEFORE_CALL" || t[t.length - 1].type === "FUNCTION_CALL") && /* @__PURE__ */ e("span", {
|
|
@@ -176,17 +178,17 @@ const u = (o) => {
|
|
|
176
178
|
})]
|
|
177
179
|
}), /* @__PURE__ */ e("span", {
|
|
178
180
|
className: "bot-plugin-title",
|
|
179
|
-
children: (
|
|
181
|
+
children: (j = t[t.length - 1].data) == null ? void 0 : j.pluginName
|
|
180
182
|
}), /* @__PURE__ */ e("span", {
|
|
181
183
|
className: "bot-plugin-action",
|
|
182
|
-
children: (
|
|
184
|
+
children: (B = t[t.length - 1].data) == null ? void 0 : B.funcName
|
|
183
185
|
}), (t[t.length - 1].type === "BEFORE_CALL" || t[t.length - 1].type === "FUNCTION_CALL") && /* @__PURE__ */ e("span", {
|
|
184
186
|
className: "bot-plugin-result",
|
|
185
187
|
children: "执行中"
|
|
186
|
-
}), (t[t.length - 1].type === "RESULT" || t[t.length - 1].type === "AFTER_CALL") && u((
|
|
188
|
+
}), (t[t.length - 1].type === "RESULT" || t[t.length - 1].type === "AFTER_CALL") && u((w = t.find((s) => s.type === "RESULT")) == null ? void 0 : w.data.result) && /* @__PURE__ */ e("span", {
|
|
187
189
|
className: "bot-plugin-result",
|
|
188
190
|
children: "执行成功"
|
|
189
|
-
}), (t[t.length - 1].type === "RESULT" || t[t.length - 1].type === "AFTER_CALL") && !u((
|
|
191
|
+
}), (t[t.length - 1].type === "RESULT" || t[t.length - 1].type === "AFTER_CALL") && !u((M = t.find((s) => s.type === "RESULT")) == null ? void 0 : M.data.result) && /* @__PURE__ */ e("span", {
|
|
190
192
|
className: "bot-plugin-result",
|
|
191
193
|
children: "执行失败"
|
|
192
194
|
}), t[t.length - 1].type === "ABORT" && /* @__PURE__ */ e("span", {
|
|
@@ -200,7 +202,7 @@ const u = (o) => {
|
|
|
200
202
|
}), /* @__PURE__ */ e("div", {
|
|
201
203
|
className: "bot-plugin-json",
|
|
202
204
|
children: /* @__PURE__ */ e(m, {
|
|
203
|
-
josn: (
|
|
205
|
+
josn: (J = t.find((s) => s.type === "BEFORE_CALL")) == null ? void 0 : J.data.thought
|
|
204
206
|
})
|
|
205
207
|
}), /* @__PURE__ */ e("div", {
|
|
206
208
|
className: "bot-plugin-content",
|
|
@@ -208,7 +210,7 @@ const u = (o) => {
|
|
|
208
210
|
}), /* @__PURE__ */ e("div", {
|
|
209
211
|
className: "bot-plugin-json",
|
|
210
212
|
children: /* @__PURE__ */ e(m, {
|
|
211
|
-
josn: (
|
|
213
|
+
josn: (P = t.find((s) => s.type === "BEFORE_CALL")) == null ? void 0 : P.data.parameters
|
|
212
214
|
})
|
|
213
215
|
}), /* @__PURE__ */ e("div", {
|
|
214
216
|
className: "bot-plugin-content",
|
|
@@ -216,7 +218,7 @@ const u = (o) => {
|
|
|
216
218
|
}), /* @__PURE__ */ e("div", {
|
|
217
219
|
className: "bot-plugin-json",
|
|
218
220
|
children: /* @__PURE__ */ e(m, {
|
|
219
|
-
josn: (
|
|
221
|
+
josn: (Q = t.find((s) => s.type === "BEFORE_CALL")) == null ? void 0 : Q.data.requestBody
|
|
220
222
|
})
|
|
221
223
|
}), /* @__PURE__ */ e("div", {
|
|
222
224
|
className: "bot-plugin-content",
|
|
@@ -224,7 +226,7 @@ const u = (o) => {
|
|
|
224
226
|
}), /* @__PURE__ */ e("div", {
|
|
225
227
|
className: "bot-plugin-json",
|
|
226
228
|
children: /* @__PURE__ */ e(m, {
|
|
227
|
-
josn: ke((
|
|
229
|
+
josn: ke((H = t.find((s) => s.type === "RESULT")) == null ? void 0 : H.data.result)
|
|
228
230
|
})
|
|
229
231
|
})]
|
|
230
232
|
}, se);
|
|
@@ -239,12 +241,12 @@ const u = (o) => {
|
|
|
239
241
|
text: "思考中"
|
|
240
242
|
})
|
|
241
243
|
})]
|
|
242
|
-
}), !!((
|
|
244
|
+
}), !!((k = n.searchReference) != null && k.length) && /* @__PURE__ */ e("div", {
|
|
243
245
|
className: "item-bot-net",
|
|
244
246
|
children: /* @__PURE__ */ e(Te, {
|
|
245
247
|
history: n
|
|
246
248
|
})
|
|
247
|
-
}), (
|
|
249
|
+
}), (T = n == null ? void 0 : n.reference) != null && T.length && ((A = i == null ? void 0 : i.reference) != null && A.referenceFirst) ? /* @__PURE__ */ e(Y, {
|
|
248
250
|
history: n,
|
|
249
251
|
docViewerUrl: g
|
|
250
252
|
}) : null, /* @__PURE__ */ r("div", {
|
|
@@ -277,27 +279,27 @@ const u = (o) => {
|
|
|
277
279
|
}
|
|
278
280
|
})
|
|
279
281
|
})]
|
|
280
|
-
}), !!((
|
|
282
|
+
}), !!((O = n == null ? void 0 : n.reasoningContent) != null && O.trim()) && y && /* @__PURE__ */ r("div", {
|
|
281
283
|
className: "think-bottom",
|
|
282
284
|
children: [/* @__PURE__ */ r("div", {
|
|
283
285
|
className: "bottom-left",
|
|
284
|
-
children: [(n == null ? void 0 : n.thinkingStatus) ===
|
|
286
|
+
children: [(n == null ? void 0 : n.thinkingStatus) === D.Start && /* @__PURE__ */ e("div", {
|
|
285
287
|
className: "thinking"
|
|
286
|
-
}), (n == null ? void 0 : n.thinkingStatus) ===
|
|
288
|
+
}), (n == null ? void 0 : n.thinkingStatus) === D.End && /* @__PURE__ */ e("div", {
|
|
287
289
|
className: "thinked",
|
|
288
290
|
children: /* @__PURE__ */ e(K, {})
|
|
289
291
|
})]
|
|
290
292
|
}), /* @__PURE__ */ e("div", {
|
|
291
293
|
className: "bottom-right",
|
|
292
|
-
children: /* @__PURE__ */ e(
|
|
294
|
+
children: /* @__PURE__ */ e(L, {
|
|
293
295
|
children: (n == null ? void 0 : n.reasoningContent) || ""
|
|
294
296
|
})
|
|
295
297
|
})]
|
|
296
298
|
})]
|
|
297
|
-
}), /* @__PURE__ */ e(
|
|
299
|
+
}), /* @__PURE__ */ e(L, {
|
|
298
300
|
children: n.content
|
|
299
301
|
})]
|
|
300
|
-
}), (
|
|
302
|
+
}), (x = n == null ? void 0 : n.reference) != null && x.length && !((F = i == null ? void 0 : i.reference) != null && F.referenceFirst) ? /* @__PURE__ */ e(Y, {
|
|
301
303
|
history: n,
|
|
302
304
|
docViewerUrl: g
|
|
303
305
|
}) : null, n.isRelatedQuestion && h ? /* @__PURE__ */ e("div", {
|
|
@@ -316,13 +318,13 @@ const u = (o) => {
|
|
|
316
318
|
size: 4,
|
|
317
319
|
text: "思考中"
|
|
318
320
|
})
|
|
319
|
-
}), l.arrange[0].recommendQuestionOpen && (i == null ? void 0 : i.relate) && h && !!((
|
|
321
|
+
}), l.arrange[0].recommendQuestionOpen && (i == null ? void 0 : i.relate) && h && !!((_ = n.relatedQuesion) != null && _.length) && /* @__PURE__ */ e(ve, {
|
|
320
322
|
relatedQuesion: n.relatedQuesion,
|
|
321
323
|
onRelatedClick: $
|
|
322
324
|
}), ne && !n.isSensitive && !!n.messageId && /* @__PURE__ */ e(de, {
|
|
323
325
|
appId: l.id,
|
|
324
326
|
history: n,
|
|
325
|
-
sessionId: (
|
|
327
|
+
sessionId: (I = a == null ? void 0 : a.data) == null ? void 0 : I.id,
|
|
326
328
|
onAgainClick: ee,
|
|
327
329
|
isLastHistory: h,
|
|
328
330
|
currentSession: a
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as r, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { useState as l, useContext as O, useEffect as D } from "react";
|
|
3
|
-
import { Space as
|
|
3
|
+
import { Space as w, Popover as L, Popconfirm as M, Input as H, message as v, notification as u, Button as Q } from "antd";
|
|
4
4
|
import m from "../../Iconfont/index.mjs";
|
|
5
5
|
import $ from "copy-to-clipboard";
|
|
6
6
|
import F from "classnames";
|
|
@@ -18,15 +18,15 @@ const J = [{
|
|
|
18
18
|
id: 4,
|
|
19
19
|
name: "其他原因"
|
|
20
20
|
}], te = (P) => {
|
|
21
|
-
var
|
|
21
|
+
var z;
|
|
22
22
|
const {
|
|
23
|
-
appId:
|
|
23
|
+
appId: x,
|
|
24
24
|
history: t,
|
|
25
25
|
isLastHistory: T = !1,
|
|
26
26
|
sessionId: d,
|
|
27
27
|
currentSession: i,
|
|
28
28
|
onAgainClick: g
|
|
29
|
-
} = P, [a, h] = l([]), [C,
|
|
29
|
+
} = P, [a, h] = l([]), [C, I] = l(), [y, b] = l(!1), [_, A] = l(!1), {
|
|
30
30
|
service: K,
|
|
31
31
|
popupContainer: o,
|
|
32
32
|
transform: N,
|
|
@@ -39,73 +39,75 @@ const J = [{
|
|
|
39
39
|
D(() => {
|
|
40
40
|
var e;
|
|
41
41
|
k((e = t == null ? void 0 : t.comment) == null ? void 0 : e.isAgree);
|
|
42
|
-
}, [(
|
|
42
|
+
}, [(z = t == null ? void 0 : t.comment) == null ? void 0 : z.isAgree]);
|
|
43
43
|
const R = () => {
|
|
44
|
-
|
|
44
|
+
v.config({
|
|
45
45
|
getContainer: () => (o == null ? void 0 : o.current) || document.body
|
|
46
|
-
}), $(t.content),
|
|
46
|
+
}), $(t.content), v.success("复制成功"), v.config({
|
|
47
|
+
getContainer: () => document.body
|
|
48
|
+
});
|
|
47
49
|
}, S = (e) => {
|
|
48
50
|
if (!d || !(t != null && t.messageId))
|
|
49
51
|
return;
|
|
50
|
-
const
|
|
52
|
+
const c = {
|
|
51
53
|
messageId: t.messageId,
|
|
52
54
|
isAgree: e
|
|
53
55
|
};
|
|
54
|
-
i == null || i.postMessageComment(
|
|
55
|
-
k(e), t != null && t.comment && (t.comment.isAgree = e), !(e <= 0) && (
|
|
56
|
-
|
|
56
|
+
i == null || i.postMessageComment(c).then(() => {
|
|
57
|
+
k(e), t != null && t.comment && (t.comment.isAgree = e), !(e <= 0) && (A(!0), setTimeout(() => {
|
|
58
|
+
A(!1);
|
|
57
59
|
}, 2e3));
|
|
58
60
|
}), p && p({
|
|
59
|
-
applicationId:
|
|
61
|
+
applicationId: x,
|
|
60
62
|
sessionId: d,
|
|
61
|
-
comment:
|
|
63
|
+
comment: c
|
|
62
64
|
});
|
|
63
65
|
}, j = (e) => {
|
|
64
|
-
if (a.some((
|
|
65
|
-
const
|
|
66
|
-
h([...
|
|
66
|
+
if (a.some((c) => c.id === e.id)) {
|
|
67
|
+
const c = a.filter((s) => s.id !== e.id);
|
|
68
|
+
h([...c]);
|
|
67
69
|
} else
|
|
68
70
|
h([...a, e]);
|
|
69
71
|
}, B = (e) => {
|
|
70
|
-
|
|
72
|
+
I(e.target.value);
|
|
71
73
|
}, E = () => {
|
|
72
74
|
if (!d)
|
|
73
75
|
return;
|
|
74
76
|
if (!(a != null && a.length))
|
|
75
|
-
return
|
|
77
|
+
return b(!0), Promise.reject();
|
|
76
78
|
let e = [];
|
|
77
|
-
a != null && a.length && (e = [...e, ...a.map((
|
|
78
|
-
const
|
|
79
|
+
a != null && a.length && (e = [...e, ...a.map((s) => s.name)]), C && (e = [...e, C]);
|
|
80
|
+
const c = {
|
|
79
81
|
messageId: t.messageId,
|
|
80
82
|
isAgree: -1,
|
|
81
83
|
againstReason: e
|
|
82
84
|
};
|
|
83
85
|
u.config({
|
|
84
86
|
getContainer: () => (o == null ? void 0 : o.current) || document.body
|
|
85
|
-
}), i == null || i.postMessageComment(
|
|
87
|
+
}), i == null || i.postMessageComment(c).then(() => {
|
|
86
88
|
k(-1), t != null && t.comment && (t.comment.isAgree = -1);
|
|
87
|
-
const
|
|
89
|
+
const s = `open${Date.now()}`;
|
|
88
90
|
u.success({
|
|
89
91
|
message: "提交反馈成功",
|
|
90
92
|
description: "感谢您的参与,我们会认真评估每一条建议!",
|
|
91
93
|
duration: 2,
|
|
92
94
|
btn: /* @__PURE__ */ n(Q, {
|
|
93
95
|
type: "primary",
|
|
94
|
-
onClick: () => u.close(
|
|
96
|
+
onClick: () => u.close(s),
|
|
95
97
|
children: "我知道了"
|
|
96
98
|
}),
|
|
97
|
-
key:
|
|
98
|
-
onClose: () => u.close(
|
|
99
|
+
key: s,
|
|
100
|
+
onClose: () => u.close(s)
|
|
99
101
|
});
|
|
100
102
|
}), p && p({
|
|
101
|
-
applicationId:
|
|
103
|
+
applicationId: x,
|
|
102
104
|
sessionId: d,
|
|
103
|
-
comment:
|
|
105
|
+
comment: c
|
|
104
106
|
});
|
|
105
107
|
};
|
|
106
108
|
return /* @__PURE__ */ r("div", {
|
|
107
109
|
className: "session-action",
|
|
108
|
-
children: [N != null && N.again && T ? /* @__PURE__ */ r(
|
|
110
|
+
children: [N != null && N.again && T ? /* @__PURE__ */ r(w, {
|
|
109
111
|
className: "session-action-again",
|
|
110
112
|
onClick: () => g == null ? void 0 : g(),
|
|
111
113
|
children: [/* @__PURE__ */ n(m, {
|
|
@@ -118,7 +120,7 @@ const J = [{
|
|
|
118
120
|
})]
|
|
119
121
|
}) : /* @__PURE__ */ n("span", {}), /* @__PURE__ */ n("div", {
|
|
120
122
|
className: "session-action-comment",
|
|
121
|
-
children: /* @__PURE__ */ r(
|
|
123
|
+
children: /* @__PURE__ */ r(w, {
|
|
122
124
|
size: 8,
|
|
123
125
|
className: "action-comment-feedback",
|
|
124
126
|
children: [!t.isSuspend && /* @__PURE__ */ n("span", {
|
|
@@ -134,7 +136,7 @@ const J = [{
|
|
|
134
136
|
onClick: () => S(1)
|
|
135
137
|
})
|
|
136
138
|
}), f === 1 && /* @__PURE__ */ n(L, {
|
|
137
|
-
open:
|
|
139
|
+
open: _,
|
|
138
140
|
getPopupContainer: (e) => e.parentNode,
|
|
139
141
|
content: /* @__PURE__ */ n("div", {
|
|
140
142
|
className: "zan-text",
|
|
@@ -154,7 +156,7 @@ const J = [{
|
|
|
154
156
|
cancelText: "取消",
|
|
155
157
|
getPopupContainer: (e) => e.parentNode,
|
|
156
158
|
onOpenChange: (e) => {
|
|
157
|
-
e && (h([]),
|
|
159
|
+
e && (h([]), I(""), b(!1));
|
|
158
160
|
},
|
|
159
161
|
icon: !1,
|
|
160
162
|
title: /* @__PURE__ */ r("div", {
|
|
@@ -173,12 +175,12 @@ const J = [{
|
|
|
173
175
|
children: J.map((e) => /* @__PURE__ */ n("span", {
|
|
174
176
|
className: F({
|
|
175
177
|
"cai-item": !0,
|
|
176
|
-
"cai-item__active": a.some((
|
|
178
|
+
"cai-item__active": a.some((c) => c.id === e.id)
|
|
177
179
|
}),
|
|
178
180
|
onClick: () => j(e),
|
|
179
181
|
children: e.name
|
|
180
182
|
}, e.id))
|
|
181
|
-
}),
|
|
183
|
+
}), y && /* @__PURE__ */ n("div", {
|
|
182
184
|
className: "cai-error",
|
|
183
185
|
children: /* @__PURE__ */ n("span", {
|
|
184
186
|
className: "cai-error-text",
|
|
@@ -1,119 +1,123 @@
|
|
|
1
|
-
var h = (
|
|
2
|
-
var
|
|
1
|
+
var h = (L, a, s) => new Promise((p, e) => {
|
|
2
|
+
var o = (c) => {
|
|
3
3
|
try {
|
|
4
|
-
|
|
4
|
+
u(s.next(c));
|
|
5
5
|
} catch (f) {
|
|
6
6
|
e(f);
|
|
7
7
|
}
|
|
8
|
-
},
|
|
8
|
+
}, I = (c) => {
|
|
9
9
|
try {
|
|
10
|
-
|
|
10
|
+
u(s.throw(c));
|
|
11
11
|
} catch (f) {
|
|
12
12
|
e(f);
|
|
13
13
|
}
|
|
14
|
-
},
|
|
15
|
-
|
|
14
|
+
}, u = (c) => c.done ? p(c.value) : Promise.resolve(c.value).then(o, I);
|
|
15
|
+
u((s = s.apply(L, a)).next());
|
|
16
16
|
});
|
|
17
|
-
import { jsx as
|
|
18
|
-
import { useContext as
|
|
19
|
-
import { Drawer as
|
|
20
|
-
/* empty css */import { LoadingOutlined as
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
const
|
|
17
|
+
import { jsx as b } from "react/jsx-runtime";
|
|
18
|
+
import { useContext as N, useState as E, useRef as O, useEffect as w } from "react";
|
|
19
|
+
import { Drawer as R, Spin as j, message as d } from "antd";
|
|
20
|
+
/* empty css */import { LoadingOutlined as v } from "@ant-design/icons";
|
|
21
|
+
import B from "./SessionItem.mjs";
|
|
22
|
+
import H from "../../../context.mjs";
|
|
23
|
+
const K = (L) => {
|
|
24
24
|
const {
|
|
25
|
-
currentSessionId:
|
|
26
|
-
onSessionChange:
|
|
27
|
-
onClose:
|
|
28
|
-
} =
|
|
25
|
+
currentSessionId: a,
|
|
26
|
+
onSessionChange: s,
|
|
27
|
+
onClose: p
|
|
28
|
+
} = L, {
|
|
29
29
|
agentClient: e,
|
|
30
|
-
popupContainer:
|
|
31
|
-
} =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
popupContainer: o
|
|
31
|
+
} = N(H), [I, u] = E(!1), [c, f] = E(!1), [x, C] = E(""), [g, l] = E([]), n = O(g);
|
|
32
|
+
w(() => {
|
|
33
|
+
n.current = [], l(n.current), u(!0), e == null || e.getSessions().then((t) => h(void 0, null, function* () {
|
|
34
|
+
u(!1), n.current = [...t], l(n.current);
|
|
35
35
|
}));
|
|
36
|
-
}, []),
|
|
37
|
-
|
|
36
|
+
}, []), w(() => {
|
|
37
|
+
g.length && a && setTimeout(() => {
|
|
38
38
|
var t;
|
|
39
|
-
(t = document.getElementById(
|
|
39
|
+
(t = document.getElementById(a)) == null || t.scrollIntoView(!0);
|
|
40
40
|
}, 100);
|
|
41
|
-
}, [
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
getContainer: () => (
|
|
41
|
+
}, [g]);
|
|
42
|
+
const T = (t, r) => {
|
|
43
|
+
d.config({
|
|
44
|
+
getContainer: () => (o == null ? void 0 : o.current) || document.body
|
|
45
45
|
}), e == null || e.removeSession(t, !0).then(() => h(void 0, null, function* () {
|
|
46
|
-
const
|
|
47
|
-
var
|
|
48
|
-
return ((
|
|
46
|
+
const i = g.filter((m) => {
|
|
47
|
+
var S, y;
|
|
48
|
+
return ((S = m.data) == null ? void 0 : S.id) !== ((y = t.data) == null ? void 0 : y.id);
|
|
49
49
|
});
|
|
50
|
-
t.data.id ===
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
t.data.id === a && s && s(""), d.success("删除成功"), d.config({
|
|
51
|
+
getContainer: () => document.body
|
|
52
|
+
}), n.current = [...i], l(n.current);
|
|
53
|
+
})), r == null || r.stopPropagation();
|
|
54
|
+
}, _ = (t) => {
|
|
55
|
+
t && (s && s(t.sessionId, t), p());
|
|
56
|
+
}, $ = (t, r) => h(void 0, null, function* () {
|
|
57
|
+
d.config({
|
|
58
|
+
getContainer: () => (o == null ? void 0 : o.current) || document.body
|
|
57
59
|
});
|
|
58
60
|
try {
|
|
59
|
-
yield e == null ? void 0 : e.setTop(t.data.id,
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
yield e == null ? void 0 : e.setTop(t.data.id, r), d.success(`${r ? "" : "取消"}置顶成功`), d.config({
|
|
62
|
+
getContainer: () => document.body
|
|
63
|
+
});
|
|
64
|
+
} catch (i) {
|
|
65
|
+
d.error(`${r ? "" : "取消"}置顶失败`), d.config({
|
|
66
|
+
getContainer: () => document.body
|
|
67
|
+
});
|
|
62
68
|
}
|
|
63
69
|
e == null || e.getSessions({
|
|
64
70
|
order: "top_time desc, sort_status desc, updated_at desc"
|
|
65
|
-
}).then((
|
|
66
|
-
|
|
71
|
+
}).then((i) => h(void 0, null, function* () {
|
|
72
|
+
n.current = [...i], l(n.current);
|
|
67
73
|
}));
|
|
68
|
-
}),
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
var g, y;
|
|
74
|
-
return ((g = u.data) == null ? void 0 : g.id) === ((y = u.data) == null ? void 0 : y.id), u;
|
|
74
|
+
}), z = (t, r) => {
|
|
75
|
+
r && (t.rename(r), t == null || t.addEventListener("data:updated", () => {
|
|
76
|
+
const i = n.current.map((m) => {
|
|
77
|
+
var S, y;
|
|
78
|
+
return ((S = m.data) == null ? void 0 : S.id) === ((y = m.data) == null ? void 0 : y.id), m;
|
|
75
79
|
});
|
|
76
|
-
|
|
80
|
+
n.current = [...i], l(n.current);
|
|
77
81
|
}));
|
|
78
|
-
},
|
|
79
|
-
f(
|
|
82
|
+
}, D = (t, r) => {
|
|
83
|
+
f(r), C(t);
|
|
80
84
|
};
|
|
81
|
-
return /* @__PURE__ */
|
|
85
|
+
return /* @__PURE__ */ b(R, {
|
|
82
86
|
title: "会话历史记录",
|
|
83
87
|
open: !0,
|
|
84
88
|
placement: "bottom",
|
|
85
|
-
onClose:
|
|
86
|
-
className: `session-list-drawer ${
|
|
89
|
+
onClose: p,
|
|
90
|
+
className: `session-list-drawer ${I ? "loading-panel" : ""}`,
|
|
87
91
|
size: "large",
|
|
88
|
-
getContainer: () => (
|
|
92
|
+
getContainer: () => (o == null ? void 0 : o.current) || document.body,
|
|
89
93
|
destroyOnClose: !0,
|
|
90
94
|
style: {
|
|
91
95
|
position: "absolute"
|
|
92
96
|
},
|
|
93
|
-
children:
|
|
94
|
-
indicator: /* @__PURE__ */
|
|
97
|
+
children: I ? /* @__PURE__ */ b(j, {
|
|
98
|
+
indicator: /* @__PURE__ */ b(v, {
|
|
95
99
|
style: {
|
|
96
100
|
fontSize: 24
|
|
97
101
|
},
|
|
98
102
|
spin: !0
|
|
99
103
|
})
|
|
100
|
-
}) :
|
|
101
|
-
var
|
|
102
|
-
return /* @__PURE__ */
|
|
104
|
+
}) : g.map((t, r) => {
|
|
105
|
+
var i;
|
|
106
|
+
return /* @__PURE__ */ b(B, {
|
|
103
107
|
session: t,
|
|
104
|
-
index:
|
|
105
|
-
currentSessionId:
|
|
106
|
-
onChangeSession:
|
|
107
|
-
onDelSession:
|
|
108
|
-
onTopSession:
|
|
109
|
-
onEditNameConfirm:
|
|
110
|
-
editSessionId:
|
|
108
|
+
index: r,
|
|
109
|
+
currentSessionId: a,
|
|
110
|
+
onChangeSession: _,
|
|
111
|
+
onDelSession: T,
|
|
112
|
+
onTopSession: $,
|
|
113
|
+
onEditNameConfirm: z,
|
|
114
|
+
editSessionId: x,
|
|
111
115
|
isEdit: c,
|
|
112
|
-
onChangeEditStatus:
|
|
113
|
-
}, (
|
|
116
|
+
onChangeEditStatus: D
|
|
117
|
+
}, (i = t.data) == null ? void 0 : i.id);
|
|
114
118
|
})
|
|
115
119
|
});
|
|
116
120
|
};
|
|
117
121
|
export {
|
|
118
|
-
|
|
122
|
+
K as default
|
|
119
123
|
};
|