@glodon-aiot/agent-cli-ui 3.7.0-alpha.3 → 3.9.0-alpha.5
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 +274 -265
- package/dist/es/Dialog/SessionList/index.mjs +266 -202
- package/dist/es/components/KnowledgeList/index.mjs +54 -48
- package/dist/es/constant.mjs +4 -3
- 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/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/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/style24.css +1 -1
- package/dist/es/src/style25.css +1 -1
- package/dist/es/src/style26.css +1 -1
- package/dist/es/src/style28.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/style7.css +1 -1
- package/dist/es/src/style8.css +1 -1
- package/dist/es/src/style9.css +1 -1
- package/dist/es/utils/index.mjs +30 -22
- package/dist/lib/index.js +54 -54
- package/dist/src/constant.d.ts +1 -0
- package/dist/src/utils/index.d.ts +2 -0
- package/package.json +3 -3
|
@@ -1,242 +1,295 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
for (var
|
|
6
|
-
|
|
7
|
-
if (
|
|
8
|
-
for (var
|
|
9
|
-
|
|
10
|
-
return
|
|
1
|
+
var Pe = Object.defineProperty;
|
|
2
|
+
var he = Object.getOwnPropertySymbols;
|
|
3
|
+
var je = Object.prototype.hasOwnProperty, De = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var me = (A, u, a) => u in A ? Pe(A, u, { enumerable: !0, configurable: !0, writable: !0, value: a }) : A[u] = a, pe = (A, u) => {
|
|
5
|
+
for (var a in u || (u = {}))
|
|
6
|
+
je.call(u, a) && me(A, a, u[a]);
|
|
7
|
+
if (he)
|
|
8
|
+
for (var a of he(u))
|
|
9
|
+
De.call(u, a) && me(A, a, u[a]);
|
|
10
|
+
return A;
|
|
11
11
|
};
|
|
12
|
-
var
|
|
13
|
-
var
|
|
12
|
+
var L = (A, u, a) => new Promise((r, O) => {
|
|
13
|
+
var k = (N) => {
|
|
14
14
|
try {
|
|
15
|
-
|
|
16
|
-
} catch (
|
|
17
|
-
|
|
15
|
+
M(a.next(N));
|
|
16
|
+
} catch (x) {
|
|
17
|
+
O(x);
|
|
18
18
|
}
|
|
19
|
-
},
|
|
19
|
+
}, J = (N) => {
|
|
20
20
|
try {
|
|
21
|
-
|
|
22
|
-
} catch (
|
|
23
|
-
|
|
21
|
+
M(a.throw(N));
|
|
22
|
+
} catch (x) {
|
|
23
|
+
O(x);
|
|
24
24
|
}
|
|
25
|
-
},
|
|
26
|
-
|
|
25
|
+
}, M = (N) => N.done ? r(N.value) : Promise.resolve(N.value).then(k, J);
|
|
26
|
+
M((a = a.apply(A, u)).next());
|
|
27
27
|
});
|
|
28
|
-
import { jsx as
|
|
29
|
-
import { forwardRef as
|
|
30
|
-
import { Button as
|
|
28
|
+
import { jsx as f, jsxs as S } from "react/jsx-runtime";
|
|
29
|
+
import { forwardRef as Ie, useState as b, useContext as Re, useRef as H, useEffect as D, useImperativeHandle as Ye, useMemo as $e } from "react";
|
|
30
|
+
import { Button as Ve, Typography as Ce, Space as ue, Popconfirm as ye, Input as He, Divider as Fe } from "antd";
|
|
31
31
|
import h from "dayjs";
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
/* empty css */import { useMemoizedFn as
|
|
36
|
-
import { NET_OPEN_STATUS as
|
|
37
|
-
import { useSessionState as
|
|
38
|
-
|
|
32
|
+
import Ke from "classnames";
|
|
33
|
+
import ge from "../../components/Iconfont/index.mjs";
|
|
34
|
+
import ze from "../../context.mjs";
|
|
35
|
+
/* empty css */import { useMemoizedFn as ve } from "ahooks";
|
|
36
|
+
import { MAX_KNOWLEDGES_AND_FILES_COUNT as F, NET_OPEN_STATUS as we } from "../../constant.mjs";
|
|
37
|
+
import { useSessionState as Be } from "../../hooks/useSessionState.mjs";
|
|
38
|
+
import { calcKnowledgesLeafCount as Ae } from "../../utils/index.mjs";
|
|
39
|
+
const q = 15, Ge = Ie((A, u) => {
|
|
39
40
|
const {
|
|
40
|
-
currentSession:
|
|
41
|
-
setCurrentSession:
|
|
42
|
-
checkKnowledges:
|
|
43
|
-
application:
|
|
44
|
-
networkStatus:
|
|
45
|
-
isShowHeader:
|
|
46
|
-
afterSessionClick:
|
|
47
|
-
sessionId:
|
|
48
|
-
} =
|
|
49
|
-
agentClient:
|
|
50
|
-
mode:
|
|
51
|
-
features:
|
|
52
|
-
} =
|
|
53
|
-
sessions:
|
|
54
|
-
setSessions:
|
|
55
|
-
} =
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
41
|
+
currentSession: a,
|
|
42
|
+
setCurrentSession: r,
|
|
43
|
+
checkKnowledges: O,
|
|
44
|
+
application: k,
|
|
45
|
+
networkStatus: J,
|
|
46
|
+
isShowHeader: M = !0,
|
|
47
|
+
afterSessionClick: N,
|
|
48
|
+
sessionId: x
|
|
49
|
+
} = A, [K, z] = b(), {
|
|
50
|
+
agentClient: m,
|
|
51
|
+
mode: Q,
|
|
52
|
+
features: o
|
|
53
|
+
} = Re(ze), [ee, te] = b(O), {
|
|
54
|
+
sessions: T,
|
|
55
|
+
setSessions: _
|
|
56
|
+
} = Be(), [ae, B] = b(0), [Ne, I] = b(""), [Ee, oe] = b(null), P = 30, [G, R] = b(!1), [Y, $] = b(!0), [ke, V] = b(!1), C = H(void 0), j = H(0), U = H(null), X = H(null), ne = (e) => {
|
|
57
|
+
var n, s;
|
|
58
|
+
if (!(e != null && e.length))
|
|
59
|
+
return;
|
|
60
|
+
let t = (s = (n = e[0]) == null ? void 0 : n.data) == null ? void 0 : s.createdAt;
|
|
61
|
+
return e.forEach((d) => {
|
|
62
|
+
var l, p, g, w;
|
|
63
|
+
t ? (p = d.data) != null && p.createdAt && h((g = d.data) == null ? void 0 : g.createdAt).valueOf() < h(t).valueOf() && (t = (w = d.data) == null ? void 0 : w.createdAt) : t = (l = d.data) == null ? void 0 : l.createdAt;
|
|
64
|
+
}), t;
|
|
65
|
+
}, de = ve((e) => {
|
|
66
|
+
e.id && _((t) => [...t.map((d) => {
|
|
67
|
+
var l;
|
|
68
|
+
return ((l = d.data) == null ? void 0 : l.id) === e.id && (d.data = pe({}, e)), d;
|
|
69
|
+
})].sort((d, l) => {
|
|
70
|
+
var w, E;
|
|
71
|
+
const p = h((w = d.data) == null ? void 0 : w.createdAt).valueOf();
|
|
72
|
+
return h((E = l.data) == null ? void 0 : E.createdAt).valueOf() - p;
|
|
63
73
|
}));
|
|
64
74
|
});
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
75
|
+
D(() => {
|
|
76
|
+
if (Q === "float") {
|
|
77
|
+
a === void 0 && !x && (r == null || r(null));
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
R(!0), C.current = void 0, j.current = 0, m == null || m.getSessions({
|
|
81
|
+
pageSize: P
|
|
82
|
+
}).then((e) => L(void 0, null, function* () {
|
|
83
|
+
var t;
|
|
84
|
+
if (_([...e]), j.current = e.length, C.current = ne(e), $(e.length >= P), V(e.length < P), !((t = a == null ? void 0 : a.data) != null && t.id) && (e != null && e.length) && Q === "inlay") {
|
|
85
|
+
const n = e[0];
|
|
86
|
+
x || r == null || r(n);
|
|
71
87
|
} else
|
|
72
|
-
|
|
73
|
-
}));
|
|
74
|
-
}, []),
|
|
75
|
-
var
|
|
76
|
-
if (!((
|
|
77
|
-
const
|
|
78
|
-
|
|
88
|
+
a === void 0 && (x || r == null || r(null));
|
|
89
|
+
})).finally(() => R(!1));
|
|
90
|
+
}, []), D(() => {
|
|
91
|
+
var e;
|
|
92
|
+
if (!((e = a == null ? void 0 : a.data) != null && e.id) && O === void 0) {
|
|
93
|
+
const t = typeof (o == null ? void 0 : o.knowledges) == "object" && o.knowledges.default || void 0;
|
|
94
|
+
if (Array.isArray(t) && t.some((d) => Array.isArray(d.fileIds) && d.fileIds.length === 0))
|
|
95
|
+
throw Error("fileIds cannot be an empty array");
|
|
96
|
+
if (Ae(t || []) > F)
|
|
97
|
+
throw Error(`knowledges and fileIds total count cannot exceed ${F}`);
|
|
98
|
+
te(t);
|
|
79
99
|
return;
|
|
80
100
|
}
|
|
81
|
-
|
|
82
|
-
}, [
|
|
83
|
-
|
|
84
|
-
}, [
|
|
85
|
-
create(
|
|
86
|
-
return
|
|
101
|
+
te(O);
|
|
102
|
+
}, [O]), D(() => {
|
|
103
|
+
a == null || a.addEventListener("data:updated", de);
|
|
104
|
+
}, [a]), Ye(u, () => ({
|
|
105
|
+
create(e) {
|
|
106
|
+
return re(e).then((t) => (r == null || r(t), t));
|
|
87
107
|
},
|
|
88
|
-
list: () => Promise.resolve(
|
|
108
|
+
list: () => Promise.resolve(T)
|
|
89
109
|
}));
|
|
90
|
-
const
|
|
91
|
-
const
|
|
92
|
-
return new Promise((
|
|
93
|
-
var
|
|
94
|
-
const
|
|
95
|
-
name:
|
|
110
|
+
const re = (e) => {
|
|
111
|
+
const t = typeof (o == null ? void 0 : o.connectNetwork) == "object" && typeof (o == null ? void 0 : o.connectNetwork.default) == "boolean" ? o.connectNetwork.default : !1;
|
|
112
|
+
return new Promise((n) => L(void 0, null, function* () {
|
|
113
|
+
var l;
|
|
114
|
+
const s = typeof (o == null ? void 0 : o.promptVariables) == "object" ? (o == null ? void 0 : o.promptVariables.default) || [] : void 0, d = yield m == null ? void 0 : m.loadSession("", {
|
|
115
|
+
name: e == null ? void 0 : e.name,
|
|
96
116
|
// @ts-ignore netOpen入参是number 响应是boolen
|
|
97
117
|
// 只有对话有联网 其它没有
|
|
98
118
|
// 不传netOpen会默认取defaultNetOpen
|
|
99
|
-
netOpen: (
|
|
100
|
-
knowledges: (
|
|
101
|
-
promptVariables:
|
|
119
|
+
netOpen: (k == null ? void 0 : k.type) === 0 ? e != null && e.netOpen ? e.netOpen : t ? we.OPEN : we.CLOSE : void 0,
|
|
120
|
+
knowledges: (l = a == null ? void 0 : a.data) != null && l.id ? e == null ? void 0 : e.knowledges : ee,
|
|
121
|
+
promptVariables: s
|
|
102
122
|
});
|
|
103
|
-
|
|
104
|
-
|
|
123
|
+
d == null || d.addEventListener("data:created", () => L(void 0, null, function* () {
|
|
124
|
+
_([d, ...T]), n(d);
|
|
105
125
|
}));
|
|
106
126
|
}));
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
knowledges:
|
|
110
|
-
}).then((
|
|
111
|
-
|
|
127
|
+
}, be = () => {
|
|
128
|
+
re({
|
|
129
|
+
knowledges: ee
|
|
130
|
+
}).then((e) => {
|
|
131
|
+
r == null || r(e);
|
|
112
132
|
});
|
|
113
|
-
},
|
|
114
|
-
|
|
115
|
-
var
|
|
116
|
-
const
|
|
117
|
-
var
|
|
118
|
-
return ((
|
|
133
|
+
}, Oe = (e) => {
|
|
134
|
+
m == null || m.removeSession(e, !0).then(() => L(void 0, null, function* () {
|
|
135
|
+
var n, s;
|
|
136
|
+
const t = T.filter((d) => {
|
|
137
|
+
var l, p;
|
|
138
|
+
return ((l = d.data) == null ? void 0 : l.id) !== ((p = e.data) == null ? void 0 : p.id);
|
|
119
139
|
});
|
|
120
|
-
((
|
|
140
|
+
((n = e.data) == null ? void 0 : n.id) === ((s = a == null ? void 0 : a.data) == null ? void 0 : s.id) && (t != null && t.length ? r == null || r(t[0]) : r == null || r(null)), _([...t]);
|
|
121
141
|
}));
|
|
122
|
-
},
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
142
|
+
}, Me = () => L(void 0, null, function* () {
|
|
143
|
+
if (!(G || !Y)) {
|
|
144
|
+
R(!0);
|
|
145
|
+
try {
|
|
146
|
+
const e = yield m == null ? void 0 : m.getSessions({
|
|
147
|
+
pageSize: P,
|
|
148
|
+
beforeTime: C.current
|
|
149
|
+
}), t = (e == null ? void 0 : e.length) || 0, n = t - j.current;
|
|
150
|
+
_([...e || []]), C.current = ne(e || []), n <= 0 ? ($(!1), V(!0)) : n < P ? ($(!1), V(!0), j.current = t) : ($(!0), V(!1), j.current = t);
|
|
151
|
+
} finally {
|
|
152
|
+
R(!1);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
D(() => {
|
|
157
|
+
if (!U.current || !X.current)
|
|
158
|
+
return;
|
|
159
|
+
const e = U.current, t = X.current, n = new IntersectionObserver((s) => {
|
|
160
|
+
s[0].isIntersecting && Y && !G && Me();
|
|
161
|
+
}, {
|
|
162
|
+
root: e,
|
|
163
|
+
rootMargin: "0px 0px 200px 0px",
|
|
164
|
+
threshold: 0
|
|
165
|
+
});
|
|
166
|
+
return n.observe(t), () => n.disconnect();
|
|
167
|
+
}, [Y, G]);
|
|
168
|
+
const xe = (e) => {
|
|
169
|
+
var t, n;
|
|
170
|
+
z((t = e.data) == null ? void 0 : t.name), I(""), oe(((n = e.data) == null ? void 0 : n.id) || null);
|
|
171
|
+
}, Le = (e) => {
|
|
172
|
+
const t = le(K || "");
|
|
173
|
+
if (t) {
|
|
174
|
+
I(t);
|
|
129
175
|
return;
|
|
130
176
|
}
|
|
131
|
-
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
},
|
|
137
|
-
|
|
138
|
-
}),
|
|
139
|
-
const
|
|
140
|
-
|
|
177
|
+
e.rename(K.trim()), e == null || e.addEventListener("data:updated", de), ie();
|
|
178
|
+
}, Se = () => {
|
|
179
|
+
ie();
|
|
180
|
+
}, ie = () => {
|
|
181
|
+
oe(null), z(""), I(""), B((e) => e + 1);
|
|
182
|
+
}, le = (e) => !e || e.trim().length === 0 ? "会话名称不能为空" : e.length > q ? `不能超过${q}个字符` : "", Te = (e) => L(void 0, null, function* () {
|
|
183
|
+
r == null || r(e), N == null || N(e);
|
|
184
|
+
}), _e = (e) => {
|
|
185
|
+
const t = e.target.value;
|
|
186
|
+
z(t), I(le(t));
|
|
141
187
|
};
|
|
142
|
-
|
|
143
|
-
var
|
|
144
|
-
if (!(
|
|
188
|
+
D(() => {
|
|
189
|
+
var t, n, s, d;
|
|
190
|
+
if (!(a != null && a.id))
|
|
145
191
|
return;
|
|
146
|
-
const
|
|
147
|
-
typeof (
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
192
|
+
const e = {};
|
|
193
|
+
if (typeof (o == null ? void 0 : o.knowledges) == "object" && ((t = o == null ? void 0 : o.knowledges) != null && t.default)) {
|
|
194
|
+
if (e.knowledges = (n = o == null ? void 0 : o.knowledges) == null ? void 0 : n.default, Array.isArray(e.knowledges) && e.knowledges.some((g) => Array.isArray(g.fileIds) && g.fileIds.length === 0))
|
|
195
|
+
throw Error("fileIds cannot be an empty array");
|
|
196
|
+
if (Ae(e.knowledges) > F)
|
|
197
|
+
throw Error(`knowledges and fileIds total count cannot exceed ${F}`);
|
|
198
|
+
}
|
|
199
|
+
typeof (o == null ? void 0 : o.promptVariables) == "object" && ((s = o == null ? void 0 : o.promptVariables) != null && s.default) && (e.promptVariables = (d = o == null ? void 0 : o.promptVariables) == null ? void 0 : d.default), m == null || m.loadSession(a.id, e);
|
|
200
|
+
}, [a]);
|
|
201
|
+
const ce = ve((e) => {
|
|
202
|
+
const t = h().endOf("day"), n = t.subtract(1, "day"), s = t.subtract(7, "day"), d = t.subtract(30, "day"), l = [], p = [], g = [], w = [], E = {};
|
|
203
|
+
return e.forEach((c) => {
|
|
204
|
+
var v;
|
|
205
|
+
const i = h((v = c.data) == null ? void 0 : v.createdAt);
|
|
206
|
+
if (i.isAfter(n))
|
|
207
|
+
p.push(c);
|
|
208
|
+
else if (i.isAfter(s))
|
|
155
209
|
g.push(c);
|
|
156
|
-
else if (i.isAfter(
|
|
157
|
-
O.push(c);
|
|
158
|
-
else if (i.isAfter(l))
|
|
210
|
+
else if (i.isAfter(d))
|
|
159
211
|
w.push(c);
|
|
160
212
|
else {
|
|
161
|
-
const
|
|
162
|
-
|
|
213
|
+
const y = i.format("YYYY-MM");
|
|
214
|
+
E[y] || (E[y] = []), E[y].push(c);
|
|
163
215
|
}
|
|
164
|
-
}),
|
|
216
|
+
}), p.length > 0 && l.push({
|
|
165
217
|
title: "今天",
|
|
166
|
-
sessions:
|
|
167
|
-
var
|
|
168
|
-
return h((
|
|
218
|
+
sessions: p.sort((c, i) => {
|
|
219
|
+
var v, y;
|
|
220
|
+
return h((v = i.data) == null ? void 0 : v.createdAt).valueOf() - h((y = c.data) == null ? void 0 : y.createdAt).valueOf();
|
|
169
221
|
}),
|
|
170
222
|
key: "today"
|
|
171
|
-
}),
|
|
223
|
+
}), g.length > 0 && l.push({
|
|
172
224
|
title: "7天内",
|
|
173
|
-
sessions:
|
|
174
|
-
var
|
|
175
|
-
return h((
|
|
225
|
+
sessions: g.sort((c, i) => {
|
|
226
|
+
var v, y;
|
|
227
|
+
return h((v = i.data) == null ? void 0 : v.createdAt).valueOf() - h((y = c.data) == null ? void 0 : y.createdAt).valueOf();
|
|
176
228
|
}),
|
|
177
229
|
key: "seven-days"
|
|
178
|
-
}), w.length > 0 &&
|
|
230
|
+
}), w.length > 0 && l.push({
|
|
179
231
|
title: "30天内",
|
|
180
232
|
sessions: w.sort((c, i) => {
|
|
181
|
-
var
|
|
182
|
-
return h((
|
|
233
|
+
var v, y;
|
|
234
|
+
return h((v = i.data) == null ? void 0 : v.createdAt).valueOf() - h((y = c.data) == null ? void 0 : y.createdAt).valueOf();
|
|
183
235
|
}),
|
|
184
236
|
key: "thirty-days"
|
|
185
|
-
}), Object.keys(
|
|
186
|
-
const i =
|
|
187
|
-
var
|
|
188
|
-
return h((
|
|
237
|
+
}), Object.keys(E).sort((c, i) => i.localeCompare(c)).forEach((c) => {
|
|
238
|
+
const i = E[c].sort((v, y) => {
|
|
239
|
+
var se, fe;
|
|
240
|
+
return h((se = y.data) == null ? void 0 : se.createdAt).valueOf() - h((fe = v.data) == null ? void 0 : fe.createdAt).valueOf();
|
|
189
241
|
});
|
|
190
|
-
|
|
242
|
+
l.push({
|
|
191
243
|
title: h(c).format("YYYY年MM月"),
|
|
192
244
|
sessions: i,
|
|
193
245
|
key: `month-${c}`
|
|
194
246
|
});
|
|
195
|
-
}),
|
|
196
|
-
}),
|
|
197
|
-
return /* @__PURE__ */
|
|
247
|
+
}), l;
|
|
248
|
+
}), W = $e(() => ce(T), [T, ce]);
|
|
249
|
+
return /* @__PURE__ */ f("div", {
|
|
198
250
|
className: "bot-session-container",
|
|
199
|
-
children: /* @__PURE__ */
|
|
251
|
+
children: /* @__PURE__ */ S("div", {
|
|
200
252
|
className: "agent-sessions",
|
|
201
|
-
children: [
|
|
253
|
+
children: [M && (o == null ? void 0 : o.siderTitle) && /* @__PURE__ */ f("div", {
|
|
202
254
|
className: "sessions-header",
|
|
203
|
-
children: /* @__PURE__ */
|
|
255
|
+
children: /* @__PURE__ */ f("div", {
|
|
204
256
|
className: "session-header-title",
|
|
205
|
-
children: (
|
|
257
|
+
children: (k == null ? void 0 : k.name) || "-"
|
|
206
258
|
})
|
|
207
|
-
}), /* @__PURE__ */
|
|
259
|
+
}), /* @__PURE__ */ S("div", {
|
|
208
260
|
className: "sessions-main",
|
|
209
|
-
|
|
261
|
+
ref: U,
|
|
262
|
+
children: [M && /* @__PURE__ */ f("div", {
|
|
210
263
|
className: "session-header-btn-wrapper",
|
|
211
|
-
children: /* @__PURE__ */
|
|
264
|
+
children: /* @__PURE__ */ f(Ve, {
|
|
212
265
|
className: "session-header-btn",
|
|
213
|
-
onClick:
|
|
266
|
+
onClick: be,
|
|
214
267
|
type: "primary",
|
|
215
268
|
children: "+ 新会话"
|
|
216
269
|
})
|
|
217
|
-
}),
|
|
218
|
-
var
|
|
219
|
-
return /* @__PURE__ */
|
|
270
|
+
}), W == null ? void 0 : W.map((e) => {
|
|
271
|
+
var t;
|
|
272
|
+
return /* @__PURE__ */ S("div", {
|
|
220
273
|
className: "session-group",
|
|
221
|
-
children: [/* @__PURE__ */
|
|
274
|
+
children: [/* @__PURE__ */ f("div", {
|
|
222
275
|
className: "group-header",
|
|
223
276
|
style: {
|
|
224
|
-
top:
|
|
277
|
+
top: M ? 48 : 0
|
|
225
278
|
},
|
|
226
|
-
children:
|
|
227
|
-
}), (
|
|
228
|
-
var
|
|
229
|
-
return /* @__PURE__ */
|
|
230
|
-
className:
|
|
279
|
+
children: e.title
|
|
280
|
+
}), (t = e.sessions) == null ? void 0 : t.map((n) => {
|
|
281
|
+
var s, d, l, p, g, w, E, Z, c;
|
|
282
|
+
return /* @__PURE__ */ f("div", {
|
|
283
|
+
className: Ke({
|
|
231
284
|
"session-item": !0,
|
|
232
|
-
"session-item__active": ((
|
|
285
|
+
"session-item__active": ((s = n.data) == null ? void 0 : s.id) === ((d = a == null ? void 0 : a.data) == null ? void 0 : d.id)
|
|
233
286
|
}),
|
|
234
|
-
onClick: () =>
|
|
235
|
-
children: /* @__PURE__ */
|
|
287
|
+
onClick: () => Te(n),
|
|
288
|
+
children: /* @__PURE__ */ f("div", {
|
|
236
289
|
className: "session-item-wrapper",
|
|
237
|
-
children: /* @__PURE__ */
|
|
290
|
+
children: /* @__PURE__ */ S("div", {
|
|
238
291
|
className: "session-item-top",
|
|
239
|
-
children: [/* @__PURE__ */
|
|
292
|
+
children: [/* @__PURE__ */ f(Ce.Paragraph, {
|
|
240
293
|
className: "item-top-title",
|
|
241
294
|
style: {
|
|
242
295
|
margin: 0,
|
|
@@ -245,79 +298,90 @@ const B = 15, Lt = gt((N, m) => {
|
|
|
245
298
|
ellipsis: {
|
|
246
299
|
rows: 1,
|
|
247
300
|
tooltip: {
|
|
248
|
-
title: ((
|
|
301
|
+
title: ((l = n.data) == null ? void 0 : l.name) || "-",
|
|
249
302
|
placement: "topLeft"
|
|
250
303
|
}
|
|
251
304
|
},
|
|
252
|
-
children: ((
|
|
253
|
-
}), /* @__PURE__ */
|
|
254
|
-
children: [/* @__PURE__ */
|
|
305
|
+
children: ((p = n.data) == null ? void 0 : p.name) || "-"
|
|
306
|
+
}), /* @__PURE__ */ S(ue, {
|
|
307
|
+
children: [/* @__PURE__ */ f("span", {
|
|
255
308
|
className: "item-top-time",
|
|
256
|
-
children: h((
|
|
257
|
-
}), /* @__PURE__ */
|
|
309
|
+
children: h((g = n.data) == null ? void 0 : g.createdAt).format("MM/DD HH:mm:ss")
|
|
310
|
+
}), /* @__PURE__ */ S("div", {
|
|
258
311
|
className: "item-top-action",
|
|
259
312
|
onClick: (i) => i.stopPropagation(),
|
|
260
|
-
children: [/* @__PURE__ */
|
|
261
|
-
open:
|
|
313
|
+
children: [/* @__PURE__ */ f(ye, {
|
|
314
|
+
open: Ee === ((w = n.data) == null ? void 0 : w.id),
|
|
262
315
|
getPopupContainer: (i) => i.parentNode,
|
|
263
316
|
icon: !1,
|
|
264
|
-
title: /* @__PURE__ */
|
|
317
|
+
title: /* @__PURE__ */ f(He, {
|
|
265
318
|
placeholder: "请输入内容",
|
|
266
319
|
autoComplete: "off",
|
|
267
320
|
showCount: !0,
|
|
268
|
-
value:
|
|
269
|
-
onChange:
|
|
270
|
-
maxLength:
|
|
271
|
-
status:
|
|
321
|
+
value: K,
|
|
322
|
+
onChange: _e,
|
|
323
|
+
maxLength: q,
|
|
324
|
+
status: Ne ? "error" : ""
|
|
272
325
|
}),
|
|
273
|
-
onConfirm: () =>
|
|
274
|
-
onCancel:
|
|
275
|
-
children: /* @__PURE__ */
|
|
326
|
+
onConfirm: () => Le(n),
|
|
327
|
+
onCancel: Se,
|
|
328
|
+
children: /* @__PURE__ */ f(ge, {
|
|
276
329
|
type: "icon-bianji2",
|
|
277
|
-
onClick: () =>
|
|
330
|
+
onClick: () => xe(n),
|
|
278
331
|
className: "icon-action",
|
|
279
332
|
style: {
|
|
280
333
|
marginRight: "8px"
|
|
281
334
|
}
|
|
282
335
|
})
|
|
283
|
-
}, `edit-${(
|
|
336
|
+
}, `edit-${(E = n.data) == null ? void 0 : E.id}-${ae}`), /* @__PURE__ */ f(ye, {
|
|
284
337
|
getPopupContainer: (i) => i.parentNode,
|
|
285
338
|
icon: !1,
|
|
286
|
-
title: /* @__PURE__ */
|
|
339
|
+
title: /* @__PURE__ */ S(ue, {
|
|
287
340
|
direction: "vertical",
|
|
288
|
-
children: [/* @__PURE__ */
|
|
341
|
+
children: [/* @__PURE__ */ f("div", {
|
|
289
342
|
children: "删除确认?"
|
|
290
|
-
}), /* @__PURE__ */
|
|
343
|
+
}), /* @__PURE__ */ f("div", {
|
|
291
344
|
children: "会话删除后不可恢复,请确认是否删除!"
|
|
292
345
|
})]
|
|
293
346
|
}),
|
|
294
347
|
onConfirm: () => {
|
|
295
|
-
|
|
348
|
+
Oe(n), B((i) => i + 1);
|
|
296
349
|
},
|
|
297
350
|
onCancel: () => {
|
|
298
|
-
|
|
351
|
+
B((i) => i + 1);
|
|
299
352
|
},
|
|
300
|
-
children: /* @__PURE__ */
|
|
353
|
+
children: /* @__PURE__ */ f(ge, {
|
|
301
354
|
style: {
|
|
302
355
|
fontSize: "18px"
|
|
303
356
|
},
|
|
304
357
|
className: "icon-action",
|
|
305
358
|
type: "icon-del"
|
|
306
359
|
})
|
|
307
|
-
}, `delete-${(
|
|
360
|
+
}, `delete-${(Z = n.data) == null ? void 0 : Z.id}-${ae}`)]
|
|
308
361
|
})]
|
|
309
362
|
})]
|
|
310
363
|
})
|
|
311
364
|
})
|
|
312
|
-
}, (c =
|
|
365
|
+
}, (c = n.data) == null ? void 0 : c.id);
|
|
313
366
|
})]
|
|
314
|
-
},
|
|
367
|
+
}, e.key);
|
|
368
|
+
}), !Y && ke && /* @__PURE__ */ f(Fe, {
|
|
369
|
+
style: {
|
|
370
|
+
color: "rgb(199 199 199)"
|
|
371
|
+
},
|
|
372
|
+
plain: !0,
|
|
373
|
+
children: "没有更多数据了"
|
|
374
|
+
}), /* @__PURE__ */ f("div", {
|
|
375
|
+
ref: X,
|
|
376
|
+
style: {
|
|
377
|
+
height: 1
|
|
378
|
+
}
|
|
315
379
|
})]
|
|
316
380
|
})]
|
|
317
381
|
})
|
|
318
382
|
});
|
|
319
383
|
});
|
|
320
|
-
|
|
384
|
+
Ge.displayName = "SessionList";
|
|
321
385
|
export {
|
|
322
|
-
|
|
386
|
+
Ge as default
|
|
323
387
|
};
|