Lista Città (prese dal server: pickup)

This commit is contained in:
paoloar77
2022-01-20 00:38:49 +01:00
parent 2d3eff1065
commit d442aa75e8
35 changed files with 1427 additions and 143 deletions

View File

@@ -105,6 +105,19 @@ const routes_admin: IListRoutes[] = [
inmenu: true, inmenu: true,
submenu: true, submenu: true,
onlyAdmin: true onlyAdmin: true
},
{
active: true,
order: 1040,
path: '/admin/importfile',
materialIcon: 'event_seat',
name: 'otherpages.manage.importfile',
component: () => import('@/rootgen/admin/importdata/importdata.vue'),
level_parent: 0.0,
level_child: 0.5,
inmenu: true,
submenu: true,
onlyAdmin: true
} }
] ]

View File

@@ -45,6 +45,12 @@ module.exports = {
Outcoming: 2, Outcoming: 2,
}, },
Cmd: {
PROVINCE: 1,
COMUNI: 2,
CITIES_SERVER: 3,
},
WalletFinalStatusType: { WalletFinalStatusType: {
None: 0, None: 0,
InCommonCash: 1, InCommonCash: 1,

View File

@@ -60,6 +60,7 @@ export const shared_consts = {
TAB_COUNTRY: 'countries', TAB_COUNTRY: 'countries',
TAB_CITIES: 'cities', TAB_CITIES: 'cities',
TAB_PHONES: 'phones', TAB_PHONES: 'phones',
TAB_SITES: 'sites',
TAB_SETTINGS: 'settings', TAB_SETTINGS: 'settings',
KEY_TO_CRYPTED: ['PWD_FROM'], KEY_TO_CRYPTED: ['PWD_FROM'],
@@ -72,6 +73,12 @@ export const shared_consts = {
Outcoming: 2, Outcoming: 2,
}, },
Cmd: {
PROVINCE: 1,
COMUNI: 2,
CITIES_SERVER: 3,
},
BOTTYPE_NONE: 0, BOTTYPE_NONE: 0,
BOTTYPE_PAGE: 1, BOTTYPE_PAGE: 1,
BOTTYPE_LINK: 2, BOTTYPE_LINK: 2,
@@ -102,6 +109,89 @@ export const shared_consts = {
VISIB_ONLY_ADMIN: 4, VISIB_ONLY_ADMIN: 4,
Regions: [
{
value: 'ABR',
label: 'Abruzzo',
},
{
value: 'BAS',
label: 'Basilicata',
},
{
value: 'CAL',
label: 'Calabria',
},
{
value: 'CAM',
label: 'Campania',
},
{
value: 'EMI',
label: 'Emilia-Romagna',
},
{
value: 'FRI',
label: 'Friuli Venezia Giulia',
},
{
value: 'LAZ',
label: 'Lazio',
},
{
value: 'LIG',
label: 'Liguria',
},
{
value: 'LOM',
label: 'Lombardia',
},
{
value: 'MAR',
label: 'Marche',
},
{
value: 'MOL',
label: 'Molise',
},
{
value: 'PIE',
label: 'Piemonte',
},
{
value: 'PUG',
label: 'Puglia',
},
{
value: 'SAR',
label: 'Sardegna',
},
{
value: 'SIC',
label: 'Sicilia',
},
{
value: 'TOS',
label: 'Toscana',
},
{
value: 'TRE',
label: 'Trentino-Alto Adige',
},
{
value: 'UMB',
label: 'Umbria',
},
{
value: 'VAL',
label: 'Valle d\'Aosta',
},
{
value: 'VEN',
label: 'Veneto',
},
],
Lang: [ Lang: [
{ {
value: 'it', value: 'it',

View File

@@ -51,6 +51,10 @@ export default defineComponent({
} }
} }
function getFilterCities(recSkill: any, index: number, arr: any) {
return true
}
function getFilterSubSkills(recSubSkill: any, index: number, arr: any) { function getFilterSubSkills(recSubSkill: any, index: number, arr: any) {
const recskills:any = searchList.value.find((rec) => rec.table === 'skills') const recskills:any = searchList.value.find((rec) => rec.table === 'skills')
// console.log('recSubSkill', recSubSkill, 'recskills', recskills) // console.log('recSubSkill', recSubSkill, 'recskills', recskills)
@@ -73,6 +77,7 @@ export default defineComponent({
filter: null, filter: null,
addall: true, addall: true,
notinsearch: true, notinsearch: true,
useinput: false,
}, },
{ {
label: 'Competenza', label: 'Competenza',
@@ -84,6 +89,7 @@ export default defineComponent({
addall: true, addall: true,
filter: getFilterSkills, filter: getFilterSkills,
showcount: true, showcount: true,
useinput: true,
}, },
{ {
label: 'Specializz.', label: 'Specializz.',
@@ -95,15 +101,28 @@ export default defineComponent({
addall: true, addall: true,
filter: getFilterSubSkills, filter: getFilterSubSkills,
showcount: true, showcount: true,
useinput: false,
},
{
label: 'Regione',
table: 'regions',
key: 'idReg',
value: 0,
type: costanti.FieldType.select,
arrvalue: tools.getCookie(tools.COOK_SEARCH + 'regions', [costanti.FILTER_TUTTI]),
filter: null,
useinput: true,
}, },
{ {
label: 'Citta', label: 'Citta',
table: 'cities', table: 'cities',
key: 'idCity', key: 'idCity',
type: costanti.FieldType.multiselect_by_server,
value: 0, value: 0,
type: costanti.FieldType.multiselect,
arrvalue: tools.getCookie(tools.COOK_SEARCH + 'cities', [costanti.FILTER_TUTTI]), arrvalue: tools.getCookie(tools.COOK_SEARCH + 'cities', [costanti.FILTER_TUTTI]),
filter: null, filter: null,
useinput: true,
tablesel: 'cities',
}, },
{ {
label: 'Livello', label: 'Livello',
@@ -113,6 +132,7 @@ export default defineComponent({
arrvalue: [], arrvalue: [],
type: costanti.FieldType.select, type: costanti.FieldType.select,
filter: null, filter: null,
useinput: false,
}, },
{ {
label: 'Stato', label: 'Stato',
@@ -122,6 +142,7 @@ export default defineComponent({
arrvalue: tools.getCookie(tools.COOK_SEARCH + 'statusSkills', [costanti.FILTER_TUTTI]), arrvalue: tools.getCookie(tools.COOK_SEARCH + 'statusSkills', [costanti.FILTER_TUTTI]),
type: costanti.FieldType.multiselect, type: costanti.FieldType.multiselect,
filter: null, filter: null,
useinput: false,
}, },
{ {
label: 'Contributo', label: 'Contributo',
@@ -131,6 +152,7 @@ export default defineComponent({
arrvalue: tools.getCookie(tools.COOK_SEARCH + 'contribtypes', [costanti.FILTER_TUTTI]), arrvalue: tools.getCookie(tools.COOK_SEARCH + 'contribtypes', [costanti.FILTER_TUTTI]),
type: costanti.FieldType.multiselect, type: costanti.FieldType.multiselect,
filter: null, filter: null,
useinput: false,
}, },
] ]
@@ -208,7 +230,10 @@ export default defineComponent({
userId: 1, userId: 1,
username: 1, username: 1,
name: 1, name: 1,
surname: 1 surname: 1,
comune: 1,
'profile.img': 1,
'profile.qualifica': 1,
} }
}, },
lookup3: { lookup3: {
@@ -225,6 +250,13 @@ export default defineComponent({
lk_as: 'myskill', lk_as: 'myskill',
af_objId_tab: '', af_objId_tab: '',
}, },
lookup5: {
lk_tab: 'cities',
lk_LF: 'idCity',
lk_FF: '_id',
lk_as: 'comune',
af_objId_tab: '',
},
} }
} }

View File

@@ -227,6 +227,8 @@ export default defineComponent({
const mycodeid = toRef(props, 'prop_codeId') const mycodeid = toRef(props, 'prop_codeId')
const myvertical = ref(0)
const valoriopt = computed(() => (item: any, addall: boolean) => { const valoriopt = computed(() => (item: any, addall: boolean) => {
// console.log('valoriopt', item.table) // console.log('valoriopt', item.table)
return globalStore.getTableJoinByName(item.table, addall, item.filter) return globalStore.getTableJoinByName(item.table, addall, item.filter)
@@ -730,8 +732,10 @@ export default defineComponent({
const mysub = elem.subfield ? elem.subfield : '' const mysub = elem.subfield ? elem.subfield : ''
if (elem) { if (elem) {
if (elem.field !== costanti.NOFIELD) { if (elem.field !== costanti.NOFIELD) {
if (checkIfColShow(elem.field)) {
colVisib.value.push(elem.field + mysub) colVisib.value.push(elem.field + mysub)
} }
}
if (elem.visible && elem.field === costanti.NOFIELD) { if (elem.visible && elem.field === costanti.NOFIELD) {
colExtra.value.push(elem.name) colExtra.value.push(elem.name)
@@ -792,6 +796,11 @@ export default defineComponent({
mycolumns.value = props.prop_mycolumns mycolumns.value = props.prop_mycolumns
colkey.value = props.prop_colkey colkey.value = props.prop_colkey
pagination.value = props.prop_pagination pagination.value = props.prop_pagination
myvertical.value = props.vertical ? -1 : 0
if (props.finder) {
myvertical.value = tools.getCookie('myv', 0)
}
} }
function mounted() { function mounted() {
@@ -799,10 +808,12 @@ export default defineComponent({
console.log('props.filtercustom', props.filtercustom) console.log('props.filtercustom', props.filtercustom)
if (!!props.tablesList) { if (!!props.tablesList) {
canEdit.value = tools.getCookie(tools.CAN_EDIT, canEdit) === 'true' canEdit.value = tools.getCookie(tools.CAN_EDIT, canEdit) === 'true'
tablesel.value = tools.getCookie('tablesel', tablesel.value) tablesel.value = tools.getCookie('tablesel', tablesel.value)
} }
myfilterand.value = props.filterdef myfilterand.value = props.filterdef
// myfiltercustom.value = props.filtercustom // myfiltercustom.value = props.filtercustom
// console.log('tablesel', tablesel) // console.log('tablesel', tablesel)
@@ -926,6 +937,16 @@ export default defineComponent({
} }
} }
function checkIfColShow(field: string|undefined) {
let vis = true
if (props.prop_mytable === 'myskills' && !props.prop_search) {
if (field === 'username') {
vis = false
}
}
return vis
}
function changeCol(newval: any) { function changeCol(newval: any) {
// console.log('changecol', mytable.value) // console.log('changecol', mytable.value)
if (!!mytable.value) { if (!!mytable.value) {
@@ -993,8 +1014,11 @@ export default defineComponent({
colVisib.value = myselcol.split('|') colVisib.value = myselcol.split('|')
} else { } else {
mycolumns.value.forEach((elem: any) => { mycolumns.value.forEach((elem: any) => {
if (elem.field !== costanti.NOFIELD) if (elem.field !== costanti.NOFIELD) {
if (checkIfColShow(elem.field)) {
colVisib.value.push(elem.field + elem.subfield) colVisib.value.push(elem.field + elem.subfield)
}
}
}) })
} }
} }
@@ -1163,7 +1187,6 @@ export default defineComponent({
return (rec._id > 0 && typeof rec._id === 'number') || rec._id !== 'number' return (rec._id > 0 && typeof rec._id === 'number') || rec._id !== 'number'
} }
// onMounted(mounted) // onMounted(mounted)
created() created()
@@ -1236,6 +1259,7 @@ export default defineComponent({
valoriopt, valoriopt,
labelcombo, labelcombo,
filter, filter,
myvertical,
} }
} }
}) })

View File

@@ -32,7 +32,7 @@
<q-spinner-tail size="2em" color="primary"/> <q-spinner-tail size="2em" color="primary"/>
</q-inner-loading> </q-inner-loading>
<q-table <q-table
:grid="vertical" :grid="myvertical === -1 || myvertical === 2"
flat flat
bordered bordered
class="my-sticky-header-table" class="my-sticky-header-table"
@@ -102,22 +102,46 @@
:class="$q.screen.lt.sm ? `` : `row` + ` text-blue`"> :class="$q.screen.lt.sm ? `` : `row` + ` text-blue`">
<span v-for="(item, index) in searchList" :key="index"> <span v-for="(item, index) in searchList" :key="index">
<CMySelect <CMySelect
v-if="item.type === costanti.FieldType.select" v-if="(item.type === costanti.FieldType.select) || (item.type === costanti.FieldType.select_by_server)"
:label="labelcombo(item)" :label="labelcombo(item)"
v-model:value="item.value" v-model:value="item.value"
@update:value="searchval(item.value, item.table)" @update:value="searchval(item.value, item.table)"
:addall="true" :addall="true"
:tablesel="item.type === costanti.FieldType.select_by_server ? item.tablesel : ''"
:pickup="item.type === costanti.FieldType.select_by_server"
label-color="primary" label-color="primary"
class="combowidth" class="combowidth"
color="primary" color="primary"
:optval="fieldsTable.getKeyByTable(item.table)" :optval="fieldsTable.getKeyByTable(item.table)"
:optlab="fieldsTable.getLabelByTable(item.table)" :optlab="fieldsTable.getLabelByTable(item.table)"
:options="valoriopt(item, false)" :options="valoriopt(item, false)"
:useinput="false"> :useinput="item.useinput && item.type !== costanti.FieldType.select_by_server">
</CMySelect>
<!--<div v-if="item.type === costanti.FieldType.multiselect_by_server">
item: {{ item}}
</div>-->
<CMySelect
v-if="item.type === costanti.FieldType.multiselect_by_server"
:multiselect_by_server="true"
:label="labelcombo(item)"
v-model:arrvalue="item.arrvalue"
@update:arrvalue="searchval(item.arrvalue, item.table)"
:addall="false"
:tablesel="item.tablesel"
:pickup="true"
label-color="primary"
class="combowidth"
color="primary"
:optval="fieldsTable.getKeyByTable(item.table)"
:optlab="fieldsTable.getLabelByTable(item.table)"
:options="valoriopt(item, false)"
:useinput="true">
</CMySelect> </CMySelect>
<q-select <q-select
v-if="item.type === costanti.FieldType.multiselect" v-if="(item.type === costanti.FieldType.multiselect)"
v-model="item.arrvalue" v-model="item.arrvalue"
label-color="primary" label-color="primary"
:label="labelcombo(item)" :label="labelcombo(item)"
@@ -130,6 +154,7 @@
emit-value emit-value
map-options map-options
stack-label stack-label
:useinput="item.useinput"
:options="valoriopt(item, item.addall)" :options="valoriopt(item, item.addall)"
class="combowidth" class="combowidth"
:option-value="fieldsTable.getKeyByTable(item.table)" :option-value="fieldsTable.getKeyByTable(item.table)"
@@ -202,7 +227,14 @@
</div> </div>
<div v-if="pagination.rowsNumber > 0 && prop_search">{{ pagination.rowsNumber }} elementi trovati</div> <div v-if="pagination.rowsNumber === 1 && prop_search">{{ pagination.rowsNumber }} elemento trovato</div>
<div v-if="pagination.rowsNumber > 1 && prop_search">{{ pagination.rowsNumber }} elementi trovati</div>
<div v-if="finder" class="">
<q-radio v-model="myvertical" :val="2" label="Lista" @update:model-value="tools.setCookie('myv', myvertical) "/>
<q-radio v-model="myvertical" :val="-1" label="Scheda" @update:model-value="tools.setCookie('myv', myvertical) "/>
<q-radio v-model="myvertical" :val="0" label="Tabella" @update:model-value="tools.setCookie('myv', myvertical) "/>
</div>
</template> </template>
<template v-slot:body="props"> <template v-slot:body="props">
@@ -251,7 +283,7 @@
<template v-slot:item="props"> <template v-slot:item="props">
<div v-if="showType === costanti.SHOW_USERINFO" class="fill-all-width"> <div v-if="(showType === costanti.SHOW_USERINFO) || (myvertical === 2)" class="fill-all-width">
<div> <div>
<CMyFriends <CMyFriends
v-model="filter" v-model="filter"
@@ -267,7 +299,7 @@
class="q-pa-xs col-xs-12 col-sm-6 col-md-4 col-lg-3 grid-style-transition" class="q-pa-xs col-xs-12 col-sm-6 col-md-4 col-lg-3 grid-style-transition"
:style="props.selected ? 'transform: scale(0.95);' : ''" :style="props.selected ? 'transform: scale(0.95);' : ''"
> >
<q-card :class="props.selected ? 'bg-grey-2' : ''"> <q-card :class="props.selected ? 'bg-grey-2' : ''" style="min-width: 200px;">
<q-bar dense class="bg-primary text-white"> <q-bar dense class="bg-primary text-white">
<span class="ellipsis"> {{ props.row[col_title] }} </span> <span class="ellipsis"> {{ props.row[col_title] }} </span>
<q-space/> <q-space/>
@@ -352,6 +384,7 @@
:mycol="mycol" :mycol="mycol"
:showall="true" :showall="true"
:row="rowclicksel" :row="rowclicksel"
:tablesel="col.tablesel"
:field="mycol.field" :field="mycol.field"
:subfield="mycol.subfield" :subfield="mycol.subfield"
@save="SaveValdb" @save="SaveValdb"
@@ -378,7 +411,6 @@
<div <div
v-if="colVisib.includes(col.field + col.subfield) && col.foredit"> v-if="colVisib.includes(col.field + col.subfield) && col.foredit">
<div class=""> <div class="">
<CMyPopupEdit <CMyPopupEdit
:table="mytable" :table="mytable"
:canEdit="true" :canEdit="true"
@@ -387,6 +419,7 @@
v-model:row="newRecord" v-model:row="newRecord"
:field="col.field" :field="col.field"
:subfield="col.subfield" :subfield="col.subfield"
:tablesel="col.tablesel"
:isInModif="true" :isInModif="true"
minuteinterval="1" minuteinterval="1"
:visulabel="true" :visulabel="true"
@@ -424,6 +457,7 @@
:table="mytable" :table="mytable"
:canEdit="true" :canEdit="true"
:canModify="canModifyThisRec(recModif)" :canModify="canModifyThisRec(recModif)"
:tablesel="col.tablesel"
:mycol="col" :mycol="col"
:isInModif="true" :isInModif="true"
v-model:row="recModif" v-model:row="recModif"

View File

@@ -228,22 +228,6 @@ export default defineComponent({
}) })
} }
function cancelReqFriends(usernameDest: string) {
$q.dialog({
message: t('db.domanda_cancel_req_friend', { username: usernameDest }),
ok: { label: t('dialog.yes'), push: true },
cancel: { label: t('dialog.cancel') },
title: t('db.domanda')
}).onOk(() => {
userStore.setFriendsCmd($q, t, username.value, usernameDest, shared_consts.FRIENDSCMD.CANCEL_REQ_FRIEND, null).then((res) => {
if (res) {
userStore.my.profile.asked_friends = userStore.my.profile.asked_friends.filter((rec: IUserFields) => rec.username !== usernameDest)
tools.showPositiveNotif($q, t('db.cancel_req_friend'))
}
})
})
}
function blockUser(usernameDest: string) { function blockUser(usernameDest: string) {
$q.dialog({ $q.dialog({
@@ -269,13 +253,13 @@ export default defineComponent({
} else if (cmd === shared_consts.FRIENDSCMD.BLOCK_USER) { } else if (cmd === shared_consts.FRIENDSCMD.BLOCK_USER) {
blockUser(usernameDest) blockUser(usernameDest)
} else if (cmd === shared_consts.FRIENDSCMD.SETFRIEND) { } else if (cmd === shared_consts.FRIENDSCMD.SETFRIEND) {
tools.addToMyFriends($q, t, username.value, usernameDest) tools.addToMyFriends($q, username.value, usernameDest)
} else if (cmd === shared_consts.FRIENDSCMD.REQFRIEND) { } else if (cmd === shared_consts.FRIENDSCMD.REQFRIEND) {
tools.setRequestFriendship($q, t, username.value, usernameDest, value) tools.setRequestFriendship($q, username.value, usernameDest, value)
} else if (cmd === shared_consts.FRIENDSCMD.REFUSE_REQ_FRIEND) { } else if (cmd === shared_consts.FRIENDSCMD.REFUSE_REQ_FRIEND) {
refuseReqFriends(usernameDest) refuseReqFriends(usernameDest)
} else if (cmd === shared_consts.FRIENDSCMD.CANCEL_REQ_FRIEND) { } else if (cmd === shared_consts.FRIENDSCMD.CANCEL_REQ_FRIEND) {
cancelReqFriends(usernameDest) tools.cancelReqFriends($q, username.value, usernameDest)
} }
} }

View File

@@ -158,7 +158,7 @@ export default defineComponent({
const userStore = useUserStore() const userStore = useUserStore()
const globalStore = useGlobalStore() const globalStore = useGlobalStore()
const myvalue = ref(<any>'') const myvalue = ref(<any>null)
const myvalueprec = ref('false') const myvalueprec = ref('false')
const countryname = ref('') const countryname = ref('')
const visueditor = ref(false) const visueditor = ref(false)
@@ -445,7 +445,7 @@ export default defineComponent({
return '[---]' return '[---]'
else else
return globalStore.getValueByTable(col, val) return globalStore.getValueByTable(col, val)
} else if (col.fieldtype === costanti.FieldType.nationality) { } else if ((col.fieldtype === costanti.FieldType.nationality) || (col.fieldtype === costanti.FieldType.select_by_server) || (col.fieldtype === costanti.FieldType.multiselect_by_server)) {
if (!val) if (!val)
return '[---]' return '[---]'
else else

View File

@@ -2,7 +2,7 @@
<div :class="getclassCol(col)"> <div :class="getclassCol(col)">
<div v-if="(visInNewRec(col) && visulabel) || !visulabel " style="flex-grow: 1;"> <div v-if="(visInNewRec(col) && visulabel) || !visulabel " style="flex-grow: 1;">
<div <div
:class="{ flex: true, 'justify-center': true }"> :class="{ flex: !isInModif, 'justify-center': true }">
<div> <div>
<!-- Edit Value --> <!-- Edit Value -->
<div v-if="col.fieldtype === costanti.FieldType.boolean"> <div v-if="col.fieldtype === costanti.FieldType.boolean">
@@ -31,11 +31,12 @@
</div> </div>
</div> </div>
<div v-else-if="col.fieldtype === costanti.FieldType.string"> <div v-else-if="col.fieldtype === costanti.FieldType.string">
<div v-if="visulabel || isInModif" class="flex"> <div v-if="visulabel || isInModif" :class="{ flex: !isInModif }">
<q-input <q-input
v-bind="$attrs" v-bind="$attrs"
v-model="myvalue" v-model="myvalue"
autogrow autogrow
counter
:disable="disable" :disable="disable"
:readonly="disable" :readonly="disable"
@keyup.enter.stop @keyup.enter.stop
@@ -50,6 +51,10 @@
color="white" text-color="blue" icon="person" :to="col.link.replace(col.name, myvalue)"> color="white" text-color="blue" icon="person" :to="col.link.replace(col.name, myvalue)">
<span :class="{disabled: disable }">{{ myvalue }}</span> <span :class="{disabled: disable }">{{ myvalue }}</span>
</q-btn> </q-btn>
<q-avatar v-else-if="col.tipovisu === costanti.TipoVisu.LINKIMG && myvalue" size="60px">
<q-img :src="getImgUser(contact)" :alt="myvalue" img-class="imgprofile" height="60px"/>
</q-avatar>
<q-btn v-else-if="col.tipovisu === costanti.TipoVisu.BUTTON && myvalue" rounded dense size="sm" <q-btn v-else-if="col.tipovisu === costanti.TipoVisu.BUTTON && myvalue" rounded dense size="sm"
color="primary" icon="person" :to="col.link.replace(col.name, myvalue)">{{ myvalue }} color="primary" icon="person" :to="col.link.replace(col.name, myvalue)">{{ myvalue }}
</q-btn> </q-btn>
@@ -279,11 +284,13 @@
:opticon="fieldsTable.getIconByTable(col.jointable)"></CMyChipList> :opticon="fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
</div> </div>
</div> </div>
<div v-else-if="col.fieldtype === costanti.FieldType.select"> <div v-else-if="(col.fieldtype === costanti.FieldType.select) || (col.fieldtype === costanti.FieldType.select_by_server)">
<div v-if="isInModif"> <div v-if="isInModif">
<CMySelect <CMySelect
:label="col.label" :label="col.label"
v-model:value="myvalue" v-model:value="myvalue"
:pickup="col.fieldtype === costanti.FieldType.select_by_server"
:tablesel="col.type === costanti.FieldType.select_by_server ? tablesel : ''"
@update:value="changevalRec" @update:value="changevalRec"
:optval="fieldsTable.getKeyByTable(col.jointable)" :optval="fieldsTable.getKeyByTable(col.jointable)"
:optlab="fieldsTable.getLabelByTable(col.jointable)" :optlab="fieldsTable.getLabelByTable(col.jointable)"
@@ -303,6 +310,27 @@
:opticon="fieldsTable.getIconByTable(col.jointable)"></CMyChipList> :opticon="fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
</div> </div>
</div> </div>
<div v-else-if="col.fieldtype === costanti.FieldType.multiselect_by_server">
tablesel: {{tablesel}}
myvalue: {{ myvalue}}
<CMySelect
:isarray="true"
:multiselect_by_server="true"
:label="col.label"
v-model:arrvalue="myvalue"
@update:arrvalue="changevalRec"
:addall="true"
:tablesel="tablesel"
:pickup="true"
label-color="primary"
class="combowidth"
color="primary"
:optval="fieldsTable.getKeyByTable(col.jointable)"
:optlab="fieldsTable.getLabelByTable(col.jointable)"
:options="globalStore.getTableJoinByName(col.jointable)"
:useinput="true">
</CMySelect>
</div>
<div v-else-if="col.fieldtype === costanti.FieldType.star5"> <div v-else-if="col.fieldtype === costanti.FieldType.star5">
<div v-if="isInModif"> <div v-if="isInModif">
<CMySelect <CMySelect
@@ -330,6 +358,9 @@
</div> </div>
<div v-else-if="col.fieldtype === costanti.FieldType.html"> <div v-else-if="col.fieldtype === costanti.FieldType.html">
<div v-if="isInModif"> <div v-if="isInModif">
<div v-if="insertMode">
</div>
<div v-if="!isFieldDb()"> <div v-if="!isFieldDb()">
<CMyEditor <CMyEditor
v-model:value="myvalue" :title="col.title" @keyup.enter.stop v-model:value="myvalue" :title="col.title" @keyup.enter.stop
@@ -414,6 +445,7 @@
<div v-else-if="col.fieldtype === costanti.FieldType.string"> <div v-else-if="col.fieldtype === costanti.FieldType.string">
<q-input <q-input
v-bind="$attrs" v-bind="$attrs"
counter
v-model="scope.value" v-model="scope.value"
autogrow autogrow
@keyup.enter.stop @keyup.enter.stop
@@ -464,16 +496,66 @@
</q-input> </q-input>
</div> </div>
</div> </div>
<div v-else-if="col.fieldtype === costanti.FieldType.select"> <div v-else-if="(col.fieldtype === costanti.FieldType.select) || (col.fieldtype === costanti.FieldType.select_by_server)">
<CMySelect <CMySelect
:label="col.label" :label="col.label"
v-model:value="scope.value" v-model:value="scope.value"
:pickup="col.fieldtype === costanti.FieldType.select_by_server"
:tablesel="col.type === costanti.FieldType.select_by_server ? tablesel : ''"
:optval="fieldsTable.getKeyByTable(col.jointable)" :optval="fieldsTable.getKeyByTable(col.jointable)"
:optlab="fieldsTable.getLabelByTable(col.jointable)" :optlab="fieldsTable.getLabelByTable(col.jointable)"
:options="globalStore.getTableJoinByName(col.jointable)" :options="globalStore.getTableJoinByName(col.jointable)"
:useinput="false"> :useinput="false">
</CMySelect> </CMySelect>
</div> </div>
<div v-else-if="col.fieldtype === costanti.FieldType.multiselect_by_server">
<CMySelect
:multiselect_by_server="true"
:label="col.label"
v-model:arrvalue="scope.value"
@update:arrvalue="changevalRec"
:addall="false"
:tablesel="tablesel"
:pickup="true"
label-color="primary"
class="combowidth"
color="primary"
:optval="fieldsTable.getKeyByTable(col.jointable)"
:optlab="fieldsTable.getLabelByTable(col.jointable)"
:options="globalStore.getTableJoinByName(col.jointable)"
:useinput="true">
</CMySelect>
</div>
<div v-else-if="col.fieldtype === costanti.FieldType.multiselect">
<q-select
v-model="scope.value"
rounded
outlined
multiple
dense
options-dense
:display-value="fieldsTable.getTitleByTable(col.jointable)"
emit-value
map-options
:options="globalStore.getTableJoinByName(col.jointable)"
class="combowidth"
:option-value="fieldsTable.getKeyByTable(col.jointable)"
@update:model-value="changeval">
<template v-slot:option="{ itemProps, opt, selected, toggleOption }">
<q-item v-bind="itemProps">
<q-item-section>
<q-item-label>{{ opt[fieldsTable.getLabelByTable(col.jointable)] }}</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>
<div v-else-if="col.fieldtype === costanti.FieldType.nationality"> <div v-else-if="col.fieldtype === costanti.FieldType.nationality">
<div class="justify-center q-gutter-sm clgutter q-mt-sm"> <div class="justify-center q-gutter-sm clgutter q-mt-sm">
<CMySelect <CMySelect
@@ -514,37 +596,6 @@
:optlab="fieldsTable.getLabelByTable(col.jointable)"> :optlab="fieldsTable.getLabelByTable(col.jointable)">
</CMyToggleList> </CMyToggleList>
</div> </div>
<div v-else-if="col.fieldtype === costanti.FieldType.multiselect">
<q-select
v-model="scope.value"
rounded
outlined
multiple
dense
options-dense
:display-value="fieldsTable.getTitleByTable(col.jointable)"
emit-value
map-options
:options="globalStore.getTableJoinByName(col.jointable)"
class="combowidth"
:option-value="fieldsTable.getKeyByTable(col.jointable)"
@update:model-value="changeval">
<template v-slot:option="{ itemProps, opt, selected, toggleOption }">
<q-item v-bind="itemProps">
<q-item-section>
<q-item-label>{{ opt[fieldsTable.getLabelByTable(col.jointable)] }}</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>
<div v-else-if="col.fieldtype === costanti.FieldType.star5"> <div v-else-if="col.fieldtype === costanti.FieldType.star5">
<CMySelect <CMySelect
:label="col.label" :label="col.label"

View File

@@ -9,12 +9,19 @@ import { shared_consts } from '@/common/shared_vuejs'
export default defineComponent({ export default defineComponent({
name: 'CMySelect', name: 'CMySelect',
emits: ['update:value', 'changeval'], emits: ['update:value', 'update:arrvalue', 'changeval'],
props: { props: {
options: { options: {
type: Array, type: Array,
required: true, required: true,
}, },
arrvalue: {
type: Array,
required: false,
default: () => {
return []
}
},
value: [String, Number], value: [String, Number],
label: { label: {
type: String, type: String,
@@ -68,6 +75,10 @@ export default defineComponent({
type: Function, type: Function,
required: false, required: false,
}, },
multiselect_by_server: {
type: Boolean,
default: false,
}
}, },
components: {}, components: {},
setup(props, { emit }) { setup(props, { emit }) {
@@ -80,6 +91,8 @@ export default defineComponent({
const valori = ref(<any>[]) const valori = ref(<any>[])
const myvalue = ref(<string | number>'') const myvalue = ref(<string | number>'')
const myarrvalue = ref(<any[]>[])
const arrtempOpt = ref(<any[]>[])
const valoriload = computed(() => { const valoriload = computed(() => {
let myarr = props.options let myarr = props.options
@@ -97,7 +110,10 @@ export default defineComponent({
}) })
watch(() => props.options, (value: any, oldval: any) => { watch(() => props.options, (value: any, oldval: any) => {
if (!props.multiselect_by_server) {
valori.value = valoriload.value valori.value = valoriload.value
// console.log('@@@ VALORI CHANGED (1)', valori.value)
}
}, },
) )
watch(() => props.value, (value: any, oldval: any) => { watch(() => props.value, (value: any, oldval: any) => {
@@ -105,10 +121,64 @@ export default defineComponent({
}, },
) )
watch(() => props.arrvalue, (value: any, oldval: any) => {
console.log(' MODIF props.arrvalue', props.arrvalue)
// mounted()
},
)
function saveOptInCookie(arrval: any) {
if (arrval) {
for (const id of arrval) {
let trovato = arrtempOpt.value.find((rec) => rec._id === id)
if (!trovato) {
const rec = valori.value.find((rec: any) => rec._id === id)
if (rec) {
console.log('SAVE OPT rec', rec)
arrtempOpt.value.push({ _id: id, comune: rec.comune })
let num = localStorage.getItem(props.tablesel + 'NUM') || 0
try {
if (!num) {
num = 0
} else {
num = parseInt(num.toString())
}
} catch (e) {
num = 0
}
console.log('----------- valori.value', valori.value)
console.log('----------- arrtempOpt.value', arrtempOpt.value)
localStorage.setItem(props.tablesel + num + 'ID', rec._id)
localStorage.setItem(props.tablesel + num + 'COMUNE', rec.comune)
num += 1
localStorage.setItem(props.tablesel + 'NUM', num.toString())
}
}
}
}
}
function changeval(newval: any) { function changeval(newval: any) {
console.log(' ½½½½½½½ changeval', newval)
if (props.multiselect_by_server) {
// localStorage.setItem(props.tablesel + '_' + newval, valori.value[newval])
myarrvalue.value = newval && newval['arrvalue'] ? newval['arrvalue'] : newval
saveOptInCookie(newval)
console.log(' ----- Myselect changeval Arrvalue', myarrvalue.value)
emit('update:arrvalue', myarrvalue.value)
emit('changeval', myarrvalue.value)
} else {
if (props.tablesel === shared_consts.TAB_COUNTRY) if (props.tablesel === shared_consts.TAB_COUNTRY)
myvalue.value = newval && newval['value'] ? newval['value'] : newval myvalue.value = newval && newval['value'] ? newval['value'] : newval
else if (props.tablesel === shared_consts.TAB_CITIES)
myvalue.value = newval && newval['value'] ? newval['value'] : newval
else if (props.tablesel === shared_consts.TAB_PHONES) else if (props.tablesel === shared_consts.TAB_PHONES)
myvalue.value = newval && newval['code'] ? newval['code'] : newval myvalue.value = newval && newval['code'] ? newval['code'] : newval
else else
@@ -117,58 +187,90 @@ export default defineComponent({
emit('update:value', myvalue.value) emit('update:value', myvalue.value)
emit('changeval', myvalue.value) emit('changeval', myvalue.value)
} }
}
function mounted() { function mounted() {
// console.log('mounted myselect', props.options) console.log(' #### mounted myselect', props.options, 'arrvalue', myarrvalue.value)
let rec: any
if (props.options) { if (props.options) {
const rec: any = props.options.find((myrec: any) => myrec[`${props.optval}`] === props.value) if (!props.multiselect_by_server) {
rec = props.options.find((myrec: any) => myrec[`${props.optval}`] === props.value)
}
}
if (props.multiselect_by_server) {
const num = parseInt(localStorage.getItem(props.tablesel + 'NUM')!)
console.log('num LOADED ', num)
for (let i = 0; i < num; i++) {
const itemId = parseInt(localStorage.getItem(props.tablesel + i + 'ID')!)
const itemcomune = localStorage.getItem(props.tablesel + i + 'COMUNE')
if (itemId) {
arrtempOpt.value.push({ _id: itemId, comune: itemcomune })
}
}
myarrvalue.value = []
for (const val of props.arrvalue) {
rec = arrtempOpt.value.find((myrec: any) => val === (myrec[`${props.optval}`]))
if (rec) {
myarrvalue.value.push(rec[`${props.optval}`])
}
}
}
if (rec) { if (rec) {
if (props.funcgetvaluebyid) if (props.funcgetvaluebyid)
myvalue.value = props.funcgetvaluebyid(rec[`${props.optval}`]) myvalue.value = props.funcgetvaluebyid(rec[`${props.optval}`])
else else
myvalue.value = rec[`${props.optlab}`] myvalue.value = rec[`${props.optlab}`]
} else { } else {
if (!props.useinput) { // if (!props.useinput) {
if (props.value) { if (props.value) {
myvalue.value = props.value myvalue.value = props.value
} }
} // }
}
} }
// console.log('cmyselect: myvalue.value', myvalue.value) // console.log('cmyselect: myvalue.value', myvalue.value)
} }
function filterFn(val: any, update: any, abort: any) { function filterFn(val: any, update: any, abort: any) {
update( update(
async () => { () => {
console.log('Filter val', val, val.length) console.log('Filter val', val, val.length)
let myarr: any = [] let myarr: any = []
if (val.length < 1) { if (val.length <= 1) {
abort() valori.value = arrtempOpt.value
return return
} }
let mystr = val.toLocaleLowerCase() let mystr = val.toLocaleLowerCase()
console.log('props.tablesel', props.tablesel)
if (fieldsTable.tableRemotePickup.includes(props.tablesel)) { if (fieldsTable.tableRemotePickup.includes(props.tablesel)) {
// if (myvalue.value.length > 1) {
try { try {
if (mystr !== '') if (mystr !== '')
myarr = await globalStore.loadPickup({ table: props.tablesel, search: mystr }) return globalStore.loadPickup({ table: props.tablesel, search: mystr })
.then((ris) => {
myarr = props.options
if (ris) {
valori.value = ris
if (props.multiselect_by_server) {
console.log('@@@ VALORI CHANGED (2)', valori.value)
}
}
if (myarr === null){ })
abort()
if (myarr === null) {
valori.value = arrtempOpt.value
return return
} }
}catch (e) { } catch (e) {
abort() valori.value = arrtempOpt.value
return return
} }
// const needle = val.toLocaleLowerCase() // const needle = val.toLocaleLowerCase()
// optFiltered.value = optFiltered.value.filter((v: any) => v.toLocaleLowerCase().indexOf(needle) > -1) // optFiltered.value = optFiltered.value.filter((v: any) => v.toLocaleLowerCase().indexOf(needle) > -1)
// }
} else { } else {
myarr = props.options myarr = props.options
} }
@@ -183,9 +285,14 @@ export default defineComponent({
myarr = [myobj, ...myarr] myarr = [myobj, ...myarr]
} }
if (myarr.length > 0) {
valori.value = myarr valori.value = myarr
if (props.multiselect_by_server) {
console.log('@@@ VALORI CHANGED (3)', valori.value)
}
}
console.log('tablesel', props.tablesel, 'filterFn', myarr) console.log('*** OUT: tablesel', props.tablesel, 'filterFn', myarr)
}, },
// "ref" is the Vue reference to the QSelect // "ref" is the Vue reference to the QSelect
(ref: any) => { (ref: any) => {
@@ -197,15 +304,32 @@ export default defineComponent({
) )
} }
function abortFilterFn() {
console.log('delayed filter aborted')
}
function checkIfShowRec(rec: any) {
return (rec._id > 0 && typeof rec._id === 'number') || rec._id !== 'number'
}
onMounted(mounted) onMounted(mounted)
if (!props.multiselect_by_server) {
valori.value = valoriload.value valori.value = valoriload.value
console.log('@@@ VALORI CHANGED (4)', valori.value)
} else {
valori.value = arrtempOpt.value
}
return { return {
changeval, changeval,
myvalue, myvalue,
myarrvalue,
valori, valori,
filterFn, filterFn,
fieldsTable,
checkIfShowRec,
abortFilterFn,
} }
} }
}) })

View File

@@ -1,6 +1,69 @@
<template> <template>
<div class="text-center"> <div class="text-center">
<div v-if="useinput"> <div v-if="multiselect_by_server">
<q-select
:model-value="myarrvalue"
label-color="primary"
:label="label"
@filter="filterFn"
@filter-abort="abortFilterFn"
@update:model-value="changeval"
input-debounce="300"
rounded
outlined
fill-input
multiple
options-dense
map-options
stack-label
emit-value
:use-input="true"
:dense="dense"
:input-class="myclass"
:options="valori"
:option-value="optval"
class="combowidth"
>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
No results
</q-item-section>
</q-item>
</template>
<template v-slot:option="{ itemProps, opt, selected, toggleOption }">
<q-item v-bind="itemProps">
<q-item-section>
<q-item-label>{{ opt[fieldsTable.getLabelByTable(tablesel)] }}</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>
<template v-slot:selected-item="scope">
<div v-if="scope.opt[fieldsTable.getLabelByTable(tablesel)]">
<q-chip
removable
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="" size="12px"/>
{{ scope.opt[fieldsTable.getLabelByTable(tablesel)] }}
</q-chip>
</div>
</template>
</q-select>
</div>
<div v-else-if="useinput">
<q-select <q-select
:multiple="multiple" :multiple="multiple"
rounded rounded
@@ -9,6 +72,7 @@
:input-class="myclass" :input-class="myclass"
:model-value="myvalue" :model-value="myvalue"
:use-input="useinput" :use-input="useinput"
@filter="filterFn"
input-debounce="0" input-debounce="0"
@new-value="newvaluefunc" @new-value="newvaluefunc"
new-value-mode="add-unique" new-value-mode="add-unique"
@@ -52,11 +116,8 @@
</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>
{{ scope.opt.flag }}
</q-item-section>
<q-item-section> <q-item-section>
<q-item-label> {{ scope.opt.value }}</q-item-label> <q-item-label> {{ scope.opt[optlab] }}</q-item-label>
</q-item-section> </q-item-section>
</q-item> </q-item>
</template> </template>

View File

@@ -10,7 +10,7 @@
<q-item-section @click="naviga(`/my/` + contact.username)"> <q-item-section @click="naviga(`/my/` + contact.username)">
<q-item-label><strong>{{ contact.name }} {{ contact.surname }}</strong> ({{ contact.username }}) <q-item-label><strong>{{ contact.name }} {{ contact.surname }}</strong> ({{ contact.username }})
</q-item-label> </q-item-label>
<q-item-label caption lines="1">{{ contact.email }}</q-item-label> <q-item-label caption lines="1"><em>{{ contact.profile.qualifica }}</em></q-item-label>
</q-item-section> </q-item-section>
<q-item-section side v-if="visu === costanti.FRIENDS"> <q-item-section side v-if="visu === costanti.FRIENDS">

View File

@@ -97,18 +97,47 @@ export default defineComponent({
lk_proj: { lk_proj: {
idSkill: 1, idSkill: 1,
idSubSkill: 1, idSubSkill: 1,
idCity: 1,
numLevel: 1, numLevel: 1,
photos: 1, photos: 1,
note: 1, note: 1,
subTitle: 1, subTitle: 1,
date_created: 1, date_created: 1,
date_updated: 1, date_updated: 1,
comune: 1,
userId: 1, userId: 1,
username: 1, username: 1,
name: 1, name: 1,
surname: 1 surname: 1,
'profile.img': 1,
'profile.qualifica': 1,
} }
},
lookup2: {
lk_tab: 'cities',
lk_LF: 'idCity',
lk_FF: '_id',
lk_as: 'comune',
af_objId_tab: '',
lk_proj: {
idSkill: 1,
idSubSkill: 1,
idCity: 1,
numLevel: 1,
photos: 1,
note: 1,
subTitle: 1,
date_created: 1,
date_updated: 1,
comune: 1,
userId: 1,
username: 1,
name: 1,
surname: 1,
'profile.img': 1,
'profile.qualifica': 1,
} }
},
} }
} }

View File

@@ -124,13 +124,22 @@
</q-badge> </q-badge>
</q-btn> </q-btn>
<q-btn <!--<q-avatar v-if="static_data.functionality.SHOW_USER_MENU && isLogged()"
class="q-mx-xs" v-if="static_data.functionality.SHOW_USER_MENU && isLogged()" round dense flat size="30px"
@click="rightDrawerOpen = !rightDrawerOpen" :color="getcolormenu()">
<q-img :src="getMyImgforIcon()" :alt="Username()" img-class=""/>
</q-avatar>-->
<q-avatar v-if="static_data.functionality.SHOW_USER_MENU && isLogged()"
size="36px" class="center_img cursor-pointer"
@click="rightDrawerOpen = !rightDrawerOpen">
<q-img ratio="1" fit="conver" :src="getMyImg()" :alt="Username()" img-class="imgprofile_small" stretch="false" />
</q-avatar>
<!--<q-btn
class="q-mx-xs iconprofile_small" v-if="static_data.functionality.SHOW_USER_MENU && isLogged()" round dense flat
@click="rightDrawerOpen = !rightDrawerOpen" :icon="getMyImgforIcon()" :color="getcolormenu()"> @click="rightDrawerOpen = !rightDrawerOpen" :icon="getMyImgforIcon()" :color="getcolormenu()">
<!--<q-badge v-if="isSocio" color="green" floating transparent> </q-btn>-->
s
</q-badge>-->
</q-btn>
</q-toolbar> </q-toolbar>
@@ -169,7 +178,11 @@
<div class="absolute-top bg-transparent text-black center_img" style="margin-top: 10px;"> <div class="absolute-top bg-transparent text-black center_img" style="margin-top: 10px;">
<div class="text-center q-ma-xs boldhigh text-white text-h7">Area Personale</div> <div class="text-center q-ma-xs boldhigh text-white text-h7">Area Personale</div>
<CMyAvatar :myimg="getMyImg()"></CMyAvatar> <q-avatar size="80px" class="center_img q-ma-md">
<q-img fit="cover" :src="getMyImg()" :alt="Username()" img-class="imgprofile" height="80px"/>
</q-avatar>
<!--<CMyAvatar :myimg="getMyImg()"></CMyAvatar>-->
<q-btn <q-btn
class="absolute-top-right" style="margin-right: 10px; color: white;" class="absolute-top-right" style="margin-right: 10px; color: white;"

View File

@@ -903,6 +903,18 @@ $heightBtn: 100%;
margin: 1px; margin: 1px;
} }
.imgprofile_small{
border: 0px solid rgb(29, 118, 13);
border-radius: 30px;
box-shadow: 0 0 45px rgba(246, 246, 246, 0.2);
margin: 1px;
transform: scale(1.0);
}
.iconprofile_small{
border-radius: 30px;
}
.fill-all-width { .fill-all-width {
width: -webkit-fill-available; width: -webkit-fill-available;
} }

448
src/db/data/popolazione.js Normal file

File diff suppressed because one or more lines are too long

View File

@@ -105,6 +105,19 @@ const routes_admin: IListRoutes[] = [
inmenu: true, inmenu: true,
submenu: true, submenu: true,
onlyAdmin: true onlyAdmin: true
},
{
active: true,
order: 1040,
path: '/admin/importfile',
materialIcon: 'event_seat',
name: 'otherpages.manage.importfile',
component: () => import('@/rootgen/admin/importdata/importdata.vue'),
level_parent: 0.0,
level_child: 0.5,
inmenu: true,
submenu: true,
onlyAdmin: true
} }
] ]

View File

@@ -1,9 +1,10 @@
import { IListRoutes } from '@src/model' import { IListRoutes } from '@src/model'
import { useGlobalStore } from '@store/globalStore' import { useGlobalStore } from '@store/globalStore'
import { tools } from '@store/Modules/tools' import { tools } from '@store/Modules/tools'
import { computed, defineComponent, watch } from 'vue' import { computed, defineComponent, ref, watch } from 'vue'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import { static_data } from '@/db/static_data' import { static_data } from '@/db/static_data'
import { useUserStore } from '@store/UserStore'
export default defineComponent({ export default defineComponent({
name: 'MenuOne', name: 'MenuOne',
@@ -17,12 +18,17 @@ export default defineComponent({
setup(props) { setup(props) {
const route = useRoute() const route = useRoute()
const userStore = useUserStore()
const globalStore = useGlobalStore() const globalStore = useGlobalStore()
const finishLoading = computed(() => globalStore.finishLoading) const finishLoading = computed(() => globalStore.finishLoading)
const path = computed(() => route.path) const path = computed(() => route.path)
const getroutes = computed(() => static_data.routes)
const myroutes = ref(<IListRoutes[]>[])
function getmenu(): any { function getmenu(): any {
// console.log('getmenu menuOne!') // console.log('getmenu menuOne!')
return globalStore.getmenu return globalStore.getmenu
@@ -36,7 +42,12 @@ export default defineComponent({
}) })
} }
watch(path, (to: string, from: string) => { watch(() => userStore.isLogged,(to, from) => {
myroutes.value = []
myroutes.value = static_data.routes
})
watch(() => path, (to, from) => {
const mymenu = globalStore.getmenu const mymenu = globalStore.getmenu
// console.log('watch:', mymenu) // console.log('watch:', mymenu)
Object.keys(mymenu).forEach((parentName: any) => { Object.keys(mymenu).forEach((parentName: any) => {
@@ -80,6 +91,8 @@ export default defineComponent({
return menu return menu
} }
myroutes.value = static_data.routes
return { return {
getmenu, getmenu,
finishLoading, finishLoading,
@@ -87,6 +100,8 @@ export default defineComponent({
getroute, getroute,
static_data, static_data,
tools, tools,
getroutes,
myroutes,
} }
}, },
}) })

View File

@@ -3,7 +3,7 @@
<q-list class="rounded-borders text-primary"> <q-list class="rounded-borders text-primary">
<div v-for="ind1 in getmenu()" :key="ind1"> <div v-for="ind1 in getmenu()" :key="ind1">
<!--<div class="q-list-header">{{replaceUnderlineToSpace(index)}}</div>--> <!--<div class="q-list-header">{{replaceUnderlineToSpace(index)}}</div>-->
<div v-for="(myitemmenu, ind2) in static_data.routes" :key="ind2"> <div v-for="(myitemmenu, ind2) in myroutes" :key="ind2">
<div v-if="myitemmenu.active"> <div v-if="myitemmenu.active">
<div v-if="myitemmenu.routes2 && myitemmenu.inmenu && tools.visumenu(myitemmenu)"> <div v-if="myitemmenu.routes2 && myitemmenu.inmenu && tools.visumenu(myitemmenu)">

View File

@@ -501,6 +501,7 @@ export interface IColGridTable {
resultjoin?: string[] resultjoin?: string[]
visuonlyEditVal?: boolean visuonlyEditVal?: boolean
notShowInNewRec?: boolean notShowInNewRec?: boolean
tablesel?: string
} }
export interface ITableRec { export interface ITableRec {
@@ -523,9 +524,11 @@ export interface ISearchList {
value: any value: any
type: number type: number
filter: any filter: any
useinput: boolean
notinsearch?: boolean notinsearch?: boolean
addall?: boolean addall?: boolean
showcount?: boolean showcount?: boolean
tablesel?: string
} }
export interface IFilter { export interface IFilter {

View File

@@ -11,7 +11,6 @@
<!--<CMapsEsempio></CMapsEsempio>--> <!--<CMapsEsempio></CMapsEsempio>-->
<div v-if="isLogged()"> <div v-if="isLogged()">
<CVerifyEmail v-if="!isEmailVerified()"> <CVerifyEmail v-if="!isEmailVerified()">
@@ -22,6 +21,7 @@
</CVerifyTelegram> </CVerifyTelegram>
<div v-if="isUserOk()"> <div v-if="isUserOk()">
<CFinder> <CFinder>

View File

View File

@@ -0,0 +1,144 @@
import { CMyPage } from '../../../components/CMyPage/index'
import { shared_consts } from '@src/common/shared_vuejs'
import { tools } from '@src/store/Modules/tools'
import { defineComponent, ref, onMounted } from 'vue'
import { useI18n } from '@src/boot/i18n'
import { useUserStore } from '@store/UserStore'
import { useGlobalStore } from '@store/globalStore'
import { useQuasar } from 'quasar'
export default defineComponent({
name: 'Sendpushnotif',
components: { CMyPage },
setup(props, { emit }) {
const $q = useQuasar()
const { t } = useI18n()
const userStore = useUserStore()
const globalStore = useGlobalStore()
const incaricamento = ref(false)
const cosafare = ref(shared_consts.Cmd.PROVINCE)
const inputfile = ref('')
const risultato = ref('')
const ListaCmd = ref(
[
{
label: 'Importa Province',
value: shared_consts.Cmd.PROVINCE
},
{
label: 'Importa Comuni',
value: shared_consts.Cmd.COMUNI
},
{
label: 'Tabella Cities',
value: shared_consts.Cmd.CITIES_SERVER
},
]
)
function created() {
inputfile.value = ''
}
function importCmd(cmd: number, testo: string) {
let risultato = '(nessuno)'
let delim = ','
if (cmd === shared_consts.Cmd.PROVINCE) {
delim = ','
} else if ((cmd === shared_consts.Cmd.COMUNI) || (cmd === shared_consts.Cmd.CITIES_SERVER)) {
delim = ';'
}
const myarr = tools.CSVToArray(testo, delim)
let strris = ''
let ind = 1
for (const rec of myarr) {
let lab = rec[0]
let val = rec[1]
if (cmd === shared_consts.Cmd.PROVINCE) {
val = rec[2]
strris += '{ \n'
strris += ' label:\'' + lab + '\','
strris += ' value:\'' + val + '\','
strris += '}, \n'
} else if (cmd === shared_consts.Cmd.COMUNI) {
strris += '{ \n'
strris += ' istat:\'' + rec[0] + '\','
strris += ' comune:\'' + rec[1] + '\','
strris += ' prov:\'' + rec[2] + '\''
} else if (cmd === shared_consts.Cmd.CITIES_SERVER) {
strris += '{ \n'
strris += ' _id :' + ind + ',\n'
strris += ' istat :\'' + rec[0] + '\'\n,'
strris += ' comune :\'' + rec[1] + '\'\n,'
strris += ' prov :\'' + rec[2] + '\'\n,'
strris += ' reg :\'' + rec[3] + '\'\n,'
strris += ' pref :\'' + rec[4] + '\'\n,'
strris += ' cap :\'' + rec[5] + '\'\n,'
strris += ' abitanti :\'' + rec[6] + '\'\n,'
strris += ' country : \'IT\'\n'
strris += '}, \n'
ind += 1
}
}
if (cmd === shared_consts.Cmd.CITIES_SERVER) {
userStore.importToServerCmd($q, t, cmd, null)
}
risultato = strris
return risultato
}
function loadTextFromFile(ev: any) {
console.log('ev', ev)
const file = ev.target.files[0]
const reader = new FileReader()
reader.onload = (e: any) => {
const testo = e.target.result
risultato.value = importCmd(cosafare.value, testo)
}
reader.readAsText(file)
}
function eseguiCmd() {
risultato.value = ''
userStore.importToServerCmd($q, t, cosafare.value, null)
}
onMounted(created)
return {
inputfile,
shared_consts,
loadTextFromFile,
risultato,
cosafare,
ListaCmd,
eseguiCmd,
}
}
})

View File

@@ -0,0 +1,30 @@
<template>
<CMyPage img="" title="Import Data" keywords="" description="">
<div class="q-ma-sm">
<br>
<q-select rounded outlined v-model="cosafare"
:options="ListaCmd"
label="Operazione" emit-value map-options>
</q-select>
<label class="text-reader">
<input type="file"
@change="loadTextFromFile" />
</label>
<br>
<br>
<q-btn
label="Esegui"
@click="eseguiCmd"></q-btn>
{{risultato}}
<br>
<br>
</div>
</CMyPage>
</template>
<script lang="ts" src="./importdata.ts">
</script>
<style lang="scss" scoped>
@import './importdata.scss';
</style>

View File

@@ -32,6 +32,7 @@ const msg_it = {
sito_offline: 'Sito in Aggiornamento', sito_offline: 'Sito in Aggiornamento',
modifprof: 'Modifica Profilo', modifprof: 'Modifica Profilo',
biografia: 'Biografia', biografia: 'Biografia',
qualifica: 'Qualifica (in breve)',
update: 'Aggiornamento in Corso...', update: 'Aggiornamento in Corso...',
error404: 'error404', error404: 'error404',
error404def: 'error404def', error404def: 'error404def',
@@ -59,6 +60,7 @@ const msg_it = {
manager: 'Segreteria', manager: 'Segreteria',
nessuno: 'Nessuno', nessuno: 'Nessuno',
sendpushnotif: 'Invia Msg Push', sendpushnotif: 'Invia Msg Push',
importfile: 'Importa File',
}, },
messages: { messages: {
menu: 'I tuoi Messaggi', menu: 'I tuoi Messaggi',
@@ -851,6 +853,7 @@ const msg_it = {
block_user: 'Blocca Utente', block_user: 'Blocca Utente',
ask_friend: 'Chiedi l\'Amicizia', ask_friend: 'Chiedi l\'Amicizia',
cancel_ask_friend: 'Annulla la richiesta di Amicizia', cancel_ask_friend: 'Annulla la richiesta di Amicizia',
cancel_ask_friend_short: 'Annulla richiesta',
reject_ask_friend: 'Rifiuta la richiesta di Amicizia', reject_ask_friend: 'Rifiuta la richiesta di Amicizia',
} }
}, },

View File

@@ -54,6 +54,8 @@ export const costanti = {
listimages: 1024, listimages: 1024,
exact: 2048, exact: 2048,
image: 3000, image: 3000,
select_by_server: 4000,
multiselect_by_server: 4010,
nationality: 4096, nationality: 4096,
intcode: 5000, intcode: 5000,
multioption: 6000, multioption: 6000,
@@ -76,6 +78,7 @@ export const costanti = {
TESTO: 1, TESTO: 1,
LINK: 2, LINK: 2,
BUTTON: 3, BUTTON: 3,
LINKIMG: 4,
}, },
} }

View File

@@ -63,6 +63,7 @@ function AddCol(params: IColGridTable) {
link: (params.link === undefined) ? '' : params.link, link: (params.link === undefined) ? '' : params.link,
visuonlyEditVal: (params.visuonlyEditVal === undefined) ? false : params.visuonlyEditVal, visuonlyEditVal: (params.visuonlyEditVal === undefined) ? false : params.visuonlyEditVal,
askaction: (params.askaction === undefined) ? '' : params.askaction, askaction: (params.askaction === undefined) ? '' : params.askaction,
tablesel: (params.tablesel === undefined) ? '' : params.tablesel,
jointable: (params.jointable === undefined) ? '' : params.jointable, jointable: (params.jointable === undefined) ? '' : params.jointable,
notShowInNewRec: (params.notShowInNewRec === undefined) ? false : params.notShowInNewRec, notShowInNewRec: (params.notShowInNewRec === undefined) ? false : params.notShowInNewRec,
} }
@@ -333,7 +334,7 @@ export const colCitys = [
AddCol({ name: 'reg', label_trans: 'city.reg' }), AddCol({ name: 'reg', label_trans: 'city.reg' }),
AddCol({ name: 'pref', label_trans: 'city.pref' }), AddCol({ name: 'pref', label_trans: 'city.pref' }),
AddCol({ name: 'cap', label_trans: 'city.cap' }), AddCol({ name: 'cap', label_trans: 'city.cap' }),
AddCol({ name: 'abitanti', label_trans: 'city.abitanti', fieldtype: costanti.FieldType.number }), // AddCol({ name: 'abitanti', label_trans: 'city.abitanti', fieldtype: costanti.FieldType.string }),
AddCol({ name: 'country', label_trans: 'city.country' }), AddCol({ name: 'country', label_trans: 'city.country' }),
AddCol(DeleteRec), AddCol(DeleteRec),
AddCol(DuplicateRec), AddCol(DuplicateRec),
@@ -441,8 +442,9 @@ export const colmySkills = [
AddCol({ AddCol({
name: 'idCity', name: 'idCity',
label_trans: 'skill.city', label_trans: 'skill.city',
fieldtype: costanti.FieldType.multiselect, fieldtype: costanti.FieldType.multiselect_by_server,
jointable: 'cities', jointable: 'cities',
tablesel: 'cities',
}), }),
AddCol({ AddCol({
name: 'photos', name: 'photos',
@@ -450,7 +452,7 @@ export const colmySkills = [
fieldtype: costanti.FieldType.listimages, fieldtype: costanti.FieldType.listimages,
jointable: '', jointable: '',
}), }),
AddCol({ name: 'subTitle', label_trans: 'skill.note' }), AddCol({ name: 'subTitle', label_trans: 'skill.note', fieldtype: costanti.FieldType.string }),
AddCol({ name: 'note', label_trans: 'proj.longdescr', fieldtype: costanti.FieldType.html }), AddCol({ name: 'note', label_trans: 'proj.longdescr', fieldtype: costanti.FieldType.html }),
AddCol(DuplicateRec), AddCol(DuplicateRec),
AddCol(ModifRec), AddCol(ModifRec),
@@ -1403,6 +1405,7 @@ export const fieldsTable = {
}), }),
AddCol({ name: 'profile.motivazioni', field: 'profile', subfield: 'motivazioni', label_trans: 'reg.motivazioni', }), 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.biografia', field: 'profile', subfield: 'biografia', label_trans: 'reg.biografia', }),
AddCol({ name: 'profile.qualifica', field: 'profile', subfield: 'qualifica', label_trans: 'reg.qualifica', }),
AddCol({ AddCol({
name: 'profile.paymenttypes', name: 'profile.paymenttypes',
field: 'profile', field: 'profile',
@@ -1692,6 +1695,15 @@ export const fieldsTable = {
colicon: 'icon', colicon: 'icon',
noshow: true, noshow: true,
}, },
{
value: 'regions',
label: 'Regioni',
columns: colTablePermission,
colkey: 'value',
collabel: 'label',
colicon: 'icon',
noshow: true,
},
{ {
value: 'accepted', value: 'accepted',
label: 'Condizioni', label: 'Condizioni',
@@ -1764,10 +1776,11 @@ export const fieldsTable = {
}, },
{ {
value: 'cities', value: 'cities',
label: 'Città', label: 'Comune',
columns: colCitys, columns: colCitys,
colkey: '_id', colkey: '_id',
collabel: 'comune', collabel: 'comune',
remote: true,
}, },
{ {
value: 'countries', value: 'countries',

View File

@@ -4390,7 +4390,7 @@ export const tools = {
return res.test(String(email).toLowerCase()) return res.test(String(email).toLowerCase())
}, },
addToMyFriends($q: any, t: any, username: string, usernameDest: string) { addToMyFriends($q: any, username: string, usernameDest: string) {
const userStore = useUserStore() const userStore = useUserStore()
$q.dialog({ $q.dialog({
@@ -4410,7 +4410,7 @@ export const tools = {
}) })
}) })
}, },
setRequestFriendship($q: any, t: any, username: string, usernameDest: string, value: boolean) { setRequestFriendship($q: any, username: string, usernameDest: string, value: boolean) {
const userStore = useUserStore() const userStore = useUserStore()
@@ -4452,6 +4452,104 @@ export const tools = {
}) })
}) })
}, },
cancelReqFriends($q: any, username: string, usernameDest: string) {
const userStore = useUserStore()
$q.dialog({
message: t('db.domanda_cancel_req_friend', { username: usernameDest }),
ok: { label: t('dialog.yes'), push: true },
cancel: { label: t('dialog.cancel') },
title: t('db.domanda')
}).onOk(() => {
userStore.setFriendsCmd($q, t, username, usernameDest, shared_consts.FRIENDSCMD.CANCEL_REQ_FRIEND, null).then((res) => {
if (res) {
userStore.my.profile.asked_friends = userStore.my.profile.asked_friends.filter((rec: IUserFields) => rec.username !== usernameDest)
tools.showPositiveNotif($q, t('db.cancel_req_friend'))
}
})
})
},
CSVToArray(strData: any, strDelimiter: string) {
// Check to see if the delimiter is defined. If not,
// then default to comma.
strDelimiter = (strDelimiter || ',')
// Create a regular expression to parse the CSV values.
let objPattern = new RegExp(
(
// Delimiters.
'(\\' + strDelimiter + '|\r?\\n|\\r|^)' +
// Quoted fields.
'(?:\"([^\"]*(?:\"\"[^\"]*)*)\"|' +
// Standard fields.
'([^\'\\' + strDelimiter + '\\r\\n]*))'
),
'gi'
)
// Create an array to hold our data. Give the array
// a default empty first row.
let arrData: any = [[]]
// Create an array to hold our individual pattern
// matching groups.
let arrMatches = null
// Keep looping over the regular expression matches
// until we can no longer find a match.
while (arrMatches = objPattern.exec(strData)) {
// Get the delimiter that was found.
let strMatchedDelimiter = arrMatches[1]
// Check to see if the given delimiter has a length
// (is not the start of string) and if it matches
// field delimiter. If id does not, then we know
// that this delimiter is a row delimiter.
if (
strMatchedDelimiter.length &&
strMatchedDelimiter !== strDelimiter
) {
// Since we have reached a new row of data,
// add an empty row to our data array.
arrData.push([])
}
let strMatchedValue: any
// Now that we have our delimiter out of the way,
// let's check to see which kind of value we
// captured (quoted or unquoted).
if (arrMatches[2]) {
// We found a quoted value. When we capture
// this value, unescape any double quotes.
strMatchedValue = arrMatches[2].replace(
new RegExp('\"\"', 'g'),
'\"'
)
} else {
// We found a non-quoted value.
strMatchedValue = arrMatches[3]
}
// Now that we have our value string, let's add
// it to the data array.
arrData[arrData.length - 1].push(strMatchedValue)
}
// Return the parsed data.
return (arrData)
},
// getLocale() { // getLocale() {

View File

@@ -876,6 +876,19 @@ export const useUserStore = defineStore('UserStore', {
return {} return {}
}) })
},
async importToServerCmd($q: any, t: any, cmd: number, data: any) {
return Api.SendReq('/admin/import', 'POST', { cmd, data })
.then((res) => {
if (res) {
tools.showPositiveNotif($q, t('db.recupdated'))
}
}).catch((error) => {
tools.showNegativeNotif($q, t('db.recfailed'))
return {}
})
} }
}, },
}) })

View File

@@ -233,8 +233,6 @@ export const useGlobalStore = defineStore('GlobalStore', {
return state.statusSkills return state.statusSkills
else if (table === 'sectors') else if (table === 'sectors')
return state.sectors return state.sectors
else if (table === 'cities')
return state.cities
else { else {
return ris return ris
} }
@@ -1296,6 +1294,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
if (table === 'bottype') return shared_consts.BotType if (table === 'bottype') return shared_consts.BotType
if (table === 'visibility') return shared_consts.Visibility if (table === 'visibility') return shared_consts.Visibility
if (table === 'lang') return shared_consts.Lang if (table === 'lang') return shared_consts.Lang
if (table === 'regions') return shared_consts.Regions
let myarr = this.getListByTable(table) let myarr = this.getListByTable(table)

View File

@@ -75,12 +75,22 @@
</CMyFieldDb> </CMyFieldDb>
</div> </div>
<CMyFieldDb
title="Qualifica"
table="users"
mykey="profile"
mysubkey="qualifica"
maxlength="40"
:showall="true"
:type="costanti.FieldType.string">
</CMyFieldDb>
<CMyFieldDb <CMyFieldDb
title="Biografia" title="Biografia"
table="users" table="users"
mykey="profile" mykey="profile"
mysubkey="biografia" mysubkey="biografia"
maxlength="200" maxlength="300"
:showall="true" :showall="true"
:type="costanti.FieldType.string"> :type="costanti.FieldType.string">
</CMyFieldDb> </CMyFieldDb>

View File

@@ -50,6 +50,7 @@ export default defineComponent({
username: 1, username: 1,
name: 1, name: 1,
'profile.img': 1, 'profile.img': 1,
'profile.qualifica': 1,
} }
} }
} }

View File

@@ -11,3 +11,8 @@
} }
} }
.qualifica{
border: solid 2px #4198ef;
border-radius: 1rem;
padding: 5px;
}

View File

@@ -26,6 +26,8 @@ export default defineComponent({
const $q = useQuasar() const $q = useQuasar()
const { t } = useI18n() const { t } = useI18n()
const animation = ref('fade')
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 filtroutente = ref(<any[]>[]) const filtroutente = ref(<any[]>[])
@@ -92,8 +94,8 @@ export default defineComponent({
showPic, showPic,
myusername, myusername,
userStore, userStore,
$q,
t, t,
animation,
} }
} }
}) })

View File

@@ -19,17 +19,27 @@
</div> </div>
<div class="col-12 text-h7"> <div class="col-12 text-h7">
<span v-if="myuser.profile.born_city">{{ myuser.profile.born_city }}</span> <span <span v-if="myuser.profile.born_city">{{ myuser.profile.born_city }}</span> <span
v-if="myuser.profile.nationality">({{ myuser.profile.nationality }})</span> v-if="myuser.profile.nationality && myuser.profile.nationality !== 'Italia'">({{ myuser.profile.nationality }})</span>
</div> </div>
<div> <div v-if="myuser.username !== userStore.my.username">
<q-btn <q-btn
v-if="!userStore.IsMyFriendByUsername(myuser.username)" v-if="!userStore.IsMyFriendByUsername(myuser.username) && !userStore.IsAskedFriendByUsername(myuser.username)"
icon="fas fa-user-plus" icon="fas fa-user-plus"
color="primary" :label="$t('friends.ask_friend')" color="primary" :label="$t('friends.ask_friend')"
@click="tools.setRequestFriendship($q, t, userStore.my.username, myuser.username, true)"/> @click="tools.setRequestFriendship($q, userStore.my.username, myuser.username, true)"
/>
<q-btn
v-if="userStore.IsAskedFriendByUsername(myuser.username) && !userStore.IsMyFriendByUsername(myuser.username)"
icon="fas fa-user-minus"
flat :label="$t('friends.cancel_ask_friend_short')"
@click="tools.cancelReqFriends($q, userStore.my.username, myuser.username)"
/>
</div> </div>
<div class="col-12 text-h8 q-mt-sm">
<em><span class="qualifica">{{ myuser.profile.qualifica }}</span></em>
</div>
<div class="col-12 text-h8 q-mt-sm"> <div class="col-12 text-h8 q-mt-sm">
{{ myuser.profile.biografia }} {{ myuser.profile.biografia }}
</div> </div>
@@ -103,6 +113,7 @@
<CSkill <CSkill
:filtercustom="filtroutente" :filtercustom="filtroutente"
:butt_modif_new="false" :butt_modif_new="false"
> >
</CSkill> </CSkill>