- fix: sistemato pagina gruppo che non si visualizzava (errore per modifica)

- fix: corretto il "Invia RIS" al gruppo.
This commit is contained in:
Surya Paolo
2025-03-13 18:19:35 +01:00
parent f187fb2146
commit f5b0e693d0
24 changed files with 258 additions and 627 deletions

View File

@@ -24,6 +24,10 @@ export default defineComponent({
const $q = useQuasar()
const { t } = useI18n();
const log = ref('');
const log2 = ref('');
const numval = ref(20);
const loading = ref(false);
const filtroutente = ref(<any[]>[])
function getpayment() {
@@ -79,6 +83,26 @@ export default defineComponent({
]
}
async function runTest(ind: number) {
loading.value = true;
log.value = '';
try {
// Assicurati che l'URL di base di axios sia impostato correttamente
// Puoi configurarlo globalmente o usare direttamente import.meta.env.VITE_API_BASE_URL
const response = await globalStore.loadTest(ind, numval.value);
if (ind === 1)
log.value = response.data.log;
else if (ind === 2)
log2.value = response.data.log;
} catch (error) {
console.error('Errore nella chiamata a /testpao:', error);
log.value = 'Errore: ' + error.message;
} finally {
loading.value = false;
}
}
onMounted(mounted)
return {
@@ -88,6 +112,11 @@ export default defineComponent({
tools,
costanti,
filtroutente,
log,
log2,
loading,
runTest,
numval,
}
}
})

View File

@@ -1,137 +1,22 @@
<template>
<div class="q-pa-md">
<div class="q-gutter-md">
<q-select
filled
v-model="model"
clearable
use-input
hide-selected
fill-input
input-debounce="0"
label="Focus after filtering"
:options="options"
@filter="filterFn"
@filter-abort="abortFilterFn"
style="width: 250px"
>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey"> No results </q-item-section>
</q-item>
</template>
</q-select>
<q-select
filled
v-model="model"
clearable
use-input
hide-selected
fill-input
input-debounce="0"
label="Autoselect after filtering"
:options="options"
@filter="filterFnAutoselect"
@filter-abort="abortFilterFn"
style="width: 250px"
>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey"> No results </q-item-section>
</q-item>
</template>
</q-select>
<div class="q-pa-md">
<q-input v-model="numval" label="Num Valori"></q-input>
<q-btn label="Esegui Test MongoDB" @click="runTest(1)" color="primary" />
<q-spinner v-if="loading" size="50px" class="q-my-md" />
<pre v-if="log" class="q-mt-md">{{ log }}</pre>
</div>
<div class="q-pa-md">
<q-input v-model="numval" label="Num Valori"></q-input>
<q-btn label="Esegui Test FindByToken" @click="runTest(2)" color="primary" />
<q-spinner v-if="loading" size="50px" class="q-my-md" />
<pre v-if="log2" class="q-mt-md">{{ log2 }}</pre>
</div>
</div>
</div>
</template>
<script lang="ts">
import { ref } from "vue";
const stringOptions = [
"Google",
"Facebook",
"Twitter",
"Apple",
"Oracle",
].reduce((acc, opt) => {
for (let i = 1; i <= 5; i++) {
acc.push(opt + " " + i);
}
return acc;
}, []);
export default {
setup() {
const options = ref(stringOptions);
return {
model: ref(null),
options,
filterFn(val, update, abort) {
// call abort() at any time if you can't retrieve data somehow
setTimeout(() => {
update(
() => {
if (val === "") {
options.value = stringOptions;
} else {
const needle = val.toLowerCase();
options.value = stringOptions.filter(
(v) => v.toLowerCase().indexOf(needle) > -1
);
}
},
// "ref" is the Vue reference to the QSelect
(ref) => {
if (val !== "" && ref.options.length > 0) {
ref.setOptionIndex(-1); // reset optionIndex in case there is something selected
ref.moveOptionSelection(1, true); // focus the first selectable option and do not update the input-value
}
}
);
}, 300);
},
filterFnAutoselect(val, update, abort) {
// call abort() at any time if you can't retrieve data somehow
setTimeout(() => {
update(
() => {
if (val === "") {
options.value = stringOptions;
} else {
const needle = val.toLowerCase();
options.value = stringOptions.filter(
(v) => v.toLowerCase().indexOf(needle) > -1
);
}
},
// "ref" is the Vue reference to the QSelect
(ref) => {
if (
val !== "" &&
ref.options.length > 0 &&
ref.getOptionIndex() === -1
) {
ref.moveOptionSelection(1, true); // focus the first selectable option and do not update the input-value
ref.toggleOption(ref.options[ref.optionIndex], true); // toggle the focused option
}
}
);
}, 300);
},
abortFilterFn() {
// console.log('delayed filter aborted')
},
};
},
};
<script lang="ts" src="./test.ts">
</script>