PASSAGGIO A VITE !
AGG. 1.1.23
This commit is contained in:
@@ -4,10 +4,11 @@ import { tools } from '../../store/Modules/tools'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useQuasar } from 'quasar'
|
||||
|
||||
import { Chart, BarController, BarElement, LineController, LinearScale, CategoryScale, PointElement, LineElement, Title, ChartItem, ChartConfiguration } from 'chart.js';
|
||||
import type { ChartItem, ChartConfiguration } from 'chart.js';
|
||||
import { Chart, BarController, BarElement, LineController, LinearScale, CategoryScale, PointElement, LineElement, Title } from 'chart.js';
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
@@ -68,7 +69,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function mounted() {
|
||||
Chart.register(BarController, BarElement,
|
||||
Chart.register(BarController, BarElement,
|
||||
LineController, LinearScale, CategoryScale, PointElement, LineElement, Title);
|
||||
|
||||
myarrdata.value = []
|
||||
@@ -87,30 +88,30 @@ export default defineComponent({
|
||||
|
||||
let num = 1
|
||||
|
||||
let mostraggtutti = true
|
||||
const mostraggtutti = true
|
||||
|
||||
if (mostraggtutti) {
|
||||
let num = 1;
|
||||
let strstartDate: any = props.mydata[0]
|
||||
const strstartDate: any = props.mydata[0]
|
||||
|
||||
let startDate = new Date(strstartDate._id); // Data di inizio da props
|
||||
let endDate = new Date(); // Data di fine da props
|
||||
let currentDate = new Date(startDate);
|
||||
const startDate = new Date(strstartDate._id); // Data di inizio da props
|
||||
const endDate = new Date(); // Data di fine da props
|
||||
const currentDate = new Date(startDate);
|
||||
|
||||
// console.log('startDate', startDate, 'endDate', endDate)
|
||||
|
||||
while (currentDate <= endDate) {
|
||||
let dataPresente = getRecordByDate(props.mydata, currentDate)
|
||||
const dataPresente = getRecordByDate(props.mydata, currentDate)
|
||||
|
||||
let count = dataPresente ? dataPresente.count : 0;
|
||||
const count = dataPresente ? dataPresente.count : 0;
|
||||
|
||||
let day = currentDate.toISOString().split('T')[0].split('-');
|
||||
let mydate = day[2] + '/' + day[1];
|
||||
const day = currentDate.toISOString().split('T')[0].split('-');
|
||||
const mydate = day[2] + '/' + day[1];
|
||||
|
||||
myarrlabel.value.push(mydate);
|
||||
myarrdata.value.push(count);
|
||||
|
||||
let media = calcolaMedia(myarrdata.value, 30);
|
||||
const media = calcolaMedia(myarrdata.value, 30);
|
||||
myarrdataLine.value.push(media ? media : undefined);
|
||||
|
||||
if (currentDate === endDate) {
|
||||
@@ -134,13 +135,13 @@ export default defineComponent({
|
||||
somma = rec.count
|
||||
}
|
||||
|
||||
let day = rec._id.split('-')
|
||||
const day = rec._id.split('-')
|
||||
ind = day[2] + '/' + day[1]
|
||||
|
||||
//myarrlabel.value.push(rec._id)
|
||||
myarrlabel.value.push(ind)
|
||||
myarrdata.value.push(rec.count)
|
||||
let media = calcolaMedia(myarrdata.value, 14)
|
||||
const media = calcolaMedia(myarrdata.value, 14)
|
||||
myarrdataLine.value.push(media ? media : undefined)
|
||||
if (num === props.mydata.length) {
|
||||
myarrbg.value.push(tools.colourNameToHex('green'))
|
||||
|
||||
Reference in New Issue
Block a user