@glodon-aiot/agent-cli-ui 3.8.0-alpha.4 → 3.9.0-alpha.6
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/index.mjs +133 -118
- package/dist/es/Dialog/AgentChat/index.mjs +601 -571
- package/dist/es/Dialog/SessionList/index.mjs +260 -207
- package/dist/es/components/FilePreview/index.mjs +6 -6
- package/dist/es/components/Iconfont/index.mjs +3 -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/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/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/style24.css +1 -1
- package/dist/es/src/style25.css +1 -1
- package/dist/es/src/style27.css +1 -1
- package/dist/es/src/style28.css +1 -1
- package/dist/es/src/style30.css +1 -1
- package/dist/es/src/style32.css +1 -1
- package/dist/es/src/style9.css +1 -1
- package/dist/lib/index.css +1 -1
- package/dist/lib/index.js +57 -56
- package/dist/src/components/Iconfont/font_4439177_ovh05fm2i0i.d.ts +0 -0
- package/package.json +3 -3
|
@@ -1,253 +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
|
|
12
|
+
var L = (A, u, a) => new Promise((r, O) => {
|
|
13
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 { MAX_KNOWLEDGES_AND_FILES_COUNT as
|
|
37
|
-
import { useSessionState as
|
|
38
|
-
import { calcKnowledgesLeafCount as
|
|
39
|
-
const
|
|
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) => {
|
|
40
40
|
const {
|
|
41
|
-
currentSession:
|
|
42
|
-
setCurrentSession:
|
|
43
|
-
checkKnowledges:
|
|
41
|
+
currentSession: a,
|
|
42
|
+
setCurrentSession: r,
|
|
43
|
+
checkKnowledges: O,
|
|
44
44
|
application: k,
|
|
45
|
-
networkStatus:
|
|
46
|
-
isShowHeader:
|
|
45
|
+
networkStatus: J,
|
|
46
|
+
isShowHeader: M = !0,
|
|
47
47
|
afterSessionClick: N,
|
|
48
|
-
sessionId:
|
|
49
|
-
} =
|
|
50
|
-
agentClient:
|
|
51
|
-
mode:
|
|
48
|
+
sessionId: x
|
|
49
|
+
} = A, [K, z] = b(), {
|
|
50
|
+
agentClient: m,
|
|
51
|
+
mode: Q,
|
|
52
52
|
features: o
|
|
53
|
-
} =
|
|
54
|
-
sessions:
|
|
55
|
-
setSessions:
|
|
56
|
-
} =
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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;
|
|
64
73
|
}));
|
|
65
74
|
});
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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);
|
|
72
87
|
} else
|
|
73
|
-
|
|
74
|
-
}));
|
|
75
|
-
}, []),
|
|
76
|
-
var
|
|
77
|
-
if (!((
|
|
78
|
-
const
|
|
79
|
-
if (Array.isArray(
|
|
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))
|
|
80
95
|
throw Error("fileIds cannot be an empty array");
|
|
81
|
-
if (
|
|
82
|
-
throw Error(`knowledges and fileIds total count cannot exceed ${
|
|
83
|
-
|
|
96
|
+
if (Ae(t || []) > F)
|
|
97
|
+
throw Error(`knowledges and fileIds total count cannot exceed ${F}`);
|
|
98
|
+
te(t);
|
|
84
99
|
return;
|
|
85
100
|
}
|
|
86
|
-
|
|
87
|
-
}, [
|
|
88
|
-
|
|
89
|
-
}, [
|
|
90
|
-
create(
|
|
91
|
-
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));
|
|
92
107
|
},
|
|
93
|
-
list: () => Promise.resolve(
|
|
108
|
+
list: () => Promise.resolve(T)
|
|
94
109
|
}));
|
|
95
|
-
const
|
|
96
|
-
const
|
|
97
|
-
return new Promise((
|
|
98
|
-
var
|
|
99
|
-
const
|
|
100
|
-
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,
|
|
101
116
|
// @ts-ignore netOpen入参是number 响应是boolen
|
|
102
117
|
// 只有对话有联网 其它没有
|
|
103
118
|
// 不传netOpen会默认取defaultNetOpen
|
|
104
|
-
netOpen: (k == null ? void 0 : k.type) === 0 ?
|
|
105
|
-
knowledges: (
|
|
106
|
-
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
|
|
107
122
|
});
|
|
108
|
-
|
|
109
|
-
|
|
123
|
+
d == null || d.addEventListener("data:created", () => L(void 0, null, function* () {
|
|
124
|
+
_([d, ...T]), n(d);
|
|
110
125
|
}));
|
|
111
126
|
}));
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
knowledges:
|
|
115
|
-
}).then((
|
|
116
|
-
|
|
127
|
+
}, be = () => {
|
|
128
|
+
re({
|
|
129
|
+
knowledges: ee
|
|
130
|
+
}).then((e) => {
|
|
131
|
+
r == null || r(e);
|
|
117
132
|
});
|
|
118
|
-
},
|
|
119
|
-
|
|
120
|
-
var
|
|
121
|
-
const
|
|
122
|
-
var
|
|
123
|
-
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);
|
|
124
139
|
});
|
|
125
|
-
((
|
|
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]);
|
|
126
141
|
}));
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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);
|
|
134
175
|
return;
|
|
135
176
|
}
|
|
136
|
-
|
|
137
|
-
},
|
|
138
|
-
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
}),
|
|
144
|
-
const
|
|
145
|
-
|
|
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));
|
|
146
187
|
};
|
|
147
|
-
|
|
148
|
-
var
|
|
149
|
-
if (!(
|
|
188
|
+
D(() => {
|
|
189
|
+
var t, n, s, d;
|
|
190
|
+
if (!(a != null && a.id))
|
|
150
191
|
return;
|
|
151
|
-
const
|
|
152
|
-
if (typeof (o == null ? void 0 : o.knowledges) == "object" && ((
|
|
153
|
-
if (
|
|
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))
|
|
154
195
|
throw Error("fileIds cannot be an empty array");
|
|
155
|
-
if (
|
|
156
|
-
throw Error(`knowledges and fileIds total count cannot exceed ${
|
|
196
|
+
if (Ae(e.knowledges) > F)
|
|
197
|
+
throw Error(`knowledges and fileIds total count cannot exceed ${F}`);
|
|
157
198
|
}
|
|
158
|
-
typeof (o == null ? void 0 : o.promptVariables) == "object" && ((
|
|
159
|
-
}, [
|
|
160
|
-
const
|
|
161
|
-
const
|
|
162
|
-
return
|
|
163
|
-
var
|
|
164
|
-
const i = h((
|
|
165
|
-
if (i.isAfter(
|
|
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))
|
|
166
209
|
g.push(c);
|
|
167
|
-
else if (i.isAfter(
|
|
168
|
-
|
|
169
|
-
else if (i.isAfter(n))
|
|
170
|
-
E.push(c);
|
|
210
|
+
else if (i.isAfter(d))
|
|
211
|
+
w.push(c);
|
|
171
212
|
else {
|
|
172
|
-
const
|
|
173
|
-
|
|
213
|
+
const y = i.format("YYYY-MM");
|
|
214
|
+
E[y] || (E[y] = []), E[y].push(c);
|
|
174
215
|
}
|
|
175
|
-
}),
|
|
216
|
+
}), p.length > 0 && l.push({
|
|
176
217
|
title: "今天",
|
|
177
|
-
sessions:
|
|
178
|
-
var
|
|
179
|
-
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();
|
|
180
221
|
}),
|
|
181
222
|
key: "today"
|
|
182
|
-
}),
|
|
223
|
+
}), g.length > 0 && l.push({
|
|
183
224
|
title: "7天内",
|
|
184
|
-
sessions:
|
|
185
|
-
var
|
|
186
|
-
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();
|
|
187
228
|
}),
|
|
188
229
|
key: "seven-days"
|
|
189
|
-
}),
|
|
230
|
+
}), w.length > 0 && l.push({
|
|
190
231
|
title: "30天内",
|
|
191
|
-
sessions:
|
|
192
|
-
var
|
|
193
|
-
return h((
|
|
232
|
+
sessions: w.sort((c, i) => {
|
|
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();
|
|
194
235
|
}),
|
|
195
236
|
key: "thirty-days"
|
|
196
|
-
}), Object.keys(
|
|
197
|
-
const i =
|
|
198
|
-
var
|
|
199
|
-
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();
|
|
200
241
|
});
|
|
201
|
-
|
|
242
|
+
l.push({
|
|
202
243
|
title: h(c).format("YYYY年MM月"),
|
|
203
244
|
sessions: i,
|
|
204
245
|
key: `month-${c}`
|
|
205
246
|
});
|
|
206
|
-
}),
|
|
207
|
-
}),
|
|
208
|
-
return /* @__PURE__ */
|
|
247
|
+
}), l;
|
|
248
|
+
}), W = $e(() => ce(T), [T, ce]);
|
|
249
|
+
return /* @__PURE__ */ f("div", {
|
|
209
250
|
className: "bot-session-container",
|
|
210
|
-
children: /* @__PURE__ */
|
|
251
|
+
children: /* @__PURE__ */ S("div", {
|
|
211
252
|
className: "agent-sessions",
|
|
212
|
-
children: [
|
|
253
|
+
children: [M && (o == null ? void 0 : o.siderTitle) && /* @__PURE__ */ f("div", {
|
|
213
254
|
className: "sessions-header",
|
|
214
|
-
children: /* @__PURE__ */
|
|
255
|
+
children: /* @__PURE__ */ f("div", {
|
|
215
256
|
className: "session-header-title",
|
|
216
257
|
children: (k == null ? void 0 : k.name) || "-"
|
|
217
258
|
})
|
|
218
|
-
}), /* @__PURE__ */
|
|
259
|
+
}), /* @__PURE__ */ S("div", {
|
|
219
260
|
className: "sessions-main",
|
|
220
|
-
|
|
261
|
+
ref: U,
|
|
262
|
+
children: [M && /* @__PURE__ */ f("div", {
|
|
221
263
|
className: "session-header-btn-wrapper",
|
|
222
|
-
children: /* @__PURE__ */
|
|
264
|
+
children: /* @__PURE__ */ f(Ve, {
|
|
223
265
|
className: "session-header-btn",
|
|
224
|
-
onClick:
|
|
266
|
+
onClick: be,
|
|
225
267
|
type: "primary",
|
|
226
268
|
children: "+ 新会话"
|
|
227
269
|
})
|
|
228
|
-
}),
|
|
229
|
-
var
|
|
230
|
-
return /* @__PURE__ */
|
|
270
|
+
}), W == null ? void 0 : W.map((e) => {
|
|
271
|
+
var t;
|
|
272
|
+
return /* @__PURE__ */ S("div", {
|
|
231
273
|
className: "session-group",
|
|
232
|
-
children: [/* @__PURE__ */
|
|
274
|
+
children: [/* @__PURE__ */ f("div", {
|
|
233
275
|
className: "group-header",
|
|
234
276
|
style: {
|
|
235
|
-
top:
|
|
277
|
+
top: M ? 48 : 0
|
|
236
278
|
},
|
|
237
|
-
children:
|
|
238
|
-
}), (
|
|
239
|
-
var
|
|
240
|
-
return /* @__PURE__ */
|
|
241
|
-
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({
|
|
242
284
|
"session-item": !0,
|
|
243
|
-
"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)
|
|
244
286
|
}),
|
|
245
|
-
onClick: () =>
|
|
246
|
-
children: /* @__PURE__ */
|
|
287
|
+
onClick: () => Te(n),
|
|
288
|
+
children: /* @__PURE__ */ f("div", {
|
|
247
289
|
className: "session-item-wrapper",
|
|
248
|
-
children: /* @__PURE__ */
|
|
290
|
+
children: /* @__PURE__ */ S("div", {
|
|
249
291
|
className: "session-item-top",
|
|
250
|
-
children: [/* @__PURE__ */
|
|
292
|
+
children: [/* @__PURE__ */ f(Ce.Paragraph, {
|
|
251
293
|
className: "item-top-title",
|
|
252
294
|
style: {
|
|
253
295
|
margin: 0,
|
|
@@ -256,79 +298,90 @@ const F = 15, Pt = At((u, m) => {
|
|
|
256
298
|
ellipsis: {
|
|
257
299
|
rows: 1,
|
|
258
300
|
tooltip: {
|
|
259
|
-
title: ((
|
|
301
|
+
title: ((l = n.data) == null ? void 0 : l.name) || "-",
|
|
260
302
|
placement: "topLeft"
|
|
261
303
|
}
|
|
262
304
|
},
|
|
263
|
-
children: ((
|
|
264
|
-
}), /* @__PURE__ */
|
|
265
|
-
children: [/* @__PURE__ */
|
|
305
|
+
children: ((p = n.data) == null ? void 0 : p.name) || "-"
|
|
306
|
+
}), /* @__PURE__ */ S(ue, {
|
|
307
|
+
children: [/* @__PURE__ */ f("span", {
|
|
266
308
|
className: "item-top-time",
|
|
267
|
-
children: h((
|
|
268
|
-
}), /* @__PURE__ */
|
|
309
|
+
children: h((g = n.data) == null ? void 0 : g.createdAt).format("MM/DD HH:mm:ss")
|
|
310
|
+
}), /* @__PURE__ */ S("div", {
|
|
269
311
|
className: "item-top-action",
|
|
270
312
|
onClick: (i) => i.stopPropagation(),
|
|
271
|
-
children: [/* @__PURE__ */
|
|
272
|
-
open:
|
|
313
|
+
children: [/* @__PURE__ */ f(ye, {
|
|
314
|
+
open: Ee === ((w = n.data) == null ? void 0 : w.id),
|
|
273
315
|
getPopupContainer: (i) => i.parentNode,
|
|
274
316
|
icon: !1,
|
|
275
|
-
title: /* @__PURE__ */
|
|
317
|
+
title: /* @__PURE__ */ f(He, {
|
|
276
318
|
placeholder: "请输入内容",
|
|
277
319
|
autoComplete: "off",
|
|
278
320
|
showCount: !0,
|
|
279
|
-
value:
|
|
280
|
-
onChange:
|
|
281
|
-
maxLength:
|
|
282
|
-
status:
|
|
321
|
+
value: K,
|
|
322
|
+
onChange: _e,
|
|
323
|
+
maxLength: q,
|
|
324
|
+
status: Ne ? "error" : ""
|
|
283
325
|
}),
|
|
284
|
-
onConfirm: () =>
|
|
285
|
-
onCancel:
|
|
286
|
-
children: /* @__PURE__ */
|
|
326
|
+
onConfirm: () => Le(n),
|
|
327
|
+
onCancel: Se,
|
|
328
|
+
children: /* @__PURE__ */ f(ge, {
|
|
287
329
|
type: "icon-bianji2",
|
|
288
|
-
onClick: () =>
|
|
330
|
+
onClick: () => xe(n),
|
|
289
331
|
className: "icon-action",
|
|
290
332
|
style: {
|
|
291
333
|
marginRight: "8px"
|
|
292
334
|
}
|
|
293
335
|
})
|
|
294
|
-
}, `edit-${(
|
|
336
|
+
}, `edit-${(E = n.data) == null ? void 0 : E.id}-${ae}`), /* @__PURE__ */ f(ye, {
|
|
295
337
|
getPopupContainer: (i) => i.parentNode,
|
|
296
338
|
icon: !1,
|
|
297
|
-
title: /* @__PURE__ */
|
|
339
|
+
title: /* @__PURE__ */ S(ue, {
|
|
298
340
|
direction: "vertical",
|
|
299
|
-
children: [/* @__PURE__ */
|
|
341
|
+
children: [/* @__PURE__ */ f("div", {
|
|
300
342
|
children: "删除确认?"
|
|
301
|
-
}), /* @__PURE__ */
|
|
343
|
+
}), /* @__PURE__ */ f("div", {
|
|
302
344
|
children: "会话删除后不可恢复,请确认是否删除!"
|
|
303
345
|
})]
|
|
304
346
|
}),
|
|
305
347
|
onConfirm: () => {
|
|
306
|
-
|
|
348
|
+
Oe(n), B((i) => i + 1);
|
|
307
349
|
},
|
|
308
350
|
onCancel: () => {
|
|
309
|
-
|
|
351
|
+
B((i) => i + 1);
|
|
310
352
|
},
|
|
311
|
-
children: /* @__PURE__ */
|
|
353
|
+
children: /* @__PURE__ */ f(ge, {
|
|
312
354
|
style: {
|
|
313
355
|
fontSize: "18px"
|
|
314
356
|
},
|
|
315
357
|
className: "icon-action",
|
|
316
358
|
type: "icon-del"
|
|
317
359
|
})
|
|
318
|
-
}, `delete-${(
|
|
360
|
+
}, `delete-${(Z = n.data) == null ? void 0 : Z.id}-${ae}`)]
|
|
319
361
|
})]
|
|
320
362
|
})]
|
|
321
363
|
})
|
|
322
364
|
})
|
|
323
|
-
}, (c =
|
|
365
|
+
}, (c = n.data) == null ? void 0 : c.id);
|
|
324
366
|
})]
|
|
325
|
-
},
|
|
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
|
+
}
|
|
326
379
|
})]
|
|
327
380
|
})]
|
|
328
381
|
})
|
|
329
382
|
});
|
|
330
383
|
});
|
|
331
|
-
|
|
384
|
+
Ge.displayName = "SessionList";
|
|
332
385
|
export {
|
|
333
|
-
|
|
386
|
+
Ge as default
|
|
334
387
|
};
|