Merged PR 59: ass summarize scenario
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
<div v-for="input in scenario.inputs" :key="input.name"
|
<div v-for="input in scenario.inputs" :key="input.name"
|
||||||
:class="['input-container', input.type === 'textarea' ? 'col-span-12' : '']">
|
:class="['input-container', input.type === 'textarea' ? 'col-span-12' : '']">
|
||||||
|
|
||||||
<div v-if="input.type === 'singlefile'">
|
<div v-if="input.type === 'singlefile' || input.type === 'singlefile_acceptall'">
|
||||||
<label :for="input.name">
|
<label :for="input.name">
|
||||||
<b>{{ input.label }}</b>
|
<b>{{ input.label }}</b>
|
||||||
<i
|
<i
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
:url="uploadUrlPR"
|
:url="uploadUrlPR"
|
||||||
@upload="(event) => onUpload(event, 'SingleFileUpload')"
|
@upload="(event) => onUpload(event, 'SingleFileUpload')"
|
||||||
:multiple="false"
|
:multiple="false"
|
||||||
accept=".docx"
|
:accept="acceptedFormats"
|
||||||
auto
|
auto
|
||||||
:showUploadButton="false"
|
:showUploadButton="false"
|
||||||
:showCancelButton="false"
|
:showCancelButton="false"
|
||||||
@@ -356,6 +356,7 @@ const uploadUrlOther = ref("");
|
|||||||
// File che l'utente ha selezionato
|
// File che l'utente ha selezionato
|
||||||
const uploadedFiles = ref([]);
|
const uploadedFiles = ref([]);
|
||||||
const numberPrFiles = ref(0);
|
const numberPrFiles = ref(0);
|
||||||
|
const acceptedFormats = ref(".docx");
|
||||||
// :url="`http://localhost:8081/uploadListFiles/${folderName}`"
|
// :url="`http://localhost:8081/uploadListFiles/${folderName}`"
|
||||||
|
|
||||||
// Stato per l'ID univoco della cartella
|
// Stato per l'ID univoco della cartella
|
||||||
@@ -387,10 +388,12 @@ function stopTimer() {
|
|||||||
const isInputFilled = computed(() => {
|
const isInputFilled = computed(() => {
|
||||||
var isFilled = true;
|
var isFilled = true;
|
||||||
if(scenario.value.inputs === undefined) {
|
if(scenario.value.inputs === undefined) {
|
||||||
|
console.log("No inputs found");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
scenario.value.inputs.forEach(input => {
|
scenario.value.inputs.forEach(input => {
|
||||||
if(formData.value[input.name] === undefined || formData.value[input.name] === '') {
|
if(formData.value[input.name] === undefined || formData.value[input.name] === '') {
|
||||||
|
console.log("Input not filled: ", input.name);
|
||||||
isFilled= false;
|
isFilled= false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -426,6 +429,12 @@ watch(() => route.params.id, fetchScenario);
|
|||||||
if (scenario.value.inputs.some((input) => input.name === 'MultiFileUpload' || input.name === 'SingleFileUpload')) {
|
if (scenario.value.inputs.some((input) => input.name === 'MultiFileUpload' || input.name === 'SingleFileUpload')) {
|
||||||
reqMultiFile.value = true;
|
reqMultiFile.value = true;
|
||||||
}
|
}
|
||||||
|
if(scenario.value.inputs.some((input) => input.type === 'singlefile_acceptall')){
|
||||||
|
acceptedFormats.value = ".docx, .pdf, .doc, .txt, .msg";
|
||||||
|
}
|
||||||
|
if(scenario.value.inputs.some((input) => input.type === 'singlefile')){
|
||||||
|
acceptedFormats.value = ".docx";
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.error("Error fetching scenario:", error);
|
console.error("Error fetching scenario:", error);
|
||||||
@@ -813,7 +822,13 @@ if (xhr.status === 200) {
|
|||||||
// Risposta OK
|
// Risposta OK
|
||||||
|
|
||||||
if(uploadType==='SingleFileUpload'){
|
if(uploadType==='SingleFileUpload'){
|
||||||
formData.value['SingleFileUpload'] = "OK";
|
//formData.value['SingleFileUpload'] = "OK";
|
||||||
|
if (event.files && event.files.length > 0) {
|
||||||
|
console.log("File uploaded:", event.files);
|
||||||
|
formData.value['SingleFileUpload'] = event.files[0].name; // Nome del primo file
|
||||||
|
} else {
|
||||||
|
formData.value['SingleFileUpload'] = "UnknownFile";
|
||||||
|
}
|
||||||
numberPrFiles.value += 1;
|
numberPrFiles.value += 1;
|
||||||
console.log("Number of PR files: ", numberPrFiles.value);
|
console.log("Number of PR files: ", numberPrFiles.value);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user