diff --git a/.env.development b/.env.development index b909d09f..68c3cf88 100755 --- a/.env.development +++ b/.env.development @@ -1,6 +1,6 @@ -APP_VERSION="1.0.25" +APP_VERSION="1.0.21" SERVICE_WORKER_FILE="service-worker.js" -APP_ID="13" +APP_ID="17" DIRECTORY_LOCAL="newfreeplanet" DIRECTORY_SERVER="freeplanet_serverside" SERVERDIR_WEBSITE="" @@ -12,7 +12,7 @@ LANG_DEFAULT="it" PAO_APP_ID="KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF" MASTER_KEY="KKPPSS5KJK435J3KSS9F9D8S9F8SD3CR3T" MONGODB_HOST="https://localhost:3000" -LOGO_REG='riso-logo-full.png' +LOGO_REG='piuchebuono-logo-full.png' TEST_NAME="Paolo" TEST_SURNAME="Arena" TEST_EMAIL="" diff --git a/.vscode/launch.json b/.vscode/launch.json index bc6c4716..d3680d97 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -17,7 +17,15 @@ "command": "npm run spa", "name": "SPA", "request": "launch", - "type": "node-terminal" + "type": "node-terminal", + "sourceMaps": false, + }, + { + "command": "npm run spa", + "name": "SPA DEBUG", + "request": "launch", + "type": "node-terminal", + "sourceMaps": true, }, { "command": "npm run dev", @@ -25,5 +33,16 @@ "request": "launch", "type": "node-terminal" }, + { + "type": "chrome", + "request": "launch", + "name": "vuejs: Launch Chrome DEBUG", + "url": "http://localhost:8088", + "breakOnLoad": true, + "webRoot": "${workspaceFolder}/src", + "sourceMapPathOverrides": { + "webpack:///src/*": "${webRoot}/*" + } + } ] } diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..e4190ab5 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,23 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "serve", + "type": "npm", + "script": "serve", + "isBackground": true, + "problemMatcher": [{ + "base": "$tsc-watch", + "background": { + "activeOnStart": true, + "beginsPattern": "Starting development server", + "endsPattern": "Compiled successfully" + } + }], + "group": { + "kind": "build", + "isDefault": true + } + } + ] +} \ No newline at end of file diff --git a/_ALL_SITES/riso.app/package.json b/_ALL_SITES/riso.app/package.json index 8cff5ca4..dd32bf35 100755 --- a/_ALL_SITES/riso.app/package.json +++ b/_ALL_SITES/riso.app/package.json @@ -17,11 +17,12 @@ "lintfileNoJS": "eslint --ext .ts,.vue --ignore-path .gitignore ./ > file.out.txt", "fix": "eslint --ext .ts,.vue --ignore-path .gitignore ./ --fix > file.out.txt", "pwa": "NODE_ENV=development NODE_OPTIONS=--max_old_space_size=4096 DEBUG=v8:* quasar dev -m pwa", - "spa": "NODE_ENV=development NODE_OPTIONS=--max_old_space_size=4096 DEBUG=v8:* quasar dev -m spa", + "spa": "NODE_ENV=development NODE_OPTIONS=--max_old_space_size=4096 DEBUG=v8:* quasar dev --mode debug", "test": "echo \"No test specified\" && exit 0", "generate-sw": "workbox generateSW workbox-config.js" }, "dependencies": { + "@cubejs-client/core": "^0.31.0", "@quasar/extras": "^1.16.9", "@quasar/quasar-ui-qcalendar": "^4.0.0-beta.16", "@vue-leaflet/vue-leaflet": "^0.10.1", @@ -35,7 +36,7 @@ "autoprefixer": "^10.4.16", "axios": "^1.6.2", "bcryptjs": "^2.4.3", - "chart.js": "3.9.1", + "chart.js": "^4.0.0", "core-js": "^3.33.3", "crypto": "^1.0.1", "date-fns": "^2.30.0", @@ -47,6 +48,7 @@ "gsap": "^3.12.3", "jquery": "^3.7.1", "js-cookie": "^3.0.5", + "leaflet": "^1.9.4", "localforage": "^1.10.0", "lodash": "^4.17.21", "normalize.css": "^8.0.1", @@ -60,7 +62,6 @@ "typescript-eslint": "^0.0.1-alpha.0", "vee-validate": "^4.12.2", "vue": "^3.3.9", - "vue-chart-3": "^3.1.8", "vue-class-component": "^8.0.0-rc.1", "vue-country-code": "^1.1.3", "vue-echarts": "^6.6.1", @@ -104,6 +105,7 @@ "node-sass": "^9.0.0", "npm-check-updates": "^16.14.11", "optimize-css-assets-webpack-plugin": "^6.0.1", + "parcel": "^2.6.2", "postcss": "^8.4.31", "postcss-loader": "^7.3.3", "sass-loader": "^13.3.2", diff --git a/_ALL_SITES/riso.app/quasar.conf.js b/_ALL_SITES/riso.app/quasar.conf.js index 4fe00ed6..640a0360 100755 --- a/_ALL_SITES/riso.app/quasar.conf.js +++ b/_ALL_SITES/riso.app/quasar.conf.js @@ -149,6 +149,7 @@ module.exports = configure((ctx) => ({ https: false, port: 8084, open: false, // opens browser window automatically + hot: false, // Disable hot module replacement headers: { 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Headers': '*', diff --git a/now.txt b/now.txt index 63f31c52..e5f5d4ff 100644 --- a/now.txt +++ b/now.txt @@ -1 +1 @@ -TERMINA DI LAVORARE SU gruppomacro.app: (Sovrascrivo !) +TERMINA DI LAVORARE SU riso.app: (Sovrascrivo !) diff --git a/package.json b/package.json index 8cff5ca4..a2b2cc9a 100755 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { - "name": "riso", - "version": "0.6.1", - "description": "Siamo la Rete Italiana di Scambio Orizzontale, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della condivisione e della cooperazione. Valori semplici e profondi che ci aiutano a ritrovare il Senso della Vita, perduto in questa società consumista, e riporti quei Sani Pricìpi Naturali ed Umani di Fratellanza che intere popolazioni antiche conoscevano bene.", - "productName": "Riso", + "name": "piuchebuono", + "version": "2.0.1", + "description": "PiuCheBuono", + "productName": "PiuCheBuono", "author": "Paolo Arena", "private": true, "keywords": [], @@ -17,107 +17,107 @@ "lintfileNoJS": "eslint --ext .ts,.vue --ignore-path .gitignore ./ > file.out.txt", "fix": "eslint --ext .ts,.vue --ignore-path .gitignore ./ --fix > file.out.txt", "pwa": "NODE_ENV=development NODE_OPTIONS=--max_old_space_size=4096 DEBUG=v8:* quasar dev -m pwa", - "spa": "NODE_ENV=development NODE_OPTIONS=--max_old_space_size=4096 DEBUG=v8:* quasar dev -m spa", + "spa": "NODE_ENV=development NODE_OPTIONS=--max_old_space_size=4096 DEBUG=v8:* quasar dev --debug", "test": "echo \"No test specified\" && exit 0", "generate-sw": "workbox generateSW workbox-config.js" }, "dependencies": { - "@quasar/extras": "^1.16.9", + "@quasar/extras": "^1.16.7", "@quasar/quasar-ui-qcalendar": "^4.0.0-beta.16", - "@vue-leaflet/vue-leaflet": "^0.10.1", - "@vue/compat": "^3.3.9", - "@vue/compiler-sfc": "^3.3.9", + "@vue-leaflet/vue-leaflet": "^0.9.0", + "@vue/compat": "^3.2.47", + "@vue/compiler-sfc": "^3.2.47", "@vue/eslint-config-standard": "7.0.0", - "@vuelidate/core": "^2.0.3", - "@vuelidate/validators": "^2.0.4", - "acorn": "^8.11.2", + "@vuelidate/core": "^2.0.2", + "@vuelidate/validators": "^2.0.2", + "acorn": "^8.8.2", "animate.css": "^4.1.1", - "autoprefixer": "^10.4.16", - "axios": "^1.6.2", + "autoprefixer": "^10.4.14", + "axios": "^1.3.5", "bcryptjs": "^2.4.3", "chart.js": "3.9.1", - "core-js": "^3.33.3", + "core-js": "^3.30.0", "crypto": "^1.0.1", - "date-fns": "^2.30.0", - "dotenv": "^16.3.1", + "date-fns": "^2.29.3", + "dotenv": "^16.0.3", "echarts": "5.4.2", "eslint-plugin-quasar": "^1.1.0", - "graphql": "^16.8.1", + "graphql": "^16.6.0", "graphql-tag": "^2.12.6", - "gsap": "^3.12.3", - "jquery": "^3.7.1", - "js-cookie": "^3.0.5", + "gsap": "^3.11.5", + "jquery": "^3.6.4", + "js-cookie": "^3.0.1", "localforage": "^1.10.0", "lodash": "^4.17.21", "normalize.css": "^8.0.1", - "npm": "^10.2.4", + "npm": "^9.6.4", "nprogress": "^0.2.0", - "pinia": "^2.1.7", + "pinia": "^2.0.33", "prerender-spa-plugin": "^3.4.0", "quasar": "^2.12.07", "quasar-extras": "^2.0.9", "register-service-worker": "^1.7.2", "typescript-eslint": "^0.0.1-alpha.0", - "vee-validate": "^4.12.2", - "vue": "^3.3.9", + "vee-validate": "^4.8.4", + "vue": "^3.2.47", "vue-chart-3": "^3.1.8", "vue-class-component": "^8.0.0-rc.1", "vue-country-code": "^1.1.3", - "vue-echarts": "^6.6.1", - "vue-i18n": "^9.8.0", + "vue-echarts": "^6.5.4", + "vue-i18n": "^9.2.2", "vue-idb": "^0.2.0", - "vue-loader": "^17.3.1", + "vue-loader": "^17.0.1", "vue-property-decorator": "^10.0.0-rc.3", - "vue-router": "^4.2.5", - "vue-scroll-reveal": "^2.1.0", + "vue-router": "^4.1.6", + "vue-scroll-reveal": "^1.0.11", "vue-social-sharing": "^4.0.0-alpha4", "vue-svgicon": "^4.0.0-alpha.3", - "vue-timeago3": "^2.3.2", + "vue-timeago3": "^2.3.0", "vue2-dragula": "^2.5.5", "vuex": "^4.1.0", "vuex-router-sync": "^6.0.0-rc.1" }, "devDependencies": { "@quasar/app": "^3.3.3", - "@types/bcryptjs": "^2.4.6", + "@types/bcryptjs": "^2.4.2", "@types/dotenv": "^8.2.0", "@types/googlemaps": "^3.43.3", - "@types/jest": "^29.5.10", - "@types/js-cookie": "^3.0.6", - "@types/node": "18.17.0", - "@types/nprogress": "^0.2.3", - "@types/vue-tel-input": "^2.1.6", - "@types/vuelidate": "^0.7.21", - "@typescript-eslint/eslint-plugin": "^6.13.1", - "@typescript-eslint/parser": "^6.13.1", - "eslint": "^8.54.0", - "eslint-config-prettier": "^9.0.0", - "eslint-plugin-import": "^2.29.0", + "@types/jest": "^29.5.0", + "@types/js-cookie": "^3.0.3", + "@types/node": "18.15.11", + "@types/nprogress": "^0.2.0", + "@types/vue-tel-input": "^2.1.2", + "@types/vuelidate": "^0.7.16", + "@typescript-eslint/eslint-plugin": "^6.7.3", + "@typescript-eslint/parser": "^6.7.2", + "eslint": "^8.37.0", + "eslint-config-prettier": "^8.8.0", + "eslint-plugin-import": "^2.27.5", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^6.1.1", - "eslint-plugin-vue": "^9.19.2", + "eslint-plugin-vue": "^9.10.0", "file-loader": "^6.2.0", - "html-webpack-plugin": "^5.5.3", + "html-webpack-plugin": "^5.5.0", "http-proxy-middleware": "^2.0.6", - "jest": "^29.7.0", + "jest": "^29.5.0", "json-loader": "^0.5.7", "node-sass": "^9.0.0", - "npm-check-updates": "^16.14.11", + "npm-check-updates": "^16.10.7", "optimize-css-assets-webpack-plugin": "^6.0.1", - "postcss": "^8.4.31", - "postcss-loader": "^7.3.3", - "sass-loader": "^13.3.2", - "strip-ansi": "=7.1.0", - "ts-jest": "^29.1.1", - "ts-loader": "^9.5.1", + "postcss": "^8.4.21", + "postcss-loader": "^7.2.4", + "sass-loader": "^13.2.2", + "strip-ansi": "=7.0.1", + "ts-jest": "^29.1.0", + "ts-loader": "^9.4.2", "tslint": "^6.1.3", "tslint-config-standard": "^9.0.0", "tslint-loader": "^3.5.4", - "typescript": "^5.3.2", + "typescript": "^5.2.2", "vue-cli-plugin-element-ui": "^1.1.4", "vueify": "^9.4.1", - "webpack": "^5.89.0", - "workbox-webpack-plugin": "^7.0.0" + "webpack": "^5.78.0", + "workbox-webpack-plugin": "^6.5.4" }, "browser": { "crypto": false diff --git a/public/images/pcb-android-icon-144x144.png b/public/images/pcb-android-icon-144x144.png new file mode 100644 index 00000000..fdea5eb1 Binary files /dev/null and b/public/images/pcb-android-icon-144x144.png differ diff --git a/public/images/pcb-android-icon-192x192.png b/public/images/pcb-android-icon-192x192.png new file mode 100644 index 00000000..93bb5fb7 Binary files /dev/null and b/public/images/pcb-android-icon-192x192.png differ diff --git a/public/images/pcb-android-icon-36x36.png b/public/images/pcb-android-icon-36x36.png new file mode 100644 index 00000000..f700c0d2 Binary files /dev/null and b/public/images/pcb-android-icon-36x36.png differ diff --git a/public/images/pcb-android-icon-48x48.png b/public/images/pcb-android-icon-48x48.png new file mode 100644 index 00000000..4018b080 Binary files /dev/null and b/public/images/pcb-android-icon-48x48.png differ diff --git a/public/images/pcb-android-icon-72x72.png b/public/images/pcb-android-icon-72x72.png new file mode 100644 index 00000000..fdaff445 Binary files /dev/null and b/public/images/pcb-android-icon-72x72.png differ diff --git a/public/images/pcb-android-icon-96x96.png b/public/images/pcb-android-icon-96x96.png new file mode 100644 index 00000000..74ae0a32 Binary files /dev/null and b/public/images/pcb-android-icon-96x96.png differ diff --git a/public/images/pcb-apple-icon-114x114.png b/public/images/pcb-apple-icon-114x114.png new file mode 100644 index 00000000..de67dfff Binary files /dev/null and b/public/images/pcb-apple-icon-114x114.png differ diff --git a/public/images/pcb-apple-icon-120x120.png b/public/images/pcb-apple-icon-120x120.png new file mode 100644 index 00000000..5864c9c8 Binary files /dev/null and b/public/images/pcb-apple-icon-120x120.png differ diff --git a/public/images/pcb-apple-icon-144x144.png b/public/images/pcb-apple-icon-144x144.png new file mode 100644 index 00000000..fdea5eb1 Binary files /dev/null and b/public/images/pcb-apple-icon-144x144.png differ diff --git a/public/images/pcb-apple-icon-152x152.png b/public/images/pcb-apple-icon-152x152.png new file mode 100644 index 00000000..6e92509a Binary files /dev/null and b/public/images/pcb-apple-icon-152x152.png differ diff --git a/public/images/pcb-apple-icon-180x180.png b/public/images/pcb-apple-icon-180x180.png new file mode 100644 index 00000000..4d59cedc Binary files /dev/null and b/public/images/pcb-apple-icon-180x180.png differ diff --git a/public/images/pcb-apple-icon-57x57.png b/public/images/pcb-apple-icon-57x57.png new file mode 100644 index 00000000..fb201a9d Binary files /dev/null and b/public/images/pcb-apple-icon-57x57.png differ diff --git a/public/images/pcb-apple-icon-60x60.png b/public/images/pcb-apple-icon-60x60.png new file mode 100644 index 00000000..3b5f1c33 Binary files /dev/null and b/public/images/pcb-apple-icon-60x60.png differ diff --git a/public/images/pcb-apple-icon-72x72.png b/public/images/pcb-apple-icon-72x72.png new file mode 100644 index 00000000..fdaff445 Binary files /dev/null and b/public/images/pcb-apple-icon-72x72.png differ diff --git a/public/images/pcb-apple-icon-76x76.png b/public/images/pcb-apple-icon-76x76.png new file mode 100644 index 00000000..2882992b Binary files /dev/null and b/public/images/pcb-apple-icon-76x76.png differ diff --git a/public/images/pcb-apple-icon.png b/public/images/pcb-apple-icon.png new file mode 100644 index 00000000..422a8dca Binary files /dev/null and b/public/images/pcb-apple-icon.png differ diff --git a/quasar.conf.js b/quasar.conf.js index 640a0360..20184824 100755 --- a/quasar.conf.js +++ b/quasar.conf.js @@ -94,6 +94,7 @@ module.exports = configure((ctx) => ({ transpileDependencies: [ /quasar-ui-qcalendar[\\/]src/ ], + devtool: 'source-map', chainWebpack(chain, { isServer, isClient }) { chain.resolve.alias @@ -147,9 +148,8 @@ module.exports = configure((ctx) => ({ }, devServer: { https: false, - port: 8084, + port: 8088, open: false, // opens browser window automatically - hot: false, // Disable hot module replacement headers: { 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Headers': '*', @@ -306,9 +306,9 @@ module.exports = configure((ctx) => ({ }, manifest: { - name: 'Riso', - short_name: 'Riso', - description: 'Siamo la Rete Italiana di Scambio Orizzontale, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della condivisione e della cooperazione. Valori semplici e profondi che ci aiutano a ritrovare il Senso della Vita, perduto in questa società consumista, e riporti quei Sani Pricìpi Naturali ed Umani di Fratellanza che intere popolazioni antiche conoscevano bene.', + name: 'Più che Buono', + short_name: 'PiuCheBuono', + description: 'PiuCheBuono è un GAS e Bottega', display: 'standalone', orientation: 'portrait', background_color: '#fff', @@ -318,54 +318,54 @@ module.exports = configure((ctx) => ({ start_url: "/?homescreen=1", icons: [ { - src: 'images/riso-android-icon-512x512.png', + src: 'images/pcb-android-icon-512x512.png', sizes: '512x512', type: 'image/png', }, { - src: 'images/riso-android-icon-384x384.png', + src: 'images/pcb-android-icon-384x384.png', sizes: '384x384', type: 'image/png', }, { - src: 'images/riso-android-icon-192x192.png', + src: 'images/pcb-android-icon-192x192.png', sizes: '192x192', type: 'image/png', }, { - src: 'images/riso-android-icon-144x144.png', + src: 'images/pcb-android-icon-144x144.png', sizes: '144x144', type: 'image/png', }, { - src: 'images/riso-android-icon-96x96.png', + src: 'images/pcb-android-icon-96x96.png', sizes: '96x96', type: 'image/png', }, { - src: 'images/riso-apple-icon-120x120.png', + src: 'images/pcb-apple-icon-120x120.png', sizes: '120x120', type: 'image/png', }, { - src: 'images/riso-apple-icon-144x144.png', + src: 'images/pcb-apple-icon-144x144.png', sizes: '144x144', type: 'image/png', }, { - src: 'images/riso-apple-icon-152x152.png', + src: 'images/pcb-apple-icon-152x152.png', sizes: '152x152', type: 'image/png', }, { - src: 'images/riso-apple-icon-180x180.png', + src: 'images/pcb-apple-icon-180x180.png', sizes: '180x180', type: 'image/png', }, ], related_applications: [{ "platform": "webapp", - "url": "https://www.riso.app/manifest.json" + "url": "https://www.piuchebuono.app/manifest.json" }] }, }, @@ -400,7 +400,7 @@ module.exports = configure((ctx) => ({ builder: { // https://www.electron.build/configuration/configuration - appId: 'Riso', + appId: 'PiuCheBuono', }, // "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain diff --git a/src/common/shared_vuejs.ts b/src/common/shared_vuejs.ts index 7bb53f1d..837f2ec3 100755 --- a/src/common/shared_vuejs.ts +++ b/src/common/shared_vuejs.ts @@ -66,7 +66,7 @@ export const shared_consts = { }, { label: 'Chili (kg)', - short: 'Kg', + short: 'kg', value: 2, }, { @@ -344,6 +344,7 @@ export const shared_consts = { CAT_NO_SPAZI: 5, CAT_GOODS_TXT: 10, PRODUCTS: 20, + PRODUCTS_V2: 22, INVENTARIO: 30, }, @@ -1806,6 +1807,8 @@ export const shared_consts = { MyBachecas: 1, }, + MAX_QTA_PREORD: 5000, + getStatusStr(status: number) { const trovatorec = this.OrderStatusStr.find((rec) => rec.value === status) return (trovatorec) ? trovatorec.label : '' diff --git a/src/components/CLineChart/CLineChart.ts b/src/components/CLineChart/CLineChart.ts index 3fee0db0..7368648f 100755 --- a/src/components/CLineChart/CLineChart.ts +++ b/src/components/CLineChart/CLineChart.ts @@ -7,16 +7,12 @@ import { useGlobalStore } from '@store/globalStore' import { useI18n } from '@/boot/i18n' import { useQuasar } from 'quasar' -import { Chart, ChartData, ChartOptions, registerables } from 'chart.js' +import { Chart, ChartItem, ChartConfiguration } from 'chart.js/auto' -import { BarChart, useBarChart } from 'vue-chart-3' - - -Chart.register(...registerables) export default defineComponent({ - name: 'CBarChart', - components: { BarChart }, + name: 'CLineChart', + components: {}, props: { mydata: { required: false, default: [] }, title: { required: false, default: false }, @@ -25,6 +21,7 @@ export default defineComponent({ bordercolor: { required: false, default: 'red' }, mycolors: { required: false, default: null }, offset: { required: false, default: 0 }, + showMedia: { required: false, default: false } }, setup(props, { emit }) { @@ -35,48 +32,44 @@ export default defineComponent({ const myarrlabel = ref([]) const myarrdata = ref([]) + const myarrdataLine = ref([]) const myarrbg = ref([]) const myarrsum = ref([]) - // @ts-ignore - const chartData = computed>(() => ({ - labels: myarrlabel.value, + + const chartDataLine = ref({ + labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'], datasets: [ - /*{ - label: 'Totali', - data: myarrsum.value, - backgroundColor: tools.colourNameToHex('green'), - },*/ { - label: props.title, - data: myarrdata.value, - borderColor: tools.colourNameToHex('red'), - backgroundColor: myarrbg.value, - fill: true, - }, - ], - })) - - const options = computed>(() => ({ - bar: { - }, - interaction: { - intersect: false - }, - scales: { - y: { - beginAtZero: true + label: 'Data One', + backgroundColor: '#f87979', + data: [40, 39, 10, 40, 39, 80, 40] } - } - })) - - const { barChartProps, barChartRef } = useBarChart({ - chartData, - options, + ] }) + const chartOptionsLine = ref({ + responsive: true, + maintainAspectRatio: false + }) + + function calcolaMedia(myarray: any, periodi: number) { + if (myarray.length === 0 || myarray.length < periodi) { + return 0; // Se l'array è vuoto o più corto del numero di periodi, la media è 0. + } + + const somma = myarray.slice(-periodi).reduce((accumulator: number, currentValue: number) => accumulator + currentValue, 0); + return somma / periodi; + } + + function getRecordByDate(mydata: any, currentDate: Date) { + const targetDate = currentDate.toISOString().split('T')[0]; + return mydata.find((record: any) => record._id === targetDate); + } + function mounted() { myarrdata.value = [] + myarrdataLine.value = [] myarrbg.value = [] myarrlabel.value = [] myarrsum.value = [] @@ -91,27 +84,119 @@ export default defineComponent({ let num = 1 - for (rec of props.mydata) { - if (props.sum) { - somma += rec.count - } else { - somma = rec.count + let mostraggtutti = true + + if (mostraggtutti) { + let num = 1; + let 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); + + // console.log('startDate', startDate, 'endDate', endDate) + + while (currentDate <= endDate) { + let dataPresente = getRecordByDate(props.mydata, currentDate) + + let count = dataPresente ? dataPresente.count : 0; + + let day = currentDate.toISOString().split('T')[0].split('-'); + let mydate = day[2] + '/' + day[1]; + + myarrlabel.value.push(mydate); + myarrdata.value.push(count); + + let media = calcolaMedia(myarrdata.value, 30); + myarrdataLine.value.push(media ? media : undefined); + + if (currentDate === endDate) { + myarrbg.value.push(tools.colourNameToHex('green')); + } else { + myarrbg.value.push(tools.colourNameToHex(props.color)); + } + + myarrsum.value.push(somma); + + num++; + currentDate.setDate(currentDate.getDate() + 1); // Passa al giorno successivo } - let day = rec._id.split('-') - ind = day[2] + '/' + day[1] - //myarrlabel.value.push(rec._id) - myarrlabel.value.push(ind) - myarrdata.value.push(rec.count) - if (num === props.mydata.length) { - myarrbg.value.push(tools.colourNameToHex('green')) - } else { - myarrbg.value.push(tools.colourNameToHex(props.color)) + } else { + + for (rec of props.mydata) { + if (props.sum) { + somma += rec.count + } else { + somma = rec.count + } + + let 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) + myarrdataLine.value.push(media ? media : undefined) + if (num === props.mydata.length) { + myarrbg.value.push(tools.colourNameToHex('green')) + } else { + myarrbg.value.push(tools.colourNameToHex(props.color)) + } + myarrsum.value.push(somma) + num++ + // ind++ } - myarrsum.value.push(somma) - num++ - // ind++ } + + const chartData: any = { + labels: myarrlabel.value, + datasets: [ + { + type: 'bar', + label: props.title, + data: myarrdata.value, + borderColor: tools.colourNameToHex('red'), + backgroundColor: myarrbg.value, + fill: true, + }, + ], + } + + const media = { + type: 'line', + label: 'Media', + data: myarrdataLine.value, + borderColor: 'rgb(255, 99, 132)', + backgroundColor: 'rgb(255, 99, 132)', + fill: true, + } + + if (props.showMedia) + chartData.datasets.push(media) + + const configBar: ChartConfiguration = { + type: 'bar', + data: chartData, + options: { + scales: { + y: { + beginAtZero: true + } + }, + interaction: { + intersect: false + }, + }, + }; + + const canvasTag = document.getElementById('myChart') + + const myChart = new Chart( + canvasTag, + configBar) + } function getoffset() { @@ -124,11 +209,6 @@ export default defineComponent({ tools, getoffset, q, - options, - barChartProps, - barChartRef, - myarrdata, - myarrlabel, } }, }) diff --git a/src/components/CLineChart/CLineChart.vue b/src/components/CLineChart/CLineChart.vue index 5c2166e7..14bcdb8e 100755 --- a/src/components/CLineChart/CLineChart.vue +++ b/src/components/CLineChart/CLineChart.vue @@ -1,13 +1,6 @@ diff --git a/src/components/CMyPopupEdit/CMyPopupEdit.vue b/src/components/CMyPopupEdit/CMyPopupEdit.vue index a46b2b54..a423c1a6 100755 --- a/src/components/CMyPopupEdit/CMyPopupEdit.vue +++ b/src/components/CMyPopupEdit/CMyPopupEdit.vue @@ -147,8 +147,9 @@ color="green" >online + , + required: false, + default: null, + }, + coord_big: { + type: String, + required: false, + default: '', + }, + urlmap: { + type: String, + required: false, + default: '', + }, + imgmap: { + type: String, + required: false, + default: '', + }, + zoom: { + type: Number, + required: false, + default: 2, + }, + }, + setup(props, { emit }) { + const $q = useQuasar() + + function mywidth() { + return tools.getwidth($q) - 20 + } + + function myheight() { + return 450 + } + + onMounted(() => { + + }); + + return { + mywidth, + myheight, + } + } +}) diff --git a/src/components/COSM/COSM.vue b/src/components/COSM/COSM.vue new file mode 100755 index 00000000..5ba6932a --- /dev/null +++ b/src/components/COSM/COSM.vue @@ -0,0 +1,19 @@ + + + + diff --git a/src/components/COSM/index.ts b/src/components/COSM/index.ts new file mode 100755 index 00000000..7e40458a --- /dev/null +++ b/src/components/COSM/index.ts @@ -0,0 +1 @@ +export {default as COSM} from './COSM.vue' diff --git a/src/components/CProductCard/CProductCard.vue b/src/components/CProductCard/CProductCard.vue index 68c9fa17..50782478 100755 --- a/src/components/CProductCard/CProductCard.vue +++ b/src/components/CProductCard/CProductCard.vue @@ -121,7 +121,8 @@ + +
+ + {{ t('products.link_scheda') }} +
+
+ +
+
@@ -347,8 +361,8 @@ {{ myproduct.bookableAvailableQty }} + + - + @@ -577,7 +610,13 @@ - + @@ -604,7 +643,13 @@ - + @@ -627,7 +672,13 @@ - + diff --git a/src/components/CSingleCart/CSingleCart.vue b/src/components/CSingleCart/CSingleCart.vue index 306f15fa..8c050ce0 100755 --- a/src/components/CSingleCart/CSingleCart.vue +++ b/src/components/CSingleCart/CSingleCart.vue @@ -1,10 +1,10 @@