@hkyhy/marsun-components-core 0.1.44 → 0.1.45
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.
- package/dist/components/AgentHub/Report/Detail/ReportArchiveModal/index.d.ts +13 -0
- package/dist/components/AgentHub/Report/Detail/ReportArchiveModal/index.js +81 -0
- package/dist/components/AgentHub/Report/Detail/ReportArchiveModal/index.js.map +1 -0
- package/dist/components/AgentHub/Report/Detail/ReportArchiveModal/style.module.scss.js +11 -0
- package/dist/components/AgentHub/Report/Detail/ReportArchiveModal/style.module.scss.js.map +1 -0
- package/dist/components/AgentHub/Report/Detail/ReportExportLayout/index.d.ts +33 -0
- package/dist/components/AgentHub/Report/Detail/ReportExportLayout/index.js +113 -0
- package/dist/components/AgentHub/Report/Detail/ReportExportLayout/index.js.map +1 -0
- package/dist/components/AgentHub/Report/Detail/ReportExportLayout/style.module.scss.js +7 -0
- package/dist/components/AgentHub/Report/Detail/ReportExportLayout/style.module.scss.js.map +1 -0
- package/dist/components/AgentHub/Report/Detail/ReportHtmlPreview/index.d.ts +15 -0
- package/dist/components/AgentHub/Report/Detail/ReportHtmlPreview/index.js +105 -0
- package/dist/components/AgentHub/Report/Detail/ReportHtmlPreview/index.js.map +1 -0
- package/dist/components/AgentHub/Report/Detail/ReportHtmlPreview/style.module.scss.js +11 -0
- package/dist/components/AgentHub/Report/Detail/ReportHtmlPreview/style.module.scss.js.map +1 -0
- package/dist/components/AgentHub/Report/Detail/ReportVersionList/index.d.ts +14 -0
- package/dist/components/AgentHub/Report/Detail/ReportVersionList/index.js +91 -0
- package/dist/components/AgentHub/Report/Detail/ReportVersionList/index.js.map +1 -0
- package/dist/components/AgentHub/Report/Detail/ReportVersionList/style.module.scss.js +14 -0
- package/dist/components/AgentHub/Report/Detail/ReportVersionList/style.module.scss.js.map +1 -0
- package/dist/components/AgentHub/Report/Detail/ReportWorkspace/index.d.ts +13 -0
- package/dist/components/AgentHub/Report/Detail/ReportWorkspace/index.js +39 -0
- package/dist/components/AgentHub/Report/Detail/ReportWorkspace/index.js.map +1 -0
- package/dist/components/AgentHub/Report/Detail/ReportWorkspace/style.module.scss.js +9 -0
- package/dist/components/AgentHub/Report/Detail/ReportWorkspace/style.module.scss.js.map +1 -0
- package/dist/components/AgentHub/Report/Detail/index.d.ts +10 -0
- package/dist/components/AgentHub/Report/index.d.ts +1 -0
- package/dist/components/AgentHub/Report/types.d.ts +24 -0
- package/dist/components/PermissionBindPanel/PermissionBindPanel.d.ts +20 -0
- package/dist/components/PermissionBindPanel/PermissionBindPanel.js +302 -0
- package/dist/components/PermissionBindPanel/PermissionBindPanel.js.map +1 -0
- package/dist/components/PermissionBindPanel/index.d.ts +3 -0
- package/dist/components/PermissionBindPanel/types.d.ts +29 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +292 -280
- package/dist/index.js.map +1 -1
- package/dist/marsun-components-core.css +1 -1
- package/dist/styles/global.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type ReportArchiveModalProps = {
|
|
2
|
+
open: boolean;
|
|
3
|
+
archivedBy: string;
|
|
4
|
+
summary?: string;
|
|
5
|
+
metaLabel?: string;
|
|
6
|
+
busy?: boolean;
|
|
7
|
+
title?: string;
|
|
8
|
+
onCancel: () => void;
|
|
9
|
+
onConfirm: () => void;
|
|
10
|
+
};
|
|
11
|
+
/** 归档确认弹窗 — 归档人由业务传入(通常 SSO),只读 */
|
|
12
|
+
declare const ReportArchiveModal: React.FC<ReportArchiveModalProps>;
|
|
13
|
+
export default ReportArchiveModal;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx as r, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { Input as h, Button as d } from "antd";
|
|
3
|
+
import a from "classnames";
|
|
4
|
+
import e from "./style.module.scss.js";
|
|
5
|
+
import u from "../../../../Modal/Modal/index.js";
|
|
6
|
+
const y = ({
|
|
7
|
+
open: t,
|
|
8
|
+
archivedBy: c,
|
|
9
|
+
summary: l,
|
|
10
|
+
metaLabel: m,
|
|
11
|
+
busy: i,
|
|
12
|
+
title: n = "归档报告",
|
|
13
|
+
onCancel: s,
|
|
14
|
+
onConfirm: p
|
|
15
|
+
}) => /* @__PURE__ */ r(
|
|
16
|
+
u,
|
|
17
|
+
{
|
|
18
|
+
title: n,
|
|
19
|
+
open: t,
|
|
20
|
+
onCancel: s,
|
|
21
|
+
size: "S",
|
|
22
|
+
footer: /* @__PURE__ */ o(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
className: a(
|
|
26
|
+
"marsun-report-archive-modal-footer",
|
|
27
|
+
e["marsun-report-archive-modal-footer"]
|
|
28
|
+
),
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ r(d, { onClick: s, disabled: i, children: "取消" }),
|
|
31
|
+
/* @__PURE__ */ r(d, { type: "primary", loading: i, onClick: p, children: "确认归档" })
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
children: /* @__PURE__ */ o(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
className: a("marsun-report-archive-modal", e["marsun-report-archive-modal"]),
|
|
39
|
+
children: [
|
|
40
|
+
m ? /* @__PURE__ */ r(
|
|
41
|
+
"p",
|
|
42
|
+
{
|
|
43
|
+
className: a(
|
|
44
|
+
"marsun-report-archive-modal-meta",
|
|
45
|
+
e["marsun-report-archive-modal-meta"]
|
|
46
|
+
),
|
|
47
|
+
children: m
|
|
48
|
+
}
|
|
49
|
+
) : null,
|
|
50
|
+
l ? /* @__PURE__ */ r(
|
|
51
|
+
"p",
|
|
52
|
+
{
|
|
53
|
+
className: a(
|
|
54
|
+
"marsun-report-archive-modal-summary",
|
|
55
|
+
e["marsun-report-archive-modal-summary"]
|
|
56
|
+
),
|
|
57
|
+
children: l
|
|
58
|
+
}
|
|
59
|
+
) : null,
|
|
60
|
+
/* @__PURE__ */ o(
|
|
61
|
+
"label",
|
|
62
|
+
{
|
|
63
|
+
className: a(
|
|
64
|
+
"marsun-report-archive-modal-label",
|
|
65
|
+
e["marsun-report-archive-modal-label"]
|
|
66
|
+
),
|
|
67
|
+
children: [
|
|
68
|
+
"归档人",
|
|
69
|
+
/* @__PURE__ */ r(h, { value: c, disabled: !0, placeholder: "当前登录用户" })
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
export {
|
|
79
|
+
y as default
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/components/AgentHub/Report/Detail/ReportArchiveModal/index.tsx"],"sourcesContent":["import { Modal } from '@/components/Modal';\nimport { Button, Input } from 'antd';\nimport classNames from 'classnames';\nimport styles from './style.module.scss';\n\nexport type ReportArchiveModalProps = {\n open: boolean;\n archivedBy: string;\n summary?: string;\n metaLabel?: string;\n busy?: boolean;\n title?: string;\n onCancel: () => void;\n onConfirm: () => void;\n};\n\n/** 归档确认弹窗 — 归档人由业务传入(通常 SSO),只读 */\nconst ReportArchiveModal: React.FC<ReportArchiveModalProps> = ({\n open,\n archivedBy,\n summary,\n metaLabel,\n busy,\n title = '归档报告',\n onCancel,\n onConfirm,\n}) => (\n <Modal\n title={title}\n open={open}\n onCancel={onCancel}\n size=\"S\"\n footer={\n <div\n className={classNames(\n 'marsun-report-archive-modal-footer',\n styles['marsun-report-archive-modal-footer'],\n )}\n >\n <Button onClick={onCancel} disabled={busy}>\n 取消\n </Button>\n <Button type=\"primary\" loading={busy} onClick={onConfirm}>\n 确认归档\n </Button>\n </div>\n }\n >\n <div\n className={classNames('marsun-report-archive-modal', styles['marsun-report-archive-modal'])}\n >\n {metaLabel ? (\n <p\n className={classNames(\n 'marsun-report-archive-modal-meta',\n styles['marsun-report-archive-modal-meta'],\n )}\n >\n {metaLabel}\n </p>\n ) : null}\n {summary ? (\n <p\n className={classNames(\n 'marsun-report-archive-modal-summary',\n styles['marsun-report-archive-modal-summary'],\n )}\n >\n {summary}\n </p>\n ) : null}\n <label\n className={classNames(\n 'marsun-report-archive-modal-label',\n styles['marsun-report-archive-modal-label'],\n )}\n >\n 归档人\n <Input value={archivedBy} disabled placeholder=\"当前登录用户\" />\n </label>\n </div>\n </Modal>\n);\n\nexport default ReportArchiveModal;\n"],"names":["ReportArchiveModal","open","archivedBy","summary","metaLabel","busy","title","onCancel","onConfirm","jsx","Modal","jsxs","classNames","styles","Button","Input"],"mappings":";;;;;AAiBA,MAAMA,IAAwD,CAAC;AAAA,EAC7D,MAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,UAAAC;AAAA,EACA,WAAAC;AACF,MACE,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,OAAAJ;AAAA,IACA,MAAAL;AAAA,IACA,UAAAM;AAAA,IACA,MAAK;AAAA,IACL,QACE,gBAAAI;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWC;AAAA,UACT;AAAA,UACAC,EAAO,oCAAoC;AAAA,QAAA;AAAA,QAG7C,UAAA;AAAA,UAAA,gBAAAJ,EAACK,GAAA,EAAO,SAASP,GAAU,UAAUF,GAAM,UAAA,MAE3C;AAAA,UACA,gBAAAI,EAACK,KAAO,MAAK,WAAU,SAAST,GAAM,SAASG,GAAW,UAAA,OAAA,CAE1D;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IAIJ,UAAA,gBAAAG;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWC,EAAW,+BAA+BC,EAAO,6BAA6B,CAAC;AAAA,QAEzF,UAAA;AAAA,UAAAT,IACC,gBAAAK;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAWG;AAAA,gBACT;AAAA,gBACAC,EAAO,kCAAkC;AAAA,cAAA;AAAA,cAG1C,UAAAT;AAAA,YAAA;AAAA,UAAA,IAED;AAAA,UACHD,IACC,gBAAAM;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAWG;AAAA,gBACT;AAAA,gBACAC,EAAO,qCAAqC;AAAA,cAAA;AAAA,cAG7C,UAAAV;AAAA,YAAA;AAAA,UAAA,IAED;AAAA,UACJ,gBAAAQ;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAWC;AAAA,gBACT;AAAA,gBACAC,EAAO,mCAAmC;AAAA,cAAA;AAAA,cAE7C,UAAA;AAAA,gBAAA;AAAA,kCAEEE,GAAA,EAAM,OAAOb,GAAY,UAAQ,IAAC,aAAY,SAAA,CAAS;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAC1D;AAAA,MAAA;AAAA,IAAA;AAAA,EACF;AACF;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const r = {
|
|
2
|
+
"marsun-report-archive-modal": "_marsun-report-archive-modal_iroxn_1",
|
|
3
|
+
"marsun-report-archive-modal-meta": "_marsun-report-archive-modal-meta_iroxn_7",
|
|
4
|
+
"marsun-report-archive-modal-summary": "_marsun-report-archive-modal-summary_iroxn_8",
|
|
5
|
+
"marsun-report-archive-modal-label": "_marsun-report-archive-modal-label_iroxn_22",
|
|
6
|
+
"marsun-report-archive-modal-footer": "_marsun-report-archive-modal-footer_iroxn_30"
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
r as default
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=style.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ReportExportApi, ReportVersionItem } from '../../types';
|
|
3
|
+
export type ReportExportLayoutProps = {
|
|
4
|
+
reportId: string;
|
|
5
|
+
/** 注入 API;不传时需自行控制 versions/html(受控) */
|
|
6
|
+
api?: ReportExportApi;
|
|
7
|
+
archivedBy: string;
|
|
8
|
+
snapshot?: unknown;
|
|
9
|
+
eventSource?: string;
|
|
10
|
+
eventLabel?: string;
|
|
11
|
+
documentTitle?: string;
|
|
12
|
+
metaLabel?: string;
|
|
13
|
+
summary?: string;
|
|
14
|
+
/** 受控:版本列表(优先于 api 拉取结果展示时可合并) */
|
|
15
|
+
versions?: ReportVersionItem[];
|
|
16
|
+
/** 受控预览 HTML;若提供则不自动用 api 覆盖,除非 refresh */
|
|
17
|
+
html?: string;
|
|
18
|
+
formatTime?: (value: string) => string;
|
|
19
|
+
onError?: (message: string) => void;
|
|
20
|
+
onArchived?: () => void;
|
|
21
|
+
/** 页头操作区外的额外内容(如返回按钮所在页壳) */
|
|
22
|
+
toolbarExtra?: ReactNode;
|
|
23
|
+
className?: string;
|
|
24
|
+
/** 打开归档弹窗的外部控制;默认内部「归档」由业务页头触发时用 openArchive / onOpenArchiveChange */
|
|
25
|
+
archiveOpen?: boolean;
|
|
26
|
+
onArchiveOpenChange?: (open: boolean) => void;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* 报告导出工作台:左版本列表 + 右 HTML 预览 + 可选 api 编排。
|
|
30
|
+
* 纯 UI:无硬编码 `/api`;归档人由 props 传入。
|
|
31
|
+
*/
|
|
32
|
+
declare const ReportExportLayout: React.FC<ReportExportLayoutProps>;
|
|
33
|
+
export default ReportExportLayout;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { jsxs as O, jsx as w } from "react/jsx-runtime";
|
|
2
|
+
import { useState as a, useCallback as V, useEffect as Q } from "react";
|
|
3
|
+
import T from "classnames";
|
|
4
|
+
import U from "../ReportArchiveModal/index.js";
|
|
5
|
+
import W from "../ReportHtmlPreview/index.js";
|
|
6
|
+
import X from "../ReportVersionList/index.js";
|
|
7
|
+
import Y from "./style.module.scss.js";
|
|
8
|
+
const r = ({
|
|
9
|
+
reportId: i,
|
|
10
|
+
api: s,
|
|
11
|
+
archivedBy: c,
|
|
12
|
+
snapshot: f,
|
|
13
|
+
eventSource: H,
|
|
14
|
+
eventLabel: b,
|
|
15
|
+
documentTitle: g = "报告预览",
|
|
16
|
+
metaLabel: h,
|
|
17
|
+
summary: j,
|
|
18
|
+
versions: l,
|
|
19
|
+
html: m,
|
|
20
|
+
formatTime: N,
|
|
21
|
+
onError: e,
|
|
22
|
+
onArchived: n,
|
|
23
|
+
className: k,
|
|
24
|
+
archiveOpen: o,
|
|
25
|
+
onArchiveOpenChange: u
|
|
26
|
+
}) => {
|
|
27
|
+
const [M, S] = a([]), [q, d] = a(""), [z, x] = a(!1), [B, R] = a(!1), [D, F] = a(!1), G = l ?? M, I = m ?? q, J = o ?? D, L = (t) => {
|
|
28
|
+
u == null || u(t), o === void 0 && F(t);
|
|
29
|
+
}, y = V(async () => {
|
|
30
|
+
if (!(!s || l))
|
|
31
|
+
try {
|
|
32
|
+
const t = await s.fetchVersions(i);
|
|
33
|
+
S(t || []);
|
|
34
|
+
} catch (t) {
|
|
35
|
+
e == null || e(t instanceof Error ? t.message : "归档历史加载失败");
|
|
36
|
+
}
|
|
37
|
+
}, [s, i, l, e]), v = V(async () => {
|
|
38
|
+
if (s) {
|
|
39
|
+
x(!0);
|
|
40
|
+
try {
|
|
41
|
+
const t = await s.fetchPreviewHtml(i, f);
|
|
42
|
+
d((t == null ? void 0 : t.html) || "");
|
|
43
|
+
} catch (t) {
|
|
44
|
+
e == null || e(t instanceof Error ? t.message : "预览加载失败"), d("");
|
|
45
|
+
} finally {
|
|
46
|
+
x(!1);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}, [s, i, f, e]);
|
|
50
|
+
Q(() => {
|
|
51
|
+
!i || !s || (y(), m === void 0 && v());
|
|
52
|
+
}, [i, s, y, v, m]);
|
|
53
|
+
const K = async () => {
|
|
54
|
+
if (s) {
|
|
55
|
+
if (!c.trim()) {
|
|
56
|
+
e == null || e("无法识别归档人");
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
R(!0);
|
|
60
|
+
try {
|
|
61
|
+
await s.archive({
|
|
62
|
+
reportId: i,
|
|
63
|
+
archivedBy: c.trim(),
|
|
64
|
+
snapshot: f,
|
|
65
|
+
eventSource: H,
|
|
66
|
+
eventLabel: b
|
|
67
|
+
}), L(!1), n == null || n(), await y();
|
|
68
|
+
} catch (t) {
|
|
69
|
+
e == null || e(t instanceof Error ? t.message : "归档失败");
|
|
70
|
+
} finally {
|
|
71
|
+
R(!1);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
return /* @__PURE__ */ O(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
className: T(
|
|
79
|
+
"marsun-report-export-layout",
|
|
80
|
+
Y["marsun-report-export-layout"],
|
|
81
|
+
k
|
|
82
|
+
),
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ w(X, { items: G, formatTime: N }),
|
|
85
|
+
/* @__PURE__ */ w(
|
|
86
|
+
W,
|
|
87
|
+
{
|
|
88
|
+
html: I,
|
|
89
|
+
loading: z,
|
|
90
|
+
documentTitle: g,
|
|
91
|
+
onRefresh: s ? () => void v() : void 0
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
/* @__PURE__ */ w(
|
|
95
|
+
U,
|
|
96
|
+
{
|
|
97
|
+
open: J,
|
|
98
|
+
archivedBy: c,
|
|
99
|
+
summary: j,
|
|
100
|
+
metaLabel: h,
|
|
101
|
+
busy: B,
|
|
102
|
+
onCancel: () => L(!1),
|
|
103
|
+
onConfirm: () => void K()
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
};
|
|
110
|
+
export {
|
|
111
|
+
r as default
|
|
112
|
+
};
|
|
113
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/components/AgentHub/Report/Detail/ReportExportLayout/index.tsx"],"sourcesContent":["import { useCallback, useEffect, useState, type ReactNode } from 'react';\nimport classNames from 'classnames';\nimport type { ReportExportApi, ReportVersionItem } from '../../types';\nimport ReportArchiveModal from '../ReportArchiveModal';\nimport ReportHtmlPreview from '../ReportHtmlPreview';\nimport ReportVersionList from '../ReportVersionList';\nimport styles from './style.module.scss';\n\nexport type ReportExportLayoutProps = {\n reportId: string;\n /** 注入 API;不传时需自行控制 versions/html(受控) */\n api?: ReportExportApi;\n archivedBy: string;\n snapshot?: unknown;\n eventSource?: string;\n eventLabel?: string;\n documentTitle?: string;\n metaLabel?: string;\n summary?: string;\n /** 受控:版本列表(优先于 api 拉取结果展示时可合并) */\n versions?: ReportVersionItem[];\n /** 受控预览 HTML;若提供则不自动用 api 覆盖,除非 refresh */\n html?: string;\n formatTime?: (value: string) => string;\n onError?: (message: string) => void;\n onArchived?: () => void;\n /** 页头操作区外的额外内容(如返回按钮所在页壳) */\n toolbarExtra?: ReactNode;\n className?: string;\n /** 打开归档弹窗的外部控制;默认内部「归档」由业务页头触发时用 openArchive / onOpenArchiveChange */\n archiveOpen?: boolean;\n onArchiveOpenChange?: (open: boolean) => void;\n};\n\n/**\n * 报告导出工作台:左版本列表 + 右 HTML 预览 + 可选 api 编排。\n * 纯 UI:无硬编码 `/api`;归档人由 props 传入。\n */\nconst ReportExportLayout: React.FC<ReportExportLayoutProps> = ({\n reportId,\n api,\n archivedBy,\n snapshot,\n eventSource,\n eventLabel,\n documentTitle = '报告预览',\n metaLabel,\n summary,\n versions: versionsProp,\n html: htmlProp,\n formatTime,\n onError,\n onArchived,\n className,\n archiveOpen: archiveOpenProp,\n onArchiveOpenChange,\n}) => {\n const [versionsInner, setVersionsInner] = useState<ReportVersionItem[]>([]);\n const [htmlInner, setHtmlInner] = useState('');\n const [previewLoading, setPreviewLoading] = useState(false);\n const [busy, setBusy] = useState(false);\n const [archiveOpenInner, setArchiveOpenInner] = useState(false);\n\n const versions = versionsProp ?? versionsInner;\n const html = htmlProp ?? htmlInner;\n const archiveOpen = archiveOpenProp ?? archiveOpenInner;\n\n const setArchiveOpen = (open: boolean) => {\n onArchiveOpenChange?.(open);\n if (archiveOpenProp === undefined) setArchiveOpenInner(open);\n };\n\n const loadVersions = useCallback(async () => {\n if (!api || versionsProp) return;\n try {\n const list = await api.fetchVersions(reportId);\n setVersionsInner(list || []);\n } catch (e) {\n onError?.(e instanceof Error ? e.message : '归档历史加载失败');\n }\n }, [api, reportId, versionsProp, onError]);\n\n const loadPreview = useCallback(async () => {\n if (!api) return;\n setPreviewLoading(true);\n try {\n const res = await api.fetchPreviewHtml(reportId, snapshot);\n setHtmlInner(res?.html || '');\n } catch (e) {\n onError?.(e instanceof Error ? e.message : '预览加载失败');\n setHtmlInner('');\n } finally {\n setPreviewLoading(false);\n }\n }, [api, reportId, snapshot, onError]);\n\n useEffect(() => {\n if (!reportId || !api) return;\n void loadVersions();\n if (htmlProp === undefined) void loadPreview();\n }, [reportId, api, loadVersions, loadPreview, htmlProp]);\n\n const handleArchive = async () => {\n if (!api) return;\n if (!archivedBy.trim()) {\n onError?.('无法识别归档人');\n return;\n }\n setBusy(true);\n try {\n await api.archive({\n reportId,\n archivedBy: archivedBy.trim(),\n snapshot,\n eventSource,\n eventLabel,\n });\n setArchiveOpen(false);\n onArchived?.();\n await loadVersions();\n } catch (e) {\n onError?.(e instanceof Error ? e.message : '归档失败');\n } finally {\n setBusy(false);\n }\n };\n\n return (\n <div\n className={classNames(\n 'marsun-report-export-layout',\n styles['marsun-report-export-layout'],\n className,\n )}\n >\n <ReportVersionList items={versions} formatTime={formatTime} />\n <ReportHtmlPreview\n html={html}\n loading={previewLoading}\n documentTitle={documentTitle}\n onRefresh={api ? () => void loadPreview() : undefined}\n />\n <ReportArchiveModal\n open={archiveOpen}\n archivedBy={archivedBy}\n summary={summary}\n metaLabel={metaLabel}\n busy={busy}\n onCancel={() => setArchiveOpen(false)}\n onConfirm={() => void handleArchive()}\n />\n </div>\n );\n};\n\nexport default ReportExportLayout;\n"],"names":["ReportExportLayout","reportId","api","archivedBy","snapshot","eventSource","eventLabel","documentTitle","metaLabel","summary","versionsProp","htmlProp","formatTime","onError","onArchived","className","archiveOpenProp","onArchiveOpenChange","versionsInner","setVersionsInner","useState","htmlInner","setHtmlInner","previewLoading","setPreviewLoading","busy","setBusy","archiveOpenInner","setArchiveOpenInner","versions","html","archiveOpen","setArchiveOpen","open","loadVersions","useCallback","list","e","loadPreview","res","useEffect","handleArchive","jsxs","classNames","styles","jsx","ReportVersionList","ReportHtmlPreview","ReportArchiveModal"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type ReportHtmlPreviewProps = {
|
|
3
|
+
html?: string;
|
|
4
|
+
loading?: boolean;
|
|
5
|
+
title?: string;
|
|
6
|
+
documentTitle?: string;
|
|
7
|
+
onRefresh?: () => void;
|
|
8
|
+
onPrint?: () => void;
|
|
9
|
+
extraActions?: ReactNode;
|
|
10
|
+
emptyDescription?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
/** HTML 报告预览(iframe srcDoc)+ 刷新/打印 */
|
|
14
|
+
declare const ReportHtmlPreview: React.FC<ReportHtmlPreviewProps>;
|
|
15
|
+
export default ReportHtmlPreview;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { jsxs as n, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { RefreshCw as f } from "../../../../Icons/index.js";
|
|
3
|
+
import i from "classnames";
|
|
4
|
+
import { Button as p } from "antd";
|
|
5
|
+
import s from "./style.module.scss.js";
|
|
6
|
+
import v from "../../../../Empty/Empty.js";
|
|
7
|
+
const b = ({
|
|
8
|
+
html: e,
|
|
9
|
+
loading: m,
|
|
10
|
+
title: l = "预览",
|
|
11
|
+
documentTitle: c = "报告预览",
|
|
12
|
+
onRefresh: o,
|
|
13
|
+
onPrint: a,
|
|
14
|
+
extraActions: u,
|
|
15
|
+
emptyDescription: d,
|
|
16
|
+
className: h
|
|
17
|
+
}) => {
|
|
18
|
+
const w = () => {
|
|
19
|
+
if (a) {
|
|
20
|
+
a();
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (!e) return;
|
|
24
|
+
const t = window.open("", "_blank");
|
|
25
|
+
t && (t.document.write(e), t.document.close(), t.focus(), t.print());
|
|
26
|
+
};
|
|
27
|
+
return /* @__PURE__ */ n(
|
|
28
|
+
"main",
|
|
29
|
+
{
|
|
30
|
+
className: i(
|
|
31
|
+
"marsun-report-html-preview",
|
|
32
|
+
s["marsun-report-html-preview"],
|
|
33
|
+
h
|
|
34
|
+
),
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ n(
|
|
37
|
+
"div",
|
|
38
|
+
{
|
|
39
|
+
className: i(
|
|
40
|
+
"marsun-report-html-preview-head",
|
|
41
|
+
s["marsun-report-html-preview-head"]
|
|
42
|
+
),
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ r(
|
|
45
|
+
"h3",
|
|
46
|
+
{
|
|
47
|
+
className: i(
|
|
48
|
+
"marsun-report-html-preview-title",
|
|
49
|
+
s["marsun-report-html-preview-title"]
|
|
50
|
+
),
|
|
51
|
+
children: l
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
/* @__PURE__ */ n(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
className: i(
|
|
58
|
+
"no-print",
|
|
59
|
+
"marsun-report-html-preview-actions",
|
|
60
|
+
s["marsun-report-html-preview-actions"]
|
|
61
|
+
),
|
|
62
|
+
children: [
|
|
63
|
+
o ? /* @__PURE__ */ r(
|
|
64
|
+
p,
|
|
65
|
+
{
|
|
66
|
+
size: "small",
|
|
67
|
+
icon: /* @__PURE__ */ r(f, { size: 14, spin: m }),
|
|
68
|
+
loading: m,
|
|
69
|
+
onClick: o,
|
|
70
|
+
children: "刷新预览"
|
|
71
|
+
}
|
|
72
|
+
) : null,
|
|
73
|
+
/* @__PURE__ */ r(p, { size: "small", disabled: !e, onClick: w, children: "打印" }),
|
|
74
|
+
u
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
e ? /* @__PURE__ */ r(
|
|
82
|
+
"iframe",
|
|
83
|
+
{
|
|
84
|
+
title: c,
|
|
85
|
+
className: i(
|
|
86
|
+
"marsun-report-html-preview-frame",
|
|
87
|
+
s["marsun-report-html-preview-frame"]
|
|
88
|
+
),
|
|
89
|
+
srcDoc: e
|
|
90
|
+
}
|
|
91
|
+
) : /* @__PURE__ */ r(
|
|
92
|
+
v,
|
|
93
|
+
{
|
|
94
|
+
iconType: "simple",
|
|
95
|
+
description: d || (m ? "预览加载中…" : "暂无预览内容")
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
};
|
|
102
|
+
export {
|
|
103
|
+
b as default
|
|
104
|
+
};
|
|
105
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/components/AgentHub/Report/Detail/ReportHtmlPreview/index.tsx"],"sourcesContent":["import { Empty } from '@/components/Empty';\nimport { RefreshCw } from '@/components/Icons';\nimport classNames from 'classnames';\nimport type { ReactNode } from 'react';\nimport { Button } from 'antd';\nimport styles from './style.module.scss';\n\nexport type ReportHtmlPreviewProps = {\n html?: string;\n loading?: boolean;\n title?: string;\n documentTitle?: string;\n onRefresh?: () => void;\n onPrint?: () => void;\n extraActions?: ReactNode;\n emptyDescription?: string;\n className?: string;\n};\n\n/** HTML 报告预览(iframe srcDoc)+ 刷新/打印 */\nconst ReportHtmlPreview: React.FC<ReportHtmlPreviewProps> = ({\n html,\n loading,\n title = '预览',\n documentTitle = '报告预览',\n onRefresh,\n onPrint,\n extraActions,\n emptyDescription,\n className,\n}) => {\n const handlePrint = () => {\n if (onPrint) {\n onPrint();\n return;\n }\n if (!html) return;\n const w = window.open('', '_blank');\n if (!w) return;\n w.document.write(html);\n w.document.close();\n w.focus();\n w.print();\n };\n\n return (\n <main\n className={classNames(\n 'marsun-report-html-preview',\n styles['marsun-report-html-preview'],\n className,\n )}\n >\n <div\n className={classNames(\n 'marsun-report-html-preview-head',\n styles['marsun-report-html-preview-head'],\n )}\n >\n <h3\n className={classNames(\n 'marsun-report-html-preview-title',\n styles['marsun-report-html-preview-title'],\n )}\n >\n {title}\n </h3>\n <div\n className={classNames(\n 'no-print',\n 'marsun-report-html-preview-actions',\n styles['marsun-report-html-preview-actions'],\n )}\n >\n {onRefresh ? (\n <Button\n size=\"small\"\n icon={<RefreshCw size={14} spin={loading} />}\n loading={loading}\n onClick={onRefresh}\n >\n 刷新预览\n </Button>\n ) : null}\n <Button size=\"small\" disabled={!html} onClick={handlePrint}>\n 打印\n </Button>\n {extraActions}\n </div>\n </div>\n {html ? (\n <iframe\n title={documentTitle}\n className={classNames(\n 'marsun-report-html-preview-frame',\n styles['marsun-report-html-preview-frame'],\n )}\n srcDoc={html}\n />\n ) : (\n <Empty\n iconType=\"simple\"\n description={emptyDescription || (loading ? '预览加载中…' : '暂无预览内容')}\n />\n )}\n </main>\n );\n};\n\nexport default ReportHtmlPreview;\n"],"names":["ReportHtmlPreview","html","loading","title","documentTitle","onRefresh","onPrint","extraActions","emptyDescription","className","handlePrint","w","jsxs","classNames","styles","jsx","Button","RefreshCw","Empty"],"mappings":";;;;;;AAoBA,MAAMA,IAAsD,CAAC;AAAA,EAC3D,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,eAAAC,IAAgB;AAAA,EAChB,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,cAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,WAAAC;AACF,MAAM;AACJ,QAAMC,IAAc,MAAM;AACxB,QAAIJ,GAAS;AACX,MAAAA,EAAA;AACA;AAAA,IACF;AACA,QAAI,CAACL,EAAM;AACX,UAAMU,IAAI,OAAO,KAAK,IAAI,QAAQ;AAClC,IAAKA,MACLA,EAAE,SAAS,MAAMV,CAAI,GACrBU,EAAE,SAAS,MAAA,GACXA,EAAE,MAAA,GACFA,EAAE,MAAA;AAAA,EACJ;AAEA,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACT;AAAA,QACAC,EAAO,4BAA4B;AAAA,QACnCL;AAAA,MAAA;AAAA,MAGF,UAAA;AAAA,QAAA,gBAAAG;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWC;AAAA,cACT;AAAA,cACAC,EAAO,iCAAiC;AAAA,YAAA;AAAA,YAG1C,UAAA;AAAA,cAAA,gBAAAC;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,WAAWF;AAAA,oBACT;AAAA,oBACAC,EAAO,kCAAkC;AAAA,kBAAA;AAAA,kBAG1C,UAAAX;AAAA,gBAAA;AAAA,cAAA;AAAA,cAEH,gBAAAS;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,WAAWC;AAAA,oBACT;AAAA,oBACA;AAAA,oBACAC,EAAO,oCAAoC;AAAA,kBAAA;AAAA,kBAG5C,UAAA;AAAA,oBAAAT,IACC,gBAAAU;AAAA,sBAACC;AAAA,sBAAA;AAAA,wBACC,MAAK;AAAA,wBACL,MAAM,gBAAAD,EAACE,GAAA,EAAU,MAAM,IAAI,MAAMf,GAAS;AAAA,wBAC1C,SAAAA;AAAA,wBACA,SAASG;AAAA,wBACV,UAAA;AAAA,sBAAA;AAAA,oBAAA,IAGC;AAAA,oBACJ,gBAAAU,EAACC,KAAO,MAAK,SAAQ,UAAU,CAACf,GAAM,SAASS,GAAa,UAAA,KAAA,CAE5D;AAAA,oBACCH;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAAA;AAAA,YACH;AAAA,UAAA;AAAA,QAAA;AAAA,QAEDN,IACC,gBAAAc;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,OAAOX;AAAA,YACP,WAAWS;AAAA,cACT;AAAA,cACAC,EAAO,kCAAkC;AAAA,YAAA;AAAA,YAE3C,QAAQb;AAAA,UAAA;AAAA,QAAA,IAGV,gBAAAc;AAAA,UAACG;AAAAA,UAAA;AAAA,YACC,UAAS;AAAA,YACT,aAAaV,MAAqBN,IAAU,WAAW;AAAA,UAAA;AAAA,QAAA;AAAA,MACzD;AAAA,IAAA;AAAA,EAAA;AAIR;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const r = {
|
|
2
|
+
"marsun-report-html-preview": "_marsun-report-html-preview_1n4x7_1",
|
|
3
|
+
"marsun-report-html-preview-head": "_marsun-report-html-preview-head_1n4x7_9",
|
|
4
|
+
"marsun-report-html-preview-title": "_marsun-report-html-preview-title_1n4x7_19",
|
|
5
|
+
"marsun-report-html-preview-actions": "_marsun-report-html-preview-actions_1n4x7_26",
|
|
6
|
+
"marsun-report-html-preview-frame": "_marsun-report-html-preview-frame_1n4x7_32"
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
r as default
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=style.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReportVersionItem } from '../../types';
|
|
2
|
+
export type ReportVersionListProps = {
|
|
3
|
+
items: ReportVersionItem[];
|
|
4
|
+
emptyDescription?: string;
|
|
5
|
+
/** 默认 formatDateTimeDisplay */
|
|
6
|
+
formatTime?: (value: string) => string;
|
|
7
|
+
selectedId?: string | null;
|
|
8
|
+
onSelect?: (item: ReportVersionItem) => void;
|
|
9
|
+
className?: string;
|
|
10
|
+
title?: string;
|
|
11
|
+
};
|
|
12
|
+
/** 报告版本 / 归档历史列表(扁平,无块级 border) */
|
|
13
|
+
declare const ReportVersionList: React.FC<ReportVersionListProps>;
|
|
14
|
+
export default ReportVersionList;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { jsxs as t, jsx as r, Fragment as d } from "react/jsx-runtime";
|
|
2
|
+
import { formatDateTimeDisplay as v } from "../../../../../utils/date.js";
|
|
3
|
+
import i from "classnames";
|
|
4
|
+
import s from "./style.module.scss.js";
|
|
5
|
+
import h from "../../../../VirtualScrollbar/VirtualScrollbar/index.js";
|
|
6
|
+
import f from "../../../../Empty/Empty.js";
|
|
7
|
+
const w = ({
|
|
8
|
+
items: l,
|
|
9
|
+
emptyDescription: m = "尚无归档",
|
|
10
|
+
formatTime: p = v,
|
|
11
|
+
selectedId: c,
|
|
12
|
+
onSelect: n,
|
|
13
|
+
className: u,
|
|
14
|
+
title: o = "归档历史"
|
|
15
|
+
}) => /* @__PURE__ */ t(
|
|
16
|
+
"aside",
|
|
17
|
+
{
|
|
18
|
+
className: i(
|
|
19
|
+
"marsun-report-version-list",
|
|
20
|
+
s["marsun-report-version-list"],
|
|
21
|
+
u
|
|
22
|
+
),
|
|
23
|
+
children: [
|
|
24
|
+
o ? /* @__PURE__ */ r(
|
|
25
|
+
"h3",
|
|
26
|
+
{
|
|
27
|
+
className: i(
|
|
28
|
+
"marsun-report-version-list-title",
|
|
29
|
+
s["marsun-report-version-list-title"]
|
|
30
|
+
),
|
|
31
|
+
children: o
|
|
32
|
+
}
|
|
33
|
+
) : null,
|
|
34
|
+
/* @__PURE__ */ r(
|
|
35
|
+
h,
|
|
36
|
+
{
|
|
37
|
+
className: i(
|
|
38
|
+
"marsun-report-version-list-scroll",
|
|
39
|
+
s["marsun-report-version-list-scroll"]
|
|
40
|
+
),
|
|
41
|
+
wrapperClassName: s["marsun-report-version-list-scroll-wrap"],
|
|
42
|
+
children: l.length === 0 ? /* @__PURE__ */ r(f, { iconType: "simple", description: m }) : /* @__PURE__ */ r(
|
|
43
|
+
"ul",
|
|
44
|
+
{
|
|
45
|
+
className: i(
|
|
46
|
+
"marsun-report-version-list-items",
|
|
47
|
+
s["marsun-report-version-list-items"]
|
|
48
|
+
),
|
|
49
|
+
children: l.map((e) => {
|
|
50
|
+
const a = /* @__PURE__ */ t(d, { children: [
|
|
51
|
+
/* @__PURE__ */ r("strong", { children: p(e.at) }),
|
|
52
|
+
e.by ? /* @__PURE__ */ t("span", { children: [
|
|
53
|
+
" · ",
|
|
54
|
+
e.by
|
|
55
|
+
] }) : null
|
|
56
|
+
] });
|
|
57
|
+
return n ? /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r(
|
|
58
|
+
"button",
|
|
59
|
+
{
|
|
60
|
+
type: "button",
|
|
61
|
+
className: i(
|
|
62
|
+
"marsun-report-version-list-item",
|
|
63
|
+
s["marsun-report-version-list-item"],
|
|
64
|
+
c === e.id && s["marsun-report-version-list-item--selected"]
|
|
65
|
+
),
|
|
66
|
+
onClick: () => n(e),
|
|
67
|
+
children: a
|
|
68
|
+
}
|
|
69
|
+
) }, e.id) : /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
className: i(
|
|
73
|
+
"marsun-report-version-list-item",
|
|
74
|
+
s["marsun-report-version-list-item"],
|
|
75
|
+
s["marsun-report-version-list-item--static"]
|
|
76
|
+
),
|
|
77
|
+
children: a
|
|
78
|
+
}
|
|
79
|
+
) }, e.id);
|
|
80
|
+
})
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
export {
|
|
89
|
+
w as default
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/components/AgentHub/Report/Detail/ReportVersionList/index.tsx"],"sourcesContent":["import { Empty } from '@/components/Empty';\nimport { VirtualScrollbar } from '@/components/VirtualScrollbar';\nimport { formatDateTimeDisplay } from '@/utils/date';\nimport classNames from 'classnames';\nimport type { ReportVersionItem } from '../../types';\nimport styles from './style.module.scss';\n\nexport type ReportVersionListProps = {\n items: ReportVersionItem[];\n emptyDescription?: string;\n /** 默认 formatDateTimeDisplay */\n formatTime?: (value: string) => string;\n selectedId?: string | null;\n onSelect?: (item: ReportVersionItem) => void;\n className?: string;\n title?: string;\n};\n\n/** 报告版本 / 归档历史列表(扁平,无块级 border) */\nconst ReportVersionList: React.FC<ReportVersionListProps> = ({\n items,\n emptyDescription = '尚无归档',\n formatTime = formatDateTimeDisplay,\n selectedId,\n onSelect,\n className,\n title = '归档历史',\n}) => {\n return (\n <aside\n className={classNames(\n 'marsun-report-version-list',\n styles['marsun-report-version-list'],\n className,\n )}\n >\n {title ? (\n <h3\n className={classNames(\n 'marsun-report-version-list-title',\n styles['marsun-report-version-list-title'],\n )}\n >\n {title}\n </h3>\n ) : null}\n <VirtualScrollbar\n className={classNames(\n 'marsun-report-version-list-scroll',\n styles['marsun-report-version-list-scroll'],\n )}\n wrapperClassName={styles['marsun-report-version-list-scroll-wrap']}\n >\n {items.length === 0 ? (\n <Empty iconType=\"simple\" description={emptyDescription} />\n ) : (\n <ul\n className={classNames(\n 'marsun-report-version-list-items',\n styles['marsun-report-version-list-items'],\n )}\n >\n {items.map((item) => {\n const label = (\n <>\n <strong>{formatTime(item.at)}</strong>\n {item.by ? <span> · {item.by}</span> : null}\n </>\n );\n if (!onSelect) {\n return (\n <li key={item.id}>\n <div\n className={classNames(\n 'marsun-report-version-list-item',\n styles['marsun-report-version-list-item'],\n styles['marsun-report-version-list-item--static'],\n )}\n >\n {label}\n </div>\n </li>\n );\n }\n return (\n <li key={item.id}>\n <button\n type=\"button\"\n className={classNames(\n 'marsun-report-version-list-item',\n styles['marsun-report-version-list-item'],\n selectedId === item.id && styles['marsun-report-version-list-item--selected'],\n )}\n onClick={() => onSelect(item)}\n >\n {label}\n </button>\n </li>\n );\n })}\n </ul>\n )}\n </VirtualScrollbar>\n </aside>\n );\n};\n\nexport default ReportVersionList;\n"],"names":["ReportVersionList","items","emptyDescription","formatTime","formatDateTimeDisplay","selectedId","onSelect","className","title","jsxs","classNames","styles","jsx","VirtualScrollbar","Empty","item","label","Fragment"],"mappings":";;;;;;AAmBA,MAAMA,IAAsD,CAAC;AAAA,EAC3D,OAAAC;AAAA,EACA,kBAAAC,IAAmB;AAAA,EACnB,YAAAC,IAAaC;AAAA,EACb,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC,IAAQ;AACV,MAEI,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC;AAAA,MACT;AAAA,MACAC,EAAO,4BAA4B;AAAA,MACnCJ;AAAA,IAAA;AAAA,IAGD,UAAA;AAAA,MAAAC,IACC,gBAAAI;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWF;AAAA,YACT;AAAA,YACAC,EAAO,kCAAkC;AAAA,UAAA;AAAA,UAG1C,UAAAH;AAAA,QAAA;AAAA,MAAA,IAED;AAAA,MACJ,gBAAAI;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,WAAWH;AAAA,YACT;AAAA,YACAC,EAAO,mCAAmC;AAAA,UAAA;AAAA,UAE5C,kBAAkBA,EAAO,wCAAwC;AAAA,UAEhE,UAAAV,EAAM,WAAW,IAChB,gBAAAW,EAACE,KAAM,UAAS,UAAS,aAAaZ,EAAA,CAAkB,IAExD,gBAAAU;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAWF;AAAA,gBACT;AAAA,gBACAC,EAAO,kCAAkC;AAAA,cAAA;AAAA,cAG1C,UAAAV,EAAM,IAAI,CAACc,MAAS;AACnB,sBAAMC,IACJ,gBAAAP,EAAAQ,GAAA,EACE,UAAA;AAAA,kBAAA,gBAAAL,EAAC,UAAA,EAAQ,UAAAT,EAAWY,EAAK,EAAE,GAAE;AAAA,kBAC5BA,EAAK,KAAK,gBAAAN,EAAC,QAAA,EAAK,UAAA;AAAA,oBAAA;AAAA,oBAAIM,EAAK;AAAA,kBAAA,EAAA,CAAG,IAAU;AAAA,gBAAA,GACzC;AAEF,uBAAKT,sBAgBF,MAAA,EACC,UAAA,gBAAAM;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,MAAK;AAAA,oBACL,WAAWF;AAAA,sBACT;AAAA,sBACAC,EAAO,iCAAiC;AAAA,sBACxCN,MAAeU,EAAK,MAAMJ,EAAO,2CAA2C;AAAA,oBAAA;AAAA,oBAE9E,SAAS,MAAML,EAASS,CAAI;AAAA,oBAE3B,UAAAC;AAAA,kBAAA;AAAA,gBAAA,EACH,GAXOD,EAAK,EAYd,sBA1BG,MAAA,EACC,UAAA,gBAAAH;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,WAAWF;AAAA,sBACT;AAAA,sBACAC,EAAO,iCAAiC;AAAA,sBACxCA,EAAO,yCAAyC;AAAA,oBAAA;AAAA,oBAGjD,UAAAK;AAAA,kBAAA;AAAA,gBAAA,EACH,GATOD,EAAK,EAUd;AAAA,cAkBN,CAAC;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAEJ;AAAA,EAAA;AAAA;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const r = {
|
|
2
|
+
"marsun-report-version-list": "_marsun-report-version-list_kqsq5_1",
|
|
3
|
+
"marsun-report-version-list-title": "_marsun-report-version-list-title_kqsq5_9",
|
|
4
|
+
"marsun-report-version-list-scroll-wrap": "_marsun-report-version-list-scroll-wrap_kqsq5_17",
|
|
5
|
+
"marsun-report-version-list-scroll": "_marsun-report-version-list-scroll_kqsq5_17",
|
|
6
|
+
"marsun-report-version-list-items": "_marsun-report-version-list-items_kqsq5_26",
|
|
7
|
+
"marsun-report-version-list-item": "_marsun-report-version-list-item_kqsq5_26",
|
|
8
|
+
"marsun-report-version-list-item--static": "_marsun-report-version-list-item--static_kqsq5_57",
|
|
9
|
+
"marsun-report-version-list-item--selected": "_marsun-report-version-list-item--selected_kqsq5_64"
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
r as default
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=style.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type ReportWorkspaceProps = {
|
|
3
|
+
/** 左侧列表(档案/会话等) */
|
|
4
|
+
list: ReactNode;
|
|
5
|
+
/** 右侧详情 / 预览 */
|
|
6
|
+
detail: ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* 报告/档案主从工作区 — 左列表右详情栅格(无业务 API)
|
|
11
|
+
*/
|
|
12
|
+
declare const ReportWorkspace: React.FC<ReportWorkspaceProps>;
|
|
13
|
+
export default ReportWorkspace;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsxs as p, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import r from "classnames";
|
|
3
|
+
import s from "./style.module.scss.js";
|
|
4
|
+
const l = ({ list: a, detail: o, className: t }) => /* @__PURE__ */ p(
|
|
5
|
+
"div",
|
|
6
|
+
{
|
|
7
|
+
className: r(
|
|
8
|
+
"marsun-report-workspace",
|
|
9
|
+
s["marsun-report-workspace"],
|
|
10
|
+
t
|
|
11
|
+
),
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ e(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
className: r(
|
|
17
|
+
"marsun-report-workspace-list",
|
|
18
|
+
s["marsun-report-workspace-list"]
|
|
19
|
+
),
|
|
20
|
+
children: a
|
|
21
|
+
}
|
|
22
|
+
),
|
|
23
|
+
/* @__PURE__ */ e(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
className: r(
|
|
27
|
+
"marsun-report-workspace-detail",
|
|
28
|
+
s["marsun-report-workspace-detail"]
|
|
29
|
+
),
|
|
30
|
+
children: o
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
export {
|
|
37
|
+
l as default
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/components/AgentHub/Report/Detail/ReportWorkspace/index.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport type { ReactNode } from 'react';\nimport styles from './style.module.scss';\n\nexport type ReportWorkspaceProps = {\n /** 左侧列表(档案/会话等) */\n list: ReactNode;\n /** 右侧详情 / 预览 */\n detail: ReactNode;\n className?: string;\n};\n\n/**\n * 报告/档案主从工作区 — 左列表右详情栅格(无业务 API)\n */\nconst ReportWorkspace: React.FC<ReportWorkspaceProps> = ({ list, detail, className }) => {\n return (\n <div\n className={classNames(\n 'marsun-report-workspace',\n styles['marsun-report-workspace'],\n className,\n )}\n >\n <div\n className={classNames(\n 'marsun-report-workspace-list',\n styles['marsun-report-workspace-list'],\n )}\n >\n {list}\n </div>\n <div\n className={classNames(\n 'marsun-report-workspace-detail',\n styles['marsun-report-workspace-detail'],\n )}\n >\n {detail}\n </div>\n </div>\n );\n};\n\nexport default ReportWorkspace;\n"],"names":["ReportWorkspace","list","detail","className","jsxs","classNames","styles","jsx"],"mappings":";;;AAeA,MAAMA,IAAkD,CAAC,EAAE,MAAAC,GAAM,QAAAC,GAAQ,WAAAC,QAErE,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC;AAAA,MACT;AAAA,MACAC,EAAO,yBAAyB;AAAA,MAChCH;AAAA,IAAA;AAAA,IAGF,UAAA;AAAA,MAAA,gBAAAI;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWF;AAAA,YACT;AAAA,YACAC,EAAO,8BAA8B;AAAA,UAAA;AAAA,UAGtC,UAAAL;AAAA,QAAA;AAAA,MAAA;AAAA,MAEH,gBAAAM;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWF;AAAA,YACT;AAAA,YACAC,EAAO,gCAAgC;AAAA,UAAA;AAAA,UAGxC,UAAAJ;AAAA,QAAA;AAAA,MAAA;AAAA,IACH;AAAA,EAAA;AAAA;"}
|