From fea40922cbffefd601bf68eefb2de4fad9f8e520 Mon Sep 17 00:00:00 2001 From: Surya Paolo Date: Tue, 20 May 2025 12:21:31 +0200 Subject: [PATCH] =?UTF-8?q?-=20Per=20generare=20la=20sinossi=20=C3=A8=20po?= =?UTF-8?q?ssibile=20estrarre=20con=201=20click=20la=20descrizione=20sia?= =?UTF-8?q?=20da=20Amazon=20che=20da=20GruppoMacro.=20-=20corretto=20picco?= =?UTF-8?q?lo=20bug=20sul=20catalogo.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 4 +- 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 +- .../nutriben-naturopatia.it/package.json | 14 +- .../_ALL_SITES/piuchebuono.app/package.json | 12 +- scripts/_ALL_SITES/riso.app/package.json | 12 +- src-pwa/custom-service-worker.js | 2 +- src/components/CCatalogoCard/CCatalogoCard.ts | 19 +- .../CCatalogoCard/CCatalogoCard.vue | 27 ++- .../CModifTrafiletto/CModifTrafiletto.ts | 170 +++++++++++++----- .../CModifTrafiletto/CModifTrafiletto.vue | 58 +++++- src/components/CProductTable/CProductTable.ts | 33 +++- .../CProductTable/CProductTable.vue | 19 ++ .../CSchedaProdotto/CSchedaProdotto.scss | 14 +- .../CSchedaProdotto/CSchedaProdotto.ts | 1 + .../CSchedaProdotto/CSchedaProdotto.vue | 6 +- src/statics/lang/it.js | 21 +++ src/store/CatalogStore.ts | 2 +- src/store/Modules/fieldsTable.ts | 26 +++ src/store/Products.ts | 11 ++ src/views/admin/dbopmacro/dbopmacro.vue | 16 +- src/views/ecommerce/catalogo/catalogo.vue | 2 +- 26 files changed, 406 insertions(+), 125 deletions(-) diff --git a/.env b/.env index 09362ce8..ce73a92f 100755 --- a/.env +++ b/.env @@ -1,6 +1,6 @@ -VITE_APP_VERSION="1.2.47" +VITE_APP_VERSION="1.2.48" VITE_LANG_DEFAULT="it" VITE_PAO_APP_ID="KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF" -VITE_SERVICE_WORKER_FILE="sw-1.2.47.js" +VITE_SERVICE_WORKER_FILE="sw-1.2.48.js" VITE_PROJECT_ID_MAIN="5cc0a13fe5c9d156728f400a" VITE_VUE_ROUTER_MODE="history" \ No newline at end of file diff --git a/index.html b/index.html index 2e5cf3ff..f4ac7f74 100755 --- a/index.html +++ b/index.html @@ -10,7 +10,7 @@ - + diff --git a/package.json b/package.json index 92027bbf..c9bf0fd5 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gruppomacro", - "version": "1.2.47", + "version": "1.2.48", "description": "Gruppo Macro", "productName": "Gruppo Macro", "author": "Surya", @@ -9,20 +9,20 @@ "license": "MIT", "type": "module", "scripts": { - "dev": "PORT=8089 APP_VERSION='1.2.47' quasar dev", + "dev": "PORT=8089 APP_VERSION='1.2.48' quasar dev", "dev_noCheck": "SKIP_TSC=true quasar dev", "build": "quasar build", - "buildpwa": "NODE_ENV=production APP_VERSION='1.2.47' quasar build -m pwa", - "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.47' quasar build -m pwa", + "buildpwa": "NODE_ENV=production APP_VERSION='1.2.48' quasar build -m pwa", + "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.48' quasar build -m pwa", "type-check": "vue-tsc --noEmit", "type-check:watch": "vue-tsc --noEmit --watch", - "buildspa": "APP_VERSION='1.2.47' quasar build -m spa", + "buildspa": "APP_VERSION='1.2.48' 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.47' quasar dev -m pwa", - "spa": "NODE_ENV=development PORT=8089 APP_VERSION='1.2.47' quasar dev", + "pwa": "NODE_ENV=development PORT=8099 APP_VERSION='1.2.48' quasar dev -m pwa", + "spa": "NODE_ENV=development PORT=8089 APP_VERSION='1.2.48' 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 0d6573bc..c287b56d 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.47", + "version": "1.2.48", "description": "Comunita Nuovo Mondo", "productName": "ComunitaNuovoMondo", "author": "Surya", @@ -9,7 +9,7 @@ "license": "MIT", "type": "module", "scripts": { - "dev": "PORT=8083 APP_VERSION='1.2.47' quasar dev", + "dev": "PORT=8083 APP_VERSION='1.2.48' 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.47' quasar dev -m pwa", - "spa": "NODE_ENV=development PORT=8083 APP_VERSION='1.2.47' quasar dev", + "pwa": "NODE_ENV=development PORT=8093 APP_VERSION='1.2.48' quasar dev -m pwa", + "spa": "NODE_ENV=development PORT=8083 APP_VERSION='1.2.48' 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 db3745e4..2499b296 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.47", + "version": "1.2.48", "description": "freeplanet", "productName": "freeplanet", "author": "Surya", @@ -9,11 +9,11 @@ "license": "MIT", "type": "module", "scripts": { - "dev": "PORT=8087 APP_VERSION='1.2.47' quasar dev", + "dev": "PORT=8087 APP_VERSION='1.2.48' quasar dev", "dev_noCheck": "SKIP_TSC=true quasar dev", "build": "quasar build", - "buildpwa": "NODE_ENV=production APP_VERSION='1.2.47' quasar build -m pwa", - "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.47' quasar build -m pwa", + "buildpwa": "NODE_ENV=production APP_VERSION='1.2.48' quasar build -m pwa", + "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.48' 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.47' quasar dev -m pwa", - "spa": "NODE_ENV=development PORT=8087 APP_VERSION='1.2.47' quasar dev", + "pwa": "NODE_ENV=development PORT=8097 APP_VERSION='1.2.48' quasar dev -m pwa", + "spa": "NODE_ENV=development PORT=8087 APP_VERSION='1.2.48' 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 92985af4..199c1361 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.47", + "version": "1.2.48", "description": "Gruppo Macro", "productName": "Gruppo Macro", "author": "Surya", @@ -9,20 +9,20 @@ "license": "MIT", "type": "module", "scripts": { - "dev": "PORT=8089 APP_VERSION='1.2.47' quasar dev", + "dev": "PORT=8089 APP_VERSION='1.2.48' quasar dev", "dev_noCheck": "SKIP_TSC=true quasar dev", "build": "quasar build", - "buildpwa": "NODE_ENV=production APP_VERSION='1.2.47' quasar build -m pwa", - "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.47' quasar build -m pwa", + "buildpwa": "NODE_ENV=production APP_VERSION='1.2.48' quasar build -m pwa", + "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.48' quasar build -m pwa", "type-check": "vue-tsc --noEmit", "type-check:watch": "vue-tsc --noEmit --watch", - "buildspa": "APP_VERSION='1.2.47' quasar build -m spa", + "buildspa": "APP_VERSION='1.2.48' 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.47' quasar dev -m pwa", - "spa": "NODE_ENV=development PORT=8089 APP_VERSION='1.2.47' quasar dev", + "pwa": "NODE_ENV=development PORT=8099 APP_VERSION='1.2.48' quasar dev -m pwa", + "spa": "NODE_ENV=development PORT=8089 APP_VERSION='1.2.48' 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 0e30ddc3..ecac0efa 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.47", + "version": "1.2.48", "description": "kolibrilab", "productName": "kolibrilab", "author": "Surya Paolo", @@ -8,11 +8,11 @@ "keywords": [], "license": "MIT", "scripts": { - "dev": "PORT=8083 APP_VERSION='1.2.47' quasar dev", + "dev": "PORT=8083 APP_VERSION='1.2.48' quasar dev", "dev_noCheck": "SKIP_TSC=true quasar dev", "build": "quasar build", - "buildpwa": "NODE_ENV=production APP_VERSION='1.2.47' quasar build -m pwa", - "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.47' quasar build -m pwa", + "buildpwa": "NODE_ENV=production APP_VERSION='1.2.48' quasar build -m pwa", + "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.48' 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.47' quasar dev -m pwa", - "spa": "NODE_ENV=development PORT=8083 APP_VERSION='1.2.47' quasar dev", + "pwa": "NODE_ENV=development PORT=8093 APP_VERSION='1.2.48' quasar dev -m pwa", + "spa": "NODE_ENV=development PORT=8083 APP_VERSION='1.2.48' 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/nutriben-naturopatia.it/package.json b/scripts/_ALL_SITES/nutriben-naturopatia.it/package.json index 2d9ee658..e18abe47 100755 --- a/scripts/_ALL_SITES/nutriben-naturopatia.it/package.json +++ b/scripts/_ALL_SITES/nutriben-naturopatia.it/package.json @@ -1,6 +1,6 @@ { "name": "nutriben", - "version": "1.2.47", + "version": "1.2.48", "description": "Nutriben", "productName": "Nutriben", "author": "Surya", @@ -9,20 +9,20 @@ "license": "MIT", "type": "module", "scripts": { - "dev": "PORT=8093 APP_VERSION='1.2.47' quasar dev", + "dev": "PORT=8093 APP_VERSION='1.2.48' quasar dev", "dev_noCheck": "SKIP_TSC=true quasar dev", "build": "quasar build", - "buildpwa": "NODE_ENV=production APP_VERSION='1.2.47' quasar build -m pwa", - "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.47' quasar build -m pwa", + "buildpwa": "NODE_ENV=production APP_VERSION='1.2.48' quasar build -m pwa", + "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.48' quasar build -m pwa", "type-check": "vue-tsc --noEmit", "type-check:watch": "vue-tsc --noEmit --watch", - "buildspa": "APP_VERSION='1.2.47' quasar build -m spa", + "buildspa": "APP_VERSION='1.2.48' 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.47' quasar dev -m pwa", - "spa": "NODE_ENV=development PORT=8093 APP_VERSION='1.2.47' quasar dev", + "pwa": "NODE_ENV=development PORT=8099 APP_VERSION='1.2.48' quasar dev -m pwa", + "spa": "NODE_ENV=development PORT=8093 APP_VERSION='1.2.48' 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/piuchebuono.app/package.json b/scripts/_ALL_SITES/piuchebuono.app/package.json index 8000642e..08dd8922 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.47", + "version": "1.2.48", "description": "PiuCheBuono", "productName": "PiuCheBuono", "author": "Surya", @@ -9,11 +9,11 @@ "license": "MIT", "type": "module", "scripts": { - "dev": "PORT=8085 APP_VERSION='1.2.47' quasar dev", + "dev": "PORT=8085 APP_VERSION='1.2.48' quasar dev", "dev_noCheck": "SKIP_TSC=true quasar dev", "build": "quasar build", - "buildpwa": "NODE_ENV=production APP_VERSION='1.2.47' quasar build -m pwa", - "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.47' quasar build -m pwa", + "buildpwa": "NODE_ENV=production APP_VERSION='1.2.48' quasar build -m pwa", + "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.48' 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.47' quasar dev -m pwa", - "spa": "NODE_ENV=development PORT=8085 APP_VERSION='1.2.47' quasar dev", + "pwa": "NODE_ENV=development PORT=8085 APP_VERSION='1.2.48' quasar dev -m pwa", + "spa": "NODE_ENV=development PORT=8085 APP_VERSION='1.2.48' 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 ec154a2b..42eedd97 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.47", + "version": "1.2.48", "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.47' PORT=8084 quasar dev", + "dev": "APP_VERSION='1.2.48' PORT=8084 quasar dev", "dev_noCheck": "SKIP_TSC=true quasar dev", "build": "quasar build", - "buildpwa": "NODE_ENV=production APP_VERSION='1.2.47' quasar build -m pwa", - "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.47' quasar build -m pwa", + "buildpwa": "NODE_ENV=production APP_VERSION='1.2.48' quasar build -m pwa", + "buildpwatest": "NODE_ENV=production APP_VERSION='1.2.48' 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.47' quasar dev -m pwa", - "spa": "NODE_ENV=development PORT=8084 APP_VERSION='1.2.47' quasar dev", + "pwa": "NODE_ENV=development PORT=8094 APP_VERSION='1.2.48' quasar dev -m pwa", + "spa": "NODE_ENV=development PORT=8084 APP_VERSION='1.2.48' 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 be51264e..058e963b 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.47'; +const VITE_APP_VERSION = '1.2.48'; // Costanti di configurazione const DYNAMIC_CACHE = 'dynamic-cache-v2'; diff --git a/src/components/CCatalogoCard/CCatalogoCard.ts b/src/components/CCatalogoCard/CCatalogoCard.ts index ad99b452..4046800e 100755 --- a/src/components/CCatalogoCard/CCatalogoCard.ts +++ b/src/components/CCatalogoCard/CCatalogoCard.ts @@ -779,6 +779,7 @@ export default defineComponent({ const options = { update, aggiornasoloSeVuoti, + forzaricarica: true, }; const myparam = { product_id: myproduct.value._id, options }; @@ -787,14 +788,22 @@ export default defineComponent({ const dataupdated = await globalStore .scrapingBook(myparam) .then((dataupdated) => { - if (dataupdated) { + if (dataupdated && update) { tools.showPositiveNotif($q, t('dbgm.scrapingOkUpdated')); } + if (!dataupdated) { + tools.showNegativeNotif($q, t('dbgm.dati_non_estratti')); + visudataextracted.value = false + } return dataupdated; }) .catch((e) => { - console.error('Errore aggiornamento singolo libro:', e); - tools.showNegativeNotif($q, t('dbgm.updateLocalDb_ERROR')); + if (update) { + console.error('Errore aggiornamento singolo libro:', e); + tools.showNegativeNotif($q, t('dbgm.updateLocalDb_ERROR')); + } else { + tools.showNegativeNotif($q, t('dbgm.err_extraction')); + } loading.value = false; }); loading.value = false; @@ -803,7 +812,6 @@ export default defineComponent({ } async function getDataExtracted() { - visudataextracted.value = true; loading.value = true; @@ -814,8 +822,9 @@ export default defineComponent({ const html = tools.generateHtmlTableFromObject(data); dataextractedWeb.value = html; } catch (error) { - console.error('Errore durante l\'estrazione dei dati:', error); + console.error("Errore durante l'estrazione dei dati:", error); dataextractedWeb.value = 'Errore nel caricamento dei dati.'; + visudataextracted.value = false; } finally { loading.value = false; } diff --git a/src/components/CCatalogoCard/CCatalogoCard.vue b/src/components/CCatalogoCard/CCatalogoCard.vue index 48f7d67e..d435f9c5 100755 --- a/src/components/CCatalogoCard/CCatalogoCard.vue +++ b/src/components/CCatalogoCard/CCatalogoCard.vue @@ -885,7 +885,7 @@ > - Visu + Visu dati Estratti -
Dati

+

Dati Estratti

+
+ + + +
({ ...props.modelValue }) + const myproduct = ref({ ...props.modelValue }); - const id = computed(() => myproduct.value.productInfo._id) + const id = computed(() => myproduct.value.productInfo._id); const myvalue = computed(() => { - return myproduct.value.productInfo[props.mykey] - }) + return myproduct.value.productInfo[props.mykey]; + }); - watch(() => props.modelValue, (newVal) => { - myproduct.value = { ...newVal }; - }, { deep: false }); + watch( + () => props.modelValue, + (newVal) => { + myproduct.value = { ...newVal }; + }, + { deep: false } + ); + const loadMyScrapingBook = async () => { + loading.value = true; + try { + const myscrapingbook = await products.loadMyScrapingBook( + myproduct.value.isbn, false + ); + myproduct.value.myscrapingbook = myscrapingbook; + } catch (error) { + console.error('Errore caricamento MyScrapingBook:', error); + } finally { + loading.value = false; + } + }; async function mounted() { + // carico anche altri dati del product + await loadMyScrapingBook(); } /* @@ -110,45 +132,94 @@ export default defineComponent({ function updateproductmodif(element: any) { // console.log('CModifTrafiletto updateproductmodif ', element) - emit('updateproductmodif', element) + emit('updateproductmodif', element); } function Savedb(element: any) { - tools.saveInDBForTypes($q, props.mykey, element, props.type, true, props.table, props.mysubkey, id.value, null, ''); + tools.saveInDBForTypes( + $q, + props.mykey, + element, + props.type, + true, + props.table, + props.mysubkey, + id.value, + null, + '' + ); } async function updateproduct(load?: boolean) { - myproduct.value = await products.getProductById(myproduct.value._id, load) - + myproduct.value = await products.getProductById( + myproduct.value._id, + load + ); } const copyToClipboard = (text) => { - navigator.clipboard.writeText(text) + navigator.clipboard + .writeText(text) .then(() => { $q.notify({ message: 'Testo copiato negli appunti!', color: 'positive', icon: 'check', - position: 'top' + position: 'top', }); }) - .catch(err => { + .catch((err) => { console.error('Errore durante la copia:', err); $q.notify({ message: 'Errore nella copia', color: 'negative', icon: 'error', - position: 'top' + position: 'top', }); }); - } + }; function handleShowAndSave(payload: any) { Savedb(payload); updateproductmodif(payload); } - onMounted(mounted) + function getPrompt() { + // Prompt: + let mydescr = 'Scrivimi la sinossi del seguente libro, che andrà nel catalogo libri, di massimo 680 battute, senza spiegazione, senza titolo iniziale, solo la sinossi. Togli eventuali riferimenti a chi ha fatto la prefazione. Rendilo un po\' accattivante, ma non troppo. \n\n'; + return mydescr + } + + function copyDescrizioneFromScrapingData() { + let mydescr = ''; + + const data = myproduct?.value.myscrapingbook; + if (!data) return false; + + mydescr = getPrompt() + mydescr += 'Titolo Libro: ' + data.titolo + '\n'; + mydescr += 'Autore Libro: ' + data.autore + '\n'; + + mydescr += 'DESCRIZIONE LIBRO: \n'; + mydescr += data.descrizione_lunga; + + tools.copyStringToClipboard($q, mydescr, false); + } + + function copyDescrizioneFromGruppoMacro() { + let mydescr = ''; + + mydescr = getPrompt() + mydescr += 'Titolo Libro: ' + myproduct?.value.productInfo?.name + '\n'; + mydescr += 'Autore Libro: ' + products.getAutoriByArrayAuthors(myproduct?.productInfo?.authors) + '\n'; + + mydescr += 'DESCRIZIONE LIBRO: \n'; + mydescr += myproduct?.value.productInfo?.descrizione_completa_macro; + + tools.copyStringToClipboard($q, mydescr, false); + } + + onMounted(mounted); return { tools, @@ -167,6 +238,9 @@ export default defineComponent({ copyToClipboard, myvalue, handleShowAndSave, - } - } -}) + copyDescrizioneFromScrapingData, + copyDescrizioneFromGruppoMacro, + loading, + }; + }, +}); diff --git a/src/components/CModifTrafiletto/CModifTrafiletto.vue b/src/components/CModifTrafiletto/CModifTrafiletto.vue index 36ad376f..7930c13b 100755 --- a/src/components/CModifTrafiletto/CModifTrafiletto.vue +++ b/src/components/CModifTrafiletto/CModifTrafiletto.vue @@ -1,7 +1,9 @@