Phase 2A: WorkflowPlannerService, WorkflowExecutorService, Python data quality, 6 bug fixes, DescriptiveResultView, multi-step R code/Word export, MVP UI reuse. V11 UI: Gemini-style, multi-task, single-page scroll, Word export. Architecture: Block-based rendering consensus (4 block types). New R tools: chi_square, correlation, descriptive, logistic_binary, mann_whitney, t_test_paired. Docs: dev summary, block-based plan, status updates, task list v2.0. Co-authored-by: Cursor <cursoragent@cursor.com>
95 lines
2.3 KiB
TypeScript
95 lines
2.3 KiB
TypeScript
/**
|
|
* SSA-Pro 智能统计工作台 V11
|
|
*
|
|
* 100% 还原 V11 原型图设计
|
|
* - 左侧抽屉栏(可展开/收起)
|
|
* - 中间对话区(居中布局)
|
|
* - 右侧工作区(动态显示)
|
|
*
|
|
* 键盘快捷键:
|
|
* - Esc: 关闭工作区/代码模态框
|
|
* - Ctrl+B: 切换侧边栏
|
|
* - Ctrl+N: 新建分析
|
|
*/
|
|
import React, { useEffect, useCallback } from 'react';
|
|
import { useSSAStore } from './stores/ssaStore';
|
|
import { SSASidebar } from './components/SSASidebar';
|
|
import { SSAChatPane } from './components/SSAChatPane';
|
|
import { SSAWorkspacePane } from './components/SSAWorkspacePane';
|
|
import { SSACodeModal } from './components/SSACodeModal';
|
|
import { SSAToast } from './components/SSAToast';
|
|
import { DataProfileModal } from './components/DataProfileModal';
|
|
|
|
const SSAWorkspace: React.FC = () => {
|
|
const {
|
|
workspaceOpen,
|
|
setWorkspaceOpen,
|
|
codeModalVisible,
|
|
setCodeModalVisible,
|
|
sidebarExpanded,
|
|
setSidebarExpanded,
|
|
reset,
|
|
} = useSSAStore();
|
|
|
|
const handleKeyDown = useCallback((e: KeyboardEvent) => {
|
|
if (e.key === 'Escape') {
|
|
if (codeModalVisible) {
|
|
setCodeModalVisible(false);
|
|
} else if (workspaceOpen) {
|
|
setWorkspaceOpen(false);
|
|
}
|
|
}
|
|
|
|
if (e.ctrlKey || e.metaKey) {
|
|
if (e.key === 'b' || e.key === 'B') {
|
|
e.preventDefault();
|
|
setSidebarExpanded(!sidebarExpanded);
|
|
}
|
|
if (e.key === 'n' || e.key === 'N') {
|
|
e.preventDefault();
|
|
reset();
|
|
}
|
|
}
|
|
}, [
|
|
codeModalVisible,
|
|
workspaceOpen,
|
|
sidebarExpanded,
|
|
setCodeModalVisible,
|
|
setWorkspaceOpen,
|
|
setSidebarExpanded,
|
|
reset,
|
|
]);
|
|
|
|
useEffect(() => {
|
|
window.addEventListener('keydown', handleKeyDown);
|
|
return () => window.removeEventListener('keydown', handleKeyDown);
|
|
}, [handleKeyDown]);
|
|
|
|
return (
|
|
<div className="ssa-v11">
|
|
{/* Toast 容器 */}
|
|
<SSAToast />
|
|
|
|
{/* 左侧抽屉栏 */}
|
|
<SSASidebar />
|
|
|
|
{/* 主容器 */}
|
|
<div className="ssa-v11-main">
|
|
{/* 对话区 */}
|
|
<SSAChatPane />
|
|
|
|
{/* 工作区 */}
|
|
<SSAWorkspacePane />
|
|
</div>
|
|
|
|
{/* 代码模态框 */}
|
|
<SSACodeModal />
|
|
|
|
{/* Phase 2A: 数据质量报告详情模态框 */}
|
|
<DataProfileModal />
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default SSAWorkspace;
|