feat:검사 기준서 동적 필드 + 자동 하이라이트 + 미리보기 개선
- 문서 작성 시 연결 품목 규격(두께/너비/길이) 기반 자동 하이라이트 - 미리보기에서 field_values 동적 필드 데이터 정상 표시 - DocumentTemplateController에서 field_values 직렬화 추가 - DocumentController에 linkedItemSpecs 조회 로직 추가 - Item 모델 attributes JSON cast 추가 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -141,19 +141,22 @@ private function prepareTemplateData(DocumentTemplate $template): array
|
||||
'title' => $s->title,
|
||||
'image_path' => $s->image_path,
|
||||
'items' => $s->items->map(function ($i) {
|
||||
$fv = $i->field_values ?? [];
|
||||
|
||||
return [
|
||||
'id' => $i->id,
|
||||
'category' => $i->category,
|
||||
'item' => $i->item,
|
||||
'standard' => $i->standard,
|
||||
'tolerance' => $i->tolerance,
|
||||
'standard_criteria' => $i->standard_criteria,
|
||||
'method' => $i->method,
|
||||
'measurement_type' => $i->measurement_type,
|
||||
'frequency_n' => $i->frequency_n,
|
||||
'frequency_c' => $i->frequency_c,
|
||||
'frequency' => $i->frequency,
|
||||
'regulation' => $i->regulation,
|
||||
'category' => $fv['category'] ?? $i->category,
|
||||
'item' => $fv['item'] ?? $i->item,
|
||||
'standard' => $fv['standard'] ?? $i->standard,
|
||||
'tolerance' => $fv['tolerance'] ?? $i->tolerance,
|
||||
'standard_criteria' => $fv['standard_criteria'] ?? $i->standard_criteria,
|
||||
'method' => $fv['method'] ?? $i->method,
|
||||
'measurement_type' => $fv['measurement_type'] ?? $i->measurement_type,
|
||||
'frequency_n' => $fv['frequency_n'] ?? $i->frequency_n,
|
||||
'frequency_c' => $fv['frequency_c'] ?? $i->frequency_c,
|
||||
'frequency' => $fv['frequency'] ?? $i->frequency,
|
||||
'regulation' => $fv['regulation'] ?? $i->regulation,
|
||||
'field_values' => $fv,
|
||||
];
|
||||
})->toArray(),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user