@yuku123/z-team-component 0.2.80 → 0.2.83
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-_bRZ55Yi.js +542 -0
- package/dist/ComponentDoc-BFoF51we.js +3998 -0
- package/dist/InvitationManagementPage-CTPCZXHu.js +495 -0
- package/dist/OnboardingPage-DwtuTL61.js +393 -0
- package/dist/ScheduledTasks-yeTm2bOY.js +9407 -0
- package/dist/SystemShell-D9OzKxL-.js +689 -0
- package/dist/_commonjsHelpers-B52_cu2H.js +26 -0
- package/dist/api-CIhVblfa.js +2155 -0
- package/dist/api-DXLNhtCX.js +20 -0
- package/dist/browser-jb_PFvU3.js +1538 -0
- package/dist/createWorkspaceWsHandler-BWP5S5X3.js +12951 -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-BCp5EtqR.js +914 -0
- package/dist/index-BHrMl3Jq.js +9585 -0
- package/dist/index-BP7WTzVH.js +137 -0
- package/dist/index-B_LJRFsK.js +339 -0
- package/dist/index-BgIheStI.js +133 -0
- package/dist/index-BohoJQPr.js +7631 -0
- package/dist/index-BydWNuk5.js +1229 -0
- package/dist/index-C815hPWS.js +430 -0
- package/dist/index-CBQMS6rx.js +178 -0
- package/dist/index-CESmMALI.js +242 -0
- package/dist/index-CUVdeb8y.js +638 -0
- package/dist/index-CijskN6t.js +316 -0
- package/dist/index-CoBZZQBy.js +112 -0
- package/dist/index-Co_0idJY.js +2936 -0
- package/dist/index-Cvx6rrxD.js +956 -0
- package/dist/index-Cwr5Slv1.js +480 -0
- package/dist/index-CxFAICql.js +42050 -0
- package/dist/index-DK70mOTz.js +143 -0
- package/dist/index-DT80Pwa_.js +5893 -0
- package/dist/index-DWsfQMp8.js +208 -0
- package/dist/index-DhDdFRHC.js +279 -0
- package/dist/index-Dm3wmB0K.js +435 -0
- package/dist/index-DzS6-D3M.js +1640 -0
- package/dist/index-PKkV63Sw.js +1143 -0
- package/dist/index-SbMjh8t4.js +574 -0
- package/dist/index-cdB5K3gx.js +814 -0
- package/dist/index-mnWs_wA3.js +93 -0
- package/dist/index-nU-V276i.js +170 -0
- package/dist/index-nW0ikV2R.js +2700 -0
- package/dist/index-uF04Ucsi.js +8 -0
- package/dist/index-x_7Rmav9.js +118 -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/{menuPermission-D9NGpBZP.js → menuPermission-DHUqvHfu.js} +1 -1
- package/dist/pages.js +1 -1
- 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
|
+
};
|