@yuku123/z-team-component 0.2.103 → 0.2.104
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-DG-ogBff.js +542 -0
- package/dist/ComponentDoc-BW1SyDxk.js +8035 -0
- package/dist/InvitationManagementPage-hYvoPEcm.js +495 -0
- package/dist/OnboardingPage-KDp-DrzY.js +393 -0
- package/dist/ScheduledTasks-CErSDgyW.js +12127 -0
- package/dist/SystemShell-DvrY4Bl7.js +688 -0
- package/dist/_commonjsHelpers-B52_cu2H.js +26 -0
- package/dist/admin-logs-uPnnclwN.js +198 -0
- package/dist/api-B__qdRIf.js +20 -0
- package/dist/browser-jb_PFvU3.js +1538 -0
- package/dist/createWorkspaceWsHandler-BXbn5-Ft.js +13142 -0
- package/dist/ctc-sso-DtJHC-2M.js +117 -0
- package/dist/echarts-B1OU1xr4.js +16 -0
- package/dist/history-BlrA1eaW.js +41 -0
- package/dist/index-0smeCTnr.js +42049 -0
- package/dist/index-2isWwv1X.js +10169 -0
- package/dist/index-BC8f-JP9.js +242 -0
- package/dist/index-BK3YDeXH.js +2217 -0
- package/dist/index-BOJm25by.js +999 -0
- package/dist/index-B_LJRFsK.js +339 -0
- package/dist/index-BnJ8UEeZ.js +5892 -0
- package/dist/index-BohoJQPr.js +7631 -0
- package/dist/index-BwJPAN8f.js +112 -0
- package/dist/index-ByhCWenF.js +434 -0
- package/dist/index-C2_tfpEj.js +118 -0
- package/dist/index-C815hPWS.js +430 -0
- package/dist/index-C9fGup9t.js +189 -0
- package/dist/index-Cb88Xdh4.js +169 -0
- package/dist/index-Cih0yoxc.js +178 -0
- package/dist/index-CkWKJORv.js +1645 -0
- package/dist/index-CsaGecGX.js +132 -0
- package/dist/index-D-xPVrY3.js +316 -0
- package/dist/index-DAGa9v8r.js +142 -0
- package/dist/index-DBnH-lRh.js +956 -0
- package/dist/index-DIFIvVWE.js +93 -0
- package/dist/index-DOgCfVB2.js +574 -0
- package/dist/index-DWsfQMp8.js +208 -0
- package/dist/index-DcurzowX.js +2699 -0
- package/dist/index-DhDdFRHC.js +279 -0
- package/dist/index-Dpii3P5J.js +1302 -0
- package/dist/index-DtHoMz1H.js +8 -0
- package/dist/index-YVtm1SRy.js +913 -0
- package/dist/index-aI2EXKED.js +479 -0
- package/dist/index-q_TPea69.js +315 -0
- package/dist/index.js +10 -0
- package/dist/index.module-CAa-2T7m.js +72 -0
- package/dist/index.module-UI0iz8K0.js +42 -0
- package/dist/instance-pdQ_wAhB.js +216 -0
- package/dist/menuPermission-CCQjJVXg.js +60 -0
- package/dist/mobile-client-O3yr9h6t.js +24 -0
- package/dist/pages.js +21 -0
- package/dist/send-default-agent-team-message-BzeR4ahf.js +35 -0
- package/dist/spark-md5-Dld54a-T.js +178 -0
- package/dist/sso-user-DI7oiDdc.js +43 -0
- package/dist/training-Bz7Sr5yC.js +450 -0
- package/dist/webide-NcHLDiSn.js +5233 -0
- package/dist/z-team-component.css +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
function d() {
|
|
2
|
+
if (typeof window > "u") return null;
|
|
3
|
+
try {
|
|
4
|
+
const t = localStorage.getItem("USER_INFO");
|
|
5
|
+
if (t) return JSON.parse(t);
|
|
6
|
+
const a = localStorage.getItem("userInfo") || localStorage.getItem("user_info");
|
|
7
|
+
if (!a) return null;
|
|
8
|
+
const n = JSON.parse(a), r = {
|
|
9
|
+
name: String(n.nickname || n.name || ""),
|
|
10
|
+
jobNumber: String(n.userId || n.jobNumber || ""),
|
|
11
|
+
username: String(n.username || n.account || n.name || ""),
|
|
12
|
+
staffId: typeof n.userId == "number" ? n.userId : Number(n.userId) || 0
|
|
13
|
+
};
|
|
14
|
+
return localStorage.setItem("USER_INFO", JSON.stringify(r)), window.USER_INFO = r, r;
|
|
15
|
+
} catch {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
async function m() {
|
|
20
|
+
const t = () => {
|
|
21
|
+
localStorage.removeItem("USER_INFO"), window.USER_INFO = void 0;
|
|
22
|
+
};
|
|
23
|
+
try {
|
|
24
|
+
const a = new AbortController(), n = setTimeout(() => a.abort(), 1500), r = await fetch("/kapi/z-ctc/api/ctc/authn/whoami", {
|
|
25
|
+
method: "GET",
|
|
26
|
+
credentials: "include",
|
|
27
|
+
headers: { Accept: "application/json" },
|
|
28
|
+
signal: a.signal
|
|
29
|
+
});
|
|
30
|
+
if (clearTimeout(n), r.status === 401) {
|
|
31
|
+
const s = await u();
|
|
32
|
+
return s ? { kind: "authenticated", user: s } : (t(), { kind: "unauthenticated" });
|
|
33
|
+
}
|
|
34
|
+
if (!r.ok) {
|
|
35
|
+
const s = await u();
|
|
36
|
+
return s ? { kind: "authenticated", user: s } : { kind: "unavailable" };
|
|
37
|
+
}
|
|
38
|
+
const e = await r.json();
|
|
39
|
+
if (!e.success || !e.data)
|
|
40
|
+
return t(), { kind: "unauthenticated" };
|
|
41
|
+
const o = e.data.user_id ?? e.data.userId, i = {
|
|
42
|
+
name: e.data.nickname || e.data.username,
|
|
43
|
+
jobNumber: o != null ? String(o) : "",
|
|
44
|
+
username: e.data.username
|
|
45
|
+
};
|
|
46
|
+
localStorage.setItem("USER_INFO", JSON.stringify(i)), localStorage.setItem(
|
|
47
|
+
"ctcUrl",
|
|
48
|
+
encodeURIComponent(window.location.origin)
|
|
49
|
+
), window.USER_INFO = i;
|
|
50
|
+
const c = localStorage.getItem("token") || localStorage.getItem("z_team_token");
|
|
51
|
+
c && localStorage.setItem("token", c);
|
|
52
|
+
const l = {
|
|
53
|
+
userId: o,
|
|
54
|
+
id: o,
|
|
55
|
+
userName: e.data.username,
|
|
56
|
+
username: e.data.username,
|
|
57
|
+
nickname: e.data.nickname
|
|
58
|
+
};
|
|
59
|
+
return localStorage.setItem("userInfo", JSON.stringify(l)), { kind: "authenticated", user: i };
|
|
60
|
+
} catch {
|
|
61
|
+
const a = await u();
|
|
62
|
+
return a ? { kind: "authenticated", user: a } : (t(), { kind: "unavailable" });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
async function u() {
|
|
66
|
+
if (typeof window > "u") return null;
|
|
67
|
+
let t = null;
|
|
68
|
+
try {
|
|
69
|
+
t = localStorage.getItem("token") || localStorage.getItem("z_team_token");
|
|
70
|
+
} catch {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
if (!t || !t.trim()) return null;
|
|
74
|
+
try {
|
|
75
|
+
const a = new AbortController(), n = setTimeout(() => a.abort(), 2e3), r = await fetch("/kapi/z-ctc/api/ctc/authn/whoami", {
|
|
76
|
+
method: "GET",
|
|
77
|
+
headers: {
|
|
78
|
+
Accept: "application/json",
|
|
79
|
+
Authorization: `Bearer ${t.trim()}`
|
|
80
|
+
},
|
|
81
|
+
signal: a.signal
|
|
82
|
+
});
|
|
83
|
+
if (clearTimeout(n), !r.ok) return null;
|
|
84
|
+
const e = await r.json();
|
|
85
|
+
if (!e.success || !e.data) return null;
|
|
86
|
+
const o = e.data.user_id ?? e.data.userId, i = {
|
|
87
|
+
name: e.data.nickname || e.data.username,
|
|
88
|
+
jobNumber: o != null ? String(o) : "",
|
|
89
|
+
username: e.data.username
|
|
90
|
+
};
|
|
91
|
+
localStorage.setItem("USER_INFO", JSON.stringify(i)), localStorage.setItem(
|
|
92
|
+
"ctcUrl",
|
|
93
|
+
encodeURIComponent(window.location.origin)
|
|
94
|
+
), window.USER_INFO = i;
|
|
95
|
+
const c = {
|
|
96
|
+
userId: o,
|
|
97
|
+
id: o,
|
|
98
|
+
userName: e.data.username,
|
|
99
|
+
username: e.data.username,
|
|
100
|
+
nickname: e.data.nickname
|
|
101
|
+
};
|
|
102
|
+
return localStorage.setItem("userInfo", JSON.stringify(c)), i;
|
|
103
|
+
} catch {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function f() {
|
|
108
|
+
const t = new URL(window.location.href);
|
|
109
|
+
t.searchParams.has("_from_login") || t.searchParams.set("_from_login", "1");
|
|
110
|
+
const a = `/login?redirect=${encodeURIComponent(t.toString())}`;
|
|
111
|
+
window.location.href = a;
|
|
112
|
+
}
|
|
113
|
+
export {
|
|
114
|
+
m as f,
|
|
115
|
+
f as r,
|
|
116
|
+
d as s
|
|
117
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as o from "echarts/core";
|
|
2
|
+
import { BarChart as r, LineChart as e, PieChart as n } from "echarts/charts";
|
|
3
|
+
import { GridComponent as t, LegendComponent as m, MarkLineComponent as p, TitleComponent as i, TooltipComponent as a, GraphicComponent as C } from "echarts/components";
|
|
4
|
+
import { CanvasRenderer as h } from "echarts/renderers";
|
|
5
|
+
o.use([
|
|
6
|
+
r,
|
|
7
|
+
e,
|
|
8
|
+
n,
|
|
9
|
+
t,
|
|
10
|
+
m,
|
|
11
|
+
p,
|
|
12
|
+
i,
|
|
13
|
+
a,
|
|
14
|
+
C,
|
|
15
|
+
h
|
|
16
|
+
]);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
function i(t) {
|
|
2
|
+
if (typeof t == "string")
|
|
3
|
+
return t;
|
|
4
|
+
const { pathname: o = "", search: n = "", hash: r = "" } = t, e = n && !n.startsWith("?") ? `?${n}` : n, a = r && !r.startsWith("#") ? `#${r}` : r;
|
|
5
|
+
return `${o}${e}${a}`;
|
|
6
|
+
}
|
|
7
|
+
function s() {
|
|
8
|
+
try {
|
|
9
|
+
window.dispatchEvent(new PopStateEvent("popstate"));
|
|
10
|
+
} catch {
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
const w = {
|
|
14
|
+
/** 当前 location(与 umi/history 形状保持一致) */
|
|
15
|
+
get location() {
|
|
16
|
+
return window.location;
|
|
17
|
+
},
|
|
18
|
+
/** 跳转到新地址(pushState + 通知 Router) */
|
|
19
|
+
push(t, o) {
|
|
20
|
+
window.history.pushState(o ?? {}, "", i(t)), s();
|
|
21
|
+
},
|
|
22
|
+
/** 替换当前地址(replaceState + 通知 Router) */
|
|
23
|
+
replace(t, o) {
|
|
24
|
+
window.history.replaceState(o ?? {}, "", i(t)), s();
|
|
25
|
+
},
|
|
26
|
+
/** 历史栈移动 */
|
|
27
|
+
go(t) {
|
|
28
|
+
window.history.go(t);
|
|
29
|
+
},
|
|
30
|
+
/** 后退 */
|
|
31
|
+
back() {
|
|
32
|
+
window.history.back();
|
|
33
|
+
},
|
|
34
|
+
/** 前进 */
|
|
35
|
+
forward() {
|
|
36
|
+
window.history.forward();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
w as h
|
|
41
|
+
};
|