@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
@@ -1,1408 +0,0 @@
1
- import { jsx as e, jsxs as a, Fragment as ce } from "react/jsx-runtime";
2
- import { ThunderboltOutlined as G, UpOutlined as ze, DownOutlined as Ce, LinkOutlined as ke, CopyOutlined as Ie, EditOutlined as Pe, DeleteOutlined as ne, BranchesOutlined as Te, HistoryOutlined as Se, ReloadOutlined as $e, PlusOutlined as H, FileImageOutlined as we } from "@ant-design/icons";
3
- import { useState as h, useEffect as V, useCallback as le, useMemo as q } from "react";
4
- import oe from "axios";
5
- import { Empty as W, Modal as O, Select as L, Input as F, Form as I, Col as M, Row as ae, Space as X, Dropdown as Ae, Popconfirm as de, Tag as $, Descriptions as Ee, Card as De, Table as xe, Tree as Le, Button as w, Tooltip as He, Spin as Oe } from "antd";
6
- const Re = {
7
- PageHeader: ({ title: i, subtitle: s }) => /* @__PURE__ */ a("div", { style: { marginBottom: 12 }, children: [
8
- /* @__PURE__ */ e("h2", { style: { margin: 0 }, children: i }),
9
- s && /* @__PURE__ */ e("p", { style: { color: "#666", margin: "4px 0 0", fontSize: 13 }, children: s })
10
- ] }),
11
- TenantDomainSelector: ({
12
- tenants: i = [],
13
- domains: s = [],
14
- selectedTenant: n,
15
- selectedDomain: d,
16
- onTenantChange: u,
17
- onDomainChange: m
18
- }) => /* @__PURE__ */ a(X, { style: { marginBottom: 12 }, children: [
19
- /* @__PURE__ */ e("span", { style: { color: "#666" }, children: "租户" }),
20
- /* @__PURE__ */ e(
21
- L,
22
- {
23
- value: n,
24
- onChange: u,
25
- style: { minWidth: 160 },
26
- options: i,
27
- placeholder: "请选择租户"
28
- }
29
- ),
30
- /* @__PURE__ */ e("span", { style: { color: "#666" }, children: "域" }),
31
- /* @__PURE__ */ e(
32
- L,
33
- {
34
- value: d,
35
- onChange: m,
36
- disabled: !n,
37
- style: { minWidth: 160 },
38
- options: s,
39
- placeholder: "请选择域"
40
- }
41
- )
42
- ] }),
43
- Button: (i) => /* @__PURE__ */ e(w, { ...i }),
44
- Tree: (i) => /* @__PURE__ */ e(Le, { ...i }),
45
- Table: (i) => /* @__PURE__ */ e(xe, { ...i }),
46
- Card: (i) => /* @__PURE__ */ e(De, { ...i }),
47
- Descriptions: ({ items: i = [], ...s }) => /* @__PURE__ */ e(Ee, { ...s, bordered: !0, size: "small", items: i }),
48
- Tag: (i) => /* @__PURE__ */ e($, { ...i }),
49
- Popconfirm: (i) => /* @__PURE__ */ e(de, { ...i }),
50
- Dropdown: (i) => /* @__PURE__ */ e(Ae, { ...i }),
51
- Empty: (i) => /* @__PURE__ */ e(W, { ...i }),
52
- Space: (i) => /* @__PURE__ */ e(X, { ...i }),
53
- Row: (i) => /* @__PURE__ */ e(ae, { ...i }),
54
- Col: (i) => /* @__PURE__ */ e(M, { ...i }),
55
- FormItem: ({ label: i, children: s, ...n }) => /* @__PURE__ */ e(I.Item, { label: i, ...n, children: s }),
56
- Input: (i) => /* @__PURE__ */ e(F, { ...i }),
57
- InputTextArea: (i) => /* @__PURE__ */ e(F.TextArea, { ...i }),
58
- Select: (i) => /* @__PURE__ */ e(L, { ...i }),
59
- Modal: (i) => /* @__PURE__ */ e(O, { ...i })
60
- };
61
- function me({ node: i, highlightId: s, onElementClick: n }) {
62
- var m;
63
- const d = Re[i.type] || (() => null), u = s === i.id;
64
- return /* @__PURE__ */ e(
65
- "div",
66
- {
67
- "data-node-id": i.id,
68
- "data-node-type": i.type,
69
- className: `manuscript-node ${u ? "manuscript-node-highlight" : ""}`,
70
- onClick: (l) => {
71
- l.stopPropagation(), n == null || n(i);
72
- },
73
- children: /* @__PURE__ */ e(d, { ...i.props || {}, children: (m = i.children) == null ? void 0 : m.map((l) => /* @__PURE__ */ e(
74
- me,
75
- {
76
- node: l,
77
- highlightId: s,
78
- onElementClick: n
79
- },
80
- l.id
81
- )) })
82
- }
83
- );
84
- }
85
- function Be({ tree: i, highlightId: s, onElementClick: n }) {
86
- return !i || i.length === 0 ? /* @__PURE__ */ e(W, { description: "暂无设计稿内容" }) : /* @__PURE__ */ e("div", { className: "manuscript-renderer", children: i.map((d) => /* @__PURE__ */ e(
87
- me,
88
- {
89
- node: d,
90
- highlightId: s,
91
- onElementClick: n
92
- },
93
- d.id
94
- )) });
95
- }
96
- const Me = {
97
- P0: "red",
98
- P1: "orange",
99
- P2: "blue"
100
- };
101
- function Fe({
102
- caseData: i,
103
- isHighlighted: s,
104
- chainData: n,
105
- onEdit: d,
106
- onDelete: u,
107
- onClick: m,
108
- onEffectClick: l
109
- }) {
110
- const [f, r] = h(!1), g = n != null && n.triggerInfo ? se(n.triggerInfo, {}) : null, _ = n != null && n.crossPageEffects ? se(n.crossPageEffects, []) : [];
111
- return /* @__PURE__ */ a(
112
- "div",
113
- {
114
- className: `manuscript-case-card ${s ? "highlight" : ""}`,
115
- onClick: () => m == null ? void 0 : m(i),
116
- children: [
117
- /* @__PURE__ */ a("div", { className: "case-card-header", onClick: (N) => {
118
- N.stopPropagation(), r(!f);
119
- }, children: [
120
- /* @__PURE__ */ a(X, { children: [
121
- /* @__PURE__ */ e("span", { className: "case-id", children: i.caseId }),
122
- /* @__PURE__ */ e("span", { className: "case-title", children: i.title }),
123
- /* @__PURE__ */ e($, { color: Me[i.priority] || "default", children: i.priority || "P1" }),
124
- i.bizCode && /* @__PURE__ */ e(He, { title: `因果链路: ${i.bizCode}`, children: /* @__PURE__ */ e(G, { style: { color: "#fa8c16" } }) })
125
- ] }),
126
- /* @__PURE__ */ e(
127
- w,
128
- {
129
- type: "text",
130
- size: "small",
131
- icon: f ? /* @__PURE__ */ e(ze, {}) : /* @__PURE__ */ e(Ce, {}),
132
- onClick: (N) => {
133
- N.stopPropagation(), r(!f);
134
- }
135
- }
136
- )
137
- ] }),
138
- f && /* @__PURE__ */ a("div", { className: "case-card-body", children: [
139
- i.bizCode && /* @__PURE__ */ a("div", { className: "case-section", children: [
140
- /* @__PURE__ */ a("div", { className: "case-section-title", children: [
141
- /* @__PURE__ */ e(G, { style: { color: "#fa8c16" } }),
142
- " 因果链路"
143
- ] }),
144
- /* @__PURE__ */ a("div", { className: "causal-chain", children: [
145
- g && /* @__PURE__ */ a("div", { className: "chain-trigger", children: [
146
- /* @__PURE__ */ e($, { color: "orange", children: g.page }),
147
- /* @__PURE__ */ a("span", { className: "chain-action", children: [
148
- "→ ",
149
- g.action
150
- ] })
151
- ] }),
152
- /* @__PURE__ */ e("div", { className: "chain-effects", children: _.map((N, C) => /* @__PURE__ */ a(
153
- "div",
154
- {
155
- className: "chain-effect-row",
156
- onClick: (A) => {
157
- A.stopPropagation(), l == null || l(N);
158
- },
159
- children: [
160
- /* @__PURE__ */ e("span", { className: "chain-arrow", children: "→" }),
161
- /* @__PURE__ */ e($, { color: "blue", children: N.page }),
162
- /* @__PURE__ */ a("span", { className: "chain-eff-type", children: [
163
- "[",
164
- N.effectType,
165
- "]"
166
- ] }),
167
- /* @__PURE__ */ e("span", { className: "chain-eff-desc", children: N.description }),
168
- /* @__PURE__ */ e($, { style: { marginLeft: 8 }, children: N.delay })
169
- ]
170
- },
171
- C
172
- )) })
173
- ] })
174
- ] }),
175
- i.learningPath && i.learningPath.length > 0 && /* @__PURE__ */ a("div", { className: "case-section", children: [
176
- /* @__PURE__ */ e("div", { className: "case-section-title", children: "📋 学习路径" }),
177
- /* @__PURE__ */ e("ol", { className: "case-learning-path", children: i.learningPath.map((N, C) => /* @__PURE__ */ e("li", { children: N }, C)) })
178
- ] }),
179
- i.scene && /* @__PURE__ */ a("div", { className: "case-section", children: [
180
- /* @__PURE__ */ e("div", { className: "case-section-title", children: "📍 起点场景" }),
181
- /* @__PURE__ */ e("div", { className: "case-scene", children: i.scene })
182
- ] }),
183
- /* @__PURE__ */ a("div", { className: "case-section", children: [
184
- /* @__PURE__ */ e("div", { className: "case-section-title", children: "🔗 设计稿关联" }),
185
- i.hotspotSelector ? /* @__PURE__ */ e($, { color: "cyan", icon: /* @__PURE__ */ e(ke, {}), children: i.hotspotSelector }) : /* @__PURE__ */ e("span", { style: { color: "#999" }, children: "未关联" })
186
- ] }),
187
- /* @__PURE__ */ a("div", { className: "case-card-actions", onClick: (N) => N.stopPropagation(), children: [
188
- /* @__PURE__ */ e(
189
- w,
190
- {
191
- size: "small",
192
- icon: /* @__PURE__ */ e(Ie, {}),
193
- onClick: () => d == null ? void 0 : d({ ...i, _action: "duplicate" }),
194
- children: "复制"
195
- }
196
- ),
197
- /* @__PURE__ */ e(
198
- w,
199
- {
200
- size: "small",
201
- icon: /* @__PURE__ */ e(Pe, {}),
202
- onClick: () => d == null ? void 0 : d(i),
203
- children: "编辑"
204
- }
205
- ),
206
- /* @__PURE__ */ e(de, { title: "确认删除此 case?", onConfirm: () => u == null ? void 0 : u(i), children: /* @__PURE__ */ e(w, { size: "small", danger: !0, icon: /* @__PURE__ */ e(ne, {}), children: "删除" }) })
207
- ] })
208
- ] })
209
- ]
210
- }
211
- );
212
- }
213
- function se(i, s) {
214
- if (!i) return s;
215
- try {
216
- return JSON.parse(i);
217
- } catch {
218
- return s;
219
- }
220
- }
221
- function Ue({
222
- open: i,
223
- initialCase: s,
224
- bizOptions: n = [],
225
- designNodes: d = [],
226
- onCancel: u,
227
- onSubmit: m
228
- }) {
229
- const [l] = I.useForm();
230
- V(() => {
231
- var r;
232
- i && (s ? l.setFieldsValue({
233
- ...s,
234
- learningPathText: (r = s.learningPath) == null ? void 0 : r.join(`
235
- `)
236
- }) : l.resetFields());
237
- }, [i, s, l]);
238
- const f = async () => {
239
- var r;
240
- try {
241
- const g = await l.validateFields(), _ = {
242
- ...g,
243
- learningPath: ((r = g.learningPathText) == null ? void 0 : r.split(`
244
- `).filter((N) => N.trim())) || []
245
- };
246
- delete _.learningPathText, m(_);
247
- } catch {
248
- }
249
- };
250
- return /* @__PURE__ */ e(
251
- O,
252
- {
253
- open: i,
254
- title: s ? `编辑 case: ${s.caseId}` : "新增 case",
255
- onCancel: u,
256
- onOk: f,
257
- okText: "保存 (commit)",
258
- destroyOnHidden: !0,
259
- children: /* @__PURE__ */ a(I, { form: l, layout: "vertical", children: [
260
- /* @__PURE__ */ a(ae, { gutter: 16, children: [
261
- /* @__PURE__ */ e(M, { span: 12, children: /* @__PURE__ */ e(
262
- I.Item,
263
- {
264
- name: "caseId",
265
- label: "Case 编码",
266
- rules: [{ required: !0, pattern: /^case\.\d+$/, message: "格式: case.NNN" }],
267
- children: /* @__PURE__ */ e(F, { placeholder: "case.001", disabled: !!s && !s._action })
268
- }
269
- ) }),
270
- /* @__PURE__ */ e(M, { span: 12, children: /* @__PURE__ */ e(I.Item, { name: "title", label: "标题", rules: [{ required: !0 }], children: /* @__PURE__ */ e(F, { placeholder: "新增组织 A" }) }) })
271
- ] }),
272
- /* @__PURE__ */ e(
273
- I.Item,
274
- {
275
- name: "bizCode",
276
- label: "因果链路 (引用 z_biz_understanding.bizCode)",
277
- extra: "选择这条 case 引用的跨页面因果链路",
278
- children: /* @__PURE__ */ e(
279
- L,
280
- {
281
- placeholder: "选择因果链路 (可选)",
282
- allowClear: !0,
283
- showSearch: !0,
284
- optionFilterProp: "label",
285
- options: n
286
- }
287
- )
288
- }
289
- ),
290
- /* @__PURE__ */ e(I.Item, { name: "scene", label: "起点场景", children: /* @__PURE__ */ e(F.TextArea, { rows: 2, placeholder: "管理员进入 4A 中心 → 组织管理 → ..." }) }),
291
- /* @__PURE__ */ e(I.Item, { name: "learningPathText", label: "学习路径 (每行一步)", children: /* @__PURE__ */ e(
292
- F.TextArea,
293
- {
294
- rows: 5,
295
- placeholder: `1. 进入组织管理页
296
- 2. 选择目标域
297
- 3. 点击 [+ 新增组织]
298
- 4. 提交表单
299
- 5. 观察 5 个页面联动`
300
- }
301
- ) }),
302
- /* @__PURE__ */ a(ae, { gutter: 16, children: [
303
- /* @__PURE__ */ e(M, { span: 8, children: /* @__PURE__ */ e(I.Item, { name: "priority", label: "优先级", initialValue: "P1", children: /* @__PURE__ */ e(L, { options: [
304
- { value: "P0", label: "P0 紧急" },
305
- { value: "P1", label: "P1 重要" },
306
- { value: "P2", label: "P2 一般" }
307
- ] }) }) }),
308
- /* @__PURE__ */ e(M, { span: 8, children: /* @__PURE__ */ e(I.Item, { name: "status", label: "状态", initialValue: "OPEN", children: /* @__PURE__ */ e(L, { 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(M, { span: 8, children: /* @__PURE__ */ e(I.Item, { name: "hotspotSelector", label: "关联设计稿元素", children: /* @__PURE__ */ e(
315
- L,
316
- {
317
- allowClear: !0,
318
- placeholder: "选择 design node",
319
- showSearch: !0,
320
- optionFilterProp: "label",
321
- options: d.map((r) => ({
322
- value: r.id,
323
- label: `${r.type} #${r.id}`
324
- }))
325
- }
326
- ) }) })
327
- ] })
328
- ] })
329
- }
330
- );
331
- }
332
- const P = oe.create({ baseURL: "/api", timeout: 15e3 });
333
- P.interceptors.response.use(
334
- (i) => i.data,
335
- (i) => (console.error("[ManuscriptView]", i), Promise.reject(i))
336
- );
337
- function qe({ productCode: i, pageCode: s }) {
338
- const [n, d] = h(null), [u, m] = h(null), [l, f] = h([]), [r, g] = h([]), [_, N] = h([]), [C, A] = h("main"), [Q, T] = h(null), [Y, S] = h(null), [K, E] = h(!1), [k, D] = h(null), [R, j] = h(!1), [Z, U] = h(!1), [B, J] = h(""), [ee, p] = h(!1), o = le(async () => {
339
- p(!0);
340
- try {
341
- const [c, b, v, z, ie] = await Promise.all([
342
- P.get("/product/manuscript/product", { params: { productCode: i, pageCode: s } }),
343
- P.get("/product/manuscript/design", { params: { productCode: i, pageCode: s } }),
344
- P.get("/product/biz-understanding/list", { params: { productCode: i } }),
345
- P.get("/product/manuscript/history", {
346
- params: {
347
- productCode: i,
348
- pageCode: s,
349
- branch: C,
350
- limit: 20
351
- }
352
- }),
353
- P.get("/product/manuscript/branches", { params: { productCode: i, pageCode: s } })
354
- ]);
355
- d(c == null ? void 0 : c.data), m(b == null ? void 0 : b.data), f((v == null ? void 0 : v.data) || []), g((z == null ? void 0 : z.data) || []), N((ie == null ? void 0 : ie.data) || []);
356
- } catch (c) {
357
- console.error("loadAll 失败:", c);
358
- } finally {
359
- p(!1);
360
- }
361
- }, [i, s, C]);
362
- V(() => {
363
- o();
364
- }, [o]);
365
- const x = q(() => {
366
- if (!(n != null && n.cases)) return [];
367
- try {
368
- return JSON.parse(n.cases);
369
- } catch {
370
- return [];
371
- }
372
- }, [n]), te = q(() => {
373
- if (!(u != null && u.renderTree)) return [];
374
- try {
375
- return JSON.parse(u.renderTree);
376
- } catch {
377
- return [];
378
- }
379
- }, [u]), re = q(() => {
380
- const c = [];
381
- function b(v) {
382
- for (const z of v || [])
383
- z.id && c.push({ id: z.id, type: z.type }), z.children && b(z.children);
384
- }
385
- return b(te), c;
386
- }, [te]), ue = q(() => {
387
- const c = {};
388
- for (const b of l) c[b.bizCode] = b;
389
- return c;
390
- }, [l]), he = q(
391
- () => l.map((c) => ({ value: c.bizCode, label: `${c.bizCode} — ${c.title}` })),
392
- [l]
393
- ), pe = (c) => {
394
- T(c.caseId), S(c.hotspotSelector || null), setTimeout(() => {
395
- T(null), S(null);
396
- }, 3e3);
397
- }, be = (c) => {
398
- if (!c.id) return;
399
- S(c.id);
400
- const b = x.find((v) => v.hotspotSelector === c.id);
401
- b && T(b.caseId), setTimeout(() => {
402
- T(null), S(null);
403
- }, 3e3);
404
- }, ge = (c) => {
405
- const b = x.find((v) => v.bizCode);
406
- b && (T(b.caseId), setTimeout(() => T(null), 3e3));
407
- }, fe = async (c) => {
408
- const b = (k == null ? void 0 : k._action) === "duplicate" || !k, v = (k == null ? void 0 : k._action) === "duplicate";
409
- try {
410
- if (b || v) {
411
- const z = v ? { ...c, caseId: Ne(), title: c.title + " (副本)" } : c;
412
- await P.post("/product/manuscript/case", {
413
- productCode: i,
414
- pageCode: s,
415
- author: "admin",
416
- caseData: z
417
- });
418
- } else
419
- await P.put("/product/manuscript/case", {
420
- productCode: i,
421
- pageCode: s,
422
- author: "admin",
423
- originalCaseId: k.caseId,
424
- caseData: c
425
- });
426
- E(!1), D(null), await o();
427
- } catch (z) {
428
- O.error({ title: "保存失败", content: z == null ? void 0 : z.message });
429
- }
430
- }, _e = async (c) => {
431
- try {
432
- await P.delete("/product/manuscript/case", {
433
- params: { productCode: i, pageCode: s, caseId: c.caseId, author: "admin" }
434
- }), await o();
435
- } catch (b) {
436
- O.error({ title: "删除失败", content: b == null ? void 0 : b.message });
437
- }
438
- }, Ne = () => {
439
- const c = x.map((v) => parseInt((v.caseId || "case.0").split(".")[1] || "0")).filter((v) => !isNaN(v)), b = c.length > 0 ? Math.max(...c) : 0;
440
- return `case.${String(b + 1).padStart(3, "0")}`;
441
- }, ve = async (c) => {
442
- A(c);
443
- }, ye = async () => {
444
- var c;
445
- if (B.trim())
446
- try {
447
- const b = (c = _.find((v) => v.branch === C)) == null ? void 0 : c.headSha;
448
- await P.post("/product/manuscript/branch", {
449
- productCode: i,
450
- pageCode: s,
451
- branch: B,
452
- fromSha: b
453
- }), U(!1), J(""), await o(), A(B);
454
- } catch (b) {
455
- O.error({ title: "创建分支失败", content: b == null ? void 0 : b.message });
456
- }
457
- };
458
- return ee && !n && !u ? /* @__PURE__ */ a("div", { style: { textAlign: "center", padding: 40 }, children: [
459
- /* @__PURE__ */ e(Oe, {}),
460
- " 加载中..."
461
- ] }) : /* @__PURE__ */ a("div", { className: "manuscript-view", children: [
462
- /* @__PURE__ */ e("div", { className: "manuscript-toolbar", children: /* @__PURE__ */ a(X, { children: [
463
- /* @__PURE__ */ e(Te, {}),
464
- /* @__PURE__ */ e("span", { children: "分支:" }),
465
- /* @__PURE__ */ e(
466
- L,
467
- {
468
- value: C,
469
- onChange: ve,
470
- style: { minWidth: 120 },
471
- options: _.map((c) => ({ value: c.branch, label: c.branch }))
472
- }
473
- ),
474
- /* @__PURE__ */ e(w, { size: "small", onClick: () => U(!0), children: "新分支" }),
475
- /* @__PURE__ */ a(
476
- w,
477
- {
478
- size: "small",
479
- icon: /* @__PURE__ */ e(Se, {}),
480
- onClick: () => j(!0),
481
- children: [
482
- "历史 (",
483
- r.length,
484
- ")"
485
- ]
486
- }
487
- ),
488
- /* @__PURE__ */ e(w, { size: "small", icon: /* @__PURE__ */ e($e, {}), onClick: o, children: "刷新" })
489
- ] }) }),
490
- /* @__PURE__ */ a("div", { className: "manuscript-layout", children: [
491
- /* @__PURE__ */ a("div", { className: "manuscript-left", children: [
492
- /* @__PURE__ */ a("div", { className: "case-list-header", children: [
493
- /* @__PURE__ */ a("h3", { children: [
494
- "📋 产品稿件 / ",
495
- x.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
- w,
501
- {
502
- type: "primary",
503
- icon: /* @__PURE__ */ e(H, {}),
504
- onClick: () => {
505
- D(null), E(!0);
506
- },
507
- children: "新增 case"
508
- }
509
- )
510
- ] }),
511
- /* @__PURE__ */ e("div", { className: "case-list", children: x.length === 0 ? /* @__PURE__ */ e(W, { description: "暂无 case, 点击 [新增 case] 开始" }) : x.map((c) => /* @__PURE__ */ e(
512
- Fe,
513
- {
514
- caseData: c,
515
- isHighlighted: Q === c.caseId,
516
- chainData: c.bizCode ? ue[c.bizCode] : null,
517
- onEdit: (b) => {
518
- D(b), E(!0);
519
- },
520
- onDelete: _e,
521
- onClick: pe,
522
- onEffectClick: ge
523
- },
524
- c.caseId
525
- )) })
526
- ] }),
527
- /* @__PURE__ */ a("div", { className: "manuscript-right", children: [
528
- /* @__PURE__ */ a("div", { className: "design-header", children: [
529
- /* @__PURE__ */ a("h3", { children: [
530
- "🎨 设计稿件",
531
- (u == null ? void 0 : u.title) && /* @__PURE__ */ e("small", { style: { marginLeft: 8, color: "#888" }, children: u.title })
532
- ] }),
533
- /* @__PURE__ */ a("span", { style: { color: "#888", fontSize: 12 }, children: [
534
- re.length,
535
- " 个节点"
536
- ] })
537
- ] }),
538
- /* @__PURE__ */ e("div", { className: "design-canvas", children: /* @__PURE__ */ e(
539
- Be,
540
- {
541
- tree: te,
542
- highlightId: Y,
543
- onElementClick: be
544
- }
545
- ) })
546
- ] })
547
- ] }),
548
- /* @__PURE__ */ e(
549
- Ue,
550
- {
551
- open: K,
552
- initialCase: k,
553
- bizOptions: he,
554
- designNodes: re,
555
- onCancel: () => {
556
- E(!1), D(null);
557
- },
558
- onSubmit: fe
559
- }
560
- ),
561
- /* @__PURE__ */ e(
562
- O,
563
- {
564
- open: R,
565
- title: `commit 历史 (${C} 分支)`,
566
- onCancel: () => j(!1),
567
- footer: null,
568
- children: /* @__PURE__ */ e("div", { className: "commit-history", children: r.length === 0 ? /* @__PURE__ */ e(W, { description: "暂无 commit 记录" }) : r.map((c) => /* @__PURE__ */ a("div", { className: "commit-row", children: [
569
- /* @__PURE__ */ e("div", { className: "commit-sha", children: /* @__PURE__ */ e($, { color: "purple", children: c.sha.substring(0, 8) }) }),
570
- /* @__PURE__ */ a("div", { className: "commit-msg", children: [
571
- /* @__PURE__ */ a("div", { children: [
572
- /* @__PURE__ */ e($, { color: c.operation === "CREATE" ? "green" : c.operation === "UPDATE" ? "blue" : c.operation === "DELETE" ? "red" : c.operation === "BIND" ? "cyan" : "default", children: c.operation }),
573
- /* @__PURE__ */ e($, { children: c.targetType }),
574
- /* @__PURE__ */ e("code", { children: c.targetId })
575
- ] }),
576
- /* @__PURE__ */ e("div", { style: { color: "#888", fontSize: 12, marginTop: 4 }, children: c.commitMessage })
577
- ] }),
578
- /* @__PURE__ */ a("div", { className: "commit-meta", style: { color: "#888", fontSize: 11 }, children: [
579
- /* @__PURE__ */ e("div", { children: c.author }),
580
- /* @__PURE__ */ e("div", { children: c.createdAt })
581
- ] })
582
- ] }, c.sha)) })
583
- }
584
- ),
585
- /* @__PURE__ */ e(
586
- O,
587
- {
588
- open: Z,
589
- title: "新建分支",
590
- onCancel: () => U(!1),
591
- onOk: ye,
592
- okText: "创建",
593
- children: /* @__PURE__ */ a("div", { style: { padding: "12px 0" }, children: [
594
- /* @__PURE__ */ e("span", { style: { marginRight: 8 }, children: "分支名:" }),
595
- /* @__PURE__ */ e(
596
- "input",
597
- {
598
- value: B,
599
- onChange: (c) => J(c.target.value),
600
- placeholder: "feature-xxx",
601
- style: { padding: "4px 8px", border: "1px solid #d9d9d9", borderRadius: 4, width: 200 }
602
- }
603
- ),
604
- /* @__PURE__ */ a("div", { style: { marginTop: 8, color: "#888", fontSize: 12 }, children: [
605
- "从当前分支 (",
606
- /* @__PURE__ */ e("code", { children: C }),
607
- ") 的 HEAD fork"
608
- ] })
609
- ] })
610
- }
611
- )
612
- ] });
613
- }
614
- const Ge = "_container_15k6u_6", Ve = "_sidebar_15k6u_15", je = "_sidebarHeader_15k6u_25", Je = "_productList_15k6u_37", We = "_productItem_15k6u_43", Xe = "_productItemActive_15k6u_57", Qe = "_productItemName_15k6u_62", Ye = "_productItemCode_15k6u_68", Ke = "_productItemStatus_15k6u_73", Ze = "_emptyHint_15k6u_84", et = "_main_15k6u_92", tt = "_productHeader_15k6u_100", it = "_productTitle_15k6u_109", at = "_productCode_15k6u_115", nt = "_tabBar_15k6u_122", rt = "_tab_15k6u_122", st = "_tabActive_15k6u_142", ct = "_tabContent_15k6u_148", lt = "_formGroup_15k6u_155", ot = "_formLabel_15k6u_163", dt = "_formInput_15k6u_171", mt = "_formTextarea_15k6u_172", ut = "_designGrid_15k6u_189", ht = "_designCard_15k6u_195", pt = "_designImage_15k6u_202", bt = "_designInfo_15k6u_209", gt = "_designName_15k6u_213", ft = "_designDesc_15k6u_220", _t = "_designActions_15k6u_225", Nt = "_designLink_15k6u_233", vt = "_table_15k6u_244", yt = "_empty_15k6u_84", zt = "_btn_15k6u_284", Ct = "_btnPrimary_15k6u_300", kt = "_btnDanger_15k6u_311", It = "_toolbar_15k6u_321", Pt = "_priority_15k6u_329", Tt = "_priorityP0_15k6u_337", St = "_priorityP1_15k6u_342", $t = "_priorityP2_15k6u_347", wt = "_priorityP3_15k6u_352", At = "_status_15k6u_357", Et = "_statusActive_15k6u_367", Dt = "_statusDone_15k6u_372", xt = "_featureNo_15k6u_377", Lt = "_spinner_15k6u_386", Ht = "_modal_15k6u_394", Ot = "_modalBody_15k6u_404", Rt = "_modalTitle_15k6u_413", Bt = "_modalActions_15k6u_420", Mt = "_bizLayout_15k6u_430", Ft = "_bizList_15k6u_437", Ut = "_bizFilter_15k6u_448", qt = "_bizFilterHint_15k6u_454", Gt = "_bizListHeader_15k6u_459", Vt = "_bizItem_15k6u_467", jt = "_bizItemActive_15k6u_481", Jt = "_bizItemHeader_15k6u_487", Wt = "_bizItemTitle_15k6u_494", Xt = "_bizItemStatus_15k6u_504", Qt = "_bizItemSummary_15k6u_512", Yt = "_bizItemMeta_15k6u_522", Kt = "_bizItemDot_15k6u_527", Zt = "_bizDetail_15k6u_531", ei = "_bizDetailHeader_15k6u_537", ti = "_bizDetailTitle_15k6u_543", ii = "_bizDetailCode_15k6u_550", ai = "_bizSection_15k6u_556", ni = "_bizSectionTitle_15k6u_560", ri = "_bizTriggerCard_15k6u_570", si = "_bizEffects_15k6u_580", ci = "_bizEffectCard_15k6u_586", li = "_bizEffectPage_15k6u_595", oi = "_bizEffectArrow_15k6u_602", di = "_bizEffectPageCode_15k6u_608", mi = "_bizEffectDelay_15k6u_618", ui = "_bizEffectType_15k6u_626", hi = "_bizEffectDesc_15k6u_633", pi = "_bizStory_15k6u_638", t = {
615
- container: Ge,
616
- sidebar: Ve,
617
- sidebarHeader: je,
618
- productList: Je,
619
- productItem: We,
620
- productItemActive: Xe,
621
- productItemName: Qe,
622
- productItemCode: Ye,
623
- productItemStatus: Ke,
624
- emptyHint: Ze,
625
- main: et,
626
- productHeader: tt,
627
- productTitle: it,
628
- productCode: at,
629
- tabBar: nt,
630
- tab: rt,
631
- tabActive: st,
632
- tabContent: ct,
633
- formGroup: lt,
634
- formLabel: ot,
635
- formInput: dt,
636
- formTextarea: mt,
637
- designGrid: ut,
638
- designCard: ht,
639
- designImage: pt,
640
- designInfo: bt,
641
- designName: gt,
642
- designDesc: ft,
643
- designActions: _t,
644
- designLink: Nt,
645
- table: vt,
646
- empty: yt,
647
- btn: zt,
648
- btnPrimary: Ct,
649
- btnDanger: kt,
650
- toolbar: It,
651
- priority: Pt,
652
- priorityP0: Tt,
653
- priorityP1: St,
654
- priorityP2: $t,
655
- priorityP3: wt,
656
- status: At,
657
- statusActive: Et,
658
- statusDone: Dt,
659
- featureNo: xt,
660
- spinner: Lt,
661
- modal: Ht,
662
- modalBody: Ot,
663
- modalTitle: Rt,
664
- modalActions: Bt,
665
- bizLayout: Mt,
666
- bizList: Ft,
667
- bizFilter: Ut,
668
- bizFilterHint: qt,
669
- bizListHeader: Gt,
670
- bizItem: Vt,
671
- bizItemActive: jt,
672
- bizItemHeader: Jt,
673
- bizItemTitle: Wt,
674
- bizItemStatus: Xt,
675
- bizItemSummary: Qt,
676
- bizItemMeta: Yt,
677
- bizItemDot: Kt,
678
- bizDetail: Zt,
679
- bizDetailHeader: ei,
680
- bizDetailTitle: ti,
681
- bizDetailCode: ii,
682
- bizSection: ai,
683
- bizSectionTitle: ni,
684
- bizTriggerCard: ri,
685
- bizEffects: si,
686
- bizEffectCard: ci,
687
- bizEffectPage: li,
688
- bizEffectArrow: oi,
689
- bizEffectPageCode: di,
690
- bizEffectDelay: mi,
691
- bizEffectType: ui,
692
- bizEffectDesc: hi,
693
- bizStory: pi
694
- }, y = oe.create({ baseURL: "/api", timeout: 15e3 });
695
- y.interceptors.response.use(
696
- (i) => i.data,
697
- (i) => (console.error("[ProductWorkbench] request failed", i), Promise.reject(i))
698
- );
699
- function Si() {
700
- const [i, s] = h([]), [n, d] = h(null), [u, m] = h(!1), [l, f] = h("description"), [r, g] = h([]), [_, N] = h([]), [C, A] = h([]), [Q, T] = h([]), [Y, S] = h(!1), [K, E] = h(!1), [k, D] = h(!1), R = le(async () => {
701
- m(!0);
702
- try {
703
- const p = await y.get("/product/list"), o = (p == null ? void 0 : p.data) || [];
704
- s(o), o.length > 0 && !n && d(o[0]);
705
- } catch (p) {
706
- console.error(p);
707
- } finally {
708
- m(!1);
709
- }
710
- }, [n]);
711
- V(() => {
712
- R();
713
- }, [R]), V(() => {
714
- if (!n) return;
715
- const p = n.productCode;
716
- l === "design" ? y.get(`/product/${p}/design/list`).then((o) => g((o == null ? void 0 : o.data) || [])).catch(() => g([])) : l === "requirement" ? y.get(`/product/${p}/requirement/list`).then((o) => N((o == null ? void 0 : o.data) || [])).catch(() => N([])) : l === "feature" ? y.get(`/product/${p}/feature/list`).then((o) => A((o == null ? void 0 : o.data) || [])).catch(() => A([])) : l === "biz-understanding" && y.get("/product/biz-understanding/list", { params: { productCode: p } }).then((o) => T((o == null ? void 0 : o.data) || [])).catch(() => T([]));
717
- }, [n, l]);
718
- const j = async (p) => {
719
- try {
720
- const o = await y.post("/product", p), x = o == null ? void 0 : o.data;
721
- await R(), d(x), S(!1);
722
- } catch (o) {
723
- console.error(o);
724
- }
725
- }, Z = async (p) => {
726
- if (n)
727
- try {
728
- await y.put(`/product/${n.productCode}`, p), await R();
729
- } catch (o) {
730
- console.error(o);
731
- }
732
- }, U = async (p) => {
733
- if (n)
734
- try {
735
- await y.post(`/product/${n.productCode}/design`, p), E(!1);
736
- const o = await y.get(`/product/${n.productCode}/design/list`);
737
- g((o == null ? void 0 : o.data) || []);
738
- } catch (o) {
739
- console.error(o);
740
- }
741
- }, B = async (p) => {
742
- if (n)
743
- try {
744
- await y.post(`/product/${n.productCode}/requirement`, p), D(!1);
745
- const o = await y.get(`/product/${n.productCode}/requirement/list`);
746
- N((o == null ? void 0 : o.data) || []);
747
- } catch (o) {
748
- console.error(o);
749
- }
750
- }, J = async (p) => {
751
- if (n && confirm("确认删除该需求?"))
752
- try {
753
- await y.delete(`/product/${n.productCode}/requirement/${p}`);
754
- const o = await y.get(`/product/${n.productCode}/requirement/list`);
755
- N((o == null ? void 0 : o.data) || []);
756
- } catch (o) {
757
- console.error(o);
758
- }
759
- }, ee = async () => {
760
- if (n)
761
- try {
762
- await y.post(`/product/${n.productCode}/feature/decompose`);
763
- const p = await y.get(`/product/${n.productCode}/feature/list`);
764
- A((p == null ? void 0 : p.data) || []), alert("功能拆分完成");
765
- } catch (p) {
766
- console.error(p);
767
- }
768
- };
769
- return u ? /* @__PURE__ */ e("div", { className: t.spinner, children: "加载中..." }) : /* @__PURE__ */ a("div", { className: t.container, children: [
770
- /* @__PURE__ */ a("aside", { className: t.sidebar, children: [
771
- /* @__PURE__ */ e("div", { className: t.sidebarHeader, children: /* @__PURE__ */ a(
772
- "button",
773
- {
774
- className: `${t.btn} ${t.btnPrimary}`,
775
- onClick: () => S(!0),
776
- title: "新建产品",
777
- children: [
778
- /* @__PURE__ */ e(H, {}),
779
- " 新建"
780
- ]
781
- }
782
- ) }),
783
- /* @__PURE__ */ e("div", { className: t.productList, children: i.length === 0 ? /* @__PURE__ */ e("div", { className: t.emptyHint, children: '暂无产品,点击"新建"开始' }) : i.map((p) => /* @__PURE__ */ a(
784
- "div",
785
- {
786
- className: `${t.productItem} ${(n == null ? void 0 : n.productCode) === p.productCode ? t.productItemActive : ""}`,
787
- onClick: () => d(p),
788
- children: [
789
- /* @__PURE__ */ e("div", { className: t.productItemName, children: p.name }),
790
- /* @__PURE__ */ e("div", { className: t.productItemCode, children: p.productCode }),
791
- /* @__PURE__ */ e("span", { className: t.productItemStatus, children: p.status })
792
- ]
793
- },
794
- p.productCode
795
- )) })
796
- ] }),
797
- /* @__PURE__ */ e("main", { className: t.main, children: n ? /* @__PURE__ */ a(ce, { children: [
798
- /* @__PURE__ */ a("div", { className: t.productHeader, children: [
799
- /* @__PURE__ */ a("div", { children: [
800
- /* @__PURE__ */ e("span", { className: t.productTitle, children: n.name }),
801
- /* @__PURE__ */ e("span", { className: t.productCode, children: n.productCode })
802
- ] }),
803
- /* @__PURE__ */ e("span", { className: t.status, children: n.status })
804
- ] }),
805
- /* @__PURE__ */ a("div", { className: t.tabBar, children: [
806
- /* @__PURE__ */ e(
807
- "div",
808
- {
809
- className: `${t.tab} ${l === "description" ? t.tabActive : ""}`,
810
- onClick: () => f("description"),
811
- children: "产品描述"
812
- }
813
- ),
814
- /* @__PURE__ */ e(
815
- "div",
816
- {
817
- className: `${t.tab} ${l === "design" ? t.tabActive : ""}`,
818
- onClick: () => f("design"),
819
- children: "设计稿"
820
- }
821
- ),
822
- /* @__PURE__ */ e(
823
- "div",
824
- {
825
- className: `${t.tab} ${l === "requirement" ? t.tabActive : ""}`,
826
- onClick: () => f("requirement"),
827
- children: "业务需求"
828
- }
829
- ),
830
- /* @__PURE__ */ e(
831
- "div",
832
- {
833
- className: `${t.tab} ${l === "feature" ? t.tabActive : ""}`,
834
- onClick: () => f("feature"),
835
- children: "功能拆分"
836
- }
837
- ),
838
- /* @__PURE__ */ a(
839
- "div",
840
- {
841
- className: `${t.tab} ${l === "biz-understanding" ? t.tabActive : ""}`,
842
- onClick: () => f("biz-understanding"),
843
- title: "跨页面因果链稿件库 — 一份稿件 = 一个跨页面动作的连锁变化",
844
- children: [
845
- "业务理解 ",
846
- /* @__PURE__ */ e(G, { style: { marginLeft: 4, fontSize: 12 } })
847
- ]
848
- }
849
- ),
850
- /* @__PURE__ */ e(
851
- "div",
852
- {
853
- className: `${t.tab} ${l === "manuscript" ? t.tabActive : ""}`,
854
- onClick: () => f("manuscript"),
855
- title: "产品稿件 (case) × 设计稿件 (UI) 双向高亮",
856
- children: "稿件编辑器"
857
- }
858
- )
859
- ] }),
860
- /* @__PURE__ */ a("div", { className: t.tabContent, children: [
861
- l === "description" && /* @__PURE__ */ e(bi, { product: n, onSave: Z }),
862
- l === "design" && /* @__PURE__ */ e(
863
- gi,
864
- {
865
- designs: r,
866
- onAdd: () => E(!0),
867
- onDelete: async (p) => {
868
- if (!confirm("确认删除该设计稿?")) return;
869
- await y.delete(
870
- `/product/${n.productCode}/design/${p}`
871
- );
872
- const o = await y.get(
873
- `/product/${n.productCode}/design/list`
874
- );
875
- g((o == null ? void 0 : o.data) || []);
876
- }
877
- }
878
- ),
879
- l === "requirement" && /* @__PURE__ */ e(
880
- fi,
881
- {
882
- requirements: _,
883
- onAdd: () => D(!0),
884
- onDelete: J
885
- }
886
- ),
887
- l === "feature" && /* @__PURE__ */ e(_i, { features: C, onDecompose: ee }),
888
- l === "biz-understanding" && /* @__PURE__ */ e(zi, { items: Q }),
889
- l === "manuscript" && n && /* @__PURE__ */ e(
890
- qe,
891
- {
892
- productCode: n.productCode,
893
- pageCode: "ctc.4a.org"
894
- }
895
- )
896
- ] })
897
- ] }) : /* @__PURE__ */ e("div", { className: t.spinner, children: /* @__PURE__ */ a("div", { children: [
898
- /* @__PURE__ */ e("p", { children: "暂无产品" }),
899
- /* @__PURE__ */ a(
900
- "button",
901
- {
902
- className: `${t.btn} ${t.btnPrimary}`,
903
- onClick: () => S(!0),
904
- children: [
905
- /* @__PURE__ */ e(H, {}),
906
- " 创建第一个产品"
907
- ]
908
- }
909
- )
910
- ] }) }) }),
911
- Y && /* @__PURE__ */ e(
912
- Ni,
913
- {
914
- onCancel: () => S(!1),
915
- onSubmit: j
916
- }
917
- ),
918
- K && /* @__PURE__ */ e(
919
- vi,
920
- {
921
- onCancel: () => E(!1),
922
- onSubmit: U
923
- }
924
- ),
925
- k && /* @__PURE__ */ e(
926
- yi,
927
- {
928
- onCancel: () => D(!1),
929
- onSubmit: B
930
- }
931
- )
932
- ] });
933
- }
934
- function bi({
935
- product: i,
936
- onSave: s
937
- }) {
938
- const [n, d] = h(i.name), [u, m] = h(i.vision || ""), [l, f] = h(i.targetUsers || ""), [r, g] = h(i.description || "");
939
- return V(() => {
940
- d(i.name), m(i.vision || ""), f(i.targetUsers || ""), g(i.description || "");
941
- }, [i]), /* @__PURE__ */ a("div", { className: t.formGroup, children: [
942
- /* @__PURE__ */ e("label", { className: t.formLabel, children: "产品名称" }),
943
- /* @__PURE__ */ e(
944
- "input",
945
- {
946
- className: t.formInput,
947
- value: n,
948
- onChange: (_) => d(_.target.value)
949
- }
950
- ),
951
- /* @__PURE__ */ e("label", { className: t.formLabel, children: "产品愿景" }),
952
- /* @__PURE__ */ e(
953
- "textarea",
954
- {
955
- className: t.formTextarea,
956
- value: u,
957
- onChange: (_) => m(_.target.value),
958
- placeholder: "描述这个产品要解决什么问题..."
959
- }
960
- ),
961
- /* @__PURE__ */ e("label", { className: t.formLabel, children: "目标用户" }),
962
- /* @__PURE__ */ e(
963
- "textarea",
964
- {
965
- className: t.formTextarea,
966
- value: l,
967
- onChange: (_) => f(_.target.value),
968
- placeholder: "谁会用这个产品..."
969
- }
970
- ),
971
- /* @__PURE__ */ e("label", { className: t.formLabel, children: "业务描述 (Markdown)" }),
972
- /* @__PURE__ */ e(
973
- "textarea",
974
- {
975
- className: t.formTextarea,
976
- style: { minHeight: 200 },
977
- value: r,
978
- onChange: (_) => g(_.target.value),
979
- placeholder: `## 核心场景
980
- ## 用户故事
981
- ## 业务规则`
982
- }
983
- ),
984
- /* @__PURE__ */ e(
985
- "button",
986
- {
987
- className: `${t.btn} ${t.btnPrimary}`,
988
- onClick: () => s({ name: n, vision: u, targetUsers: l, description: r }),
989
- children: "保存"
990
- }
991
- )
992
- ] });
993
- }
994
- function gi({
995
- designs: i,
996
- onAdd: s,
997
- onDelete: n
998
- }) {
999
- return /* @__PURE__ */ a("div", { children: [
1000
- /* @__PURE__ */ a("div", { className: t.toolbar, children: [
1001
- /* @__PURE__ */ a("h3", { style: { margin: 0, fontSize: 14 }, children: [
1002
- "设计稿 (",
1003
- i.length,
1004
- ")"
1005
- ] }),
1006
- /* @__PURE__ */ a("button", { className: `${t.btn} ${t.btnPrimary}`, onClick: s, children: [
1007
- /* @__PURE__ */ e(H, {}),
1008
- " 添加设计稿"
1009
- ] })
1010
- ] }),
1011
- i.length === 0 ? /* @__PURE__ */ e("div", { className: t.empty, children: '暂无设计稿,点击"添加设计稿"录入' }) : /* @__PURE__ */ e("div", { className: t.designGrid, children: i.map((d) => /* @__PURE__ */ a("div", { className: t.designCard, children: [
1012
- d.fileUrl && /\.(jpg|jpeg|png|gif|webp|svg)$/i.test(d.fileUrl) ? /* @__PURE__ */ e("img", { className: t.designImage, src: d.fileUrl, alt: d.name }) : /* @__PURE__ */ a(
1013
- "a",
1014
- {
1015
- className: t.designLink,
1016
- href: d.fileUrl,
1017
- target: "_blank",
1018
- rel: "noreferrer",
1019
- children: [
1020
- /* @__PURE__ */ e(we, { style: { fontSize: 24, marginRight: 6 } }),
1021
- "外链预览"
1022
- ]
1023
- }
1024
- ),
1025
- /* @__PURE__ */ a("div", { className: t.designInfo, children: [
1026
- /* @__PURE__ */ e("div", { className: t.designName, children: d.name || "(未命名)" }),
1027
- /* @__PURE__ */ e("div", { className: t.designDesc, children: d.description || d.fileUrl })
1028
- ] }),
1029
- /* @__PURE__ */ e("div", { className: t.designActions, children: /* @__PURE__ */ a(
1030
- "button",
1031
- {
1032
- className: `${t.btn} ${t.btnDanger}`,
1033
- onClick: () => n(d.id),
1034
- children: [
1035
- /* @__PURE__ */ e(ne, {}),
1036
- " 删除"
1037
- ]
1038
- }
1039
- ) })
1040
- ] }, d.id)) })
1041
- ] });
1042
- }
1043
- function fi({
1044
- requirements: i,
1045
- onAdd: s,
1046
- onDelete: n
1047
- }) {
1048
- const d = (m) => m === "P0" ? t.priorityP0 : m === "P1" ? t.priorityP1 : m === "P2" ? t.priorityP2 : t.priorityP3, u = (m) => m === "IN_PROGRESS" ? t.statusActive : m === "DONE" ? t.statusDone : "";
1049
- return /* @__PURE__ */ a("div", { children: [
1050
- /* @__PURE__ */ a("div", { className: t.toolbar, children: [
1051
- /* @__PURE__ */ a("h3", { style: { margin: 0, fontSize: 14 }, children: [
1052
- "业务需求 (",
1053
- i.length,
1054
- ")"
1055
- ] }),
1056
- /* @__PURE__ */ a("button", { className: `${t.btn} ${t.btnPrimary}`, onClick: s, children: [
1057
- /* @__PURE__ */ e(H, {}),
1058
- " 新增需求"
1059
- ] })
1060
- ] }),
1061
- i.length === 0 ? /* @__PURE__ */ e("div", { className: t.empty, children: "暂无需求,先录入需求后即可一键拆分" }) : /* @__PURE__ */ a("table", { className: t.table, children: [
1062
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ a("tr", { children: [
1063
- /* @__PURE__ */ e("th", { style: { width: 80 }, children: "优先级" }),
1064
- /* @__PURE__ */ e("th", { children: "标题" }),
1065
- /* @__PURE__ */ e("th", { children: "描述" }),
1066
- /* @__PURE__ */ e("th", { style: { width: 100 }, children: "状态" }),
1067
- /* @__PURE__ */ e("th", { style: { width: 100 }, children: "操作" })
1068
- ] }) }),
1069
- /* @__PURE__ */ e("tbody", { children: i.map((m) => /* @__PURE__ */ a("tr", { children: [
1070
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: `${t.priority} ${d(m.priority)}`, children: m.priority }) }),
1071
- /* @__PURE__ */ e("td", { children: m.title }),
1072
- /* @__PURE__ */ e("td", { style: { color: "var(--text-tertiary, #999)" }, children: m.description }),
1073
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: `${t.status} ${u(m.status)}`, children: m.status }) }),
1074
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
1075
- "button",
1076
- {
1077
- className: `${t.btn} ${t.btnDanger}`,
1078
- onClick: () => n(m.id),
1079
- children: /* @__PURE__ */ e(ne, {})
1080
- }
1081
- ) })
1082
- ] }, m.id)) })
1083
- ] })
1084
- ] });
1085
- }
1086
- function _i({
1087
- features: i,
1088
- onDecompose: s
1089
- }) {
1090
- return /* @__PURE__ */ a("div", { children: [
1091
- /* @__PURE__ */ a("div", { className: t.toolbar, children: [
1092
- /* @__PURE__ */ a("h3", { style: { margin: 0, fontSize: 14 }, children: [
1093
- "功能拆分 (",
1094
- i.length,
1095
- ")"
1096
- ] }),
1097
- /* @__PURE__ */ a(
1098
- "button",
1099
- {
1100
- className: `${t.btn} ${t.btnPrimary}`,
1101
- onClick: s,
1102
- title: "根据业务需求自动生成 FEATURE-XXX",
1103
- children: [
1104
- /* @__PURE__ */ e(G, {}),
1105
- " 一键拆分"
1106
- ]
1107
- }
1108
- )
1109
- ] }),
1110
- i.length === 0 ? /* @__PURE__ */ e("div", { className: t.empty, children: '暂无功能,先在"业务需求"录入需求,再点击"一键拆分"' }) : /* @__PURE__ */ a("table", { className: t.table, children: [
1111
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ a("tr", { children: [
1112
- /* @__PURE__ */ e("th", { style: { width: 120 }, children: "编号" }),
1113
- /* @__PURE__ */ e("th", { children: "名称" }),
1114
- /* @__PURE__ */ e("th", { children: "描述" }),
1115
- /* @__PURE__ */ e("th", { style: { width: 100 }, children: "状态" }),
1116
- /* @__PURE__ */ e("th", { style: { width: 220 }, children: "文档路径" })
1117
- ] }) }),
1118
- /* @__PURE__ */ e("tbody", { children: i.map((n) => /* @__PURE__ */ a("tr", { children: [
1119
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: t.featureNo, children: n.featureNo }) }),
1120
- /* @__PURE__ */ e("td", { children: n.name }),
1121
- /* @__PURE__ */ e("td", { style: { color: "var(--text-tertiary, #999)" }, children: n.description }),
1122
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: t.status, children: n.status }) }),
1123
- /* @__PURE__ */ e("td", { style: { fontSize: 11, color: "var(--text-tertiary, #999)" }, children: n.docPath })
1124
- ] }, n.id)) })
1125
- ] })
1126
- ] });
1127
- }
1128
- function Ni({
1129
- onCancel: i,
1130
- onSubmit: s
1131
- }) {
1132
- const [n, d] = h(""), [u, m] = h("");
1133
- return /* @__PURE__ */ e("div", { className: t.modal, children: /* @__PURE__ */ a("div", { className: t.modalBody, children: [
1134
- /* @__PURE__ */ e("div", { className: t.modalTitle, children: "新建产品" }),
1135
- /* @__PURE__ */ e("label", { className: t.formLabel, children: "产品名称 *" }),
1136
- /* @__PURE__ */ e(
1137
- "input",
1138
- {
1139
- className: t.formInput,
1140
- value: n,
1141
- onChange: (l) => d(l.target.value),
1142
- placeholder: "例如:智能客服平台"
1143
- }
1144
- ),
1145
- /* @__PURE__ */ e("label", { className: t.formLabel, children: "产品愿景" }),
1146
- /* @__PURE__ */ e(
1147
- "textarea",
1148
- {
1149
- className: t.formTextarea,
1150
- value: u,
1151
- onChange: (l) => m(l.target.value),
1152
- placeholder: "简要描述愿景..."
1153
- }
1154
- ),
1155
- /* @__PURE__ */ a("div", { className: t.modalActions, children: [
1156
- /* @__PURE__ */ e("button", { className: t.btn, onClick: i, children: "取消" }),
1157
- /* @__PURE__ */ a(
1158
- "button",
1159
- {
1160
- className: `${t.btn} ${t.btnPrimary}`,
1161
- onClick: () => n && s({ name: n, vision: u, status: "DRAFT" }),
1162
- disabled: !n,
1163
- children: [
1164
- /* @__PURE__ */ e(H, {}),
1165
- " 创建"
1166
- ]
1167
- }
1168
- )
1169
- ] })
1170
- ] }) });
1171
- }
1172
- function vi({
1173
- onCancel: i,
1174
- onSubmit: s
1175
- }) {
1176
- const [n, d] = h(""), [u, m] = h(""), [l, f] = h("");
1177
- return /* @__PURE__ */ e("div", { className: t.modal, children: /* @__PURE__ */ a("div", { className: t.modalBody, children: [
1178
- /* @__PURE__ */ e("div", { className: t.modalTitle, children: "添加设计稿" }),
1179
- /* @__PURE__ */ e("label", { className: t.formLabel, children: "名称" }),
1180
- /* @__PURE__ */ e(
1181
- "input",
1182
- {
1183
- className: t.formInput,
1184
- value: n,
1185
- onChange: (r) => d(r.target.value),
1186
- placeholder: "首页 / 登录页 / 后台..."
1187
- }
1188
- ),
1189
- /* @__PURE__ */ e("label", { className: t.formLabel, children: "URL 或图片地址 *" }),
1190
- /* @__PURE__ */ e(
1191
- "input",
1192
- {
1193
- className: t.formInput,
1194
- value: u,
1195
- onChange: (r) => m(r.target.value),
1196
- placeholder: "https://... 或 Figma link"
1197
- }
1198
- ),
1199
- /* @__PURE__ */ e("label", { className: t.formLabel, children: "说明" }),
1200
- /* @__PURE__ */ e(
1201
- "textarea",
1202
- {
1203
- className: t.formTextarea,
1204
- value: l,
1205
- onChange: (r) => f(r.target.value)
1206
- }
1207
- ),
1208
- /* @__PURE__ */ a("div", { className: t.modalActions, children: [
1209
- /* @__PURE__ */ e("button", { className: t.btn, onClick: i, children: "取消" }),
1210
- /* @__PURE__ */ a(
1211
- "button",
1212
- {
1213
- className: `${t.btn} ${t.btnPrimary}`,
1214
- onClick: () => u && s({ name: n, fileUrl: u, description: l, assetType: "IMAGE" }),
1215
- disabled: !u,
1216
- children: [
1217
- /* @__PURE__ */ e(H, {}),
1218
- " 添加"
1219
- ]
1220
- }
1221
- )
1222
- ] })
1223
- ] }) });
1224
- }
1225
- function yi({
1226
- onCancel: i,
1227
- onSubmit: s
1228
- }) {
1229
- const [n, d] = h(""), [u, m] = h(""), [l, f] = h("P1");
1230
- return /* @__PURE__ */ e("div", { className: t.modal, children: /* @__PURE__ */ a("div", { className: t.modalBody, children: [
1231
- /* @__PURE__ */ e("div", { className: t.modalTitle, children: "新增业务需求" }),
1232
- /* @__PURE__ */ e("label", { className: t.formLabel, children: "标题 *" }),
1233
- /* @__PURE__ */ e(
1234
- "input",
1235
- {
1236
- className: t.formInput,
1237
- value: n,
1238
- onChange: (r) => d(r.target.value),
1239
- placeholder: "例如:支持用户拖拽上传设计稿"
1240
- }
1241
- ),
1242
- /* @__PURE__ */ e("label", { className: t.formLabel, children: "描述" }),
1243
- /* @__PURE__ */ e(
1244
- "textarea",
1245
- {
1246
- className: t.formTextarea,
1247
- value: u,
1248
- onChange: (r) => m(r.target.value)
1249
- }
1250
- ),
1251
- /* @__PURE__ */ e("label", { className: t.formLabel, children: "优先级" }),
1252
- /* @__PURE__ */ a(
1253
- "select",
1254
- {
1255
- className: t.formInput,
1256
- value: l,
1257
- onChange: (r) => f(r.target.value),
1258
- children: [
1259
- /* @__PURE__ */ e("option", { value: "P0", children: "P0 - 紧急" }),
1260
- /* @__PURE__ */ e("option", { value: "P1", children: "P1 - 重要" }),
1261
- /* @__PURE__ */ e("option", { value: "P2", children: "P2 - 一般" }),
1262
- /* @__PURE__ */ e("option", { value: "P3", children: "P3 - 低" })
1263
- ]
1264
- }
1265
- ),
1266
- /* @__PURE__ */ a("div", { className: t.modalActions, children: [
1267
- /* @__PURE__ */ e("button", { className: t.btn, onClick: i, children: "取消" }),
1268
- /* @__PURE__ */ a(
1269
- "button",
1270
- {
1271
- className: `${t.btn} ${t.btnPrimary}`,
1272
- onClick: () => n && s({ title: n, description: u, priority: l }),
1273
- disabled: !n,
1274
- children: [
1275
- /* @__PURE__ */ e(H, {}),
1276
- " 添加"
1277
- ]
1278
- }
1279
- )
1280
- ] })
1281
- ] }) });
1282
- }
1283
- function zi({ items: i }) {
1284
- const [s, n] = h(null), [d, u] = h(""), m = (r, g) => {
1285
- if (!r) return g;
1286
- try {
1287
- return JSON.parse(r);
1288
- } catch {
1289
- return g;
1290
- }
1291
- }, l = d.trim() ? i.filter((r) => m(r.impactedPages, []).some((_) => _.includes(d.trim()))) : i, f = (r) => r === "P0" ? t.priorityP0 : r === "P1" ? t.priorityP1 : t.priorityP2;
1292
- return l.length > 0 && (!s || !l.find((r) => r.id === s.id)) && n(l[0]), /* @__PURE__ */ a("div", { className: t.bizLayout, children: [
1293
- /* @__PURE__ */ a("div", { className: t.bizList, children: [
1294
- /* @__PURE__ */ a("div", { className: t.bizFilter, children: [
1295
- /* @__PURE__ */ e(
1296
- "input",
1297
- {
1298
- className: t.formInput,
1299
- placeholder: "反向追溯: 输入页面编码 (如 ctc.4a.account)",
1300
- value: d,
1301
- onChange: (r) => u(r.target.value)
1302
- }
1303
- ),
1304
- d && /* @__PURE__ */ a("span", { className: t.bizFilterHint, children: [
1305
- l.length,
1306
- " 篇稿件涉及该页面"
1307
- ] })
1308
- ] }),
1309
- /* @__PURE__ */ a("div", { className: t.bizListHeader, children: [
1310
- "业务理解 / 跨页面因果链 (",
1311
- l.length,
1312
- ")"
1313
- ] }),
1314
- l.length === 0 ? /* @__PURE__ */ e("div", { className: t.empty, children: d ? `没有稿件涉及「${d}」` : "暂无稿件, 请先在 DBA 层跑建表 SQL + 种子数据" }) : l.map((r) => {
1315
- var _;
1316
- const g = m(r.impactedPages, []);
1317
- return /* @__PURE__ */ a(
1318
- "div",
1319
- {
1320
- className: `${t.bizItem} ${(s == null ? void 0 : s.id) === r.id ? t.bizItemActive : ""}`,
1321
- onClick: () => n(r),
1322
- children: [
1323
- /* @__PURE__ */ a("div", { className: t.bizItemHeader, children: [
1324
- /* @__PURE__ */ e("span", { className: `${t.priority} ${f(r.priority)}`, children: r.priority }),
1325
- /* @__PURE__ */ e("span", { className: t.bizItemTitle, children: r.title }),
1326
- /* @__PURE__ */ e("span", { className: t.bizItemStatus, children: r.status })
1327
- ] }),
1328
- /* @__PURE__ */ e("div", { className: t.bizItemSummary, children: r.summary }),
1329
- /* @__PURE__ */ a("div", { className: t.bizItemMeta, children: [
1330
- "触发: ",
1331
- ((_ = m(r.triggerInfo, {})) == null ? void 0 : _.page) || "-",
1332
- /* @__PURE__ */ e("span", { className: t.bizItemDot, children: "•" }),
1333
- "影响 ",
1334
- g.length,
1335
- " 个页面"
1336
- ] })
1337
- ]
1338
- },
1339
- r.id
1340
- );
1341
- })
1342
- ] }),
1343
- /* @__PURE__ */ e("div", { className: t.bizDetail, children: s ? /* @__PURE__ */ a(ce, { children: [
1344
- /* @__PURE__ */ a("div", { className: t.bizDetailHeader, children: [
1345
- /* @__PURE__ */ e("div", { className: t.bizDetailTitle, children: s.title }),
1346
- /* @__PURE__ */ e("div", { className: t.bizDetailCode, children: s.bizCode })
1347
- ] }),
1348
- /* @__PURE__ */ a("div", { className: t.bizSection, children: [
1349
- /* @__PURE__ */ a("div", { className: t.bizSectionTitle, children: [
1350
- /* @__PURE__ */ e(G, {}),
1351
- " 触发信息"
1352
- ] }),
1353
- (() => {
1354
- const r = m(s.triggerInfo, {});
1355
- return /* @__PURE__ */ a("div", { className: t.bizTriggerCard, children: [
1356
- /* @__PURE__ */ a("div", { children: [
1357
- /* @__PURE__ */ e("b", { children: "页面:" }),
1358
- " ",
1359
- r.page || "-"
1360
- ] }),
1361
- /* @__PURE__ */ a("div", { children: [
1362
- /* @__PURE__ */ e("b", { children: "动作:" }),
1363
- " ",
1364
- r.action || "-"
1365
- ] }),
1366
- /* @__PURE__ */ a("div", { children: [
1367
- /* @__PURE__ */ e("b", { children: "元素:" }),
1368
- " ",
1369
- r.element || "-"
1370
- ] }),
1371
- r.preStates && r.preStates.length > 0 && /* @__PURE__ */ a("div", { children: [
1372
- /* @__PURE__ */ e("b", { children: "前置:" }),
1373
- " ",
1374
- r.preStates.join(" / ")
1375
- ] })
1376
- ] });
1377
- })()
1378
- ] }),
1379
- /* @__PURE__ */ a("div", { className: t.bizSection, children: [
1380
- /* @__PURE__ */ a("div", { className: t.bizSectionTitle, children: [
1381
- "⚡ 跨页面连带效应 (",
1382
- m(s.crossPageEffects, []).length,
1383
- ")"
1384
- ] }),
1385
- /* @__PURE__ */ e("div", { className: t.bizEffects, children: m(s.crossPageEffects, []).map((r, g) => /* @__PURE__ */ a("div", { className: t.bizEffectCard, children: [
1386
- /* @__PURE__ */ a("div", { className: t.bizEffectPage, children: [
1387
- /* @__PURE__ */ e("span", { className: t.bizEffectArrow, children: "→" }),
1388
- /* @__PURE__ */ e("span", { className: t.bizEffectPageCode, children: r.page }),
1389
- /* @__PURE__ */ e("span", { className: t.bizEffectDelay, children: r.delay })
1390
- ] }),
1391
- /* @__PURE__ */ a("div", { className: t.bizEffectType, children: [
1392
- "[",
1393
- r.effectType,
1394
- "]"
1395
- ] }),
1396
- /* @__PURE__ */ e("div", { className: t.bizEffectDesc, children: r.description })
1397
- ] }, g)) })
1398
- ] }),
1399
- s.story && /* @__PURE__ */ a("div", { className: t.bizSection, children: [
1400
- /* @__PURE__ */ e("div", { className: t.bizSectionTitle, children: "📖 故事正文" }),
1401
- /* @__PURE__ */ e("pre", { className: t.bizStory, children: s.story })
1402
- ] })
1403
- ] }) : /* @__PURE__ */ e("div", { className: t.empty, children: "从左侧选择一份稿件查看因果链详情" }) })
1404
- ] });
1405
- }
1406
- export {
1407
- Si as default
1408
- };