feat(dc-tool-c): Tool C UX重大改进 - 列头筛选/行号/滚动条/全量数据
新功能 - 列头筛选:Excel风格筛选功能(Community版本,中文本地化,显示唯一值及计数) - 行号列:添加固定行号列(#列头,灰色背景,左侧固定) - 全量数据加载:不再限制50行预览,Session加载全量数据 - 全量数据返回:所有快速操作(筛选/映射/分箱/条件/删NA/计算/Pivot)全量返回结果 Bug修复 - 滚动条终极修复:修改MainLayout为固定高度(h-screen + overflow-hidden),整个浏览器窗口无滚动条,只有AG Grid内部滚动 - 计算列全角字符修复:自动转换中文括号等全角字符为半角 - 计算列特殊字符列名修复:完善列别名机制,支持任意特殊字符列名 UI优化 - 删除'表格仅展示前50行'提示条,减少干扰 - 筛选对话框美化:白色背景,圆角,阴影 - 列头筛选图标优化:清晰可见,易于点击 文档更新 - 工具C_功能按钮开发计划_V1.0.md:添加V1.5版本记录 - 工具C_MVP开发_TODO清单.md:添加Day 8 UX优化内容 - 00-工具C当前状态与开发指南.md:更新进度为98% - 00-模块当前状态与开发指南.md:更新DC模块状态 - 00-系统当前状态与开发指南.md:更新系统整体状态 影响范围 - Python微服务:无修改 - Node.js后端:5处代码修改(SessionService + QuickActionController + AICodeService) - 前端:MainLayout + DataGrid + ag-grid-custom.css + index.tsx - 完成度:Tool C整体完成度提升至98% 代码统计 - 修改文件:~15个文件 - 新增行数:~200行 - 修改行数:~150行 Co-authored-by: AI Assistant <assistant@example.com>
This commit is contained in:
@@ -244,9 +244,9 @@ export class QuickActionController {
|
||||
// 历史保存失败不影响主流程
|
||||
}
|
||||
|
||||
// 8. 返回预览结果(前50行)
|
||||
// 8. 返回完整结果(⭐ 全量返回)
|
||||
const resultData = executeResult.result_data || [];
|
||||
const preview = resultData.slice(0, 50);
|
||||
const preview = resultData; // ⭐ 修改:全量返回,不再切片
|
||||
const duration = Date.now() - startTime;
|
||||
|
||||
logger.info(`[QuickAction] 操作成功: ${actionDescription}, 结果=${resultData.length}行, 耗时=${duration}ms, Python执行=${executeResult.execution_time?.toFixed(3)}s`);
|
||||
@@ -469,7 +469,7 @@ export class QuickActionController {
|
||||
return reply.code(200).send({
|
||||
success: true,
|
||||
data: {
|
||||
newDataPreview: resultData.slice(0, 50),
|
||||
newDataPreview: resultData, // ⭐ 修改:全量返回
|
||||
affectedRows: resultData.length,
|
||||
message: result.message || '填补成功',
|
||||
stats: result.stats
|
||||
@@ -491,14 +491,15 @@ export class QuickActionController {
|
||||
*/
|
||||
async handleFillnaMice(request: FastifyRequest, reply: FastifyReply) {
|
||||
try {
|
||||
const { sessionId, columns, nIterations, randomState } = request.body as {
|
||||
const { sessionId, columns, referenceColumns, nIterations, randomState } = request.body as {
|
||||
sessionId: string;
|
||||
columns: string[];
|
||||
referenceColumns?: string[]; // ⭐ 新增:参考列
|
||||
nIterations?: number;
|
||||
randomState?: number;
|
||||
};
|
||||
|
||||
logger.info(`[QuickAction] 执行MICE填补: session=${sessionId}, columns=${columns.length}个`);
|
||||
logger.info(`[QuickAction] 执行MICE填补: session=${sessionId}, columns=${columns.length}个, referenceColumns=${referenceColumns?.length || 0}个`);
|
||||
|
||||
// 获取Session数据
|
||||
const fullData = await sessionService.getFullData(sessionId);
|
||||
@@ -506,6 +507,7 @@ export class QuickActionController {
|
||||
// 调用Service执行MICE填补
|
||||
const result = await quickActionService.executeFillnaMice(fullData, {
|
||||
columns,
|
||||
referenceColumns, // ⭐ 新增:传递参考列
|
||||
nIterations,
|
||||
randomState
|
||||
});
|
||||
@@ -524,7 +526,7 @@ export class QuickActionController {
|
||||
return reply.code(200).send({
|
||||
success: true,
|
||||
data: {
|
||||
newDataPreview: resultData.slice(0, 50),
|
||||
newDataPreview: resultData, // ⭐ 修改:全量返回
|
||||
affectedRows: resultData.length,
|
||||
message: result.message || 'MICE填补成功',
|
||||
stats: result.stats
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* API端点:
|
||||
* - POST /sessions/upload 上传Excel文件创建Session
|
||||
* - GET /sessions/:id 获取Session信息
|
||||
* - GET /sessions/:id/preview 获取预览数据(前100行)
|
||||
* - GET /sessions/:id/preview 获取预览数据(⭐ 已改为全量加载)
|
||||
* - GET /sessions/:id/full 获取完整数据
|
||||
* - DELETE /sessions/:id 删除Session
|
||||
* - POST /sessions/:id/heartbeat 更新心跳
|
||||
@@ -151,7 +151,7 @@ export class SessionController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取预览数据(前100行)
|
||||
* 获取预览数据(⭐ 已改为全量加载)
|
||||
*
|
||||
* GET /api/v1/dc/tool-c/sessions/:id/preview
|
||||
*/
|
||||
|
||||
@@ -160,10 +160,10 @@ export class AICodeService {
|
||||
}
|
||||
});
|
||||
|
||||
// 4. 如果成功,保存完整处理结果到OSS并获取预览
|
||||
// 4. 如果成功,保存完整处理结果到OSS并获取完整数据
|
||||
if (result.success && result.result_data) {
|
||||
const preview = Array.isArray(result.result_data)
|
||||
? result.result_data.slice(0, 50)
|
||||
? result.result_data // ⭐ 修改:全量返回
|
||||
: result.result_data;
|
||||
|
||||
// ✅ 保存完整的处理结果到OSS(覆盖原文件)
|
||||
|
||||
@@ -86,6 +86,7 @@ interface FillnaSimpleParams {
|
||||
|
||||
interface FillnaMiceParams {
|
||||
columns: string[];
|
||||
referenceColumns?: string[]; // ⭐ 新增:参考列
|
||||
nIterations?: number;
|
||||
randomState?: number;
|
||||
}
|
||||
@@ -433,6 +434,7 @@ export class QuickActionService {
|
||||
const response = await axios.post(`${PYTHON_SERVICE_URL}/api/operations/fillna-mice`, {
|
||||
data,
|
||||
columns: params.columns,
|
||||
reference_columns: params.referenceColumns || [], // ⭐ 新增:传递参考列
|
||||
n_iterations: params.nIterations || 10,
|
||||
random_state: params.randomState || 42,
|
||||
}, {
|
||||
|
||||
@@ -222,10 +222,10 @@ export class SessionService {
|
||||
defval: null,
|
||||
});
|
||||
|
||||
// 4. 返回前100行
|
||||
const previewData = data.slice(0, PREVIEW_ROWS);
|
||||
// 4. ⭐ 返回全部数据(全量加载)
|
||||
const previewData = data; // ⭐ 修改:不再切片,返回全部数据
|
||||
|
||||
logger.info(`[SessionService] 预览数据获取成功: ${previewData.length}行`);
|
||||
logger.info(`[SessionService] 预览数据获取成功: ${previewData.length}行(全量)`);
|
||||
|
||||
return {
|
||||
...session,
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user