исправлены желтые ячейки
This commit is contained in:
@@ -711,6 +711,7 @@ const DualSpreadsheet: FC<DualSpreadsheetProps> = ({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const reportTemplate = templateData?.[SHEET_NAMES.report]
|
const reportTemplate = templateData?.[SHEET_NAMES.report]
|
||||||
|
|
||||||
if (reportTemplate) {
|
if (reportTemplate) {
|
||||||
// Очищаем старые значения
|
// Очищаем старые значения
|
||||||
initialTemplateValues.current = {}
|
initialTemplateValues.current = {}
|
||||||
@@ -774,10 +775,23 @@ const DualSpreadsheet: FC<DualSpreadsheetProps> = ({
|
|||||||
|
|
||||||
const cellName = getColumnLabel(col) + (row + 1)
|
const cellName = getColumnLabel(col) + (row + 1)
|
||||||
const templateValue = initialTemplateValues.current[cellName] ?? ''
|
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 =
|
const isModified =
|
||||||
sheetType === 'report' &&
|
sheetType === 'report' &&
|
||||||
templateValue !== '' &&
|
normalizedTemplate !== '' &&
|
||||||
rawValue !== templateValue
|
normalizedRaw !== normalizedTemplate
|
||||||
|
|
||||||
cachedData[cellKey] = {
|
cachedData[cellKey] = {
|
||||||
displayValue,
|
displayValue,
|
||||||
|
|||||||
Reference in New Issue
Block a user