| | |
| | | const duration = /^(\d+):([0-5]\d):([0-5]\d)(?:\.(\d{1,3}))?$/.exec(value.trim()) |
| | | value = duration ? Number(duration[1]) * 3600 + Number(duration[2]) * 60 + Number(duration[3]) + Number((duration[4] || '').padEnd(3, '0')) / 1000 : NaN |
| | | } |
| | | if (party && ['temperature', 'positivePotential', 'negativePotential'].includes(field) && (value === undefined || value === '')) { |
| | | // 开发测试值只在甲方实时表缺值时补齐,按记录序号确定以保持重复导入幂等。 |
| | | const offset = Number(raw['记录序号']) % 10 |
| | | value = field === 'temperature' ? 25 + offset / 10 : field === 'positivePotential' ? (1500 + offset) / 1000 : (-100 - offset) / 1000 |
| | | } |
| | | const text = String(value ?? '').trim() |
| | | const fail = (reason: string) => errors.push(`第${sourceRow}行,列「${header}」:${reason}`) |
| | | if (['recordNo', 'batteryNo', 'stepName'].includes(field)) { |