Заменены чекбоксы docs_exist на блоки загрузки файлов

This commit is contained in:
Fedor
2025-11-25 23:20:33 +03:00
parent be1ac2ed49
commit b5478c143f

View File

@@ -1224,6 +1224,17 @@ export default function StepWizardPlan({
// Если в плане визарда есть документы, не показываем поля про загрузку (text/textarea/file)
const questionLabelLower = (question.label || '').toLowerCase();
const questionNameLower = (question.name || '').toLowerCase();
// Скрываем вопрос docs_exist (чекбоксы "какие документы есть") если есть документы
// Загрузка документов реализована через отдельные блоки под информационной карточкой
const isDocsExistQuestion = questionNameLower === 'docs_exist' ||
questionNameLower === 'correspondence_exist' ||
questionNameLower.includes('docs_exist');
if (isDocsExistQuestion && documents.length > 0) {
console.log(`🚫 Question ${question.name} hidden: docs_exist with documents`);
return null;
}
const isDocumentUploadQuestion =
(question.input_type === 'text' ||
question.input_type === 'textarea' ||
@@ -1405,6 +1416,23 @@ export default function StepWizardPlan({
))}
</Space>
</Card>
{/* Блоки загрузки для каждого документа из плана */}
<div style={{ marginTop: 16 }}>
<Text strong style={{ fontSize: 16, marginBottom: 16, display: 'block' }}>
Загрузите документы
</Text>
<Space direction="vertical" style={{ width: '100%' }}>
{documents.map((doc: any) => {
const docKey = doc.id || doc.name || `doc_${Math.random()}`;
return (
<div key={docKey}>
{renderDocumentBlocks(docKey, [doc])}
</div>
);
})}
</Space>
</div>
)}
{renderQuestions()}