feat(edit): 编辑上报细节优化

This commit is contained in:
2026-10-06 18:30:05 +08:00
parent e20cd7547f
commit 79b310efe7
92 changed files with 2764 additions and 368 deletions
@@ -0,0 +1,19 @@
import { App, Button } from 'antd';
import { CopyOutlined } from '@ant-design/icons';
/** 直接复制表单或预览原文,保留换行和空行,不从页面排版提取文本。 */
export function CopyTextButton({ getText, label }: {
getText: () => string | null | undefined;
label: string;
}) {
const { message } = App.useApp();
return <Button type="text" icon={<CopyOutlined />} aria-label={label} title={label}
onClick={async () => {
const text = getText();
if (!text) { message.info('暂无可复制的内容'); return; }
try {
await navigator.clipboard.writeText(text);
message.success('已复制,换行格式已保留');
} catch { message.error('复制失败,请选中文本后复制'); }
}} />;
}