yeg
2026-09-08 8781e056353216d82d9a5b42d8abe074217324a0
修复化成曲线默认工步选择
1个文件已修改
13 ■■■■■ 已修改文件
src/views/FormationReportForm.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/FormationReportForm.vue
@@ -193,6 +193,19 @@
    if (sequence !== previewSequence) return
    items.value = result.items
    cycleNos.value = result.cycleNos
    // 可靠识别的充放电工步默认全部纳入曲线;未知类型留给操作员人工指定。
    const nextSelections: Record<string, FormationStepSelection> = { ...curveStepSelections.value }
    for (const item of items.value) for (const cycle of item.cycleNos) {
      const key = formationCycleKey(item, cycle)
      const choices = item.chargeSteps?.[String(cycle)] ?? []
      const charge = choices.filter(step => step.direction === 'CHARGE').map(step => step.stepNo)
      const discharge = choices.filter(step => step.direction === 'DISCHARGE').map(step => step.stepNo)
      const existing = nextSelections[key]
      nextSelections[key] = existing
        ? { charge: existing.charge ?? charge, discharge: existing.discharge ?? discharge }
        : { charge, discharge }
    }
    curveStepSelections.value = nextSelections
    fields.value = fields.value.map(field => field.kind === 'battery' && field.fieldDefinitionId == null
      ? { ...field, fieldDefinitionId: items.value.flatMap(item => item.businessFields).find(value => value.fieldName === field.key)?.fieldDefinitionId ?? null } : field)
    pruneValues()