corretto problema che si aggiornava a fatica... si bloccava... era una label che veniva continuamente azzerata e riscritta...
This commit is contained in:
@@ -98,12 +98,6 @@ export default defineComponent({
|
||||
const scale = ref(1)
|
||||
|
||||
|
||||
const valoriopt = computed(() => (item: any, addall: boolean, addnone: boolean) => {
|
||||
// console.log('valoriopt', item.table)
|
||||
return globalStore.getTableJoinByName(item.table, addall, addnone, item.filter)
|
||||
})
|
||||
|
||||
|
||||
watch(() => editOn.value, (to: any, from: any) => {
|
||||
if (!editOn.value)
|
||||
ricarica()
|
||||
@@ -266,15 +260,26 @@ export default defineComponent({
|
||||
})
|
||||
|
||||
function updateLabel() {
|
||||
if (myproduct.value.gasordine) {
|
||||
if (myproduct.value.gasordine.data_arrivo_merce)
|
||||
labelDataArrivoMerce.value = tools.getstrDateShort(myproduct.value.gasordine.data_arrivo_merce)
|
||||
if (myproduct.value.gasordine.dataora_ritiro)
|
||||
labelDataRitiro.value = tools.getstrDateTime(myproduct.value.gasordine.dataora_ritiro)
|
||||
} else {
|
||||
labelDataArrivoMerce.value = ''
|
||||
labelDataRitiro.value = ''
|
||||
let dataArrivoMerce = ''
|
||||
let dataRitiro = ''
|
||||
try {
|
||||
if (myproduct.value && myproduct.value.gasordine) {
|
||||
if (myproduct.value.gasordine.data_arrivo_merce)
|
||||
dataArrivoMerce = tools.getstrDateShort(myproduct.value.gasordine.data_arrivo_merce)
|
||||
if (myproduct.value.gasordine.dataora_ritiro)
|
||||
dataRitiro = tools.getstrDateTime(myproduct.value.gasordine.dataora_ritiro)
|
||||
} else {
|
||||
dataArrivoMerce = ''
|
||||
dataRitiro = ''
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
if (labelDataArrivoMerce.value !== dataArrivoMerce)
|
||||
labelDataArrivoMerce.value = dataArrivoMerce
|
||||
if (labelDataRitiro.value !== dataRitiro)
|
||||
labelDataRitiro.value = dataRitiro
|
||||
|
||||
updateTimerLabel()
|
||||
}
|
||||
|
||||
@@ -291,7 +296,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function updateTimerLabel() {
|
||||
if (myproduct.value.gasordine && myproduct.value.gasordine._id && myproduct.value.gasordine.dataora_chiusura_ordini)
|
||||
if (myproduct.value && myproduct.value.gasordine && myproduct.value.gasordine._id && myproduct.value.gasordine.dataora_chiusura_ordini)
|
||||
timerLabelScadenza.value = tools.getCountDown(myproduct.value.gasordine.dataora_chiusura_ordini)
|
||||
else
|
||||
timerLabelScadenza.value = ''
|
||||
@@ -304,12 +309,14 @@ export default defineComponent({
|
||||
|
||||
function startTimer() {
|
||||
// Update the timer label every second
|
||||
timerInterval.value = setInterval(() => updateTimerLabel(), 1000);
|
||||
timerInterval.value = setInterval(() => updateTimerLabel(), 60000);
|
||||
}
|
||||
|
||||
function load() {
|
||||
initproduct()
|
||||
updateproduct()
|
||||
labelDataArrivoMerce.value = ''
|
||||
labelDataRitiro.value = ''
|
||||
|
||||
// console.log('Load', myproduct.value.name)
|
||||
// console.log('created Cproductcard', code)
|
||||
|
||||
Reference in New Issue
Block a user