@yuku123/z-team-component 0.2.91 → 0.2.93
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/{ChangeLogView-DagOxr6O.js → ChangeLogView-BjV4gBq4.js} +12 -12
- package/dist/ComponentDoc-C9lt-45y.js +8035 -0
- package/dist/{InvitationManagementPage-DYoqQA0v.js → InvitationManagementPage-CWtBWLd9.js} +1 -1
- package/dist/{OnboardingPage-D2Gm8MRd.js → OnboardingPage-B2fwh4gu.js} +2 -2
- package/dist/{ScheduledTasks-DB3VxAnb.js → ScheduledTasks-CuQyjAK-.js} +4341 -4337
- package/dist/{SystemShell-D3jHItxY.js → SystemShell-CTkRb3jk.js} +11 -12
- package/dist/admin-logs-Dh41ezP6.js +198 -0
- package/dist/{api-DYsAzJJo.js → api-ChrRZOc4.js} +1 -1
- package/dist/createWorkspaceWsHandler-DMw_Vk6i.js +13135 -0
- package/dist/{index-152G-_4j.js → index-3JPBTMXq.js} +5 -6
- package/dist/{index-CLD5lLa6.js → index-7glbcqX1.js} +19 -19
- package/dist/{index-CSpckSHg.js → index-BYpA6zMn.js} +23 -23
- package/dist/{index-BydWNuk5.js → index-BZCQSW-G.js} +44 -51
- package/dist/{index-CLfhHxPf.js → index-B_2fxZ6u.js} +1 -1
- package/dist/{index-B5dDwxhs.js → index-BnRRZ6Iv.js} +1 -1
- package/dist/{index-W_4faD_M.js → index-C-XgeN0c.js} +2 -2
- package/dist/index-CA0ql0r3.js +3495 -0
- package/dist/{index-CgWa7RFv.js → index-CIGBLmd6.js} +23 -24
- package/dist/{index-Cggl78j7.js → index-CLSOhZRs.js} +5 -6
- package/dist/index-CLnmI_a7.js +316 -0
- package/dist/{index-BfzgRKii.js → index-CSXrOBjf.js} +90 -91
- package/dist/{index-ues0LW7p.js → index-CdqU0NUf.js} +1257 -1258
- package/dist/{index-BMQ6XkO3.js → index-CnWYolUK.js} +1 -1
- package/dist/{index-CYyFYmlZ.js → index-CrQpBHe1.js} +8 -9
- package/dist/{index-BZ12pY96.js → index-D1_tbmUH.js} +2 -2
- package/dist/{index-CZyFAmEq.js → index-DNo7i9f6.js} +10 -11
- package/dist/{index-DE82vM_4.js → index-DPyEBso8.js} +19 -18
- package/dist/{index-DyQ9YnMd.js → index-DdvzONMo.js} +3663 -3537
- package/dist/{index-Dwqa30HZ.js → index-Dq4oBpcb.js} +4 -4
- package/dist/{index-C8cR7lJw.js → index-DtIPLfks.js} +10 -11
- package/dist/{index-Cw6MIoNv.js → index-Dy6vNz1c.js} +6 -7
- package/dist/{index-VGtET31b.js → index-bkqC-Ys8.js} +1 -1
- package/dist/{index-E4Q6JmzX.js → index-fab1eszg.js} +3 -3
- package/dist/{index-BYe87pnq.js → index-vIdK5WMU.js} +11 -12
- package/dist/index.js +1 -1
- package/dist/{instance-CI6-4BZ6.js → instance-BY043pYn.js} +1 -1
- package/dist/{menuPermission-C33I6ujb.js → menuPermission-BeYwZcoW.js} +11 -11
- package/dist/pages.js +8 -8
- package/dist/{send-default-agent-team-message-c5oKdQQA.js → send-default-agent-team-message-BN61cG7q.js} +1 -1
- package/dist/{sso-user-DToM5dPy.js → sso-user-DmsDr1MJ.js} +1 -1
- package/dist/{training-B38tnwLL.js → training-CU6j5m-5.js} +1 -1
- package/dist/webide-BYaEjOx6.js +5233 -0
- package/dist/z-team-component.css +1 -26
- package/package.json +3 -2
- package/dist/ComponentDoc-Bqfu128t.js +0 -3998
- package/dist/admin-logs-ogvMwS4O.js +0 -302
- package/dist/api-BftpestH.js +0 -2156
- package/dist/createWorkspaceWsHandler-D8h5BEzH.js +0 -13030
- package/dist/index-BaCqZeiw.js +0 -1143
- package/dist/index-CUVdeb8y.js +0 -638
- package/dist/index-DVaTGA2z.js +0 -3488
- package/dist/schedule-ChO2xIGd.js +0 -625
- package/dist/useAppStore-uc8v8XZC.js +0 -1920
- package/dist/webide-BuUYLPSp.js +0 -8399
|
@@ -1,625 +0,0 @@
|
|
|
1
|
-
import { a as i, f as c, B as d, n as u, u as S, t as h, g as P } from "./api-BftpestH.js";
|
|
2
|
-
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
3
|
-
import { useMemo as b, useState as L, useEffect as D, Component as M } from "react";
|
|
4
|
-
const N = [
|
|
5
|
-
{ status: "TODO", label: "待办" },
|
|
6
|
-
{ status: "DOING", label: "进行中" },
|
|
7
|
-
{ status: "DONE", label: "已完成" }
|
|
8
|
-
];
|
|
9
|
-
function at(e) {
|
|
10
|
-
if (!e || !e.trim()) return [...N];
|
|
11
|
-
try {
|
|
12
|
-
const t = JSON.parse(e), n = Array.isArray(t == null ? void 0 : t.statusColumns) ? t.statusColumns : null;
|
|
13
|
-
if (!n) return [...N];
|
|
14
|
-
const o = n.map((r) => {
|
|
15
|
-
const a = r ?? {}, s = String(a.status ?? "").trim().toUpperCase(), l = String(a.label ?? "").trim();
|
|
16
|
-
return s && l ? { status: s, label: l } : null;
|
|
17
|
-
}).filter((r) => r != null);
|
|
18
|
-
return o.length > 0 ? o : [...N];
|
|
19
|
-
} catch {
|
|
20
|
-
return [...N];
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
function B(e) {
|
|
24
|
-
if (e == null) return !0;
|
|
25
|
-
const t = String(e).trim();
|
|
26
|
-
return t === "" || t === "0";
|
|
27
|
-
}
|
|
28
|
-
function I(e) {
|
|
29
|
-
const t = (s) => {
|
|
30
|
-
if (typeof s != "string" || !s.trim()) return [];
|
|
31
|
-
try {
|
|
32
|
-
const l = JSON.parse(s);
|
|
33
|
-
return Array.isArray(l) ? l.filter((p) => typeof p == "string") : [];
|
|
34
|
-
} catch {
|
|
35
|
-
return [];
|
|
36
|
-
}
|
|
37
|
-
}, n = (s) => {
|
|
38
|
-
if (typeof s != "string" || !s.trim()) return [];
|
|
39
|
-
try {
|
|
40
|
-
const l = JSON.parse(s);
|
|
41
|
-
return Array.isArray(l) ? l.filter(
|
|
42
|
-
(p) => !!p && typeof p == "object" && typeof p.type == "string"
|
|
43
|
-
) : [];
|
|
44
|
-
} catch {
|
|
45
|
-
return [];
|
|
46
|
-
}
|
|
47
|
-
}, o = () => {
|
|
48
|
-
const s = e.assigneeUserIds;
|
|
49
|
-
let l = null;
|
|
50
|
-
if (Array.isArray(s))
|
|
51
|
-
l = s;
|
|
52
|
-
else if (typeof s == "string" && s.trim())
|
|
53
|
-
try {
|
|
54
|
-
const m = JSON.parse(s);
|
|
55
|
-
l = Array.isArray(m) ? m : null;
|
|
56
|
-
} catch {
|
|
57
|
-
l = s.split(",");
|
|
58
|
-
}
|
|
59
|
-
if (l) {
|
|
60
|
-
const m = l.map((f) => String(f ?? "").trim()).filter(Boolean);
|
|
61
|
-
if (m.length > 0) return Array.from(new Set(m));
|
|
62
|
-
}
|
|
63
|
-
const p = e.assigneeUserId == null ? "" : String(e.assigneeUserId);
|
|
64
|
-
return p.trim() ? [p.trim()] : [];
|
|
65
|
-
}, r = (s) => {
|
|
66
|
-
const l = e.assignees, p = Array.isArray(l) ? l.map((m) => {
|
|
67
|
-
const f = m ?? {}, $ = String(f.userId ?? "").trim();
|
|
68
|
-
return $ ? { userId: $, name: String(f.name ?? "").trim() || $ } : null;
|
|
69
|
-
}).filter((m) => m != null) : [];
|
|
70
|
-
return p.length > 0 ? p : s.map((m) => ({ userId: m, name: m }));
|
|
71
|
-
}, a = o();
|
|
72
|
-
return {
|
|
73
|
-
id: h(e.id),
|
|
74
|
-
projectId: e.projectId == null ? null : h(e.projectId),
|
|
75
|
-
userId: String(e.userId ?? ""),
|
|
76
|
-
title: String(e.title ?? ""),
|
|
77
|
-
detail: e.detail == null ? null : String(e.detail),
|
|
78
|
-
status: e.status ?? "TODO",
|
|
79
|
-
priority: e.priority ?? "MEDIUM",
|
|
80
|
-
dueDate: e.dueDate == null ? null : String(e.dueDate).slice(0, 10),
|
|
81
|
-
assigneeUserId: a[0] ?? null,
|
|
82
|
-
assigneeUserIds: a,
|
|
83
|
-
assignees: r(a),
|
|
84
|
-
projectTitle: e.projectTitle == null || !String(e.projectTitle).trim() ? null : String(e.projectTitle),
|
|
85
|
-
tags: t(e.tags),
|
|
86
|
-
links: n(e.links),
|
|
87
|
-
parentId: B(e.parentId) ? "" : h(e.parentId),
|
|
88
|
-
sortOrder: e.sortOrder == null ? 0 : Number(e.sortOrder),
|
|
89
|
-
completedAt: e.completedAt == null ? null : String(e.completedAt),
|
|
90
|
-
completedBy: e.completedBy == null ? null : String(e.completedBy),
|
|
91
|
-
createByName: e.createByName == null ? null : String(e.createByName),
|
|
92
|
-
updateTime: e.updateTime == null ? null : String(e.updateTime),
|
|
93
|
-
agentId: e.agentId == null ? null : h(e.agentId),
|
|
94
|
-
agentSessionId: e.agentSessionId == null ? null : h(e.agentSessionId)
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
function T(e) {
|
|
98
|
-
const t = e ?? {};
|
|
99
|
-
return {
|
|
100
|
-
id: h(t.id),
|
|
101
|
-
userId: String(t.userId ?? ""),
|
|
102
|
-
title: String(t.title ?? ""),
|
|
103
|
-
icon: t.icon == null ? null : String(t.icon),
|
|
104
|
-
description: t.description == null ? null : String(t.description),
|
|
105
|
-
visibility: t.visibility === "shared" ? "shared" : "private",
|
|
106
|
-
sortOrder: t.sortOrder == null ? 0 : Number(t.sortOrder),
|
|
107
|
-
extraInfo: t.extraInfo == null ? null : String(t.extraInfo),
|
|
108
|
-
createByName: t.createByName == null ? null : String(t.createByName)
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
function C(e) {
|
|
112
|
-
const t = e ?? {}, n = Array.isArray(t.memberDetails) ? t.memberDetails : [];
|
|
113
|
-
return {
|
|
114
|
-
...T(t),
|
|
115
|
-
openCount: t.openCount == null ? 0 : Number(t.openCount),
|
|
116
|
-
memberDetails: n.map((o) => {
|
|
117
|
-
const r = o ?? {}, a = String(r.userId ?? "").trim();
|
|
118
|
-
return a ? { userId: a, userName: String(r.userName ?? "").trim() || a } : null;
|
|
119
|
-
}).filter((o) => o != null)
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
async function it(e = "") {
|
|
123
|
-
const t = e ? `?token=${encodeURIComponent(e)}` : "", n = await i(`${d}/todo/projects${t}`, c), o = await u(n, "获取待办项目失败");
|
|
124
|
-
return {
|
|
125
|
-
owned: ((o == null ? void 0 : o.owned) ?? []).map(C),
|
|
126
|
-
joined: ((o == null ? void 0 : o.joined) ?? []).map(C)
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
async function ct(e, t = "") {
|
|
130
|
-
const n = t ? `?token=${encodeURIComponent(t)}` : "", o = await i(`${d}/todo/projects${n}`, {
|
|
131
|
-
...c,
|
|
132
|
-
method: "POST",
|
|
133
|
-
headers: { "Content-Type": "application/json" },
|
|
134
|
-
body: JSON.stringify(e)
|
|
135
|
-
}), r = await u(o, "新建项目失败");
|
|
136
|
-
return T(r);
|
|
137
|
-
}
|
|
138
|
-
async function dt(e, t, n = "") {
|
|
139
|
-
const o = n ? `?token=${encodeURIComponent(n)}` : "", r = await i(`${d}/todo/projects/${e}${o}`, {
|
|
140
|
-
...c,
|
|
141
|
-
method: "PUT",
|
|
142
|
-
headers: { "Content-Type": "application/json" },
|
|
143
|
-
body: JSON.stringify(t)
|
|
144
|
-
}), a = await u(r, "更新项目失败");
|
|
145
|
-
return T(a);
|
|
146
|
-
}
|
|
147
|
-
async function lt(e, t = "") {
|
|
148
|
-
const n = t ? `?token=${encodeURIComponent(t)}` : "", o = await i(`${d}/todo/projects/${e}${n}`, {
|
|
149
|
-
...c,
|
|
150
|
-
method: "DELETE"
|
|
151
|
-
});
|
|
152
|
-
return S(o, "删除项目失败");
|
|
153
|
-
}
|
|
154
|
-
async function ut(e, t, n = "") {
|
|
155
|
-
const o = n ? `?token=${encodeURIComponent(n)}` : "", r = await i(`${d}/todo/projects/${e}/members${o}`, {
|
|
156
|
-
...c,
|
|
157
|
-
method: "POST",
|
|
158
|
-
headers: { "Content-Type": "application/json" },
|
|
159
|
-
body: JSON.stringify(t)
|
|
160
|
-
}), a = await u(r, "添加成员失败");
|
|
161
|
-
return T(a);
|
|
162
|
-
}
|
|
163
|
-
async function pt(e, t, n = "") {
|
|
164
|
-
const o = n ? `?token=${encodeURIComponent(n)}` : "", r = await i(
|
|
165
|
-
`${d}/todo/projects/${e}/members/${encodeURIComponent(t)}${o}`,
|
|
166
|
-
{ ...c, method: "DELETE" }
|
|
167
|
-
), a = await u(r, "移除成员失败");
|
|
168
|
-
return T(a);
|
|
169
|
-
}
|
|
170
|
-
async function mt(e = {}, t = "") {
|
|
171
|
-
const n = new URLSearchParams();
|
|
172
|
-
t && n.set("token", t), e.view && n.set("view", e.view), e.projectId != null && n.set("projectId", String(e.projectId)), e.status && n.set("status", e.status), e.keyword && n.set("keyword", e.keyword);
|
|
173
|
-
const o = n.toString() ? `?${n.toString()}` : "", r = await i(`${d}/todo/items${o}`, c);
|
|
174
|
-
return (await u(
|
|
175
|
-
r,
|
|
176
|
-
"获取事项失败"
|
|
177
|
-
) ?? []).map(I);
|
|
178
|
-
}
|
|
179
|
-
async function yt(e, t = "") {
|
|
180
|
-
const n = t ? `?token=${encodeURIComponent(t)}` : "", o = await i(`${d}/todo/items${n}`, {
|
|
181
|
-
...c,
|
|
182
|
-
method: "POST",
|
|
183
|
-
headers: { "Content-Type": "application/json" },
|
|
184
|
-
body: JSON.stringify(e)
|
|
185
|
-
}), r = await u(o, "新建事项失败");
|
|
186
|
-
return I(r);
|
|
187
|
-
}
|
|
188
|
-
async function ft(e, t, n = "") {
|
|
189
|
-
const o = n ? `?token=${encodeURIComponent(n)}` : "", r = await i(`${d}/todo/items/${e}${o}`, {
|
|
190
|
-
...c,
|
|
191
|
-
method: "PUT",
|
|
192
|
-
headers: { "Content-Type": "application/json" },
|
|
193
|
-
body: JSON.stringify(t)
|
|
194
|
-
}), a = await u(r, "更新事项失败");
|
|
195
|
-
return I(a);
|
|
196
|
-
}
|
|
197
|
-
async function gt(e, t = "", n = "") {
|
|
198
|
-
const o = n ? `?token=${encodeURIComponent(n)}` : "", r = await i(`${d}/todo/items/${e}/complete${o}`, {
|
|
199
|
-
...c,
|
|
200
|
-
method: "POST",
|
|
201
|
-
headers: { "Content-Type": "application/json" },
|
|
202
|
-
body: JSON.stringify({ result: t })
|
|
203
|
-
}), a = await u(r, "完成事项失败");
|
|
204
|
-
return I(a);
|
|
205
|
-
}
|
|
206
|
-
async function ht(e, t = "") {
|
|
207
|
-
const n = t ? `?token=${encodeURIComponent(t)}` : "", o = await i(`${d}/todo/items/${e}/reopen${n}`, {
|
|
208
|
-
...c,
|
|
209
|
-
method: "POST"
|
|
210
|
-
}), r = await u(o, "重开事项失败");
|
|
211
|
-
return I(r);
|
|
212
|
-
}
|
|
213
|
-
async function St(e, t, n = "") {
|
|
214
|
-
const o = n ? `?token=${encodeURIComponent(n)}` : "", r = await i(`${d}/todo/items/${e}/reorder${o}`, {
|
|
215
|
-
...c,
|
|
216
|
-
method: "POST",
|
|
217
|
-
headers: { "Content-Type": "application/json" },
|
|
218
|
-
body: JSON.stringify(t)
|
|
219
|
-
}), a = await u(r, "调整排序失败");
|
|
220
|
-
return I(a);
|
|
221
|
-
}
|
|
222
|
-
async function $t(e, t = "") {
|
|
223
|
-
const n = t ? `?token=${encodeURIComponent(t)}` : "", o = await i(`${d}/todo/items/reorder-batch${n}`, {
|
|
224
|
-
...c,
|
|
225
|
-
method: "POST",
|
|
226
|
-
headers: { "Content-Type": "application/json" },
|
|
227
|
-
body: JSON.stringify({ updates: e })
|
|
228
|
-
});
|
|
229
|
-
return S(o, "调整排序失败");
|
|
230
|
-
}
|
|
231
|
-
async function It(e, t = "") {
|
|
232
|
-
const n = t ? `?token=${encodeURIComponent(t)}` : "", o = await i(`${d}/todo/projects/reorder-batch${n}`, {
|
|
233
|
-
...c,
|
|
234
|
-
method: "POST",
|
|
235
|
-
headers: { "Content-Type": "application/json" },
|
|
236
|
-
body: JSON.stringify({ updates: e })
|
|
237
|
-
});
|
|
238
|
-
return S(o, "调整项目排序失败");
|
|
239
|
-
}
|
|
240
|
-
async function Tt(e, t = "") {
|
|
241
|
-
const n = t ? `?token=${encodeURIComponent(t)}` : "", o = await i(`${d}/todo/items/${e}${n}`, {
|
|
242
|
-
...c,
|
|
243
|
-
method: "DELETE"
|
|
244
|
-
});
|
|
245
|
-
return S(o, "删除事项失败");
|
|
246
|
-
}
|
|
247
|
-
function G(e) {
|
|
248
|
-
const t = e ?? {};
|
|
249
|
-
return {
|
|
250
|
-
todoId: h(t.todoId),
|
|
251
|
-
sessionId: t.sessionId == null ? null : h(t.sessionId),
|
|
252
|
-
agentId: t.agentId == null ? null : h(t.agentId),
|
|
253
|
-
projectSpaceId: t.projectSpaceId == null ? 0 : h(t.projectSpaceId),
|
|
254
|
-
projectSpaceTitle: String(t.projectSpaceTitle ?? ""),
|
|
255
|
-
status: String(t.status ?? ""),
|
|
256
|
-
kickoff: String(t.kickoff ?? ""),
|
|
257
|
-
spaceEntries: Array.isArray(t.spaceEntries) ? t.spaceEntries.map((n) => ({
|
|
258
|
-
path: String(n.path ?? ""),
|
|
259
|
-
name: String(n.name ?? ""),
|
|
260
|
-
dir: !!n.dir,
|
|
261
|
-
size: n.size == null ? 0 : Number(n.size)
|
|
262
|
-
})) : []
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
async function Nt(e, t, n = "") {
|
|
266
|
-
const o = n ? `?token=${encodeURIComponent(n)}` : "", r = await i(`${d}/todo/items/${e}/dispatch${o}`, {
|
|
267
|
-
...c,
|
|
268
|
-
method: "POST",
|
|
269
|
-
headers: { "Content-Type": "application/json" },
|
|
270
|
-
body: JSON.stringify({ agentId: t })
|
|
271
|
-
}), a = await u(r, "派发给 Agent 失败");
|
|
272
|
-
return G(a);
|
|
273
|
-
}
|
|
274
|
-
async function Et(e, t = "") {
|
|
275
|
-
const n = t ? `?token=${encodeURIComponent(t)}` : "", o = await i(`${d}/todo/items/${e}/undispatch${n}`, {
|
|
276
|
-
...c,
|
|
277
|
-
method: "POST"
|
|
278
|
-
}), r = await u(o, "取消派发失败");
|
|
279
|
-
return I(r);
|
|
280
|
-
}
|
|
281
|
-
const q = {
|
|
282
|
-
RUNTIME_MONITOR_VIEW: ["RUNTIME_MONITOR_MANAGE"],
|
|
283
|
-
EVALUATION_VIEW: ["EVALUATION_MANAGE"],
|
|
284
|
-
COLLABORATION_VIEW: [
|
|
285
|
-
"AGENT_MANAGE",
|
|
286
|
-
"SKILL_MANAGE",
|
|
287
|
-
"SCENARIO_MANAGE",
|
|
288
|
-
"PROFILE_MANAGE",
|
|
289
|
-
"TAG_MANAGE",
|
|
290
|
-
"TOOL_MANAGE"
|
|
291
|
-
],
|
|
292
|
-
EVOLUTION_VIEW: ["EVOLUTION_MANAGE"],
|
|
293
|
-
OPS_CONFIG_VIEW: [
|
|
294
|
-
"OPS_CONFIG_MANAGE",
|
|
295
|
-
"ONCALL_MANAGE",
|
|
296
|
-
"ANNOUNCEMENT_MANAGE",
|
|
297
|
-
"OPS_REPORT_MANAGE"
|
|
298
|
-
],
|
|
299
|
-
KNOWLEDGE_VIEW: ["KNOWLEDGE_MANAGE"],
|
|
300
|
-
WEBIDE_VIEW: ["WEBIDE_MANAGE"]
|
|
301
|
-
};
|
|
302
|
-
function Ot(e, t) {
|
|
303
|
-
var o;
|
|
304
|
-
if (!e) return !1;
|
|
305
|
-
if (e.is_global_admin || (o = e.permissions) != null && o.includes(t)) return !0;
|
|
306
|
-
const n = q[t];
|
|
307
|
-
return !!(n != null && n.some((r) => {
|
|
308
|
-
var a;
|
|
309
|
-
return (a = e.permissions) == null ? void 0 : a.includes(r);
|
|
310
|
-
}));
|
|
311
|
-
}
|
|
312
|
-
const J = "_wrap_2gcw5_1", z = "_card_2gcw5_9", V = "_badge_2gcw5_19", W = "_title_2gcw5_41", v = "_desc_2gcw5_48", x = "_actions_2gcw5_55", F = "_primary_2gcw5_63", K = "_secondary_2gcw5_75", H = "_details_2gcw5_90", Y = "_pre_2gcw5_102", Q = "_copy_2gcw5_117", X = "_compact_2gcw5_127", y = {
|
|
313
|
-
wrap: J,
|
|
314
|
-
card: z,
|
|
315
|
-
badge: V,
|
|
316
|
-
title: W,
|
|
317
|
-
desc: v,
|
|
318
|
-
actions: x,
|
|
319
|
-
primary: F,
|
|
320
|
-
secondary: K,
|
|
321
|
-
details: H,
|
|
322
|
-
pre: Y,
|
|
323
|
-
copy: Q,
|
|
324
|
-
compact: X
|
|
325
|
-
};
|
|
326
|
-
function Z(e) {
|
|
327
|
-
const t = e, n = `${(t == null ? void 0 : t.name) ?? ""} ${(t == null ? void 0 : t.message) ?? ""} ${typeof e == "string" ? e : ""}`;
|
|
328
|
-
return /ChunkLoadError|Loading chunk|Failed to fetch dynamically imported module|Importing a module script failed|error loading dynamically imported module/i.test(n);
|
|
329
|
-
}
|
|
330
|
-
function tt(e) {
|
|
331
|
-
const { status: t, error: n } = e;
|
|
332
|
-
return t === 401 ? {
|
|
333
|
-
kind: "unauthorized",
|
|
334
|
-
status: t,
|
|
335
|
-
badge: "401",
|
|
336
|
-
title: "登录已失效",
|
|
337
|
-
description: "当前会话已过期或未建立,请重新登录后继续。重登后会回到这个页面。"
|
|
338
|
-
} : t === 403 ? {
|
|
339
|
-
kind: "forbidden",
|
|
340
|
-
status: t,
|
|
341
|
-
badge: "403",
|
|
342
|
-
title: "没有访问权限",
|
|
343
|
-
description: "当前账号无权访问该功能。如需开通,请联系管理员分配权限。"
|
|
344
|
-
} : t === 404 ? {
|
|
345
|
-
kind: "not-found",
|
|
346
|
-
status: t,
|
|
347
|
-
badge: "404",
|
|
348
|
-
title: "功能接口未就绪",
|
|
349
|
-
description: "这个页面要用的后端接口还没有部署,或前后端路径对不上。可以重试;若持续如此,请把技术详情发给运维确认版本。"
|
|
350
|
-
} : t && t >= 500 ? {
|
|
351
|
-
kind: "server",
|
|
352
|
-
status: t,
|
|
353
|
-
badge: String(t),
|
|
354
|
-
title: "服务暂时不可用",
|
|
355
|
-
description: "后端返回了错误。稍后重试;如果反复出现,请把技术详情发给运维。"
|
|
356
|
-
} : t === 0 ? {
|
|
357
|
-
kind: "network",
|
|
358
|
-
status: t,
|
|
359
|
-
badge: "!",
|
|
360
|
-
title: "网络不可用",
|
|
361
|
-
description: "请求没有到达后端。请检查网络,或确认本地后端服务是否已启动。"
|
|
362
|
-
} : Z(n) ? {
|
|
363
|
-
kind: "chunk",
|
|
364
|
-
badge: "⟳",
|
|
365
|
-
title: "页面资源加载失败",
|
|
366
|
-
description: "可能刚发布了新版本,旧页面资源已被替换。刷新页面即可拿到新资源。"
|
|
367
|
-
} : n != null ? {
|
|
368
|
-
kind: "render",
|
|
369
|
-
badge: "!",
|
|
370
|
-
title: "页面渲染出错",
|
|
371
|
-
description: "这个页面遇到了未预期的错误,已被拦截,不影响其他页面。可以重试;仍然失败请把技术详情发给研发。"
|
|
372
|
-
} : {
|
|
373
|
-
kind: "unknown",
|
|
374
|
-
badge: "!",
|
|
375
|
-
title: "页面加载失败",
|
|
376
|
-
description: "发生了未知错误。请重试,或返回首页换个入口再试。"
|
|
377
|
-
};
|
|
378
|
-
}
|
|
379
|
-
function et(e, t) {
|
|
380
|
-
const n = [];
|
|
381
|
-
if (n.push(`页面:${typeof location < "u" ? location.pathname + location.search : "-"}`), n.push(`时间:${(/* @__PURE__ */ new Date()).toISOString()}`), e != null && n.push(`HTTP:${e}`), t != null) {
|
|
382
|
-
const o = t;
|
|
383
|
-
o != null && o.name && n.push(`错误名:${String(o.name)}`), o != null && o.message && n.push(`消息:${String(o.message)}`), o != null && o.stack ? n.push(`堆栈:
|
|
384
|
-
${String(o.stack)}`) : typeof t != "object" && n.push(`原文:${String(t)}`);
|
|
385
|
-
}
|
|
386
|
-
return n.join(`
|
|
387
|
-
`).slice(0, 4e3);
|
|
388
|
-
}
|
|
389
|
-
const nt = ({
|
|
390
|
-
status: e,
|
|
391
|
-
error: t,
|
|
392
|
-
title: n,
|
|
393
|
-
description: o,
|
|
394
|
-
retry: r,
|
|
395
|
-
retryText: a,
|
|
396
|
-
extra: s,
|
|
397
|
-
showHome: l = !0,
|
|
398
|
-
compact: p = !1,
|
|
399
|
-
className: m
|
|
400
|
-
}) => {
|
|
401
|
-
const f = b(() => tt({ status: e, error: t }), [e, t]), [$, E] = L(!1), A = b(() => et(e, t), [e, t]);
|
|
402
|
-
D(() => {
|
|
403
|
-
if (!$) return;
|
|
404
|
-
const O = setTimeout(() => E(!1), 2e3);
|
|
405
|
-
return () => clearTimeout(O);
|
|
406
|
-
}, [$]);
|
|
407
|
-
const j = async () => {
|
|
408
|
-
try {
|
|
409
|
-
await navigator.clipboard.writeText(A), E(!0);
|
|
410
|
-
} catch {
|
|
411
|
-
E(!1);
|
|
412
|
-
}
|
|
413
|
-
}, k = () => {
|
|
414
|
-
const O = encodeURIComponent(location.pathname + location.search);
|
|
415
|
-
location.assign(`/login?redirect=${O}`);
|
|
416
|
-
}, U = () => r ? /* @__PURE__ */ g("button", { type: "button", className: y.primary, onClick: r, children: a || "重试" }) : f.kind === "chunk" ? /* @__PURE__ */ g("button", { type: "button", className: y.primary, onClick: () => location.reload(), children: "刷新页面" }) : f.kind === "unauthorized" ? /* @__PURE__ */ g("button", { type: "button", className: y.primary, onClick: k, children: "重新登录" }) : null, R = t != null || e != null;
|
|
417
|
-
return /* @__PURE__ */ g(
|
|
418
|
-
"div",
|
|
419
|
-
{
|
|
420
|
-
className: [y.wrap, p ? y.compact : "", m || ""].filter(Boolean).join(" "),
|
|
421
|
-
role: "alert",
|
|
422
|
-
"data-error-kind": f.kind,
|
|
423
|
-
children: /* @__PURE__ */ _("div", { className: y.card, children: [
|
|
424
|
-
/* @__PURE__ */ g("div", { className: y.badge, "data-kind": f.kind, children: f.badge }),
|
|
425
|
-
/* @__PURE__ */ g("h2", { className: y.title, children: n || f.title }),
|
|
426
|
-
/* @__PURE__ */ g("p", { className: y.desc, children: o || f.description }),
|
|
427
|
-
/* @__PURE__ */ _("div", { className: y.actions, children: [
|
|
428
|
-
U(),
|
|
429
|
-
s,
|
|
430
|
-
l && f.kind !== "unauthorized" && /* @__PURE__ */ g("a", { className: y.secondary, href: "/", children: "返回首页" })
|
|
431
|
-
] }),
|
|
432
|
-
R && /* @__PURE__ */ _("details", { className: y.details, children: [
|
|
433
|
-
/* @__PURE__ */ g("summary", { children: "技术详情" }),
|
|
434
|
-
/* @__PURE__ */ g("pre", { className: y.pre, children: A }),
|
|
435
|
-
/* @__PURE__ */ g("button", { type: "button", className: y.copy, onClick: j, children: $ ? "已复制" : "复制详情" })
|
|
436
|
-
] })
|
|
437
|
-
] })
|
|
438
|
-
}
|
|
439
|
-
);
|
|
440
|
-
};
|
|
441
|
-
class _t extends M {
|
|
442
|
-
constructor(t) {
|
|
443
|
-
super(t), this.state = { hasError: !1, error: null };
|
|
444
|
-
}
|
|
445
|
-
static getDerivedStateFromError(t) {
|
|
446
|
-
return { hasError: !0, error: t };
|
|
447
|
-
}
|
|
448
|
-
componentDidCatch(t, n) {
|
|
449
|
-
console.error("[ErrorBoundary]", t, n.componentStack);
|
|
450
|
-
}
|
|
451
|
-
render() {
|
|
452
|
-
return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ g(
|
|
453
|
-
nt,
|
|
454
|
-
{
|
|
455
|
-
error: this.state.error,
|
|
456
|
-
retry: () => this.setState({ hasError: !1, error: null })
|
|
457
|
-
}
|
|
458
|
-
) : this.props.children;
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
function w(e) {
|
|
462
|
-
const t = e && typeof e == "object" ? e : {}, n = Array.isArray(t.items) ? P(t.items) : [];
|
|
463
|
-
return { ...t, items: n };
|
|
464
|
-
}
|
|
465
|
-
async function At(e, t = "") {
|
|
466
|
-
const n = t ? `?token=${encodeURIComponent(t)}` : "", o = await i(
|
|
467
|
-
`${d}/personal-agents/${e}/schedules${n}`,
|
|
468
|
-
c
|
|
469
|
-
);
|
|
470
|
-
return u(o, "获取定时任务列表失败");
|
|
471
|
-
}
|
|
472
|
-
async function bt(e, t, n, o, r = "", a = "", s = "") {
|
|
473
|
-
const l = s ? `?token=${encodeURIComponent(s)}` : "", p = await i(
|
|
474
|
-
`${d}/personal-agents/${e}/schedules${l}`,
|
|
475
|
-
{
|
|
476
|
-
...c,
|
|
477
|
-
method: "POST",
|
|
478
|
-
headers: { "Content-Type": "application/json" },
|
|
479
|
-
body: JSON.stringify({
|
|
480
|
-
name: t,
|
|
481
|
-
prompt: n,
|
|
482
|
-
cron_expression: o,
|
|
483
|
-
notify_user_id: r,
|
|
484
|
-
notify_user_name: a
|
|
485
|
-
})
|
|
486
|
-
}
|
|
487
|
-
);
|
|
488
|
-
return u(p, "创建定时任务失败");
|
|
489
|
-
}
|
|
490
|
-
async function Ct(e, t, n, o = "") {
|
|
491
|
-
const r = o ? `?token=${encodeURIComponent(o)}` : "", a = await i(
|
|
492
|
-
`${d}/personal-agents/${e}/schedules/${t}${r}`,
|
|
493
|
-
{
|
|
494
|
-
...c,
|
|
495
|
-
method: "PUT",
|
|
496
|
-
headers: { "Content-Type": "application/json" },
|
|
497
|
-
body: JSON.stringify(n)
|
|
498
|
-
}
|
|
499
|
-
);
|
|
500
|
-
return u(a, "更新定时任务失败");
|
|
501
|
-
}
|
|
502
|
-
async function wt(e, t, n = "") {
|
|
503
|
-
const o = n ? `?token=${encodeURIComponent(n)}` : "", r = await i(
|
|
504
|
-
`${d}/personal-agents/${e}/schedules/${t}${o}`,
|
|
505
|
-
{
|
|
506
|
-
...c,
|
|
507
|
-
method: "DELETE"
|
|
508
|
-
}
|
|
509
|
-
);
|
|
510
|
-
return S(r, "删除定时任务失败");
|
|
511
|
-
}
|
|
512
|
-
async function jt(e, t, n, o = "") {
|
|
513
|
-
const r = o ? `?token=${encodeURIComponent(o)}` : "", a = await i(
|
|
514
|
-
`${d}/personal-agents/${e}/schedules/${t}/toggle${r}`,
|
|
515
|
-
{
|
|
516
|
-
...c,
|
|
517
|
-
method: "POST",
|
|
518
|
-
headers: { "Content-Type": "application/json" },
|
|
519
|
-
body: JSON.stringify({ enable: n })
|
|
520
|
-
}
|
|
521
|
-
);
|
|
522
|
-
return u(a, "切换定时任务状态失败");
|
|
523
|
-
}
|
|
524
|
-
async function kt(e, t, n = 1, o = 20, r = "") {
|
|
525
|
-
const a = new URLSearchParams();
|
|
526
|
-
a.set("page", String(n)), a.set("size", String(o)), r && a.set("token", r);
|
|
527
|
-
const s = await i(
|
|
528
|
-
`${d}/personal-agents/${e}/schedules/${t}/logs?${a.toString()}`,
|
|
529
|
-
c
|
|
530
|
-
), l = await S(s, "获取执行历史失败");
|
|
531
|
-
return w(l);
|
|
532
|
-
}
|
|
533
|
-
async function Ut(e, t, n = "") {
|
|
534
|
-
const o = n ? `?token=${encodeURIComponent(n)}` : "", r = await i(
|
|
535
|
-
`${d}/personal-agents/${e}/schedules/${t}/run${o}`,
|
|
536
|
-
{
|
|
537
|
-
...c,
|
|
538
|
-
method: "POST"
|
|
539
|
-
}
|
|
540
|
-
);
|
|
541
|
-
return u(r, "手动触发任务失败");
|
|
542
|
-
}
|
|
543
|
-
async function Rt(e, t = "", n = "") {
|
|
544
|
-
const o = new URLSearchParams();
|
|
545
|
-
t && o.set("keyword", t), n && o.set("token", n);
|
|
546
|
-
const r = await i(
|
|
547
|
-
`${d}/personal-agents/${e}/schedules/staff-search?${o.toString()}`,
|
|
548
|
-
c
|
|
549
|
-
);
|
|
550
|
-
return (await S(r, "搜索员工失败") ?? []).map((s) => {
|
|
551
|
-
const l = (s == null ? void 0 : s.extend) ?? {};
|
|
552
|
-
return {
|
|
553
|
-
userId: String((s == null ? void 0 : s.userId) ?? (s == null ? void 0 : s.id) ?? ""),
|
|
554
|
-
name: String((s == null ? void 0 : s.name) ?? ""),
|
|
555
|
-
accountNo: String((s == null ? void 0 : s.accountNo) ?? ""),
|
|
556
|
-
jobNumber: String((s == null ? void 0 : s.jobNumber) ?? ""),
|
|
557
|
-
flowerName: String((s == null ? void 0 : s.flowerName) ?? l.flowerName ?? "")
|
|
558
|
-
};
|
|
559
|
-
});
|
|
560
|
-
}
|
|
561
|
-
async function Pt(e = "", t = 50) {
|
|
562
|
-
const n = new URLSearchParams();
|
|
563
|
-
n.set("limit", String(t)), e && n.set("token", e);
|
|
564
|
-
const o = await i(
|
|
565
|
-
`${d}/personal-agents/schedules/notifications?${n.toString()}`,
|
|
566
|
-
c
|
|
567
|
-
), r = await S(o, "获取通知失败");
|
|
568
|
-
return w(r);
|
|
569
|
-
}
|
|
570
|
-
async function Lt(e, t = "") {
|
|
571
|
-
const n = t ? `?token=${encodeURIComponent(t)}` : "", o = await i(
|
|
572
|
-
`${d}/personal-agents/schedules/notifications/${e}/read${n}`,
|
|
573
|
-
{
|
|
574
|
-
...c,
|
|
575
|
-
method: "POST"
|
|
576
|
-
}
|
|
577
|
-
);
|
|
578
|
-
return S(o, "标记已读失败");
|
|
579
|
-
}
|
|
580
|
-
async function Dt(e = "") {
|
|
581
|
-
const t = e ? `?token=${encodeURIComponent(e)}` : "", n = await i(
|
|
582
|
-
`${d}/personal-agents/schedules/notifications/read-all${t}`,
|
|
583
|
-
{
|
|
584
|
-
...c,
|
|
585
|
-
method: "POST"
|
|
586
|
-
}
|
|
587
|
-
);
|
|
588
|
-
return S(n, "标记已读失败");
|
|
589
|
-
}
|
|
590
|
-
export {
|
|
591
|
-
lt as A,
|
|
592
|
-
mt as B,
|
|
593
|
-
$t as C,
|
|
594
|
-
N as D,
|
|
595
|
-
St as E,
|
|
596
|
-
It as F,
|
|
597
|
-
_t as G,
|
|
598
|
-
nt as P,
|
|
599
|
-
At as a,
|
|
600
|
-
Pt as b,
|
|
601
|
-
kt as c,
|
|
602
|
-
bt as d,
|
|
603
|
-
wt as e,
|
|
604
|
-
it as f,
|
|
605
|
-
Dt as g,
|
|
606
|
-
Ot as h,
|
|
607
|
-
Z as i,
|
|
608
|
-
ut as j,
|
|
609
|
-
yt as k,
|
|
610
|
-
ft as l,
|
|
611
|
-
Lt as m,
|
|
612
|
-
Nt as n,
|
|
613
|
-
Et as o,
|
|
614
|
-
at as p,
|
|
615
|
-
ht as q,
|
|
616
|
-
Ut as r,
|
|
617
|
-
Rt as s,
|
|
618
|
-
jt as t,
|
|
619
|
-
Ct as u,
|
|
620
|
-
gt as v,
|
|
621
|
-
Tt as w,
|
|
622
|
-
pt as x,
|
|
623
|
-
ct as y,
|
|
624
|
-
dt as z
|
|
625
|
-
};
|