@yuku123/z-team-component 0.2.103 → 0.2.105

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 (60) hide show
  1. package/dist/ChangeLogView-B0ML82u0.js +542 -0
  2. package/dist/ComponentDoc-C_289lsE.js +8035 -0
  3. package/dist/InvitationManagementPage-D2ezz4ZQ.js +495 -0
  4. package/dist/OnboardingPage-BXsJ-kcJ.js +393 -0
  5. package/dist/ScheduledTasks-Cn8BsDkN.js +12127 -0
  6. package/dist/SystemShell-gcfNlt2L.js +688 -0
  7. package/dist/_commonjsHelpers-B52_cu2H.js +26 -0
  8. package/dist/admin-logs-B6K1DwRL.js +198 -0
  9. package/dist/api-BdP8mK8v.js +101 -0
  10. package/dist/api-DxSgE7qw.js +20 -0
  11. package/dist/browser-jb_PFvU3.js +1538 -0
  12. package/dist/createWorkspaceWsHandler-DcNA1pfi.js +13142 -0
  13. package/dist/ctc-sso-DtJHC-2M.js +117 -0
  14. package/dist/echarts-B1OU1xr4.js +16 -0
  15. package/dist/history-BlrA1eaW.js +41 -0
  16. package/dist/index-54iTaRVW.js +316 -0
  17. package/dist/index-BCw3Oxp1.js +42049 -0
  18. package/dist/index-BDq0ofl2.js +348 -0
  19. package/dist/index-BN-o5nZM.js +8 -0
  20. package/dist/index-B_LJRFsK.js +339 -0
  21. package/dist/index-Bf1K9zpk.js +112 -0
  22. package/dist/index-BfMFQ6RD.js +169 -0
  23. package/dist/index-BohoJQPr.js +7631 -0
  24. package/dist/index-C-8n6xxK.js +93 -0
  25. package/dist/index-C815hPWS.js +430 -0
  26. package/dist/index-C8m8s-SU.js +479 -0
  27. package/dist/index-CXJXSmhB.js +2217 -0
  28. package/dist/index-CdugR2_4.js +5892 -0
  29. package/dist/index-CeCsncoT.js +913 -0
  30. package/dist/index-CgCB0-yK.js +1645 -0
  31. package/dist/index-Cjddvrij.js +2699 -0
  32. package/dist/index-D487Inba.js +315 -0
  33. package/dist/index-DK71mfJn.js +999 -0
  34. package/dist/index-DLHcoHS9.js +189 -0
  35. package/dist/index-DUiFk01c.js +178 -0
  36. package/dist/index-DWsfQMp8.js +208 -0
  37. package/dist/index-DgN13A-E.js +10169 -0
  38. package/dist/index-DhDdFRHC.js +279 -0
  39. package/dist/index-DpLamT1r.js +574 -0
  40. package/dist/index-Dpii3P5J.js +1302 -0
  41. package/dist/index-DszzQwsc.js +956 -0
  42. package/dist/index-HJ3Kt-NT.js +358 -0
  43. package/dist/index-Nj-dlFKY.js +242 -0
  44. package/dist/index-ZuYJoo9E.js +118 -0
  45. package/dist/index-etyS3HY2.js +142 -0
  46. package/dist/index-jIh52A4c.js +132 -0
  47. package/dist/index.js +10 -0
  48. package/dist/index.module-CAa-2T7m.js +72 -0
  49. package/dist/index.module-UI0iz8K0.js +42 -0
  50. package/dist/instance-p-ezisoS.js +216 -0
  51. package/dist/menuPermission-u3Gd_c8S.js +60 -0
  52. package/dist/mobile-client-O3yr9h6t.js +24 -0
  53. package/dist/pages.js +21 -0
  54. package/dist/send-default-agent-team-message-BhIV6T6O.js +35 -0
  55. package/dist/spark-md5-Dld54a-T.js +178 -0
  56. package/dist/sso-user-Ib1jhF7t.js +43 -0
  57. package/dist/training-D3Uy5K_M.js +450 -0
  58. package/dist/webide-BGQnArzY.js +5233 -0
  59. package/dist/z-team-component.css +1 -0
  60. package/package.json +1 -1
@@ -0,0 +1,315 @@
1
+ import { jsx as t, jsxs as l } from "react/jsx-runtime";
2
+ import { f as ie, r as z } from "./ctc-sso-DtJHC-2M.js";
3
+ import { r as ne, h as X, s as oe } from "./sso-user-Ib1jhF7t.js";
4
+ import { CheckCircleFilled as le, QuestionCircleOutlined as ce, CloseOutlined as me } from "@ant-design/icons";
5
+ import { message as P, Result as de, Button as D, Spin as G, Input as ue, Image as fe } from "antd";
6
+ import pe from "query-string";
7
+ import { useState as f, useRef as Y, useMemo as K, useCallback as w, useEffect as V } from "react";
8
+ import { useLocation as ge } from "react-router-dom";
9
+ import { h as W } from "./history-BlrA1eaW.js";
10
+ import { u as c, o as he, j as be, k as _e } from "./ComponentDoc-C_289lsE.js";
11
+ /* empty css */
12
+ import { b as ye } from "./mobile-client-O3yr9h6t.js";
13
+ import { a as ve, s as we } from "./send-default-agent-team-message-BhIV6T6O.js";
14
+ const Ne = 5e3, E = 9, Ce = 10 * 1024 * 1024, Se = /^image\//i, Ie = /\.(png|jpe?g|gif|bmp|webp)$/i;
15
+ function ke(a) {
16
+ return a.type && Se.test(a.type) ? !0 : Ie.test(a.name || "");
17
+ }
18
+ function Pe(a) {
19
+ var o;
20
+ if (!((o = a == null ? void 0 : a.items) != null && o.length))
21
+ return [];
22
+ const m = [];
23
+ for (let p = 0; p < a.items.length; p += 1) {
24
+ const d = a.items[p];
25
+ if (d.kind === "file" && d.type.startsWith("image/")) {
26
+ const N = d.getAsFile();
27
+ N && m.push(N);
28
+ }
29
+ }
30
+ return m;
31
+ }
32
+ function Ee(a) {
33
+ return {
34
+ id: `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`,
35
+ file: a,
36
+ previewUrl: URL.createObjectURL(a)
37
+ };
38
+ }
39
+ function Q(a) {
40
+ URL.revokeObjectURL(a.previewUrl);
41
+ }
42
+ function Ue(a) {
43
+ return a.map((m) => m.file);
44
+ }
45
+ const J = 30;
46
+ function Xe() {
47
+ const a = ge(), m = pe.parse(a.search), o = String(
48
+ m.scenarioCode ?? m.scenario_code ?? ""
49
+ ).trim(), p = c((e) => e.expandProject), d = c((e) => e.updateCurrentUser), [N, H] = f(!1), [_, Z] = f(""), [y, U] = f([]), [M, R] = f("form"), [j, T] = f(""), [A, g] = f("正在登录…"), [B, F] = f([]), k = Y(!1), x = Y(y);
50
+ x.current = y;
51
+ const C = K(() => o ? "" : "缺少参数 scenarioCode", [o]), S = w((e, r) => {
52
+ F((n) => [...n, e]), g(r);
53
+ }, []), ee = (e) => new Promise((r) => {
54
+ window.setTimeout(r, e);
55
+ });
56
+ V(() => {
57
+ if (C)
58
+ return;
59
+ let e = !1, r = 0;
60
+ const n = 100;
61
+ let i = !1, s = 0;
62
+ const v = 3;
63
+ return (() => {
64
+ if (e)
65
+ return;
66
+ const u = async () => {
67
+ if (e)
68
+ return;
69
+ let h = ne();
70
+ if ((!h || !X(h)) && !i) {
71
+ i = !0;
72
+ try {
73
+ const b = await ie();
74
+ b.kind === "authenticated" ? h = b.user : b.kind === "unauthenticated" && (s += 1);
75
+ } catch {
76
+ } finally {
77
+ i = !1;
78
+ }
79
+ }
80
+ if (h && X(h)) {
81
+ d(oe(h));
82
+ const b = c.getState().token;
83
+ try {
84
+ const se = await _e(b);
85
+ e || d(se);
86
+ } catch {
87
+ !e && b && (localStorage.removeItem("z_team_token"), c.setState({ token: "" }));
88
+ } finally {
89
+ e || (H(!0), g(""));
90
+ }
91
+ return;
92
+ }
93
+ if (s >= v) {
94
+ z();
95
+ return;
96
+ }
97
+ if (r += 1, r >= n) {
98
+ z();
99
+ return;
100
+ }
101
+ window.setTimeout(() => void u(), 150);
102
+ };
103
+ u();
104
+ })(), () => {
105
+ e = !0;
106
+ };
107
+ }, [C, d]);
108
+ const te = w(
109
+ async (e, r) => {
110
+ if (k.current)
111
+ return;
112
+ k.current = !0, R("loading"), F([]), g("正在按场景创建工程…");
113
+ const n = e.slice(0, J), i = c.getState().token;
114
+ try {
115
+ let s = [];
116
+ r.length > 0 && (g("正在上传图片…"), s = await he(r));
117
+ const v = ve(e, s), I = await be(
118
+ {
119
+ name: n,
120
+ description: v,
121
+ workspace_path: n,
122
+ scenario_code: o
123
+ },
124
+ i
125
+ );
126
+ S("工程已创建", "正在打开协作区…"), g("正在同步工程列表…"), await p(I);
127
+ const u = c.getState();
128
+ u.currentProject && await u.refreshProjectPanels(
129
+ String(u.currentProject.id),
130
+ u.projectSwitchSeq,
131
+ !1
132
+ ), S("协作区已就绪", "正在发送协作消息…"), await we(
133
+ I.id,
134
+ e,
135
+ i,
136
+ c.getState().members,
137
+ s
138
+ ), await c.getState().loadMessages(), S("协作消息已发送", "即将进入工作台…"), g("即将进入工作台…"), await ee(2e3), W.replace(
139
+ ye({
140
+ projectId: I.id,
141
+ search: a.search
142
+ })
143
+ );
144
+ } catch (s) {
145
+ k.current = !1, R("form");
146
+ const v = s instanceof Error ? s.message : String(s);
147
+ T(v || "创建工程失败");
148
+ }
149
+ },
150
+ [S, p, a.search, o]
151
+ ), L = w((e) => {
152
+ e.length && U((r) => {
153
+ const n = E - r.length;
154
+ if (n <= 0)
155
+ return P.warning(`最多粘贴 ${E} 张图片`), r;
156
+ const i = [...r];
157
+ for (const s of e.slice(0, n)) {
158
+ if (!ke(s)) {
159
+ P.warning("仅支持粘贴图片");
160
+ continue;
161
+ }
162
+ if (s.size > Ce) {
163
+ P.warning("单张图片不能超过 10MB");
164
+ continue;
165
+ }
166
+ i.push(Ee(s));
167
+ }
168
+ return i;
169
+ });
170
+ }, []), re = w((e) => {
171
+ U((r) => {
172
+ const n = r.find((i) => i.id === e);
173
+ return n && Q(n), r.filter((i) => i.id !== e);
174
+ });
175
+ }, []);
176
+ V(() => () => {
177
+ x.current.forEach(Q);
178
+ }, []);
179
+ const ae = w(
180
+ (e) => {
181
+ const r = Pe(e.clipboardData);
182
+ r.length > 0 && (e.preventDefault(), L(r));
183
+ },
184
+ [L]
185
+ ), $ = () => {
186
+ const e = _.trim();
187
+ e && (T(""), te(e, Ue(y)));
188
+ }, O = K(() => {
189
+ const e = _.trim().slice(0, J);
190
+ return `场景 ${o}${e ? ` · ${e}` : ""}`;
191
+ }, [_, o]);
192
+ if (C || j && M === "form")
193
+ return /* @__PURE__ */ t("div", { className: "build-by-form-page", children: /* @__PURE__ */ t(
194
+ de,
195
+ {
196
+ status: "error",
197
+ title: "无法继续",
198
+ subTitle: C || j,
199
+ extra: /* @__PURE__ */ t(
200
+ D,
201
+ {
202
+ type: "primary",
203
+ onClick: () => W.replace("/workspace"),
204
+ children: "返回工作台"
205
+ }
206
+ )
207
+ }
208
+ ) });
209
+ if (!N)
210
+ return /* @__PURE__ */ t("div", { className: "build-by-form-page", children: /* @__PURE__ */ t("div", { className: "build-by-form-page__shell", children: /* @__PURE__ */ t("div", { className: "build-by-form-page__panel", children: /* @__PURE__ */ l("div", { className: "build-by-form-page__loading", children: [
211
+ /* @__PURE__ */ t(G, { size: "large" }),
212
+ /* @__PURE__ */ t("p", { className: "build-by-form-page__step", children: A || "正在登录…" })
213
+ ] }) }) }) });
214
+ if (M === "loading")
215
+ return /* @__PURE__ */ t("div", { className: "build-by-form-page", children: /* @__PURE__ */ t("div", { className: "build-by-form-page__shell", children: /* @__PURE__ */ t("div", { className: "build-by-form-page__panel", children: /* @__PURE__ */ l("div", { className: "build-by-form-page__loading", children: [
216
+ /* @__PURE__ */ t(G, { size: "large" }),
217
+ /* @__PURE__ */ t("p", { className: "build-by-form-page__step", children: A }),
218
+ O ? /* @__PURE__ */ t("p", { className: "build-by-form-page__meta", children: O }) : null,
219
+ B.length > 0 ? /* @__PURE__ */ t("ul", { className: "build-by-form-page__done-list", children: B.map((e, r) => /* @__PURE__ */ l(
220
+ "li",
221
+ {
222
+ className: "build-by-form-page__done-item",
223
+ children: [
224
+ /* @__PURE__ */ t(le, { className: "build-by-form-page__done-icon" }),
225
+ /* @__PURE__ */ t("span", { children: e })
226
+ ]
227
+ },
228
+ `${r}-${e}`
229
+ )) }) : null
230
+ ] }) }) }) });
231
+ const q = !!_.trim();
232
+ return /* @__PURE__ */ t("div", { className: "build-by-form-page", children: /* @__PURE__ */ t("div", { className: "build-by-form-page__shell", children: /* @__PURE__ */ l("div", { className: "build-by-form-page__panel", children: [
233
+ /* @__PURE__ */ l("div", { className: "build-by-form-page__header", children: [
234
+ /* @__PURE__ */ t("div", { className: "build-by-form-page__icon", "aria-hidden": !0, children: /* @__PURE__ */ t(ce, {}) }),
235
+ /* @__PURE__ */ l("div", { children: [
236
+ /* @__PURE__ */ t("h1", { className: "build-by-form-page__title", children: "描述你的问题" }),
237
+ /* @__PURE__ */ t("p", { className: "build-by-form-page__subtitle", children: "提交后将创建协作空间,并把问题发送给智能体" })
238
+ ] })
239
+ ] }),
240
+ /* @__PURE__ */ l("div", { className: "build-by-form-page__field", onPaste: ae, children: [
241
+ /* @__PURE__ */ t(
242
+ "label",
243
+ {
244
+ className: "build-by-form-page__label",
245
+ htmlFor: "build-by-form-question",
246
+ children: "请描述问题"
247
+ }
248
+ ),
249
+ /* @__PURE__ */ t(
250
+ ue.TextArea,
251
+ {
252
+ id: "build-by-form-question",
253
+ className: "build-by-form-page__textarea",
254
+ value: _,
255
+ onChange: (e) => Z(e.target.value),
256
+ onKeyDown: (e) => {
257
+ (e.metaKey || e.ctrlKey) && e.key === "Enter" && q && (e.preventDefault(), $());
258
+ },
259
+ placeholder: "请尽量描述清楚现象、期望结果或相关背景…(可在输入框内 Ctrl+V 粘贴图片)",
260
+ autoSize: { minRows: 6, maxRows: 14 },
261
+ maxLength: Ne,
262
+ showCount: !0,
263
+ autoFocus: !0
264
+ }
265
+ ),
266
+ y.length > 0 ? /* @__PURE__ */ t("ul", { className: "build-by-form-page__preview-list", children: y.map((e) => /* @__PURE__ */ l(
267
+ "li",
268
+ {
269
+ className: "build-by-form-page__preview-item",
270
+ children: [
271
+ /* @__PURE__ */ t(
272
+ fe,
273
+ {
274
+ src: e.previewUrl,
275
+ alt: "粘贴的图片",
276
+ className: "build-by-form-page__preview-img",
277
+ preview: { mask: "预览" }
278
+ }
279
+ ),
280
+ /* @__PURE__ */ t(
281
+ "button",
282
+ {
283
+ type: "button",
284
+ className: "build-by-form-page__preview-remove",
285
+ "aria-label": "移除图片",
286
+ onClick: () => re(e.id),
287
+ children: /* @__PURE__ */ t(me, {})
288
+ }
289
+ )
290
+ ]
291
+ },
292
+ e.id
293
+ )) }) : /* @__PURE__ */ l("p", { className: "build-by-form-page__paste-hint", children: [
294
+ "支持 Ctrl+V / ⌘+V 粘贴图片,最多 ",
295
+ E,
296
+ " 张"
297
+ ] })
298
+ ] }),
299
+ /* @__PURE__ */ t(
300
+ D,
301
+ {
302
+ type: "primary",
303
+ block: !0,
304
+ size: "large",
305
+ className: "build-by-form-page__submit",
306
+ disabled: !q,
307
+ onClick: $,
308
+ children: "确认并开始"
309
+ }
310
+ )
311
+ ] }) }) });
312
+ }
313
+ export {
314
+ Xe as default
315
+ };