@yuku123/z-team-component 0.2.89 → 0.2.91
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/{ComponentDoc-CP8PmT4l.js → ComponentDoc-Bqfu128t.js} +3 -3
- package/dist/{InvitationManagementPage-C-8t565B.js → InvitationManagementPage-DYoqQA0v.js} +1 -1
- package/dist/{OnboardingPage-DUUHQLSp.js → OnboardingPage-D2Gm8MRd.js} +2 -2
- package/dist/{ScheduledTasks-BSJP-8rB.js → ScheduledTasks-DB3VxAnb.js} +3519 -3380
- package/dist/{SystemShell-DTFR-Pfd.js → SystemShell-D3jHItxY.js} +5 -5
- package/dist/admin-logs-ogvMwS4O.js +302 -0
- package/dist/{api-GfWm5pTp.js → api-DYsAzJJo.js} +1 -1
- package/dist/{createWorkspaceWsHandler-rKc7vc8k.js → createWorkspaceWsHandler-D8h5BEzH.js} +2 -2
- package/dist/{index-MYohlrH6.js → index-152G-_4j.js} +1 -1
- package/dist/{index-DyFaoD5W.js → index-BYe87pnq.js} +1 -1
- package/dist/{index-EdPtymBD.js → index-BZ12pY96.js} +2 -2
- package/dist/{index-mIk8zAAm.js → index-BaCqZeiw.js} +1 -1
- package/dist/{index-pScDd5cp.js → index-BfzgRKii.js} +3 -3
- package/dist/{index-ji8TPz9K.js → index-C8cR7lJw.js} +1 -1
- package/dist/{index-CHTu5H1U.js → index-CLD5lLa6.js} +3 -3
- package/dist/{index-s_ikMJ2V.js → index-CLfhHxPf.js} +1 -1
- package/dist/{index-D92Y4nix.js → index-CSpckSHg.js} +2 -2
- package/dist/{index-v3WaXkDJ.js → index-CYyFYmlZ.js} +1 -1
- package/dist/{index-BxBGVGKQ.js → index-CZyFAmEq.js} +1 -1
- package/dist/{index-DcHrkop2.js → index-CgWa7RFv.js} +1 -1
- package/dist/{index-9Vozb4E5.js → index-Cggl78j7.js} +2 -2
- package/dist/{index-C5FC0WCa.js → index-Cw6MIoNv.js} +4 -4
- package/dist/{index-BngdCYiY.js → index-DE82vM_4.js} +3 -3
- package/dist/{index-DTFcQizU.js → index-DVaTGA2z.js} +5 -5
- package/dist/{index-DoC-nKZZ.js → index-Dwqa30HZ.js} +1 -1
- package/dist/{index-B_H-Ynz5.js → index-DyQ9YnMd.js} +6 -6
- package/dist/{index-BR0HXBjY.js → index-E4Q6JmzX.js} +3 -3
- package/dist/{index-DelMCvoP.js → index-W_4faD_M.js} +2 -2
- package/dist/{index-B51WSpDM.js → index-ues0LW7p.js} +3 -3
- package/dist/index.js +1 -1
- package/dist/{menuPermission-CF3r6JEV.js → menuPermission-C33I6ujb.js} +2 -2
- package/dist/pages.js +1 -1
- package/dist/{useAppStore-BFO_h1L2.js → useAppStore-uc8v8XZC.js} +1 -1
- package/dist/{webide-DTZ46LPR.js → webide-BuUYLPSp.js} +2 -2
- package/dist/z-team-component.css +1 -1
- package/package.json +1 -1
- package/dist/ComponentDoc-D1vtx1CE.js +0 -3998
- package/dist/InvitationManagementPage-DDx-AX4v.js +0 -495
- package/dist/OnboardingPage-DUVza4FC.js +0 -393
- package/dist/ScheduledTasks-CGNB0zlb.js +0 -10708
- package/dist/SystemShell-DZ-W2gUt.js +0 -689
- package/dist/api-nf4Uaca5.js +0 -20
- package/dist/index-3qkbu-HG.js +0 -9844
- package/dist/index-B1lzhb6f.js +0 -1143
- package/dist/index-BqG6XqTh.js +0 -574
- package/dist/index-C1kpuot_.js +0 -118
- package/dist/index-CUhSJJL0.js +0 -178
- package/dist/index-D8ncig8C.js +0 -149
- package/dist/index-D_t92tEF.js +0 -2700
- package/dist/index-Dxx0UEBW.js +0 -93
- package/dist/index-JS2OVZ4Q.js +0 -3488
- package/dist/index-LkYDFjtJ.js +0 -914
- package/dist/index-d7BD8lzt.js +0 -242
- package/dist/index-p1jMVRnp.js +0 -112
- package/dist/menuPermission-CZvOK8eU.js +0 -60
- package/dist/personal-D-eMMf0_.js +0 -294
|
@@ -1,495 +0,0 @@
|
|
|
1
|
-
import { jsxs as i, jsx as e, Fragment as A } from "react/jsx-runtime";
|
|
2
|
-
import { useState as o, useEffect as oe } from "react";
|
|
3
|
-
import { Form as m, message as l, Button as d, Input as B, Row as ae, Col as z, Card as v, Statistic as O, Alert as T, Space as p, Typography as se, Tabs as de, Popconfirm as F, Tag as h, Tooltip as ce, Modal as he, Radio as S, Select as w, InputNumber as ue } from "antd";
|
|
4
|
-
import { PlusOutlined as me, ClockCircleOutlined as _, CheckCircleOutlined as $, LinkOutlined as D, CopyOutlined as b, QrcodeOutlined as U, UserDeleteOutlined as K, TeamOutlined as pe, MailOutlined as j, DeleteOutlined as ye, UserAddOutlined as q, CloseCircleOutlined as N } from "@ant-design/icons";
|
|
5
|
-
import { l as fe, b as ge, g as ve, c as we, d as be, e as Ce, f as xe } from "./api-nf4Uaca5.js";
|
|
6
|
-
import { PageHeader as Ie, TableToolbar as ke, ListTable as W } from "@yuku123/z-frontend-common/ui";
|
|
7
|
-
const { Text: c } = se, Me = () => {
|
|
8
|
-
const [C] = m.useForm(), [M, P] = o(!1), [y, G] = o([]), [L, H] = o([]), [J, Q] = o(null), [u, V] = o(""), [X, x] = o(!1), [Y, R] = o(!1), [a, E] = o(null), [r, Z] = o(localStorage.getItem("userInfo") && JSON.parse(localStorage.getItem("userInfo") || "{}").tenantCode || "");
|
|
9
|
-
oe(() => {
|
|
10
|
-
r && f();
|
|
11
|
-
}, [r]);
|
|
12
|
-
const f = async () => {
|
|
13
|
-
if (!r) {
|
|
14
|
-
l.warning("请先选择租户");
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
P(!0);
|
|
18
|
-
try {
|
|
19
|
-
const [t, n, s] = await Promise.all([
|
|
20
|
-
fe(r).catch(() => []),
|
|
21
|
-
ge(r).catch(() => []),
|
|
22
|
-
ve().catch(() => null)
|
|
23
|
-
]);
|
|
24
|
-
if (G(t || []), H(n || []), s) {
|
|
25
|
-
Q(s.userId);
|
|
26
|
-
const k = (s.memberships || []).find((le) => le.tenantCode === r);
|
|
27
|
-
V((k == null ? void 0 : k.roleCode) || "");
|
|
28
|
-
}
|
|
29
|
-
} catch (t) {
|
|
30
|
-
l.error("加载失败: " + ((t == null ? void 0 : t.message) || t));
|
|
31
|
-
} finally {
|
|
32
|
-
P(!1);
|
|
33
|
-
}
|
|
34
|
-
}, ee = async () => {
|
|
35
|
-
try {
|
|
36
|
-
const t = await C.validateFields();
|
|
37
|
-
R(!0);
|
|
38
|
-
const n = await xe({
|
|
39
|
-
tenantCode: r,
|
|
40
|
-
inviteeEmail: t.inviteeEmail,
|
|
41
|
-
roleCode: t.roleCode,
|
|
42
|
-
type: t.type,
|
|
43
|
-
maxUses: t.maxUses
|
|
44
|
-
});
|
|
45
|
-
n && n.id && (l.success("邀请创建成功!"), E(n), x(!1), C.resetFields(), f());
|
|
46
|
-
} catch (t) {
|
|
47
|
-
if (t != null && t.errorFields) return;
|
|
48
|
-
l.error("创建失败: " + ((t == null ? void 0 : t.message) || t));
|
|
49
|
-
} finally {
|
|
50
|
-
R(!1);
|
|
51
|
-
}
|
|
52
|
-
}, te = async (t) => {
|
|
53
|
-
try {
|
|
54
|
-
await Ce(t, r), l.success("已撤销"), f();
|
|
55
|
-
} catch (n) {
|
|
56
|
-
l.error("撤销失败: " + ((n == null ? void 0 : n.message) || n));
|
|
57
|
-
}
|
|
58
|
-
}, ne = async (t, n) => {
|
|
59
|
-
try {
|
|
60
|
-
await be(t, r), l.success(`已移除成员 ${n}`), f();
|
|
61
|
-
} catch (s) {
|
|
62
|
-
l.error("移除失败: " + ((s == null ? void 0 : s.message) || s));
|
|
63
|
-
}
|
|
64
|
-
}, ie = async () => {
|
|
65
|
-
try {
|
|
66
|
-
await we(r), l.success("已退出该租户"), window.location.href = "/onboarding";
|
|
67
|
-
} catch (t) {
|
|
68
|
-
l.error("退出失败: " + ((t == null ? void 0 : t.message) || t));
|
|
69
|
-
}
|
|
70
|
-
}, g = (t, n = "已复制") => {
|
|
71
|
-
navigator.clipboard.writeText(t), l.success(n);
|
|
72
|
-
}, re = {
|
|
73
|
-
0: { color: "processing", text: "待接受", icon: /* @__PURE__ */ e(_, {}) },
|
|
74
|
-
1: { color: "success", text: "已接受", icon: /* @__PURE__ */ e($, {}) },
|
|
75
|
-
2: { color: "default", text: "已撤销", icon: /* @__PURE__ */ e(N, {}) },
|
|
76
|
-
3: { color: "error", text: "已过期", icon: /* @__PURE__ */ e(N, {}) }
|
|
77
|
-
}, I = {
|
|
78
|
-
total: y.length,
|
|
79
|
-
pending: y.filter((t) => t.status === 0).length,
|
|
80
|
-
accepted: y.filter((t) => t.status === 1).length
|
|
81
|
-
};
|
|
82
|
-
return /* @__PURE__ */ i("div", { children: [
|
|
83
|
-
/* @__PURE__ */ e(
|
|
84
|
-
Ie,
|
|
85
|
-
{
|
|
86
|
-
title: "邀请管理",
|
|
87
|
-
subtitle: `租户: ${r}`
|
|
88
|
-
}
|
|
89
|
-
),
|
|
90
|
-
/* @__PURE__ */ e(
|
|
91
|
-
ke,
|
|
92
|
-
{
|
|
93
|
-
left: /* @__PURE__ */ e(
|
|
94
|
-
B,
|
|
95
|
-
{
|
|
96
|
-
placeholder: "租户编码",
|
|
97
|
-
value: r,
|
|
98
|
-
onChange: (t) => Z(t.target.value),
|
|
99
|
-
onPressEnter: f,
|
|
100
|
-
style: { width: 200 }
|
|
101
|
-
}
|
|
102
|
-
),
|
|
103
|
-
right: /* @__PURE__ */ e(d, { type: "primary", icon: /* @__PURE__ */ e(me, {}), onClick: () => x(!0), children: "创建邀请" }),
|
|
104
|
-
extra: null
|
|
105
|
-
}
|
|
106
|
-
),
|
|
107
|
-
/* @__PURE__ */ i(ae, { gutter: 16, style: { marginBottom: 16 }, children: [
|
|
108
|
-
/* @__PURE__ */ e(z, { span: 8, children: /* @__PURE__ */ e(v, { size: "small", children: /* @__PURE__ */ e(O, { title: "总邀请数", value: I.total }) }) }),
|
|
109
|
-
/* @__PURE__ */ e(z, { span: 8, children: /* @__PURE__ */ e(v, { size: "small", children: /* @__PURE__ */ e(
|
|
110
|
-
O,
|
|
111
|
-
{
|
|
112
|
-
title: "待接受",
|
|
113
|
-
value: I.pending,
|
|
114
|
-
styles: { content: { color: "#1890ff" } },
|
|
115
|
-
prefix: /* @__PURE__ */ e(_, {})
|
|
116
|
-
}
|
|
117
|
-
) }) }),
|
|
118
|
-
/* @__PURE__ */ e(z, { span: 8, children: /* @__PURE__ */ e(v, { size: "small", children: /* @__PURE__ */ e(
|
|
119
|
-
O,
|
|
120
|
-
{
|
|
121
|
-
title: "已接受",
|
|
122
|
-
value: I.accepted,
|
|
123
|
-
styles: { content: { color: "#52c41a" } },
|
|
124
|
-
prefix: /* @__PURE__ */ e($, {})
|
|
125
|
-
}
|
|
126
|
-
) }) })
|
|
127
|
-
] }),
|
|
128
|
-
a && /* @__PURE__ */ e(
|
|
129
|
-
T,
|
|
130
|
-
{
|
|
131
|
-
type: "success",
|
|
132
|
-
showIcon: !0,
|
|
133
|
-
style: { marginBottom: 16 },
|
|
134
|
-
message: "邀请创建成功!",
|
|
135
|
-
description: /* @__PURE__ */ i(p, { orientation: "vertical", style: { width: "100%" }, children: [
|
|
136
|
-
a.inviteUrl && /* @__PURE__ */ i(p, { children: [
|
|
137
|
-
/* @__PURE__ */ e(D, {}),
|
|
138
|
-
/* @__PURE__ */ e("code", { style: { background: "#f0f0f0", padding: "2px 6px", borderRadius: 3 }, children: a.inviteUrl }),
|
|
139
|
-
/* @__PURE__ */ e(
|
|
140
|
-
d,
|
|
141
|
-
{
|
|
142
|
-
size: "small",
|
|
143
|
-
icon: /* @__PURE__ */ e(b, {}),
|
|
144
|
-
onClick: () => g(a.inviteUrl, "邀请链接已复制"),
|
|
145
|
-
children: "复制链接"
|
|
146
|
-
}
|
|
147
|
-
)
|
|
148
|
-
] }),
|
|
149
|
-
a.inviteCode && /* @__PURE__ */ i(p, { children: [
|
|
150
|
-
/* @__PURE__ */ e(U, {}),
|
|
151
|
-
/* @__PURE__ */ e("code", { style: {
|
|
152
|
-
background: "#f0f0f0",
|
|
153
|
-
padding: "4px 12px",
|
|
154
|
-
borderRadius: 4,
|
|
155
|
-
fontSize: 18,
|
|
156
|
-
letterSpacing: 4,
|
|
157
|
-
fontWeight: "bold"
|
|
158
|
-
}, children: a.inviteCode }),
|
|
159
|
-
/* @__PURE__ */ e(
|
|
160
|
-
d,
|
|
161
|
-
{
|
|
162
|
-
size: "small",
|
|
163
|
-
icon: /* @__PURE__ */ e(b, {}),
|
|
164
|
-
onClick: () => g(a.inviteCode, "邀请码已复制"),
|
|
165
|
-
children: "复制码"
|
|
166
|
-
}
|
|
167
|
-
)
|
|
168
|
-
] }),
|
|
169
|
-
/* @__PURE__ */ i(c, { type: "secondary", style: { fontSize: 12 }, children: [
|
|
170
|
-
"过期时间: ",
|
|
171
|
-
new Date(a.expireAt).toLocaleString()
|
|
172
|
-
] })
|
|
173
|
-
] }),
|
|
174
|
-
closable: !0,
|
|
175
|
-
onClose: () => E(null)
|
|
176
|
-
}
|
|
177
|
-
),
|
|
178
|
-
/* @__PURE__ */ e(v, { size: "small", styles: { body: { paddingTop: 8 } }, children: /* @__PURE__ */ e(
|
|
179
|
-
de,
|
|
180
|
-
{
|
|
181
|
-
size: "small",
|
|
182
|
-
defaultActiveKey: "members",
|
|
183
|
-
items: [
|
|
184
|
-
{
|
|
185
|
-
key: "members",
|
|
186
|
-
label: /* @__PURE__ */ i("span", { children: [
|
|
187
|
-
/* @__PURE__ */ e(pe, {}),
|
|
188
|
-
" 成员管理 (",
|
|
189
|
-
L.length,
|
|
190
|
-
")"
|
|
191
|
-
] }),
|
|
192
|
-
children: /* @__PURE__ */ i(A, { children: [
|
|
193
|
-
u && u !== "owner" && /* @__PURE__ */ e(
|
|
194
|
-
T,
|
|
195
|
-
{
|
|
196
|
-
type: "warning",
|
|
197
|
-
showIcon: !0,
|
|
198
|
-
style: { marginBottom: 12 },
|
|
199
|
-
message: `你是 ${u}, 退出后回游离态, owner 需先转让`,
|
|
200
|
-
action: /* @__PURE__ */ e(
|
|
201
|
-
F,
|
|
202
|
-
{
|
|
203
|
-
title: "确认退出该租户?",
|
|
204
|
-
description: "退出后将回到游离态, 可重新加入或创建新租户",
|
|
205
|
-
onConfirm: ie,
|
|
206
|
-
children: /* @__PURE__ */ e(d, { size: "small", danger: !0, icon: /* @__PURE__ */ e(K, {}), children: "退出租户" })
|
|
207
|
-
}
|
|
208
|
-
)
|
|
209
|
-
}
|
|
210
|
-
),
|
|
211
|
-
/* @__PURE__ */ e(
|
|
212
|
-
W,
|
|
213
|
-
{
|
|
214
|
-
rows: L,
|
|
215
|
-
rowKey: "id",
|
|
216
|
-
loading: M,
|
|
217
|
-
searchKeys: ["userId", "roleCode"],
|
|
218
|
-
searchPlaceholder: "按用户 ID / 角色过滤",
|
|
219
|
-
emptyTitle: "暂无成员",
|
|
220
|
-
emptyDescription: "该租户还没有成员,发个邀请把人拉进来。",
|
|
221
|
-
cardProps: { variant: "borderless", styles: { body: { padding: 0 } } },
|
|
222
|
-
columns: [
|
|
223
|
-
{ title: "ID", dataIndex: "id", width: 60 },
|
|
224
|
-
{ title: "用户ID", dataIndex: "userId", width: 80 },
|
|
225
|
-
{
|
|
226
|
-
title: "角色",
|
|
227
|
-
dataIndex: "roleCode",
|
|
228
|
-
width: 100,
|
|
229
|
-
render: (t) => /* @__PURE__ */ i(
|
|
230
|
-
h,
|
|
231
|
-
{
|
|
232
|
-
color: t === "owner" ? "gold" : t === "admin" ? "blue" : "default",
|
|
233
|
-
children: [
|
|
234
|
-
t === "owner" && "👑 ",
|
|
235
|
-
t
|
|
236
|
-
]
|
|
237
|
-
}
|
|
238
|
-
)
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
title: "状态",
|
|
242
|
-
dataIndex: "memberStatus",
|
|
243
|
-
width: 80,
|
|
244
|
-
render: (t) => /* @__PURE__ */ e(
|
|
245
|
-
h,
|
|
246
|
-
{
|
|
247
|
-
color: t === 1 ? "success" : "default",
|
|
248
|
-
children: t === 1 ? "正常" : "已退出"
|
|
249
|
-
}
|
|
250
|
-
)
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
title: "加入时间",
|
|
254
|
-
dataIndex: "joinedAt",
|
|
255
|
-
width: 160,
|
|
256
|
-
render: (t) => t ? new Date(t).toLocaleString() : "-"
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
title: "操作",
|
|
260
|
-
width: 100,
|
|
261
|
-
fixed: "right",
|
|
262
|
-
render: (t, n) => u !== "owner" && u !== "admin" ? /* @__PURE__ */ e(
|
|
263
|
-
c,
|
|
264
|
-
{
|
|
265
|
-
type: "secondary",
|
|
266
|
-
children: "-"
|
|
267
|
-
}
|
|
268
|
-
) : n.roleCode === "owner" ? /* @__PURE__ */ e(
|
|
269
|
-
c,
|
|
270
|
-
{
|
|
271
|
-
type: "secondary",
|
|
272
|
-
children: "owner"
|
|
273
|
-
}
|
|
274
|
-
) : n.userId === J ? /* @__PURE__ */ e(c, { type: "secondary", children: "自己" }) : u === "admin" && n.roleCode === "admin" ? /* @__PURE__ */ e(
|
|
275
|
-
c,
|
|
276
|
-
{
|
|
277
|
-
type: "secondary",
|
|
278
|
-
children: "-"
|
|
279
|
-
}
|
|
280
|
-
) : /* @__PURE__ */ e(
|
|
281
|
-
F,
|
|
282
|
-
{
|
|
283
|
-
title: "确认移除该成员?",
|
|
284
|
-
description: "移除后该用户将回游离态, 可重新接受邀请加入",
|
|
285
|
-
onConfirm: () => ne(n.id, `userId=${n.userId}`),
|
|
286
|
-
children: /* @__PURE__ */ e(
|
|
287
|
-
d,
|
|
288
|
-
{
|
|
289
|
-
size: "small",
|
|
290
|
-
type: "text",
|
|
291
|
-
danger: !0,
|
|
292
|
-
icon: /* @__PURE__ */ e(K, {}),
|
|
293
|
-
children: "移除"
|
|
294
|
-
}
|
|
295
|
-
)
|
|
296
|
-
}
|
|
297
|
-
)
|
|
298
|
-
}
|
|
299
|
-
]
|
|
300
|
-
}
|
|
301
|
-
)
|
|
302
|
-
] })
|
|
303
|
-
},
|
|
304
|
-
{
|
|
305
|
-
key: "invitations",
|
|
306
|
-
label: /* @__PURE__ */ i("span", { children: [
|
|
307
|
-
/* @__PURE__ */ e(q, {}),
|
|
308
|
-
" 邀请记录 (",
|
|
309
|
-
y.length,
|
|
310
|
-
")"
|
|
311
|
-
] }),
|
|
312
|
-
// 邀请记录 —— 走基座 ListTable:标准分页 + 端侧过滤 + EmptyState。
|
|
313
|
-
children: /* @__PURE__ */ e(
|
|
314
|
-
W,
|
|
315
|
-
{
|
|
316
|
-
rows: y,
|
|
317
|
-
rowKey: "id",
|
|
318
|
-
loading: M,
|
|
319
|
-
searchKeys: ["inviteeEmail", "roleCode", "status"],
|
|
320
|
-
searchPlaceholder: "按被邀请人 / 角色 / 状态过滤",
|
|
321
|
-
emptyTitle: "暂无邀请",
|
|
322
|
-
emptyDescription: "点右上角创建第一个。",
|
|
323
|
-
cardProps: { variant: "borderless", styles: { body: { padding: 0 } } },
|
|
324
|
-
columns: [
|
|
325
|
-
{ title: "ID", dataIndex: "id", width: 60 },
|
|
326
|
-
{
|
|
327
|
-
title: "类型",
|
|
328
|
-
dataIndex: "type",
|
|
329
|
-
width: 80,
|
|
330
|
-
render: (t, n) => n.token ? /* @__PURE__ */ e(h, { color: "blue", icon: /* @__PURE__ */ e(D, {}), children: "链接" }) : n.inviteCode ? /* @__PURE__ */ e(h, { color: "purple", icon: /* @__PURE__ */ e(U, {}), children: "码" }) : "-"
|
|
331
|
-
},
|
|
332
|
-
{
|
|
333
|
-
title: "内容",
|
|
334
|
-
render: (t, n) => n.token ? /* @__PURE__ */ i(p, { children: [
|
|
335
|
-
/* @__PURE__ */ i("code", { style: { fontSize: 11 }, children: [
|
|
336
|
-
n.token.substring(0, 16),
|
|
337
|
-
"..."
|
|
338
|
-
] }),
|
|
339
|
-
/* @__PURE__ */ e(
|
|
340
|
-
d,
|
|
341
|
-
{
|
|
342
|
-
size: "small",
|
|
343
|
-
type: "link",
|
|
344
|
-
icon: /* @__PURE__ */ e(b, {}),
|
|
345
|
-
onClick: () => g(
|
|
346
|
-
`https://opc.zopc.top/invite?token=${n.token}`,
|
|
347
|
-
"完整链接已复制"
|
|
348
|
-
),
|
|
349
|
-
children: "复制"
|
|
350
|
-
}
|
|
351
|
-
)
|
|
352
|
-
] }) : n.inviteCode ? /* @__PURE__ */ i(p, { children: [
|
|
353
|
-
/* @__PURE__ */ e("code", { style: {
|
|
354
|
-
fontSize: 16,
|
|
355
|
-
letterSpacing: 2,
|
|
356
|
-
fontWeight: "bold",
|
|
357
|
-
background: "#f0f0f0",
|
|
358
|
-
padding: "2px 8px",
|
|
359
|
-
borderRadius: 3
|
|
360
|
-
}, children: n.inviteCode }),
|
|
361
|
-
/* @__PURE__ */ e(
|
|
362
|
-
d,
|
|
363
|
-
{
|
|
364
|
-
size: "small",
|
|
365
|
-
type: "link",
|
|
366
|
-
icon: /* @__PURE__ */ e(b, {}),
|
|
367
|
-
onClick: () => g(n.inviteCode, "邀请码已复制"),
|
|
368
|
-
children: "复制"
|
|
369
|
-
}
|
|
370
|
-
)
|
|
371
|
-
] }) : "-"
|
|
372
|
-
},
|
|
373
|
-
{
|
|
374
|
-
title: "被邀请人",
|
|
375
|
-
render: (t, n) => n.inviteeEmail ? /* @__PURE__ */ i(p, { size: 4, children: [
|
|
376
|
-
/* @__PURE__ */ e(j, {}),
|
|
377
|
-
" ",
|
|
378
|
-
n.inviteeEmail
|
|
379
|
-
] }) : n.inviteePhone || /* @__PURE__ */ e(c, { type: "secondary", children: "不限 (公开码)" })
|
|
380
|
-
},
|
|
381
|
-
{
|
|
382
|
-
title: "角色",
|
|
383
|
-
dataIndex: "roleCode",
|
|
384
|
-
width: 80,
|
|
385
|
-
render: (t) => /* @__PURE__ */ e(
|
|
386
|
-
h,
|
|
387
|
-
{
|
|
388
|
-
color: t === "owner" ? "gold" : t === "admin" ? "blue" : "default",
|
|
389
|
-
children: t
|
|
390
|
-
}
|
|
391
|
-
)
|
|
392
|
-
},
|
|
393
|
-
{
|
|
394
|
-
title: "使用情况",
|
|
395
|
-
width: 100,
|
|
396
|
-
render: (t, n) => /* @__PURE__ */ e(ce, { title: `最多 ${n.maxUses || 1} 次`, children: /* @__PURE__ */ i(h, { children: [
|
|
397
|
-
n.usedCount || 0,
|
|
398
|
-
" / ",
|
|
399
|
-
n.maxUses || 1
|
|
400
|
-
] }) })
|
|
401
|
-
},
|
|
402
|
-
{
|
|
403
|
-
title: "状态",
|
|
404
|
-
dataIndex: "status",
|
|
405
|
-
width: 90,
|
|
406
|
-
render: (t) => {
|
|
407
|
-
const n = re[t] || { color: "default", text: "?" };
|
|
408
|
-
return /* @__PURE__ */ e(h, { color: n.color, icon: n.icon, children: n.text });
|
|
409
|
-
}
|
|
410
|
-
},
|
|
411
|
-
{
|
|
412
|
-
title: "过期时间",
|
|
413
|
-
dataIndex: "expireAt",
|
|
414
|
-
width: 140,
|
|
415
|
-
render: (t) => t ? /* @__PURE__ */ e(
|
|
416
|
-
c,
|
|
417
|
-
{
|
|
418
|
-
type: new Date(t) < /* @__PURE__ */ new Date() ? "danger" : "secondary",
|
|
419
|
-
style: { fontSize: 12 },
|
|
420
|
-
children: new Date(t).toLocaleString()
|
|
421
|
-
}
|
|
422
|
-
) : "-"
|
|
423
|
-
},
|
|
424
|
-
{
|
|
425
|
-
title: "操作",
|
|
426
|
-
width: 80,
|
|
427
|
-
fixed: "right",
|
|
428
|
-
render: (t, n) => n.status === 0 ? /* @__PURE__ */ e(
|
|
429
|
-
d,
|
|
430
|
-
{
|
|
431
|
-
size: "small",
|
|
432
|
-
type: "text",
|
|
433
|
-
danger: !0,
|
|
434
|
-
icon: /* @__PURE__ */ e(ye, {}),
|
|
435
|
-
onClick: () => te(n.id),
|
|
436
|
-
children: "撤销"
|
|
437
|
-
}
|
|
438
|
-
) : /* @__PURE__ */ e(c, { type: "secondary", children: "-" })
|
|
439
|
-
}
|
|
440
|
-
]
|
|
441
|
-
}
|
|
442
|
-
)
|
|
443
|
-
}
|
|
444
|
-
]
|
|
445
|
-
}
|
|
446
|
-
) }),
|
|
447
|
-
/* @__PURE__ */ i(
|
|
448
|
-
he,
|
|
449
|
-
{
|
|
450
|
-
title: /* @__PURE__ */ i(A, { children: [
|
|
451
|
-
/* @__PURE__ */ e(q, {}),
|
|
452
|
-
" 创建邀请"
|
|
453
|
-
] }),
|
|
454
|
-
open: X,
|
|
455
|
-
onCancel: () => x(!1),
|
|
456
|
-
onOk: ee,
|
|
457
|
-
confirmLoading: Y,
|
|
458
|
-
okText: "创建",
|
|
459
|
-
children: [
|
|
460
|
-
/* @__PURE__ */ i(m, { form: C, layout: "vertical", initialValues: { type: "link", roleCode: "member", maxUses: 1 }, children: [
|
|
461
|
-
/* @__PURE__ */ e(m.Item, { name: "type", label: "类型", rules: [{ required: !0 }], children: /* @__PURE__ */ i(S.Group, { children: [
|
|
462
|
-
/* @__PURE__ */ i(S.Button, { value: "link", children: [
|
|
463
|
-
/* @__PURE__ */ e(D, {}),
|
|
464
|
-
" 邀请链接"
|
|
465
|
-
] }),
|
|
466
|
-
/* @__PURE__ */ i(S.Button, { value: "code", children: [
|
|
467
|
-
/* @__PURE__ */ e(U, {}),
|
|
468
|
-
" 邀请码"
|
|
469
|
-
] })
|
|
470
|
-
] }) }),
|
|
471
|
-
/* @__PURE__ */ e(m.Item, { name: "inviteeEmail", label: "被邀请人邮箱 (可选, 链接模式可指定)", children: /* @__PURE__ */ e(B, { prefix: /* @__PURE__ */ e(j, {}), placeholder: "留空则任何人都可用 (码模式)" }) }),
|
|
472
|
-
/* @__PURE__ */ e(m.Item, { name: "roleCode", label: "加入后角色", rules: [{ required: !0 }], children: /* @__PURE__ */ i(w, { children: [
|
|
473
|
-
/* @__PURE__ */ e(w.Option, { value: "owner", children: "owner (完全管理)" }),
|
|
474
|
-
/* @__PURE__ */ e(w.Option, { value: "admin", children: "admin (管理员)" }),
|
|
475
|
-
/* @__PURE__ */ e(w.Option, { value: "member", children: "member (普通成员)" })
|
|
476
|
-
] }) }),
|
|
477
|
-
/* @__PURE__ */ e(
|
|
478
|
-
m.Item,
|
|
479
|
-
{
|
|
480
|
-
name: "maxUses",
|
|
481
|
-
label: "最大使用次数",
|
|
482
|
-
extra: "码模式可 > 1 (批量邀请), 链接模式固定 1",
|
|
483
|
-
children: /* @__PURE__ */ e(ue, { min: 1, max: 100, style: { width: "100%" } })
|
|
484
|
-
}
|
|
485
|
-
)
|
|
486
|
-
] }),
|
|
487
|
-
/* @__PURE__ */ e(T, { type: "info", showIcon: !0, title: "链接模式 7 天过期, 码模式同 7 天" })
|
|
488
|
-
]
|
|
489
|
-
}
|
|
490
|
-
)
|
|
491
|
-
] });
|
|
492
|
-
};
|
|
493
|
-
export {
|
|
494
|
-
Me as default
|
|
495
|
-
};
|