From 08a089881ce985c0273aa627ccf5a2ce47d04406 Mon Sep 17 00:00:00 2001 From: Surya Paolo Date: Tue, 14 Jan 2025 18:34:58 +0100 Subject: [PATCH] =?UTF-8?q?-=20aggiunto=20anche=20nei=20beni,=20servizi=20?= =?UTF-8?q?e=20ospitalit=C3=A0=20la=20possibilit=C3=A0=20di=20aggiungerli?= =?UTF-8?q?=20come=20"Gruppo"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/shared_vuejs.ts | 19 +++++ src/components/CFindUsers/CFindUsers.ts | 1 + src/components/CGridTableRec/CGridTableRec.ts | 85 +++++++++++-------- src/components/CMyActivities/CMyActivities.ts | 11 ++- .../CMyCardService/CMyCardService.vue | 3 +- src/components/CMyPopupEdit/CMyPopupEdit.ts | 26 ++++-- src/components/CMyRecCard/CMyRecCard.ts | 2 +- src/components/CMyUser/CMyUser.vue | 5 +- src/components/CSkill/CSkill.vue | 1 + src/components/CUserNote/CUserNote.scss | 0 src/components/CUserNote/CUserNote.ts | 77 +++++++++++++++++ src/components/CUserNote/CUserNote.vue | 60 +++++++++++++ src/components/CUserNote/index.ts | 1 + src/model/UserStore.ts | 1 + src/rootgen/admin/userPanel/userPanel.vue | 1 + src/statics/lang/it.js | 1 + src/store/Modules/fieldsTable.ts | 29 +++++++ src/store/Modules/tools.ts | 45 ++++++++-- src/views/user/myfriends/myfriends.ts | 7 +- src/views/user/mygroup/mygroup.ts | 46 ++++++++-- src/views/user/mygroup/mygroup.vue | 82 +++++++++++++----- src/views/user/myprofile/myprofile.ts | 13 ++- src/views/user/myprofile/myprofile.vue | 62 ++++++++++++-- 23 files changed, 484 insertions(+), 94 deletions(-) create mode 100755 src/components/CUserNote/CUserNote.scss create mode 100755 src/components/CUserNote/CUserNote.ts create mode 100755 src/components/CUserNote/CUserNote.vue create mode 100755 src/components/CUserNote/index.ts diff --git a/src/common/shared_vuejs.ts b/src/common/shared_vuejs.ts index 3008ce1e..0a0f4e3f 100755 --- a/src/common/shared_vuejs.ts +++ b/src/common/shared_vuejs.ts @@ -211,6 +211,8 @@ export const shared_consts = { FILTER_USER_SENZA_CIRCUITO: 67108864, FILTER_USER_CON_CIRCUITO: 134217728, FILTER_USER_ONLINE_6_MESI: 268435456, + FILTER_NOTE: 536870912, + FILTER_SENZA_NOTE: 1073741824, OPTIONS_SEARCH_ONLY_FULL_WORDS: 1, OPTIONS_SEARCH_USER_ONLY_FULL_WORDS: 2, @@ -335,6 +337,14 @@ export const shared_consts = { label: 'Chat "BOT RISO" eliminata', value: 1024, //shared_consts.FILTER_USER_TELEGRAM_BLOCKED }, + { + label: 'Con Note Facilitatore', + value: 536870912, //shared_consts.FILTER_NOTE + }, + { + label: 'Senza Note Facilitatore', + value: 1073741824, //shared_consts.FILTER_SENZA_NOTE + }, ], @@ -2180,6 +2190,14 @@ export const shared_consts = { } } + const proj_common = { + 'mygrp.groupname': 1, + 'mygrp.title': 1, + 'mygrp.photos': 1, + } + + proj = Object.assign({}, proj, proj_common); + if (proj_add) proj = Object.assign({}, proj, proj_add); @@ -2211,6 +2229,7 @@ export const shared_consts = { 'profile.mygroups': 1, 'profile.mycircuits': 1, 'profile.qualifica': 1, + 'profile.note': 1, 'profile.resid_province': 1, 'profile.resid_card': 1, 'profile.username_telegram': 1, diff --git a/src/components/CFindUsers/CFindUsers.ts b/src/components/CFindUsers/CFindUsers.ts index 1dd08c86..85be9371 100755 --- a/src/components/CFindUsers/CFindUsers.ts +++ b/src/components/CFindUsers/CFindUsers.ts @@ -164,6 +164,7 @@ export default defineComponent({ 'profile.img': 1, 'profile.mygroups': 1, 'profile.qualifica': 1, + 'profile.note': 1, 'profile.resid_province': 1, 'mycities.reg': 1, } diff --git a/src/components/CGridTableRec/CGridTableRec.ts b/src/components/CGridTableRec/CGridTableRec.ts index 38c963ad..d3780c34 100755 --- a/src/components/CGridTableRec/CGridTableRec.ts +++ b/src/components/CGridTableRec/CGridTableRec.ts @@ -939,46 +939,59 @@ export default defineComponent({ } } else if (item.table === shared_consts.TABFILTRI_UTENTE) { - if (item.value === shared_consts.FILTER_USER_SENZA_PROVINCE) { - filtercustom.push({ 'profile.resid_province': { $exists: false } }); - } else if (item.value === shared_consts.FILTER_USER_CON_CIRCUITO) { - filtercustom.push({ - 'profile.mycircuits': { $exists: true, $ne: [] } - }); - } else if (item.value === shared_consts.FILTER_USER_ONLINE_6_MESI) { - const numgiorni_attivi = 30 * 6 - let daytocheck = new Date(); - daytocheck.setDate(daytocheck.getDate() - numgiorni_attivi); - daytocheck.setHours(0, 0, 0, 0) - filtercustom.push({ lasttimeonline: { $gt: daytocheck } }) - } else if (item.value === shared_consts.FILTER_USER_SENZA_CIRCUITO) { - filtercustom.push({ - $or: [ - { 'profile.mycircuits': { $exists: false } }, - { 'profile.mycircuits': { $eq: [] } } - ] - }); - } else if (item.value === shared_consts.FILTER_USER_PROVINCE) { - filtercustom.push({ 'profile.resid_province': { $exists: true, $ne: '' } }); - } else if (item.value === shared_consts.FILTER_USER_TELEGRAM_BLOCKED) { - filtercustom.push({ 'profile.teleg_id_old': { $gt: 1 } }); - } else if (item.value === shared_consts.FILTER_USER_WITHOUT_USERNAME_TELEGRAM) { - filtercustom.push({ - $or: [ - { 'profile.username_telegram': { $exists: false } }, - { 'profile.username_telegram': { $exists: true, $eq: '' } }], + item.arrvalue.forEach((myitemsingle: any) => { + if (myitemsingle === shared_consts.FILTER_USER_SENZA_PROVINCE) { + filtercustom.push({ 'profile.resid_province': { $exists: false } }); + } else if (myitemsingle === shared_consts.FILTER_USER_CON_CIRCUITO) { + filtercustom.push({ + 'profile.mycircuits': { $exists: true, $ne: [] } + }); + } else if (myitemsingle === shared_consts.FILTER_USER_ONLINE_6_MESI) { + const numgiorni_attivi = 30 * 6 + let daytocheck = new Date(); + daytocheck.setDate(daytocheck.getDate() - numgiorni_attivi); + daytocheck.setHours(0, 0, 0, 0) - }); + filtercustom.push({ lasttimeonline: { $gt: daytocheck } }) + } else if (myitemsingle === shared_consts.FILTER_USER_SENZA_CIRCUITO) { + filtercustom.push({ + $or: [ + { 'profile.mycircuits': { $exists: false } }, + { 'profile.mycircuits': { $eq: [] } } + ] + }); + } else if (myitemsingle === shared_consts.FILTER_USER_PROVINCE) { + filtercustom.push({ 'profile.resid_province': { $exists: true, $ne: '' } }); + } else if (myitemsingle === shared_consts.FILTER_USER_TELEGRAM_BLOCKED) { + filtercustom.push({ 'profile.teleg_id_old': { $gt: 1 } }); + } else if (myitemsingle === shared_consts.FILTER_NOTE) { + filtercustom.push({ 'profile.note': { $exists: true, $ne: '' } }); + } else if (myitemsingle === shared_consts.FILTER_SENZA_NOTE) { + filtercustom.push({ + $or: [ + { 'profile.note': { $exists: false } }, + { 'profile.note': { $exists: true, $eq: '' } }], - } else if (item.value === shared_consts.FILTER_USER_NO_VERIFIED_APORTADOR) { - filtercustom.push({ - verified_by_aportador: { $exists: false }, - }); - } else if (item.value === shared_consts.FILTER_USER_NO_TELEGRAM_ID) { - filtercustom.push({ 'profile.teleg_id': { $lt: 1 } }); + }); + } else if (myitemsingle === shared_consts.FILTER_USER_WITHOUT_USERNAME_TELEGRAM) { + filtercustom.push({ + $or: [ + { 'profile.username_telegram': { $exists: false } }, + { 'profile.username_telegram': { $exists: true, $eq: '' } }], + + }); + + } else if (myitemsingle === shared_consts.FILTER_USER_NO_VERIFIED_APORTADOR) { + filtercustom.push({ + verified_by_aportador: { $exists: false }, + }); + } else if (myitemsingle === shared_consts.FILTER_USER_NO_TELEGRAM_ID) { + filtercustom.push({ 'profile.teleg_id': { $lt: 1 } }); + + } + }) - } } else if (item.table === 'cities') { if (item.value && item.value.hasOwnProperty('_id')) { diff --git a/src/components/CMyActivities/CMyActivities.ts b/src/components/CMyActivities/CMyActivities.ts index d4bf8085..fd31783d 100755 --- a/src/components/CMyActivities/CMyActivities.ts +++ b/src/components/CMyActivities/CMyActivities.ts @@ -41,6 +41,11 @@ export default defineComponent({ CTimeAgo, CContactUser }, props: { + username: { + type: String, + required: true, + default : '', + }, introUser: { type: Boolean, required: false, @@ -63,7 +68,8 @@ export default defineComponent({ const animation = ref('fade') const mytab = ref('my') - const username = computed(() => $route.params.username ? $route.params.username.toString() : userStore.my.username) + // const username = computed(() => $route.params.username ? $route.params.username.toString() : userStore.my.username) + const username = ref('') const idnotif = computed(() => $route.query.idnotif ? $route.query.idnotif.toString() : '') const filtroutente = ref([]) @@ -110,7 +116,7 @@ export default defineComponent({ if (myuser.value) { // filtro_eventi.value = [{ userId: myuser.value._id }, { dateTimeStart: { $gte: today } }] let mydate = tools.addDays(tools.getDateNow(), -1) - let mydateend = tools.addDays(mydate, 30) + let mydateend = tools.addDays(mydate, 180) mydate = tools.getstrYYMMDDDate(mydate) filtro_eventi.value = [{ userId: myuser.value._id }, { dateTimeStart: { $gte: mydate, $lte: mydateend } }] filtroutente.value = [{ userId: myuser.value._id }] @@ -163,6 +169,7 @@ export default defineComponent({ }) function mounted() { + username.value = props.username || userStore.my.username loadProfile() } diff --git a/src/components/CMyCardService/CMyCardService.vue b/src/components/CMyCardService/CMyCardService.vue index d4b515d8..7f48e738 100644 --- a/src/components/CMyCardService/CMyCardService.vue +++ b/src/components/CMyCardService/CMyCardService.vue @@ -430,7 +430,7 @@ - + @@ -580,7 +580,6 @@ 0) { + const primo = arrcol[0] + let sec = null + if (arrcol.length > 1) + sec = arrcol[1] + if (sec) { + if (!myrow.value[primo]) { + myrow.value[primo] = {} + } + myrow.value[primo][sec] = newval + } else { + myrow.value[primo] = newval + } + /*if (!myrow.value[col.value.name]) { + myrow.value[col.value.name] = {} + } + myrow.value[col.value.name][subcol] = newval*/ + // console.log('myrow.value[col.value.name]', myrow.value[col.value.name]) } - myrow.value[col.value.name][subcol] = newval - // console.log('myrow.value[col.value.name]', myrow.value[col.value.name]) } else { myrow.value[col.value.name] = newval } - // console.log('changevalRec update:row', myrow.value) // emit('update:row', myrow.value) emit('update_col', col.value.name, newval) diff --git a/src/components/CMyRecCard/CMyRecCard.ts b/src/components/CMyRecCard/CMyRecCard.ts index f4c1c753..c10c6dfa 100755 --- a/src/components/CMyRecCard/CMyRecCard.ts +++ b/src/components/CMyRecCard/CMyRecCard.ts @@ -99,7 +99,7 @@ export default defineComponent({ } function getNameToShow(user: IUserFields, col = null) { - if (props.table === shared_consts.TABLES_MYBACHECAS && myrec.value.groupname) + if (myrec.value.groupname) return myrec.value.groupname else return userStore.getNameToShow(user, col) diff --git a/src/components/CMyUser/CMyUser.vue b/src/components/CMyUser/CMyUser.vue index 3431cbb5..90d991a0 100755 --- a/src/components/CMyUser/CMyUser.vue +++ b/src/components/CMyUser/CMyUser.vue @@ -37,7 +37,10 @@ }} {{ contact.profile.qualifica }} + {{ contact.profile.qualifica }} +
Note: {{ contact.profile.note }}
+
diff --git a/src/components/CSkill/CSkill.vue b/src/components/CSkill/CSkill.vue index 0ee17a45..53a51e1e 100755 --- a/src/components/CSkill/CSkill.vue +++ b/src/components/CSkill/CSkill.vue @@ -26,6 +26,7 @@ :labelBtnAddExtra="`Aggiungi ` + title" :prop_pagination="tools.getPagination()" :groupname="groupname" + :extrafield="groupname" :margin_right="30"> diff --git a/src/components/CUserNote/CUserNote.scss b/src/components/CUserNote/CUserNote.scss new file mode 100755 index 00000000..e69de29b diff --git a/src/components/CUserNote/CUserNote.ts b/src/components/CUserNote/CUserNote.ts new file mode 100755 index 00000000..9700f9a1 --- /dev/null +++ b/src/components/CUserNote/CUserNote.ts @@ -0,0 +1,77 @@ +import { defineComponent, onMounted, PropType, ref, watch } from 'vue' +import { useQuasar } from 'quasar' +import { useI18n } from '@/boot/i18n' +import { useGlobalStore } from '@store/globalStore' +import { fieldsTable } from '@store/Modules/fieldsTable' +import { tools } from '@store/Modules/tools' +import { costanti } from '@costanti' +import { CMyFieldDb } from '@/components/CMyFieldDb' +import { CMyFieldRec } from '@/components/CMyFieldRec' +import { IColGridTable, IOperators, ISpecialField, IUserFields } from 'model' +import MixinBase from '@/mixins/mixin-base' +import { useCalendarStore } from '@src/store/CalendarStore' + + +export default defineComponent({ + name: 'CUserNote', + emits: ['closenote', 'save'], + props: { + username: String, + userprofile_param: { + type: Object as PropType, + required: true, + } + }, + components: { CMyFieldDb, CMyFieldRec }, + setup(props, { emit }) { + const $q = useQuasar() + const { t } = useI18n() + const globalStore = useGlobalStore() + + const shownote = ref(false) + const userprofile = ref({}) + + function mounted() { + shownote.value = true + userprofile.value = props.userprofile_param + } + + function UpdateDbNote() { + const calendarStore = useCalendarStore() + const globalStore = useGlobalStore() + const { t } = useI18n() + + const mydatatosave = { + id: userprofile.value._id, + table: 'users', + fieldsvalue: { 'profile.note': userprofile.value.profile.note } + } + + globalStore.saveFieldValue(mydatatosave).then((esito) => { + if (esito) { + emit('save', userprofile.value) + tools.showPositiveNotif($q, t('db.recupdated')) + shownote.value = false + } else { + tools.showNegativeNotif($q, t('db.recfailed')) + } + }) + } + + + + onMounted(mounted) + + return { + tools, + costanti, + fieldsTable, + globalStore, + shownote, + userprofile, + UpdateDbNote, + t, + } + }, +}) + diff --git a/src/components/CUserNote/CUserNote.vue b/src/components/CUserNote/CUserNote.vue new file mode 100755 index 00000000..94101c97 --- /dev/null +++ b/src/components/CUserNote/CUserNote.vue @@ -0,0 +1,60 @@ + + + + + diff --git a/src/components/CUserNote/index.ts b/src/components/CUserNote/index.ts new file mode 100755 index 00000000..4bfd5852 --- /dev/null +++ b/src/components/CUserNote/index.ts @@ -0,0 +1 @@ +export {default as CUserNote} from './CUserNote.vue' diff --git a/src/model/UserStore.ts b/src/model/UserStore.ts index 4752ef62..d12b1ae6 100755 --- a/src/model/UserStore.ts +++ b/src/model/UserStore.ts @@ -132,6 +132,7 @@ export interface IUserProfile { special_req?: boolean sex?: ESexType biografia?: string + note?: string socio?: boolean socioresidente?: boolean consiglio?: boolean diff --git a/src/rootgen/admin/userPanel/userPanel.vue b/src/rootgen/admin/userPanel/userPanel.vue index 2a603cee..6a598003 100755 --- a/src/rootgen/admin/userPanel/userPanel.vue +++ b/src/rootgen/admin/userPanel/userPanel.vue @@ -169,6 +169,7 @@ +
diff --git a/src/statics/lang/it.js b/src/statics/lang/it.js index c5053cef..50e24ca3 100755 --- a/src/statics/lang/it.js +++ b/src/statics/lang/it.js @@ -46,6 +46,7 @@ const msg_it = { }, profile: { info_pers: 'Info Personali', + aggiungi_note: 'Aggiungi note', annunci: 'Annunci', share_link: 'Copia Link', info_msg: 'Puoi compilare facoltativamente questi tuoi dati personali.', diff --git a/src/store/Modules/fieldsTable.ts b/src/store/Modules/fieldsTable.ts index cdae3bec..2ee06ec3 100755 --- a/src/store/Modules/fieldsTable.ts +++ b/src/store/Modules/fieldsTable.ts @@ -1151,6 +1151,15 @@ export const colmyGoods = [ icon: 'fas fa-users', showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist, }), + AddCol({ + name: 'groupname', + label_trans: 'proj.gruppo', + foredit: false, + tipovisu: costanti.TipoVisu.LINK, + fieldtype: costanti.FieldType.username_chip, + link: '/mygrp/groupname', + noshowlabel: true, + }), AddCol({ name: 'adType', label_trans: 'adTypes.name', @@ -1499,6 +1508,15 @@ export const colmySkills = [ showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist, numpag_carousel: 2, }), + AddCol({ + name: 'groupname', + label_trans: 'proj.gruppo', + foredit: false, + tipovisu: costanti.TipoVisu.LINK, + fieldtype: costanti.FieldType.username_chip, + link: '/mygrp/groupname', + noshowlabel: true, + }), AddCol({ name: 'descr', label_trans: 'proj.shortdescr', @@ -1692,6 +1710,15 @@ export const colmyHosp = [ icon: 'fas fa-users', showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist, }), + AddCol({ + name: 'groupname', + label_trans: 'proj.gruppo', + foredit: false, + tipovisu: costanti.TipoVisu.LINK, + fieldtype: costanti.FieldType.username_chip, + link: '/mygrp/groupname', + noshowlabel: true, + }), AddCol({ name: 'idContribType', label_trans: 'contribtype.name', @@ -3188,6 +3215,7 @@ export const colTableUsersCNM = [ }), AddCol({ name: 'profile.motivazioni', field: 'profile', subfield: 'motivazioni', label_trans: 'reg.motivazioni' }), AddCol({ name: 'profile.biografia', field: 'profile', subfield: 'biografia', label_trans: 'reg.biografia' }), + AddCol({ name: 'profile.note', field: 'profile', subfield: 'note', label_trans: 'reg.note' }), AddCol({ name: 'profile.competenze_professionalita', field: 'profile', @@ -3465,6 +3493,7 @@ export const colTableUsersISP = [ }), // AddCol({ name: 'profile.motivazioni', field: 'profile', subfield: 'motivazioni', label_trans: 'reg.motivazioni', }), AddCol({ name: 'profile.biografia', field: 'profile', subfield: 'biografia', label_trans: 'reg.biografia' }), + AddCol({ name: 'profile.note', field: 'profile', subfield: 'note', label_trans: 'reg.note' }), AddCol({ name: 'profile.qualifica', field: 'profile', subfield: 'qualifica', label_trans: 'reg.qualifica' }), AddCol({ name: 'profile.paymenttypes', diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts index 83a152da..b966509e 100644 --- a/src/store/Modules/tools.ts +++ b/src/store/Modules/tools.ts @@ -7320,7 +7320,7 @@ export const tools = { return ris }, - getdefaultnewrec_MySkill(groupname?: string): any { + getdefaultnewrec_MySkill(extrarec: any): any { return { idSector: tools.getSelectionByTable('sectors', 0, true), @@ -7336,11 +7336,11 @@ export const tools = { //**ADDFIELD_MYSKILL website: '', descr: '', - groupname, + groupname: extrarec && extrarec.groupname ? extrarec.groupname : '', } }, - getdefaultnewrec_MyGoods(): any { + getdefaultnewrec_MyGoods(extrarec: any): any { return { // idSectorGood: 0, // idGood: 0, @@ -7366,6 +7366,7 @@ export const tools = { //**ADDFIELD_MYSKILL website: '', descr: '', + groupname: extrarec && extrarec.groupname ? extrarec.groupname : '', } }, @@ -7442,7 +7443,7 @@ export const tools = { } }, - getdefaultnewrec_MyHosp(): any { + getdefaultnewrec_MyHosp(extrarec: any): any { return { visibile: true, adType: tools.getSelectionByTable('adtypes', costanti.AdType.OFFRO), @@ -7455,6 +7456,7 @@ export const tools = { descr: '', note: '', website: '', + groupname: extrarec && extrarec.groupname ? extrarec.groupname : '', } }, @@ -8367,13 +8369,13 @@ export const tools = { getdefaultnewrec(table: string, extrarec?: any): any { if (table === toolsext.TABMYSKILLS) { - return tools.getdefaultnewrec_MySkill() + return tools.getdefaultnewrec_MySkill(extrarec) } else if (table === toolsext.TABMYBACHECAS) { return tools.getdefaultnewrec_MyBacheca(extrarec) } else if (table === toolsext.TABMYHOSPS) { - return tools.getdefaultnewrec_MyHosp() + return tools.getdefaultnewrec_MyHosp(extrarec) } else if (table === toolsext.TABMYGOODS) { - return tools.getdefaultnewrec_MyGoods() + return tools.getdefaultnewrec_MyGoods(extrarec) } else if (table === toolsext.TABMYGROUPS) { return tools.getdefaultnewrec_MyGroup() } else if (table === toolsext.TABCIRCUITS) { @@ -8498,6 +8500,15 @@ export const tools = { lk_as: 'mycities', af_objId_tab: '', }, + lookup5: { + lk_tab: 'mygroups', + lk_LF: 'groupname', + lk_FF: 'groupname', + lk_as: 'mygrp', + lk_proj: shared_consts.getProjectForAll({}, table), + unwind: true, + noarray: true, + }, } } else if (table === toolsext.TABMYBACHECAS) { return { @@ -8566,6 +8577,15 @@ export const tools = { af_objId_tab: '', lk_proj: shared_consts.getProjectForAll({}, table), }, + lookup3: { + lk_tab: 'mygroups', + lk_LF: 'groupname', + lk_FF: 'groupname', + lk_as: 'mygrp', + lk_proj: shared_consts.getProjectForAll({}, table), + unwind: true, + noarray: true, + }, } } else { @@ -8593,13 +8613,22 @@ export const tools = { lk_as: 'sector', af_objId_tab: '', }, - lookup5: { + lookup4: { lk_tab: 'cities', lk_LF: 'idCity', lk_FF: '_id', lk_as: 'mycities', af_objId_tab: '', }, + lookup5: { + lk_tab: 'mygroups', + lk_LF: 'groupname', + lk_FF: 'groupname', + lk_as: 'mygrp', + lk_proj: shared_consts.getProjectForAll({}, table), + unwind: true, + noarray: true, + }, } } }, diff --git a/src/views/user/myfriends/myfriends.ts b/src/views/user/myfriends/myfriends.ts index 05d01b6e..3faf3c45 100755 --- a/src/views/user/myfriends/myfriends.ts +++ b/src/views/user/myfriends/myfriends.ts @@ -34,11 +34,11 @@ export default defineComponent({ label: 'Filtra per', table: shared_consts.TABFILTRI_UTENTE, key: '', - type: costanti.FieldType.select, - value: tools.getCookie(tools.COOK_SEARCH + 'filtroutente', costanti.FILTER_TUTTI), + type: costanti.FieldType.multiselect, + value: 0, keycookie: '_fu', addall: false, - arrvalue: [], + arrvalue: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + 'users' + costanti.FILTER_SEP + shared_consts.TABFILTRI_UTENTE + '_fu', []), filter: null, useinput: false, icon: 'fas fa-filter' @@ -106,6 +106,7 @@ export default defineComponent({ 'profile.img': 1, 'profile.mygroups': 1, 'profile.qualifica': 1, + 'profile.note': 1, 'profile.resid_province': 1, 'mycities.reg': 1, } diff --git a/src/views/user/mygroup/mygroup.ts b/src/views/user/mygroup/mygroup.ts index c0fbc906..d05bd4a9 100755 --- a/src/views/user/mygroup/mygroup.ts +++ b/src/views/user/mygroup/mygroup.ts @@ -30,7 +30,7 @@ export default defineComponent({ name: 'mygroup', components: { CProfile, CTitleBanner, CMyFieldRec, - CInfoAccount, CSkill, CDateTime, CMyFriends, CGridTableRec, CMyUser, CCheckIfIsLogged, + CInfoAccount, CSkill, CDateTime, CMyFriends, CGridTableRec, CMyUser, CCheckIfIsLogged, CNotifAtTop, CSendCoins }, props: {}, @@ -43,6 +43,11 @@ export default defineComponent({ const { t } = useI18n() const animation = ref('fade') + const tabevents = ref('new') + + const mycards = computed(() => { + return costanti.MAINCARDS.filter((rec: any) => rec.table && rec.showinprofile) + }) const groupname = computed(() => $route.params.groupname ? $route.params.groupname.toString() : '') const idnotif = computed(() => $route.query.idnotif ? $route.query.idnotif.toString() : '') @@ -53,6 +58,7 @@ export default defineComponent({ const showsendCoinTo = ref(false) const tabcircuit = ref('info') + const filtro_eventi = ref([]) const mygrp = ref({}) const mystatus = ref(0) @@ -106,7 +112,7 @@ export default defineComponent({ if (circuitslist.value) { circuitslistOpt.value = [] for (let i = 0; i < circuitslist.value.length; i++) { - circuitslistOpt.value.push({label: circuitslist.value[i].name, value: i }) + circuitslistOpt.value.push({ label: circuitslist.value[i].name, value: i }) let myc = data.mygroup.mycircuits.find((circ: IMyCircuit) => circ.circuitname === circuitslist.value[i].name) if (myc) { circuitslist.value[i].account = myc.account @@ -140,6 +146,7 @@ export default defineComponent({ arrfilterand.value = [] filtercustom_rich.value = [] + //++TODO: sistemare la filtercustom ... richieste... } @@ -213,11 +220,34 @@ export default defineComponent({ } } - function filtroeventsgroup() { + function filtrotables(table: string, quale: string) { + let out = [] if (mygrp.value) - return [{ groupname: mygrp.value.groupname }] - else - return null + out.push({ groupname: mygrp.value.groupname }) + + if (table === shared_consts.TABLES_MYBACHECAS) { + let mydate = tools.addDays(tools.getDateNow(), -1) + let mydateend = tools.addDays(mydate, 180) + mydate = tools.getstrYYMMDDDate(mydate) + mydateend = tools.getstrYYMMDDDate(mydateend) + + if (quale === 'new') { + filtro_eventi.value = [{ dateTimeStart: { $gte: mydate, $lte: mydateend } }] + } else { + mydate = tools.addDays(tools.getDateNow(), -365) + mydateend = tools.addDays(tools.getDateNow(), 0) + mydate = tools.getstrYYMMDDDate(mydate) + mydateend = tools.getstrYYMMDDDate(mydateend) + filtro_eventi.value = [{ dateTimeStart: { $gte: mydate, $lte: mydateend } }] + } + + filtro_eventi.value.forEach((rec: any) => [ + out.push({ ...rec }) + ]) + + } + + return out } function getlinkpage() { @@ -270,9 +300,11 @@ export default defineComponent({ tabcircuit, circuitIndex, circuitslistOpt, - filtroeventsgroup, + filtrotables, getlinkpage, showsendCoinTo, + mycards, + tabevents, } } }) diff --git a/src/views/user/mygroup/mygroup.vue b/src/views/user/mygroup/mygroup.vue index 50a830a5..20485035 100755 --- a/src/views/user/mygroup/mygroup.vue +++ b/src/views/user/mygroup/mygroup.vue @@ -204,6 +204,11 @@ name="members" icon="fas fa-users" > + - @@ -511,7 +511,7 @@ > - +
@@ -604,17 +604,59 @@ >
-
- +
+
+
+
+
+ + + + + + + + + + + + + +
+
+ +
+
+
+
-
+
-
- - +