fix altro
This commit is contained in:
@@ -3,7 +3,9 @@ import draggable from 'vuedraggable';
|
||||
|
||||
import { tools } from '@tools';
|
||||
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useGlobalStore } from '@src/store/globalStore';
|
||||
import { useProducts } from '@src/store/productStore';
|
||||
|
||||
import { CMyValueDb } from '@src/components/CMyValueDb';
|
||||
import { CSchedaProdotto } from '@src/components/CSchedaProdotto';
|
||||
@@ -56,6 +58,10 @@ export default defineComponent({
|
||||
// Copia locale della lista_prodotti per manipolazione interna
|
||||
const internalProducts = ref([...(props.lista_prodotti || [])]);
|
||||
|
||||
const productStore = useProducts()
|
||||
|
||||
const $router = useRouter()
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const globalStore = useGlobalStore();
|
||||
@@ -107,7 +113,7 @@ export default defineComponent({
|
||||
|
||||
const allColumns = ref([]);
|
||||
|
||||
const isVisibleEditBtn = ref(false)
|
||||
const isVisibleEditBtn = ref(false);
|
||||
|
||||
// Colonne della tabella
|
||||
const allColumns_Raccolta = ref([
|
||||
@@ -210,10 +216,10 @@ export default defineComponent({
|
||||
|
||||
if (props.table === 'products') {
|
||||
allColumns.value = allColumns_Catalog.value;
|
||||
isVisibleEditBtn.value = true
|
||||
isVisibleEditBtn.value = true;
|
||||
} else if (props.table === 'catalogs') {
|
||||
allColumns.value = allColumns_Raccolta.value;
|
||||
isVisibleEditBtn.value = false
|
||||
isVisibleEditBtn.value = false;
|
||||
}
|
||||
|
||||
optionscatalogo.value = {
|
||||
@@ -277,7 +283,11 @@ export default defineComponent({
|
||||
return tools.getstrDate(catalog.data_online_stampa);
|
||||
case 'image':
|
||||
return catalog.foto_collana?.imagefile
|
||||
? tools.getFullFileNameByImageFile(shared_consts.TABLES_CATALOG, catalog.foto_collana?.imagefile, catalog._id)
|
||||
? tools.getFullFileNameByImageFile(
|
||||
shared_consts.TABLES_CATALOG,
|
||||
catalog.foto_collana?.imagefile,
|
||||
catalog._id
|
||||
)
|
||||
: '';
|
||||
}
|
||||
} else {
|
||||
@@ -609,9 +619,18 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function showProduct(element: any) {
|
||||
selProd.value = element;
|
||||
if (isProduct()) {
|
||||
selProd.value = element;
|
||||
|
||||
showProd.value = true;
|
||||
showProd.value = true;
|
||||
} else if (isCatalog()) {
|
||||
// Apri la pagina del catalogo
|
||||
if (element.idPageAssigned) {
|
||||
const mypagepath = productStore.getPathByPage(element.idPageAssigned);
|
||||
// fai il route sulla pagina myfilename
|
||||
$router.push(`/${mypagepath}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function modifyProduct(element: any) {
|
||||
@@ -788,7 +807,10 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function isProduct() {
|
||||
return props.table === 'products'
|
||||
return props.table === 'products';
|
||||
}
|
||||
function isCatalog() {
|
||||
return props.table === 'catalogs';
|
||||
}
|
||||
|
||||
onMounted(mounted);
|
||||
@@ -835,6 +857,7 @@ export default defineComponent({
|
||||
getImageByElement,
|
||||
isVisibleEditBtn,
|
||||
isProduct,
|
||||
isCatalog,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user