@yuku123/z-team-component 0.2.28 → 0.2.30

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 (45) hide show
  1. package/dist/{ChangeLogView-CG-o5YP1.js → ChangeLogView-FLd1wS8H.js} +1 -1
  2. package/dist/{InvitationManagementPage-DpA3Xlq1.js → InvitationManagementPage-CttWZdu8.js} +87 -82
  3. package/dist/{OnboardingPage-DFRAwruv.js → OnboardingPage-CAI-P20Q.js} +2 -2
  4. package/dist/ProjectApp-ZR_QUlPs.js +3839 -0
  5. package/dist/{SystemShell-BLXTOqFb.js → SystemShell-BKNdXqXt.js} +1 -1
  6. package/dist/{admin-logs-C2V1ElH9.js → admin-logs-Dv86pFvY.js} +2 -2
  7. package/dist/{api--Fg0hL9Y.js → api-19TXED_O.js} +52 -39
  8. package/dist/api-BNwdLozd.js +20 -0
  9. package/dist/{createWorkspaceWsHandler-CqGqcTh_.js → createWorkspaceWsHandler-CBk4DqP4.js} +6 -5
  10. package/dist/{index-hPzswwk2.js → index-B5_xKK08.js} +1139 -1152
  11. package/dist/{index-D5u3BjCZ.js → index-BIJnjJd5.js} +2 -2
  12. package/dist/{index-BylksTyk.js → index-BKwpQ-HW.js} +136 -134
  13. package/dist/{index-bbwTcNjB.js → index-BTLD5gUt.js} +3 -3
  14. package/dist/{index-C9BOtjtQ.js → index-BTaLAs80.js} +9 -9
  15. package/dist/{index-CiMxCTOS.js → index-B_EBV24V.js} +1 -1
  16. package/dist/{index-BafC42Cl.js → index-Bd57t_yF.js} +1 -1
  17. package/dist/{index-C2aPiQSz.js → index-BjqYiZpC.js} +3 -3
  18. package/dist/{index-BaCiSbPR.js → index-BoGVJ0hC.js} +1 -1
  19. package/dist/{index-C01UUprh.js → index-BpuJ9Njb.js} +7016 -6946
  20. package/dist/{index-CcFJEYgr.js → index-C815hPWS.js} +55 -52
  21. package/dist/{index-DIxwe_pk.js → index-C8GK1bOQ.js} +358 -347
  22. package/dist/{index-DvIHX7lZ.js → index-CcpWacSZ.js} +243 -236
  23. package/dist/{index-Da7ls5q6.js → index-DOPkM2W8.js} +6 -6
  24. package/dist/index-DQNZE7Go.js +169 -0
  25. package/dist/{index-BYEx4vlI.js → index-DR_FCf71.js} +1134 -1132
  26. package/dist/{index-CTD7k9dP.js → index-DYgD6BuB.js} +4 -4
  27. package/dist/{index-dSnK7qcL.js → index-DdN9Apqq.js} +5 -5
  28. package/dist/{index-CPF3LS0x.js → index-DuGWlMWm.js} +3 -3
  29. package/dist/index-JMzBzwiO.js +1746 -0
  30. package/dist/{index-Dao4uqQd.js → index-x4-W5ClM.js} +4 -4
  31. package/dist/index.js +1 -1
  32. package/dist/{instance-1QEDBRqA.js → instance-D951fRuD.js} +1 -1
  33. package/dist/pages.js +5 -4
  34. package/dist/{schedule-C89oiqIR.js → schedule-DD50-7cs.js} +1 -1
  35. package/dist/{send-default-agent-team-message-CxkWi3XC.js → send-default-agent-team-message-Bbs2rMNf.js} +1 -1
  36. package/dist/{sso-user-BE1Ell5F.js → sso-user-BEY5ICaR.js} +1 -1
  37. package/dist/{training-o-vSBkqP.js → training-B-9tNFQw.js} +1 -1
  38. package/dist/{useAppStore-wgWaxcyc.js → useAppStore-BQN-26ns.js} +1 -1
  39. package/dist/{webide-BxD6cYe-.js → webide-P867RFZi.js} +4 -4
  40. package/dist/z-team-component.css +1 -1
  41. package/package.json +3 -3
  42. package/dist/ProjectApp-BquB_X7K.js +0 -4591
  43. package/dist/api-CX7MUpws.js +0 -19
  44. package/dist/index-CcTdM5kT.js +0 -178
  45. package/dist/index-pfzY68PH.js +0 -1408
@@ -0,0 +1,1746 @@
1
+ import { jsx as e, jsxs as i, Fragment as be } from "react/jsx-runtime";
2
+ import { ThunderboltOutlined as se, UpOutlined as Ie, DownOutlined as Se, LinkOutlined as $e, CopyOutlined as Te, EditOutlined as we, DeleteOutlined as ge, BranchesOutlined as Ae, HistoryOutlined as Ee, ReloadOutlined as xe, PlusOutlined as j, FileImageOutlined as De } from "@ant-design/icons";
3
+ import { useState as p, useEffect as F, useCallback as re, useMemo as ne, useRef as fe } from "react";
4
+ import _e from "axios";
5
+ import { Empty as le, Modal as X, Select as q, Input as ee, Form as D, Col as Z, Row as pe, Space as oe, Dropdown as ke, Popconfirm as ye, Tag as H, Descriptions as Re, Card as Le, Table as He, Tree as Oe, Button as O, Tooltip as Be, Spin as Ue } from "antd";
6
+ const Me = {
7
+ PageHeader: ({ title: a, subtitle: c }) => /* @__PURE__ */ i("div", { style: { marginBottom: 12 }, children: [
8
+ /* @__PURE__ */ e("h2", { style: { margin: 0 }, children: a }),
9
+ c && /* @__PURE__ */ e("p", { style: { color: "#666", margin: "4px 0 0", fontSize: 13 }, children: c })
10
+ ] }),
11
+ TenantDomainSelector: ({
12
+ tenants: a = [],
13
+ domains: c = [],
14
+ selectedTenant: n,
15
+ selectedDomain: h,
16
+ onTenantChange: b,
17
+ onDomainChange: d
18
+ }) => /* @__PURE__ */ i(oe, { style: { marginBottom: 12 }, children: [
19
+ /* @__PURE__ */ e("span", { style: { color: "#666" }, children: "租户" }),
20
+ /* @__PURE__ */ e(
21
+ q,
22
+ {
23
+ value: n,
24
+ onChange: b,
25
+ style: { minWidth: 160 },
26
+ options: a,
27
+ placeholder: "请选择租户"
28
+ }
29
+ ),
30
+ /* @__PURE__ */ e("span", { style: { color: "#666" }, children: "域" }),
31
+ /* @__PURE__ */ e(
32
+ q,
33
+ {
34
+ value: h,
35
+ onChange: d,
36
+ disabled: !n,
37
+ style: { minWidth: 160 },
38
+ options: c,
39
+ placeholder: "请选择域"
40
+ }
41
+ )
42
+ ] }),
43
+ Button: (a) => /* @__PURE__ */ e(O, { ...a }),
44
+ Tree: (a) => /* @__PURE__ */ e(Oe, { ...a }),
45
+ Table: (a) => /* @__PURE__ */ e(He, { ...a }),
46
+ Card: (a) => /* @__PURE__ */ e(Le, { ...a }),
47
+ Descriptions: ({ items: a = [], ...c }) => /* @__PURE__ */ e(Re, { ...c, bordered: !0, size: "small", items: a }),
48
+ Tag: (a) => /* @__PURE__ */ e(H, { ...a }),
49
+ Popconfirm: (a) => /* @__PURE__ */ e(ye, { ...a }),
50
+ Dropdown: (a) => /* @__PURE__ */ e(ke, { ...a }),
51
+ Empty: (a) => /* @__PURE__ */ e(le, { ...a }),
52
+ Space: (a) => /* @__PURE__ */ e(oe, { ...a }),
53
+ Row: (a) => /* @__PURE__ */ e(pe, { ...a }),
54
+ Col: (a) => /* @__PURE__ */ e(Z, { ...a }),
55
+ FormItem: ({ label: a, children: c, ...n }) => /* @__PURE__ */ e(D.Item, { label: a, ...n, children: c }),
56
+ Input: (a) => /* @__PURE__ */ e(ee, { ...a }),
57
+ InputTextArea: (a) => /* @__PURE__ */ e(ee.TextArea, { ...a }),
58
+ Select: (a) => /* @__PURE__ */ e(q, { ...a }),
59
+ Modal: (a) => /* @__PURE__ */ e(X, { ...a })
60
+ };
61
+ function ze({ node: a, highlightId: c, onElementClick: n }) {
62
+ var d;
63
+ const h = Me[a.type] || (() => null), b = c === a.id;
64
+ return /* @__PURE__ */ e(
65
+ "div",
66
+ {
67
+ "data-node-id": a.id,
68
+ "data-node-type": a.type,
69
+ className: `manuscript-node ${b ? "manuscript-node-highlight" : ""}`,
70
+ onClick: (l) => {
71
+ l.stopPropagation(), n == null || n(a);
72
+ },
73
+ children: /* @__PURE__ */ e(h, { ...a.props || {}, children: (d = a.children) == null ? void 0 : d.map((l) => /* @__PURE__ */ e(
74
+ ze,
75
+ {
76
+ node: l,
77
+ highlightId: c,
78
+ onElementClick: n
79
+ },
80
+ l.id
81
+ )) })
82
+ }
83
+ );
84
+ }
85
+ function qe({ tree: a, highlightId: c, onElementClick: n }) {
86
+ return !a || a.length === 0 ? /* @__PURE__ */ e(le, { description: "暂无设计稿内容" }) : /* @__PURE__ */ e("div", { className: "manuscript-renderer", children: a.map((h) => /* @__PURE__ */ e(
87
+ ze,
88
+ {
89
+ node: h,
90
+ highlightId: c,
91
+ onElementClick: n
92
+ },
93
+ h.id
94
+ )) });
95
+ }
96
+ const Fe = {
97
+ P0: "red",
98
+ P1: "orange",
99
+ P2: "blue"
100
+ };
101
+ function je({
102
+ caseData: a,
103
+ isHighlighted: c,
104
+ chainData: n,
105
+ onEdit: h,
106
+ onDelete: b,
107
+ onClick: d,
108
+ onEffectClick: l
109
+ }) {
110
+ const [_, r] = p(!1), f = n != null && n.triggerInfo ? Ne(n.triggerInfo, {}) : null, N = n != null && n.crossPageEffects ? Ne(n.crossPageEffects, []) : [];
111
+ return /* @__PURE__ */ i(
112
+ "div",
113
+ {
114
+ className: `manuscript-case-card ${c ? "highlight" : ""}`,
115
+ onClick: () => d == null ? void 0 : d(a),
116
+ children: [
117
+ /* @__PURE__ */ i("div", { className: "case-card-header", onClick: (v) => {
118
+ v.stopPropagation(), r(!_);
119
+ }, children: [
120
+ /* @__PURE__ */ i(oe, { children: [
121
+ /* @__PURE__ */ e("span", { className: "case-id", children: a.caseId }),
122
+ /* @__PURE__ */ e("span", { className: "case-title", children: a.title }),
123
+ /* @__PURE__ */ e(H, { color: Fe[a.priority] || "default", children: a.priority || "P1" }),
124
+ a.bizCode && /* @__PURE__ */ e(Be, { title: `因果链路: ${a.bizCode}`, children: /* @__PURE__ */ e(se, { style: { color: "#fa8c16" } }) })
125
+ ] }),
126
+ /* @__PURE__ */ e(
127
+ O,
128
+ {
129
+ type: "text",
130
+ size: "small",
131
+ icon: _ ? /* @__PURE__ */ e(Ie, {}) : /* @__PURE__ */ e(Se, {}),
132
+ onClick: (v) => {
133
+ v.stopPropagation(), r(!_);
134
+ }
135
+ }
136
+ )
137
+ ] }),
138
+ _ && /* @__PURE__ */ i("div", { className: "case-card-body", children: [
139
+ a.bizCode && /* @__PURE__ */ i("div", { className: "case-section", children: [
140
+ /* @__PURE__ */ i("div", { className: "case-section-title", children: [
141
+ /* @__PURE__ */ e(se, { style: { color: "#fa8c16" } }),
142
+ " 因果链路"
143
+ ] }),
144
+ /* @__PURE__ */ i("div", { className: "causal-chain", children: [
145
+ f && /* @__PURE__ */ i("div", { className: "chain-trigger", children: [
146
+ /* @__PURE__ */ e(H, { color: "orange", children: f.page }),
147
+ /* @__PURE__ */ i("span", { className: "chain-action", children: [
148
+ "→ ",
149
+ f.action
150
+ ] })
151
+ ] }),
152
+ /* @__PURE__ */ e("div", { className: "chain-effects", children: N.map((v, P) => /* @__PURE__ */ i(
153
+ "div",
154
+ {
155
+ className: "chain-effect-row",
156
+ onClick: ($) => {
157
+ $.stopPropagation(), l == null || l(v);
158
+ },
159
+ children: [
160
+ /* @__PURE__ */ e("span", { className: "chain-arrow", children: "→" }),
161
+ /* @__PURE__ */ e(H, { color: "blue", children: v.page }),
162
+ /* @__PURE__ */ i("span", { className: "chain-eff-type", children: [
163
+ "[",
164
+ v.effectType,
165
+ "]"
166
+ ] }),
167
+ /* @__PURE__ */ e("span", { className: "chain-eff-desc", children: v.description }),
168
+ /* @__PURE__ */ e(H, { style: { marginLeft: 8 }, children: v.delay })
169
+ ]
170
+ },
171
+ P
172
+ )) })
173
+ ] })
174
+ ] }),
175
+ a.learningPath && a.learningPath.length > 0 && /* @__PURE__ */ i("div", { className: "case-section", children: [
176
+ /* @__PURE__ */ e("div", { className: "case-section-title", children: "📋 学习路径" }),
177
+ /* @__PURE__ */ e("ol", { className: "case-learning-path", children: a.learningPath.map((v, P) => /* @__PURE__ */ e("li", { children: v }, P)) })
178
+ ] }),
179
+ a.scene && /* @__PURE__ */ i("div", { className: "case-section", children: [
180
+ /* @__PURE__ */ e("div", { className: "case-section-title", children: "📍 起点场景" }),
181
+ /* @__PURE__ */ e("div", { className: "case-scene", children: a.scene })
182
+ ] }),
183
+ /* @__PURE__ */ i("div", { className: "case-section", children: [
184
+ /* @__PURE__ */ e("div", { className: "case-section-title", children: "🔗 设计稿关联" }),
185
+ a.hotspotSelector ? /* @__PURE__ */ e(H, { color: "cyan", icon: /* @__PURE__ */ e($e, {}), children: a.hotspotSelector }) : /* @__PURE__ */ e("span", { style: { color: "#999" }, children: "未关联" })
186
+ ] }),
187
+ /* @__PURE__ */ i("div", { className: "case-card-actions", onClick: (v) => v.stopPropagation(), children: [
188
+ /* @__PURE__ */ e(
189
+ O,
190
+ {
191
+ size: "small",
192
+ icon: /* @__PURE__ */ e(Te, {}),
193
+ onClick: () => h == null ? void 0 : h({ ...a, _action: "duplicate" }),
194
+ children: "复制"
195
+ }
196
+ ),
197
+ /* @__PURE__ */ e(
198
+ O,
199
+ {
200
+ size: "small",
201
+ icon: /* @__PURE__ */ e(we, {}),
202
+ onClick: () => h == null ? void 0 : h(a),
203
+ children: "编辑"
204
+ }
205
+ ),
206
+ /* @__PURE__ */ e(ye, { title: "确认删除此 case?", onConfirm: () => b == null ? void 0 : b(a), children: /* @__PURE__ */ e(O, { size: "small", danger: !0, icon: /* @__PURE__ */ e(ge, {}), children: "删除" }) })
207
+ ] })
208
+ ] })
209
+ ]
210
+ }
211
+ );
212
+ }
213
+ function Ne(a, c) {
214
+ if (!a) return c;
215
+ try {
216
+ return JSON.parse(a);
217
+ } catch {
218
+ return c;
219
+ }
220
+ }
221
+ function Ge({
222
+ open: a,
223
+ initialCase: c,
224
+ bizOptions: n = [],
225
+ designNodes: h = [],
226
+ onCancel: b,
227
+ onSubmit: d
228
+ }) {
229
+ const [l] = D.useForm();
230
+ F(() => {
231
+ var r;
232
+ a && (c ? l.setFieldsValue({
233
+ ...c,
234
+ learningPathText: (r = c.learningPath) == null ? void 0 : r.join(`
235
+ `)
236
+ }) : l.resetFields());
237
+ }, [a, c, l]);
238
+ const _ = async () => {
239
+ var r;
240
+ try {
241
+ const f = await l.validateFields(), N = {
242
+ ...f,
243
+ learningPath: ((r = f.learningPathText) == null ? void 0 : r.split(`
244
+ `).filter((v) => v.trim())) || []
245
+ };
246
+ delete N.learningPathText, d(N);
247
+ } catch {
248
+ }
249
+ };
250
+ return /* @__PURE__ */ e(
251
+ X,
252
+ {
253
+ open: a,
254
+ title: c ? `编辑 case: ${c.caseId}` : "新增 case",
255
+ onCancel: b,
256
+ onOk: _,
257
+ okText: "保存 (commit)",
258
+ destroyOnHidden: !0,
259
+ children: /* @__PURE__ */ i(D, { form: l, layout: "vertical", children: [
260
+ /* @__PURE__ */ i(pe, { gutter: 16, children: [
261
+ /* @__PURE__ */ e(Z, { span: 12, children: /* @__PURE__ */ e(
262
+ D.Item,
263
+ {
264
+ name: "caseId",
265
+ label: "Case 编码",
266
+ rules: [{ required: !0, pattern: /^case\.\d+$/, message: "格式: case.NNN" }],
267
+ children: /* @__PURE__ */ e(ee, { placeholder: "case.001", disabled: !!c && !c._action })
268
+ }
269
+ ) }),
270
+ /* @__PURE__ */ e(Z, { span: 12, children: /* @__PURE__ */ e(D.Item, { name: "title", label: "标题", rules: [{ required: !0 }], children: /* @__PURE__ */ e(ee, { placeholder: "新增组织 A" }) }) })
271
+ ] }),
272
+ /* @__PURE__ */ e(
273
+ D.Item,
274
+ {
275
+ name: "bizCode",
276
+ label: "因果链路 (引用 z_biz_understanding.bizCode)",
277
+ extra: "选择这条 case 引用的跨页面因果链路",
278
+ children: /* @__PURE__ */ e(
279
+ q,
280
+ {
281
+ placeholder: "选择因果链路 (可选)",
282
+ allowClear: !0,
283
+ showSearch: !0,
284
+ optionFilterProp: "label",
285
+ options: n
286
+ }
287
+ )
288
+ }
289
+ ),
290
+ /* @__PURE__ */ e(D.Item, { name: "scene", label: "起点场景", children: /* @__PURE__ */ e(ee.TextArea, { rows: 2, placeholder: "管理员进入 4A 中心 → 组织管理 → ..." }) }),
291
+ /* @__PURE__ */ e(D.Item, { name: "learningPathText", label: "学习路径 (每行一步)", children: /* @__PURE__ */ e(
292
+ ee.TextArea,
293
+ {
294
+ rows: 5,
295
+ placeholder: `1. 进入组织管理页
296
+ 2. 选择目标域
297
+ 3. 点击 [+ 新增组织]
298
+ 4. 提交表单
299
+ 5. 观察 5 个页面联动`
300
+ }
301
+ ) }),
302
+ /* @__PURE__ */ i(pe, { gutter: 16, children: [
303
+ /* @__PURE__ */ e(Z, { span: 8, children: /* @__PURE__ */ e(D.Item, { name: "priority", label: "优先级", initialValue: "P1", children: /* @__PURE__ */ e(q, { options: [
304
+ { value: "P0", label: "P0 紧急" },
305
+ { value: "P1", label: "P1 重要" },
306
+ { value: "P2", label: "P2 一般" }
307
+ ] }) }) }),
308
+ /* @__PURE__ */ e(Z, { span: 8, children: /* @__PURE__ */ e(D.Item, { name: "status", label: "状态", initialValue: "OPEN", children: /* @__PURE__ */ e(q, { options: [
309
+ { value: "OPEN", label: "OPEN" },
310
+ { value: "IN_PROGRESS", label: "IN_PROGRESS" },
311
+ { value: "DONE", label: "DONE" },
312
+ { value: "ARCHIVED", label: "ARCHIVED" }
313
+ ] }) }) }),
314
+ /* @__PURE__ */ e(Z, { span: 8, children: /* @__PURE__ */ e(D.Item, { name: "hotspotSelector", label: "关联设计稿元素", children: /* @__PURE__ */ e(
315
+ q,
316
+ {
317
+ allowClear: !0,
318
+ placeholder: "选择 design node",
319
+ showSearch: !0,
320
+ optionFilterProp: "label",
321
+ options: h.map((r) => ({
322
+ value: r.id,
323
+ label: `${r.type} #${r.id}`
324
+ }))
325
+ }
326
+ ) }) })
327
+ ] })
328
+ ] })
329
+ }
330
+ );
331
+ }
332
+ const k = _e.create({ baseURL: "/api", timeout: 15e3 });
333
+ k.interceptors.response.use(
334
+ (a) => a.data,
335
+ (a) => (console.error("[ManuscriptView]", a), Promise.reject(a))
336
+ );
337
+ function Ve({ productCode: a, pageCode: c }) {
338
+ const [n, h] = p(null), [b, d] = p(null), [l, _] = p([]), [r, f] = p([]), [N, v] = p([]), [P, $] = p("main"), [K, w] = p(null), [G, A] = p(null), [R, E] = p(!1), [S, T] = p(null), [x, V] = p(!1), [te, B] = p(!1), [U, Y] = p(""), [u, o] = p(!1), s = re(async () => {
339
+ o(!0);
340
+ try {
341
+ const [m, g, z, I, ue] = await Promise.all([
342
+ k.get("/product/manuscript/product", { params: { productCode: a, pageCode: c } }),
343
+ k.get("/product/manuscript/design", { params: { productCode: a, pageCode: c } }),
344
+ k.get("/product/biz-understanding/list", { params: { productCode: a } }),
345
+ k.get("/product/manuscript/history", {
346
+ params: {
347
+ productCode: a,
348
+ pageCode: c,
349
+ branch: P,
350
+ limit: 20
351
+ }
352
+ }),
353
+ k.get("/product/manuscript/branches", { params: { productCode: a, pageCode: c } })
354
+ ]);
355
+ h(m == null ? void 0 : m.data), d(g == null ? void 0 : g.data), _((z == null ? void 0 : z.data) || []), f((I == null ? void 0 : I.data) || []), v((ue == null ? void 0 : ue.data) || []);
356
+ } catch (m) {
357
+ console.error("loadAll 失败:", m);
358
+ } finally {
359
+ o(!1);
360
+ }
361
+ }, [a, c, P]);
362
+ F(() => {
363
+ s();
364
+ }, [s]);
365
+ const y = ne(() => {
366
+ if (!(n != null && n.cases)) return [];
367
+ try {
368
+ return JSON.parse(n.cases);
369
+ } catch {
370
+ return [];
371
+ }
372
+ }, [n]), J = ne(() => {
373
+ if (!(b != null && b.renderTree)) return [];
374
+ try {
375
+ return JSON.parse(b.renderTree);
376
+ } catch {
377
+ return [];
378
+ }
379
+ }, [b]), L = ne(() => {
380
+ const m = [];
381
+ function g(z) {
382
+ for (const I of z || [])
383
+ I.id && m.push({ id: I.id, type: I.type }), I.children && g(I.children);
384
+ }
385
+ return g(J), m;
386
+ }, [J]), Q = ne(() => {
387
+ const m = {};
388
+ for (const g of l) m[g.bizCode] = g;
389
+ return m;
390
+ }, [l]), ae = ne(
391
+ () => l.map((m) => ({ value: m.bizCode, label: `${m.bizCode} — ${m.title}` })),
392
+ [l]
393
+ ), de = (m) => {
394
+ w(m.caseId), A(m.hotspotSelector || null), setTimeout(() => {
395
+ w(null), A(null);
396
+ }, 3e3);
397
+ }, ce = (m) => {
398
+ if (!m.id) return;
399
+ A(m.id);
400
+ const g = y.find((z) => z.hotspotSelector === m.id);
401
+ g && w(g.caseId), setTimeout(() => {
402
+ w(null), A(null);
403
+ }, 3e3);
404
+ }, me = (m) => {
405
+ const g = y.find((z) => z.bizCode);
406
+ g && (w(g.caseId), setTimeout(() => w(null), 3e3));
407
+ }, M = async (m) => {
408
+ const g = (S == null ? void 0 : S._action) === "duplicate" || !S, z = (S == null ? void 0 : S._action) === "duplicate";
409
+ try {
410
+ if (g || z) {
411
+ const I = z ? { ...m, caseId: he(), title: m.title + " (副本)" } : m;
412
+ await k.post("/product/manuscript/case", {
413
+ productCode: a,
414
+ pageCode: c,
415
+ author: "admin",
416
+ caseData: I
417
+ });
418
+ } else
419
+ await k.put("/product/manuscript/case", {
420
+ productCode: a,
421
+ pageCode: c,
422
+ author: "admin",
423
+ originalCaseId: S.caseId,
424
+ caseData: m
425
+ });
426
+ E(!1), T(null), await s();
427
+ } catch (I) {
428
+ X.error({ title: "保存失败", content: I == null ? void 0 : I.message });
429
+ }
430
+ }, ie = async (m) => {
431
+ try {
432
+ await k.delete("/product/manuscript/case", {
433
+ params: { productCode: a, pageCode: c, caseId: m.caseId, author: "admin" }
434
+ }), await s();
435
+ } catch (g) {
436
+ X.error({ title: "删除失败", content: g == null ? void 0 : g.message });
437
+ }
438
+ }, he = () => {
439
+ const m = y.map((z) => parseInt((z.caseId || "case.0").split(".")[1] || "0")).filter((z) => !isNaN(z)), g = m.length > 0 ? Math.max(...m) : 0;
440
+ return `case.${String(g + 1).padStart(3, "0")}`;
441
+ }, Ce = async (m) => {
442
+ $(m);
443
+ }, Pe = async () => {
444
+ var m;
445
+ if (U.trim())
446
+ try {
447
+ const g = (m = N.find((z) => z.branch === P)) == null ? void 0 : m.headSha;
448
+ await k.post("/product/manuscript/branch", {
449
+ productCode: a,
450
+ pageCode: c,
451
+ branch: U,
452
+ fromSha: g
453
+ }), B(!1), Y(""), await s(), $(U);
454
+ } catch (g) {
455
+ X.error({ title: "创建分支失败", content: g == null ? void 0 : g.message });
456
+ }
457
+ };
458
+ return u && !n && !b ? /* @__PURE__ */ i("div", { style: { textAlign: "center", padding: 40 }, children: [
459
+ /* @__PURE__ */ e(Ue, {}),
460
+ " 加载中..."
461
+ ] }) : /* @__PURE__ */ i("div", { className: "manuscript-view", children: [
462
+ /* @__PURE__ */ e("div", { className: "manuscript-toolbar", children: /* @__PURE__ */ i(oe, { children: [
463
+ /* @__PURE__ */ e(Ae, {}),
464
+ /* @__PURE__ */ e("span", { children: "分支:" }),
465
+ /* @__PURE__ */ e(
466
+ q,
467
+ {
468
+ value: P,
469
+ onChange: Ce,
470
+ style: { minWidth: 120 },
471
+ options: N.map((m) => ({ value: m.branch, label: m.branch }))
472
+ }
473
+ ),
474
+ /* @__PURE__ */ e(O, { size: "small", onClick: () => B(!0), children: "新分支" }),
475
+ /* @__PURE__ */ i(
476
+ O,
477
+ {
478
+ size: "small",
479
+ icon: /* @__PURE__ */ e(Ee, {}),
480
+ onClick: () => V(!0),
481
+ children: [
482
+ "历史 (",
483
+ r.length,
484
+ ")"
485
+ ]
486
+ }
487
+ ),
488
+ /* @__PURE__ */ e(O, { size: "small", icon: /* @__PURE__ */ e(xe, {}), onClick: s, children: "刷新" })
489
+ ] }) }),
490
+ /* @__PURE__ */ i("div", { className: "manuscript-layout", children: [
491
+ /* @__PURE__ */ i("div", { className: "manuscript-left", children: [
492
+ /* @__PURE__ */ i("div", { className: "case-list-header", children: [
493
+ /* @__PURE__ */ i("h3", { children: [
494
+ "📋 产品稿件 / ",
495
+ y.length,
496
+ " 条 case",
497
+ (n == null ? void 0 : n.title) && /* @__PURE__ */ e("small", { style: { marginLeft: 8, color: "#888" }, children: n.title })
498
+ ] }),
499
+ /* @__PURE__ */ e(
500
+ O,
501
+ {
502
+ type: "primary",
503
+ icon: /* @__PURE__ */ e(j, {}),
504
+ onClick: () => {
505
+ T(null), E(!0);
506
+ },
507
+ children: "新增 case"
508
+ }
509
+ )
510
+ ] }),
511
+ /* @__PURE__ */ e("div", { className: "case-list", children: y.length === 0 ? /* @__PURE__ */ e(le, { description: "暂无 case, 点击 [新增 case] 开始" }) : y.map((m) => /* @__PURE__ */ e(
512
+ je,
513
+ {
514
+ caseData: m,
515
+ isHighlighted: K === m.caseId,
516
+ chainData: m.bizCode ? Q[m.bizCode] : null,
517
+ onEdit: (g) => {
518
+ T(g), E(!0);
519
+ },
520
+ onDelete: ie,
521
+ onClick: de,
522
+ onEffectClick: me
523
+ },
524
+ m.caseId
525
+ )) })
526
+ ] }),
527
+ /* @__PURE__ */ i("div", { className: "manuscript-right", children: [
528
+ /* @__PURE__ */ i("div", { className: "design-header", children: [
529
+ /* @__PURE__ */ i("h3", { children: [
530
+ "🎨 设计稿件",
531
+ (b == null ? void 0 : b.title) && /* @__PURE__ */ e("small", { style: { marginLeft: 8, color: "#888" }, children: b.title })
532
+ ] }),
533
+ /* @__PURE__ */ i("span", { style: { color: "#888", fontSize: 12 }, children: [
534
+ L.length,
535
+ " 个节点"
536
+ ] })
537
+ ] }),
538
+ /* @__PURE__ */ e("div", { className: "design-canvas", children: /* @__PURE__ */ e(
539
+ qe,
540
+ {
541
+ tree: J,
542
+ highlightId: G,
543
+ onElementClick: ce
544
+ }
545
+ ) })
546
+ ] })
547
+ ] }),
548
+ /* @__PURE__ */ e(
549
+ Ge,
550
+ {
551
+ open: R,
552
+ initialCase: S,
553
+ bizOptions: ae,
554
+ designNodes: L,
555
+ onCancel: () => {
556
+ E(!1), T(null);
557
+ },
558
+ onSubmit: M
559
+ }
560
+ ),
561
+ /* @__PURE__ */ e(
562
+ X,
563
+ {
564
+ open: x,
565
+ title: `commit 历史 (${P} 分支)`,
566
+ onCancel: () => V(!1),
567
+ footer: null,
568
+ children: /* @__PURE__ */ e("div", { className: "commit-history", children: r.length === 0 ? /* @__PURE__ */ e(le, { description: "暂无 commit 记录" }) : r.map((m) => /* @__PURE__ */ i("div", { className: "commit-row", children: [
569
+ /* @__PURE__ */ e("div", { className: "commit-sha", children: /* @__PURE__ */ e(H, { color: "purple", children: m.sha.substring(0, 8) }) }),
570
+ /* @__PURE__ */ i("div", { className: "commit-msg", children: [
571
+ /* @__PURE__ */ i("div", { children: [
572
+ /* @__PURE__ */ e(H, { color: m.operation === "CREATE" ? "green" : m.operation === "UPDATE" ? "blue" : m.operation === "DELETE" ? "red" : m.operation === "BIND" ? "cyan" : "default", children: m.operation }),
573
+ /* @__PURE__ */ e(H, { children: m.targetType }),
574
+ /* @__PURE__ */ e("code", { children: m.targetId })
575
+ ] }),
576
+ /* @__PURE__ */ e("div", { style: { color: "#888", fontSize: 12, marginTop: 4 }, children: m.commitMessage })
577
+ ] }),
578
+ /* @__PURE__ */ i("div", { className: "commit-meta", style: { color: "#888", fontSize: 11 }, children: [
579
+ /* @__PURE__ */ e("div", { children: m.author }),
580
+ /* @__PURE__ */ e("div", { children: m.createdAt })
581
+ ] })
582
+ ] }, m.sha)) })
583
+ }
584
+ ),
585
+ /* @__PURE__ */ e(
586
+ X,
587
+ {
588
+ open: te,
589
+ title: "新建分支",
590
+ onCancel: () => B(!1),
591
+ onOk: Pe,
592
+ okText: "创建",
593
+ children: /* @__PURE__ */ i("div", { style: { padding: "12px 0" }, children: [
594
+ /* @__PURE__ */ e("span", { style: { marginRight: 8 }, children: "分支名:" }),
595
+ /* @__PURE__ */ e(
596
+ "input",
597
+ {
598
+ value: U,
599
+ onChange: (m) => Y(m.target.value),
600
+ placeholder: "feature-xxx",
601
+ style: { padding: "4px 8px", border: "1px solid #d9d9d9", borderRadius: 4, width: 200 }
602
+ }
603
+ ),
604
+ /* @__PURE__ */ i("div", { style: { marginTop: 8, color: "#888", fontSize: 12 }, children: [
605
+ "从当前分支 (",
606
+ /* @__PURE__ */ e("code", { children: P }),
607
+ ") 的 HEAD fork"
608
+ ] })
609
+ ] })
610
+ }
611
+ )
612
+ ] });
613
+ }
614
+ const Je = "_container_1c2b1_6", We = "_sidebar_1c2b1_15", Xe = "_sidebarHeader_1c2b1_25", Ke = "_productList_1c2b1_37", Ye = "_productItem_1c2b1_43", Qe = "_productItemActive_1c2b1_57", Ze = "_productItemName_1c2b1_62", et = "_productItemCode_1c2b1_68", tt = "_productItemStatus_1c2b1_73", at = "_emptyHint_1c2b1_84", it = "_main_1c2b1_92", nt = "_productHeader_1c2b1_100", st = "_productTitle_1c2b1_109", ct = "_productCode_1c2b1_115", rt = "_tabBar_1c2b1_122", lt = "_tab_1c2b1_122", ot = "_tabActive_1c2b1_142", dt = "_tabContent_1c2b1_148", mt = "_formGroup_1c2b1_155", ht = "_formLabel_1c2b1_163", ut = "_formInput_1c2b1_171", pt = "_formTextarea_1c2b1_172", bt = "_designGrid_1c2b1_189", gt = "_designCard_1c2b1_195", _t = "_designImage_1c2b1_202", ft = "_designInfo_1c2b1_209", Nt = "_designName_1c2b1_213", vt = "_designDesc_1c2b1_220", yt = "_designActions_1c2b1_225", zt = "_designLink_1c2b1_233", Ct = "_table_1c2b1_244", Pt = "_empty_1c2b1_84", It = "_btn_1c2b1_284", St = "_btnPrimary_1c2b1_300", $t = "_btnDanger_1c2b1_311", Tt = "_toolbar_1c2b1_321", wt = "_priority_1c2b1_329", At = "_priorityP0_1c2b1_337", Et = "_priorityP1_1c2b1_342", xt = "_priorityP2_1c2b1_347", Dt = "_priorityP3_1c2b1_352", kt = "_status_1c2b1_357", Rt = "_statusActive_1c2b1_367", Lt = "_statusDone_1c2b1_372", Ht = "_featureNo_1c2b1_377", Ot = "_spinner_1c2b1_386", Bt = "_modal_1c2b1_394", Ut = "_modalBody_1c2b1_404", Mt = "_modalTitle_1c2b1_413", qt = "_modalActions_1c2b1_420", Ft = "_bizLayout_1c2b1_430", jt = "_bizList_1c2b1_437", Gt = "_bizFilter_1c2b1_448", Vt = "_bizFilterHint_1c2b1_454", Jt = "_bizListHeader_1c2b1_459", Wt = "_bizItem_1c2b1_467", Xt = "_bizItemActive_1c2b1_481", Kt = "_bizItemHeader_1c2b1_487", Yt = "_bizItemTitle_1c2b1_494", Qt = "_bizItemStatus_1c2b1_504", Zt = "_bizItemSummary_1c2b1_512", ea = "_bizItemMeta_1c2b1_522", ta = "_bizItemDot_1c2b1_527", aa = "_bizDetail_1c2b1_531", ia = "_bizDetailHeader_1c2b1_537", na = "_bizDetailTitle_1c2b1_543", sa = "_bizDetailCode_1c2b1_550", ca = "_bizSection_1c2b1_556", ra = "_bizSectionTitle_1c2b1_560", la = "_bizTriggerCard_1c2b1_570", oa = "_bizEffects_1c2b1_580", da = "_bizEffectCard_1c2b1_586", ma = "_bizEffectPage_1c2b1_595", ha = "_bizEffectArrow_1c2b1_602", ua = "_bizEffectPageCode_1c2b1_608", pa = "_bizEffectDelay_1c2b1_618", ba = "_bizEffectType_1c2b1_626", ga = "_bizEffectDesc_1c2b1_633", _a = "_bizStory_1c2b1_638", fa = "_chatLayout_1c2b1_657", Na = "_chatHeader_1c2b1_666", va = "_chatSessionSelect_1c2b1_673", ya = "_chatHint_1c2b1_683", za = "_chatBody_1c2b1_689", Ca = "_chatEmpty_1c2b1_699", Pa = "_msgRow_1c2b1_707", Ia = "_msgRowUser_1c2b1_714", Sa = "_bubble_1c2b1_718", $a = "_bubbleUser_1c2b1_728", Ta = "_bubbleAssistant_1c2b1_734", wa = "_streamingCursor_1c2b1_741", Aa = "_proposalCard_1c2b1_752", Ea = "_proposalHead_1c2b1_764", xa = "_proposalBadge_1c2b1_771", Da = "_proposalType_1c2b1_779", ka = "_proposalActions_1c2b1_785", Ra = "_proposalAccepted_1c2b1_791", La = "_proposalRejected_1c2b1_797", Ha = "_proposalPreview_1c2b1_803", Oa = "_chatError_1c2b1_813", Ba = "_chatInputRow_1c2b1_822", Ua = "_chatTextarea_1c2b1_828", t = {
615
+ container: Je,
616
+ sidebar: We,
617
+ sidebarHeader: Xe,
618
+ productList: Ke,
619
+ productItem: Ye,
620
+ productItemActive: Qe,
621
+ productItemName: Ze,
622
+ productItemCode: et,
623
+ productItemStatus: tt,
624
+ emptyHint: at,
625
+ main: it,
626
+ productHeader: nt,
627
+ productTitle: st,
628
+ productCode: ct,
629
+ tabBar: rt,
630
+ tab: lt,
631
+ tabActive: ot,
632
+ tabContent: dt,
633
+ formGroup: mt,
634
+ formLabel: ht,
635
+ formInput: ut,
636
+ formTextarea: pt,
637
+ designGrid: bt,
638
+ designCard: gt,
639
+ designImage: _t,
640
+ designInfo: ft,
641
+ designName: Nt,
642
+ designDesc: vt,
643
+ designActions: yt,
644
+ designLink: zt,
645
+ table: Ct,
646
+ empty: Pt,
647
+ btn: It,
648
+ btnPrimary: St,
649
+ btnDanger: $t,
650
+ toolbar: Tt,
651
+ priority: wt,
652
+ priorityP0: At,
653
+ priorityP1: Et,
654
+ priorityP2: xt,
655
+ priorityP3: Dt,
656
+ status: kt,
657
+ statusActive: Rt,
658
+ statusDone: Lt,
659
+ featureNo: Ht,
660
+ spinner: Ot,
661
+ modal: Bt,
662
+ modalBody: Ut,
663
+ modalTitle: Mt,
664
+ modalActions: qt,
665
+ bizLayout: Ft,
666
+ bizList: jt,
667
+ bizFilter: Gt,
668
+ bizFilterHint: Vt,
669
+ bizListHeader: Jt,
670
+ bizItem: Wt,
671
+ bizItemActive: Xt,
672
+ bizItemHeader: Kt,
673
+ bizItemTitle: Yt,
674
+ bizItemStatus: Qt,
675
+ bizItemSummary: Zt,
676
+ bizItemMeta: ea,
677
+ bizItemDot: ta,
678
+ bizDetail: aa,
679
+ bizDetailHeader: ia,
680
+ bizDetailTitle: na,
681
+ bizDetailCode: sa,
682
+ bizSection: ca,
683
+ bizSectionTitle: ra,
684
+ bizTriggerCard: la,
685
+ bizEffects: oa,
686
+ bizEffectCard: da,
687
+ bizEffectPage: ma,
688
+ bizEffectArrow: ha,
689
+ bizEffectPageCode: ua,
690
+ bizEffectDelay: pa,
691
+ bizEffectType: ba,
692
+ bizEffectDesc: ga,
693
+ bizStory: _a,
694
+ chatLayout: fa,
695
+ chatHeader: Na,
696
+ chatSessionSelect: va,
697
+ chatHint: ya,
698
+ chatBody: za,
699
+ chatEmpty: Ca,
700
+ msgRow: Pa,
701
+ msgRowUser: Ia,
702
+ bubble: Sa,
703
+ bubbleUser: $a,
704
+ bubbleAssistant: Ta,
705
+ streamingCursor: wa,
706
+ proposalCard: Aa,
707
+ proposalHead: Ea,
708
+ proposalBadge: xa,
709
+ proposalType: Da,
710
+ proposalActions: ka,
711
+ proposalAccepted: Ra,
712
+ proposalRejected: La,
713
+ proposalPreview: Ha,
714
+ chatError: Oa,
715
+ chatInputRow: Ba,
716
+ chatTextarea: Ua
717
+ }, W = _e.create({ baseURL: "/api", timeout: 3e4 });
718
+ W.interceptors.response.use(
719
+ (a) => a.data,
720
+ (a) => (console.error("[ProductChat] request failed", a), Promise.reject(a))
721
+ );
722
+ const Ma = {
723
+ name: "产品名称",
724
+ vision: "产品愿景",
725
+ target_users: "目标用户",
726
+ description: "业务描述",
727
+ requirement: "业务需求",
728
+ design: "设计稿",
729
+ biz_understanding: "业务理解稿件",
730
+ glossary: "统一语言术语",
731
+ concept: "领域概念",
732
+ scenario: "用户链路场景"
733
+ };
734
+ function ve(a) {
735
+ return a.replace(/<proposal[\s\S]*?<\/proposal>/g, "").trim();
736
+ }
737
+ function qa(a) {
738
+ try {
739
+ return JSON.parse(a);
740
+ } catch {
741
+ return {};
742
+ }
743
+ }
744
+ function Fa(a, c) {
745
+ switch (a) {
746
+ case "name":
747
+ return String(c.name || "");
748
+ case "vision":
749
+ return String(c.vision || "");
750
+ case "target_users":
751
+ return String(c.targetUsers || "");
752
+ case "description":
753
+ return String(c.description || "");
754
+ case "requirement":
755
+ return `[${c.priority || "P1"}] ${c.title || ""}`;
756
+ case "design":
757
+ return String(c.name || "");
758
+ case "biz_understanding":
759
+ return String(c.title || "");
760
+ default:
761
+ return JSON.stringify(c);
762
+ }
763
+ }
764
+ function ja({
765
+ productCode: a,
766
+ productName: c,
767
+ onArtifactChanged: n
768
+ }) {
769
+ const [h, b] = p([]), [d, l] = p(null), [_, r] = p([]), [f, N] = p([]), [v, P] = p(""), [$, K] = p(!1), [w, G] = p(""), [A, R] = p(""), E = fe(null), S = fe(null), T = re(async () => {
770
+ try {
771
+ const u = await W.get(`/product/${a}/chat/sessions`), o = (u == null ? void 0 : u.data) || [];
772
+ b(o), l(
773
+ (s) => s && o.some((y) => y.id === s) ? s : o.length > 0 ? o[0].id : null
774
+ );
775
+ } catch (u) {
776
+ console.error(u);
777
+ }
778
+ }, [a]), x = re(async (u) => {
779
+ try {
780
+ const [o, s] = await Promise.all([
781
+ W.get(`/product/${a}/chat/sessions/${u}/messages`),
782
+ W.get(`/product/${a}/chat/proposals`, {
783
+ params: { sessionId: u }
784
+ })
785
+ ]);
786
+ r((o == null ? void 0 : o.data) || []), N((s == null ? void 0 : s.data) || []);
787
+ } catch (o) {
788
+ console.error(o);
789
+ }
790
+ }, [a]);
791
+ F(() => {
792
+ l(null), r([]), N([]), T();
793
+ }, [T]), F(() => {
794
+ d != null && x(d);
795
+ }, [d, x]), F(() => {
796
+ var u;
797
+ (u = S.current) == null || u.scrollIntoView({ behavior: "smooth" });
798
+ }, [_, w]);
799
+ const V = async () => {
800
+ try {
801
+ const u = await W.post(`/product/${a}/chat/sessions`, {
802
+ title: `${c} · 产品对话`
803
+ }), o = u == null ? void 0 : u.data;
804
+ await T(), o != null && o.id && l(o.id);
805
+ } catch (u) {
806
+ console.error(u);
807
+ }
808
+ }, te = async () => {
809
+ if (d != null && confirm("确认删除该会话(连同消息与提案记录)?"))
810
+ try {
811
+ await W.delete(`/product/${a}/chat/sessions/${d}`), l(null), r([]), N([]), await T();
812
+ } catch (u) {
813
+ console.error(u);
814
+ }
815
+ }, B = async () => {
816
+ const u = v.trim();
817
+ if (!u || $ || d == null) return;
818
+ P(""), R(""), K(!0), G(""), r((s) => [
819
+ ...s,
820
+ { id: -Date.now(), sessionId: d, role: "user", content: u }
821
+ ]);
822
+ const o = new AbortController();
823
+ E.current = o;
824
+ try {
825
+ const s = await fetch(
826
+ `/api/product/${a}/chat/sessions/${d}/chat/stream`,
827
+ {
828
+ method: "POST",
829
+ headers: { Accept: "text/event-stream", "Content-Type": "application/json" },
830
+ body: JSON.stringify({ message: u }),
831
+ signal: o.signal
832
+ }
833
+ );
834
+ if (!s.ok || !s.body) {
835
+ const ae = await s.text().catch(() => "");
836
+ R(ae || `HTTP ${s.status}`);
837
+ return;
838
+ }
839
+ const y = s.body.getReader(), J = new TextDecoder();
840
+ let L = "", Q = "";
841
+ for (; ; ) {
842
+ const { done: ae, value: de } = await y.read();
843
+ if (ae) break;
844
+ L += J.decode(de, { stream: !0 });
845
+ const ce = L.split(`
846
+ `);
847
+ L = ce.pop() || "";
848
+ for (const me of ce) {
849
+ const M = me.trim();
850
+ if (!M) {
851
+ Q = "";
852
+ continue;
853
+ }
854
+ if (!M.startsWith(":")) {
855
+ if (M.startsWith("event:")) {
856
+ Q = M.slice(6).trim();
857
+ continue;
858
+ }
859
+ if (M.startsWith("data:")) {
860
+ const ie = M.slice(5).trim();
861
+ if (Q === "done") {
862
+ Q = "";
863
+ continue;
864
+ }
865
+ if (ie.startsWith("[error]")) {
866
+ R(ie.slice(7).trim());
867
+ return;
868
+ }
869
+ G((he) => he + ie);
870
+ }
871
+ }
872
+ }
873
+ }
874
+ } catch (s) {
875
+ (s == null ? void 0 : s.name) !== "AbortError" && R(String((s == null ? void 0 : s.message) || s));
876
+ } finally {
877
+ E.current = null, K(!1), G(""), d != null && await x(d);
878
+ }
879
+ }, U = async (u, o) => {
880
+ try {
881
+ const s = await W.post(
882
+ `/product/${a}/chat/proposals/${u}/${o}`,
883
+ {}
884
+ ), y = s == null ? void 0 : s.data;
885
+ y != null && y.id && N((J) => J.map((L) => L.id === y.id ? y : L)), o === "accept" && n();
886
+ } catch (s) {
887
+ console.error(s), R("裁定失败,请重试");
888
+ }
889
+ }, Y = (u) => f.filter((o) => o.messageId === u);
890
+ return /* @__PURE__ */ i("div", { className: t.chatLayout, children: [
891
+ /* @__PURE__ */ i("div", { className: t.chatHeader, children: [
892
+ /* @__PURE__ */ i(
893
+ "select",
894
+ {
895
+ className: t.chatSessionSelect,
896
+ value: d ?? "",
897
+ onChange: (u) => l(u.target.value ? Number(u.target.value) : null),
898
+ children: [
899
+ h.length === 0 && /* @__PURE__ */ e("option", { value: "", children: "(暂无会话)" }),
900
+ h.map((u) => /* @__PURE__ */ e("option", { value: u.id, children: u.title }, u.id))
901
+ ]
902
+ }
903
+ ),
904
+ /* @__PURE__ */ e("button", { className: t.btn, onClick: V, children: "新会话" }),
905
+ /* @__PURE__ */ e(
906
+ "button",
907
+ {
908
+ className: t.btn,
909
+ onClick: te,
910
+ disabled: d == null,
911
+ children: "删除会话"
912
+ }
913
+ ),
914
+ /* @__PURE__ */ e("span", { className: t.chatHint, children: "AI 已自动装载产品蓝图与现状;聊出的结论会以提案卡交你裁定后落库" })
915
+ ] }),
916
+ /* @__PURE__ */ e("div", { className: t.chatBody, children: d == null ? /* @__PURE__ */ i("div", { className: t.chatEmpty, children: [
917
+ /* @__PURE__ */ e("p", { children: "新建产品后就可以开聊了。" }),
918
+ /* @__PURE__ */ e("p", { children: "把产品想成什么聊什么:愿景、用户、需求、设计,聊清楚的会沉淀下来。" }),
919
+ /* @__PURE__ */ e("button", { className: `${t.btn} ${t.btnPrimary}`, onClick: V, children: "开聊" })
920
+ ] }) : /* @__PURE__ */ i(be, { children: [
921
+ _.map(
922
+ (u) => u.role === "user" ? /* @__PURE__ */ e("div", { className: `${t.msgRow} ${t.msgRowUser}`, children: /* @__PURE__ */ e("div", { className: `${t.bubble} ${t.bubbleUser}`, children: u.content }) }, u.id) : /* @__PURE__ */ i("div", { className: t.msgRow, children: [
923
+ /* @__PURE__ */ e("div", { className: `${t.bubble} ${t.bubbleAssistant}`, children: ve(u.content) || "(本条为提案输出)" }),
924
+ Y(u.id).map((o) => /* @__PURE__ */ e(
925
+ Ga,
926
+ {
927
+ proposal: o,
928
+ onDecide: U
929
+ },
930
+ o.id
931
+ ))
932
+ ] }, u.id)
933
+ ),
934
+ $ && /* @__PURE__ */ e("div", { className: t.msgRow, children: /* @__PURE__ */ i("div", { className: `${t.bubble} ${t.bubbleAssistant}`, children: [
935
+ ve(w) || "…",
936
+ /* @__PURE__ */ e("span", { className: t.streamingCursor, children: "▍" })
937
+ ] }) }),
938
+ /* @__PURE__ */ e("div", { ref: S })
939
+ ] }) }),
940
+ A && /* @__PURE__ */ e("div", { className: t.chatError, children: A }),
941
+ /* @__PURE__ */ i("div", { className: t.chatInputRow, children: [
942
+ /* @__PURE__ */ e(
943
+ "textarea",
944
+ {
945
+ className: t.chatTextarea,
946
+ placeholder: d == null ? "先点「开聊」创建会话…" : "和 AI 聊这个产品…(Enter 发送,Shift+Enter 换行)",
947
+ value: v,
948
+ disabled: d == null || $,
949
+ onChange: (u) => P(u.target.value),
950
+ onKeyDown: (u) => {
951
+ u.key === "Enter" && !u.shiftKey && (u.preventDefault(), B());
952
+ }
953
+ }
954
+ ),
955
+ $ ? /* @__PURE__ */ e(
956
+ "button",
957
+ {
958
+ className: `${t.btn} ${t.btnDanger}`,
959
+ onClick: () => {
960
+ var u;
961
+ return (u = E.current) == null ? void 0 : u.abort();
962
+ },
963
+ children: "停止"
964
+ }
965
+ ) : /* @__PURE__ */ e(
966
+ "button",
967
+ {
968
+ className: `${t.btn} ${t.btnPrimary}`,
969
+ onClick: B,
970
+ disabled: !v.trim() || d == null,
971
+ children: "发送"
972
+ }
973
+ )
974
+ ] })
975
+ ] });
976
+ }
977
+ function Ga({
978
+ proposal: a,
979
+ onDecide: c
980
+ }) {
981
+ const n = qa(a.payload), h = Ma[a.proposalType] || a.proposalType, b = a.action === "CREATE";
982
+ return /* @__PURE__ */ i("div", { className: t.proposalCard, children: [
983
+ /* @__PURE__ */ i("div", { className: t.proposalHead, children: [
984
+ /* @__PURE__ */ e("span", { className: t.proposalBadge, children: b ? "新增" : "更新" }),
985
+ /* @__PURE__ */ e("span", { className: t.proposalType, children: h }),
986
+ a.status === "PENDING" && /* @__PURE__ */ i("span", { className: t.proposalActions, children: [
987
+ /* @__PURE__ */ e(
988
+ "button",
989
+ {
990
+ className: `${t.btn} ${t.btnPrimary}`,
991
+ onClick: () => c(a.id, "accept"),
992
+ children: "采纳"
993
+ }
994
+ ),
995
+ /* @__PURE__ */ e(
996
+ "button",
997
+ {
998
+ className: t.btn,
999
+ onClick: () => c(a.id, "reject"),
1000
+ children: "驳回"
1001
+ }
1002
+ )
1003
+ ] }),
1004
+ a.status === "ACCEPTED" && /* @__PURE__ */ i("span", { className: t.proposalAccepted, children: [
1005
+ "已落库 ",
1006
+ a.appliedRef || ""
1007
+ ] }),
1008
+ a.status === "REJECTED" && /* @__PURE__ */ e("span", { className: t.proposalRejected, children: "已驳回" })
1009
+ ] }),
1010
+ /* @__PURE__ */ e("div", { className: t.proposalPreview, children: Fa(a.proposalType, n) || "(空提案)" })
1011
+ ] });
1012
+ }
1013
+ const C = _e.create({ baseURL: "/api", timeout: 15e3 });
1014
+ C.interceptors.response.use(
1015
+ (a) => a.data,
1016
+ (a) => (console.error("[ProductWorkbench] request failed", a), Promise.reject(a))
1017
+ );
1018
+ function si() {
1019
+ const [a, c] = p([]), [n, h] = p(null), [b, d] = p(!1), [l, _] = p("chat"), [r, f] = p([]), [N, v] = p([]), [P, $] = p([]), [K, w] = p([]), [G, A] = p(!1), [R, E] = p(!1), [S, T] = p(!1), x = re(async () => {
1020
+ d(!0);
1021
+ try {
1022
+ const o = await C.get("/product/list"), s = (o == null ? void 0 : o.data) || [];
1023
+ c(s), s.length > 0 && !n && h(s[0]);
1024
+ } catch (o) {
1025
+ console.error(o);
1026
+ } finally {
1027
+ d(!1);
1028
+ }
1029
+ }, [n]);
1030
+ F(() => {
1031
+ x();
1032
+ }, [x]), F(() => {
1033
+ if (!n) return;
1034
+ const o = n.productCode;
1035
+ l === "design" ? C.get(`/product/${o}/design/list`).then((s) => f((s == null ? void 0 : s.data) || [])).catch(() => f([])) : l === "requirement" ? C.get(`/product/${o}/requirement/list`).then((s) => v((s == null ? void 0 : s.data) || [])).catch(() => v([])) : l === "feature" ? C.get(`/product/${o}/feature/list`).then((s) => $((s == null ? void 0 : s.data) || [])).catch(() => $([])) : l === "biz-understanding" && C.get("/product/biz-understanding/list", { params: { productCode: o } }).then((s) => w((s == null ? void 0 : s.data) || [])).catch(() => w([]));
1036
+ }, [n, l]);
1037
+ const V = async (o) => {
1038
+ try {
1039
+ const s = await C.post("/product", o), y = s == null ? void 0 : s.data;
1040
+ await x(), h(y), A(!1);
1041
+ } catch (s) {
1042
+ console.error(s);
1043
+ }
1044
+ }, te = async (o) => {
1045
+ if (n)
1046
+ try {
1047
+ await C.put(`/product/${n.productCode}`, o), await x();
1048
+ } catch (s) {
1049
+ console.error(s);
1050
+ }
1051
+ }, B = async (o) => {
1052
+ if (n)
1053
+ try {
1054
+ await C.post(`/product/${n.productCode}/design`, o), E(!1);
1055
+ const s = await C.get(`/product/${n.productCode}/design/list`);
1056
+ f((s == null ? void 0 : s.data) || []);
1057
+ } catch (s) {
1058
+ console.error(s);
1059
+ }
1060
+ }, U = async (o) => {
1061
+ if (n)
1062
+ try {
1063
+ await C.post(`/product/${n.productCode}/requirement`, o), T(!1);
1064
+ const s = await C.get(`/product/${n.productCode}/requirement/list`);
1065
+ v((s == null ? void 0 : s.data) || []);
1066
+ } catch (s) {
1067
+ console.error(s);
1068
+ }
1069
+ }, Y = async (o) => {
1070
+ if (n && confirm("确认删除该需求?"))
1071
+ try {
1072
+ await C.delete(`/product/${n.productCode}/requirement/${o}`);
1073
+ const s = await C.get(`/product/${n.productCode}/requirement/list`);
1074
+ v((s == null ? void 0 : s.data) || []);
1075
+ } catch (s) {
1076
+ console.error(s);
1077
+ }
1078
+ }, u = async () => {
1079
+ if (n)
1080
+ try {
1081
+ await C.post(`/product/${n.productCode}/feature/decompose`);
1082
+ const o = await C.get(`/product/${n.productCode}/feature/list`);
1083
+ $((o == null ? void 0 : o.data) || []), alert("功能拆分完成");
1084
+ } catch (o) {
1085
+ console.error(o);
1086
+ }
1087
+ };
1088
+ return b ? /* @__PURE__ */ e("div", { className: t.spinner, children: "加载中..." }) : /* @__PURE__ */ i("div", { className: t.container, children: [
1089
+ /* @__PURE__ */ i("aside", { className: t.sidebar, children: [
1090
+ /* @__PURE__ */ e("div", { className: t.sidebarHeader, children: /* @__PURE__ */ i(
1091
+ "button",
1092
+ {
1093
+ className: `${t.btn} ${t.btnPrimary}`,
1094
+ onClick: () => A(!0),
1095
+ title: "新建产品",
1096
+ children: [
1097
+ /* @__PURE__ */ e(j, {}),
1098
+ " 新建"
1099
+ ]
1100
+ }
1101
+ ) }),
1102
+ /* @__PURE__ */ e("div", { className: t.productList, children: a.length === 0 ? /* @__PURE__ */ e("div", { className: t.emptyHint, children: '暂无产品,点击"新建"开始' }) : a.map((o) => /* @__PURE__ */ i(
1103
+ "div",
1104
+ {
1105
+ className: `${t.productItem} ${(n == null ? void 0 : n.productCode) === o.productCode ? t.productItemActive : ""}`,
1106
+ onClick: () => h(o),
1107
+ children: [
1108
+ /* @__PURE__ */ e("div", { className: t.productItemName, children: o.name }),
1109
+ /* @__PURE__ */ e("div", { className: t.productItemCode, children: o.productCode }),
1110
+ /* @__PURE__ */ e("span", { className: t.productItemStatus, children: o.status })
1111
+ ]
1112
+ },
1113
+ o.productCode
1114
+ )) })
1115
+ ] }),
1116
+ /* @__PURE__ */ e("main", { className: t.main, children: n ? /* @__PURE__ */ i(be, { children: [
1117
+ /* @__PURE__ */ i("div", { className: t.productHeader, children: [
1118
+ /* @__PURE__ */ i("div", { children: [
1119
+ /* @__PURE__ */ e("span", { className: t.productTitle, children: n.name }),
1120
+ /* @__PURE__ */ e("span", { className: t.productCode, children: n.productCode })
1121
+ ] }),
1122
+ /* @__PURE__ */ e("span", { className: t.status, children: n.status })
1123
+ ] }),
1124
+ /* @__PURE__ */ i("div", { className: t.tabBar, children: [
1125
+ /* @__PURE__ */ e(
1126
+ "div",
1127
+ {
1128
+ className: `${t.tab} ${l === "chat" ? t.tabActive : ""}`,
1129
+ onClick: () => _("chat"),
1130
+ title: "产品在对话中生长:聊出的结论经你裁定后落为正式产物",
1131
+ children: "对话"
1132
+ }
1133
+ ),
1134
+ /* @__PURE__ */ e(
1135
+ "div",
1136
+ {
1137
+ className: `${t.tab} ${l === "description" ? t.tabActive : ""}`,
1138
+ onClick: () => _("description"),
1139
+ children: "产品描述"
1140
+ }
1141
+ ),
1142
+ /* @__PURE__ */ e(
1143
+ "div",
1144
+ {
1145
+ className: `${t.tab} ${l === "design" ? t.tabActive : ""}`,
1146
+ onClick: () => _("design"),
1147
+ children: "设计稿"
1148
+ }
1149
+ ),
1150
+ /* @__PURE__ */ e(
1151
+ "div",
1152
+ {
1153
+ className: `${t.tab} ${l === "requirement" ? t.tabActive : ""}`,
1154
+ onClick: () => _("requirement"),
1155
+ children: "业务需求"
1156
+ }
1157
+ ),
1158
+ /* @__PURE__ */ e(
1159
+ "div",
1160
+ {
1161
+ className: `${t.tab} ${l === "feature" ? t.tabActive : ""}`,
1162
+ onClick: () => _("feature"),
1163
+ children: "功能拆分"
1164
+ }
1165
+ ),
1166
+ /* @__PURE__ */ i(
1167
+ "div",
1168
+ {
1169
+ className: `${t.tab} ${l === "biz-understanding" ? t.tabActive : ""}`,
1170
+ onClick: () => _("biz-understanding"),
1171
+ title: "跨页面因果链稿件库 — 一份稿件 = 一个跨页面动作的连锁变化",
1172
+ children: [
1173
+ "业务理解 ",
1174
+ /* @__PURE__ */ e(se, { style: { marginLeft: 4, fontSize: 12 } })
1175
+ ]
1176
+ }
1177
+ ),
1178
+ /* @__PURE__ */ e(
1179
+ "div",
1180
+ {
1181
+ className: `${t.tab} ${l === "manuscript" ? t.tabActive : ""}`,
1182
+ onClick: () => _("manuscript"),
1183
+ title: "产品稿件 (case) × 设计稿件 (UI) 双向高亮",
1184
+ children: "稿件编辑器"
1185
+ }
1186
+ )
1187
+ ] }),
1188
+ /* @__PURE__ */ i("div", { className: t.tabContent, children: [
1189
+ l === "chat" && /* @__PURE__ */ e(
1190
+ ja,
1191
+ {
1192
+ productCode: n.productCode,
1193
+ productName: n.name,
1194
+ onArtifactChanged: () => {
1195
+ x();
1196
+ }
1197
+ }
1198
+ ),
1199
+ l === "description" && /* @__PURE__ */ e(Va, { product: n, onSave: te }),
1200
+ l === "design" && /* @__PURE__ */ e(
1201
+ Ja,
1202
+ {
1203
+ designs: r,
1204
+ onAdd: () => E(!0),
1205
+ onDelete: async (o) => {
1206
+ if (!confirm("确认删除该设计稿?")) return;
1207
+ await C.delete(
1208
+ `/product/${n.productCode}/design/${o}`
1209
+ );
1210
+ const s = await C.get(
1211
+ `/product/${n.productCode}/design/list`
1212
+ );
1213
+ f((s == null ? void 0 : s.data) || []);
1214
+ }
1215
+ }
1216
+ ),
1217
+ l === "requirement" && /* @__PURE__ */ e(
1218
+ Wa,
1219
+ {
1220
+ requirements: N,
1221
+ onAdd: () => T(!0),
1222
+ onDelete: Y
1223
+ }
1224
+ ),
1225
+ l === "feature" && /* @__PURE__ */ e(Xa, { features: P, onDecompose: u }),
1226
+ l === "biz-understanding" && /* @__PURE__ */ e(Za, { items: K }),
1227
+ l === "manuscript" && n && /* @__PURE__ */ e(
1228
+ Ve,
1229
+ {
1230
+ productCode: n.productCode,
1231
+ pageCode: "ctc.4a.org"
1232
+ }
1233
+ )
1234
+ ] })
1235
+ ] }) : /* @__PURE__ */ e("div", { className: t.spinner, children: /* @__PURE__ */ i("div", { children: [
1236
+ /* @__PURE__ */ e("p", { children: "暂无产品" }),
1237
+ /* @__PURE__ */ i(
1238
+ "button",
1239
+ {
1240
+ className: `${t.btn} ${t.btnPrimary}`,
1241
+ onClick: () => A(!0),
1242
+ children: [
1243
+ /* @__PURE__ */ e(j, {}),
1244
+ " 创建第一个产品"
1245
+ ]
1246
+ }
1247
+ )
1248
+ ] }) }) }),
1249
+ G && /* @__PURE__ */ e(
1250
+ Ka,
1251
+ {
1252
+ onCancel: () => A(!1),
1253
+ onSubmit: V
1254
+ }
1255
+ ),
1256
+ R && /* @__PURE__ */ e(
1257
+ Ya,
1258
+ {
1259
+ onCancel: () => E(!1),
1260
+ onSubmit: B
1261
+ }
1262
+ ),
1263
+ S && /* @__PURE__ */ e(
1264
+ Qa,
1265
+ {
1266
+ onCancel: () => T(!1),
1267
+ onSubmit: U
1268
+ }
1269
+ )
1270
+ ] });
1271
+ }
1272
+ function Va({
1273
+ product: a,
1274
+ onSave: c
1275
+ }) {
1276
+ const [n, h] = p(a.name), [b, d] = p(a.vision || ""), [l, _] = p(a.targetUsers || ""), [r, f] = p(a.description || "");
1277
+ return F(() => {
1278
+ h(a.name), d(a.vision || ""), _(a.targetUsers || ""), f(a.description || "");
1279
+ }, [a]), /* @__PURE__ */ i("div", { className: t.formGroup, children: [
1280
+ /* @__PURE__ */ e("label", { className: t.formLabel, children: "产品名称" }),
1281
+ /* @__PURE__ */ e(
1282
+ "input",
1283
+ {
1284
+ className: t.formInput,
1285
+ value: n,
1286
+ onChange: (N) => h(N.target.value)
1287
+ }
1288
+ ),
1289
+ /* @__PURE__ */ e("label", { className: t.formLabel, children: "产品愿景" }),
1290
+ /* @__PURE__ */ e(
1291
+ "textarea",
1292
+ {
1293
+ className: t.formTextarea,
1294
+ value: b,
1295
+ onChange: (N) => d(N.target.value),
1296
+ placeholder: "描述这个产品要解决什么问题..."
1297
+ }
1298
+ ),
1299
+ /* @__PURE__ */ e("label", { className: t.formLabel, children: "目标用户" }),
1300
+ /* @__PURE__ */ e(
1301
+ "textarea",
1302
+ {
1303
+ className: t.formTextarea,
1304
+ value: l,
1305
+ onChange: (N) => _(N.target.value),
1306
+ placeholder: "谁会用这个产品..."
1307
+ }
1308
+ ),
1309
+ /* @__PURE__ */ e("label", { className: t.formLabel, children: "业务描述 (Markdown)" }),
1310
+ /* @__PURE__ */ e(
1311
+ "textarea",
1312
+ {
1313
+ className: t.formTextarea,
1314
+ style: { minHeight: 200 },
1315
+ value: r,
1316
+ onChange: (N) => f(N.target.value),
1317
+ placeholder: `## 核心场景
1318
+ ## 用户故事
1319
+ ## 业务规则`
1320
+ }
1321
+ ),
1322
+ /* @__PURE__ */ e(
1323
+ "button",
1324
+ {
1325
+ className: `${t.btn} ${t.btnPrimary}`,
1326
+ onClick: () => c({ name: n, vision: b, targetUsers: l, description: r }),
1327
+ children: "保存"
1328
+ }
1329
+ )
1330
+ ] });
1331
+ }
1332
+ function Ja({
1333
+ designs: a,
1334
+ onAdd: c,
1335
+ onDelete: n
1336
+ }) {
1337
+ return /* @__PURE__ */ i("div", { children: [
1338
+ /* @__PURE__ */ i("div", { className: t.toolbar, children: [
1339
+ /* @__PURE__ */ i("h3", { style: { margin: 0, fontSize: 14 }, children: [
1340
+ "设计稿 (",
1341
+ a.length,
1342
+ ")"
1343
+ ] }),
1344
+ /* @__PURE__ */ i("button", { className: `${t.btn} ${t.btnPrimary}`, onClick: c, children: [
1345
+ /* @__PURE__ */ e(j, {}),
1346
+ " 添加设计稿"
1347
+ ] })
1348
+ ] }),
1349
+ a.length === 0 ? /* @__PURE__ */ e("div", { className: t.empty, children: '暂无设计稿,点击"添加设计稿"录入' }) : /* @__PURE__ */ e("div", { className: t.designGrid, children: a.map((h) => /* @__PURE__ */ i("div", { className: t.designCard, children: [
1350
+ h.fileUrl && /\.(jpg|jpeg|png|gif|webp|svg)$/i.test(h.fileUrl) ? /* @__PURE__ */ e("img", { className: t.designImage, src: h.fileUrl, alt: h.name }) : /* @__PURE__ */ i(
1351
+ "a",
1352
+ {
1353
+ className: t.designLink,
1354
+ href: h.fileUrl,
1355
+ target: "_blank",
1356
+ rel: "noreferrer",
1357
+ children: [
1358
+ /* @__PURE__ */ e(De, { style: { fontSize: 24, marginRight: 6 } }),
1359
+ "外链预览"
1360
+ ]
1361
+ }
1362
+ ),
1363
+ /* @__PURE__ */ i("div", { className: t.designInfo, children: [
1364
+ /* @__PURE__ */ e("div", { className: t.designName, children: h.name || "(未命名)" }),
1365
+ /* @__PURE__ */ e("div", { className: t.designDesc, children: h.description || h.fileUrl })
1366
+ ] }),
1367
+ /* @__PURE__ */ e("div", { className: t.designActions, children: /* @__PURE__ */ i(
1368
+ "button",
1369
+ {
1370
+ className: `${t.btn} ${t.btnDanger}`,
1371
+ onClick: () => n(h.id),
1372
+ children: [
1373
+ /* @__PURE__ */ e(ge, {}),
1374
+ " 删除"
1375
+ ]
1376
+ }
1377
+ ) })
1378
+ ] }, h.id)) })
1379
+ ] });
1380
+ }
1381
+ function Wa({
1382
+ requirements: a,
1383
+ onAdd: c,
1384
+ onDelete: n
1385
+ }) {
1386
+ const h = (d) => d === "P0" ? t.priorityP0 : d === "P1" ? t.priorityP1 : d === "P2" ? t.priorityP2 : t.priorityP3, b = (d) => d === "IN_PROGRESS" ? t.statusActive : d === "DONE" ? t.statusDone : "";
1387
+ return /* @__PURE__ */ i("div", { children: [
1388
+ /* @__PURE__ */ i("div", { className: t.toolbar, children: [
1389
+ /* @__PURE__ */ i("h3", { style: { margin: 0, fontSize: 14 }, children: [
1390
+ "业务需求 (",
1391
+ a.length,
1392
+ ")"
1393
+ ] }),
1394
+ /* @__PURE__ */ i("button", { className: `${t.btn} ${t.btnPrimary}`, onClick: c, children: [
1395
+ /* @__PURE__ */ e(j, {}),
1396
+ " 新增需求"
1397
+ ] })
1398
+ ] }),
1399
+ a.length === 0 ? /* @__PURE__ */ e("div", { className: t.empty, children: "暂无需求,先录入需求后即可一键拆分" }) : /* @__PURE__ */ i("table", { className: t.table, children: [
1400
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ i("tr", { children: [
1401
+ /* @__PURE__ */ e("th", { style: { width: 80 }, children: "优先级" }),
1402
+ /* @__PURE__ */ e("th", { children: "标题" }),
1403
+ /* @__PURE__ */ e("th", { children: "描述" }),
1404
+ /* @__PURE__ */ e("th", { style: { width: 100 }, children: "状态" }),
1405
+ /* @__PURE__ */ e("th", { style: { width: 100 }, children: "操作" })
1406
+ ] }) }),
1407
+ /* @__PURE__ */ e("tbody", { children: a.map((d) => /* @__PURE__ */ i("tr", { children: [
1408
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: `${t.priority} ${h(d.priority)}`, children: d.priority }) }),
1409
+ /* @__PURE__ */ e("td", { children: d.title }),
1410
+ /* @__PURE__ */ e("td", { style: { color: "var(--text-tertiary, #999)" }, children: d.description }),
1411
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: `${t.status} ${b(d.status)}`, children: d.status }) }),
1412
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
1413
+ "button",
1414
+ {
1415
+ className: `${t.btn} ${t.btnDanger}`,
1416
+ onClick: () => n(d.id),
1417
+ children: /* @__PURE__ */ e(ge, {})
1418
+ }
1419
+ ) })
1420
+ ] }, d.id)) })
1421
+ ] })
1422
+ ] });
1423
+ }
1424
+ function Xa({
1425
+ features: a,
1426
+ onDecompose: c
1427
+ }) {
1428
+ return /* @__PURE__ */ i("div", { children: [
1429
+ /* @__PURE__ */ i("div", { className: t.toolbar, children: [
1430
+ /* @__PURE__ */ i("h3", { style: { margin: 0, fontSize: 14 }, children: [
1431
+ "功能拆分 (",
1432
+ a.length,
1433
+ ")"
1434
+ ] }),
1435
+ /* @__PURE__ */ i(
1436
+ "button",
1437
+ {
1438
+ className: `${t.btn} ${t.btnPrimary}`,
1439
+ onClick: c,
1440
+ title: "根据业务需求自动生成 FEATURE-XXX",
1441
+ children: [
1442
+ /* @__PURE__ */ e(se, {}),
1443
+ " 一键拆分"
1444
+ ]
1445
+ }
1446
+ )
1447
+ ] }),
1448
+ a.length === 0 ? /* @__PURE__ */ e("div", { className: t.empty, children: '暂无功能,先在"业务需求"录入需求,再点击"一键拆分"' }) : /* @__PURE__ */ i("table", { className: t.table, children: [
1449
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ i("tr", { children: [
1450
+ /* @__PURE__ */ e("th", { style: { width: 120 }, children: "编号" }),
1451
+ /* @__PURE__ */ e("th", { children: "名称" }),
1452
+ /* @__PURE__ */ e("th", { children: "描述" }),
1453
+ /* @__PURE__ */ e("th", { style: { width: 100 }, children: "状态" }),
1454
+ /* @__PURE__ */ e("th", { style: { width: 220 }, children: "文档路径" })
1455
+ ] }) }),
1456
+ /* @__PURE__ */ e("tbody", { children: a.map((n) => /* @__PURE__ */ i("tr", { children: [
1457
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: t.featureNo, children: n.featureNo }) }),
1458
+ /* @__PURE__ */ e("td", { children: n.name }),
1459
+ /* @__PURE__ */ e("td", { style: { color: "var(--text-tertiary, #999)" }, children: n.description }),
1460
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: t.status, children: n.status }) }),
1461
+ /* @__PURE__ */ e("td", { style: { fontSize: 11, color: "var(--text-tertiary, #999)" }, children: n.docPath })
1462
+ ] }, n.id)) })
1463
+ ] })
1464
+ ] });
1465
+ }
1466
+ function Ka({
1467
+ onCancel: a,
1468
+ onSubmit: c
1469
+ }) {
1470
+ const [n, h] = p(""), [b, d] = p("");
1471
+ return /* @__PURE__ */ e("div", { className: t.modal, children: /* @__PURE__ */ i("div", { className: t.modalBody, children: [
1472
+ /* @__PURE__ */ e("div", { className: t.modalTitle, children: "新建产品" }),
1473
+ /* @__PURE__ */ e("label", { className: t.formLabel, children: "产品名称 *" }),
1474
+ /* @__PURE__ */ e(
1475
+ "input",
1476
+ {
1477
+ className: t.formInput,
1478
+ value: n,
1479
+ onChange: (l) => h(l.target.value),
1480
+ placeholder: "例如:智能客服平台"
1481
+ }
1482
+ ),
1483
+ /* @__PURE__ */ e("label", { className: t.formLabel, children: "产品愿景" }),
1484
+ /* @__PURE__ */ e(
1485
+ "textarea",
1486
+ {
1487
+ className: t.formTextarea,
1488
+ value: b,
1489
+ onChange: (l) => d(l.target.value),
1490
+ placeholder: "简要描述愿景..."
1491
+ }
1492
+ ),
1493
+ /* @__PURE__ */ i("div", { className: t.modalActions, children: [
1494
+ /* @__PURE__ */ e("button", { className: t.btn, onClick: a, children: "取消" }),
1495
+ /* @__PURE__ */ i(
1496
+ "button",
1497
+ {
1498
+ className: `${t.btn} ${t.btnPrimary}`,
1499
+ onClick: () => n && c({ name: n, vision: b, status: "DRAFT" }),
1500
+ disabled: !n,
1501
+ children: [
1502
+ /* @__PURE__ */ e(j, {}),
1503
+ " 创建"
1504
+ ]
1505
+ }
1506
+ )
1507
+ ] })
1508
+ ] }) });
1509
+ }
1510
+ function Ya({
1511
+ onCancel: a,
1512
+ onSubmit: c
1513
+ }) {
1514
+ const [n, h] = p(""), [b, d] = p(""), [l, _] = p("");
1515
+ return /* @__PURE__ */ e("div", { className: t.modal, children: /* @__PURE__ */ i("div", { className: t.modalBody, children: [
1516
+ /* @__PURE__ */ e("div", { className: t.modalTitle, children: "添加设计稿" }),
1517
+ /* @__PURE__ */ e("label", { className: t.formLabel, children: "名称" }),
1518
+ /* @__PURE__ */ e(
1519
+ "input",
1520
+ {
1521
+ className: t.formInput,
1522
+ value: n,
1523
+ onChange: (r) => h(r.target.value),
1524
+ placeholder: "首页 / 登录页 / 后台..."
1525
+ }
1526
+ ),
1527
+ /* @__PURE__ */ e("label", { className: t.formLabel, children: "URL 或图片地址 *" }),
1528
+ /* @__PURE__ */ e(
1529
+ "input",
1530
+ {
1531
+ className: t.formInput,
1532
+ value: b,
1533
+ onChange: (r) => d(r.target.value),
1534
+ placeholder: "https://... 或 Figma link"
1535
+ }
1536
+ ),
1537
+ /* @__PURE__ */ e("label", { className: t.formLabel, children: "说明" }),
1538
+ /* @__PURE__ */ e(
1539
+ "textarea",
1540
+ {
1541
+ className: t.formTextarea,
1542
+ value: l,
1543
+ onChange: (r) => _(r.target.value)
1544
+ }
1545
+ ),
1546
+ /* @__PURE__ */ i("div", { className: t.modalActions, children: [
1547
+ /* @__PURE__ */ e("button", { className: t.btn, onClick: a, children: "取消" }),
1548
+ /* @__PURE__ */ i(
1549
+ "button",
1550
+ {
1551
+ className: `${t.btn} ${t.btnPrimary}`,
1552
+ onClick: () => b && c({ name: n, fileUrl: b, description: l, assetType: "IMAGE" }),
1553
+ disabled: !b,
1554
+ children: [
1555
+ /* @__PURE__ */ e(j, {}),
1556
+ " 添加"
1557
+ ]
1558
+ }
1559
+ )
1560
+ ] })
1561
+ ] }) });
1562
+ }
1563
+ function Qa({
1564
+ onCancel: a,
1565
+ onSubmit: c
1566
+ }) {
1567
+ const [n, h] = p(""), [b, d] = p(""), [l, _] = p("P1");
1568
+ return /* @__PURE__ */ e("div", { className: t.modal, children: /* @__PURE__ */ i("div", { className: t.modalBody, children: [
1569
+ /* @__PURE__ */ e("div", { className: t.modalTitle, children: "新增业务需求" }),
1570
+ /* @__PURE__ */ e("label", { className: t.formLabel, children: "标题 *" }),
1571
+ /* @__PURE__ */ e(
1572
+ "input",
1573
+ {
1574
+ className: t.formInput,
1575
+ value: n,
1576
+ onChange: (r) => h(r.target.value),
1577
+ placeholder: "例如:支持用户拖拽上传设计稿"
1578
+ }
1579
+ ),
1580
+ /* @__PURE__ */ e("label", { className: t.formLabel, children: "描述" }),
1581
+ /* @__PURE__ */ e(
1582
+ "textarea",
1583
+ {
1584
+ className: t.formTextarea,
1585
+ value: b,
1586
+ onChange: (r) => d(r.target.value)
1587
+ }
1588
+ ),
1589
+ /* @__PURE__ */ e("label", { className: t.formLabel, children: "优先级" }),
1590
+ /* @__PURE__ */ i(
1591
+ "select",
1592
+ {
1593
+ className: t.formInput,
1594
+ value: l,
1595
+ onChange: (r) => _(r.target.value),
1596
+ children: [
1597
+ /* @__PURE__ */ e("option", { value: "P0", children: "P0 - 紧急" }),
1598
+ /* @__PURE__ */ e("option", { value: "P1", children: "P1 - 重要" }),
1599
+ /* @__PURE__ */ e("option", { value: "P2", children: "P2 - 一般" }),
1600
+ /* @__PURE__ */ e("option", { value: "P3", children: "P3 - 低" })
1601
+ ]
1602
+ }
1603
+ ),
1604
+ /* @__PURE__ */ i("div", { className: t.modalActions, children: [
1605
+ /* @__PURE__ */ e("button", { className: t.btn, onClick: a, children: "取消" }),
1606
+ /* @__PURE__ */ i(
1607
+ "button",
1608
+ {
1609
+ className: `${t.btn} ${t.btnPrimary}`,
1610
+ onClick: () => n && c({ title: n, description: b, priority: l }),
1611
+ disabled: !n,
1612
+ children: [
1613
+ /* @__PURE__ */ e(j, {}),
1614
+ " 添加"
1615
+ ]
1616
+ }
1617
+ )
1618
+ ] })
1619
+ ] }) });
1620
+ }
1621
+ function Za({ items: a }) {
1622
+ const [c, n] = p(null), [h, b] = p(""), d = (r, f) => {
1623
+ if (!r) return f;
1624
+ try {
1625
+ return JSON.parse(r);
1626
+ } catch {
1627
+ return f;
1628
+ }
1629
+ }, l = h.trim() ? a.filter((r) => d(r.impactedPages, []).some((N) => N.includes(h.trim()))) : a, _ = (r) => r === "P0" ? t.priorityP0 : r === "P1" ? t.priorityP1 : t.priorityP2;
1630
+ return l.length > 0 && (!c || !l.find((r) => r.id === c.id)) && n(l[0]), /* @__PURE__ */ i("div", { className: t.bizLayout, children: [
1631
+ /* @__PURE__ */ i("div", { className: t.bizList, children: [
1632
+ /* @__PURE__ */ i("div", { className: t.bizFilter, children: [
1633
+ /* @__PURE__ */ e(
1634
+ "input",
1635
+ {
1636
+ className: t.formInput,
1637
+ placeholder: "反向追溯: 输入页面编码 (如 ctc.4a.account)",
1638
+ value: h,
1639
+ onChange: (r) => b(r.target.value)
1640
+ }
1641
+ ),
1642
+ h && /* @__PURE__ */ i("span", { className: t.bizFilterHint, children: [
1643
+ l.length,
1644
+ " 篇稿件涉及该页面"
1645
+ ] })
1646
+ ] }),
1647
+ /* @__PURE__ */ i("div", { className: t.bizListHeader, children: [
1648
+ "业务理解 / 跨页面因果链 (",
1649
+ l.length,
1650
+ ")"
1651
+ ] }),
1652
+ l.length === 0 ? /* @__PURE__ */ e("div", { className: t.empty, children: h ? `没有稿件涉及「${h}」` : "暂无稿件, 请先在 DBA 层跑建表 SQL + 种子数据" }) : l.map((r) => {
1653
+ var N;
1654
+ const f = d(r.impactedPages, []);
1655
+ return /* @__PURE__ */ i(
1656
+ "div",
1657
+ {
1658
+ className: `${t.bizItem} ${(c == null ? void 0 : c.id) === r.id ? t.bizItemActive : ""}`,
1659
+ onClick: () => n(r),
1660
+ children: [
1661
+ /* @__PURE__ */ i("div", { className: t.bizItemHeader, children: [
1662
+ /* @__PURE__ */ e("span", { className: `${t.priority} ${_(r.priority)}`, children: r.priority }),
1663
+ /* @__PURE__ */ e("span", { className: t.bizItemTitle, children: r.title }),
1664
+ /* @__PURE__ */ e("span", { className: t.bizItemStatus, children: r.status })
1665
+ ] }),
1666
+ /* @__PURE__ */ e("div", { className: t.bizItemSummary, children: r.summary }),
1667
+ /* @__PURE__ */ i("div", { className: t.bizItemMeta, children: [
1668
+ "触发: ",
1669
+ ((N = d(r.triggerInfo, {})) == null ? void 0 : N.page) || "-",
1670
+ /* @__PURE__ */ e("span", { className: t.bizItemDot, children: "•" }),
1671
+ "影响 ",
1672
+ f.length,
1673
+ " 个页面"
1674
+ ] })
1675
+ ]
1676
+ },
1677
+ r.id
1678
+ );
1679
+ })
1680
+ ] }),
1681
+ /* @__PURE__ */ e("div", { className: t.bizDetail, children: c ? /* @__PURE__ */ i(be, { children: [
1682
+ /* @__PURE__ */ i("div", { className: t.bizDetailHeader, children: [
1683
+ /* @__PURE__ */ e("div", { className: t.bizDetailTitle, children: c.title }),
1684
+ /* @__PURE__ */ e("div", { className: t.bizDetailCode, children: c.bizCode })
1685
+ ] }),
1686
+ /* @__PURE__ */ i("div", { className: t.bizSection, children: [
1687
+ /* @__PURE__ */ i("div", { className: t.bizSectionTitle, children: [
1688
+ /* @__PURE__ */ e(se, {}),
1689
+ " 触发信息"
1690
+ ] }),
1691
+ (() => {
1692
+ const r = d(c.triggerInfo, {});
1693
+ return /* @__PURE__ */ i("div", { className: t.bizTriggerCard, children: [
1694
+ /* @__PURE__ */ i("div", { children: [
1695
+ /* @__PURE__ */ e("b", { children: "页面:" }),
1696
+ " ",
1697
+ r.page || "-"
1698
+ ] }),
1699
+ /* @__PURE__ */ i("div", { children: [
1700
+ /* @__PURE__ */ e("b", { children: "动作:" }),
1701
+ " ",
1702
+ r.action || "-"
1703
+ ] }),
1704
+ /* @__PURE__ */ i("div", { children: [
1705
+ /* @__PURE__ */ e("b", { children: "元素:" }),
1706
+ " ",
1707
+ r.element || "-"
1708
+ ] }),
1709
+ r.preStates && r.preStates.length > 0 && /* @__PURE__ */ i("div", { children: [
1710
+ /* @__PURE__ */ e("b", { children: "前置:" }),
1711
+ " ",
1712
+ r.preStates.join(" / ")
1713
+ ] })
1714
+ ] });
1715
+ })()
1716
+ ] }),
1717
+ /* @__PURE__ */ i("div", { className: t.bizSection, children: [
1718
+ /* @__PURE__ */ i("div", { className: t.bizSectionTitle, children: [
1719
+ "⚡ 跨页面连带效应 (",
1720
+ d(c.crossPageEffects, []).length,
1721
+ ")"
1722
+ ] }),
1723
+ /* @__PURE__ */ e("div", { className: t.bizEffects, children: d(c.crossPageEffects, []).map((r, f) => /* @__PURE__ */ i("div", { className: t.bizEffectCard, children: [
1724
+ /* @__PURE__ */ i("div", { className: t.bizEffectPage, children: [
1725
+ /* @__PURE__ */ e("span", { className: t.bizEffectArrow, children: "→" }),
1726
+ /* @__PURE__ */ e("span", { className: t.bizEffectPageCode, children: r.page }),
1727
+ /* @__PURE__ */ e("span", { className: t.bizEffectDelay, children: r.delay })
1728
+ ] }),
1729
+ /* @__PURE__ */ i("div", { className: t.bizEffectType, children: [
1730
+ "[",
1731
+ r.effectType,
1732
+ "]"
1733
+ ] }),
1734
+ /* @__PURE__ */ e("div", { className: t.bizEffectDesc, children: r.description })
1735
+ ] }, f)) })
1736
+ ] }),
1737
+ c.story && /* @__PURE__ */ i("div", { className: t.bizSection, children: [
1738
+ /* @__PURE__ */ e("div", { className: t.bizSectionTitle, children: "📖 故事正文" }),
1739
+ /* @__PURE__ */ e("pre", { className: t.bizStory, children: c.story })
1740
+ ] })
1741
+ ] }) : /* @__PURE__ */ e("div", { className: t.empty, children: "从左侧选择一份稿件查看因果链详情" }) })
1742
+ ] });
1743
+ }
1744
+ export {
1745
+ si as default
1746
+ };