- Invia e Ricevi RIS (grafica aggiornata)
- Visualizzazione Movimenti (ultimi e successivi), per singolo e di tutti
This commit is contained in:
6
src/components/CFindUsers/CFindUsers.scss
Executable file
6
src/components/CFindUsers/CFindUsers.scss
Executable file
@@ -0,0 +1,6 @@
|
||||
.my-custom-border {
|
||||
border: 1px solid #ccc; /* Imposta il colore del bordo (puoi personalizzare) */
|
||||
|
||||
background-color: #fff; /* Colore sfondo per il contenitore (puoi personalizzare) */
|
||||
border-radius: 10px;
|
||||
}
|
||||
222
src/components/CFindUsers/CFindUsers.ts
Executable file
222
src/components/CFindUsers/CFindUsers.ts
Executable file
@@ -0,0 +1,222 @@
|
||||
import { computed, defineComponent, onMounted, PropType, ref, watch, reactive, toRefs } from 'vue'
|
||||
|
||||
import { ICalcStat, IOperators, ISearchList } from '../../model'
|
||||
import { useUserStore } from '../../store/UserStore'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useGlobalStore } from '../../store/globalStore'
|
||||
import { useCircuitStore } from '../../store/CircuitStore'
|
||||
import { useI18n } from '../../boot/i18n'
|
||||
|
||||
import { shared_consts } from '@src/common/shared_vuejs'
|
||||
import { costanti, IMainCard } from '@store/Modules/costanti'
|
||||
|
||||
import { CMyUser } from '../CMyUser'
|
||||
import { CTitleBanner } from '../CTitleBanner'
|
||||
import { CMyGroup } from '../CMyGroup'
|
||||
import { CQRCode } from '../CQRCode'
|
||||
import { CCopyBtnSmall } from '../CCopyBtnSmall'
|
||||
import { CContactUser } from '../CContactUser'
|
||||
import { CGridTableRec } from '../CGridTableRec'
|
||||
import { CUserInfoAccount } from '../CUserInfoAccount'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { useQuasar } from 'quasar'
|
||||
|
||||
import { colmyUserPeople } from '@store/Modules/fieldsTable'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CFindUsers',
|
||||
props: {
|
||||
actionType: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: costanti.ACTIONTYPE.SEND_RIS,
|
||||
},
|
||||
sendRIS: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
components: {
|
||||
CMyUser, CMyGroup, CUserInfoAccount, CCopyBtnSmall,
|
||||
CTitleBanner, CContactUser, CGridTableRec, CQRCode
|
||||
},
|
||||
setup(props) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
const globalStore = useGlobalStore()
|
||||
const circuitStore = useCircuitStore()
|
||||
const { t } = useI18n()
|
||||
const $q = useQuasar()
|
||||
const $router = useRouter()
|
||||
|
||||
const receiveRislist = computed(() => globalStore.datastat ? globalStore.datastat.receiveRislist : [])
|
||||
const receiveRislistgroup = computed(() => globalStore.datastat ? globalStore.datastat.receiveRislistgroup : [])
|
||||
|
||||
const arrfilterand: any = ref([])
|
||||
const filtercustom: any = ref([])
|
||||
const searchList = ref(<ISearchList[]>[])
|
||||
|
||||
const filter = ref(costanti.FIND_PEOPLE)
|
||||
|
||||
const loading = ref(false)
|
||||
const tipoConto = ref(0)
|
||||
|
||||
const contact = computed(() => userStore.my)
|
||||
|
||||
const searchType = ref('username')
|
||||
|
||||
const usersList = ref(<any>{ show: false, title: '', list: [], listgroup: [] })
|
||||
|
||||
const options = ref([
|
||||
{
|
||||
label: 'Cerca per Nome o Username',
|
||||
value: 'username'
|
||||
},
|
||||
{
|
||||
label: 'Lista dei Riceventi di oggi',
|
||||
value: 'receivers'
|
||||
},
|
||||
{
|
||||
label: 'Scansiona il QRCode del Destinatario',
|
||||
value: 'qrcode'
|
||||
},
|
||||
])
|
||||
|
||||
const arrTypesAccounts = ref(<any>[
|
||||
{
|
||||
label: t('circuit.user'),
|
||||
value: shared_consts.AccountType.USER,
|
||||
},
|
||||
{
|
||||
label: t('circuit.conticollettivi'),
|
||||
value: shared_consts.AccountType.COLLECTIVE_ACCOUNT,
|
||||
}
|
||||
])
|
||||
|
||||
|
||||
function getFilterProvinceByRegion(recProvince: any, index: number, arr: any) {
|
||||
const recreg: any = searchList.value.find((rec) => rec.table === 'regions')
|
||||
if (recreg) {
|
||||
return recProvince.reg === recreg.value
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
function mounted() {
|
||||
|
||||
searchList.value = [
|
||||
{
|
||||
label: 'Regione',
|
||||
table: 'regions',
|
||||
key: 'idReg',
|
||||
type: costanti.FieldType.select,
|
||||
value: tools.getCookie(tools.COOK_SEARCH + 'regions_fr', costanti.FILTER_TUTTI),
|
||||
keycookie: '_fr',
|
||||
addall: true,
|
||||
arrvalue: [],
|
||||
filter: null,
|
||||
useinput: false,
|
||||
icon: 'fas fa-globe-europe'
|
||||
},
|
||||
{
|
||||
label: 'Provincia',
|
||||
table: 'provinces',
|
||||
key: 'profile.resid_province',
|
||||
type: costanti.FieldType.select,
|
||||
value: tools.getCookie(tools.COOK_SEARCH + 'provinces_fr', costanti.FILTER_TUTTI),
|
||||
keycookie: '_fr',
|
||||
addall: true,
|
||||
arrvalue: [],
|
||||
filter: getFilterProvinceByRegion,
|
||||
useinput: true,
|
||||
icon: 'flag',
|
||||
tablesel: 'provinces',
|
||||
},
|
||||
]
|
||||
|
||||
filtercustom.value = []
|
||||
arrfilterand.value = []
|
||||
|
||||
const filt_loaded = tools.getCookie(tools.COOK_SEARCH + tools.FRIENDS_SEARCH, costanti.FIND_PEOPLE, true)
|
||||
filter.value = filt_loaded ? filt_loaded : costanti.FIND_PEOPLE
|
||||
|
||||
updateUserListRIS()
|
||||
|
||||
sendCoinsToClick()
|
||||
}
|
||||
|
||||
function extraparams() {
|
||||
|
||||
return {
|
||||
lookup1: {
|
||||
lk_tab: 'provinces',
|
||||
lk_LF: 'profile.resid_province',
|
||||
lk_FF: 'prov',
|
||||
lk_as: 'mycities',
|
||||
lk_proj: {
|
||||
username: 1,
|
||||
name: 1,
|
||||
surname: 1,
|
||||
verified_by_aportador: 1,
|
||||
'profile.handshake': 1,
|
||||
'profile.img': 1,
|
||||
'profile.mygroups': 1,
|
||||
'profile.qualifica': 1,
|
||||
'profile.resid_province': 1,
|
||||
'mycities.reg': 1,
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
async function updateUserListRIS() {
|
||||
const userStore = useUserStore()
|
||||
|
||||
loading.value = true
|
||||
|
||||
await globalStore.getStatSite()
|
||||
|
||||
usersList.value.list = receiveRislist
|
||||
usersList.value.listgroup = receiveRislistgroup
|
||||
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
async function sendCoinsToClick() {
|
||||
|
||||
usersList.value.show = true;
|
||||
usersList.value.title = t('circuit.sendcoins');
|
||||
usersList.value.list = receiveRislist
|
||||
usersList.value.listgroup = receiveRislistgroup
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
userStore,
|
||||
tools,
|
||||
costanti,
|
||||
shared_consts,
|
||||
arrTypesAccounts,
|
||||
loading,
|
||||
contact,
|
||||
t,
|
||||
extraparams,
|
||||
colmyUserPeople,
|
||||
searchList,
|
||||
options,
|
||||
searchType,
|
||||
updateUserListRIS,
|
||||
usersList,
|
||||
receiveRislist,
|
||||
receiveRislistgroup,
|
||||
tipoConto,
|
||||
CQRCode,
|
||||
}
|
||||
},
|
||||
})
|
||||
116
src/components/CFindUsers/CFindUsers.vue
Executable file
116
src/components/CFindUsers/CFindUsers.vue
Executable file
@@ -0,0 +1,116 @@
|
||||
<template>
|
||||
<q-option-group
|
||||
class="q-ma-xs"
|
||||
style="text-align: left !important"
|
||||
v-model="searchType"
|
||||
:options="options"
|
||||
color="primary"
|
||||
/>
|
||||
<q-tab-panels v-model="searchType" animated class="shadow-2 rounded-borders">
|
||||
<q-tab-panel name="username">
|
||||
<CGridTableRec
|
||||
prop_mytable="users"
|
||||
prop_mytitle=""
|
||||
subtitle=""
|
||||
:prop_mycolumns="colmyUserPeople"
|
||||
prop_colkey="_id"
|
||||
col_title="username"
|
||||
:vertical="costanti.VISUTABLE_LISTA"
|
||||
nodataLabel=" "
|
||||
:prop_search="true"
|
||||
:prop_showfilter="true"
|
||||
hint="Cerca il nome o Username"
|
||||
:hintinbtnsearch="true"
|
||||
:findByDebounce="true"
|
||||
:showSearchOnTop="false"
|
||||
:finder="true"
|
||||
:choose_visutype="false"
|
||||
:finder_noNull="false"
|
||||
:finder_noNullFilters="true"
|
||||
:options="shared_consts.OPTIONS_SEARCH_USER_ALL_WORDS"
|
||||
:butt_modif_new="false"
|
||||
noresultLabel="Username, Nome o Cognome non trovato"
|
||||
:arrfilters="arrfilterand"
|
||||
:filtercustom="filtercustom"
|
||||
:prop_searchList="searchList"
|
||||
:showType="costanti.SHOW_USERINFO"
|
||||
:showCol="false"
|
||||
:extraparams="extraparams()"
|
||||
:actionType="actionType"
|
||||
>
|
||||
</CGridTableRec>
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="receivers">
|
||||
<div class="row centeritems">
|
||||
<q-btn-toggle
|
||||
v-if="arrTypesAccounts.length > 0"
|
||||
v-model="tipoConto"
|
||||
class="my-custom-toggle"
|
||||
no-caps
|
||||
rounded
|
||||
unelevated
|
||||
toggle-color="primary"
|
||||
color="white"
|
||||
text-color="primary"
|
||||
:options="arrTypesAccounts"
|
||||
/>
|
||||
|
||||
<div v-if="tipoConto === shared_consts.AccountType.USER">
|
||||
<div v-for="(rec, i) in usersList.list" :key="i">
|
||||
<div class="q-pa-xs q-ma-xs q-border q-rounded my-custom-border">
|
||||
<CMyUser
|
||||
:mycontact="rec"
|
||||
:visu="costanti.FIND_PEOPLE"
|
||||
@setCmd="tools.setCmd"
|
||||
:actionType="actionType"
|
||||
>
|
||||
</CMyUser>
|
||||
<CContactUser
|
||||
:myuser="rec"
|
||||
:showBtnActivities="false"
|
||||
:sendRIS="tools.isUserOk() ? sendRIS : false"
|
||||
:actionType="actionType"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="tipoConto === shared_consts.AccountType.COLLECTIVE_ACCOUNT"
|
||||
>
|
||||
<div v-for="(grp, i) in usersList.listgroup" :key="i">
|
||||
<CMyGroup :mygrp="grp" :visu="costanti.USER_GROUPS" :noaut="true">
|
||||
</CMyGroup>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row centeritems justify-evenly items-center">
|
||||
<q-btn
|
||||
icon="autorenew"
|
||||
rounded
|
||||
glossy
|
||||
dense
|
||||
color="primary"
|
||||
:label="$t('dialog.update_receivers')"
|
||||
:disable="loading"
|
||||
@click="updateUserListRIS()"
|
||||
>
|
||||
</q-btn>
|
||||
|
||||
<q-spinner-radio v-if="loading" class="q-ma-sm" color="brown" />
|
||||
<div class="q-ma-sm"> </div>
|
||||
<br>
|
||||
</div>
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="qrcode">
|
||||
<CQRCode :read="true"></CQRCode>
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CFindUsers.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CFindUsers.scss';
|
||||
</style>
|
||||
1
src/components/CFindUsers/index.ts
Executable file
1
src/components/CFindUsers/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export {default as CFindUsers} from './CFindUsers.vue'
|
||||
Reference in New Issue
Block a user