- Modifiche a ProductInfo... Continua
This commit is contained in:
@@ -451,7 +451,7 @@ export const shared_consts = {
|
||||
TABLES_DIRECTORY_A_PARTE: ['mygroups'],
|
||||
TABLES_WITH_ADMINS: ['mygroups', 'circuits'],
|
||||
TABLES_DIRECTORY_SINGLE_IMG: ['circuits', 'catalogs', 'raccoltacataloghis'],
|
||||
TABLES_IMAGEFILE_SINGOLO: ['productInfos', 'products'],
|
||||
TABLES_IMAGEFILE_SINGOLO: ['products'],
|
||||
|
||||
TABLES_PER_EDITORI: ['catalogs', 'raccoltacataloghis'],
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
:src="
|
||||
myproduct.productInfo.imagefile
|
||||
? tools.getFullFileNameByImageFile(
|
||||
'productInfos',
|
||||
'products',
|
||||
myproduct.productInfo.imagefile
|
||||
)
|
||||
: myproduct.productInfo.image_link
|
||||
@@ -901,8 +901,8 @@
|
||||
<CModifTrafiletto
|
||||
v-model="myproduct"
|
||||
titolo="Sinossi"
|
||||
table="productinfos"
|
||||
mykey="descr_trafiletto_catalogo"
|
||||
table="products"
|
||||
mykey="productInfo.descr_trafiletto_catalogo"
|
||||
:canModify="true"
|
||||
:type="costanti.FieldType.editor_nohtml"
|
||||
@updateproductmodif="updateproductmodif"
|
||||
|
||||
@@ -377,8 +377,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function getrealdirectory() {
|
||||
if (props.directory == 'productinfos') return 'products';
|
||||
else return props.directory;
|
||||
return props.directory;
|
||||
}
|
||||
|
||||
function getParamDir() {
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
:src="
|
||||
myproduct.productInfo.imagefile
|
||||
? tools.getFullFileNameByImageFile(
|
||||
'productInfos',
|
||||
'products',
|
||||
myproduct.productInfo.imagefile
|
||||
)
|
||||
: myproduct.productInfo.image_link
|
||||
@@ -417,8 +417,8 @@
|
||||
v-if="editOn"
|
||||
title=""
|
||||
:editOn="editOn"
|
||||
table="productinfos"
|
||||
:id="myproduct.productInfo._id"
|
||||
table="products"
|
||||
:id="myproduct._id"
|
||||
:rec="myproduct.productInfo"
|
||||
mykey="note"
|
||||
debounce="1000"
|
||||
@@ -450,8 +450,8 @@
|
||||
v-if="editOn"
|
||||
:editOn="editOn"
|
||||
:title="t('products.imagefile')"
|
||||
table="productinfos"
|
||||
:id="myproduct.productInfo._id"
|
||||
table="products"
|
||||
:id="myproduct._id"
|
||||
:rec="myproduct.productInfo"
|
||||
mykey="imagefile"
|
||||
debounce="1000"
|
||||
@@ -1157,7 +1157,7 @@
|
||||
:src="
|
||||
myproduct.productInfo.imagefile
|
||||
? tools.getFullFileNameByImageFile(
|
||||
'productInfos',
|
||||
'products',
|
||||
myproduct.productInfo.imagefile
|
||||
)
|
||||
: myproduct.productInfo.image_link
|
||||
|
||||
@@ -632,7 +632,7 @@ export default defineComponent({
|
||||
case 'image':
|
||||
return element.productInfo?.imagefile
|
||||
? tools.getFullFileNameByImageFile(
|
||||
'productInfos',
|
||||
'products',
|
||||
element.productInfo?.imagefile
|
||||
)
|
||||
: element.productInfo?.image_link;
|
||||
|
||||
@@ -388,8 +388,8 @@
|
||||
<CModifTrafiletto
|
||||
v-model="selProd"
|
||||
titolo="Sinossi"
|
||||
table="productinfos"
|
||||
mykey="descr_trafiletto_catalogo"
|
||||
table="products"
|
||||
mykey="productInfo.descr_trafiletto_catalogo"
|
||||
:canModify="true"
|
||||
:type="costanti.FieldType.editor_nohtml"
|
||||
@updateproductmodif="updateproductmodif"
|
||||
|
||||
@@ -81,8 +81,8 @@ export default defineComponent({
|
||||
{
|
||||
editOn: false,
|
||||
label: 'Fatturati',
|
||||
table: 'productinfos',
|
||||
id: myproduct.value.productInfo._id, // ID dinamico, da sostituire con il valore reale
|
||||
table: 'products',
|
||||
id: myproduct.value._id, // ID dinamico, da sostituire con il valore reale
|
||||
rec: myproduct.value.productInfo, // Oggetto dinamico, da sostituire con il valore reale
|
||||
mykey: 'totFat',
|
||||
debounce: '1000',
|
||||
@@ -91,8 +91,8 @@ export default defineComponent({
|
||||
{
|
||||
editOn: false,
|
||||
label: 'Fatturati ultimi 3 Mesi',
|
||||
table: 'productinfos',
|
||||
id: myproduct.value.productInfo._id,
|
||||
table: 'products',
|
||||
id: myproduct.value._id,
|
||||
rec: myproduct.value.productInfo,
|
||||
mykey: 'fatLast3M',
|
||||
debounce: '1000',
|
||||
@@ -101,8 +101,8 @@ export default defineComponent({
|
||||
{
|
||||
editOn: false,
|
||||
label: 'Fatturati ultimi 6 Mesi',
|
||||
table: 'productinfos',
|
||||
id: myproduct.value.productInfo._id,
|
||||
table: 'products',
|
||||
id: myproduct.value._id,
|
||||
rec: myproduct.value.productInfo,
|
||||
mykey: 'fatLast6M',
|
||||
debounce: '1000',
|
||||
@@ -111,8 +111,8 @@ export default defineComponent({
|
||||
{
|
||||
editOn: false,
|
||||
label: 'Fatturati ultimo Anno',
|
||||
table: 'productinfos',
|
||||
id: myproduct.value.productInfo._id,
|
||||
table: 'products',
|
||||
id: myproduct.value._id,
|
||||
rec: myproduct.value.productInfo,
|
||||
mykey: 'fatLast1Y',
|
||||
debounce: '1000',
|
||||
@@ -121,8 +121,8 @@ export default defineComponent({
|
||||
{
|
||||
editOn: false,
|
||||
label: 'Fatturati ultimi 2 Anni',
|
||||
table: 'productinfos',
|
||||
id: myproduct.value.productInfo._id,
|
||||
table: 'products',
|
||||
id: myproduct.value._id,
|
||||
rec: myproduct.value.productInfo,
|
||||
mykey: 'fatLast2Y',
|
||||
debounce: '1000',
|
||||
@@ -131,8 +131,8 @@ export default defineComponent({
|
||||
{
|
||||
editOn: false,
|
||||
label: 'Venduti',
|
||||
table: 'productinfos',
|
||||
id: myproduct.value.productInfo._id, // ID dinamico, da sostituire con il valore reale
|
||||
table: 'products',
|
||||
id: myproduct.value._id, // ID dinamico, da sostituire con il valore reale
|
||||
rec: myproduct.value.productInfo, // Oggetto dinamico, da sostituire con il valore reale
|
||||
mykey: 'totVen',
|
||||
debounce: '1000',
|
||||
@@ -141,8 +141,8 @@ export default defineComponent({
|
||||
{
|
||||
editOn: false,
|
||||
label: 'Venduti Ultimi 3 Mesi',
|
||||
table: 'productinfos',
|
||||
id: myproduct.value.productInfo._id,
|
||||
table: 'products',
|
||||
id: myproduct.value._id,
|
||||
rec: myproduct.value.productInfo,
|
||||
mykey: 'vLast3M',
|
||||
debounce: '1000',
|
||||
@@ -151,8 +151,8 @@ export default defineComponent({
|
||||
{
|
||||
editOn: false,
|
||||
label: 'Venduti Ultimi 6 Mesi',
|
||||
table: 'productinfos',
|
||||
id: myproduct.value.productInfo._id,
|
||||
table: 'products',
|
||||
id: myproduct.value._id,
|
||||
rec: myproduct.value.productInfo,
|
||||
mykey: 'vLast6M',
|
||||
debounce: '1000',
|
||||
@@ -161,8 +161,8 @@ export default defineComponent({
|
||||
{
|
||||
editOn: false,
|
||||
label: 'Venduti Ultimo Anno',
|
||||
table: 'productinfos',
|
||||
id: myproduct.value.productInfo._id,
|
||||
table: 'products',
|
||||
id: myproduct.value._id,
|
||||
rec: myproduct.value.productInfo,
|
||||
mykey: 'vLast1Y',
|
||||
debounce: '1000',
|
||||
@@ -171,8 +171,8 @@ export default defineComponent({
|
||||
{
|
||||
editOn: false,
|
||||
label: 'Venduti Ultimi 2 Anni',
|
||||
table: 'productinfos',
|
||||
id: myproduct.value.productInfo._id,
|
||||
table: 'products',
|
||||
id: myproduct.value._id,
|
||||
rec: myproduct.value.productInfo,
|
||||
mykey: 'vLast2Y',
|
||||
debounce: '1000',
|
||||
@@ -183,33 +183,14 @@ export default defineComponent({
|
||||
/*{
|
||||
editOn: false,
|
||||
label: "Ranking 3 Mesi",
|
||||
table: "productinfos",
|
||||
id: myproduct.value.productInfo._id,
|
||||
table: "products",
|
||||
id: myproduct.value._id,
|
||||
rec: myproduct.value.productInfo,
|
||||
mykey: "rank3M",
|
||||
debounce: "1000",
|
||||
type: costanti.FieldType.number,
|
||||
},
|
||||
{
|
||||
editOn: false,
|
||||
label: "Ranking 6 Mesi",
|
||||
table: "productinfos",
|
||||
id: myproduct.value.productInfo._id,
|
||||
rec: myproduct.value.productInfo,
|
||||
mykey: "rank6M",
|
||||
debounce: "1000",
|
||||
type: costanti.FieldType.number,
|
||||
},
|
||||
{
|
||||
editOn: false,
|
||||
label: "Ranking 1 Anno",
|
||||
table: "productinfos",
|
||||
id: myproduct.value.productInfo._id,
|
||||
rec: myproduct.value.productInfo,
|
||||
mykey: "rank1Y",
|
||||
debounce: "1000",
|
||||
type: costanti.FieldType.number,
|
||||
},*/
|
||||
*/
|
||||
];
|
||||
return arrlist;
|
||||
}
|
||||
@@ -220,8 +201,8 @@ export default defineComponent({
|
||||
editOn: true,
|
||||
label: 'Descrizione Sinossi per Catalogo',
|
||||
title: myproduct.value?.productInfo?.name,
|
||||
table: 'productinfos',
|
||||
id: myproduct.value.productInfo._id, // ID dinamico, da sostituire con il valore reale
|
||||
table: 'products',
|
||||
id: myproduct.value._id, // ID dinamico, da sostituire con il valore reale
|
||||
rec: myproduct.value.productInfo, // Oggetto dinamico, da sostituire con il valore reale
|
||||
mykey: 'descr_trafiletto_catalogo',
|
||||
debounce: '1000',
|
||||
@@ -233,8 +214,8 @@ export default defineComponent({
|
||||
editOn: true,
|
||||
label: 'Descrizione breve macro',
|
||||
title: myproduct.value?.productInfo?.name,
|
||||
table: 'productinfos',
|
||||
id: myproduct.value.productInfo._id, // ID dinamico, da sostituire con il valore reale
|
||||
table: 'products',
|
||||
id: myproduct.value._id, // ID dinamico, da sostituire con il valore reale
|
||||
rec: myproduct.value.productInfo, // Oggetto dinamico, da sostituire con il valore reale
|
||||
mykey: 'descrizione_breve_macro',
|
||||
maxlength: 650,
|
||||
@@ -246,8 +227,8 @@ export default defineComponent({
|
||||
{
|
||||
editOn: true,
|
||||
label: 'Descrizione Estesa',
|
||||
table: 'productinfos',
|
||||
id: myproduct.value.productInfo._id, // ID dinamico, da sostituire con il valore reale
|
||||
table: 'products',
|
||||
id: myproduct.value._id, // ID dinamico, da sostituire con il valore reale
|
||||
rec: myproduct.value.productInfo, // Oggetto dinamico, da sostituire con il valore reale
|
||||
mykey: 'descrizione_completa_macro',
|
||||
maxlength: props.scheda?.testo_bottom?.maxlength
|
||||
@@ -261,8 +242,8 @@ export default defineComponent({
|
||||
{
|
||||
editOn: true,
|
||||
label: 'Link a gruppomacro.com',
|
||||
table: 'productinfos',
|
||||
id: myproduct.value.productInfo._id, // ID dinamico, da sostituire con il valore reale
|
||||
table: 'products',
|
||||
id: myproduct.value._id, // ID dinamico, da sostituire con il valore reale
|
||||
rec: myproduct.value.productInfo, // Oggetto dinamico, da sostituire con il valore reale
|
||||
mykey: 'link_macro',
|
||||
debounce: '1000',
|
||||
@@ -273,8 +254,8 @@ export default defineComponent({
|
||||
{
|
||||
editOn: true,
|
||||
label: 'Imagefile',
|
||||
table: 'productinfos',
|
||||
id: myproduct.value.productInfo._id, // ID dinamico, da sostituire con il valore reale
|
||||
table: 'products',
|
||||
id: myproduct.value._id, // ID dinamico, da sostituire con il valore reale
|
||||
rec: myproduct.value.productInfo, // Oggetto dinamico, da sostituire con il valore reale
|
||||
mykey: 'imagefile',
|
||||
debounce: '1000',
|
||||
@@ -292,8 +273,8 @@ export default defineComponent({
|
||||
{
|
||||
editOn: true,
|
||||
label: 'Titolo',
|
||||
table: 'productinfos',
|
||||
id: myproduct.value.productInfo._id,
|
||||
table: 'products',
|
||||
id: myproduct.value._id,
|
||||
rec: myproduct.value.productInfo, // Oggetto dinamico, da sostituire con il valore reale
|
||||
mykey: 'name',
|
||||
debounce: '1000',
|
||||
@@ -314,8 +295,8 @@ export default defineComponent({
|
||||
{
|
||||
editOn: true,
|
||||
label: 'SottoTitolo',
|
||||
table: 'productinfos',
|
||||
id: myproduct.value.productInfo._id,
|
||||
table: 'products',
|
||||
id: myproduct.value._id,
|
||||
rec: myproduct.value.productInfo,
|
||||
mykey: 'sottotitolo',
|
||||
debounce: '1000',
|
||||
@@ -325,8 +306,8 @@ export default defineComponent({
|
||||
{
|
||||
editOn: false,
|
||||
label: 'Pubblicazione',
|
||||
table: 'productinfos',
|
||||
id: myproduct.value.productInfo._id,
|
||||
table: 'products',
|
||||
id: myproduct.value._id,
|
||||
rec: myproduct.value.productInfo,
|
||||
mykey: 'date_pub',
|
||||
debounce: '1000',
|
||||
@@ -347,8 +328,8 @@ export default defineComponent({
|
||||
{
|
||||
editOn: false,
|
||||
label: 'Stato',
|
||||
table: 'productinfos',
|
||||
id: myproduct.value.productInfo._id,
|
||||
table: 'products',
|
||||
id: myproduct.value._id,
|
||||
rec: myproduct.value.productInfo,
|
||||
mykey: 'idStatoProdotto',
|
||||
debounce: '1000',
|
||||
@@ -359,7 +340,7 @@ export default defineComponent({
|
||||
{
|
||||
editOn: true,
|
||||
label: 'Argomento',
|
||||
table: 'productinfos',
|
||||
table: 'products',
|
||||
id: myproduct.value.productInfo?._id,
|
||||
rec: myproduct.value.productInfo,
|
||||
mykey: 'idCatProds',
|
||||
@@ -465,8 +446,8 @@ export default defineComponent({
|
||||
{
|
||||
editOn: false,
|
||||
label: 'Aggiornato (da GM) il',
|
||||
table: 'productinfos',
|
||||
id: myproduct.value.productInfo._id,
|
||||
table: 'products',
|
||||
id: myproduct.value._id,
|
||||
rec: myproduct.value.productInfo,
|
||||
mykey: 'date_updated_fromGM',
|
||||
debounce: '1000',
|
||||
|
||||
@@ -333,10 +333,7 @@ export default defineComponent({
|
||||
onMounted(created)
|
||||
|
||||
function getrealdirectory() {
|
||||
if (props.directory == 'productinfos')
|
||||
return 'products'
|
||||
else
|
||||
return props.directory
|
||||
return props.directory
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
"
|
||||
:src="
|
||||
tools.getFullFileNameByImageFile(
|
||||
'productInfos',
|
||||
'products',
|
||||
order.product.productInfo.imagefile
|
||||
)
|
||||
"
|
||||
|
||||
@@ -190,13 +190,13 @@ export default function () {
|
||||
if (idprod >= 0 && key) {
|
||||
productStore.products[idprod][key as keyof IProduct] = value
|
||||
}
|
||||
} else if (table === 'productinfos') {
|
||||
/*} else if (table === 'productinfos') {
|
||||
const productStore = useProducts()
|
||||
const idprod = productStore.products.findIndex((rec: IProduct) => rec.productInfo._id === id)
|
||||
if (idprod >= 0 && key) {
|
||||
const myfield = key as keyof IProductInfo
|
||||
productStore.products[idprod].productInfo[myfield] = value
|
||||
}
|
||||
}*/
|
||||
} else if (table === 'arrvariazioni') {
|
||||
const productStore = useProducts()
|
||||
const idprod = productStore.products.findIndex((rec: IProduct) => rec._id === id)
|
||||
|
||||
@@ -123,7 +123,7 @@ export interface IProduct {
|
||||
_id?: any
|
||||
active?: boolean
|
||||
isbn?: string
|
||||
idProductInfo?: string,
|
||||
// idProductInfo?: string,
|
||||
productInfo: IProductInfo,
|
||||
idProducer?: string,
|
||||
idProvider?: string,
|
||||
@@ -208,7 +208,7 @@ export interface IProductsState {
|
||||
collane?: ICollana[]
|
||||
catprods_gas: ICatProd[]
|
||||
subcatprods: ISubCatProd[]
|
||||
productInfos: IProductInfo[]
|
||||
// productInfos: IProductInfo[]
|
||||
userActive: IUserShort
|
||||
|
||||
isPubblicatoById?: (idStatoProdotto: number) => boolean;
|
||||
|
||||
@@ -48,14 +48,14 @@ export default defineComponent({
|
||||
preserveNullAndEmptyArrays: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
/*{
|
||||
$lookup: {
|
||||
from: 'productinfos',
|
||||
localField: 'product.idProductInfo',
|
||||
foreignField: '_id',
|
||||
as: 'productInfo',
|
||||
},
|
||||
},
|
||||
},*/
|
||||
{
|
||||
$unwind: {
|
||||
path: '$productInfo',
|
||||
@@ -109,10 +109,10 @@ export default defineComponent({
|
||||
$group: {
|
||||
_id: '$product._id',
|
||||
name: {
|
||||
$first: '$productInfo.name',
|
||||
$first: '$product.productInfo.name',
|
||||
},
|
||||
weight: {
|
||||
$first: '$productInfo.weight',
|
||||
$first: '$product.productInfo.weight',
|
||||
},
|
||||
price_acquistato: {
|
||||
$first: '$product.price_acquistato',
|
||||
|
||||
@@ -291,7 +291,7 @@ function getRoutesEcomm(site: ISites) {
|
||||
path: '/product/:idprod/:cosa',
|
||||
materialIcon: 'event',
|
||||
name: 'otherpages.product',
|
||||
component: () => import('@src/views/ecommerce/productInfo/productInfo.vue'),
|
||||
component: () => import('app/src/views/ecommerce/productView/productView.vue'),
|
||||
inmenu: false,
|
||||
infooter: false
|
||||
},
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8974,8 +8974,6 @@ export const tools = {
|
||||
ris = 'pages/' + (path ? path : myrow.path);
|
||||
} else if (table === 'imgcards') {
|
||||
ris = 'pages/' + path;
|
||||
} else if (table === 'productInfos') {
|
||||
ris = path;
|
||||
} else if (table === 'imgs') {
|
||||
ris = path;
|
||||
} else {
|
||||
|
||||
@@ -141,7 +141,6 @@ export const useProducts = defineStore('Products', {
|
||||
authors: [],
|
||||
publishers: [],
|
||||
subcatprods: [],
|
||||
productInfos: [],
|
||||
userActive: { username: '', name: '', surname: '', _id: '' },
|
||||
}),
|
||||
|
||||
|
||||
@@ -537,7 +537,6 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
else if (table === 'producers') ris = state.producers;
|
||||
else if (table === 'storehouses') ris = state.storehouses;
|
||||
else if (table === 'providers') ris = state.providers;
|
||||
else if (table === 'productinfos') ris = Products.productInfos;
|
||||
// else if (table === 'products') ris = Products.products
|
||||
else if (table === 'gasordines') ris = state.gasordines;
|
||||
else if (table === 'scontisticas') ris = state.scontisticas;
|
||||
@@ -2076,9 +2075,6 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
this.gallery = res.data.gallery ? [...res.data.gallery] : [];
|
||||
this.calzoom = res.data.calzoom ? [...res.data.calzoom] : [];
|
||||
Products.products = res.data.products ? [...res.data.products] : [];
|
||||
Products.productInfos = res.data.productInfos
|
||||
? [...res.data.productInfos]
|
||||
: [];
|
||||
this.producers = res.data.producers ? [...res.data.producers] : [];
|
||||
this.storehouses = res.data.storehouses ? [...res.data.storehouses] : [];
|
||||
this.providers = res.data.providers ? [...res.data.providers] : [];
|
||||
@@ -3154,7 +3150,6 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
try {
|
||||
if (table === 'products') {
|
||||
await productStore.loadProductById(id, true);
|
||||
} else if (table === 'productinfos') {
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Errore durante l'aggiornamento della tabella in memoria:", error);
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
export {default as ProductInfo} from './productInfo.vue'
|
||||
1
src/views/ecommerce/productView/index.ts
Executable file
1
src/views/ecommerce/productView/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export {default as ProductInfo} from './productView.vue'
|
||||
Reference in New Issue
Block a user