From 721d2ac38cc63f95eaff250bd04bb898776f10f5 Mon Sep 17 00:00:00 2001 From: Surya Paolo Date: Thu, 1 May 2025 00:20:02 +0200 Subject: [PATCH] - corretto scheda prodotto, record salvato --- .env | 4 +- .env.production | 18 +-- index.html | 2 +- package.json | 14 +- .../comunitanuovomondo.app/package.json | 8 +- .../_ALL_SITES/freeplanet.app/package.json | 12 +- .../_ALL_SITES/gruppomacro.app/package.json | 14 +- scripts/_ALL_SITES/kolibrilab.it/package.json | 12 +- .../_ALL_SITES/piuchebuono.app/package.json | 12 +- scripts/_ALL_SITES/riso.app/package.json | 12 +- src-pwa/custom-service-worker.js | 2 +- .../CCatalogoCard/CCatalogoCard.vue | 20 +-- src/components/CGridTableRec/CGridTableRec.ts | 2 +- .../CModifTrafiletto/CModifTrafiletto.vue | 2 +- src/components/CMyEditElem/CMyEditElem.vue | 16 ++ src/components/CProductTable/CProductTable.ts | 144 ++++++++++-------- .../CProductTable/CProductTable.vue | 4 +- .../CSchedaProdotto/CSchedaProdotto.ts | 11 ++ src/components/MyHeader/MyHeader.vue | 1 - src/model/CatalogStore.ts | 1 + src/model/GlobalStore.ts | 2 + src/model/Products.ts | 6 + src/statics/lang/it.js | 1 + src/store/Modules/costanti.ts | 6 +- src/store/Modules/fieldsTable.ts | 12 ++ src/store/Products.ts | 11 +- src/store/globalStore.ts | 13 +- src/views/admin/cfgServer/cfgServer.ts | 2 +- src/views/admin/dbopmacro/dbopmacro.vue | 15 ++ src/views/ecommerce/catalogo/catalogo.scss | 2 +- src/views/ecommerce/catalogo/catalogo.ts | 29 +++- src/views/ecommerce/catalogo/catalogo.vue | 63 ++++---- 32 files changed, 296 insertions(+), 177 deletions(-) diff --git a/.env b/.env index 68607c8c..352c4842 100755 --- a/.env +++ b/.env @@ -1,6 +1,6 @@ -VITE_APP_VERSION="1.2.33" +VITE_APP_VERSION="1.2.34" VITE_LANG_DEFAULT="it" VITE_PAO_APP_ID="KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF" -VITE_SERVICE_WORKER_FILE="sw-1.2.33.js" +VITE_SERVICE_WORKER_FILE="sw-1.2.34.js" VITE_PROJECT_ID_MAIN="5cc0a13fe5c9d156728f400a" VITE_VUE_ROUTER_MODE="history" \ No newline at end of file diff --git a/.env.production b/.env.production index 806a4a4b..2a577413 100644 --- a/.env.production +++ b/.env.production @@ -1,13 +1,11 @@ VITE_APP_ID="18" -VITE_APP_URL="https://gruppomacro.app" -VITE_MONGODB_HOST="https://api.gruppomacro.app" -VITE_LOGO_REG='gruppomacro-logo-full.png' +VITE_APP_URL="https://test.gruppomacro.app" +VITE_MONGODB_HOST="https://testapi.gruppomacro.app" +VITE_LOGO_REG="gruppomacro-logo-full.png" VITE_PUBLICKEY_PUSH="BJgo8XR_upbnbMLWgCAUELo6DK7dRXffYAnFOxbaMMz5favBgcQBKT-eISqouO-jRad4Sw8l5nd2wCF6KorGiTc" -VITE_DEBUG="0" -VITE_VUE_APP_ISTEST="0" +VITE_DEBUG="1" +VITE_VUE_APP_ISTEST="1" DIRECTORY_LOCAL="myprojplanet_vite" -DIRECTORY_SERVER="/var/www/nodejs_piuchebuono_server" -SERVERDIR_WEBSITE="/var/www/gruppomacro.app" -SERVERPW_WEBSITE="pwdadmin@1AOK" -PORT_SPA="8089" -PORT_PWA="8099" \ No newline at end of file +DIRECTORY_SERVER="/var/www/nodejs_test.piuchebuono_server" +SERVERDIR_WEBSITE="/var/www/test.gruppomacro.app" +SERVERPW_WEBSITE="pwdadmin@1AOK" \ No newline at end of file diff --git a/index.html b/index.html index e69af298..ef437070 100755 --- a/index.html +++ b/index.html @@ -10,7 +10,7 @@ - + diff --git a/package.json b/package.json index c1ed96ac..d5030d42 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gruppomacro", - "version": "1.2.33", + "version": "1.2.34", "description": "Gruppo Macro", "productName": "Gruppo Macro", "author": "Surya", @@ -9,20 +9,20 @@ "license": "MIT", "type": "module", "scripts": { - "dev": "PORT=8089 APP_VERSION='1.2.33' quasar dev", + "dev": "PORT=8089 APP_VERSION='1.2.34' quasar dev", "dev_noCheck": "SKIP_TSC=true quasar dev", "build": "quasar build", - "buildpwa": "NODE_ENV=production APP_VERSION='1.2.33' quasar build -m pwa", - "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.33' quasar build -m pwa", + "buildpwa": "NODE_ENV=production APP_VERSION='1.2.34' quasar build -m pwa", + "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.34' quasar build -m pwa", "type-check": "vue-tsc --noEmit", "type-check:watch": "vue-tsc --noEmit --watch", - "buildspa": "APP_VERSION='1.2.33' quasar build -m spa", + "buildspa": "APP_VERSION='1.2.34' quasar build -m spa", "lint": "eslint -c ./eslint.config.js \"./src*/**/*.{ts,js,cjs,mjs,vue}\"", "lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt", "lintfileNoJS": "eslint --ext .ts,.vue --ignore-path .gitignore ./ > file.out.txt", "fix": "eslint -c ./eslint.config.js \"./src*/**/*.{ts,js,cjs,mjs,vue}\" --ignore-pattern .gitignore ./ --fix > file.out.txt", - "pwa": "NODE_ENV=development PORT=8099 APP_VERSION='1.2.33' quasar dev -m pwa", - "spa": "NODE_ENV=development PORT=8089 APP_VERSION='1.2.33' quasar dev", + "pwa": "NODE_ENV=development PORT=8099 APP_VERSION='1.2.34' quasar dev -m pwa", + "spa": "NODE_ENV=development PORT=8089 APP_VERSION='1.2.34' quasar dev", "debug": "quasar dev --mode debug", "test": "echo \"No test specified\" && exit 0", "generate-sw": "workbox generateSW workbox-config.js", diff --git a/scripts/_ALL_SITES/comunitanuovomondo.app/package.json b/scripts/_ALL_SITES/comunitanuovomondo.app/package.json index b6f149f9..ed0d5359 100755 --- a/scripts/_ALL_SITES/comunitanuovomondo.app/package.json +++ b/scripts/_ALL_SITES/comunitanuovomondo.app/package.json @@ -1,6 +1,6 @@ { "name": "cnm", - "version": "1.2.33", + "version": "1.2.34", "description": "Comunita Nuovo Mondo", "productName": "ComunitaNuovoMondo", "author": "Surya", @@ -9,7 +9,7 @@ "license": "MIT", "type": "module", "scripts": { - "dev": "PORT=8083 APP_VERSION='1.2.33' quasar dev", + "dev": "PORT=8083 APP_VERSION='1.2.34' quasar dev", "dev_noCheck": "SKIP_TSC=true quasar dev", "build": "quasar build", "buildpwa": "NODE_ENV=production quasar build -m pwa", @@ -21,8 +21,8 @@ "lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt", "lintfileNoJS": "eslint --ext .ts,.vue --ignore-path .gitignore ./ > file.out.txt", "fix": "eslint -c ./eslint.config.js \"./src*/**/*.{ts,js,cjs,mjs,vue}\" --ignore-pattern .gitignore ./ --fix > file.out.txt", - "pwa": "NODE_ENV=development PORT=8093 APP_VERSION='1.2.33' quasar dev -m pwa", - "spa": "NODE_ENV=development PORT=8083 APP_VERSION='1.2.33' quasar dev", + "pwa": "NODE_ENV=development PORT=8093 APP_VERSION='1.2.34' quasar dev -m pwa", + "spa": "NODE_ENV=development PORT=8083 APP_VERSION='1.2.34' quasar dev", "debug": "quasar dev --mode debug", "test": "echo \"No test specified\" && exit 0", "generate-sw": "workbox generateSW workbox-config.js", diff --git a/scripts/_ALL_SITES/freeplanet.app/package.json b/scripts/_ALL_SITES/freeplanet.app/package.json index 5f44d5bf..feca3890 100755 --- a/scripts/_ALL_SITES/freeplanet.app/package.json +++ b/scripts/_ALL_SITES/freeplanet.app/package.json @@ -1,6 +1,6 @@ { "name": "freeplanet", - "version": "1.2.33", + "version": "1.2.34", "description": "freeplanet", "productName": "freeplanet", "author": "Surya", @@ -9,11 +9,11 @@ "license": "MIT", "type": "module", "scripts": { - "dev": "PORT=8087 APP_VERSION='1.2.33' quasar dev", + "dev": "PORT=8087 APP_VERSION='1.2.34' quasar dev", "dev_noCheck": "SKIP_TSC=true quasar dev", "build": "quasar build", - "buildpwa": "NODE_ENV=production APP_VERSION='1.2.33' quasar build -m pwa", - "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.33' quasar build -m pwa", + "buildpwa": "NODE_ENV=production APP_VERSION='1.2.34' quasar build -m pwa", + "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.34' quasar build -m pwa", "type-check": "vue-tsc --noEmit", "type-check:watch": "vue-tsc --noEmit --watch", "buildspa": "quasar build -m spa", @@ -21,8 +21,8 @@ "lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt", "lintfileNoJS": "eslint --ext .ts,.vue --ignore-path .gitignore ./ > file.out.txt", "fix": "eslint -c ./eslint.config.js \"./src*/**/*.{ts,js,cjs,mjs,vue}\" --ignore-pattern .gitignore ./ --fix > file.out.txt", - "pwa": "NODE_ENV=development PORT=8097 APP_VERSION='1.2.33' quasar dev -m pwa", - "spa": "NODE_ENV=development PORT=8087 APP_VERSION='1.2.33' quasar dev", + "pwa": "NODE_ENV=development PORT=8097 APP_VERSION='1.2.34' quasar dev -m pwa", + "spa": "NODE_ENV=development PORT=8087 APP_VERSION='1.2.34' quasar dev", "debug": "quasar dev --mode debug", "test": "echo \"No test specified\" && exit 0", "generate-sw": "workbox generateSW workbox-config.js", diff --git a/scripts/_ALL_SITES/gruppomacro.app/package.json b/scripts/_ALL_SITES/gruppomacro.app/package.json index c1ed96ac..d5030d42 100755 --- a/scripts/_ALL_SITES/gruppomacro.app/package.json +++ b/scripts/_ALL_SITES/gruppomacro.app/package.json @@ -1,6 +1,6 @@ { "name": "gruppomacro", - "version": "1.2.33", + "version": "1.2.34", "description": "Gruppo Macro", "productName": "Gruppo Macro", "author": "Surya", @@ -9,20 +9,20 @@ "license": "MIT", "type": "module", "scripts": { - "dev": "PORT=8089 APP_VERSION='1.2.33' quasar dev", + "dev": "PORT=8089 APP_VERSION='1.2.34' quasar dev", "dev_noCheck": "SKIP_TSC=true quasar dev", "build": "quasar build", - "buildpwa": "NODE_ENV=production APP_VERSION='1.2.33' quasar build -m pwa", - "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.33' quasar build -m pwa", + "buildpwa": "NODE_ENV=production APP_VERSION='1.2.34' quasar build -m pwa", + "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.34' quasar build -m pwa", "type-check": "vue-tsc --noEmit", "type-check:watch": "vue-tsc --noEmit --watch", - "buildspa": "APP_VERSION='1.2.33' quasar build -m spa", + "buildspa": "APP_VERSION='1.2.34' quasar build -m spa", "lint": "eslint -c ./eslint.config.js \"./src*/**/*.{ts,js,cjs,mjs,vue}\"", "lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt", "lintfileNoJS": "eslint --ext .ts,.vue --ignore-path .gitignore ./ > file.out.txt", "fix": "eslint -c ./eslint.config.js \"./src*/**/*.{ts,js,cjs,mjs,vue}\" --ignore-pattern .gitignore ./ --fix > file.out.txt", - "pwa": "NODE_ENV=development PORT=8099 APP_VERSION='1.2.33' quasar dev -m pwa", - "spa": "NODE_ENV=development PORT=8089 APP_VERSION='1.2.33' quasar dev", + "pwa": "NODE_ENV=development PORT=8099 APP_VERSION='1.2.34' quasar dev -m pwa", + "spa": "NODE_ENV=development PORT=8089 APP_VERSION='1.2.34' quasar dev", "debug": "quasar dev --mode debug", "test": "echo \"No test specified\" && exit 0", "generate-sw": "workbox generateSW workbox-config.js", diff --git a/scripts/_ALL_SITES/kolibrilab.it/package.json b/scripts/_ALL_SITES/kolibrilab.it/package.json index 520aa863..d3d78eef 100755 --- a/scripts/_ALL_SITES/kolibrilab.it/package.json +++ b/scripts/_ALL_SITES/kolibrilab.it/package.json @@ -1,6 +1,6 @@ { "name": "kolibrilab", - "version": "1.2.33", + "version": "1.2.34", "description": "kolibrilab", "productName": "kolibrilab", "author": "Surya Paolo", @@ -8,11 +8,11 @@ "keywords": [], "license": "MIT", "scripts": { - "dev": "PORT=8083 APP_VERSION='1.2.33' quasar dev", + "dev": "PORT=8083 APP_VERSION='1.2.34' quasar dev", "dev_noCheck": "SKIP_TSC=true quasar dev", "build": "quasar build", - "buildpwa": "NODE_ENV=production APP_VERSION='1.2.33' quasar build -m pwa", - "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.33' quasar build -m pwa", + "buildpwa": "NODE_ENV=production APP_VERSION='1.2.34' quasar build -m pwa", + "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.34' quasar build -m pwa", "type-check": "vue-tsc --noEmit", "type-check:watch": "vue-tsc --noEmit --watch", "buildspa": "quasar build -m spa", @@ -20,8 +20,8 @@ "lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt", "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 PORT=8093 APP_VERSION='1.2.33' quasar dev -m pwa", - "spa": "NODE_ENV=development PORT=8083 APP_VERSION='1.2.33' quasar dev", + "pwa": "NODE_ENV=development PORT=8093 APP_VERSION='1.2.34' quasar dev -m pwa", + "spa": "NODE_ENV=development PORT=8083 APP_VERSION='1.2.34' quasar dev", "spanorefresh": "NODE_ENV=development NODE_OPTIONS=--max_old_space_size=4096 DEBUG=v8:* quasar dev -m spa", "test": "echo \"No test specified\" && exit 0", "generate-sw": "workbox generateSW workbox-config.js" diff --git a/scripts/_ALL_SITES/piuchebuono.app/package.json b/scripts/_ALL_SITES/piuchebuono.app/package.json index cb6c18a5..ba39e2e6 100755 --- a/scripts/_ALL_SITES/piuchebuono.app/package.json +++ b/scripts/_ALL_SITES/piuchebuono.app/package.json @@ -1,6 +1,6 @@ { "name": "piuchebuono", - "version": "1.2.33", + "version": "1.2.34", "description": "PiuCheBuono", "productName": "PiuCheBuono", "author": "Surya", @@ -9,11 +9,11 @@ "license": "MIT", "type": "module", "scripts": { - "dev": "PORT=8085 APP_VERSION='1.2.33' quasar dev", + "dev": "PORT=8085 APP_VERSION='1.2.34' quasar dev", "dev_noCheck": "SKIP_TSC=true quasar dev", "build": "quasar build", - "buildpwa": "NODE_ENV=production APP_VERSION='1.2.33' quasar build -m pwa", - "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.33' quasar build -m pwa", + "buildpwa": "NODE_ENV=production APP_VERSION='1.2.34' quasar build -m pwa", + "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.34' quasar build -m pwa", "type-check": "vue-tsc --noEmit", "type-check:watch": "vue-tsc --noEmit --watch", "buildspa": "quasar build -m spa", @@ -21,8 +21,8 @@ "lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt", "lintfileNoJS": "eslint --ext .ts,.vue --ignore-path .gitignore ./ > file.out.txt", "fix": "eslint -c ./eslint.config.js \"./src*/**/*.{ts,js,cjs,mjs,vue}\" --ignore-pattern .gitignore ./ --fix > file.out.txt", - "pwa": "NODE_ENV=development PORT=8085 APP_VERSION='1.2.33' quasar dev -m pwa", - "spa": "NODE_ENV=development PORT=8085 APP_VERSION='1.2.33' quasar dev", + "pwa": "NODE_ENV=development PORT=8085 APP_VERSION='1.2.34' quasar dev -m pwa", + "spa": "NODE_ENV=development PORT=8085 APP_VERSION='1.2.34' quasar dev", "debug": "quasar dev --mode debug", "test": "echo \"No test specified\" && exit 0", "generate-sw": "workbox generateSW workbox-config.js", diff --git a/scripts/_ALL_SITES/riso.app/package.json b/scripts/_ALL_SITES/riso.app/package.json index 9b0604f1..b80b5730 100755 --- a/scripts/_ALL_SITES/riso.app/package.json +++ b/scripts/_ALL_SITES/riso.app/package.json @@ -1,6 +1,6 @@ { "name": "riso", - "version": "1.2.33", + "version": "1.2.34", "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", "author": "Surya", @@ -9,11 +9,11 @@ "license": "MIT", "type": "module", "scripts": { - "dev": "APP_VERSION='1.2.33' PORT=8084 quasar dev", + "dev": "APP_VERSION='1.2.34' PORT=8084 quasar dev", "dev_noCheck": "SKIP_TSC=true quasar dev", "build": "quasar build", - "buildpwa": "NODE_ENV=production APP_VERSION='1.2.33' quasar build -m pwa", - "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.33' quasar build -m pwa", + "buildpwa": "NODE_ENV=production APP_VERSION='1.2.34' quasar build -m pwa", + "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.34' quasar build -m pwa", "type-check": "vue-tsc --noEmit", "type-check:watch": "vue-tsc --noEmit --watch", "buildspa": "quasar build -m spa", @@ -21,8 +21,8 @@ "lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt", "lintfileNoJS": "eslint --ext .ts,.vue --ignore-path .gitignore ./ > file.out.txt", "fix": "eslint -c ./eslint.config.js \"./src*/**/*.{ts,js,cjs,mjs,vue}\" --ignore-pattern .gitignore ./ --fix > file.out.txt", - "pwa": "NODE_ENV=development PORT=8094 APP_VERSION='1.2.33' quasar dev -m pwa", - "spa": "NODE_ENV=development PORT=8084 APP_VERSION='1.2.33' quasar dev", + "pwa": "NODE_ENV=development PORT=8094 APP_VERSION='1.2.34' quasar dev -m pwa", + "spa": "NODE_ENV=development PORT=8084 APP_VERSION='1.2.34' quasar dev", "debug": "quasar dev --mode debug", "test": "echo \"No test specified\" && exit 0", "generate-sw": "workbox generateSW workbox-config.js", diff --git a/src-pwa/custom-service-worker.js b/src-pwa/custom-service-worker.js index 63c8b854..593e219a 100755 --- a/src-pwa/custom-service-worker.js +++ b/src-pwa/custom-service-worker.js @@ -3,7 +3,7 @@ /* global workbox */ /* global cfgenv */ -const VITE_APP_VERSION = "1.2.33"; +const VITE_APP_VERSION = "1.2.34"; // Costanti di configurazione const DYNAMIC_CACHE = 'dynamic-cache-v2'; diff --git a/src/components/CCatalogoCard/CCatalogoCard.vue b/src/components/CCatalogoCard/CCatalogoCard.vue index cfe37a6c..887b57d6 100755 --- a/src/components/CCatalogoCard/CCatalogoCard.vue +++ b/src/components/CCatalogoCard/CCatalogoCard.vue @@ -128,13 +128,13 @@ > - Modifica + Scheda Libro @@ -188,13 +188,13 @@ > - Riaggiorna il Libro da GM + Carica dati del Libro (da GM) - Riaggiorna il Libro da DBLocale + Carica dati del Libro (dal DB Locale) + + { maxlength: 0 }) + function handleUpdate(newList) { + internalProducts.value = newList + emit('update:lista_prodotti', internalProducts.value) + } const editOn = computed({ get(): boolean { @@ -90,10 +94,19 @@ export default defineComponent({ async function mounted() { + console.log('mounted CProductTable') + loading.value = true optionscatalogo.value = { maxlength: props.scheda?.testo_bottom?.maxlength } + + const savedColumns = tools.getCookie("selColCat"); + if (savedColumns) { + selectedColumns.value = savedColumns; + } + + loading.value = false } // Aggiorna la copia locale quando il prop cambia @@ -102,7 +115,7 @@ export default defineComponent({ (newVal) => { internalProducts.value = [...newVal]; } - ); + ), { deep: true }; // Colonne della tabella const allColumns = [ @@ -119,6 +132,7 @@ export default defineComponent({ { name: "idCollana", label: "Collana", field: "idCollana", align: "left" }, { name: "stato", label: "Stato", field: "stato", align: "left" }, { name: "tipologia", label: "Tipologia", field: "tipologia", align: "left" }, + { name: "tipoformato", label: "Formato", field: "tipoformato", align: "left" }, { name: "date_pub", label: "Pubblicato", field: "date_pub", align: "left" }, //{ name: "ranking", label: "Class.", field: "ranking", align: "right" }, //{ name: "rank3M", label: "Class. 3M", field: "rank3M", align: "right", visu: costanti.VISUCAMPI.PER_EDITORE }, @@ -136,87 +150,97 @@ export default defineComponent({ ]; function getFieldValue(element: any, field: any): any { - switch (field.field) { - case 'image': - return element.productInfo?.imagefile - ? tools.getFullFileNameByImageFile('productInfos', element.productInfo?.imagefile) - : element.productInfo?.image_link; + if (!element) + return '' - case 'name': - return element.productInfo?.name; + try { + switch (field.field) { + case 'image': + return element.productInfo?.imagefile + ? tools.getFullFileNameByImageFile('productInfos', element.productInfo?.imagefile) + : element.productInfo?.image_link; - case 'authors': - return formatAuthors(element.productInfo?.authors); + case 'name': + return element.productInfo?.name; - case 'isbn': - return element.isbn; + case 'authors': + return formatAuthors(element.productInfo?.authors); - case 'trafiletto': - return element.productInfo?.descr_trafiletto_catalogo?.length > 100 ? 'SI' : 'NO'; + case 'isbn': + return element.isbn; - case 'catprods': - return tools.formatCatProds(element.productInfo?.catprods); + case 'trafiletto': + return element.productInfo?.descr_trafiletto_catalogo?.length > 100 ? 'SI' : 'NO'; - case 'edizione': - return element.arrvariazioni?.[0]?.edizione; + case 'catprods': + return tools.formatCatProds(element.productInfo?.catprods); - case 'casaeditrice': - return products.getCasaEditriceByIdPublisher(element.productInfo?.idPublisher); + case 'edizione': + return element.arrvariazioni?.[0]?.edizione; - case 'idCollana': - return tools.formatCollane(element.productInfo?.idCollana); + case 'casaeditrice': + return products.getCasaEditriceByIdPublisher(element.productInfo?.idPublisher); - case 'stato': - return products.getDescrStatiProdottoByIdStatoProdotto(element.productInfo?.idStatoProdotto || ''); + case 'idCollana': + return tools.formatCollane(element.productInfo?.idCollana); - case 'tipologia': - return products.getDescrByIdTipologia(element.arrvariazioni?.[0]?.idTipologia || ''); + case 'stato': + return products.getDescrStatiProdottoByIdStatoProdotto(element.productInfo?.idStatoProdotto || ''); - case 'tipoformato': - return products.getDescrByIdTipoFormato(element.arrvariazioni?.[0]?.idTipoFormato || ''); + case 'tipologia': + return products.getDescrByIdTipologia(element.arrvariazioni?.[0]?.idTipologia || ''); - case 'date_pub': - return tools.getstrDate(element.productInfo?.date_pub); + case 'tipoformato': + return products.getDescrByIdTipoFormato(element.arrvariazioni?.[0]?.idTipoFormato || ''); - case 'rank3M': - return element.productInfo?.rank3M; + case 'date_pub': + return tools.getstrDate(element.productInfo?.date_pub); - case 'rank6M': - return element.productInfo?.rank6M; + case 'rank3M': + return element.productInfo?.rank3M; - case 'rank1Y': - return element.productInfo?.rank1Y; + case 'rank6M': + return element.productInfo?.rank6M; - case 'pagine': - return element.arrvariazioni?.[0]?.pagine; + case 'rank1Y': + return element.productInfo?.rank1Y; - case 'totVen': - return element.productInfo?.totVen; + case 'pagine': + return element.arrvariazioni?.[0]?.pagine; - case 'totFat': - return element.productInfo?.totFat; + case 'totVen': + return element.productInfo?.totVen; - case 'fatLast6M': - return element.productInfo?.fatLast6M; + case 'totFat': + return element.productInfo?.totFat; - case 'fatLast1Y': - return element.productInfo?.fatLast1Y; + case 'fatLast6M': + return element.productInfo?.fatLast6M; - case 'fatLast2Y': - return element.productInfo?.fatLast2Y; + case 'fatLast1Y': + return element.productInfo?.fatLast1Y; - case 'ult_ord': - return tools.getstrDate(element.productInfo?.dataUltimoOrdine); + case 'fatLast2Y': + return element.productInfo?.fatLast2Y; - case 'quantity': - return element.arrvariazioni?.[0]?.quantita; + case 'ult_ord': + return tools.getstrDate(element.productInfo?.dataUltimoOrdine); - default: - return null; + case 'quantity': + return element.arrvariazioni?.[0]?.quantita; + + default: + return null; + } + } catch (e) { + console.error('Errore getFieldValue:', e, element, field); + return null; } } function getFieldClass(element: any, field: any): string { + if (!element) + return '' switch (field.field) { case 'trafiletto': return element.productInfo?.descr_trafiletto_catalogo?.length > 100 @@ -265,6 +289,8 @@ export default defineComponent({ } function getFieldStyle(element: any, field: any): Record { + if (!element) + return '' switch (field.field) { case 'image': return { @@ -357,13 +383,6 @@ export default defineComponent({ .join(", "); } - // Caricamento delle preferenze al mount del componente - onMounted(() => { - const savedColumns = tools.getCookie("selColCat"); - if (savedColumns) { - selectedColumns.value = savedColumns; - } - }); function showProduct(element: any) { selProd.value = element @@ -524,6 +543,7 @@ export default defineComponent({ getFieldClass, getFieldStyle, getFieldClick, + handleUpdate, } } }) diff --git a/src/components/CProductTable/CProductTable.vue b/src/components/CProductTable/CProductTable.vue index b959eab6..d9ecb2d7 100755 --- a/src/components/CProductTable/CProductTable.vue +++ b/src/components/CProductTable/CProductTable.vue @@ -50,11 +50,13 @@ diff --git a/src/model/CatalogStore.ts b/src/model/CatalogStore.ts index db07093f..01857a74 100755 --- a/src/model/CatalogStore.ts +++ b/src/model/CatalogStore.ts @@ -10,6 +10,7 @@ export interface ICatalog { foto_collana?: IImg, idCollane?: string[] argomenti?: string[] + idTipoFormato?: number[] condition_andor: number, editore?: string[] collana_info?: ICollana diff --git a/src/model/GlobalStore.ts b/src/model/GlobalStore.ts index e09d8dcb..929c3a83 100755 --- a/src/model/GlobalStore.ts +++ b/src/model/GlobalStore.ts @@ -809,6 +809,7 @@ export interface IMyScheda { productTypes?: number[] excludeproductTypes?: number[] idTipologie?: number[] + idTipoFormato?: number[] editore?: string[] argomenti?: string[] idCollane?: string[] @@ -858,6 +859,7 @@ export interface IOptCatalogo { excludeproductTypes?: number[] formato?: string[] idTipologie?: number[] + idTipoFormato?: number[] Categoria?: string[] editore?: string[] argomenti?: string[] diff --git a/src/model/Products.ts b/src/model/Products.ts index d46e04aa..064636b8 100755 --- a/src/model/Products.ts +++ b/src/model/Products.ts @@ -1,5 +1,11 @@ import type { IUserFields, IUserShort } from './UserStore' +export interface IVerificaProd { + esito?: number + data?: Date + username?: string + note?: string +} export interface IProductInfo { _id?: any diff --git a/src/statics/lang/it.js b/src/statics/lang/it.js index 42e3296c..e94798dc 100755 --- a/src/statics/lang/it.js +++ b/src/statics/lang/it.js @@ -2051,6 +2051,7 @@ const msg_it = { pdf_generato_stampa: 'Pdf generato (per STAMPA)', pdf_online_stampa: 'Pdf online Ufficiale (per STAMPA)', argomenti: 'Argomenti', + idTipoFormato: 'Tipo Formato', numprodtot: 'Numero Prodotti', }, diff --git a/src/store/Modules/costanti.ts b/src/store/Modules/costanti.ts index 28acaedc..45eeedbe 100755 --- a/src/store/Modules/costanti.ts +++ b/src/store/Modules/costanti.ts @@ -27,10 +27,14 @@ export const costanti = { CATALOGO_FIELDS: [ 'productTypes', 'excludeproductTypes', + 'formato', + 'idTipologie', + 'idTipoFormato', 'misure', 'Categoria', - 'idCollane', 'editore', + 'argomenti', + 'idCollane', 'pdf', 'Printable', 'numschede_perCol', diff --git a/src/store/Modules/fieldsTable.ts b/src/store/Modules/fieldsTable.ts index bdaffec7..d31838b3 100755 --- a/src/store/Modules/fieldsTable.ts +++ b/src/store/Modules/fieldsTable.ts @@ -169,6 +169,12 @@ export const colTableCatalogList = [ fieldtype: costanti.FieldType.multiselect, jointable: 'publishers_totali', }), + AddCol({ + name: 'idTipoFormato', + label_trans: 'cataloglist.idTipoFormato', + fieldtype: costanti.FieldType.multiselect, + jointable: 't_web_tipiformatos', + }), AddCol({ name: 'descr_introduttiva', label_trans: 'cataloglist.descr_introduttiva', fieldtype: costanti.FieldType.html, maxlength: 1300 }), AddCol({ name: 'pagina_introduttiva_sfondo_nero', label_trans: 'cataloglist.pagina_introduttiva_sfondo_nero', fieldtype: costanti.FieldType.boolean }), @@ -316,6 +322,12 @@ export const colmyScheda = [ AddCol({ name: 'productTypes', label_trans: 'productTypes', fieldtype: costanti.FieldType.number }), AddCol({ name: 'excludeproductTypes', label_trans: 'excludeproductTypes', fieldtype: costanti.FieldType.number }), AddCol({ name: 'idTipologie', label_trans: 'idTipologie', fieldtype: costanti.FieldType.number }), + AddCol({ + name: 'idTipoFormato', + label_trans: 'cataloglist.idTipoFormato', + fieldtype: costanti.FieldType.multiselect, + jointable: 't_web_tipiformatos', + }), AddCol({ name: 'editore', label_trans: 'editore' }), AddCol({ name: 'author', label_trans: 'scheda.author' }), AddCol({ name: 'argomenti', label_trans: 'scheda.argomenti' }), diff --git a/src/store/Products.ts b/src/store/Products.ts index e7b387b8..744ab3c8 100755 --- a/src/store/Products.ts +++ b/src/store/Products.ts @@ -1529,7 +1529,7 @@ export const useProducts = defineStore('Products', { replacements['{collana}'] = tools.formatCollane(myproduct.productInfo.idCollana) || ''; } - const maxDescriptionLength = testo.maxlength || 600; + const maxDescriptionLength = testo.maxlength || 680; if (testo.contenuto.includes('{descrizione_da_fdv}')) { const description = myproduct.productInfo.short_descr || ''; @@ -1564,16 +1564,17 @@ export const useProducts = defineStore('Products', { if (testo.contenuto.includes('{descrizione_breve_macro}')) { const short_descr = myproduct.productInfo.descrizione_breve_macro || ''; - replacements['{descrizione_breve_macro}'] = short_descr.length > maxDescriptionLength && maxDescriptionLength > 0 + replacements['{descrizione_breve_macro}'] = short_descr.length > maxDescriptionLength && maxDescriptionLength > 0 ? short_descr.substring(0, short_descr.lastIndexOf(' ', maxDescriptionLength)) + '...' : short_descr; } - if (testo.contenuto.includes('{descr_trafiletto_catalogo}')) { + if (testo.contenuto.includes('{descr_trafiletto_catalogo}') || testo.contenuto.includes('{descrizione_completa_macro}')) { const short_descr = myproduct.productInfo.descr_trafiletto_catalogo || ''; - replacements['{descr_trafiletto_catalogo}'] = short_descr.length > maxDescriptionLength && maxDescriptionLength > 0 + replacements['{descr_trafiletto_catalogo}'] = short_descr.length > maxDescriptionLength && maxDescriptionLength > 0 ? short_descr.substring(0, short_descr.lastIndexOf(' ', maxDescriptionLength)) + '...' : short_descr; + replacements['{descrizione_completa_macro}'] = replacements['{descr_trafiletto_catalogo}'] } if (testo.contenuto.includes('{prezzo}') || testo.contenuto.includes('{prezzo_scontato}')) { @@ -1666,7 +1667,7 @@ export const useProducts = defineStore('Products', { case '{debug}': const date_pub = replacements['{date_pub}'] || ''; const fatLast6M = myproduct.productInfo.fatLast6M! || 0; - const linkvenduti = `${replacements['{venduti}']}`; + const linkvenduti = `${myproduct.productInfo.totVen!}`; const vLast3M = myproduct.productInfo.vLast3M! || 0; const vLast6M = myproduct.productInfo.vLast6M! || 0; const linkfatturati = `${myproduct.productInfo.totFat! || 0}`; diff --git a/src/store/globalStore.ts b/src/store/globalStore.ts index 1e0c2a26..70f9dbbb 100644 --- a/src/store/globalStore.ts +++ b/src/store/globalStore.ts @@ -2674,6 +2674,7 @@ export const useGlobalStore = defineStore('GlobalStore', { try { // aggiungi idapp ad options options.idapp = tools.getEnv('VITE_APP_ID') + console.log('CHIAMATA fetchTableContent...', options) return Api.SendReq('/apisqlsrv/view-table', 'POST', { options }) .then((res) => { return res.data.data @@ -2682,7 +2683,6 @@ export const useGlobalStore = defineStore('GlobalStore', { }) } catch (error) { console.error("Errore nel recupero della tabella:", error); - throw error; } }, @@ -2783,7 +2783,16 @@ export const useGlobalStore = defineStore('GlobalStore', { if (index !== -1 && index !== undefined) { // Aggiorna il record mantenendo reattività - mytablerec![index] = { ...mytablerec[index], ...resdata.rec } + if (datain.table === 'catalogs') { + // salva lista_prodotti + const prec_lista_prodotti = mytablerec![index].lista_prodotti + mytablerec![index] = { ...mytablerec[index], ...resdata.rec } + mytablerec![index].lista_prodotti = prec_lista_prodotti + } else { + + mytablerec![index] = { ...mytablerec[index], ...resdata.rec } + console.log('Aggiorna il record mantenendo reattività') + } } } } diff --git a/src/views/admin/cfgServer/cfgServer.ts b/src/views/admin/cfgServer/cfgServer.ts index c819bba5..6b5d6b31 100755 --- a/src/views/admin/cfgServer/cfgServer.ts +++ b/src/views/admin/cfgServer/cfgServer.ts @@ -62,7 +62,7 @@ export default defineComponent({ } function SaveValue(newVal: any, valinitial: any) { - console.log('SaveValue', newVal) + // console.log('SaveValue', newVal) const mydata: ICfgServer = { chiave: keysel.value, diff --git a/src/views/admin/dbopmacro/dbopmacro.vue b/src/views/admin/dbopmacro/dbopmacro.vue index 1dfda7b4..f27bebdc 100755 --- a/src/views/admin/dbopmacro/dbopmacro.vue +++ b/src/views/admin/dbopmacro/dbopmacro.vue @@ -11,6 +11,21 @@ @click="EseguiFunz('MigrateMSSQLToMongoDb', {tutte: true})" > + + + ` + testo + `` + return testo }) @@ -489,6 +499,7 @@ export default defineComponent({ filtroProductTypes: number[], filtroExcludeProductTypes: number[], filtroidTipologie: number[], + filtroidTipoFormato: number[], editore: string[], idCollane: string[], arrargomstr: any[], @@ -507,6 +518,7 @@ export default defineComponent({ filtroProductTypes.length === 0 || (filtroProductTypes.length === 1 && filtroProductTypes[0] === 0); const boolfiltroVuotoExcludeProductTypes = filtroExcludeProductTypes.length === 0; const boolfiltroVuotoidTipologie = filtroidTipologie.length === 0; + const boolfiltroVuotoidTipoFormato = filtroidTipoFormato.length === 0; const boolfiltroVuotoEditore = editore.length === 0; const boolfiltroVuotoCollane = idCollane.length === 0; const boolfiltroVuotoArgomenti = arrargomstr.length === 0; @@ -587,6 +599,10 @@ export default defineComponent({ ? true : filtroidTipologie.includes(product.arrvariazioni?.[0].idTipologia); + const hasidTipoFormato = boolfiltroVuotoidTipoFormato + ? true + : filtroidTipoFormato.includes(product.arrvariazioni?.[0].idTipoFormato); + // Filtri per editore const hasPublished = boolfiltroVuotoEditore ? se_tutti_veri @@ -615,7 +631,7 @@ export default defineComponent({ const filtri = [hasArgomentiCat, hasCategoria, hasCollana, hasPublished]; // Decido se combinare in AND o OR sulla base della scelta globale - let risult = searchMatch && hasAuthor && productgassel && hasidTipologie + let risult = searchMatch && hasAuthor && productgassel && hasidTipologie && hasidTipoFormato if (op_andor.condition_andor === costanti.OP_ANDOR.OP_AND) { risult = risult && filtri.every(Boolean); // Tutti i gruppi devono essere veri @@ -653,6 +669,7 @@ export default defineComponent({ const filtroProductTypes = optcatalogo.value.productTypes || [0]; const filtroExcludeProductTypes = optcatalogo.value.excludeproductTypes || [0]; const filtroidTipologie = optcatalogo.value.idTipologie || []; + const filtroidTipoFormato = optcatalogo.value.idTipoFormato || []; const editore = getEditoreDaFiltrare(optcatalogo.value.editore); const filtroPublishers = editore || []; const idCollane = getIdCollaneDaFiltrare(optcatalogo.value.idCollane); @@ -693,6 +710,7 @@ export default defineComponent({ filtroProductTypes, filtroExcludeProductTypes, filtroidTipologie, + filtroidTipoFormato, filtroPublishers, filtroCollane, arrargomstr, @@ -752,6 +770,7 @@ export default defineComponent({ !arraysEqual(scheda.productTypes, schedaprec?.productTypes) || !arraysEqual(scheda.excludeproductTypes, schedaprec?.excludeproductTypes) || !arraysEqual(scheda.idTipologie, schedaprec?.idTipologie) || + !arraysEqual(scheda.idTipoFormato, schedaprec?.idTipoFormato) || !arraysEqual(scheda.editore, schedaprec?.editore) || !arraysEqual(scheda.idCollane, schedaprec?.idCollane) ; @@ -767,6 +786,7 @@ export default defineComponent({ const filtroProductTypes = scheda.productTypes || [0]; const filtroExcludeProductTypes = scheda.excludeproductTypes || [0]; const filtroidTipologie = scheda.idTipologie || []; + const filtroidTipoFormato = scheda.idTipoFormato || []; const editore = getEditoreDaFiltrare(scheda.editore); const filtroPublishers = editore || []; const idCollane = getIdCollaneDaFiltrare(scheda.idCollane); @@ -795,6 +815,7 @@ export default defineComponent({ filtroProductTypes, filtroExcludeProductTypes, filtroidTipologie, + filtroidTipoFormato, filtroPublishers, filtroCollane, arrargomstr, @@ -1091,7 +1112,11 @@ export default defineComponent({ if (showListaArgomenti.value) cat.value = tools.getCookie(getKeyCatAtLoad(), '') - tabcatalogo.value = tools.getCookie('TAB_CAT', 'visu') + if (getCatalogoByMyPage.value) { + tabcatalogo.value = tools.getCookie('TAB_CAT', 'visu') + } else { + tabcatalogo.value = 'visu' + } optrigenera.value.visibilitaDisp = tools.getCookie((showListaArgomenti.value ? 'INC_ES_' : '') + 'VIS_DISP', costanti.DISP.DISPONIBILI) optrigenera.value.stato = tools.getCookie((showListaArgomenti.value ? 'INC_ES_' : '') + 'VIS_STATO', costanti.STATO.IN_COMMERCIO) diff --git a/src/views/ecommerce/catalogo/catalogo.vue b/src/views/ecommerce/catalogo/catalogo.vue index c8b0dbcc..cc78f376 100755 --- a/src/views/ecommerce/catalogo/catalogo.vue +++ b/src/views/ecommerce/catalogo/catalogo.vue @@ -190,6 +190,7 @@ PASSI DA COMPIERE PER FARE AGGIORNAMENTI : - 1. Ottenere il file delle descrizioni aggiornato (da Matteo chiedere l'export di tutti i prodotti presenti su GruppoMacro - XML) + 1. Ottenere il file delle descrizioni aggiornato (esportare tutti i prodotti presenti su GruppoMacro - XML) + Esporta Prodotti (XML) + 2. Eseguire "IMPORTA DESCRIZIONI E LINK DA SITO GRUPPOMACRO (XML)" - importa_descrizioni_e_link.xml - 3. Visualizza - Ranking - + 3. Visualizza: (Ranking Ordini) + >Articoli Venduti e controlla se tutto ok +
- 4. Esporta il file del Ranking ed importarlo con "IMPORTA RANKING DA JSON" - (Esporta Ranking Venduti e Fatturati) - - 5. Scarica Catalogo (Catalogo primofeed-2.json) - - 6. Esegui "Importa Cataloghi da JSON (ImportaMacro)" - - 7. GENERARE UN CATALOGO cliccando su "CREA CATALOGO ..." + 4 . GENERARE UN CATALOGO cliccando su "CREA CATALOGO ..." 8. Tabella Argomenti - Gestisci Campi Catalogo FDV (CTXFEED) - + -
+
+ + +
-
-