исправлены желтые ячейки
This commit is contained in:
@@ -711,6 +711,7 @@ const DualSpreadsheet: FC<DualSpreadsheetProps> = ({
|
||||
|
||||
useEffect(() => {
|
||||
const reportTemplate = templateData?.[SHEET_NAMES.report]
|
||||
|
||||
if (reportTemplate) {
|
||||
// Очищаем старые значения
|
||||
initialTemplateValues.current = {}
|
||||
@@ -774,10 +775,23 @@ const DualSpreadsheet: FC<DualSpreadsheetProps> = ({
|
||||
|
||||
const cellName = getColumnLabel(col) + (row + 1)
|
||||
const templateValue = initialTemplateValues.current[cellName] ?? ''
|
||||
|
||||
// Нормализуем значения для сравнения
|
||||
const normalizeValue = (value: any): string => {
|
||||
if (value === null || value === undefined) return ''
|
||||
const str = String(value).trim()
|
||||
// Считаем "0" и пустую строку эквивалентными
|
||||
if (str === '0' || str === '') return ''
|
||||
return str
|
||||
}
|
||||
|
||||
const normalizedTemplate = normalizeValue(templateValue)
|
||||
const normalizedRaw = normalizeValue(rawValue)
|
||||
|
||||
const isModified =
|
||||
sheetType === 'report' &&
|
||||
templateValue !== '' &&
|
||||
rawValue !== templateValue
|
||||
normalizedTemplate !== '' &&
|
||||
normalizedRaw !== normalizedTemplate
|
||||
|
||||
cachedData[cellKey] = {
|
||||
displayValue,
|
||||
|
||||
Reference in New Issue
Block a user