@yuku123/z-team-component 0.2.54 → 0.2.55

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 (50) hide show
  1. package/dist/{ChangeLogView-Cstbioyw.js → ChangeLogView-R6boINWk.js} +137 -137
  2. package/dist/{ComponentDoc-yvIrAz9-.js → ComponentDoc-DTJyJAy-.js} +121 -121
  3. package/dist/{InvitationManagementPage-CIouC3Fn.js → InvitationManagementPage-BZOxuoM5.js} +1 -1
  4. package/dist/{OnboardingPage-DScwVCi-.js → OnboardingPage-Be3MXW9i.js} +2 -2
  5. package/dist/{ScheduledTasks-Dd2lJrBF.js → ScheduledTasks-CxDbixJe.js} +2957 -2992
  6. package/dist/{SystemShell-DtvyWy0u.js → SystemShell-BEKwj3WF.js} +1 -1
  7. package/dist/{admin-logs-B9KS6VJz.js → admin-logs-DMF0dtG1.js} +2 -2
  8. package/dist/{api-CALqShkO.js → api-DhuqONeb.js} +210 -228
  9. package/dist/{api-CdVRdA0g.js → api-DqNgdbLm.js} +1 -1
  10. package/dist/createWorkspaceWsHandler-BKcAIc4B.js +13034 -0
  11. package/dist/{index-DEx5rtXv.js → index-8Qtz0IKN.js} +2 -2
  12. package/dist/{index-Pk7OkJrk.js → index-B30K72xQ.js} +517 -320
  13. package/dist/{index-7Pe_xBrh.js → index-B7cZdoRq.js} +1 -1
  14. package/dist/{index-C2Wkg1b5.js → index-B8eiFO_f.js} +3 -3
  15. package/dist/{index-DET70T3j.js → index-BKVWW3ba.js} +1 -1
  16. package/dist/{index-aw72ID7y.js → index-BM6XpIcw.js} +1 -1
  17. package/dist/{index-C3B7CbHo.js → index-BOcKPM37.js} +1 -1
  18. package/dist/{index-lftFkqfI.js → index-BP97Ev-W.js} +4 -4
  19. package/dist/{index-C6S3MIu4.js → index-BkX0I2aB.js} +56 -56
  20. package/dist/{index-DC5lxCN8.js → index-C5O0cK8A.js} +6 -6
  21. package/dist/index-C8Wkx3H_.js +8960 -0
  22. package/dist/{index-4YxdJwFm.js → index-CZ9xxAL0.js} +3 -3
  23. package/dist/{index-DLyAy3cr.js → index-CZxihNo5.js} +7 -7
  24. package/dist/{index-DKeYG0Fu.js → index-CbUsvCMy.js} +4 -4
  25. package/dist/{index-CLWgeKwr.js → index-Ct9MzvZV.js} +2 -2
  26. package/dist/{index-CGWttFLb.js → index-CzePRAbT.js} +4 -4
  27. package/dist/{index-CgQH7-9F.js → index-DQk6Pt6U.js} +3 -3
  28. package/dist/{index-DOygBsXO.js → index-DQmgOqd1.js} +1123 -1121
  29. package/dist/{index-D6V-4vNa.js → index-DV8rmjvN.js} +5 -5
  30. package/dist/{index-CKS65_Dw.js → index-DpNZTqcn.js} +3 -3
  31. package/dist/{index-usrA11ZG.js → index-JMzBzwiO.js} +617 -618
  32. package/dist/{index-DJOyOVn_.js → index-Otx98G8z.js} +74 -87
  33. package/dist/{index-C_2o9qgM.js → index-TPTesErt.js} +2 -2
  34. package/dist/index-mXMdvUYD.js +1182 -0
  35. package/dist/index.js +1 -1
  36. package/dist/{instance-f3C-1qYl.js → instance-Cr4_XM2r.js} +1 -1
  37. package/dist/pages.js +1 -1
  38. package/dist/{schedule-DfkgwPdE.js → schedule-BNLns-p4.js} +1 -1
  39. package/dist/{send-default-agent-team-message-d_ECdczr.js → send-default-agent-team-message-C9VWSWKJ.js} +1 -1
  40. package/dist/{sso-user-HcsSzg8P.js → sso-user-Cme2tmGq.js} +1 -1
  41. package/dist/{training-DnNQN0An.js → training-SjRAdtNQ.js} +1 -1
  42. package/dist/{useAppStore-kRZEA5WZ.js → useAppStore-C63xiq3-.js} +1 -1
  43. package/dist/{webide-DPjFYxLl.js → webide-DDFxSedU.js} +1526 -1526
  44. package/dist/z-team-component.css +2 -2
  45. package/package.json +1 -1
  46. package/dist/createWorkspaceWsHandler-CL5-4wFp.js +0 -13037
  47. package/dist/index-DLQoecEe.js +0 -1143
  48. package/dist/index-DWsfQMp8.js +0 -208
  49. package/dist/index-TDZM-Zv3.js +0 -9287
  50. package/dist/index-WIsi8fln.js +0 -339
@@ -0,0 +1,1182 @@
1
+ import { jsxs as l, jsx as e, Fragment as ce } from "react/jsx-runtime";
2
+ import { useNavigate as G, useParams as pe, useLocation as he, useRoutes as ue } from "react-router-dom";
3
+ import { useState as _, useEffect as M, useMemo as me } from "react";
4
+ import { RocketOutlined as ye, AppstoreOutlined as le, BellOutlined as ae, PlayCircleOutlined as V, CheckCircleOutlined as Q, CloseCircleOutlined as X, BulbOutlined as Y, PlusOutlined as B, EditOutlined as ge, CopyOutlined as ne, DeleteOutlined as fe, ArrowLeftOutlined as be, SaveOutlined as we, ReloadOutlined as Ie, ShopOutlined as ie, StarFilled as _e, CloudDownloadOutlined as ke, DashboardOutlined as ve, InfoCircleOutlined as xe } from "@ant-design/icons";
5
+ import { Typography as $, Row as H, Col as O, Card as F, Statistic as P, Table as se, Tag as b, Form as h, Input as N, Button as y, Space as S, Popconfirm as de, Drawer as J, Select as z, message as g, Tabs as Ce, InputNumber as Te, Switch as Ae, Descriptions as R, Timeline as Ee, Spin as Ne } from "antd";
6
+ import { r as w } from "./ComponentDoc-DTJyJAy-.js";
7
+ import { ListTable as K } from "@yuku123/z-frontend-common/ui";
8
+ const { Title: Se, Paragraph: Oe } = $;
9
+ function q() {
10
+ const [i, T] = _(null), [f, v] = _([]), [r, x] = _(!1), s = async () => {
11
+ x(!0);
12
+ try {
13
+ const [c, u] = await Promise.all([
14
+ w.get("rpa/dashboard/summary"),
15
+ w.get("rpa/dashboard/recent-runs")
16
+ ]);
17
+ T((c == null ? void 0 : c.data) ?? c), v(Array.isArray(u == null ? void 0 : u.data) ? u.data : Array.isArray(u) ? u : []);
18
+ } catch (c) {
19
+ console.warn("dashboard load failed", c);
20
+ } finally {
21
+ x(!1);
22
+ }
23
+ };
24
+ return M(() => {
25
+ s();
26
+ }, []), /* @__PURE__ */ l("div", { style: { padding: 24, background: "#f5f7fa", minHeight: "100%" }, children: [
27
+ /* @__PURE__ */ l(Se, { level: 3, style: { marginTop: 0 }, children: [
28
+ /* @__PURE__ */ e(ye, {}),
29
+ " RPA 卓越中心"
30
+ ] }),
31
+ /* @__PURE__ */ e(Oe, { type: "secondary", children: "影刀 RPA 全量功能映射 v1.0 — 应用管理 / 流程定义 / 触发器 / 运行监控 / 应用市场 / 需求中心" }),
32
+ /* @__PURE__ */ l(H, { gutter: 16, style: { marginBottom: 24 }, children: [
33
+ /* @__PURE__ */ e(O, { span: 6, children: /* @__PURE__ */ e(F, { loading: r, children: /* @__PURE__ */ e(
34
+ P,
35
+ {
36
+ title: "应用数",
37
+ value: (i == null ? void 0 : i.appCount) ?? 0,
38
+ prefix: /* @__PURE__ */ e(le, {})
39
+ }
40
+ ) }) }),
41
+ /* @__PURE__ */ e(O, { span: 6, children: /* @__PURE__ */ e(F, { loading: r, children: /* @__PURE__ */ e(
42
+ P,
43
+ {
44
+ title: "触发器数",
45
+ value: (i == null ? void 0 : i.triggerCount) ?? 0,
46
+ prefix: /* @__PURE__ */ e(ae, {})
47
+ }
48
+ ) }) }),
49
+ /* @__PURE__ */ e(O, { span: 6, children: /* @__PURE__ */ e(F, { loading: r, children: /* @__PURE__ */ e(
50
+ P,
51
+ {
52
+ title: "今日运行",
53
+ value: (i == null ? void 0 : i.runTotalCount) ?? 0,
54
+ prefix: /* @__PURE__ */ e(V, {})
55
+ }
56
+ ) }) }),
57
+ /* @__PURE__ */ e(O, { span: 6, children: /* @__PURE__ */ e(F, { loading: r, children: /* @__PURE__ */ e(
58
+ P,
59
+ {
60
+ title: "运行成功率",
61
+ value: (i == null ? void 0 : i.successRate) ?? "N/A",
62
+ styles: { content: { color: "#2F70F1" } }
63
+ }
64
+ ) }) })
65
+ ] }),
66
+ /* @__PURE__ */ l(H, { gutter: 16, children: [
67
+ /* @__PURE__ */ e(O, { span: 12, children: /* @__PURE__ */ e(F, { title: "最近 5 条运行", loading: r, children: /* @__PURE__ */ e(
68
+ se,
69
+ {
70
+ size: "small",
71
+ rowKey: "id",
72
+ dataSource: f,
73
+ pagination: !1,
74
+ columns: [
75
+ { title: "应用", dataIndex: "app_name", width: 140 },
76
+ {
77
+ title: "触发器",
78
+ dataIndex: "trigger_type",
79
+ width: 100,
80
+ render: (c) => /* @__PURE__ */ e(b, { color: c === "manual" ? "blue" : c === "cron" ? "purple" : "cyan", children: c })
81
+ },
82
+ {
83
+ title: "状态",
84
+ dataIndex: "status",
85
+ width: 90,
86
+ render: (c) => c === "success" ? /* @__PURE__ */ e(b, { icon: /* @__PURE__ */ e(Q, {}), color: "success", children: "成功" }) : c === "failed" ? /* @__PURE__ */ e(b, { icon: /* @__PURE__ */ e(X, {}), color: "error", children: "失败" }) : /* @__PURE__ */ e(b, { children: c })
87
+ },
88
+ { title: "开始时间", dataIndex: "started_at", width: 170 },
89
+ {
90
+ title: "耗时(ms)",
91
+ dataIndex: "duration_ms",
92
+ width: 90,
93
+ render: (c) => c ?? "-"
94
+ }
95
+ ]
96
+ }
97
+ ) }) }),
98
+ /* @__PURE__ */ e(O, { span: 12, children: /* @__PURE__ */ e(F, { title: "卓越中心统计", children: /* @__PURE__ */ l(H, { gutter: 16, children: [
99
+ /* @__PURE__ */ e(O, { span: 12, children: /* @__PURE__ */ e(
100
+ P,
101
+ {
102
+ title: "成功运行",
103
+ value: (i == null ? void 0 : i.runSuccessCount) ?? 0,
104
+ prefix: /* @__PURE__ */ e(Q, { style: { color: "#52c41a" } })
105
+ }
106
+ ) }),
107
+ /* @__PURE__ */ e(O, { span: 12, children: /* @__PURE__ */ e(
108
+ P,
109
+ {
110
+ title: "失败运行",
111
+ value: (i == null ? void 0 : i.runFailedCount) ?? 0,
112
+ prefix: /* @__PURE__ */ e(X, { style: { color: "#ff4d4f" } })
113
+ }
114
+ ) }),
115
+ /* @__PURE__ */ e(O, { span: 12, style: { marginTop: 16 }, children: /* @__PURE__ */ e(
116
+ P,
117
+ {
118
+ title: "需求数",
119
+ value: (i == null ? void 0 : i.demandCount) ?? 0,
120
+ prefix: /* @__PURE__ */ e(Y, { style: { color: "#faad14" } })
121
+ }
122
+ ) }),
123
+ /* @__PURE__ */ e(O, { span: 12, style: { marginTop: 16 }, children: /* @__PURE__ */ e(P, { title: "覆盖 MVP 功能", value: 7, suffix: "/ 25" }) })
124
+ ] }) }) })
125
+ ] })
126
+ ] });
127
+ }
128
+ const { Title: Re } = $;
129
+ function De() {
130
+ const i = G(), [T, f] = _([]), [v, r] = _(!1), [x, s] = _(!1), [c] = h.useForm(), u = async () => {
131
+ r(!0);
132
+ try {
133
+ const d = await w.post("rpa/app/list"), t = Array.isArray(d == null ? void 0 : d.data) ? d.data : Array.isArray(d) ? d : [];
134
+ f(t);
135
+ } catch (d) {
136
+ console.warn(d);
137
+ } finally {
138
+ r(!1);
139
+ }
140
+ };
141
+ M(() => {
142
+ u();
143
+ }, []);
144
+ const A = async () => {
145
+ try {
146
+ const d = await c.validateFields();
147
+ await w.post("rpa/app", d), g.success("创建成功"), s(!1), c.resetFields(), u();
148
+ } catch (d) {
149
+ if (d != null && d.errorFields) return;
150
+ g.error("创建失败: " + ((d == null ? void 0 : d.message) ?? d));
151
+ }
152
+ }, p = async (d) => {
153
+ await w.delete("rpa/app/" + d), g.success("已删除"), u();
154
+ }, a = async (d, t) => {
155
+ const n = "app-copy-" + Date.now(), C = "副本-" + t;
156
+ try {
157
+ await w.post(`rpa/app/${d}/copy`, {
158
+ app_code: n,
159
+ app_name: C
160
+ }), g.success("已复制"), u();
161
+ } catch (D) {
162
+ g.error("复制失败: " + ((D == null ? void 0 : D.message) || D));
163
+ }
164
+ }, m = async (d) => {
165
+ try {
166
+ const t = await w.post("rpa/run", { app_id: d, runner_type: "mock" });
167
+ g.success("已派发, runId=" + t), setTimeout(u, 800);
168
+ } catch (t) {
169
+ g.error("派发失败: " + ((t == null ? void 0 : t.message) || t));
170
+ }
171
+ };
172
+ return /* @__PURE__ */ l("div", { style: { padding: 24, background: "#fff", minHeight: "100%" }, children: [
173
+ /* @__PURE__ */ e(Re, { level: 3, style: { marginTop: 0 }, children: "应用管理" }),
174
+ /* @__PURE__ */ l("div", { style: { marginBottom: 16, display: "flex", gap: 8 }, children: [
175
+ /* @__PURE__ */ e(
176
+ N.Search,
177
+ {
178
+ placeholder: "搜索应用名 / 编码",
179
+ allowClear: !0,
180
+ style: { maxWidth: 320 },
181
+ onSearch: (d) => {
182
+ if (!d) return u();
183
+ f((t) => t.filter((n) => {
184
+ var C, D;
185
+ return ((C = n.appName) == null ? void 0 : C.includes(d)) || ((D = n.appCode) == null ? void 0 : D.includes(d));
186
+ }));
187
+ }
188
+ }
189
+ ),
190
+ /* @__PURE__ */ e(y, { type: "primary", icon: /* @__PURE__ */ e(B, {}), onClick: () => s(!0), children: "新建应用" })
191
+ ] }),
192
+ /* @__PURE__ */ e(
193
+ K,
194
+ {
195
+ rows: T,
196
+ loading: v,
197
+ rowKey: "id",
198
+ emptyTitle: "暂无应用",
199
+ emptyDescription: "新建一个 RPA 应用,把流程编排成可复用的能力。",
200
+ cardProps: { variant: "borderless", styles: { body: { padding: 0 } } },
201
+ columns: [
202
+ { title: "ID", dataIndex: "id", width: 60 },
203
+ { title: "应用名", dataIndex: "app_name", width: 160, ellipsis: !0 },
204
+ { title: "编码", dataIndex: "app_code", width: 160, ellipsis: !0 },
205
+ {
206
+ title: "分类",
207
+ dataIndex: "category",
208
+ width: 100,
209
+ render: (d) => d ? /* @__PURE__ */ e(b, { children: d }) : /* @__PURE__ */ e(b, { color: "default", children: "未分类" })
210
+ },
211
+ {
212
+ title: "状态",
213
+ dataIndex: "status",
214
+ width: 100,
215
+ render: (d) => d === "PUBLISHED" ? /* @__PURE__ */ e(b, { color: "success", children: d }) : d === "DISABLED" ? /* @__PURE__ */ e(b, { color: "default", children: d }) : /* @__PURE__ */ e(b, { color: "processing", children: d ?? "DRAFT" })
216
+ },
217
+ { title: "描述", dataIndex: "description", ellipsis: !0 },
218
+ {
219
+ title: "创建时间",
220
+ dataIndex: "created_at",
221
+ width: 170
222
+ },
223
+ {
224
+ title: "操作",
225
+ width: 280,
226
+ render: (d, t) => /* @__PURE__ */ l(S, { size: 4, children: [
227
+ /* @__PURE__ */ e(
228
+ y,
229
+ {
230
+ size: "small",
231
+ icon: /* @__PURE__ */ e(ge, {}),
232
+ onClick: () => i(`/rpa/app/${t.id}/edit`),
233
+ children: "编辑"
234
+ }
235
+ ),
236
+ /* @__PURE__ */ e(
237
+ y,
238
+ {
239
+ size: "small",
240
+ icon: /* @__PURE__ */ e(V, {}),
241
+ onClick: () => m(t.id),
242
+ type: "primary",
243
+ ghost: !0,
244
+ children: "运行"
245
+ }
246
+ ),
247
+ /* @__PURE__ */ e(
248
+ y,
249
+ {
250
+ size: "small",
251
+ icon: /* @__PURE__ */ e(ne, {}),
252
+ onClick: () => a(t.id, t.appName),
253
+ children: "复制"
254
+ }
255
+ ),
256
+ /* @__PURE__ */ e(
257
+ de,
258
+ {
259
+ title: "确认删除?",
260
+ onConfirm: () => p(t.id),
261
+ children: /* @__PURE__ */ e(y, { size: "small", danger: !0, icon: /* @__PURE__ */ e(fe, {}), children: "删除" })
262
+ }
263
+ )
264
+ ] })
265
+ }
266
+ ]
267
+ }
268
+ ),
269
+ /* @__PURE__ */ e(
270
+ J,
271
+ {
272
+ title: "新建应用",
273
+ open: x,
274
+ onClose: () => s(!1),
275
+ extra: /* @__PURE__ */ l(S, { children: [
276
+ /* @__PURE__ */ e(y, { onClick: () => s(!1), children: "取消" }),
277
+ /* @__PURE__ */ e(y, { type: "primary", onClick: A, children: "创建" })
278
+ ] }),
279
+ children: /* @__PURE__ */ l(h, { form: c, layout: "vertical", children: [
280
+ /* @__PURE__ */ e(h.Item, { name: "appName", label: "应用名称", rules: [{ required: !0 }], children: /* @__PURE__ */ e(N, { placeholder: "例如: 财务报表自动生成" }) }),
281
+ /* @__PURE__ */ e(h.Item, { name: "category", label: "分类", children: /* @__PURE__ */ e(
282
+ z,
283
+ {
284
+ placeholder: "选择分类",
285
+ options: [
286
+ { value: "OFFICE", label: "OFFICE 办公" },
287
+ { value: "WEB", label: "WEB 网页" },
288
+ { value: "ERP", label: "ERP 系统" },
289
+ { value: "CUSTOM", label: "CUSTOM 自定义" }
290
+ ]
291
+ }
292
+ ) }),
293
+ /* @__PURE__ */ e(h.Item, { name: "description", label: "描述", children: /* @__PURE__ */ e(N.TextArea, { rows: 3, placeholder: "用途说明" }) })
294
+ ] })
295
+ }
296
+ )
297
+ ] });
298
+ }
299
+ const { Title: Fe } = $, Pe = [
300
+ { value: "start", label: "开始" },
301
+ { value: "delay", label: "延时" },
302
+ { value: "http", label: "HTTP 请求" },
303
+ { value: "sql", label: "SQL 查询" },
304
+ { value: "shell", label: "Shell 命令" },
305
+ { value: "if", label: "条件分支" },
306
+ { value: "loop", label: "循环" },
307
+ { value: "subflow", label: "子流程" },
308
+ { value: "setVariable", label: "设置变量" },
309
+ { value: "end", label: "结束" }
310
+ ];
311
+ function ze() {
312
+ var j;
313
+ const { id: i } = pe(), T = G(), [f, v] = _(null), [r, x] = _(null), [s, c] = _([]), [u, A] = _(!1), [p, a] = _(null), [m] = h.useForm(), [d] = h.useForm();
314
+ M(() => {
315
+ i && Promise.all([
316
+ w.get("rpa/app/" + i),
317
+ w.get(`rpa/flow/${i}`)
318
+ ]).then(([o, k]) => {
319
+ const I = (o == null ? void 0 : o.data) ?? o, E = (k == null ? void 0 : k.data) ?? k;
320
+ console.log("[FEATURE063 AppEdit] loaded:", { appObj: I, flowObj: E }), v(I), x(E), d.setFieldsValue({
321
+ app_name: (I == null ? void 0 : I.app_name) ?? "",
322
+ app_code: (I == null ? void 0 : I.app_code) ?? "",
323
+ category: (I == null ? void 0 : I.category) ?? "",
324
+ description: (I == null ? void 0 : I.description) ?? ""
325
+ });
326
+ try {
327
+ const U = E != null && E.nodes_json ? JSON.parse(E.nodes_json) : [];
328
+ c(Array.isArray(U) ? U : []);
329
+ } catch {
330
+ c([]);
331
+ }
332
+ }).catch((o) => {
333
+ console.error("[FEATURE063 AppEdit] fetch error:", o);
334
+ });
335
+ }, [i]);
336
+ const t = async () => {
337
+ const o = JSON.stringify(s);
338
+ try {
339
+ const k = await w.post("rpa/flow/save", {
340
+ // FEATURE063: 后端全局 Jackson SNAKE_CASE, 请求字段必须 snake_case
341
+ app_id: Number(i),
342
+ flow_name: (r == null ? void 0 : r.flow_name) ?? (f == null ? void 0 : f.app_name) ?? "未命名流程",
343
+ nodes_json: o,
344
+ description: (r == null ? void 0 : r.description) ?? ""
345
+ });
346
+ g.success("流程已保存");
347
+ const I = await w.get(`rpa/flow/${i}`), E = (I == null ? void 0 : I.data) ?? I;
348
+ x(E);
349
+ } catch (k) {
350
+ console.error("[FEATURE063 AppEdit] saveFlow error:", k), g.error("保存失败: " + ((k == null ? void 0 : k.message) || k));
351
+ }
352
+ }, n = () => {
353
+ a({
354
+ id: "node-" + Date.now(),
355
+ type: "delay",
356
+ name: "新节点",
357
+ orderNo: s.length + 1,
358
+ config: { mockDelayMs: 300 }
359
+ }), m.resetFields(), m.setFieldsValue({
360
+ type: "delay",
361
+ name: "新节点",
362
+ orderNo: s.length + 1,
363
+ configJson: JSON.stringify({ mockDelayMs: 300 }, null, 2)
364
+ }), A(!0);
365
+ }, C = (o) => {
366
+ a(o), m.setFieldsValue({
367
+ type: o.type,
368
+ name: o.name,
369
+ orderNo: o.orderNo,
370
+ configJson: JSON.stringify(o.config ?? {}, null, 2)
371
+ }), A(!0);
372
+ }, D = async () => {
373
+ const o = await m.validateFields();
374
+ let k = {};
375
+ try {
376
+ k = o.configJson ? JSON.parse(o.configJson) : {};
377
+ } catch (E) {
378
+ g.error("config 不是合法 JSON: " + E.message);
379
+ return;
380
+ }
381
+ const I = {
382
+ id: p.id,
383
+ type: o.type,
384
+ name: o.name,
385
+ orderNo: o.orderNo,
386
+ config: k
387
+ };
388
+ c((E) => {
389
+ const U = E.findIndex((L) => L.id === I.id);
390
+ if (U >= 0) {
391
+ const L = [...E];
392
+ return L[U] = I, L;
393
+ }
394
+ return [...E, I];
395
+ }), A(!1);
396
+ }, oe = (o) => {
397
+ c((k) => k.filter((I) => I.id !== o.id));
398
+ };
399
+ return /* @__PURE__ */ l("div", { style: { padding: 24, background: "#fff", minHeight: "100%" }, children: [
400
+ /* @__PURE__ */ l(S, { style: { marginBottom: 16 }, children: [
401
+ /* @__PURE__ */ e(y, { icon: /* @__PURE__ */ e(be, {}), onClick: () => T("/rpa/app"), children: "返回" }),
402
+ /* @__PURE__ */ e(Fe, { level: 3, style: { margin: 0 }, children: (f == null ? void 0 : f.app_name) ?? "应用编辑" }),
403
+ /* @__PURE__ */ e(b, { color: "blue", children: (f == null ? void 0 : f.status) ?? "DRAFT" })
404
+ ] }),
405
+ /* @__PURE__ */ e(
406
+ Ce,
407
+ {
408
+ items: [
409
+ {
410
+ key: "basic",
411
+ label: "基本信息",
412
+ children: /* @__PURE__ */ e("div", { style: { padding: 16 }, children: /* @__PURE__ */ l(
413
+ h,
414
+ {
415
+ form: d,
416
+ layout: "vertical",
417
+ style: { maxWidth: 520 },
418
+ children: [
419
+ /* @__PURE__ */ e(h.Item, { label: "应用名", name: "app_name", children: /* @__PURE__ */ e(N, { disabled: !0 }) }),
420
+ /* @__PURE__ */ e(h.Item, { label: "编码", name: "app_code", children: /* @__PURE__ */ e(N, { disabled: !0 }) }),
421
+ /* @__PURE__ */ e(h.Item, { label: "分类", name: "category", children: /* @__PURE__ */ e(N, { disabled: !0 }) }),
422
+ /* @__PURE__ */ e(h.Item, { label: "描述", name: "description", children: /* @__PURE__ */ e(N.TextArea, { disabled: !0, rows: 3 }) })
423
+ ]
424
+ }
425
+ ) })
426
+ },
427
+ {
428
+ key: "nodes",
429
+ label: `节点列表 (${s.length})`,
430
+ children: /* @__PURE__ */ l("div", { style: { padding: 16 }, children: [
431
+ /* @__PURE__ */ l(S, { style: { marginBottom: 12 }, children: [
432
+ /* @__PURE__ */ e(y, { type: "primary", icon: /* @__PURE__ */ e(B, {}), onClick: n, children: "新增节点" }),
433
+ /* @__PURE__ */ e(y, { icon: /* @__PURE__ */ e(we, {}), onClick: t, children: "保存流程" }),
434
+ /* @__PURE__ */ e(
435
+ y,
436
+ {
437
+ onClick: async () => {
438
+ try {
439
+ const o = await w.post("rpa/run", {
440
+ app_id: Number(i),
441
+ runner_type: "mock"
442
+ });
443
+ g.success(`已派发, runId=${o}`);
444
+ } catch (o) {
445
+ console.error("[FEATURE063 AppEdit] dispatch run error:", o), g.error("派发失败: " + ((o == null ? void 0 : o.message) || o));
446
+ }
447
+ },
448
+ children: "试运行 (mock)"
449
+ }
450
+ )
451
+ ] }),
452
+ /* @__PURE__ */ e(
453
+ se,
454
+ {
455
+ size: "small",
456
+ rowKey: "id",
457
+ dataSource: s.sort((o, k) => (o.orderNo ?? 0) - (k.orderNo ?? 0)),
458
+ pagination: !1,
459
+ columns: [
460
+ { title: "序号", dataIndex: "orderNo", width: 60 },
461
+ {
462
+ title: "类型",
463
+ dataIndex: "type",
464
+ width: 100,
465
+ render: (o) => /* @__PURE__ */ e(b, { color: "blue", children: o })
466
+ },
467
+ { title: "名称", dataIndex: "name", width: 200 },
468
+ {
469
+ title: "配置",
470
+ dataIndex: "config",
471
+ ellipsis: !0,
472
+ render: (o) => /* @__PURE__ */ e("code", { children: JSON.stringify(o) })
473
+ },
474
+ {
475
+ title: "操作",
476
+ width: 160,
477
+ render: (o, k) => /* @__PURE__ */ l(S, { size: 4, children: [
478
+ /* @__PURE__ */ e(y, { size: "small", onClick: () => C(k), children: "编辑" }),
479
+ /* @__PURE__ */ e(
480
+ y,
481
+ {
482
+ size: "small",
483
+ danger: !0,
484
+ onClick: () => oe(k),
485
+ children: "删除"
486
+ }
487
+ )
488
+ ] })
489
+ }
490
+ ]
491
+ }
492
+ )
493
+ ] })
494
+ },
495
+ {
496
+ key: "trigger",
497
+ label: "触发器",
498
+ children: /* @__PURE__ */ e("div", { style: { padding: 16 }, children: /* @__PURE__ */ e(
499
+ y,
500
+ {
501
+ type: "primary",
502
+ onClick: () => T("/rpa/trigger", { state: { appId: Number(i) } }),
503
+ children: "管理触发器"
504
+ }
505
+ ) })
506
+ },
507
+ {
508
+ key: "version",
509
+ label: "版本",
510
+ children: /* @__PURE__ */ e("div", { style: { padding: 16 }, children: /* @__PURE__ */ e(
511
+ y,
512
+ {
513
+ type: "primary",
514
+ onClick: async () => {
515
+ try {
516
+ await w.post(`rpa/app/${i}/publish`, { description: "v1" }), g.success("已发布版本 v1");
517
+ } catch (o) {
518
+ g.error("发布失败: " + ((o == null ? void 0 : o.message) || o));
519
+ }
520
+ },
521
+ children: "发布当前版本"
522
+ }
523
+ ) })
524
+ }
525
+ ]
526
+ }
527
+ ),
528
+ /* @__PURE__ */ e(
529
+ J,
530
+ {
531
+ title: (j = p == null ? void 0 : p.id) != null && j.startsWith("node-") ? "新增节点" : "编辑节点",
532
+ open: u,
533
+ onClose: () => A(!1),
534
+ size: "large",
535
+ footer: /* @__PURE__ */ l(S, { style: { float: "right" }, children: [
536
+ /* @__PURE__ */ e(y, { onClick: () => A(!1), children: "取消" }),
537
+ /* @__PURE__ */ e(y, { type: "primary", onClick: D, children: "确定" })
538
+ ] }),
539
+ children: /* @__PURE__ */ l(h, { form: m, layout: "vertical", children: [
540
+ /* @__PURE__ */ e(h.Item, { name: "type", label: "节点类型", rules: [{ required: !0 }], children: /* @__PURE__ */ e(z, { options: Pe }) }),
541
+ /* @__PURE__ */ e(h.Item, { name: "name", label: "节点名称", rules: [{ required: !0 }], children: /* @__PURE__ */ e(N, {}) }),
542
+ /* @__PURE__ */ e(h.Item, { name: "orderNo", label: "序号", rules: [{ required: !0 }], children: /* @__PURE__ */ e(Te, { min: 1, style: { width: "100%" } }) }),
543
+ /* @__PURE__ */ e(h.Item, { name: "configJson", label: "配置 JSON", children: /* @__PURE__ */ e(N.TextArea, { rows: 8, placeholder: '{"mockDelayMs": 300}' }) })
544
+ ] })
545
+ }
546
+ )
547
+ ] });
548
+ }
549
+ const { Title: Me } = $;
550
+ function $e() {
551
+ const [i, T] = _([]), [f, v] = _([]), [r, x] = _(!1), [s, c] = _(!1), [u] = h.useForm(), A = async () => {
552
+ x(!0);
553
+ try {
554
+ const [t, n] = await Promise.all([
555
+ w.post("rpa/trigger/list", {}),
556
+ w.post("rpa/app/list", {})
557
+ ]);
558
+ T(Array.isArray(t == null ? void 0 : t.data) ? t.data : Array.isArray(t) ? t : []), v(Array.isArray(n == null ? void 0 : n.data) ? n.data : Array.isArray(n) ? n : []);
559
+ } catch (t) {
560
+ console.warn(t);
561
+ } finally {
562
+ x(!1);
563
+ }
564
+ };
565
+ M(() => {
566
+ A();
567
+ }, []);
568
+ const p = async () => {
569
+ try {
570
+ const t = await u.validateFields(), n = {};
571
+ t.appId != null && (n.app_id = t.appId), t.triggerName != null && (n.trigger_name = t.triggerName), t.triggerType != null && (n.trigger_type = t.triggerType), t.cronExpr != null && (n.cron_expr = t.cronExpr), t.webhookCode != null && (n.webhook_code = t.webhookCode), await w.post("rpa/trigger", n), g.success("已创建"), c(!1), u.resetFields(), A();
572
+ } catch (t) {
573
+ if (t != null && t.errorFields) return;
574
+ g.error((t == null ? void 0 : t.message) ?? String(t));
575
+ }
576
+ }, a = async (t, n) => {
577
+ try {
578
+ await w.post(`rpa/trigger/${t}/toggle`, { enabled: n ? 1 : 0 }), g.success(n ? "已启用" : "已禁用"), A();
579
+ } catch (C) {
580
+ g.error("切换失败: " + ((C == null ? void 0 : C.message) || C));
581
+ }
582
+ }, m = async (t) => {
583
+ try {
584
+ await w.delete("rpa/trigger/" + t), g.success("已删除"), A();
585
+ } catch (n) {
586
+ g.error("删除失败: " + ((n == null ? void 0 : n.message) || n));
587
+ }
588
+ }, d = (t) => {
589
+ var C;
590
+ const n = `${window.location.origin}/api/rpa/trigger/webhook/${t}`;
591
+ (C = navigator.clipboard) == null || C.writeText(n), g.success("已复制 webhook URL");
592
+ };
593
+ return /* @__PURE__ */ l("div", { style: { padding: 24, background: "#fff", minHeight: "100%" }, children: [
594
+ /* @__PURE__ */ e(Me, { level: 3, style: { marginTop: 0 }, children: "触发器" }),
595
+ /* @__PURE__ */ e(S, { style: { marginBottom: 16 }, children: /* @__PURE__ */ e(y, { type: "primary", icon: /* @__PURE__ */ e(B, {}), onClick: () => c(!0), children: "新建触发器" }) }),
596
+ /* @__PURE__ */ e(
597
+ K,
598
+ {
599
+ rows: i,
600
+ loading: r,
601
+ rowKey: "id",
602
+ searchKeys: ["trigger_name", "trigger_type"],
603
+ searchPlaceholder: "按触发器名 / 类型过滤",
604
+ emptyTitle: "暂无触发器",
605
+ emptyDescription: "新建一个触发器,让外部系统按 cron 或 webhook 回调 RPA 应用。",
606
+ cardProps: { variant: "borderless", styles: { body: { padding: 0 } } },
607
+ columns: [
608
+ { title: "ID", dataIndex: "id", width: 60 },
609
+ {
610
+ title: "应用",
611
+ dataIndex: "app_id",
612
+ width: 160,
613
+ render: (t) => {
614
+ var n;
615
+ return ((n = f.find((C) => C.id === t)) == null ? void 0 : n.app_name) ?? `#${t}`;
616
+ }
617
+ },
618
+ { title: "触发器名", dataIndex: "trigger_name", width: 160 },
619
+ {
620
+ title: "类型",
621
+ dataIndex: "trigger_type",
622
+ width: 100,
623
+ render: (t) => /* @__PURE__ */ e(b, { color: t === "manual" ? "blue" : t === "cron" ? "purple" : "cyan", children: t })
624
+ },
625
+ {
626
+ title: "Cron / Webhook",
627
+ width: 240,
628
+ render: (t, n) => n.trigger_type === "cron" ? /* @__PURE__ */ e("code", { children: n.cron_expr }) : n.trigger_type === "webhook" ? /* @__PURE__ */ l(S, { children: [
629
+ /* @__PURE__ */ l("code", { style: { fontSize: 12 }, children: [
630
+ "/api/rpa/trigger/webhook/",
631
+ n.webhook_code
632
+ ] }),
633
+ /* @__PURE__ */ e(
634
+ y,
635
+ {
636
+ size: "small",
637
+ icon: /* @__PURE__ */ e(ne, {}),
638
+ onClick: () => d(n.webhook_code)
639
+ }
640
+ )
641
+ ] }) : "-"
642
+ },
643
+ {
644
+ title: "启用",
645
+ dataIndex: "enabled",
646
+ width: 80,
647
+ render: (t, n) => /* @__PURE__ */ e(
648
+ Ae,
649
+ {
650
+ checked: t === 1,
651
+ onChange: (C) => a(n.id, C)
652
+ }
653
+ )
654
+ },
655
+ {
656
+ title: "最近状态",
657
+ dataIndex: "last_run_status",
658
+ width: 100,
659
+ render: (t) => t === "success" ? /* @__PURE__ */ e(b, { color: "success", children: t }) : t === "failed" ? /* @__PURE__ */ e(b, { color: "error", children: t }) : /* @__PURE__ */ e(b, { children: "-" })
660
+ },
661
+ {
662
+ title: "操作",
663
+ width: 100,
664
+ render: (t, n) => /* @__PURE__ */ e(de, { title: "确认删除?", onConfirm: () => m(n.id), children: /* @__PURE__ */ e(y, { size: "small", danger: !0, children: "删除" }) })
665
+ }
666
+ ]
667
+ }
668
+ ),
669
+ /* @__PURE__ */ e(
670
+ J,
671
+ {
672
+ title: "新建触发器",
673
+ open: s,
674
+ onClose: () => c(!1),
675
+ size: "large",
676
+ footer: /* @__PURE__ */ l(S, { style: { float: "right" }, children: [
677
+ /* @__PURE__ */ e(y, { onClick: () => c(!1), children: "取消" }),
678
+ /* @__PURE__ */ e(y, { type: "primary", onClick: p, children: "确定" })
679
+ ] }),
680
+ children: /* @__PURE__ */ l(h, { form: u, layout: "vertical", children: [
681
+ /* @__PURE__ */ e(h.Item, { name: "appId", label: "应用", rules: [{ required: !0 }], children: /* @__PURE__ */ e(
682
+ z,
683
+ {
684
+ options: f.map((t) => ({ value: t.id, label: t.appName })),
685
+ placeholder: "选择应用"
686
+ }
687
+ ) }),
688
+ /* @__PURE__ */ e(h.Item, { name: "triggerName", label: "触发器名称", children: /* @__PURE__ */ e(N, { placeholder: "例如: 每日9点报表" }) }),
689
+ /* @__PURE__ */ e(h.Item, { name: "triggerType", label: "类型", rules: [{ required: !0 }], children: /* @__PURE__ */ e(
690
+ z,
691
+ {
692
+ options: [
693
+ { value: "manual", label: "手动" },
694
+ { value: "cron", label: "Cron 定时" },
695
+ { value: "webhook", label: "Webhook" }
696
+ ]
697
+ }
698
+ ) }),
699
+ /* @__PURE__ */ e(
700
+ h.Item,
701
+ {
702
+ noStyle: !0,
703
+ shouldUpdate: (t, n) => t.triggerType !== n.triggerType,
704
+ children: ({ getFieldValue: t }) => t("triggerType") === "cron" ? /* @__PURE__ */ e(
705
+ h.Item,
706
+ {
707
+ name: "cronExpr",
708
+ label: "Cron 表达式 (Quartz 7 段)",
709
+ rules: [{ required: !0 }],
710
+ children: /* @__PURE__ */ e(N, { placeholder: "0 0 9 * * ? (每天 9 点)" })
711
+ }
712
+ ) : t("triggerType") === "webhook" ? /* @__PURE__ */ e(
713
+ h.Item,
714
+ {
715
+ name: "webhookCode",
716
+ label: "Webhook 路径 (留空自动生成)",
717
+ children: /* @__PURE__ */ e(N, { placeholder: "可选, 不填自动生成 wh-xxx" })
718
+ }
719
+ ) : null
720
+ }
721
+ )
722
+ ] })
723
+ }
724
+ )
725
+ ] });
726
+ }
727
+ const { Title: Z } = $;
728
+ function ee() {
729
+ const [i, T] = _([]), [f, v] = _(!1), [r, x] = _(null), [s, c] = _([]), u = async () => {
730
+ v(!0);
731
+ try {
732
+ const a = await w.post("rpa/run/page", {
733
+ page: 1,
734
+ size: 50
735
+ }), m = (a == null ? void 0 : a.data) ?? a;
736
+ T(Array.isArray(m == null ? void 0 : m.records) ? m.records : []);
737
+ } catch (a) {
738
+ console.warn(a);
739
+ } finally {
740
+ v(!1);
741
+ }
742
+ };
743
+ M(() => {
744
+ u();
745
+ }, []);
746
+ const A = async (a) => {
747
+ try {
748
+ const m = await w.get("rpa/run/" + a);
749
+ x(m.run), c(m.steps ?? []);
750
+ } catch (m) {
751
+ g.error((m == null ? void 0 : m.message) ?? String(m));
752
+ }
753
+ }, p = async (a) => {
754
+ await w.post(`rpa/run/${a}/abort`), g.success("已请求中止"), u();
755
+ };
756
+ return /* @__PURE__ */ l("div", { style: { padding: 24, background: "#fff", minHeight: "100%" }, children: [
757
+ /* @__PURE__ */ l(S, { style: { marginBottom: 16 }, children: [
758
+ /* @__PURE__ */ e(Z, { level: 3, style: { margin: 0 }, children: "运行监控" }),
759
+ /* @__PURE__ */ e(y, { icon: /* @__PURE__ */ e(Ie, {}), onClick: u, children: "刷新" })
760
+ ] }),
761
+ /* @__PURE__ */ e(
762
+ K,
763
+ {
764
+ rows: i,
765
+ loading: f,
766
+ rowKey: "id",
767
+ searchKeys: ["run_code", "app_name", "status"],
768
+ searchPlaceholder: "按执行编号 / 应用 / 状态过滤",
769
+ emptyTitle: "暂无运行记录",
770
+ emptyDescription: "应用被触发后,运行记录会出现在这里。",
771
+ cardProps: { variant: "borderless", styles: { body: { padding: 0 } } },
772
+ columns: [
773
+ { title: "Run ID", dataIndex: "id", width: 70 },
774
+ { title: "执行编号", dataIndex: "run_code", width: 220, ellipsis: !0 },
775
+ { title: "应用", dataIndex: "app_name", width: 160 },
776
+ {
777
+ title: "触发器",
778
+ dataIndex: "trigger_type",
779
+ width: 100,
780
+ render: (a) => /* @__PURE__ */ e(b, { children: a })
781
+ },
782
+ {
783
+ title: "触发人",
784
+ dataIndex: "trigger_by",
785
+ width: 140,
786
+ ellipsis: !0
787
+ },
788
+ {
789
+ title: "状态",
790
+ dataIndex: "status",
791
+ width: 100,
792
+ render: (a) => a === "success" ? /* @__PURE__ */ e(b, { color: "success", children: a }) : a === "failed" ? /* @__PURE__ */ e(b, { color: "error", children: a }) : a === "running" ? /* @__PURE__ */ e(b, { color: "processing", children: a }) : /* @__PURE__ */ e(b, { children: a })
793
+ },
794
+ { title: "成功节点", dataIndex: "success_nodes", width: 90 },
795
+ { title: "失败节点", dataIndex: "failed_nodes", width: 90 },
796
+ {
797
+ title: "耗时(ms)",
798
+ dataIndex: "duration_ms",
799
+ width: 100,
800
+ render: (a) => a ?? "-"
801
+ },
802
+ { title: "开始时间", dataIndex: "started_at", width: 170 },
803
+ {
804
+ title: "操作",
805
+ width: 140,
806
+ render: (a, m) => /* @__PURE__ */ l(S, { size: 4, children: [
807
+ /* @__PURE__ */ e(y, { size: "small", onClick: () => A(m.id), children: "查看" }),
808
+ (m.status === "running" || m.status === "pending") && /* @__PURE__ */ e(y, { size: "small", danger: !0, onClick: () => p(m.id), children: "中止" })
809
+ ] })
810
+ }
811
+ ]
812
+ }
813
+ ),
814
+ /* @__PURE__ */ e(
815
+ J,
816
+ {
817
+ title: r ? `运行详情 - ${r.run_code}` : "运行详情",
818
+ open: !!r,
819
+ onClose: () => x(null),
820
+ size: "large",
821
+ children: r && /* @__PURE__ */ l(ce, { children: [
822
+ /* @__PURE__ */ l(R, { size: "small", column: 2, bordered: !0, children: [
823
+ /* @__PURE__ */ e(R.Item, { label: "应用", children: r.app_name }),
824
+ /* @__PURE__ */ e(R.Item, { label: "触发器", children: r.trigger_type }),
825
+ /* @__PURE__ */ e(R.Item, { label: "执行器", children: r.runner_type }),
826
+ /* @__PURE__ */ e(R.Item, { label: "状态", children: /* @__PURE__ */ e(b, { color: r.status === "success" ? "success" : "error", children: r.status }) }),
827
+ /* @__PURE__ */ e(R.Item, { label: "成功节点", children: r.success_nodes }),
828
+ /* @__PURE__ */ e(R.Item, { label: "失败节点", children: r.failed_nodes }),
829
+ /* @__PURE__ */ e(R.Item, { label: "开始时间", children: r.started_at }),
830
+ /* @__PURE__ */ e(R.Item, { label: "完成时间", children: r.finished_at }),
831
+ /* @__PURE__ */ e(R.Item, { label: "耗时(ms)", span: 2, children: r.duration_ms ?? "-" }),
832
+ r.error_message && /* @__PURE__ */ e(R.Item, { label: "错误", span: 2, children: r.error_message })
833
+ ] }),
834
+ /* @__PURE__ */ l(Z, { level: 5, style: { marginTop: 24 }, children: [
835
+ "步骤日志 (",
836
+ s.length,
837
+ ")"
838
+ ] }),
839
+ /* @__PURE__ */ e(
840
+ Ee,
841
+ {
842
+ items: s.map((a) => ({
843
+ color: a.status === "success" ? "green" : a.status === "failed" ? "red" : "gray",
844
+ children: /* @__PURE__ */ l("div", { children: [
845
+ /* @__PURE__ */ l(S, { children: [
846
+ /* @__PURE__ */ e(b, { color: "blue", children: a.node_no }),
847
+ /* @__PURE__ */ e("strong", { children: a.node_name }),
848
+ /* @__PURE__ */ e(b, { children: a.node_type }),
849
+ /* @__PURE__ */ e(
850
+ b,
851
+ {
852
+ color: a.status === "success" ? "success" : a.status === "failed" ? "error" : "default",
853
+ children: a.status
854
+ }
855
+ ),
856
+ /* @__PURE__ */ l("span", { style: { color: "#999" }, children: [
857
+ a.cost_ms ?? 0,
858
+ "ms"
859
+ ] })
860
+ ] }),
861
+ /* @__PURE__ */ e("div", { style: { color: "#666", marginTop: 4 }, children: a.message })
862
+ ] })
863
+ }))
864
+ }
865
+ )
866
+ ] })
867
+ }
868
+ )
869
+ ] });
870
+ }
871
+ const { Title: Ue, Paragraph: te } = $;
872
+ function Je() {
873
+ const [i, T] = _([]), [f, v] = _(!1), r = async () => {
874
+ v(!0);
875
+ try {
876
+ const s = await w.post("rpa/market/list", {});
877
+ T(Array.isArray(s == null ? void 0 : s.data) ? s.data : Array.isArray(s) ? s : []);
878
+ } catch (s) {
879
+ console.warn(s);
880
+ } finally {
881
+ v(!1);
882
+ }
883
+ };
884
+ M(() => {
885
+ r();
886
+ }, []);
887
+ const x = async (s, c) => {
888
+ try {
889
+ await w.post(`rpa/market/${s}/install`, {}), g.success(`已安装: ${c}`);
890
+ } catch (u) {
891
+ g.error((u == null ? void 0 : u.message) ?? "安装失败");
892
+ }
893
+ };
894
+ return /* @__PURE__ */ l("div", { style: { padding: 24, background: "#f5f7fa", minHeight: "100%" }, children: [
895
+ /* @__PURE__ */ l(Ue, { level: 3, style: { marginTop: 0 }, children: [
896
+ /* @__PURE__ */ e(ie, {}),
897
+ " 应用市场"
898
+ ] }),
899
+ /* @__PURE__ */ e(te, { type: "secondary", children: "影刀 RPA 应用市场 (MVP: 卡片展示 + 一键安装)" }),
900
+ /* @__PURE__ */ e(Ne, { spinning: f, children: /* @__PURE__ */ l(H, { gutter: [16, 16], children: [
901
+ i.length === 0 && /* @__PURE__ */ e(O, { span: 24, children: /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e("div", { style: { textAlign: "center", color: "#999", padding: 32 }, children: "暂无市场条目" }) }) }),
902
+ i.map((s) => /* @__PURE__ */ e(O, { xs: 24, sm: 12, md: 8, lg: 6, children: /* @__PURE__ */ e(
903
+ F,
904
+ {
905
+ hoverable: !0,
906
+ actions: [
907
+ /* @__PURE__ */ e(
908
+ y,
909
+ {
910
+ type: "primary",
911
+ icon: /* @__PURE__ */ e(ke, {}),
912
+ onClick: () => x(s.id, s.appName),
913
+ children: "安装"
914
+ },
915
+ "install"
916
+ )
917
+ ],
918
+ children: /* @__PURE__ */ e(
919
+ F.Meta,
920
+ {
921
+ avatar: /* @__PURE__ */ e("span", { style: { fontSize: 32 }, children: s.icon || "📦" }),
922
+ title: /* @__PURE__ */ l("span", { children: [
923
+ s.featured === 1 && /* @__PURE__ */ e(_e, { style: { color: "#faad14", marginRight: 6 } }),
924
+ s.appName
925
+ ] }),
926
+ description: /* @__PURE__ */ l("div", { children: [
927
+ /* @__PURE__ */ e(b, { children: s.category ?? "未分类" }),
928
+ /* @__PURE__ */ l(b, { color: "blue", children: [
929
+ s.downloads ?? 0,
930
+ " 次安装"
931
+ ] }),
932
+ /* @__PURE__ */ l(
933
+ "div",
934
+ {
935
+ style: {
936
+ marginTop: 8,
937
+ color: "#666",
938
+ fontSize: 12
939
+ },
940
+ children: [
941
+ "作者: ",
942
+ s.author ?? "anonymous"
943
+ ]
944
+ }
945
+ ),
946
+ /* @__PURE__ */ e(
947
+ te,
948
+ {
949
+ style: { marginTop: 8, marginBottom: 0 },
950
+ ellipsis: { rows: 2 },
951
+ children: s.description
952
+ }
953
+ )
954
+ ] })
955
+ }
956
+ )
957
+ }
958
+ ) }, s.id))
959
+ ] }) })
960
+ ] });
961
+ }
962
+ const { Title: Le } = $, We = {
963
+ LOW: "default",
964
+ MEDIUM: "blue",
965
+ HIGH: "orange",
966
+ URGENT: "red"
967
+ };
968
+ function He() {
969
+ const [i, T] = _([]), [f, v] = _(!1), [r, x] = _(!1), [s] = h.useForm(), c = async () => {
970
+ v(!0);
971
+ try {
972
+ const p = await w.post("rpa/demand/list", {});
973
+ T(Array.isArray(p == null ? void 0 : p.data) ? p.data : Array.isArray(p) ? p : []);
974
+ } catch (p) {
975
+ console.warn(p);
976
+ } finally {
977
+ v(!1);
978
+ }
979
+ };
980
+ M(() => {
981
+ c();
982
+ }, []);
983
+ const u = async () => {
984
+ try {
985
+ const p = await s.validateFields();
986
+ await w.post("rpa/demand/submit", p), g.success("需求已提交"), x(!1), s.resetFields(), c();
987
+ } catch (p) {
988
+ if (p != null && p.errorFields) return;
989
+ g.error((p == null ? void 0 : p.message) ?? String(p));
990
+ }
991
+ }, A = async (p, a) => {
992
+ await w.put(`rpa/demand/${p}/status`, { status: a }), g.success("状态已更新"), c();
993
+ };
994
+ return /* @__PURE__ */ l("div", { style: { padding: 24, background: "#fff", minHeight: "100%" }, children: [
995
+ /* @__PURE__ */ l(S, { style: { marginBottom: 16 }, children: [
996
+ /* @__PURE__ */ l(Le, { level: 3, style: { margin: 0 }, children: [
997
+ /* @__PURE__ */ e(Y, {}),
998
+ " 需求中心"
999
+ ] }),
1000
+ /* @__PURE__ */ e(y, { type: "primary", icon: /* @__PURE__ */ e(B, {}), onClick: () => x(!0), children: "提交需求" })
1001
+ ] }),
1002
+ /* @__PURE__ */ e(
1003
+ K,
1004
+ {
1005
+ rows: i,
1006
+ loading: f,
1007
+ rowKey: "id",
1008
+ searchKeys: ["demand_code", "title", "status"],
1009
+ searchPlaceholder: "按编号 / 标题 / 状态过滤",
1010
+ emptyTitle: "暂无需求",
1011
+ emptyDescription: "把要做的事提成需求,需求中心负责跟踪到落地。",
1012
+ cardProps: { variant: "borderless", styles: { body: { padding: 0 } } },
1013
+ columns: [
1014
+ { title: "编号", dataIndex: "demand_code", width: 200, ellipsis: !0 },
1015
+ { title: "标题", dataIndex: "title", ellipsis: !0 },
1016
+ { title: "分类", dataIndex: "category", width: 100 },
1017
+ {
1018
+ title: "优先级",
1019
+ dataIndex: "priority",
1020
+ width: 90,
1021
+ render: (p) => /* @__PURE__ */ e(b, { color: We[p] ?? "default", children: p })
1022
+ },
1023
+ {
1024
+ title: "状态",
1025
+ dataIndex: "status",
1026
+ width: 110,
1027
+ render: (p, a) => /* @__PURE__ */ e(
1028
+ z,
1029
+ {
1030
+ size: "small",
1031
+ value: p,
1032
+ style: { width: 110 },
1033
+ onChange: (m) => A(a.id, m),
1034
+ options: [
1035
+ { value: "OPEN", label: "OPEN" },
1036
+ { value: "IN_PROGRESS", label: "IN_PROGRESS" },
1037
+ { value: "DONE", label: "DONE" },
1038
+ { value: "REJECTED", label: "REJECTED" }
1039
+ ]
1040
+ }
1041
+ )
1042
+ },
1043
+ { title: "提交人", dataIndex: "submitter", width: 120 },
1044
+ { title: "创建时间", dataIndex: "created_at", width: 170 }
1045
+ ]
1046
+ }
1047
+ ),
1048
+ /* @__PURE__ */ e(
1049
+ J,
1050
+ {
1051
+ title: "提交需求",
1052
+ open: r,
1053
+ onClose: () => x(!1),
1054
+ size: "large",
1055
+ footer: /* @__PURE__ */ l(S, { style: { float: "right" }, children: [
1056
+ /* @__PURE__ */ e(y, { onClick: () => x(!1), children: "取消" }),
1057
+ /* @__PURE__ */ e(y, { type: "primary", onClick: u, children: "提交" })
1058
+ ] }),
1059
+ children: /* @__PURE__ */ l(h, { form: s, layout: "vertical", children: [
1060
+ /* @__PURE__ */ e(h.Item, { name: "title", label: "需求标题", rules: [{ required: !0 }], children: /* @__PURE__ */ e(N, { placeholder: "简短描述需求" }) }),
1061
+ /* @__PURE__ */ e(h.Item, { name: "category", label: "分类", children: /* @__PURE__ */ e(
1062
+ z,
1063
+ {
1064
+ options: [
1065
+ { value: "DESKTOP", label: "桌面自动化" },
1066
+ { value: "WEB", label: "网页自动化" },
1067
+ { value: "MOBILE", label: "手机自动化" },
1068
+ { value: "AI", label: "AI 智能" },
1069
+ { value: "MARKET", label: "应用市场" },
1070
+ { value: "OTHER", label: "其他" }
1071
+ ]
1072
+ }
1073
+ ) }),
1074
+ /* @__PURE__ */ e(h.Item, { name: "priority", label: "优先级", children: /* @__PURE__ */ e(
1075
+ z,
1076
+ {
1077
+ defaultValue: "MEDIUM",
1078
+ options: [
1079
+ { value: "LOW", label: "LOW" },
1080
+ { value: "MEDIUM", label: "MEDIUM" },
1081
+ { value: "HIGH", label: "HIGH" },
1082
+ { value: "URGENT", label: "URGENT" }
1083
+ ]
1084
+ }
1085
+ ) }),
1086
+ /* @__PURE__ */ e(h.Item, { name: "description", label: "详细描述", children: /* @__PURE__ */ e(N.TextArea, { rows: 5, placeholder: "详细描述应用场景/痛点/期望" }) })
1087
+ ] })
1088
+ }
1089
+ )
1090
+ ] });
1091
+ }
1092
+ const Be = "_shell_ezj0g_6", Ke = "_sidebar_ezj0g_14", qe = "_main_ezj0g_25", Ge = "_menuWrap_ezj0g_43", W = {
1093
+ shell: Be,
1094
+ sidebar: Ke,
1095
+ main: qe,
1096
+ menuWrap: Ge
1097
+ }, re = [
1098
+ { key: "/rpa/dashboard", icon: /* @__PURE__ */ e(ve, {}), label: "概览" },
1099
+ { key: "/rpa/app", icon: /* @__PURE__ */ e(le, {}), label: "应用管理" },
1100
+ { key: "/rpa/trigger", icon: /* @__PURE__ */ e(ae, {}), label: "触发器" },
1101
+ { key: "/rpa/run", icon: /* @__PURE__ */ e(V, {}), label: "运行监控" },
1102
+ { key: "/rpa/market", icon: /* @__PURE__ */ e(ie, {}), label: "应用市场" },
1103
+ { key: "/rpa/demand", icon: /* @__PURE__ */ e(Y, {}), label: "需求中心" },
1104
+ { key: "/rpa/about", icon: /* @__PURE__ */ e(xe, {}), label: "关于影刀参考" }
1105
+ ];
1106
+ function Ve() {
1107
+ return /* @__PURE__ */ l("div", { style: { padding: 24 }, children: [
1108
+ /* @__PURE__ */ e("h2", { children: "影刀 RPA 功能全景参考 (FEATURE063)" }),
1109
+ /* @__PURE__ */ e("p", { children: "本工作台为复刻影刀 RPA 的 MVP 实现, 当前阶段 (v1.0) 包含:" }),
1110
+ /* @__PURE__ */ l("ul", { style: { lineHeight: 1.9 }, children: [
1111
+ /* @__PURE__ */ e("li", { children: "✅ 应用管理 (CRUD + 复制 + 版本发布)" }),
1112
+ /* @__PURE__ */ e("li", { children: "✅ 流程定义 (JSON 节点列表编辑器, 10 种节点类型)" }),
1113
+ /* @__PURE__ */ e("li", { children: "✅ 调度计划 (manual + cron + webhook 三种触发器)" }),
1114
+ /* @__PURE__ */ e("li", { children: "✅ 运行监控 (实例列表 + 步骤日志时间线)" }),
1115
+ /* @__PURE__ */ e("li", { children: "✅ 应用市场 (条目展示 + 一键安装为新 App)" }),
1116
+ /* @__PURE__ */ e("li", { children: "✅ 卓越中心 (4 卡片 Dashboard + 最近运行)" }),
1117
+ /* @__PURE__ */ e("li", { children: "✅ 需求中心 (提交 + 列表)" })
1118
+ ] }),
1119
+ /* @__PURE__ */ e("h3", { children: "Phase 2 规划" }),
1120
+ /* @__PURE__ */ l("ul", { style: { lineHeight: 1.9 }, children: [
1121
+ /* @__PURE__ */ e("li", { children: "桌面/网页/手机 worker (puppeteer / pywinauto / appium)" }),
1122
+ /* @__PURE__ */ e("li", { children: "Python / JS 脚本节点 (GraalPy / GraalJS)" }),
1123
+ /* @__PURE__ */ e("li", { children: "元素库 + 图像库 + OCR (z-oss 接入)" }),
1124
+ /* @__PURE__ */ e("li", { children: "AI Power (z-agent-llm-gateway)" }),
1125
+ /* @__PURE__ */ e("li", { children: "可视化拖拽画布编辑器" })
1126
+ ] })
1127
+ ] });
1128
+ }
1129
+ function Ye() {
1130
+ return ue([
1131
+ { path: "", element: /* @__PURE__ */ e(q, {}) },
1132
+ { path: "dashboard", element: /* @__PURE__ */ e(q, {}) },
1133
+ { path: "app", element: /* @__PURE__ */ e(De, {}) },
1134
+ { path: "app/:id/edit", element: /* @__PURE__ */ e(ze, {}) },
1135
+ { path: "trigger", element: /* @__PURE__ */ e($e, {}) },
1136
+ { path: "run", element: /* @__PURE__ */ e(ee, {}) },
1137
+ { path: "run/:id", element: /* @__PURE__ */ e(ee, {}) },
1138
+ { path: "market", element: /* @__PURE__ */ e(Je, {}) },
1139
+ { path: "demand", element: /* @__PURE__ */ e(He, {}) },
1140
+ { path: "about", element: /* @__PURE__ */ e(Ve, {}) }
1141
+ ]) ?? /* @__PURE__ */ e(q, {});
1142
+ }
1143
+ function lt({ onModeSwitch: i }) {
1144
+ const T = G(), { pathname: f } = he(), v = me(() => {
1145
+ for (const r of re)
1146
+ if (f.startsWith(r.key)) return r.key;
1147
+ return f;
1148
+ }, [f]);
1149
+ return /* @__PURE__ */ l("div", { className: W.shell, children: [
1150
+ /* @__PURE__ */ e("aside", { className: W.sidebar, children: /* @__PURE__ */ e("div", { className: W.menuWrap, children: re.map((r) => /* @__PURE__ */ l(
1151
+ "button",
1152
+ {
1153
+ type: "button",
1154
+ onClick: () => T(r.key),
1155
+ style: {
1156
+ display: "flex",
1157
+ alignItems: "center",
1158
+ gap: 10,
1159
+ width: "100%",
1160
+ padding: "10px 16px",
1161
+ border: "none",
1162
+ background: v === r.key ? "var(--color-primary-bg, #e6f4ff)" : "transparent",
1163
+ color: v === r.key ? "var(--color-primary, #2F70F1)" : "var(--text-primary, #333)",
1164
+ fontWeight: v === r.key ? 600 : 400,
1165
+ cursor: "pointer",
1166
+ fontSize: 14,
1167
+ textAlign: "left",
1168
+ borderLeft: v === r.key ? "3px solid var(--color-primary, #2F70F1)" : "3px solid transparent"
1169
+ },
1170
+ children: [
1171
+ r.icon,
1172
+ /* @__PURE__ */ e("span", { children: r.label })
1173
+ ]
1174
+ },
1175
+ r.key
1176
+ )) }) }),
1177
+ /* @__PURE__ */ e("main", { className: W.main, children: /* @__PURE__ */ e(Ye, {}) })
1178
+ ] });
1179
+ }
1180
+ export {
1181
+ lt as default
1182
+ };