fix(dc/tool-c): Fix special character handling and improve UX

Major fixes:
- Fix pivot transformation with special characters in column names
- Fix compute column validation for Chinese punctuation
- Fix recode dialog to fetch unique values from full dataset via new API
- Add column mapping mechanism to handle special characters

Database migration:
- Add column_mapping field to dc_tool_c_sessions table
- Migration file: 20251208_add_column_mapping

UX improvements:
- Darken table grid lines for better visibility
- Reduce column width by 40% with tooltip support
- Insert new columns next to source columns
- Preserve original row order after operations
- Add notice about 50-row preview limit

Modified files:
- Backend: SessionService, SessionController, QuickActionService, routes
- Python: pivot.py, compute.py, recode.py, binning.py, conditional.py
- Frontend: DataGrid, RecodeDialog, index.tsx, ag-grid-custom.css
- Database: schema.prisma, migration SQL

Status: Code complete, database migrated, ready for testing
This commit is contained in:
2025-12-08 23:20:55 +08:00
parent f729699510
commit 91cab452d1
90 changed files with 735 additions and 45 deletions

View File

@@ -860,6 +860,7 @@ model DcToolCSession {
totalRows Int @map("total_rows")
totalCols Int @map("total_cols")
columns Json @map("columns") // ["age", "gender", "diagnosis"] 列名数组
columnMapping Json? @map("column_mapping") // ✨ 列名映射:[{originalName, safeName, displayName}] 解决特殊字符问题
encoding String? @map("encoding") // 文件编码 utf-8, gbk等
fileSize Int @map("file_size") // 文件大小(字节)