Заменены чекбоксы docs_exist на блоки загрузки файлов
This commit is contained in:
@@ -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()}
|
||||
|
||||
Reference in New Issue
Block a user