nuova veste grafica: myskills, mygoods, mybachecas, myhosps,
- cambiato id (da numero a stringa)
This commit is contained in:
@@ -5,8 +5,10 @@ import { CTitleBanner } from '@/components/CTitleBanner'
|
||||
import { CProfile } from '@/components/CProfile'
|
||||
import { CDateTime } from '@/components/CDateTime'
|
||||
import { CMyPage } from '@/components/CMyPage'
|
||||
import { CMyChipList } from '@/components/CMyChipList'
|
||||
import { CMyFieldRec } from '@/components/CMyFieldRec'
|
||||
import { CMyUser } from '@/components/CMyUser'
|
||||
import { CGalleryImages } from '@/components/CGalleryImages'
|
||||
import { CAccomodation } from '@/components/CAccomodation'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
@@ -19,14 +21,16 @@ import { costanti } from '@costanti'
|
||||
import { IColGridTable, IImgGallery, IUserFields } from 'model'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { colCitys, fieldsTable } from '@store/Modules/fieldsTable'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { useNotifStore } from '@store/NotifStore'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMyCardService',
|
||||
components: { CProfile, CTitleBanner,
|
||||
components: {
|
||||
CProfile, CTitleBanner,
|
||||
CMyFieldDb, CDateTime, CMyPage, CMyFieldRec, CAccomodation,
|
||||
CMyUser },
|
||||
CMyUser, CGalleryImages, CMyChipList
|
||||
},
|
||||
props: {
|
||||
table: {
|
||||
type: String,
|
||||
@@ -60,6 +64,10 @@ export default defineComponent({
|
||||
|
||||
const showPic = ref(false)
|
||||
|
||||
const $router = useRouter()
|
||||
|
||||
const usersList = ref({ show: false, title: '', list: [] })
|
||||
|
||||
const myrec = ref(<any>{})
|
||||
const col = ref(<IColGridTable>{})
|
||||
|
||||
@@ -71,7 +79,7 @@ export default defineComponent({
|
||||
|
||||
function load() {
|
||||
// Carica il profilo di quest'utente
|
||||
if (props.idRec > 0) {
|
||||
if (props.idRec) {
|
||||
userStore.loadGeneric(props.table, props.idRec, idnotif.value).then((ris) => {
|
||||
myrec.value = ris
|
||||
notifStore.setAsRead(idnotif.value)
|
||||
@@ -110,6 +118,54 @@ export default defineComponent({
|
||||
return false
|
||||
}
|
||||
|
||||
function getRecGoodSkillByRec(rec: any) {
|
||||
if (props.table === 'myskills')
|
||||
return rec.recSkill
|
||||
else if (props.table === 'mygoods')
|
||||
return rec.recGood
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
function getSectorByRec(rec: any) {
|
||||
if (props.table === 'myskills')
|
||||
return rec.sector
|
||||
else if (props.table === 'mygoods')
|
||||
return rec.sectorGood
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
function clicca(tipo: any, set: any, title: string) {
|
||||
if (set && myrec.value.username !== userStore.my.username && tipo === costanti.TIPOFAVBOOK.FAVORITE) {
|
||||
userStore.setFavorite($q, t, myrec.value._id, props.table, myrec.value);
|
||||
}
|
||||
if (set && myrec.value.username !== userStore.my.username && tipo === costanti.TIPOFAVBOOK.BOOKMARK) {
|
||||
userStore.setBookmark($q, t, myrec.value._id, props.table, myrec.value);
|
||||
}
|
||||
|
||||
if (!set) {
|
||||
usersList.value.show = true;
|
||||
usersList.value.title = title;
|
||||
usersList.value.list = myrec.value.myfav;
|
||||
}
|
||||
}
|
||||
|
||||
function naviga(path: string) {
|
||||
$router.push(path)
|
||||
}
|
||||
|
||||
function getTypeHosps() {
|
||||
let obj = null
|
||||
if (myrec.value.typeHosp) {
|
||||
obj = globalStore.getRecordByTableSingle(toolsext.TABTYPEHOSP, myrec.value.typeHosp)
|
||||
if (obj)
|
||||
return obj.label
|
||||
}
|
||||
|
||||
return obj
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
@@ -130,6 +186,12 @@ export default defineComponent({
|
||||
showBadge,
|
||||
getlinkpage,
|
||||
calendarStore,
|
||||
getSectorByRec,
|
||||
getRecGoodSkillByRec,
|
||||
usersList,
|
||||
clicca,
|
||||
naviga,
|
||||
getTypeHosps,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user