Filtra Ricerca...

This commit is contained in:
Surya Paolo
2023-06-05 16:36:06 +02:00
parent e805088da7
commit bd3a9557e2
13 changed files with 1604 additions and 1528 deletions

View File

@@ -100,6 +100,7 @@ export default defineComponent({
const serverData: any = ref([]) const serverData: any = ref([])
const numRecLoaded = ref(0) const numRecLoaded = ref(0)
const changetable = ref(false) const changetable = ref(false)
const filtri = ref(false)
const searchList = ref([] as ISearchList[]) const searchList = ref([] as ISearchList[])
const actual = '' const actual = ''
@@ -349,6 +350,7 @@ export default defineComponent({
createNewRecordDialog, createNewRecordDialog,
toHome, toHome,
iconsel, iconsel,
filtri,
} }
} }
}) })

View File

@@ -3,7 +3,7 @@
:class="$q.screen.lt.sm ? `` : `q-pa-xs`" :class="$q.screen.lt.sm ? `` : `q-pa-xs`"
v-if="isfinishLoading && mycolumns" v-if="isfinishLoading && mycolumns"
> >
<q-layout view="hHh lpR fFf" :class="`shadow-2 rounded-borders `"> <div :class="`shadow-2 rounded-borders`">
<div> <div>
<div v-if="prop_search || canEdit" class="q-my-xs text-right"> <div v-if="prop_search || canEdit" class="q-my-xs text-right">
<q-btn <q-btn
@@ -15,218 +15,230 @@
></q-btn> ></q-btn>
</div> </div>
<q-slide-transition> <q-slide-transition>
<div class="row no-wrap shadow-1"> <div class="row no-wrap shadow-1" style="height: 40px;">
<q-header elevated reveal> <div v-if="$q.screen.gt.xs" class="col-1">
<q-toolbar class="glossy" style=""> <q-avatar @click="toHome" class="imglink">
<div v-if="$q.screen.gt.xs" class="col-1"> <img
<q-avatar @click="toHome" class="imglink"> :src="tools.getimglogo()"
<img height="27"
:src="tools.getimglogo()" alt="Immagine Logo"
height="27" />
alt="Immagine Logo" </q-avatar>
/> </div>
</q-avatar> <div class="col-4">
</div> <q-select
<div class="col-4"> dense
<q-select v-model="tablesel"
v-model="tablesel" :options="optionsMainCards"
:options="optionsMainCards" emit-value
dark borderless
emit-value class="text-blue"
borderless map-options
map-options :behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'" @update:model-value="gotoPageSel"
@update:model-value="gotoPageSel" >
> <template v-slot:prepend>
<template v-slot:prepend> <q-icon :name="iconsel" />
<q-icon :name="iconsel" /> </template>
</template> <template v-slot:option="scope">
<template v-slot:option="scope"> <q-item v-bind="scope.itemProps">
<q-item v-bind="scope.itemProps"> <q-item-section avatar>
<q-item-section avatar> <q-icon :name="scope.opt.icon" />
<q-icon :name="scope.opt.icon" /> </q-item-section>
</q-item-section> <q-item-section>
<q-item-section> <q-item-label>{{ scope.opt.label }}</q-item-label>
<q-item-label>{{ scope.opt.label }}</q-item-label> <!--<q-item-label caption>{{
<!--<q-item-label caption>{{
scope.opt.description scope.opt.description
}}</q-item-label>--> }}</q-item-label>-->
</q-item-section> </q-item-section>
</q-item> </q-item>
</template> </template>
</q-select> </q-select>
</div> </div>
<q-space />
<!--<q-btn <!--<q-btn
size="sm" size="sm"
class="col-1 q-mx-xs" class="col-1 q-mx-xs"
icon="fas fa-plus" icon="fas fa-plus"
@click="createNewRecordDialog" @click="createNewRecordDialog"
> >
</q-btn>--> </q-btn>-->
<div <q-btn v-if="false" color="green" label="Filtra la ricerca">
class="col" <q-popup-proxy>
v-for="(item, index) in searchList" <q-banner class="bg-brown text-white">
:key="index" <div
> class="col"
<CMySelect v-for="(item, index) in searchList"
:col="fieldsTable.getColByColumns(mycolumns, item.key)" :key="index"
v-if="
item.type === costanti.FieldType.select ||
item.type === costanti.FieldType.select_by_server
"
:label="
item.value && item.value._id > 0
? undefined
: labelcombo(item)
"
v-model:value="item.value"
@update:value="searchval(item.value, item.table)"
:addall="item.addall"
:addnone="item.addnone"
:addlast="true"
:tablesel="
item.type === costanti.FieldType.select_by_server
? item.tablesel
: ''
"
:pickup="item.type === costanti.FieldType.select_by_server"
label-color="white"
myclass="comboselector"
color="primary"
dark
:dense="true"
:icon_alternative="item.icon"
:optval="fieldsTable.getKeyByTable(item.table)"
:optlab="fieldsTable.getLabelByTable(item.table)"
:options="valoriopt(item, false)"
:filter="item.filter"
:filter_extra="item.filter_extra"
style="font-size: 0.8rem !important"
:useinput="
item.useinput &&
item.type !== costanti.FieldType.select_by_server
"
> >
</CMySelect> <CMySelect
:col="fieldsTable.getColByColumns(mycolumns, item.key)"
v-if="
item.type === costanti.FieldType.select ||
item.type === costanti.FieldType.select_by_server
"
:label="
item.value && item.value._id > 0
? undefined
: labelcombo(item)
"
v-model:value="item.value"
@update:value="searchval(item.value, item.table)"
:addall="item.addall"
:addnone="item.addnone"
:addlast="true"
:tablesel="
item.type === costanti.FieldType.select_by_server
? item.tablesel
: ''
"
:pickup="
item.type === costanti.FieldType.select_by_server
"
:label-color="$q.dark.isActive ? 'white' : 'black'"
myclass="comboselector"
color="primary"
dark
:dense="true"
:icon_alternative="item.icon"
:optval="fieldsTable.getKeyByTable(item.table)"
:optlab="fieldsTable.getLabelByTable(item.table)"
:options="valoriopt(item, false)"
:filter="item.filter"
:filter_extra="item.filter_extra"
style="font-size: 0.8rem !important"
:useinput="
item.useinput &&
item.type !== costanti.FieldType.select_by_server
"
>
</CMySelect>
<!--<div v-if="item.type === costanti.FieldType.multiselect_by_server"> <!--<div v-if="item.type === costanti.FieldType.multiselect_by_server">
item: {{ item}} item: {{ item}}
</div>--> </div>-->
<CMySelect <CMySelect
v-if=" v-if="
item.type === costanti.FieldType.multiselect_by_server item.type === costanti.FieldType.multiselect_by_server
" "
:col="fieldsTable.getColByColumns(mycolumns, item.key)" :col="fieldsTable.getColByColumns(mycolumns, item.key)"
:multiselect_by_server="true" :multiselect_by_server="true"
:label="labelcombo(item)" :label="labelcombo(item)"
v-model:arrvalue="item.arrvalue" v-model:arrvalue="item.arrvalue"
@update:arrvalue="searchval(item.arrvalue, item.table)" @update:arrvalue="searchval(item.arrvalue, item.table)"
:addall="item.addall" :addall="item.addall"
:addnone="item.addnone" :addnone="item.addnone"
dark dark
:addlast="true" :addlast="true"
:tablesel="item.tablesel" :tablesel="item.tablesel"
:pickup="true" :pickup="true"
:param1="item.param1" :param1="item.param1"
label-color="primary" label-color="primary"
class="comboselector" class="comboselector"
color="primary" color="primary"
:icon_alternative="item.icon" :icon_alternative="item.icon"
:optval="fieldsTable.getKeyByTable(item.table)" :optval="fieldsTable.getKeyByTable(item.table)"
:optlab="fieldsTable.getLabelByTable(item.table)" :optlab="fieldsTable.getLabelByTable(item.table)"
:filter="item.filter" :filter="item.filter"
:filter_extra="item.filter_extra" :filter_extra="item.filter_extra"
:options="valoriopt(item, false)" :options="valoriopt(item, false)"
:useinput="true" :useinput="true"
>
</CMySelect>
<q-select
v-if="item.type === costanti.FieldType.multiselect"
v-model="item.arrvalue"
label-color="primary"
:label="labelcombo(item)"
@update:model-value="searchval(item.arrvalue, item.table)"
rounded
dark
dense
outlined
multiple
options-dense
emit-value
map-options
:useinput="item.useinput"
:options="valoriopt(item, item.addall, item.addnone)"
:filter="item.filter"
class="comboselector"
:option-value="fieldsTable.getKeyByTable(item.table)"
>
<template v-if="item.icon" v-slot:prepend>
<q-icon :name="item.icon" />
</template>
<template
v-if="item.arrvalue.length >= 1"
v-slot:selected-item="scope"
> >
<div </CMySelect>
v-if="
scope.opt[fieldsTable.getLabelByTable(item.table)] || <q-select
(scope.opt && checkIfShowRec(scope.opt)) v-if="item.type === costanti.FieldType.multiselect"
" v-model="item.arrvalue"
label-color="primary"
:label="labelcombo(item)"
@update:model-value="searchval(item.arrvalue, item.table)"
rounded
dark
dense
outlined
multiple
options-dense
emit-value
map-options
:useinput="item.useinput"
:options="valoriopt(item, item.addall, item.addnone)"
:filter="item.filter"
class="comboselector"
:option-value="fieldsTable.getKeyByTable(item.table)"
>
<template v-if="item.icon" v-slot:prepend>
<q-icon :name="item.icon" />
</template>
<template
v-if="item.arrvalue.length >= 1"
v-slot:selected-item="scope"
> >
<q-chip <div
removable v-if="
dense
@remove="scope.removeAtIndex(scope.index)"
v-if="checkIfShowRec(scope.opt)"
color="white"
text-color="mycol"
class="q-my-none q-ml-xs q-mr-none"
>
<q-avatar
color="primary"
text-color="white"
:icon="item.icon"
size="12px"
/>
{{
scope.opt[ scope.opt[
fieldsTable.getLabelByTable(item.table) fieldsTable.getLabelByTable(item.table)
] || scope.opt ] ||
}} (scope.opt && checkIfShowRec(scope.opt))
</q-chip> "
</div> >
</template> <q-chip
<template removable
v-slot:option="{ itemProps, opt, selected, toggleOption }" dense
> @remove="scope.removeAtIndex(scope.index)"
<q-item v-bind="itemProps"> v-if="checkIfShowRec(scope.opt)"
<q-item-section> :color="$q.dark.isActive ? 'white' : 'black'"
<q-item-label>{{ text-color="mycol"
opt[fieldsTable.getLabelByTable(item.table)] class="q-my-none q-ml-xs q-mr-none"
}}</q-item-label> >
</q-item-section> <q-avatar
<q-item-section side> color="primary"
<q-toggle :text-color="$q.dark.isActive ? 'white' : 'black'"
:model-value="selected" :icon="item.icon"
@update:model-value="toggleOption(opt)" size="12px"
/> />
</q-item-section> {{
</q-item> scope.opt[
</template> fieldsTable.getLabelByTable(item.table)
</q-select> ] || scope.opt
</div> }}
</q-toolbar> </q-chip>
</q-header> </div>
</template>
<template
v-slot:option="{
itemProps,
opt,
selected,
toggleOption,
}"
>
<q-item v-bind="itemProps">
<q-item-section>
<q-item-label>{{
opt[fieldsTable.getLabelByTable(item.table)]
}}</q-item-label>
</q-item-section>
<q-item-section side>
<q-toggle
:model-value="selected"
@update:model-value="toggleOption(opt)"
/>
</q-item-section>
</q-item>
</template>
</q-select>
</div>
</q-banner>
</q-popup-proxy>
</q-btn>
</div> </div>
</q-slide-transition> </q-slide-transition>
</div> </div>
<div class="q-my-md"> <div class="q-my-xs">
<slot /> <slot />
</div> </div>
</q-layout> </div>
</div> </div>
</template> </template>
<script lang="ts" src="./CBarSelection.ts"> <script lang="ts" src="./CBarSelection.ts">

View File

@@ -326,18 +326,6 @@ export default defineComponent({
searchList_Servizi.value = [ searchList_Servizi.value = [
{
label: 'Stato',
table: 'statusSkills',
key: 'idStatusSkill',
value: 0,
arrvalue: tools.getCookie(tools.COOK_SEARCH + 'statusSkills', []),
type: costanti.FieldType.multiselect,
filter: null,
useinput: false,
icon: 'mood',
filteradv: true,
},
{ {
label: 'Regione', label: 'Regione',
table: 'regions', table: 'regions',
@@ -377,7 +365,7 @@ export default defineComponent({
// param1: shared_consts.PARAM_SHOW_PROVINCE, // param1: shared_consts.PARAM_SHOW_PROVINCE,
tablesel: 'cities', tablesel: 'cities',
}, },
{ /*{
label: 'Visibilità', label: 'Visibilità',
table: 'pub_to_share', table: 'pub_to_share',
key: 'pub_to_share', key: 'pub_to_share',
@@ -387,18 +375,7 @@ export default defineComponent({
arrvalue: [], arrvalue: [],
useinput: false, useinput: false,
filter: null, filter: null,
}, },*/
{
label: 'Offro/Cerco',
table: 'adtypes',
key: 'adType',
value: tools.getCookie(tools.COOK_SEARCH + 'adtypes', costanti.FILTER_TUTTI, true),
arrvalue: [],
addall: true,
type: costanti.FieldType.select,
filter: null,
useinput: false,
},
{ {
label: 'Settore', label: 'Settore',
table: toolsext.TABSECTORS, table: toolsext.TABSECTORS,
@@ -411,6 +388,17 @@ export default defineComponent({
notinsearch: true, notinsearch: true,
useinput: false, useinput: false,
}, },
{
label: 'Offro/Cerco',
table: 'adtypes',
key: 'adType',
value: tools.getCookie(tools.COOK_SEARCH + 'adtypes', costanti.FILTER_TUTTI, true),
arrvalue: [],
addall: true,
type: costanti.FieldType.select,
filter: null,
useinput: false,
},
{ {
label: 'Categoria', label: 'Categoria',
table: 'skills', table: 'skills',
@@ -456,6 +444,18 @@ export default defineComponent({
*/ */
{
label: 'Stato',
table: 'statusSkills',
key: 'idStatusSkill',
value: 0,
arrvalue: tools.getCookie(tools.COOK_SEARCH + 'statusSkills', []),
type: costanti.FieldType.multiselect,
filter: null,
useinput: false,
icon: 'mood',
filteradv: true,
},
{ {
label: 'In cambio di', label: 'In cambio di',
table: 'contribtypes', table: 'contribtypes',
@@ -490,7 +490,7 @@ export default defineComponent({
] ]
searchList_Events.value = [ searchList_Events.value = [
{ /*{
label: 'Stato', label: 'Stato',
table: 'statusSkills', table: 'statusSkills',
key: 'idStatusSkill', key: 'idStatusSkill',
@@ -501,7 +501,7 @@ export default defineComponent({
useinput: false, useinput: false,
icon: 'mood', icon: 'mood',
filteradv: false, filteradv: false,
}, },*/
{ {
label: 'Regione', label: 'Regione',
table: 'regions', table: 'regions',
@@ -540,7 +540,7 @@ export default defineComponent({
// param1: shared_consts.PARAM_SHOW_PROVINCE, // param1: shared_consts.PARAM_SHOW_PROVINCE,
tablesel: 'cities', tablesel: 'cities',
}, },
{ /*{
label: 'Visiblità', label: 'Visiblità',
table: 'pub_to_share', table: 'pub_to_share',
key: 'pub_to_share', key: 'pub_to_share',
@@ -551,7 +551,7 @@ export default defineComponent({
useinput: true, useinput: true,
filter: null, filter: null,
tablesel: 'pub_to_share', tablesel: 'pub_to_share',
}, },*/
{ {
label: 'Data Inizio', label: 'Data Inizio',
table: 'caldate', table: 'caldate',
@@ -736,7 +736,7 @@ export default defineComponent({
// param1: shared_consts.PARAM_SHOW_PROVINCE, // param1: shared_consts.PARAM_SHOW_PROVINCE,
tablesel: 'cities', tablesel: 'cities',
}, },
{ /*{
label: 'Visiblità', label: 'Visiblità',
table: 'pub_to_share', table: 'pub_to_share',
key: 'pub_to_share', key: 'pub_to_share',
@@ -747,7 +747,7 @@ export default defineComponent({
useinput: true, useinput: true,
filter: null, filter: null,
tablesel: 'pub_to_share', tablesel: 'pub_to_share',
}, },*/
{ {
label: 'Offro/Cerco', label: 'Offro/Cerco',
table: 'adtypes', table: 'adtypes',

View File

@@ -20,6 +20,7 @@ import { lists } from '@store/Modules/lists'
import { IParamsQuery } from 'model' import { IParamsQuery } from 'model'
import { CMyPopupEdit } from '../CMyPopupEdit' import { CMyPopupEdit } from '../CMyPopupEdit'
import { CMyFriends } from '../CMyFriends' import { CMyFriends } from '../CMyFriends'
import { CNotifSettings } from '../CNotifSettings'
import { CMyUser } from '../CMyUser' import { CMyUser } from '../CMyUser'
import { CMyGroups } from '../CMyGroups' import { CMyGroups } from '../CMyGroups'
import { CMyFieldDb } from '../CMyFieldDb' import { CMyFieldDb } from '../CMyFieldDb'
@@ -293,7 +294,7 @@ export default defineComponent({
components: { components: {
CMyPopupEdit, CTitleBanner, CMyFieldDb, CMySelect, CMyFriends, CMyGroups, CMyPopupEdit, CTitleBanner, CMyFieldDb, CMySelect, CMyFriends, CMyGroups,
CMyUser, CMyRecCard, CMyCardPopup, CMyRecGrpCard, CMyCardGrpPopup, CMyCardCircuitPopup, CMyUser, CMyRecCard, CMyCardPopup, CMyRecGrpCard, CMyCardGrpPopup, CMyCardCircuitPopup,
CMyRecCircuitCard, CMyCardService CMyRecCircuitCard, CMyCardService, CNotifSettings
}, },
setup(props, { emit }) { setup(props, { emit }) {
const $q = useQuasar() const $q = useQuasar()
@@ -312,6 +313,7 @@ export default defineComponent({
const newRecord: any = ref({}) const newRecord: any = ref({})
const recSaved: any = ref({}) const recSaved: any = ref({})
const recModif: any = ref({}) const recModif: any = ref({})
const showInnerDialog: any = ref(false)
const mytable = ref('') const mytable = ref('')
const mytitle = ref('') const mytitle = ref('')
@@ -321,6 +323,7 @@ export default defineComponent({
const tablesel = ref('') const tablesel = ref('')
const showSpin = ref(false) const showSpin = ref(false)
const showNotification = ref(false)
const loading = ref(false) const loading = ref(false)
const editOn = computed({ const editOn = computed({
@@ -387,6 +390,11 @@ export default defineComponent({
// console.log('valoriopt', item.table) // console.log('valoriopt', item.table)
return globalStore.getTableJoinByName(item.table, addall, addnone, item.filter) return globalStore.getTableJoinByName(item.table, addall, addnone, item.filter)
}) })
const lengthopt = computed(() => (item: any, addall: boolean, addnone: boolean) => {
// console.log('valoriopt', item.table)
const valori = globalStore.getTableJoinByName(item.table, addall, addnone, item.filter)
return (valori ? valori.length : 0)
})
const labelcombo = computed(() => (item: any) => { const labelcombo = computed(() => (item: any) => {
let lab = item.label let lab = item.label
@@ -2150,6 +2158,7 @@ export default defineComponent({
} }
function onLoadScroll(index: number, done: any) { function onLoadScroll(index: number, done: any) {
if (index > 1) { if (index > 1) {
// console.log('onLoadScroll', index, 'RECLOAD', numRecLoaded.value, 'ROWS: ', pagination.value.rowsNumber, 'PAGE: ', pagination.value.page) // console.log('onLoadScroll', index, 'RECLOAD', numRecLoaded.value, 'ROWS: ', pagination.value.rowsNumber, 'PAGE: ', pagination.value.page)
if (numRecLoaded.value < pagination.value.rowsNumber || (pagination.value.rowsNumber <= 0 && clickbuttsearch.value)) { if (numRecLoaded.value < pagination.value.rowsNumber || (pagination.value.rowsNumber <= 0 && clickbuttsearch.value)) {
@@ -2228,9 +2237,9 @@ export default defineComponent({
} }
} }
function showNotification() { /*function showNotification() {
$router.push('/notifs') $router.push('/notifs')
} } */
created() created()
mounted() mounted()
@@ -2333,6 +2342,8 @@ export default defineComponent({
ordinam_desc, ordinam_desc,
getNumFilterSelected, getNumFilterSelected,
rowsel, rowsel,
showInnerDialog,
lengthopt,
} }
} }
}) })

View File

@@ -87,8 +87,9 @@
<CMySelect <CMySelect
:col="fieldsTable.getColByColumns(mycolumns, item.key)" :col="fieldsTable.getColByColumns(mycolumns, item.key)"
v-if=" v-if="
item.type === costanti.FieldType.select || (item.type === costanti.FieldType.select ||
item.type === costanti.FieldType.select_by_server item.type === costanti.FieldType.select_by_server)
&& lengthopt(item, false) > 1
" "
:label="labelcombo(item)" :label="labelcombo(item)"
v-model:value="item.value" v-model:value="item.value"
@@ -122,7 +123,7 @@
</div>--> </div>-->
<CMySelect <CMySelect
v-if="item.type === costanti.FieldType.multiselect_by_server" v-if="item.type === costanti.FieldType.multiselect_by_server && lengthopt(item, false) > 1"
:col="fieldsTable.getColByColumns(mycolumns, item.key)" :col="fieldsTable.getColByColumns(mycolumns, item.key)"
:multiselect_by_server="true" :multiselect_by_server="true"
:label="labelcombo(item)" :label="labelcombo(item)"
@@ -229,6 +230,33 @@
v-if="prop_search || canEdit" v-if="prop_search || canEdit"
class="row justify-center vertical-middle" class="row justify-center vertical-middle"
> >
<div class="row justify-around q-mb-sm">
<div v-if="searchList && finder">
<q-btn
dense
label="Filtra Ricerca"
color="positive"
icon="fas fa-filter"
@click="showfilter = !showfilter"
><q-badge
v-if="getNumFilterSelected()"
color="red"
floating
transparent
>
{{ getNumFilterSelected() }}
</q-badge>
</q-btn>
<q-btn
dense
color="orange"
icon="fas fa-bell"
label="Avvisami se..."
@click="showNotification = !showNotification"
></q-btn>
</div>
</div>
<div v-if="prop_search" class="q-mr-sm full-width"> <div v-if="prop_search" class="q-mr-sm full-width">
<q-input <q-input
v-model="search" v-model="search"
@@ -243,29 +271,6 @@
<template v-slot:prepend> <template v-slot:prepend>
<q-icon name="search" /> <q-icon name="search" />
</template> </template>
<template v-if="searchList && finder" v-slot:before>
<q-btn
dense
color="positive"
icon="fas fa-filter"
@click="showfilter = !showfilter"
><q-badge
v-if="getNumFilterSelected()"
color="red"
floating
transparent
>
{{ getNumFilterSelected() }}
</q-badge>
</q-btn>
<q-btn
dense
color="orange"
icon="fas fa-bell"
@click="showNotification"
></q-btn>
</template>
<template v-slot:after> <template v-slot:after>
<q-select <q-select
v-if="prop_SortFieldsAvailable.length > 0" v-if="prop_SortFieldsAvailable.length > 0"
@@ -376,7 +381,9 @@
<div v-if="row && shared_consts.TABLES_WITH_DATE.includes(tablesel)"> <div v-if="row && shared_consts.TABLES_WITH_DATE.includes(tablesel)">
<div <div
v-if=" v-if="
actmonth !== tools.getstrMonth(row.dateTimeStart) || !actmonth || index === 0 actmonth !== tools.getstrMonth(row.dateTimeStart) ||
!actmonth ||
index === 0
" "
> >
<span style="display: none">{{ <span style="display: none">{{
@@ -393,10 +400,11 @@
</div> </div>
<div <div
v-if="false && v-if="
false &&
((row.dateTimeStart && ((row.dateTimeStart &&
tools.getstrVeryShortDate(row.dateTimeStart) !== actual) || tools.getstrVeryShortDate(row.dateTimeStart) !== actual) ||
index === 0) index === 0)
" "
class="actualdate" class="actualdate"
> >
@@ -457,6 +465,7 @@
? tools.getLabelFooterByRow(row, col_footer, tablesel) ? tools.getLabelFooterByRow(row, col_footer, tablesel)
: '' : ''
" "
@showInnerDialog="showInnerDialog"
> >
</CMyUser> </CMyUser>
@@ -1404,7 +1413,22 @@
</q-dialog> </q-dialog>
<span v-if="!hidetitleIfEmpty"> <br /></span> <span v-if="!hidetitleIfEmpty"> <br /></span>
</div> </div>
<q-dialog v-model="showNotification" :maximized="$q.screen.lt.sm">
<q-card class="dialog_card">
<q-toolbar class="bg-primary text-white">
<q-toolbar-title>
Notifiche
</q-toolbar-title>
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
</q-toolbar>
<q-card-section class="inset-shadow">
<CNotifSettings> </CNotifSettings>
</q-card-section>
</q-card>
</q-dialog>
</template> </template>
<script lang="ts" src="./CGridTableRec.ts"> <script lang="ts" src="./CGridTableRec.ts">
</script> </script>

View File

@@ -15,7 +15,7 @@ import { useCircuitStore } from '@store/CircuitStore'
export default defineComponent({ export default defineComponent({
name: 'CMyUser', name: 'CMyUser',
components: { CSendCoins, CSaldo, CUserInfoAccount }, components: { CSendCoins, CSaldo, CUserInfoAccount },
emits: ['setCmd'], emits: ['setCmd', 'showInnerDialog'],
props: { props: {
mycontact: { mycontact: {
type: Object as PropType<IUserFields | null>, type: Object as PropType<IUserFields | null>,
@@ -111,6 +111,11 @@ export default defineComponent({
} }
} }
function showsendCoin(value: boolean) {
showsendCoinTo.value = value
emit('showInnerDialog', showsendCoinTo.value)
}
onMounted(mounted) onMounted(mounted)
return { return {
@@ -125,6 +130,7 @@ export default defineComponent({
circuit, circuit,
showAccountInfo, showAccountInfo,
showsendCoinTo, showsendCoinTo,
showsendCoin,
} }
}, },
}) })

View File

@@ -391,6 +391,17 @@
<q-menu> <q-menu>
<q-list v-if="true" style="min-width: 150px"> <q-list v-if="true" style="min-width: 150px">
<q-item <q-item
clickable
v-close-popup
dense
@click="naviga(`/my/` + contact.username)"
>
<q-item-section avatar>
<q-icon color="primary" name="fas fa-user" />
</q-item-section>
<q-item-section>{{ $t('shared.profile') }}</q-item-section>
</q-item>
<!--<q-item
v-if=" v-if="
userStore.showButtonSendCoin(contact) && userStore.showButtonSendCoin(contact) &&
(contact.username !== userStore.my.username || (contact.username !== userStore.my.username ||
@@ -400,13 +411,13 @@
clickable clickable
v-close-popup v-close-popup
dense dense
@click="showsendCoinTo = true" @click="showsendCoin(true)"
> >
<q-item-section avatar> <q-item-section avatar>
<q-icon color="positive" name="fas fa-coins" /> <q-icon color="positive" name="fas fa-coins" />
</q-item-section> </q-item-section>
<q-item-section>{{ $t('circuit.sendcoins') }}</q-item-section> <q-item-section>{{ $t('circuit.sendcoins') }}</q-item-section>
</q-item> </q-item>-->
<q-item <q-item
clickable clickable
v-close-popup v-close-popup
@@ -776,7 +787,7 @@
> >
<q-menu> <q-menu>
<q-list style="min-width: 200px"> <q-list style="min-width: 200px">
<q-item <!--<q-item
v-if=" v-if="
userStore.showButtonSendCoin(contact) && userStore.showButtonSendCoin(contact) &&
(contact.username !== userStore.my.username || (contact.username !== userStore.my.username ||
@@ -786,13 +797,25 @@
clickable clickable
v-close-popup v-close-popup
dense dense
@click="showsendCoinTo = true" @click="showsendCoin(true)"
> >
<q-item-section avatar> <q-item-section avatar>
<q-icon color="positive" name="fas fa-coins" /> <q-icon color="positive" name="fas fa-coins" />
</q-item-section> </q-item-section>
<q-item-section>{{ $t('circuit.sendcoins') }}</q-item-section> <q-item-section>{{ $t('circuit.sendcoins') }}</q-item-section>
</q-item>-->
<q-item
clickable
v-close-popup
dense
@click="naviga(`/my/` + contact.username)"
>
<q-item-section avatar>
<q-icon color="primary" name="fas fa-user" />
</q-item-section>
<q-item-section>{{ $t('shared.profile') }}</q-item-section>
</q-item> </q-item>
<q-item <q-item
v-if=" v-if="
costanti.ENABLE_FRIENDS && costanti.ENABLE_FRIENDS &&
@@ -979,12 +1002,13 @@
</q-item-section> </q-item-section>
</q-item> </q-item>
</div> </div>
<div v-if="showsendCoinTo && contact"> <div v-if="contact">
<CSendCoins <CSendCoins
v-if="showsendCoinTo"
:showprop="showsendCoinTo" :showprop="showsendCoinTo"
:to_user="contact" :to_user="contact"
:circuitname="circuitname" :circuitname="circuitname"
@close="showsendCoinTo = false" @close="showsendCoin(false)"
> >
</CSendCoins> </CSendCoins>
</div> </div>

View File

@@ -35,21 +35,21 @@
<div <div
v-if="tools.isBitActive(getnotifbydir(shared_consts.TypeNotifs.TYPEDIR_BACHECA), shared_consts.UsersNotif.NEW_ADV_SECTOR)"> v-if="tools.isBitActive(getnotifbydir(shared_consts.TypeNotifs.TYPEDIR_BACHECA), shared_consts.UsersNotif.NEW_ADV_SECTOR)">
<CMyFieldDb <CMyFieldDb
:title="$t('sectors.sector_general')" :title="$t('sectors.sector_goods_select')"
table="users"
mykey="profile"
mysubkey="notif_sectors"
:jointable="toolsext.TABSECTORS"
:type="costanti.FieldType.multiselect">
</CMyFieldDb>
<CMyFieldDb
:title="$t('sectors.sector_goods')"
table="users" table="users"
mykey="profile" mykey="profile"
mysubkey="notif_sector_goods" mysubkey="notif_sector_goods"
:jointable="toolsext.TABSECTORGOODS" :jointable="toolsext.TABSECTORGOODS"
:type="costanti.FieldType.multiselect"> :type="costanti.FieldType.multiselect">
</CMyFieldDb> </CMyFieldDb>
<CMyFieldDb
:title="$t('sectors.sector_select')"
table="users"
mykey="profile"
mysubkey="notif_sectors"
:jointable="toolsext.TABSECTORS"
:type="costanti.FieldType.multiselect">
</CMyFieldDb>
</div> </div>
<div <div
v-if="tools.isBitActive(getnotifbydir(shared_consts.TypeNotifs.TYPEDIR_BACHECA), shared_consts.UsersNotif.NEW_ADV_REGION)"> v-if="tools.isBitActive(getnotifbydir(shared_consts.TypeNotifs.TYPEDIR_BACHECA), shared_consts.UsersNotif.NEW_ADV_REGION)">

View File

@@ -240,7 +240,7 @@ export default defineComponent({
} }
} }
function mounted() { async function mounted() {
arrTypesAccounts.value = [ arrTypesAccounts.value = [
{ {
@@ -259,13 +259,13 @@ export default defineComponent({
} else { } else {
circuitsel.value = tools.getCookie(tools.CIRCUIT_USE, bothcircuits.value[0]) circuitsel.value = tools.getCookie(tools.CIRCUIT_USE, bothcircuits.value[0])
} }
if (!userStore.IsMyCircuitByName(circuitsel.value)) { if (bothcircuits.value && bothcircuits.value.find((name: any) => name !== circuitsel.value)) {
circuitsel.value = bothcircuits.value[0] circuitsel.value = bothcircuits.value[0]
} }
qty.value = props.qtydefault qty.value = props.qtydefault
aggiorna() await aggiorna()
showpage.value = true showpage.value = true
} }
@@ -283,7 +283,7 @@ export default defineComponent({
circuitsel.value = bothcircuits.value[0] circuitsel.value = bothcircuits.value[0]
} }
aggiorna() await aggiorna()
showpage.value = true showpage.value = true
} }
@@ -296,7 +296,7 @@ export default defineComponent({
circuitsel.value = bothcircuits.value[0] circuitsel.value = bothcircuits.value[0]
} }
aggiorna() await aggiorna()
showpage.value = true showpage.value = true
} }

View File

@@ -1,207 +1,205 @@
<template> <template>
<q-dialog <q-dialog
v-model="showpage" v-model="showpage"
:maximized="$q.screen.lt.sm" :maximized="$q.screen.lt.sm"
@hide="hide" @hide="hide"
@show="qtyRef ? qtyRef.focus() : ''" @show="qtyRef ? qtyRef.focus() : ''"
> >
<q-card class="dialog_card"> <q-card class="dialog_card">
<q-bar class="bg-primary text-white"> <q-bar class="bg-primary text-white">
{{ $t('circuit.sendcoins') }} {{ $t('circuit.sendcoins') }}
<q-space /> <q-space />
<q-btn flat round color="white" icon="close" v-close-popup></q-btn> <q-btn flat round color="white" icon="close" v-close-popup></q-btn>
</q-bar> </q-bar>
<q-card-section class="q-px-xs inset-shadow"> <q-card-section class="q-px-xs inset-shadow">
<q-select <q-select
v-if="!circuitname" v-if="!circuitname"
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'" :behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
rounded rounded
dense dense
outlined outlined
v-model="circuitsel" v-model="circuitsel"
:options="bothcircuits" :options="bothcircuits"
label="Circuito" label="Circuito"
> >
</q-select> </q-select>
<div v-else>{{ circuitname }}</div> <div v-else>{{ circuitname }}</div>
<q-banner <q-banner
v-if="showProvinceToSelect" v-if="showProvinceToSelect"
rounded
class="bg-red text-white"
style="text-align: center"
>
<em style="font-weight: bold">{{
$t('circuit.insertprovince_text')
}}</em
><br />
</q-banner>
<q-banner
rounded
dense
class="shadow-5 q-my-sm"
color="primary q-title"
style="text-align: center"
>
<div class="mybanner_left bg-blue text-white q-mb-sm">
{{ $t('circuit.sender') }}:
</div>
<div>
<q-btn-toggle
v-if="arrTypesAccounts.length > 0"
v-model="tipoConto"
class="my-custom-toggle"
no-caps
rounded rounded
class="bg-red text-white" unelevated
style="text-align: center" toggle-color="primary"
color="white"
text-color="primary"
:options="arrTypesAccounts"
/>
</div>
<q-input
v-if="tipoConto === costanti.AccountType.USER"
v-model="from_username"
class="full-width"
readonly
>
</q-input>
<div
v-else-if="tipoConto === costanti.AccountType.COLLECTIVE_ACCOUNT"
>
<q-select
v-model="from_groupname"
:options="arrGroupsList"
:label="$t('circuit.choosecontocom')"
rounded
emit-value
map-options
> >
<em style="font-weight: bold">{{ <!-- Mostra i gruppi su cui sei Admin -->
$t('circuit.insertprovince_text') </q-select>
}}</em </div>
><br /> <div v-else-if="tipoConto === costanti.AccountType.COMMUNITY_ACCOUNT">
</q-banner> <q-input
v-model="from_contocom"
:label="$t('circuit.contocom')"
readonly
class="q-my-sm"
>
</q-input>
</div>
<CSaldo
v-if="circuitloaded && circuitloaded.symbol"
:symbol="circuitloaded.symbol"
:color="circuitloaded.color"
:saldo="accountloaded ? accountloaded.saldo : 0"
:qtarem="
accountloaded
? circuitStore.getRemainingCoinsToSend(accountloaded)
: 0
"
>
</CSaldo>
</q-banner>
<q-banner
rounded
dense
class="shadow-5 q-my-sm"
color="primary q-title"
>
<div class="mybanner_left bg-green text-white q-mb-sm">
{{ $t('circuit.dest') }}
</div>
<!-- Destination -->
<CMyUserOnlyView
v-if="to_user"
:mycontact="to_user"
:visu="costanti.FIND_PEOPLE"
@setCmd="tools.setCmd"
>
</CMyUserOnlyView>
<CMyGroupOnlyView
v-if="to_group"
:mygrp="to_group"
:visu="costanti.USER_GROUPS"
:circuitname="circuitloaded.name"
>
</CMyGroupOnlyView>
<CMyGroupOnlyView
v-if="circuitloaded && to_contocom"
:mygrp="{ groupname: to_contocom }"
:visu="costanti.USER_GROUPS"
:circuitname="circuitloaded.name"
>
</CMyGroupOnlyView>
</q-banner>
<q-inner-loading id="spinner" :showing="loading">
<q-spinner-tail size="6em" color="primary" />
</q-inner-loading>
<div v-if="circuitloaded">
<q-banner <q-banner
v-if="!circuitloaded.transactionsEnabled"
rounded rounded
dense class="bg-red text-white"
class="shadow-5 q-my-sm"
color="primary q-title"
style="text-align: center" style="text-align: center"
> >
<div class="mybanner_left bg-blue text-white q-mb-sm"> <em style="font-weight: bold">{{
{{ $t('circuit.sender') }}: $t('circuit.transactionsEnabled_text')
</div> }}</em
<div> ><br />
<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>
<q-input
v-if="tipoConto === costanti.AccountType.USER"
v-model="from_username"
class="full-width"
readonly
>
</q-input>
<div
v-else-if="tipoConto === costanti.AccountType.COLLECTIVE_ACCOUNT"
>
<q-select
v-model="from_groupname"
:options="arrGroupsList"
:label="$t('circuit.choosecontocom')"
rounded
emit-value
map-options
>
<!-- Mostra i gruppi su cui sei Admin -->
</q-select>
</div>
<div
v-else-if="tipoConto === costanti.AccountType.COMMUNITY_ACCOUNT"
>
<q-input
v-model="from_contocom"
:label="$t('circuit.contocom')"
readonly
class="q-my-sm"
>
</q-input>
</div>
<CSaldo
v-if="circuitloaded && circuitloaded.symbol"
:symbol="circuitloaded.symbol"
:color="circuitloaded.color"
:saldo="accountloaded ? accountloaded.saldo : 0"
:qtarem="
accountloaded
? circuitStore.getRemainingCoinsToSend(accountloaded)
: 0
"
>
</CSaldo>
</q-banner> </q-banner>
<q-banner <q-input
rounded ref="qtyRef"
dense class="q-py-sm text-h5"
class="shadow-5 q-my-sm" outlined
color="primary q-title" v-model="qty"
type="number"
:rules="[
(val) =>
val <= circuitStore.getRemainingCoinsToSend(accountloaded) ||
t('circuit.qta_remaining_to_send', {
maxqta: circuitStore.getRemainingCoinsToSend(accountloaded),
symbol: circuitloaded.symbol,
}),
(val) => val > 0 || t('circuit.qta_not_valid'),
]"
:label="
t('movement.amount_to_send', {
qtamax: circuitStore.getRemainingCoinsToSend(accountloaded)
? circuitStore
.getRemainingCoinsToSend(accountloaded)
.toFixed(2)
: 0 + ` ` + circuitloaded.symbol,
})
"
input-class="text-right"
v-on:keyup.enter="$event.target.nextElementSibling.focus()"
> >
<div class="mybanner_left bg-green text-white q-mb-sm"> <!--val => val > circuitStore.getMaxCoinsToSend(accountloaded) || t('circuit.qta_max_to_send', { maxqta: tools.getRemainingCoinsToSend(accountloaded), symbol: circuitloaded.symbol })]" -->
{{ $t('circuit.dest') }} <template v-slot:append>
</div> <div class="text-h5">
<em
class="q-px-sm text-white rounded-borders"
:style="
`background-color: ` +
(circuitloaded.color ? circuitloaded.color : '#ff5500')
"
>{{ circuitloaded.symbol }}</em
>
</div>
</template>
</q-input>
<!-- Destination --> <!--<q-slider
<CMyUserOnlyView
v-if="to_user"
:mycontact="to_user"
:visu="costanti.FIND_PEOPLE"
@setCmd="tools.setCmd"
>
</CMyUserOnlyView>
<CMyGroupOnlyView
v-if="to_group"
:mygrp="to_group"
:visu="costanti.USER_GROUPS"
:circuitname="circuitloaded.name"
>
</CMyGroupOnlyView>
<CMyGroupOnlyView
v-if="circuitloaded && to_contocom"
:mygrp="{ groupname: to_contocom }"
:visu="costanti.USER_GROUPS"
:circuitname="circuitloaded.name"
>
</CMyGroupOnlyView>
</q-banner>
<q-inner-loading id="spinner" :showing="loading">
<q-spinner-tail size="6em" color="primary" />
</q-inner-loading>
<div v-if="circuitloaded">
<q-banner
v-if="!circuitloaded.transactionsEnabled"
rounded
class="bg-red text-white"
style="text-align: center"
>
<em style="font-weight: bold">{{
$t('circuit.transactionsEnabled_text')
}}</em
><br />
</q-banner>
<q-input
ref="qtyRef"
class="q-py-sm text-h5"
outlined
v-model="qty"
type="number"
:rules="[
(val) =>
val <= circuitStore.getRemainingCoinsToSend(accountloaded) ||
t('circuit.qta_remaining_to_send', {
maxqta: circuitStore.getRemainingCoinsToSend(accountloaded),
symbol: circuitloaded.symbol,
}),
(val) => val > 0 || t('circuit.qta_not_valid'),
]"
:label="
t('movement.amount_to_send', {
qtamax: circuitStore.getRemainingCoinsToSend(accountloaded)
? circuitStore
.getRemainingCoinsToSend(accountloaded)
.toFixed(2)
: 0 + ` ` + circuitloaded.symbol,
})
"
input-class="text-right"
v-on:keyup.enter="$event.target.nextElementSibling.focus()"
>
<!--val => val > circuitStore.getMaxCoinsToSend(accountloaded) || t('circuit.qta_max_to_send', { maxqta: tools.getRemainingCoinsToSend(accountloaded), symbol: circuitloaded.symbol })]" -->
<template v-slot:append>
<div class="text-h5">
<em
class="q-px-sm text-white rounded-borders"
:style="
`background-color: ` +
(circuitloaded.color ? circuitloaded.color : '#ff5500')
"
>{{ circuitloaded.symbol }}</em
>
</div>
</template>
</q-input>
<!--<q-slider
class="q-ma-xs" class="q-ma-xs"
v-if=" v-if="
qty !== '' && qty !== '' &&
@@ -221,61 +219,62 @@
:min="0" :min="0"
:max="Number(maxsendable ? maxsendable : 0)" :max="Number(maxsendable ? maxsendable : 0)"
/> />
--></div> -->
</div>
<q-input <q-input
ref="causalRef" ref="causalRef"
v-model="causal" v-model="causal"
:label="$t('circuit.note')" :label="$t('circuit.note')"
class="q-my-sm full-width" class="q-my-sm full-width"
> >
</q-input> </q-input>
</q-card-section> </q-card-section>
<q-card-actions align="center"> <q-card-actions align="center">
<q-btn <q-btn
v-if=" v-if="
circuitloaded && circuitloaded &&
(qtyRef (qtyRef
? !( ? !(
qtyRef.hasError || qtyRef.hasError ||
!circuitloaded.transactionsEnabled || !circuitloaded.transactionsEnabled ||
(tipoConto === costanti.AccountType.USER && (tipoConto === costanti.AccountType.USER &&
to_user && to_user &&
from_username === to_user.username) || from_username === to_user.username) ||
(tipoConto === costanti.AccountType.COLLECTIVE_ACCOUNT && (tipoConto === costanti.AccountType.COLLECTIVE_ACCOUNT &&
!from_groupname) || !from_groupname) ||
(tipoConto === costanti.AccountType.COLLECTIVE_ACCOUT && (tipoConto === costanti.AccountType.COLLECTIVE_ACCOUT &&
to_group && to_group &&
from_groupname && from_groupname &&
to_group.groupname === from_groupname) || to_group.groupname === from_groupname) ||
(tipoConto === costanti.AccountType.COMMUNITY_ACCOUNT && (tipoConto === costanti.AccountType.COMMUNITY_ACCOUNT &&
!from_contocom) !from_contocom)
) )
: true) : true)
" "
:label=" :label="
$t('circuit.sendcoinsto', { $t('circuit.sendcoinsto', {
qty, qty,
coin: circuitloaded.symbol, coin: circuitloaded.symbol,
dest: to_group dest: to_group
? to_group.groupname ? to_group.groupname
: to_user : to_user
? tools.getNomeUtenteByRecUser(to_user) ? tools.getNomeUtenteByRecUser(to_user)
: to_contocom, : to_contocom,
}) })
" "
color="positive" color="positive"
@click="sendCoin()" @click="sendCoin()"
></q-btn> ></q-btn>
<q-btn <q-btn
flat flat
:label="$t('dialog.cancel')" :label="$t('dialog.cancel')"
color="primary" color="primary"
v-close-popup v-close-popup
></q-btn> ></q-btn>
</q-card-actions> </q-card-actions>
</q-card> </q-card>
</q-dialog> </q-dialog>
</template> </template>
<script lang="ts" src="./CSendCoins.ts"> <script lang="ts" src="./CSendCoins.ts">

View File

@@ -867,7 +867,7 @@ const msg_it = {
}, },
typenotifs: { typenotifs: {
new_rec_bacheca: 'Annunci', new_rec_bacheca: 'Annunci',
new_rec_bacheca_descr: 'Avvisami se:', new_rec_bacheca_descr: 'Avvisami quando viene aggiunto un Annuncio:',
friends: 'Richieste di Amicizia', friends: 'Richieste di Amicizia',
groups: 'Gruppi', groups: 'Gruppi',
friends_descr: 'Avvisami se:', friends_descr: 'Avvisami se:',
@@ -1050,7 +1050,9 @@ const msg_it = {
sectors: { sectors: {
name: 'Settore', name: 'Settore',
sector_general: 'Settori', sector_general: 'Settori',
sector_select: 'Scegli i Settori Preferiti',
sector_goods: 'Settori dei Beni', sector_goods: 'Settori dei Beni',
sector_goods_select: 'Scegli i Settori Preferiti dei Beni',
}, },
catgrps: { catgrps: {
name: 'Categoria', name: 'Categoria',
@@ -1136,6 +1138,7 @@ const msg_it = {
subscribes: 'Membri', subscribes: 'Membri',
cancel_ask: 'Annulla la richiesta', cancel_ask: 'Annulla la richiesta',
refuse_ask: 'Rifiuta la richiesta', refuse_ask: 'Rifiuta la richiesta',
profile: 'Apri Profilo',
cancel_ask_short: 'Annulla richiesta', cancel_ask_short: 'Annulla richiesta',
refuse_ask_short: 'Rifiuta la richiesta', refuse_ask_short: 'Rifiuta la richiesta',
member: 'membro', member: 'membro',

View File

@@ -86,6 +86,8 @@ export default defineComponent({
const cities = ref([] as ICity[]) const cities = ref([] as ICity[])
const fidoConcesso = computed(() => account.value ? account.value.fidoConcesso : circuit.value!.fido_scoperto_default)
const qtaMax = computed(() => account.value ? account.value.qta_maxConcessa : circuit.value!.qta_max_default)
watch(() => path.value, (to: any, from: any) => { watch(() => path.value, (to: any, from: any) => {
loadCircuit() loadCircuit()
@@ -496,6 +498,8 @@ export default defineComponent({
extraparams_rich_groups, extraparams_rich_groups,
extraparams_refused_groups, extraparams_refused_groups,
getRegulation, getRegulation,
fidoConcesso,
qtaMax,
} }
} }
}) })

File diff suppressed because it is too large Load Diff