@yuku123/z-team-component 0.2.59 → 0.2.61

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.
Files changed (52) hide show
  1. package/dist/{ChangeLogView-Cstbioyw.js → ChangeLogView-VRWVzP0r.js} +1 -1
  2. package/dist/{ComponentDoc-Bx6NAJlK.js → ComponentDoc-CZGpQekc.js} +1497 -1387
  3. package/dist/{InvitationManagementPage-Gkqisq4C.js → InvitationManagementPage-Dvhu6OWP.js} +1 -1
  4. package/dist/{OnboardingPage-C7C4PEjn.js → OnboardingPage-CF_ECLv7.js} +2 -2
  5. package/dist/{ScheduledTasks-BQRcjBOd.js → ScheduledTasks-Cec22jf4.js} +8 -8
  6. package/dist/SystemShell-D8uLAhd8.js +670 -0
  7. package/dist/{admin-logs-B9KS6VJz.js → admin-logs-DCYof_u5.js} +2 -2
  8. package/dist/{api-CALqShkO.js → api-DWt94BcM.js} +584 -572
  9. package/dist/{api-Y-52Ejhz.js → api-Dxw9Ajfn.js} +1 -1
  10. package/dist/{createWorkspaceWsHandler-DP30xvug.js → createWorkspaceWsHandler-3aHkBZE9.js} +4 -4
  11. package/dist/{index-4YxdJwFm.js → index-4LNRkvy6.js} +3 -3
  12. package/dist/index-B5dPYPuA.js +93 -0
  13. package/dist/{index-C2Wkg1b5.js → index-BIdcTXZW.js} +3 -3
  14. package/dist/{index-m8V5TniT.js → index-BVh0W8ck.js} +15861 -15586
  15. package/dist/{index-Gt21FARO.js → index-BdGXRcf4.js} +3 -3
  16. package/dist/index-BgR7NlYr.js +118 -0
  17. package/dist/{index-8gCovDDT.js → index-C6jp_1-U.js} +6 -6
  18. package/dist/{index-DJ0FV74Y.js → index-CKtjapcc.js} +3 -3
  19. package/dist/{index-lftFkqfI.js → index-CTKf6h2u.js} +4 -4
  20. package/dist/{index-DKeYG0Fu.js → index-CrIIInfs.js} +4 -4
  21. package/dist/{index-63ovR-_x.js → index-DF4ZWJfp.js} +1 -1
  22. package/dist/index-DepaHnKP.js +2858 -0
  23. package/dist/{index-CO6WYRIS.js → index-Dfce6-jv.js} +3 -3
  24. package/dist/{index-Bpn6x1So.js → index-Dr8elYjm.js} +12 -12
  25. package/dist/{index-CLWgeKwr.js → index-DtVBFjaJ.js} +2 -2
  26. package/dist/{index-CGWttFLb.js → index-Dvhocfyo.js} +4 -4
  27. package/dist/{index-aw72ID7y.js → index-NPxrK-81.js} +1 -1
  28. package/dist/{index-CinRd7Nz.js → index-VY-pgcyl.js} +1 -1
  29. package/dist/{index-DJOyOVn_.js → index-VxO9i5r6.js} +1 -1
  30. package/dist/{index-C3B7CbHo.js → index-bsGAZKaU.js} +624 -613
  31. package/dist/index-gMeWspFX.js +112 -0
  32. package/dist/{index-DET70T3j.js → index-i6Ejgpao.js} +1 -1
  33. package/dist/{index-BvTYVEEv.js → index-nxjdN-Fp.js} +20 -16
  34. package/dist/{index-DfQCaS0z.js → index-tipx38MZ.js} +248 -244
  35. package/dist/{index-CN9NsUQ6.js → index-yRDgpDx1.js} +5 -5
  36. package/dist/index.js +1 -1
  37. package/dist/{instance-f3C-1qYl.js → instance-CbkHlDr4.js} +1 -1
  38. package/dist/menuPermission-BvgoOn21.js +60 -0
  39. package/dist/pages.js +1 -1
  40. package/dist/schedule-BRvmKoDG.js +587 -0
  41. package/dist/{send-default-agent-team-message-d_ECdczr.js → send-default-agent-team-message-8wnVWO7H.js} +1 -1
  42. package/dist/{sso-user-HcsSzg8P.js → sso-user-QZNVhjpR.js} +1 -1
  43. package/dist/{training-DnNQN0An.js → training-DYo1pvX7.js} +1 -1
  44. package/dist/{useAppStore-kRZEA5WZ.js → useAppStore-BGOxWep2.js} +6 -2
  45. package/dist/{webide-BcRzJX-h.js → webide-CWTbQs4I.js} +4 -4
  46. package/dist/z-team-component.css +2 -2
  47. package/package.json +1 -1
  48. package/dist/SystemShell-Df9PZzLO.js +0 -907
  49. package/dist/index-Bw9yypc4.js +0 -2841
  50. package/dist/index-C0EIMJI2.js +0 -112
  51. package/dist/index-DRrBkbr_.js +0 -100
  52. package/dist/schedule-DfkgwPdE.js +0 -497
@@ -6,10 +6,10 @@ import { useState as F, useRef as fp, useEffect as Y, useMemo as Wp, useCallback
6
6
  import Vp, { defaultUrlTransform as KA } from "react-markdown";
7
7
  import gp from "rehype-highlight";
8
8
  import Jp from "remark-gfm";
9
- import { ap as xa, aq as jA } from "./api-CALqShkO.js";
10
- import { u as Dp } from "./useAppStore-kRZEA5WZ.js";
11
- import { v as ia, w as oA, x as fA, y as lA, i as xA, z as iA, B as cA, E as TA, G as vA, H as up, I as Yp, J as mp, K as yp, M as Ip, N as FA, O as dA, Q as OA, V as XA } from "./index-DfQCaS0z.js";
12
- import { b as RA, d as NA, f as kA, e as WA, g as Cp, h as DA, j as qA, r as uA, k as mA, l as wA, m as BA, n as GA, o as LA, p as zA, q as VA } from "./createWorkspaceWsHandler-DP30xvug.js";
9
+ import { ap as xa, aq as jA } from "./api-DWt94BcM.js";
10
+ import { u as Dp } from "./useAppStore-BGOxWep2.js";
11
+ import { v as ia, w as oA, x as fA, y as lA, i as xA, z as iA, B as cA, E as TA, G as vA, H as up, I as Yp, J as mp, K as yp, M as Ip, O as FA, Q as dA, V as OA, X as XA } from "./index-tipx38MZ.js";
12
+ import { b as RA, d as NA, f as kA, e as WA, g as Cp, h as DA, j as qA, r as uA, k as mA, l as wA, m as BA, n as GA, o as LA, p as zA, q as VA } from "./createWorkspaceWsHandler-3aHkBZE9.js";
13
13
  import { h as r } from "./index.module-CAa-2T7m.js";
14
14
  const gA = "_editorView_as93v_7", JA = "_editorTopBar_as93v_16", bA = "_backBtn_as93v_25", MA = "_titleInput_as93v_39", sA = "_summaryBar_as93v_50", QA = "_summaryInput_as93v_55", hA = "_mdToolbar_as93v_67", YA = "_mdBtn_as93v_77", yA = "_mdSep_as93v_84", IA = "_editorBody_as93v_93", CA = "_tocPanel_as93v_100", ZA = "_tocHeader_as93v_108", EA = "_tocList_as93v_117", _A = "_tocItem_as93v_122", $A = "_tocEmpty_as93v_137", pt = "_textarea_as93v_144", at = "_half_as93v_160", At = "_preview_as93v_163", tt = "_markdown_as93v_173", et = "_videoEmbed_as93v_185", w = {
15
15
  editorView: gA,
@@ -1682,7 +1682,7 @@ const Rt = [
1682
1682
  draftDeleteBtn: T0,
1683
1683
  markdown: v0
1684
1684
  }, F0 = HA(
1685
- () => import("./index-DJ0FV74Y.js").then((a) => ({ default: a.MarketContent }))
1685
+ () => import("./index-CKtjapcc.js").then((a) => ({ default: a.MarketContent }))
1686
1686
  );
1687
1687
  function d0(a) {
1688
1688
  const n = [], x = a.split(`
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C as e, P as s, S as a, Z as r, i } from "./ComponentDoc-Bx6NAJlK.js";
1
+ import { C as e, P as s, S as a, Z as r, i } from "./ComponentDoc-CZGpQekc.js";
2
2
  import { h as m } from "./history-BlrA1eaW.js";
3
3
  export {
4
4
  e as ComponentDocPage,
@@ -1,4 +1,4 @@
1
- import { a as o, f as d, B as r, u as c } from "./api-CALqShkO.js";
1
+ import { a as o, f as d, B as r, u as c } from "./api-DWt94BcM.js";
2
2
  async function h(e, n = "") {
3
3
  const t = new URLSearchParams();
4
4
  n && t.set("token", n), e.scenario_code && t.set("scenario_code", e.scenario_code), e.status && t.set("status", e.status), e.name && t.set("name", e.name), e.role && t.set("role", e.role), e.create_time_start && t.set("create_time_start", e.create_time_start), e.create_time_end && t.set("create_time_end", e.create_time_end), t.set("page", String(e.page ?? 1)), t.set("size", String(e.size ?? 20));
@@ -0,0 +1,60 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { Alert as h } from "antd";
3
+ import { u as d } from "./useAppStore-BGOxWep2.js";
4
+ import { h as g } from "./schedule-BRvmKoDG.js";
5
+ import { N as A } from "./index-tipx38MZ.js";
6
+ function P() {
7
+ return d((n) => n.permissionState) !== "failed" ? null : /* @__PURE__ */ a(
8
+ h,
9
+ {
10
+ type: "warning",
11
+ showIcon: !0,
12
+ "data-testid": "menu-permission-notice",
13
+ message: "权限校验失败",
14
+ description: "未能获取当前账号的权限点(4A 授权中心接口异常)。下方菜单为全量展示,可能包含无权访问的入口;进入受限页面会返回 403。请联系管理员确认账号权限绑定。",
15
+ style: { margin: "8px 12px" }
16
+ }
17
+ );
18
+ }
19
+ function m(e) {
20
+ const n = e.permission;
21
+ return n ? Array.isArray(n) ? n : [n] : [];
22
+ }
23
+ function S(e) {
24
+ return e ? e.is_global_admin ? !1 : !(e.permissions && e.permissions.length > 0) : !0;
25
+ }
26
+ function f(e, n) {
27
+ return n.length === 0 ? !0 : S(e) ? n.some((i) => A.includes(i)) : n.some((i) => g(e, i));
28
+ }
29
+ function c(e, n, i) {
30
+ const t = m(n), s = t.length > 0 ? t : i ? [i] : [];
31
+ return f(e, s);
32
+ }
33
+ function _(e, n) {
34
+ const i = [];
35
+ for (const t of e) {
36
+ const s = t.permission;
37
+ if (!f(n, m(t))) continue;
38
+ const o = t.items;
39
+ if (!Array.isArray(o)) {
40
+ i.push(t);
41
+ continue;
42
+ }
43
+ const u = o.filter((r) => c(n, r, s)).map(
44
+ (r) => r.children ? {
45
+ ...r,
46
+ children: r.children.filter(
47
+ (l) => c(n, l, r.permission ?? s)
48
+ )
49
+ } : r
50
+ ).filter((r) => !r.children || r.children.length > 0);
51
+ if (u.length === 0) continue;
52
+ const p = { ...t, items: u };
53
+ i.push(p);
54
+ }
55
+ return i;
56
+ }
57
+ export {
58
+ P as M,
59
+ _ as f
60
+ };
package/dist/pages.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createElement as e } from "react";
2
2
  import { ReadOutlined as t } from "@ant-design/icons";
3
- import { S as o, P as a, C as r, Z as m } from "./ComponentDoc-Bx6NAJlK.js";
3
+ import { S as o, P as a, C as r, Z as m } from "./ComponentDoc-CZGpQekc.js";
4
4
  import "react/jsx-runtime";
5
5
  import "react-router-dom";
6
6
  import "antd";
@@ -0,0 +1,587 @@
1
+ import { a as i, f as c, B as d, n as u, u as h, t as N, g as R } from "./api-DWt94BcM.js";
2
+ import { jsx as g, jsxs as O } from "react/jsx-runtime";
3
+ import { useMemo as b, useState as L, useEffect as D, Component as M } from "react";
4
+ const T = [
5
+ { status: "TODO", label: "待办" },
6
+ { status: "DOING", label: "进行中" },
7
+ { status: "DONE", label: "已完成" }
8
+ ];
9
+ function se(t) {
10
+ if (!t || !t.trim()) return [...T];
11
+ try {
12
+ const e = JSON.parse(t), n = Array.isArray(e == null ? void 0 : e.statusColumns) ? e.statusColumns : null;
13
+ if (!n) return [...T];
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 : [...T];
19
+ } catch {
20
+ return [...T];
21
+ }
22
+ }
23
+ function B(t) {
24
+ if (t == null) return !0;
25
+ const e = String(t).trim();
26
+ return e === "" || e === "0";
27
+ }
28
+ function S(t) {
29
+ const e = (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 = t.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 = t.assigneeUserId == null ? "" : String(t.assigneeUserId);
64
+ return p.trim() ? [p.trim()] : [];
65
+ }, r = (s) => {
66
+ const l = t.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: N(t.id),
74
+ projectId: t.projectId == null ? null : N(t.projectId),
75
+ userId: String(t.userId ?? ""),
76
+ title: String(t.title ?? ""),
77
+ detail: t.detail == null ? null : String(t.detail),
78
+ status: t.status ?? "TODO",
79
+ priority: t.priority ?? "MEDIUM",
80
+ dueDate: t.dueDate == null ? null : String(t.dueDate).slice(0, 10),
81
+ assigneeUserId: a[0] ?? null,
82
+ assigneeUserIds: a,
83
+ assignees: r(a),
84
+ projectTitle: t.projectTitle == null || !String(t.projectTitle).trim() ? null : String(t.projectTitle),
85
+ tags: e(t.tags),
86
+ links: n(t.links),
87
+ parentId: B(t.parentId) ? "" : N(t.parentId),
88
+ sortOrder: t.sortOrder == null ? 0 : Number(t.sortOrder),
89
+ completedAt: t.completedAt == null ? null : String(t.completedAt),
90
+ completedBy: t.completedBy == null ? null : String(t.completedBy),
91
+ createByName: t.createByName == null ? null : String(t.createByName),
92
+ updateTime: t.updateTime == null ? null : String(t.updateTime)
93
+ };
94
+ }
95
+ function I(t) {
96
+ const e = t ?? {};
97
+ return {
98
+ id: N(e.id),
99
+ userId: String(e.userId ?? ""),
100
+ title: String(e.title ?? ""),
101
+ icon: e.icon == null ? null : String(e.icon),
102
+ description: e.description == null ? null : String(e.description),
103
+ visibility: e.visibility === "shared" ? "shared" : "private",
104
+ sortOrder: e.sortOrder == null ? 0 : Number(e.sortOrder),
105
+ extraInfo: e.extraInfo == null ? null : String(e.extraInfo),
106
+ createByName: e.createByName == null ? null : String(e.createByName)
107
+ };
108
+ }
109
+ function C(t) {
110
+ const e = t ?? {}, n = Array.isArray(e.memberDetails) ? e.memberDetails : [];
111
+ return {
112
+ ...I(e),
113
+ openCount: e.openCount == null ? 0 : Number(e.openCount),
114
+ memberDetails: n.map((o) => {
115
+ const r = o ?? {}, a = String(r.userId ?? "").trim();
116
+ return a ? { userId: a, userName: String(r.userName ?? "").trim() || a } : null;
117
+ }).filter((o) => o != null)
118
+ };
119
+ }
120
+ async function ae(t = "") {
121
+ const e = t ? `?token=${encodeURIComponent(t)}` : "", n = await i(`${d}/todo/projects${e}`, c), o = await u(n, "获取待办项目失败");
122
+ return {
123
+ owned: ((o == null ? void 0 : o.owned) ?? []).map(C),
124
+ joined: ((o == null ? void 0 : o.joined) ?? []).map(C)
125
+ };
126
+ }
127
+ async function ie(t, e = "") {
128
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", o = await i(`${d}/todo/projects${n}`, {
129
+ ...c,
130
+ method: "POST",
131
+ headers: { "Content-Type": "application/json" },
132
+ body: JSON.stringify(t)
133
+ }), r = await u(o, "新建项目失败");
134
+ return I(r);
135
+ }
136
+ async function ce(t, e, n = "") {
137
+ const o = n ? `?token=${encodeURIComponent(n)}` : "", r = await i(`${d}/todo/projects/${t}${o}`, {
138
+ ...c,
139
+ method: "PUT",
140
+ headers: { "Content-Type": "application/json" },
141
+ body: JSON.stringify(e)
142
+ }), a = await u(r, "更新项目失败");
143
+ return I(a);
144
+ }
145
+ async function de(t, e = "") {
146
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", o = await i(`${d}/todo/projects/${t}${n}`, {
147
+ ...c,
148
+ method: "DELETE"
149
+ });
150
+ return h(o, "删除项目失败");
151
+ }
152
+ async function le(t, e, n = "") {
153
+ const o = n ? `?token=${encodeURIComponent(n)}` : "", r = await i(`${d}/todo/projects/${t}/members${o}`, {
154
+ ...c,
155
+ method: "POST",
156
+ headers: { "Content-Type": "application/json" },
157
+ body: JSON.stringify(e)
158
+ }), a = await u(r, "添加成员失败");
159
+ return I(a);
160
+ }
161
+ async function ue(t, e, n = "") {
162
+ const o = n ? `?token=${encodeURIComponent(n)}` : "", r = await i(
163
+ `${d}/todo/projects/${t}/members/${encodeURIComponent(e)}${o}`,
164
+ { ...c, method: "DELETE" }
165
+ ), a = await u(r, "移除成员失败");
166
+ return I(a);
167
+ }
168
+ async function pe(t = {}, e = "") {
169
+ const n = new URLSearchParams();
170
+ e && n.set("token", e), t.view && n.set("view", t.view), t.projectId != null && n.set("projectId", String(t.projectId)), t.status && n.set("status", t.status), t.keyword && n.set("keyword", t.keyword);
171
+ const o = n.toString() ? `?${n.toString()}` : "", r = await i(`${d}/todo/items${o}`, c);
172
+ return (await u(
173
+ r,
174
+ "获取事项失败"
175
+ ) ?? []).map(S);
176
+ }
177
+ async function me(t, e = "") {
178
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", o = await i(`${d}/todo/items${n}`, {
179
+ ...c,
180
+ method: "POST",
181
+ headers: { "Content-Type": "application/json" },
182
+ body: JSON.stringify(t)
183
+ }), r = await u(o, "新建事项失败");
184
+ return S(r);
185
+ }
186
+ async function ye(t, e, n = "") {
187
+ const o = n ? `?token=${encodeURIComponent(n)}` : "", r = await i(`${d}/todo/items/${t}${o}`, {
188
+ ...c,
189
+ method: "PUT",
190
+ headers: { "Content-Type": "application/json" },
191
+ body: JSON.stringify(e)
192
+ }), a = await u(r, "更新事项失败");
193
+ return S(a);
194
+ }
195
+ async function fe(t, e = "", n = "") {
196
+ const o = n ? `?token=${encodeURIComponent(n)}` : "", r = await i(`${d}/todo/items/${t}/complete${o}`, {
197
+ ...c,
198
+ method: "POST",
199
+ headers: { "Content-Type": "application/json" },
200
+ body: JSON.stringify({ result: e })
201
+ }), a = await u(r, "完成事项失败");
202
+ return S(a);
203
+ }
204
+ async function ge(t, e = "") {
205
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", o = await i(`${d}/todo/items/${t}/reopen${n}`, {
206
+ ...c,
207
+ method: "POST"
208
+ }), r = await u(o, "重开事项失败");
209
+ return S(r);
210
+ }
211
+ async function he(t, e, n = "") {
212
+ const o = n ? `?token=${encodeURIComponent(n)}` : "", r = await i(`${d}/todo/items/${t}/reorder${o}`, {
213
+ ...c,
214
+ method: "POST",
215
+ headers: { "Content-Type": "application/json" },
216
+ body: JSON.stringify(e)
217
+ }), a = await u(r, "调整排序失败");
218
+ return S(a);
219
+ }
220
+ async function $e(t, e = "") {
221
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", o = await i(`${d}/todo/items/reorder-batch${n}`, {
222
+ ...c,
223
+ method: "POST",
224
+ headers: { "Content-Type": "application/json" },
225
+ body: JSON.stringify({ updates: t })
226
+ });
227
+ return h(o, "调整排序失败");
228
+ }
229
+ async function Se(t, e = "") {
230
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", o = await i(`${d}/todo/projects/reorder-batch${n}`, {
231
+ ...c,
232
+ method: "POST",
233
+ headers: { "Content-Type": "application/json" },
234
+ body: JSON.stringify({ updates: t })
235
+ });
236
+ return h(o, "调整项目排序失败");
237
+ }
238
+ async function Ie(t, e = "") {
239
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", o = await i(`${d}/todo/items/${t}${n}`, {
240
+ ...c,
241
+ method: "DELETE"
242
+ });
243
+ return h(o, "删除事项失败");
244
+ }
245
+ const G = {
246
+ RUNTIME_MONITOR_VIEW: ["RUNTIME_MONITOR_MANAGE"],
247
+ EVALUATION_VIEW: ["EVALUATION_MANAGE"],
248
+ COLLABORATION_VIEW: [
249
+ "AGENT_MANAGE",
250
+ "SKILL_MANAGE",
251
+ "SCENARIO_MANAGE",
252
+ "PROFILE_MANAGE",
253
+ "TAG_MANAGE",
254
+ "TOOL_MANAGE"
255
+ ],
256
+ EVOLUTION_VIEW: ["EVOLUTION_MANAGE"],
257
+ OPS_CONFIG_VIEW: [
258
+ "OPS_CONFIG_MANAGE",
259
+ "ONCALL_MANAGE",
260
+ "ANNOUNCEMENT_MANAGE",
261
+ "OPS_REPORT_MANAGE"
262
+ ],
263
+ KNOWLEDGE_VIEW: ["KNOWLEDGE_MANAGE"],
264
+ WEBIDE_VIEW: ["WEBIDE_MANAGE"]
265
+ };
266
+ function Te(t, e) {
267
+ var o;
268
+ if (!t) return !1;
269
+ if (t.is_global_admin || (o = t.permissions) != null && o.includes(e)) return !0;
270
+ const n = G[e];
271
+ return !!(n != null && n.some((r) => {
272
+ var a;
273
+ return (a = t.permissions) == null ? void 0 : a.includes(r);
274
+ }));
275
+ }
276
+ const q = "_wrap_2gcw5_1", J = "_card_2gcw5_9", V = "_badge_2gcw5_19", W = "_title_2gcw5_41", v = "_desc_2gcw5_48", x = "_actions_2gcw5_55", z = "_primary_2gcw5_63", F = "_secondary_2gcw5_75", K = "_details_2gcw5_90", H = "_pre_2gcw5_102", Y = "_copy_2gcw5_117", Q = "_compact_2gcw5_127", y = {
277
+ wrap: q,
278
+ card: J,
279
+ badge: V,
280
+ title: W,
281
+ desc: v,
282
+ actions: x,
283
+ primary: z,
284
+ secondary: F,
285
+ details: K,
286
+ pre: H,
287
+ copy: Y,
288
+ compact: Q
289
+ };
290
+ function X(t) {
291
+ const e = t, n = `${(e == null ? void 0 : e.name) ?? ""} ${(e == null ? void 0 : e.message) ?? ""} ${typeof t == "string" ? t : ""}`;
292
+ return /ChunkLoadError|Loading chunk|Failed to fetch dynamically imported module|Importing a module script failed|error loading dynamically imported module/i.test(n);
293
+ }
294
+ function Z(t) {
295
+ const { status: e, error: n } = t;
296
+ return e === 401 ? {
297
+ kind: "unauthorized",
298
+ status: e,
299
+ badge: "401",
300
+ title: "登录已失效",
301
+ description: "当前会话已过期或未建立,请重新登录后继续。重登后会回到这个页面。"
302
+ } : e === 403 ? {
303
+ kind: "forbidden",
304
+ status: e,
305
+ badge: "403",
306
+ title: "没有访问权限",
307
+ description: "当前账号无权访问该功能。如需开通,请联系管理员分配权限。"
308
+ } : e === 404 ? {
309
+ kind: "not-found",
310
+ status: e,
311
+ badge: "404",
312
+ title: "功能接口未就绪",
313
+ description: "这个页面要用的后端接口还没有部署,或前后端路径对不上。可以重试;若持续如此,请把技术详情发给运维确认版本。"
314
+ } : e && e >= 500 ? {
315
+ kind: "server",
316
+ status: e,
317
+ badge: String(e),
318
+ title: "服务暂时不可用",
319
+ description: "后端返回了错误。稍后重试;如果反复出现,请把技术详情发给运维。"
320
+ } : e === 0 ? {
321
+ kind: "network",
322
+ status: e,
323
+ badge: "!",
324
+ title: "网络不可用",
325
+ description: "请求没有到达后端。请检查网络,或确认本地后端服务是否已启动。"
326
+ } : X(n) ? {
327
+ kind: "chunk",
328
+ badge: "⟳",
329
+ title: "页面资源加载失败",
330
+ description: "可能刚发布了新版本,旧页面资源已被替换。刷新页面即可拿到新资源。"
331
+ } : n != null ? {
332
+ kind: "render",
333
+ badge: "!",
334
+ title: "页面渲染出错",
335
+ description: "这个页面遇到了未预期的错误,已被拦截,不影响其他页面。可以重试;仍然失败请把技术详情发给研发。"
336
+ } : {
337
+ kind: "unknown",
338
+ badge: "!",
339
+ title: "页面加载失败",
340
+ description: "发生了未知错误。请重试,或返回首页换个入口再试。"
341
+ };
342
+ }
343
+ function ee(t, e) {
344
+ const n = [];
345
+ if (n.push(`页面:${typeof location < "u" ? location.pathname + location.search : "-"}`), n.push(`时间:${(/* @__PURE__ */ new Date()).toISOString()}`), t != null && n.push(`HTTP:${t}`), e != null) {
346
+ const o = e;
347
+ o != null && o.name && n.push(`错误名:${String(o.name)}`), o != null && o.message && n.push(`消息:${String(o.message)}`), o != null && o.stack ? n.push(`堆栈:
348
+ ${String(o.stack)}`) : typeof e != "object" && n.push(`原文:${String(e)}`);
349
+ }
350
+ return n.join(`
351
+ `).slice(0, 4e3);
352
+ }
353
+ const te = ({
354
+ status: t,
355
+ error: e,
356
+ title: n,
357
+ description: o,
358
+ retry: r,
359
+ retryText: a,
360
+ extra: s,
361
+ showHome: l = !0,
362
+ compact: p = !1,
363
+ className: m
364
+ }) => {
365
+ const f = b(() => Z({ status: t, error: e }), [t, e]), [$, _] = L(!1), A = b(() => ee(t, e), [t, e]);
366
+ D(() => {
367
+ if (!$) return;
368
+ const E = setTimeout(() => _(!1), 2e3);
369
+ return () => clearTimeout(E);
370
+ }, [$]);
371
+ const j = async () => {
372
+ try {
373
+ await navigator.clipboard.writeText(A), _(!0);
374
+ } catch {
375
+ _(!1);
376
+ }
377
+ }, U = () => {
378
+ const E = encodeURIComponent(location.pathname + location.search);
379
+ location.assign(`/login?redirect=${E}`);
380
+ }, k = () => 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: U, children: "重新登录" }) : null, P = e != null || t != null;
381
+ return /* @__PURE__ */ g(
382
+ "div",
383
+ {
384
+ className: [y.wrap, p ? y.compact : "", m || ""].filter(Boolean).join(" "),
385
+ role: "alert",
386
+ "data-error-kind": f.kind,
387
+ children: /* @__PURE__ */ O("div", { className: y.card, children: [
388
+ /* @__PURE__ */ g("div", { className: y.badge, "data-kind": f.kind, children: f.badge }),
389
+ /* @__PURE__ */ g("h2", { className: y.title, children: n || f.title }),
390
+ /* @__PURE__ */ g("p", { className: y.desc, children: o || f.description }),
391
+ /* @__PURE__ */ O("div", { className: y.actions, children: [
392
+ k(),
393
+ s,
394
+ l && f.kind !== "unauthorized" && /* @__PURE__ */ g("a", { className: y.secondary, href: "/", children: "返回首页" })
395
+ ] }),
396
+ P && /* @__PURE__ */ O("details", { className: y.details, children: [
397
+ /* @__PURE__ */ g("summary", { children: "技术详情" }),
398
+ /* @__PURE__ */ g("pre", { className: y.pre, children: A }),
399
+ /* @__PURE__ */ g("button", { type: "button", className: y.copy, onClick: j, children: $ ? "已复制" : "复制详情" })
400
+ ] })
401
+ ] })
402
+ }
403
+ );
404
+ };
405
+ class Ne extends M {
406
+ constructor(e) {
407
+ super(e), this.state = { hasError: !1, error: null };
408
+ }
409
+ static getDerivedStateFromError(e) {
410
+ return { hasError: !0, error: e };
411
+ }
412
+ componentDidCatch(e, n) {
413
+ console.error("[ErrorBoundary]", e, n.componentStack);
414
+ }
415
+ render() {
416
+ return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ g(
417
+ te,
418
+ {
419
+ error: this.state.error,
420
+ retry: () => this.setState({ hasError: !1, error: null })
421
+ }
422
+ ) : this.props.children;
423
+ }
424
+ }
425
+ function w(t) {
426
+ const e = t && typeof t == "object" ? t : {}, n = Array.isArray(e.items) ? R(e.items) : [];
427
+ return { ...e, items: n };
428
+ }
429
+ async function _e(t, e = "") {
430
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", o = await i(
431
+ `${d}/personal-agents/${t}/schedules${n}`,
432
+ c
433
+ );
434
+ return u(o, "获取定时任务列表失败");
435
+ }
436
+ async function Ee(t, e, n, o, r = "", a = "", s = "") {
437
+ const l = s ? `?token=${encodeURIComponent(s)}` : "", p = await i(
438
+ `${d}/personal-agents/${t}/schedules${l}`,
439
+ {
440
+ ...c,
441
+ method: "POST",
442
+ headers: { "Content-Type": "application/json" },
443
+ body: JSON.stringify({
444
+ name: e,
445
+ prompt: n,
446
+ cron_expression: o,
447
+ notify_user_id: r,
448
+ notify_user_name: a
449
+ })
450
+ }
451
+ );
452
+ return u(p, "创建定时任务失败");
453
+ }
454
+ async function Oe(t, e, n, o = "") {
455
+ const r = o ? `?token=${encodeURIComponent(o)}` : "", a = await i(
456
+ `${d}/personal-agents/${t}/schedules/${e}${r}`,
457
+ {
458
+ ...c,
459
+ method: "PUT",
460
+ headers: { "Content-Type": "application/json" },
461
+ body: JSON.stringify(n)
462
+ }
463
+ );
464
+ return u(a, "更新定时任务失败");
465
+ }
466
+ async function Ae(t, e, n = "") {
467
+ const o = n ? `?token=${encodeURIComponent(n)}` : "", r = await i(
468
+ `${d}/personal-agents/${t}/schedules/${e}${o}`,
469
+ {
470
+ ...c,
471
+ method: "DELETE"
472
+ }
473
+ );
474
+ return h(r, "删除定时任务失败");
475
+ }
476
+ async function be(t, e, n, o = "") {
477
+ const r = o ? `?token=${encodeURIComponent(o)}` : "", a = await i(
478
+ `${d}/personal-agents/${t}/schedules/${e}/toggle${r}`,
479
+ {
480
+ ...c,
481
+ method: "POST",
482
+ headers: { "Content-Type": "application/json" },
483
+ body: JSON.stringify({ enable: n })
484
+ }
485
+ );
486
+ return u(a, "切换定时任务状态失败");
487
+ }
488
+ async function Ce(t, e, n = 1, o = 20, r = "") {
489
+ const a = new URLSearchParams();
490
+ a.set("page", String(n)), a.set("size", String(o)), r && a.set("token", r);
491
+ const s = await i(
492
+ `${d}/personal-agents/${t}/schedules/${e}/logs?${a.toString()}`,
493
+ c
494
+ ), l = await h(s, "获取执行历史失败");
495
+ return w(l);
496
+ }
497
+ async function we(t, e, n = "") {
498
+ const o = n ? `?token=${encodeURIComponent(n)}` : "", r = await i(
499
+ `${d}/personal-agents/${t}/schedules/${e}/run${o}`,
500
+ {
501
+ ...c,
502
+ method: "POST"
503
+ }
504
+ );
505
+ return u(r, "手动触发任务失败");
506
+ }
507
+ async function je(t, e = "", n = "") {
508
+ const o = new URLSearchParams();
509
+ e && o.set("keyword", e), n && o.set("token", n);
510
+ const r = await i(
511
+ `${d}/personal-agents/${t}/schedules/staff-search?${o.toString()}`,
512
+ c
513
+ );
514
+ return (await h(r, "搜索员工失败") ?? []).map((s) => {
515
+ const l = (s == null ? void 0 : s.extend) ?? {};
516
+ return {
517
+ userId: String((s == null ? void 0 : s.userId) ?? (s == null ? void 0 : s.id) ?? ""),
518
+ name: String((s == null ? void 0 : s.name) ?? ""),
519
+ accountNo: String((s == null ? void 0 : s.accountNo) ?? ""),
520
+ jobNumber: String((s == null ? void 0 : s.jobNumber) ?? ""),
521
+ flowerName: String((s == null ? void 0 : s.flowerName) ?? l.flowerName ?? "")
522
+ };
523
+ });
524
+ }
525
+ async function Ue(t = "", e = 50) {
526
+ const n = new URLSearchParams();
527
+ n.set("limit", String(e)), t && n.set("token", t);
528
+ const o = await i(
529
+ `${d}/personal-agents/schedules/notifications?${n.toString()}`,
530
+ c
531
+ ), r = await h(o, "获取通知失败");
532
+ return w(r);
533
+ }
534
+ async function ke(t, e = "") {
535
+ const n = e ? `?token=${encodeURIComponent(e)}` : "", o = await i(
536
+ `${d}/personal-agents/schedules/notifications/${t}/read${n}`,
537
+ {
538
+ ...c,
539
+ method: "POST"
540
+ }
541
+ );
542
+ return h(o, "标记已读失败");
543
+ }
544
+ async function Pe(t = "") {
545
+ const e = t ? `?token=${encodeURIComponent(t)}` : "", n = await i(
546
+ `${d}/personal-agents/schedules/notifications/read-all${e}`,
547
+ {
548
+ ...c,
549
+ method: "POST"
550
+ }
551
+ );
552
+ return h(n, "标记已读失败");
553
+ }
554
+ export {
555
+ $e as A,
556
+ he as B,
557
+ Se as C,
558
+ T as D,
559
+ Ne as E,
560
+ te as P,
561
+ _e as a,
562
+ Ue as b,
563
+ Ce as c,
564
+ Ee as d,
565
+ Ae as e,
566
+ ae as f,
567
+ Pe as g,
568
+ Te as h,
569
+ X as i,
570
+ le as j,
571
+ me as k,
572
+ ye as l,
573
+ ke as m,
574
+ ge as n,
575
+ fe as o,
576
+ se as p,
577
+ Ie as q,
578
+ we as r,
579
+ je as s,
580
+ be as t,
581
+ Oe as u,
582
+ ue as v,
583
+ ie as w,
584
+ ce as x,
585
+ de as y,
586
+ pe as z
587
+ };