ver 1.1.20:

- corretto campo foto che non compariva più.
 - sistemato i campi aggiuntivi e i richiesti.
- migliorato la barra in alto di selezione.
- aggiunto alcune icone.
This commit is contained in:
Surya Paolo
2025-02-03 17:18:33 +01:00
parent 997fd136ea
commit 979f90f980
84 changed files with 1257 additions and 357 deletions

View File

@@ -0,0 +1,81 @@
.cardrec {
/* Aggiungi un bordo sottile */
border: 1px solid #ddd;
/* Applica un'ombreggiatura per dare l'effetto di elevazione */
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
/* Arrotonda leggermente gli angoli */
border-radius: 8px;
/* Aggiungi un po' di spazio interno intorno ai contenuti */
padding: 8px;
/* Colore di sfondo bianco per separare dal resto del contenuto */
background-color: #eff;
margin: 4px;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
@media (min-width: 500px) {
margin: 1px;
padding: 4px;
}
}
.catalog-image {
max-width: 100%;
height: auto;
margin-bottom: 20px;
}
.imgcatalog {
border: 4px solid #ffffff;
/* Bordo bianco */
border-radius: 12px;
/* Angoli arrotondati */
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
/* Ombra per un effetto 3D */
transition: transform 0.3s ease, box-shadow 0.3s ease;
/* Transizione fluida */
object-fit: cover;
/* Mantiene l'aspetto dell'immagine senza distorsioni */
}
.imgcatalog:hover {
transform: scale(1.05);
/* Effetto di ingrandimento al passaggio del mouse */
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
/* Ombra più pronunciata al passaggio del mouse */
}
.back_img {
background-repeat: no-repeat !important;
background-size: cover;
background-position: center;
}
.flex-grow {
flex-grow: 1;
/* Usa flex-grow per occupare spazio disponibile */
}
.title-container {
background-color: rgba(0, 0, 0, 0.3);
/* Sfondo bianco con trasparenza */
padding: 4px;
/* Aggiunta di padding per creare spazio attorno al testo */
border-radius: 8px;
/* Arrotonda gli angoli dello sfondo */
}
.text-h6 {
font-family: 'Arial', sans-serif;
/* Scegli un font accattivante e comune */
font-size: 1.15rem;
/* Dimensione del font modificabile */
color: #FFF;
/* Colore del testo */
margin-top: auto;
/* Assicura che il titolo sia posizionato alla base della scheda */
}

View File

@@ -0,0 +1,143 @@
import { defineComponent, onMounted, PropType, ref, watch, computed } from 'vue'
import { useUserStore } from '@store/UserStore'
import { IImgGallery, IOptGrid, IUserFields, IUserProfile } from 'model'
import { costanti } from '@costanti'
import { shared_consts } from '@/common/shared_vuejs'
import { fieldsTable } from '@store/Modules/fieldsTable'
import { tools } from '@store/Modules/tools'
import { toolsext } from '@store/Modules/toolsext'
import { useQuasar } from 'quasar'
import { useI18n } from '@/boot/i18n'
import { CMyCardPopup } from '@/components/CMyCardPopup'
import { useRouter } from 'vue-router'
import { useCalendarStore } from '@src/store/CalendarStore'
import { useGlobalStore } from '@src/store/globalStore'
export default defineComponent({
name: 'CMyRecCatalog',
components: { CMyCardPopup },
emits: ['setCmd', 'cmdext'],
props: {
table: {
type: String,
required: true,
},
prop_myrec: {
type: Object as PropType<any>,
required: false,
default: null,
},
editOn: {
type: Boolean,
required: false,
default: false,
},
margin_right: {
type: Number,
required: false,
default: 0,
},
opt: {
type: Object as PropType<IOptGrid>,
required: false,
default: {},
},
},
setup(props, { emit }) {
const userStore = useUserStore()
const calendarStore = useCalendarStore()
const globalStore = useGlobalStore()
const $q = useQuasar()
const { t } = useI18n()
const $router = useRouter()
const myrec = ref(<any>null)
const visupage = ref(false)
const disabilita = computed(() => {
return props.table === shared_consts.TABLES_MYBACHECAS
})
watch(() => props.prop_myrec, (newval, oldval) => {
mounted()
})
function mounted() {
if (props.prop_myrec) {
myrec.value = props.prop_myrec
}
}
function showBadge() {
if (shared_consts.TABLES_SHOW_ADTYPE.includes(props.table)) {
return true
}
return false
}
function getImgUser(profile: IUserFields) {
return userStore.getImgByProfile(profile)
}
function naviga(path: string) {
$router.push(path)
}
function setCmd($q: any, cmd: number, myusername: string, value: any, groupname: string) {
emit('setCmd', $q, cmd, myusername, value, groupname)
}
function cmdExt(cmd: any, val1: any, val2: any) {
emit('cmdext', cmd, val1, val2)
}
function navigaExt(obj: any) {
cmdExt(costanti.CMD_SHOW_PAGE, null, obj)
//let link = shared_consts.getDirectoryByTable(props.table) + '/' + obj._id
//console.log('link', link)
//$router.push(link)
}
function getNameToShow(user: IUserFields, col = null) {
if (myrec.value.groupname)
return myrec.value.groupname
else
return userStore.getNameToShow(user, col)
}
function computedWidth() {
const width = tools.getwidth($q) - 20;
return `${Math.min(width, 600)}px`; // Limita la larghezza massima a 600px
}
onMounted(mounted)
return {
t,
myrec,
costanti,
getImgUser,
naviga,
navigaExt,
setCmd,
shared_consts,
userStore,
tools,
toolsext,
fieldsTable,
cmdExt,
visupage,
showBadge,
getNameToShow,
calendarStore,
disabilita,
globalStore,
computedWidth,
}
},
})

View File

@@ -0,0 +1,80 @@
<template>
<div
v-if="myrec"
class="q-py-xs centermydiv cardrec back_img column justify-between"
:style="{
width: opt.widthcard,
height: opt.heightcard,
backgroundImage:
`url(` +
tools.getFullFileName(
[myrec.foto_collana],
table,
myrec.username,
myrec._id
) +
`)`,
}"
>
<div class="flex-grow" />
<!-- Questo elemento occupa spazio per separare l'immagine dal titolo -->
<div class="title-container">
<div class="text-h6 text-center">
{{ myrec.title }}
</div>
</div>
<q-item>
<q-item-section side v-if="tools.canModifyThisRec(myrec, table) || editOn">
<q-item-label>
<q-btn rounded dense icon="fas fa-pencil-alt">
<q-menu>
<q-list style="min-width: 150px">
<q-item
clickable
v-close-popup
@click="cmdExt(costanti.CMD_MODIFY, myrec._id, null)"
>
<q-item-section side>
<q-icon name="fas fa-pencil-alt" />
</q-item-section>
<q-item-section>{{ $t('reg.edit') }}</q-item-section>
</q-item>
</q-list>
<q-list style="min-width: 150px">
<q-item
clickable
v-close-popup
@click="cmdExt(costanti.CMD_CLONE, myrec._id, null)"
>
<q-item-section side>
<q-icon name="fas fa-copy" />
</q-item-section>
<q-item-section>{{ $t('event.duplicate') }}</q-item-section>
</q-item>
</q-list>
<q-list style="min-width: 150px">
<q-item
clickable
v-close-popup
@click="cmdExt(costanti.CMD_DELETE, myrec._id, null)"
>
<q-item-section side>
<q-icon name="fas fa-trash-alt" />
</q-item-section>
<q-item-section>{{ $t('reg.elimina') }}</q-item-section>
</q-item>
</q-list>
</q-menu>
</q-btn>
</q-item-label>
</q-item-section>
</q-item>
</div>
</template>
<script lang="ts" src="./CMyRecCatalog.ts">
</script>
<style lang="scss" scoped>
@import './CMyRecCatalog.scss';
</style>

View File

@@ -0,0 +1 @@
export { default as CMyRecCatalog } from './CMyRecCatalog.vue'