Исправлены проблемы с сохранением и убраны console.logs

This commit is contained in:
2025-07-22 07:45:13 +03:00
parent 1b17638565
commit 3275cdc661
18 changed files with 439 additions and 587 deletions

View File

@@ -44,13 +44,13 @@ export const Cell = memo(
// Отладка стилей для измененных ячеек
if (isModified) {
console.log(`🎨 Стили для измененной ячейки ${rowIndex},${colIndex}:`, {
className,
isModified,
isSelected,
displayValue,
highlightColor,
})
// console.log(`🎨 Стили для измененной ячейки ${rowIndex},${colIndex}:`, //{
// className,
// isModified,
// isSelected,
// displayValue,
// highlightColor,
//})
}
// Для объединенных ячеек нужно рассчитать правильные размеры
@@ -109,14 +109,14 @@ export const Cell = memo(
const handleClick = useCallback(
(e: React.MouseEvent) => {
console.log('🖱️ Cell клик:', {
rowIndex,
colIndex,
sheetType,
isInEditMode,
isSelected,
hasReferenceHandler: !!onCellReferenceClick,
})
// console.log('🖱️ Cell клик:', {
// rowIndex,
// colIndex,
// sheetType,
// isInEditMode,
// isSelected,
//hasReferenceHandler: !!onCellReferenceClick,
//})
// Если мы в режиме редактирования, вставка была обработана на mousedown.
// Останавливаем всплытие, чтобы родительский Spreadsheet не сменил активный лист.
@@ -127,17 +127,17 @@ export const Cell = memo(
}
// Обычная логика клика (выделение ячейки)
console.log('📍 Обычный клик - выбираем ячейку:', {
rowIndex,
colIndex,
sheetType,
})
// console.log('📍 Обычный клик - выбираем ячейку:', {
// rowIndex,
// colIndex,
// sheetType,
//})
// Подсказка для пользователя
if (!isInEditMode) {
console.log(
'💡 Чтобы вставить ссылку на ячейку: 1) Выберите ячейку 2) Нажмите F2 или Enter для редактирования 3) Кликните на нужную ячейку'
)
// console.log(
// '💡 Чтобы вставить ссылку на ячейку: 1) Выберите ячейку 2) Нажмите F2 или Enter для редактирования 3) Кликните на нужную ячейку'
//)
}
setActiveSheet(sheetType)
@@ -166,11 +166,11 @@ export const Cell = memo(
if (isInEditMode && onCellReferenceClick && !isSelected) {
e.preventDefault()
e.stopPropagation()
console.log('🖱️ mousedown вставка ссылки до blur:', {
rowIndex,
colIndex,
sheetType,
})
// console.log('🖱️ mousedown вставка ссылки до blur:', {
// rowIndex,
// colIndex,
// sheetType,
//})
onCellReferenceClick(sheetType, rowIndex, colIndex)
return
}

View File

@@ -55,16 +55,16 @@ export const CellRenderer = ({
// Отладка для измененных ячеек
if (cellData?.isModified) {
console.log(
`🔍 CellRenderer: Измененная ячейка ${rowIndex},${columnIndex}:`,
{
cellKey,
isModified: cellData.isModified,
displayValue,
rawValue,
highlightColor,
}
)
// console.log(
// `🔍 CellRenderer: Измененная ячейка ${rowIndex},${columnIndex}:`,
// {
// cellKey,
// isModified: cellData.isModified,
// displayValue,
// rawValue,
// highlightColor,
// }
// )
}
// Получаем информацию об объединенных ячейках только для листа отчета

View File

@@ -56,13 +56,13 @@ export const Spreadsheet = ({
}
// Отладочное логирование для проверки состояния
console.log(`📊 Spreadsheet ${sheetType} состояние:`, {
isEditing,
isInEditMode,
selectedCell,
activeSheet,
isActiveSheet: activeSheet === sheetType,
})
// console.log(`📊 Spreadsheet ${sheetType} состояние:`, {
// isEditing,
// isInEditMode,
// selectedCell,
// activeSheet,
// isActiveSheet: activeSheet === sheetType,
//})
const parentRef = useRef<HTMLDivElement>(null)
const [gridSize, setGridSize] = useState({ width: 0, height: 0 })