diff --git a/.DS_Store b/.DS_Store index c7e173b..68e6571 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/dist.zip b/dist.zip deleted file mode 100644 index 197e669..0000000 Binary files a/dist.zip and /dev/null differ diff --git a/src/App.jsx b/src/App.jsx index 88ffb2c..1e639c3 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -17,11 +17,9 @@ function App() { // Load user from localStorage on app start useEffect(() => { const savedUser = localStorage.getItem('iMeetingUser'); - console.log('Saved user from localStorage:', savedUser); if (savedUser) { try { const parsedUser = JSON.parse(savedUser); - console.log('Parsed user:', parsedUser); setUser(parsedUser); } catch (error) { console.error('Error parsing saved user:', error); diff --git a/src/components/MindMap.jsx b/src/components/MindMap.jsx index 190a600..e5a92a4 100644 --- a/src/components/MindMap.jsx +++ b/src/components/MindMap.jsx @@ -86,8 +86,9 @@ const MindMap = ({ meetingId, meetingTitle, meeting, formatDateTime }) => { // 移除分隔线 processed = processed.replace(/^---+$/gm, ''); - // 如果没有主标题,添加一个 - if (!processed.startsWith('# ')) { + // 检查是否已经有一级标题,如果没有才添加 + const hasMainTitle = processed.match(/^#+\s+.*会议总结/m); + if (!processed.startsWith('# ') && !hasMainTitle) { processed = `# 会议总结\n\n${processed}`; } @@ -96,18 +97,25 @@ const MindMap = ({ meetingId, meetingTitle, meeting, formatDateTime }) => { let i = 0; while (i < lines.length) { - const line = lines[i].trim(); + const line = lines[i]; + const trimmedLine = line.trim(); - if (line === '') { + if (trimmedLine === '') { i++; continue; } // 处理标题行 - if (line.match(/^#+\s+/)) { + if (trimmedLine.match(/^#+\s+/)) { // 清理标题格式,移除粗体和多余符号 - let cleanTitle = line.replace(/\*\*([^*]+)\*\*/g, '$1'); // 移除粗体 + let cleanTitle = trimmedLine.replace(/\*\*([^*]+)\*\*/g, '$1'); // 移除粗体 cleanTitle = cleanTitle.replace(/[*_]/g, ''); // 移除其他markdown符号 + + // 如果是包含"会议总结"的标题,且不是一级标题,调整为一级标题 + if (cleanTitle.includes('会议总结') && !cleanTitle.startsWith('# ')) { + cleanTitle = `# ${cleanTitle.replace(/^#+\s*/, '')}`; + } + processedLines.push(cleanTitle); // 查看下一个非空行 @@ -119,16 +127,19 @@ const MindMap = ({ meetingId, meetingTitle, meeting, formatDateTime }) => { // 如果下一行不是标题、列表或表格,将段落内容转换为列表项 if (j < lines.length) { const nextLine = lines[j].trim(); - if (!nextLine.match(/^#+\s+/) && !nextLine.match(/^[-*+]\s+/) && !nextLine.includes('|') && nextLine.length > 0) { + const nextLineOriginal = lines[j]; + if (!nextLine.match(/^#+\s+/) && !nextLine.match(/^[-*+]\s+/) && !nextLineOriginal.match(/^\s+[-*+]\s+/) && !nextLine.includes('|') && nextLine.length > 0) { // 收集段落内容直到下一个标题、列表或表格 const paragraphLines = []; while (j < lines.length) { const currentLine = lines[j].trim(); + const currentLineOriginal = lines[j]; if (currentLine === '') { j++; continue; } - if (currentLine.match(/^#+\s+/) || currentLine.match(/^[-*+]\s+/) || currentLine.includes('|')) { + // 遇到标题、任何列表(包括缩进列表)或表格就停止 + if (currentLine.match(/^#+\s+/) || currentLine.match(/^[-*+]\s+/) || currentLineOriginal.match(/^\s+[-*+]\s+/) || currentLine.includes('|')) { break; } paragraphLines.push(currentLine); @@ -163,18 +174,21 @@ const MindMap = ({ meetingId, meetingTitle, meeting, formatDateTime }) => { } } } - // 处理列表项 - else if (line.match(/^[-*+]\s+/)) { - const cleanListItem = line.replace(/\*\*([^*]+)\*\*/g, '$1'); // 移除粗体 - processedLines.push(cleanListItem); + // 处理列表项,只保留顶级列表项(没有缩进的第一层) + else if (trimmedLine.match(/^[-*+]\s+/)) { + // 检查原始行是否有缩进(以空格或制表符开头) + if (!line.match(/^\s/)) { + const cleanListItem = trimmedLine.replace(/\*\*([^*]+)\*\*/g, '$1'); // 移除粗体 + processedLines.push(cleanListItem); + } } // 保持表格原样,让markmap自己处理 - else if (line.includes('|')) { - processedLines.push(line); + else if (trimmedLine.includes('|')) { + processedLines.push(trimmedLine); } // 处理其他普通段落(如果前面没有被处理) - else if (line.length > 0 && !line.match(/\*\*总字数:\d+字\*\*/)) { - processedLines.push(`- ${line}`); + else if (trimmedLine.length > 0 && !trimmedLine.match(/\*\*总字数:\d+字\*\*/)) { + processedLines.push(`- ${trimmedLine}`); } i++; @@ -193,14 +207,10 @@ const MindMap = ({ meetingId, meetingTitle, meeting, formatDateTime }) => { try { const processedMarkdown = preprocessMarkdownForMindMap(markdown); - console.log('原始markdown内容:', markdown); - console.log('预处理后的markdown:', processedMarkdown); const transformer = new Transformer(); const { root } = transformer.transform(processedMarkdown); - console.log('转换后的思维导图数据:', root); - if (markmapRef.current) { markmapRef.current.setData(root); } else { diff --git a/src/pages/AdminManagement.jsx b/src/pages/AdminManagement.jsx index e2f51fb..294c996 100644 --- a/src/pages/AdminManagement.jsx +++ b/src/pages/AdminManagement.jsx @@ -6,8 +6,6 @@ import UserManagement from '../components/admin/UserManagement'; import SystemConfiguration from '../components/admin/SystemConfiguration'; import './AdminManagement.css'; -const { TabPane } = Tabs; - const AdminManagement = () => { const navigate = useNavigate(); @@ -28,20 +26,22 @@ const AdminManagement = () => {