@yuku123/z-team-component 0.2.73 → 0.2.74

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