From ec45efb4440694dae6a1a943e6bd49fcd3000b87 Mon Sep 17 00:00:00 2001 From: Well Date: Wed, 3 Jul 2024 16:44:31 +0800 Subject: [PATCH] upload result v3 --- l2-frontend/src/components/UploadFile.vue | 2 ++ l2-frontend/src/components/types-and-forms-file.ts | 2 +- l2-frontend/src/ui-cards/LaboratoryHeader.vue | 12 ++++++++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/l2-frontend/src/components/UploadFile.vue b/l2-frontend/src/components/UploadFile.vue index 9eea5e58a5..dcb3d02541 100644 --- a/l2-frontend/src/components/UploadFile.vue +++ b/l2-frontend/src/components/UploadFile.vue @@ -144,6 +144,8 @@ const changeType = () => { currentFileForms.value = getForms(String(selectedType.value), props.formsFile, props.uploadResult); if (currentFileForms.value.length > 0) { selectedForm.value = currentFileForms.value[0].id; + } else { + selectedForm.value = null; } }; diff --git a/l2-frontend/src/components/types-and-forms-file.ts b/l2-frontend/src/components/types-and-forms-file.ts index 9268d8fb3d..0fbcc495cd 100644 --- a/l2-frontend/src/components/types-and-forms-file.ts +++ b/l2-frontend/src/components/types-and-forms-file.ts @@ -43,7 +43,7 @@ export default function typesAndForms() { }); // todo - режим UploadResult - получать по расширению файла - только функции связанные с сохранением результата (анализаторы) // todo - UploadResult + forms - получать только выбранные isResult функции - const getForms = (type: string, forms: string[] = [], onlyResult = false): formsFile[] => { + const getForms = (type: string, forms: string[] = null, onlyResult = false): formsFile[] => { let result: formsFile[] = []; if (forms && forms.length > 0) { for (const form of forms) { diff --git a/l2-frontend/src/ui-cards/LaboratoryHeader.vue b/l2-frontend/src/ui-cards/LaboratoryHeader.vue index 799468e6a5..742023dea8 100644 --- a/l2-frontend/src/ui-cards/LaboratoryHeader.vue +++ b/l2-frontend/src/ui-cards/LaboratoryHeader.vue @@ -36,7 +36,15 @@ - + @@ -46,7 +54,7 @@ import LaboratorySelector from '@/ui-cards/LaboratorySelector.vue'; import ExecutionList from '@/ui-cards/ExecutionList.vue'; import LaboratoryJournal from '@/ui-cards/LaboratoryJournal.vue'; import LaboratoryPrintResults from '@/ui-cards/LaboratoryPrintResults.vue'; -import UploadFileModal from "@/modals/UploadFileModal.vue"; +import UploadFileModal from '@/modals/UploadFileModal.vue'; export default { name: 'LaboratoryHeader',