ver: 1.1.21:
- Lista dei Cataloghi - Gestione Cataloghi in base alla configurazione
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { defineComponent, onMounted, PropType, ref, watch, computed } from 'vue'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { IImgGallery, IOptGrid, IUserFields, IUserProfile } from 'model'
|
||||
import { ICatalog, IImgGallery, IOptGrid, IUserFields, IUserProfile } from 'model'
|
||||
import { costanti } from '@costanti'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { fieldsTable } from '@store/Modules/fieldsTable'
|
||||
@@ -8,14 +8,18 @@ import { tools } from '@store/Modules/tools'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { CLabel } from '@/components/CLabel'
|
||||
import { CMyCardPopup } from '@/components/CMyCardPopup'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useCalendarStore } from '@src/store/CalendarStore'
|
||||
import { useGlobalStore } from '@src/store/globalStore'
|
||||
|
||||
import { ICollana, IPublisher } from "@src/model/Products"
|
||||
import { useProducts } from '@src/store/Products'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMyRecCatalog',
|
||||
components: { CMyCardPopup },
|
||||
components: { CMyCardPopup, CLabel },
|
||||
emits: ['setCmd', 'cmdext'],
|
||||
props: {
|
||||
table: {
|
||||
@@ -53,12 +57,36 @@ export default defineComponent({
|
||||
const { t } = useI18n()
|
||||
const $router = useRouter()
|
||||
|
||||
const myrec = ref(<any>null)
|
||||
const myrec = ref(<ICatalog>{})
|
||||
|
||||
const statecolor = ref('negative')
|
||||
const apriInfo = ref(false)
|
||||
const collanestr = ref('')
|
||||
const editorestr = ref('')
|
||||
|
||||
const products = useProducts()
|
||||
|
||||
const visupage = ref(false)
|
||||
const disabilita = computed(() => {
|
||||
return props.table === shared_consts.TABLES_MYBACHECAS
|
||||
})
|
||||
})
|
||||
const esiste_descrintro = computed(() => {
|
||||
return myrec.value.descr_introduttiva && myrec.value.descr_introduttiva.length > 100
|
||||
})
|
||||
const pagina_collegata = computed(() => {
|
||||
|
||||
let linkpage = ''
|
||||
|
||||
let idpag = myrec.value.idPageAssigned
|
||||
if (idpag) {
|
||||
let mypage = globalStore.getPageById(idpag)
|
||||
if (mypage)
|
||||
linkpage = mypage.path!
|
||||
}
|
||||
|
||||
return linkpage
|
||||
|
||||
})
|
||||
|
||||
watch(() => props.prop_myrec, (newval, oldval) => {
|
||||
|
||||
@@ -70,6 +98,30 @@ export default defineComponent({
|
||||
if (props.prop_myrec) {
|
||||
myrec.value = props.prop_myrec
|
||||
}
|
||||
|
||||
collanestr.value = ''
|
||||
if (myrec.value.idCollane) {
|
||||
for (const idcollana of myrec.value.idCollane!) {
|
||||
const reccoll: ICollana = products.collane!.find((coll: ICollana) => coll.idCollana === idcollana)
|
||||
collanestr.value += reccoll.title + ' '
|
||||
}
|
||||
}
|
||||
editorestr.value = ''
|
||||
if (myrec.value.editore) {
|
||||
for (const receditore of myrec.value.editore!) {
|
||||
const rectrovato: IPublisher = products.publishers!.find((editore: IPublisher) => editore._id === receditore)
|
||||
editorestr.value += rectrovato!.name + ' '
|
||||
}
|
||||
}
|
||||
|
||||
statecolor.value = 'negative'
|
||||
|
||||
if (myrec.value.descr_introduttiva && myrec.value.img_bordata?.imagefile && myrec.value.img_intro?.imagefile) {
|
||||
statecolor.value = 'orange-8'
|
||||
if (myrec.value.pdf_generato) {
|
||||
statecolor.value = 'positive'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function showBadge() {
|
||||
@@ -88,6 +140,8 @@ export default defineComponent({
|
||||
$router.push(path)
|
||||
}
|
||||
|
||||
|
||||
|
||||
function setCmd($q: any, cmd: number, myusername: string, value: any, groupname: string) {
|
||||
emit('setCmd', $q, cmd, myusername, value, groupname)
|
||||
}
|
||||
@@ -138,6 +192,12 @@ export default defineComponent({
|
||||
disabilita,
|
||||
globalStore,
|
||||
computedWidth,
|
||||
statecolor,
|
||||
apriInfo,
|
||||
collanestr,
|
||||
editorestr,
|
||||
pagina_collegata,
|
||||
esiste_descrintro,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user