@yuku123/z-team-component 0.2.84 → 0.2.89

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 (69) hide show
  1. package/dist/{ChangeLogView-_bRZ55Yi.js → ChangeLogView-DagOxr6O.js} +1 -1
  2. package/dist/{ComponentDoc-BFoF51we.js → ComponentDoc-CP8PmT4l.js} +3 -3
  3. package/dist/ComponentDoc-D1vtx1CE.js +3998 -0
  4. package/dist/{InvitationManagementPage-CTPCZXHu.js → InvitationManagementPage-C-8t565B.js} +1 -1
  5. package/dist/InvitationManagementPage-DDx-AX4v.js +495 -0
  6. package/dist/{OnboardingPage-DwtuTL61.js → OnboardingPage-DUUHQLSp.js} +2 -2
  7. package/dist/OnboardingPage-DUVza4FC.js +393 -0
  8. package/dist/ScheduledTasks-BSJP-8rB.js +10708 -0
  9. package/dist/ScheduledTasks-CGNB0zlb.js +10708 -0
  10. package/dist/{SystemShell-D9OzKxL-.js → SystemShell-DTFR-Pfd.js} +5 -5
  11. package/dist/SystemShell-DZ-W2gUt.js +689 -0
  12. package/dist/{api-CIhVblfa.js → api-BftpestH.js} +392 -391
  13. package/dist/{api-DXLNhtCX.js → api-GfWm5pTp.js} +1 -1
  14. package/dist/api-nf4Uaca5.js +20 -0
  15. package/dist/{createWorkspaceWsHandler-BWP5S5X3.js → createWorkspaceWsHandler-rKc7vc8k.js} +4373 -4294
  16. package/dist/index-3qkbu-HG.js +9844 -0
  17. package/dist/{index-BCp5EtqR.js → index-9Vozb4E5.js} +3 -3
  18. package/dist/{index-PKkV63Sw.js → index-B1lzhb6f.js} +1 -1
  19. package/dist/{index-CxFAICql.js → index-B51WSpDM.js} +7 -7
  20. package/dist/{index-uF04Ucsi.js → index-B5dDwxhs.js} +1 -1
  21. package/dist/{index-Cvx6rrxD.js → index-BMQ6XkO3.js} +1 -1
  22. package/dist/{index-CESmMALI.js → index-BR0HXBjY.js} +3 -3
  23. package/dist/index-B_H-Ynz5.js +9844 -0
  24. package/dist/index-BngdCYiY.js +149 -0
  25. package/dist/{index-SbMjh8t4.js → index-BqG6XqTh.js} +2 -2
  26. package/dist/{index-CijskN6t.js → index-BxBGVGKQ.js} +4 -4
  27. package/dist/{index-x_7Rmav9.js → index-C1kpuot_.js} +2 -2
  28. package/dist/{index-nW0ikV2R.js → index-C5FC0WCa.js} +5 -5
  29. package/dist/{index-CoBZZQBy.js → index-CHTu5H1U.js} +3 -3
  30. package/dist/{index-CBQMS6rx.js → index-CUhSJJL0.js} +2 -2
  31. package/dist/index-D8ncig8C.js +149 -0
  32. package/dist/index-D92Y4nix.js +178 -0
  33. package/dist/index-DTFcQizU.js +3488 -0
  34. package/dist/index-D_t92tEF.js +2700 -0
  35. package/dist/{index-DK70mOTz.js → index-DcHrkop2.js} +3 -3
  36. package/dist/index-DelMCvoP.js +118 -0
  37. package/dist/{index-mnWs_wA3.js → index-DoC-nKZZ.js} +2 -2
  38. package/dist/index-Dxx0UEBW.js +93 -0
  39. package/dist/{index-Dm3wmB0K.js → index-DyFaoD5W.js} +2 -2
  40. package/dist/index-EdPtymBD.js +574 -0
  41. package/dist/index-JS2OVZ4Q.js +3488 -0
  42. package/dist/index-LkYDFjtJ.js +914 -0
  43. package/dist/{index-nU-V276i.js → index-MYohlrH6.js} +4 -4
  44. package/dist/{index-cdB5K3gx.js → index-VGtET31b.js} +1 -1
  45. package/dist/index-d7BD8lzt.js +242 -0
  46. package/dist/{index-DT80Pwa_.js → index-ji8TPz9K.js} +4 -4
  47. package/dist/index-mIk8zAAm.js +1143 -0
  48. package/dist/index-p1jMVRnp.js +112 -0
  49. package/dist/{index-Cwr5Slv1.js → index-pScDd5cp.js} +6 -6
  50. package/dist/{index-DzS6-D3M.js → index-s_ikMJ2V.js} +1 -1
  51. package/dist/{index-BgIheStI.js → index-v3WaXkDJ.js} +3 -3
  52. package/dist/index.js +1 -1
  53. package/dist/{instance-CDmueqyu.js → instance-CI6-4BZ6.js} +1 -1
  54. package/dist/{menuPermission-DHUqvHfu.js → menuPermission-CF3r6JEV.js} +3 -3
  55. package/dist/menuPermission-CZvOK8eU.js +60 -0
  56. package/dist/pages.js +1 -1
  57. package/dist/{personal-Bn3RLYB8.js → personal-D-eMMf0_.js} +2 -2
  58. package/dist/{schedule-CETzN_0H.js → schedule-ChO2xIGd.js} +1 -1
  59. package/dist/{send-default-agent-team-message-CfVaEN2y.js → send-default-agent-team-message-c5oKdQQA.js} +1 -1
  60. package/dist/{sso-user-ZUKv4XMX.js → sso-user-DToM5dPy.js} +1 -1
  61. package/dist/{training-bxftgU55.js → training-B38tnwLL.js} +1 -1
  62. package/dist/{useAppStore-BBr_Fwsz.js → useAppStore-BFO_h1L2.js} +1 -1
  63. package/dist/{webide-Cuj_Pvkk.js → webide-DTZ46LPR.js} +4 -4
  64. package/dist/z-team-component.css +2 -2
  65. package/package.json +1 -1
  66. package/dist/ScheduledTasks-yeTm2bOY.js +0 -9407
  67. package/dist/index-BHrMl3Jq.js +0 -9585
  68. package/dist/index-BP7WTzVH.js +0 -137
  69. package/dist/index-Co_0idJY.js +0 -2936
@@ -2,7 +2,7 @@ import { jsxs as i, jsx as e, Fragment as A } from "react/jsx-runtime";
2
2
  import { useState as o, useEffect as oe } from "react";
3
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
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-DXLNhtCX.js";
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-GfWm5pTp.js";
6
6
  import { PageHeader as Ie, TableToolbar as ke, ListTable as W } from "@yuku123/z-frontend-common/ui";
7
7
  const { Text: c } = se, Me = () => {
8
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 || "");
@@ -0,0 +1,495 @@
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
+ };
@@ -3,8 +3,8 @@ import { useState as a, useMemo as oe, useEffect as W } from "react";
3
3
  import { useNavigate as le, useSearchParams as se } from "react-router-dom";
4
4
  import { Form as c, message as o, Spin as ce, Typography as de, Card as d, Tag as x, Empty as me, Row as he, Col as fe, Space as S, Avatar as ge, Pagination as pe, Button as T, Result as ue, Modal as E, Input as k, Alert as U } from "antd";
5
5
  import { RocketOutlined as q, ApartmentOutlined as ye, CheckCircleOutlined as Ce, PlusOutlined as z, KeyOutlined as m, GiftOutlined as ve, HomeOutlined as we, CrownOutlined as be } from "@ant-design/icons";
6
- import { g as xe, a as Se, s as Te, r as ke } from "./api-DXLNhtCX.js";
7
- import { a as ze } from "./ComponentDoc-BFoF51we.js";
6
+ import { g as xe, a as Se, s as Te, r as ke } from "./api-nf4Uaca5.js";
7
+ import { a as ze } from "./ComponentDoc-D1vtx1CE.js";
8
8
  const { Title: u, Text: O, Paragraph: Oe } = de, y = 12, Me = () => {
9
9
  const L = le(), [H] = se(), [_, I] = a(!0), [i, $] = a(null), [l, G] = a([]), [A, F] = a(0), [h, B] = a(""), [C, K] = a(1), X = oe(() => {
10
10
  const e = (C - 1) * y;