Lista Città (prese dal server: pickup)
This commit is contained in:
@@ -105,6 +105,19 @@ const routes_admin: IListRoutes[] = [
|
||||
inmenu: true,
|
||||
submenu: 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
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
@@ -45,6 +45,12 @@ module.exports = {
|
||||
Outcoming: 2,
|
||||
},
|
||||
|
||||
Cmd: {
|
||||
PROVINCE: 1,
|
||||
COMUNI: 2,
|
||||
CITIES_SERVER: 3,
|
||||
},
|
||||
|
||||
WalletFinalStatusType: {
|
||||
None: 0,
|
||||
InCommonCash: 1,
|
||||
|
||||
@@ -60,6 +60,7 @@ export const shared_consts = {
|
||||
TAB_COUNTRY: 'countries',
|
||||
TAB_CITIES: 'cities',
|
||||
TAB_PHONES: 'phones',
|
||||
TAB_SITES: 'sites',
|
||||
TAB_SETTINGS: 'settings',
|
||||
|
||||
KEY_TO_CRYPTED: ['PWD_FROM'],
|
||||
@@ -72,6 +73,12 @@ export const shared_consts = {
|
||||
Outcoming: 2,
|
||||
},
|
||||
|
||||
Cmd: {
|
||||
PROVINCE: 1,
|
||||
COMUNI: 2,
|
||||
CITIES_SERVER: 3,
|
||||
},
|
||||
|
||||
BOTTYPE_NONE: 0,
|
||||
BOTTYPE_PAGE: 1,
|
||||
BOTTYPE_LINK: 2,
|
||||
@@ -102,6 +109,89 @@ export const shared_consts = {
|
||||
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: [
|
||||
{
|
||||
value: 'it',
|
||||
|
||||
@@ -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) {
|
||||
const recskills:any = searchList.value.find((rec) => rec.table === 'skills')
|
||||
// console.log('recSubSkill', recSubSkill, 'recskills', recskills)
|
||||
@@ -73,6 +77,7 @@ export default defineComponent({
|
||||
filter: null,
|
||||
addall: true,
|
||||
notinsearch: true,
|
||||
useinput: false,
|
||||
},
|
||||
{
|
||||
label: 'Competenza',
|
||||
@@ -84,6 +89,7 @@ export default defineComponent({
|
||||
addall: true,
|
||||
filter: getFilterSkills,
|
||||
showcount: true,
|
||||
useinput: true,
|
||||
},
|
||||
{
|
||||
label: 'Specializz.',
|
||||
@@ -95,15 +101,28 @@ export default defineComponent({
|
||||
addall: true,
|
||||
filter: getFilterSubSkills,
|
||||
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',
|
||||
table: 'cities',
|
||||
key: 'idCity',
|
||||
type: costanti.FieldType.multiselect_by_server,
|
||||
value: 0,
|
||||
type: costanti.FieldType.multiselect,
|
||||
arrvalue: tools.getCookie(tools.COOK_SEARCH + 'cities', [costanti.FILTER_TUTTI]),
|
||||
filter: null,
|
||||
useinput: true,
|
||||
tablesel: 'cities',
|
||||
},
|
||||
{
|
||||
label: 'Livello',
|
||||
@@ -113,6 +132,7 @@ export default defineComponent({
|
||||
arrvalue: [],
|
||||
type: costanti.FieldType.select,
|
||||
filter: null,
|
||||
useinput: false,
|
||||
},
|
||||
{
|
||||
label: 'Stato',
|
||||
@@ -122,6 +142,7 @@ export default defineComponent({
|
||||
arrvalue: tools.getCookie(tools.COOK_SEARCH + 'statusSkills', [costanti.FILTER_TUTTI]),
|
||||
type: costanti.FieldType.multiselect,
|
||||
filter: null,
|
||||
useinput: false,
|
||||
},
|
||||
{
|
||||
label: 'Contributo',
|
||||
@@ -131,6 +152,7 @@ export default defineComponent({
|
||||
arrvalue: tools.getCookie(tools.COOK_SEARCH + 'contribtypes', [costanti.FILTER_TUTTI]),
|
||||
type: costanti.FieldType.multiselect,
|
||||
filter: null,
|
||||
useinput: false,
|
||||
},
|
||||
|
||||
]
|
||||
@@ -208,7 +230,10 @@ export default defineComponent({
|
||||
userId: 1,
|
||||
username: 1,
|
||||
name: 1,
|
||||
surname: 1
|
||||
surname: 1,
|
||||
comune: 1,
|
||||
'profile.img': 1,
|
||||
'profile.qualifica': 1,
|
||||
}
|
||||
},
|
||||
lookup3: {
|
||||
@@ -225,6 +250,13 @@ export default defineComponent({
|
||||
lk_as: 'myskill',
|
||||
af_objId_tab: '',
|
||||
},
|
||||
lookup5: {
|
||||
lk_tab: 'cities',
|
||||
lk_LF: 'idCity',
|
||||
lk_FF: '_id',
|
||||
lk_as: 'comune',
|
||||
af_objId_tab: '',
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -227,6 +227,8 @@ export default defineComponent({
|
||||
|
||||
const mycodeid = toRef(props, 'prop_codeId')
|
||||
|
||||
const myvertical = ref(0)
|
||||
|
||||
const valoriopt = computed(() => (item: any, addall: boolean) => {
|
||||
// console.log('valoriopt', item.table)
|
||||
return globalStore.getTableJoinByName(item.table, addall, item.filter)
|
||||
@@ -730,7 +732,9 @@ export default defineComponent({
|
||||
const mysub = elem.subfield ? elem.subfield : ''
|
||||
if (elem) {
|
||||
if (elem.field !== costanti.NOFIELD) {
|
||||
colVisib.value.push(elem.field + mysub)
|
||||
if (checkIfColShow(elem.field)) {
|
||||
colVisib.value.push(elem.field + mysub)
|
||||
}
|
||||
}
|
||||
|
||||
if (elem.visible && elem.field === costanti.NOFIELD) {
|
||||
@@ -792,6 +796,11 @@ export default defineComponent({
|
||||
mycolumns.value = props.prop_mycolumns
|
||||
colkey.value = props.prop_colkey
|
||||
pagination.value = props.prop_pagination
|
||||
|
||||
myvertical.value = props.vertical ? -1 : 0
|
||||
if (props.finder) {
|
||||
myvertical.value = tools.getCookie('myv', 0)
|
||||
}
|
||||
}
|
||||
|
||||
function mounted() {
|
||||
@@ -799,10 +808,12 @@ export default defineComponent({
|
||||
|
||||
console.log('props.filtercustom', props.filtercustom)
|
||||
|
||||
|
||||
if (!!props.tablesList) {
|
||||
canEdit.value = tools.getCookie(tools.CAN_EDIT, canEdit) === 'true'
|
||||
tablesel.value = tools.getCookie('tablesel', tablesel.value)
|
||||
}
|
||||
|
||||
myfilterand.value = props.filterdef
|
||||
// myfiltercustom.value = props.filtercustom
|
||||
// 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) {
|
||||
// console.log('changecol', mytable.value)
|
||||
if (!!mytable.value) {
|
||||
@@ -993,8 +1014,11 @@ export default defineComponent({
|
||||
colVisib.value = myselcol.split('|')
|
||||
} else {
|
||||
mycolumns.value.forEach((elem: any) => {
|
||||
if (elem.field !== costanti.NOFIELD)
|
||||
colVisib.value.push(elem.field + elem.subfield)
|
||||
if (elem.field !== costanti.NOFIELD) {
|
||||
if (checkIfColShow(elem.field)) {
|
||||
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'
|
||||
}
|
||||
|
||||
|
||||
// onMounted(mounted)
|
||||
|
||||
created()
|
||||
@@ -1236,6 +1259,7 @@ export default defineComponent({
|
||||
valoriopt,
|
||||
labelcombo,
|
||||
filter,
|
||||
myvertical,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<q-spinner-tail size="2em" color="primary"/>
|
||||
</q-inner-loading>
|
||||
<q-table
|
||||
:grid="vertical"
|
||||
:grid="myvertical === -1 || myvertical === 2"
|
||||
flat
|
||||
bordered
|
||||
class="my-sticky-header-table"
|
||||
@@ -102,22 +102,46 @@
|
||||
:class="$q.screen.lt.sm ? `` : `row` + ` text-blue`">
|
||||
<span v-for="(item, index) in searchList" :key="index">
|
||||
<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)"
|
||||
v-model:value="item.value"
|
||||
@update:value="searchval(item.value, item.table)"
|
||||
:addall="true"
|
||||
:tablesel="item.type === costanti.FieldType.select_by_server ? item.tablesel : ''"
|
||||
:pickup="item.type === costanti.FieldType.select_by_server"
|
||||
label-color="primary"
|
||||
class="combowidth"
|
||||
color="primary"
|
||||
:optval="fieldsTable.getKeyByTable(item.table)"
|
||||
:optlab="fieldsTable.getLabelByTable(item.table)"
|
||||
: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>
|
||||
|
||||
<q-select
|
||||
v-if="item.type === costanti.FieldType.multiselect"
|
||||
v-if="(item.type === costanti.FieldType.multiselect)"
|
||||
v-model="item.arrvalue"
|
||||
label-color="primary"
|
||||
:label="labelcombo(item)"
|
||||
@@ -130,6 +154,7 @@
|
||||
emit-value
|
||||
map-options
|
||||
stack-label
|
||||
:useinput="item.useinput"
|
||||
:options="valoriopt(item, item.addall)"
|
||||
class="combowidth"
|
||||
:option-value="fieldsTable.getKeyByTable(item.table)"
|
||||
@@ -202,7 +227,14 @@
|
||||
|
||||
</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 v-slot:body="props">
|
||||
@@ -251,7 +283,7 @@
|
||||
|
||||
|
||||
<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>
|
||||
<CMyFriends
|
||||
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"
|
||||
: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">
|
||||
<span class="ellipsis"> {{ props.row[col_title] }} </span>
|
||||
<q-space/>
|
||||
@@ -352,6 +384,7 @@
|
||||
:mycol="mycol"
|
||||
:showall="true"
|
||||
:row="rowclicksel"
|
||||
:tablesel="col.tablesel"
|
||||
:field="mycol.field"
|
||||
:subfield="mycol.subfield"
|
||||
@save="SaveValdb"
|
||||
@@ -378,7 +411,6 @@
|
||||
<div
|
||||
v-if="colVisib.includes(col.field + col.subfield) && col.foredit">
|
||||
<div class="">
|
||||
|
||||
<CMyPopupEdit
|
||||
:table="mytable"
|
||||
:canEdit="true"
|
||||
@@ -387,6 +419,7 @@
|
||||
v-model:row="newRecord"
|
||||
:field="col.field"
|
||||
:subfield="col.subfield"
|
||||
:tablesel="col.tablesel"
|
||||
:isInModif="true"
|
||||
minuteinterval="1"
|
||||
:visulabel="true"
|
||||
@@ -424,6 +457,7 @@
|
||||
:table="mytable"
|
||||
:canEdit="true"
|
||||
:canModify="canModifyThisRec(recModif)"
|
||||
:tablesel="col.tablesel"
|
||||
:mycol="col"
|
||||
:isInModif="true"
|
||||
v-model:row="recModif"
|
||||
|
||||
@@ -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) {
|
||||
$q.dialog({
|
||||
@@ -269,13 +253,13 @@ export default defineComponent({
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.BLOCK_USER) {
|
||||
blockUser(usernameDest)
|
||||
} 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) {
|
||||
tools.setRequestFriendship($q, t, username.value, usernameDest, value)
|
||||
tools.setRequestFriendship($q, username.value, usernameDest, value)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.REFUSE_REQ_FRIEND) {
|
||||
refuseReqFriends(usernameDest)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.CANCEL_REQ_FRIEND) {
|
||||
cancelReqFriends(usernameDest)
|
||||
tools.cancelReqFriends($q, username.value, usernameDest)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ export default defineComponent({
|
||||
const userStore = useUserStore()
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
const myvalue = ref(<any>'')
|
||||
const myvalue = ref(<any>null)
|
||||
const myvalueprec = ref('false')
|
||||
const countryname = ref('')
|
||||
const visueditor = ref(false)
|
||||
@@ -445,7 +445,7 @@ export default defineComponent({
|
||||
return '[---]'
|
||||
else
|
||||
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)
|
||||
return '[---]'
|
||||
else
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div :class="getclassCol(col)">
|
||||
<div v-if="(visInNewRec(col) && visulabel) || !visulabel " style="flex-grow: 1;">
|
||||
<div
|
||||
:class="{ flex: true, 'justify-center': true }">
|
||||
:class="{ flex: !isInModif, 'justify-center': true }">
|
||||
<div>
|
||||
<!-- Edit Value -->
|
||||
<div v-if="col.fieldtype === costanti.FieldType.boolean">
|
||||
@@ -31,11 +31,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<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
|
||||
v-bind="$attrs"
|
||||
v-model="myvalue"
|
||||
autogrow
|
||||
counter
|
||||
:disable="disable"
|
||||
:readonly="disable"
|
||||
@keyup.enter.stop
|
||||
@@ -50,6 +51,10 @@
|
||||
color="white" text-color="blue" icon="person" :to="col.link.replace(col.name, myvalue)">
|
||||
<span :class="{disabled: disable }">{{ myvalue }}</span>
|
||||
</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"
|
||||
color="primary" icon="person" :to="col.link.replace(col.name, myvalue)">{{ myvalue }}
|
||||
</q-btn>
|
||||
@@ -279,11 +284,13 @@
|
||||
:opticon="fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
|
||||
</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">
|
||||
<CMySelect
|
||||
:label="col.label"
|
||||
v-model:value="myvalue"
|
||||
:pickup="col.fieldtype === costanti.FieldType.select_by_server"
|
||||
:tablesel="col.type === costanti.FieldType.select_by_server ? tablesel : ''"
|
||||
@update:value="changevalRec"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
@@ -303,6 +310,27 @@
|
||||
:opticon="fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
|
||||
</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-if="isInModif">
|
||||
<CMySelect
|
||||
@@ -330,6 +358,9 @@
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.html">
|
||||
<div v-if="isInModif">
|
||||
<div v-if="insertMode">
|
||||
|
||||
</div>
|
||||
<div v-if="!isFieldDb()">
|
||||
<CMyEditor
|
||||
v-model:value="myvalue" :title="col.title" @keyup.enter.stop
|
||||
@@ -414,6 +445,7 @@
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.string">
|
||||
<q-input
|
||||
v-bind="$attrs"
|
||||
counter
|
||||
v-model="scope.value"
|
||||
autogrow
|
||||
@keyup.enter.stop
|
||||
@@ -464,16 +496,66 @@
|
||||
</q-input>
|
||||
</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
|
||||
:label="col.label"
|
||||
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)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:options="globalStore.getTableJoinByName(col.jointable)"
|
||||
:useinput="false">
|
||||
</CMySelect>
|
||||
</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 class="justify-center q-gutter-sm clgutter q-mt-sm">
|
||||
<CMySelect
|
||||
@@ -514,37 +596,6 @@
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)">
|
||||
</CMyToggleList>
|
||||
</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">
|
||||
<CMySelect
|
||||
:label="col.label"
|
||||
|
||||
@@ -9,12 +9,19 @@ import { shared_consts } from '@/common/shared_vuejs'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMySelect',
|
||||
emits: ['update:value', 'changeval'],
|
||||
emits: ['update:value', 'update:arrvalue', 'changeval'],
|
||||
props: {
|
||||
options: {
|
||||
type: Array,
|
||||
required: true,
|
||||
},
|
||||
arrvalue: {
|
||||
type: Array,
|
||||
required: false,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
},
|
||||
value: [String, Number],
|
||||
label: {
|
||||
type: String,
|
||||
@@ -68,6 +75,10 @@ export default defineComponent({
|
||||
type: Function,
|
||||
required: false,
|
||||
},
|
||||
multiselect_by_server: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
}
|
||||
},
|
||||
components: {},
|
||||
setup(props, { emit }) {
|
||||
@@ -80,6 +91,8 @@ export default defineComponent({
|
||||
const valori = ref(<any>[])
|
||||
|
||||
const myvalue = ref(<string | number>'')
|
||||
const myarrvalue = ref(<any[]>[])
|
||||
const arrtempOpt = ref(<any[]>[])
|
||||
|
||||
const valoriload = computed(() => {
|
||||
let myarr = props.options
|
||||
@@ -97,78 +110,167 @@ export default defineComponent({
|
||||
})
|
||||
|
||||
watch(() => props.options, (value: any, oldval: any) => {
|
||||
valori.value = valoriload.value
|
||||
if (!props.multiselect_by_server) {
|
||||
valori.value = valoriload.value
|
||||
// console.log('@@@ VALORI CHANGED (1)', valori.value)
|
||||
}
|
||||
},
|
||||
)
|
||||
watch(() => props.value, (value: any, oldval: any) => {
|
||||
mounted()
|
||||
mounted()
|
||||
},
|
||||
)
|
||||
|
||||
watch(() => props.arrvalue, (value: any, oldval: any) => {
|
||||
console.log(' MODIF props.arrvalue', props.arrvalue)
|
||||
// mounted()
|
||||
},
|
||||
)
|
||||
|
||||
function changeval(newval: any) {
|
||||
if (props.tablesel === shared_consts.TAB_COUNTRY)
|
||||
myvalue.value = newval && newval['value'] ? newval['value'] : newval
|
||||
else if (props.tablesel === shared_consts.TAB_PHONES)
|
||||
myvalue.value = newval && newval['code'] ? newval['code'] : newval
|
||||
else
|
||||
myvalue.value = newval
|
||||
console.log('Myselect changeval', myvalue.value)
|
||||
emit('update:value', myvalue.value)
|
||||
emit('changeval', myvalue.value)
|
||||
}
|
||||
function saveOptInCookie(arrval: any) {
|
||||
|
||||
function mounted() {
|
||||
// console.log('mounted myselect', props.options)
|
||||
if (props.options) {
|
||||
const rec: any = props.options.find((myrec: any) => myrec[`${props.optval}`] === props.value)
|
||||
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)
|
||||
|
||||
if (rec) {
|
||||
if (props.funcgetvaluebyid)
|
||||
myvalue.value = props.funcgetvaluebyid(rec[`${props.optval}`])
|
||||
else
|
||||
myvalue.value = rec[`${props.optlab}`]
|
||||
} else {
|
||||
if (!props.useinput) {
|
||||
if (props.value) {
|
||||
myvalue.value = props.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) {
|
||||
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)
|
||||
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)
|
||||
myvalue.value = newval && newval['code'] ? newval['code'] : newval
|
||||
else
|
||||
myvalue.value = newval
|
||||
console.log('Myselect changeval', myvalue.value)
|
||||
emit('update:value', myvalue.value)
|
||||
emit('changeval', myvalue.value)
|
||||
}
|
||||
}
|
||||
|
||||
function mounted() {
|
||||
console.log(' #### mounted myselect', props.options, 'arrvalue', myarrvalue.value)
|
||||
let rec: any
|
||||
if (props.options) {
|
||||
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 (props.funcgetvaluebyid)
|
||||
myvalue.value = props.funcgetvaluebyid(rec[`${props.optval}`])
|
||||
else
|
||||
myvalue.value = rec[`${props.optlab}`]
|
||||
} else {
|
||||
// if (!props.useinput) {
|
||||
if (props.value) {
|
||||
myvalue.value = props.value
|
||||
}
|
||||
// }
|
||||
}
|
||||
// console.log('cmyselect: myvalue.value', myvalue.value)
|
||||
}
|
||||
|
||||
function filterFn(val: any, update: any, abort: any) {
|
||||
update(
|
||||
async () => {
|
||||
() => {
|
||||
console.log('Filter val', val, val.length)
|
||||
let myarr: any = []
|
||||
|
||||
if (val.length < 1) {
|
||||
abort()
|
||||
if (val.length <= 1) {
|
||||
valori.value = arrtempOpt.value
|
||||
return
|
||||
}
|
||||
|
||||
let mystr = val.toLocaleLowerCase()
|
||||
|
||||
console.log('props.tablesel', props.tablesel)
|
||||
|
||||
if (fieldsTable.tableRemotePickup.includes(props.tablesel)) {
|
||||
// if (myvalue.value.length > 1) {
|
||||
try {
|
||||
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
|
||||
}
|
||||
}catch (e) {
|
||||
abort()
|
||||
} catch (e) {
|
||||
valori.value = arrtempOpt.value
|
||||
return
|
||||
}
|
||||
// const needle = val.toLocaleLowerCase()
|
||||
// optFiltered.value = optFiltered.value.filter((v: any) => v.toLocaleLowerCase().indexOf(needle) > -1)
|
||||
// }
|
||||
} else {
|
||||
myarr = props.options
|
||||
}
|
||||
@@ -183,9 +285,14 @@ export default defineComponent({
|
||||
myarr = [myobj, ...myarr]
|
||||
}
|
||||
|
||||
valori.value = myarr
|
||||
if (myarr.length > 0) {
|
||||
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: 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)
|
||||
|
||||
valori.value = valoriload.value
|
||||
if (!props.multiselect_by_server) {
|
||||
valori.value = valoriload.value
|
||||
console.log('@@@ VALORI CHANGED (4)', valori.value)
|
||||
} else {
|
||||
valori.value = arrtempOpt.value
|
||||
}
|
||||
|
||||
return {
|
||||
changeval,
|
||||
myvalue,
|
||||
myarrvalue,
|
||||
valori,
|
||||
filterFn,
|
||||
fieldsTable,
|
||||
checkIfShowRec,
|
||||
abortFilterFn,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,6 +1,69 @@
|
||||
<template>
|
||||
<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
|
||||
:multiple="multiple"
|
||||
rounded
|
||||
@@ -9,6 +72,7 @@
|
||||
:input-class="myclass"
|
||||
:model-value="myvalue"
|
||||
:use-input="useinput"
|
||||
@filter="filterFn"
|
||||
input-debounce="0"
|
||||
@new-value="newvaluefunc"
|
||||
new-value-mode="add-unique"
|
||||
@@ -52,11 +116,8 @@
|
||||
</template>
|
||||
<template v-slot:option="scope">
|
||||
<q-item v-bind="scope.itemProps">
|
||||
<q-item-section avatar>
|
||||
{{ scope.opt.flag }}
|
||||
</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>
|
||||
</template>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<q-item-section @click="naviga(`/my/` + contact.username)">
|
||||
<q-item-label><strong>{{ contact.name }} {{ contact.surname }}</strong> ({{ contact.username }})
|
||||
</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 side v-if="visu === costanti.FRIENDS">
|
||||
|
||||
@@ -97,18 +97,47 @@ export default defineComponent({
|
||||
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
|
||||
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,
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -124,13 +124,22 @@
|
||||
</q-badge>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
class="q-mx-xs" v-if="static_data.functionality.SHOW_USER_MENU && isLogged()" round dense flat
|
||||
<!--<q-avatar v-if="static_data.functionality.SHOW_USER_MENU && isLogged()"
|
||||
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()">
|
||||
<!--<q-badge v-if="isSocio" color="green" floating transparent>
|
||||
s
|
||||
</q-badge>-->
|
||||
</q-btn>
|
||||
</q-btn>-->
|
||||
|
||||
</q-toolbar>
|
||||
|
||||
@@ -169,7 +178,11 @@
|
||||
<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>
|
||||
|
||||
<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
|
||||
class="absolute-top-right" style="margin-right: 10px; color: white;"
|
||||
|
||||
@@ -903,6 +903,18 @@ $heightBtn: 100%;
|
||||
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 {
|
||||
width: -webkit-fill-available;
|
||||
}
|
||||
|
||||
448
src/db/data/popolazione.js
Normal file
448
src/db/data/popolazione.js
Normal file
File diff suppressed because one or more lines are too long
@@ -105,6 +105,19 @@ const routes_admin: IListRoutes[] = [
|
||||
inmenu: true,
|
||||
submenu: 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
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { IListRoutes } from '@src/model'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
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 { static_data } from '@/db/static_data'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'MenuOne',
|
||||
@@ -17,12 +18,17 @@ export default defineComponent({
|
||||
|
||||
setup(props) {
|
||||
const route = useRoute()
|
||||
const userStore = useUserStore()
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
const finishLoading = computed(() => globalStore.finishLoading)
|
||||
|
||||
const path = computed(() => route.path)
|
||||
|
||||
const getroutes = computed(() => static_data.routes)
|
||||
|
||||
const myroutes = ref(<IListRoutes[]>[])
|
||||
|
||||
function getmenu(): any {
|
||||
// console.log('getmenu menuOne!')
|
||||
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
|
||||
// console.log('watch:', mymenu)
|
||||
Object.keys(mymenu).forEach((parentName: any) => {
|
||||
@@ -80,6 +91,8 @@ export default defineComponent({
|
||||
return menu
|
||||
}
|
||||
|
||||
myroutes.value = static_data.routes
|
||||
|
||||
return {
|
||||
getmenu,
|
||||
finishLoading,
|
||||
@@ -87,6 +100,8 @@ export default defineComponent({
|
||||
getroute,
|
||||
static_data,
|
||||
tools,
|
||||
getroutes,
|
||||
myroutes,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<q-list class="rounded-borders text-primary">
|
||||
<div v-for="ind1 in getmenu()" :key="ind1">
|
||||
<!--<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.routes2 && myitemmenu.inmenu && tools.visumenu(myitemmenu)">
|
||||
|
||||
|
||||
@@ -501,6 +501,7 @@ export interface IColGridTable {
|
||||
resultjoin?: string[]
|
||||
visuonlyEditVal?: boolean
|
||||
notShowInNewRec?: boolean
|
||||
tablesel?: string
|
||||
}
|
||||
|
||||
export interface ITableRec {
|
||||
@@ -523,9 +524,11 @@ export interface ISearchList {
|
||||
value: any
|
||||
type: number
|
||||
filter: any
|
||||
useinput: boolean
|
||||
notinsearch?: boolean
|
||||
addall?: boolean
|
||||
showcount?: boolean
|
||||
tablesel?: string
|
||||
}
|
||||
|
||||
export interface IFilter {
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
<!--<CMapsEsempio></CMapsEsempio>-->
|
||||
|
||||
|
||||
<div v-if="isLogged()">
|
||||
<CVerifyEmail v-if="!isEmailVerified()">
|
||||
|
||||
@@ -22,6 +21,7 @@
|
||||
</CVerifyTelegram>
|
||||
|
||||
|
||||
|
||||
<div v-if="isUserOk()">
|
||||
<CFinder>
|
||||
|
||||
|
||||
0
src/rootgen/admin/importdata/importdata.scss
Executable file
0
src/rootgen/admin/importdata/importdata.scss
Executable file
144
src/rootgen/admin/importdata/importdata.ts
Executable file
144
src/rootgen/admin/importdata/importdata.ts
Executable 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,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
30
src/rootgen/admin/importdata/importdata.vue
Executable file
30
src/rootgen/admin/importdata/importdata.vue
Executable 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>
|
||||
@@ -32,6 +32,7 @@ const msg_it = {
|
||||
sito_offline: 'Sito in Aggiornamento',
|
||||
modifprof: 'Modifica Profilo',
|
||||
biografia: 'Biografia',
|
||||
qualifica: 'Qualifica (in breve)',
|
||||
update: 'Aggiornamento in Corso...',
|
||||
error404: 'error404',
|
||||
error404def: 'error404def',
|
||||
@@ -59,6 +60,7 @@ const msg_it = {
|
||||
manager: 'Segreteria',
|
||||
nessuno: 'Nessuno',
|
||||
sendpushnotif: 'Invia Msg Push',
|
||||
importfile: 'Importa File',
|
||||
},
|
||||
messages: {
|
||||
menu: 'I tuoi Messaggi',
|
||||
@@ -851,6 +853,7 @@ const msg_it = {
|
||||
block_user: 'Blocca Utente',
|
||||
ask_friend: 'Chiedi l\'Amicizia',
|
||||
cancel_ask_friend: 'Annulla la richiesta di Amicizia',
|
||||
cancel_ask_friend_short: 'Annulla richiesta',
|
||||
reject_ask_friend: 'Rifiuta la richiesta di Amicizia',
|
||||
}
|
||||
},
|
||||
|
||||
@@ -54,6 +54,8 @@ export const costanti = {
|
||||
listimages: 1024,
|
||||
exact: 2048,
|
||||
image: 3000,
|
||||
select_by_server: 4000,
|
||||
multiselect_by_server: 4010,
|
||||
nationality: 4096,
|
||||
intcode: 5000,
|
||||
multioption: 6000,
|
||||
@@ -76,6 +78,7 @@ export const costanti = {
|
||||
TESTO: 1,
|
||||
LINK: 2,
|
||||
BUTTON: 3,
|
||||
LINKIMG: 4,
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
@@ -63,6 +63,7 @@ function AddCol(params: IColGridTable) {
|
||||
link: (params.link === undefined) ? '' : params.link,
|
||||
visuonlyEditVal: (params.visuonlyEditVal === undefined) ? false : params.visuonlyEditVal,
|
||||
askaction: (params.askaction === undefined) ? '' : params.askaction,
|
||||
tablesel: (params.tablesel === undefined) ? '' : params.tablesel,
|
||||
jointable: (params.jointable === undefined) ? '' : params.jointable,
|
||||
notShowInNewRec: (params.notShowInNewRec === undefined) ? false : params.notShowInNewRec,
|
||||
}
|
||||
@@ -333,7 +334,7 @@ export const colCitys = [
|
||||
AddCol({ name: 'reg', label_trans: 'city.reg' }),
|
||||
AddCol({ name: 'pref', label_trans: 'city.pref' }),
|
||||
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(DeleteRec),
|
||||
AddCol(DuplicateRec),
|
||||
@@ -441,8 +442,9 @@ export const colmySkills = [
|
||||
AddCol({
|
||||
name: 'idCity',
|
||||
label_trans: 'skill.city',
|
||||
fieldtype: costanti.FieldType.multiselect,
|
||||
fieldtype: costanti.FieldType.multiselect_by_server,
|
||||
jointable: 'cities',
|
||||
tablesel: 'cities',
|
||||
}),
|
||||
AddCol({
|
||||
name: 'photos',
|
||||
@@ -450,7 +452,7 @@ export const colmySkills = [
|
||||
fieldtype: costanti.FieldType.listimages,
|
||||
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(DuplicateRec),
|
||||
AddCol(ModifRec),
|
||||
@@ -1403,6 +1405,7 @@ export const fieldsTable = {
|
||||
}),
|
||||
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.qualifica', field: 'profile', subfield: 'qualifica', label_trans: 'reg.qualifica', }),
|
||||
AddCol({
|
||||
name: 'profile.paymenttypes',
|
||||
field: 'profile',
|
||||
@@ -1692,6 +1695,15 @@ export const fieldsTable = {
|
||||
colicon: 'icon',
|
||||
noshow: true,
|
||||
},
|
||||
{
|
||||
value: 'regions',
|
||||
label: 'Regioni',
|
||||
columns: colTablePermission,
|
||||
colkey: 'value',
|
||||
collabel: 'label',
|
||||
colicon: 'icon',
|
||||
noshow: true,
|
||||
},
|
||||
{
|
||||
value: 'accepted',
|
||||
label: 'Condizioni',
|
||||
@@ -1764,10 +1776,11 @@ export const fieldsTable = {
|
||||
},
|
||||
{
|
||||
value: 'cities',
|
||||
label: 'Città',
|
||||
label: 'Comune',
|
||||
columns: colCitys,
|
||||
colkey: '_id',
|
||||
collabel: 'comune',
|
||||
remote: true,
|
||||
},
|
||||
{
|
||||
value: 'countries',
|
||||
|
||||
@@ -4390,7 +4390,7 @@ export const tools = {
|
||||
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()
|
||||
$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()
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -876,6 +876,19 @@ export const useUserStore = defineStore('UserStore', {
|
||||
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 {}
|
||||
})
|
||||
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -233,8 +233,6 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
return state.statusSkills
|
||||
else if (table === 'sectors')
|
||||
return state.sectors
|
||||
else if (table === 'cities')
|
||||
return state.cities
|
||||
else {
|
||||
return ris
|
||||
}
|
||||
@@ -1296,6 +1294,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
if (table === 'bottype') return shared_consts.BotType
|
||||
if (table === 'visibility') return shared_consts.Visibility
|
||||
if (table === 'lang') return shared_consts.Lang
|
||||
if (table === 'regions') return shared_consts.Regions
|
||||
|
||||
let myarr = this.getListByTable(table)
|
||||
|
||||
|
||||
@@ -75,12 +75,22 @@
|
||||
</CMyFieldDb>
|
||||
</div>
|
||||
|
||||
<CMyFieldDb
|
||||
title="Qualifica"
|
||||
table="users"
|
||||
mykey="profile"
|
||||
mysubkey="qualifica"
|
||||
maxlength="40"
|
||||
:showall="true"
|
||||
:type="costanti.FieldType.string">
|
||||
</CMyFieldDb>
|
||||
|
||||
<CMyFieldDb
|
||||
title="Biografia"
|
||||
table="users"
|
||||
mykey="profile"
|
||||
mysubkey="biografia"
|
||||
maxlength="200"
|
||||
maxlength="300"
|
||||
:showall="true"
|
||||
:type="costanti.FieldType.string">
|
||||
</CMyFieldDb>
|
||||
|
||||
@@ -50,6 +50,7 @@ export default defineComponent({
|
||||
username: 1,
|
||||
name: 1,
|
||||
'profile.img': 1,
|
||||
'profile.qualifica': 1,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,3 +11,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
.qualifica{
|
||||
border: solid 2px #4198ef;
|
||||
border-radius: 1rem;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@ export default defineComponent({
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
|
||||
const animation = ref('fade')
|
||||
|
||||
const username = computed(() => $route.params.username ? $route.params.username.toString() : userStore.my.username)
|
||||
|
||||
const filtroutente = ref(<any[]>[])
|
||||
@@ -92,8 +94,8 @@ export default defineComponent({
|
||||
showPic,
|
||||
myusername,
|
||||
userStore,
|
||||
$q,
|
||||
t,
|
||||
animation,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -19,17 +19,27 @@
|
||||
</div>
|
||||
<div class="col-12 text-h7">
|
||||
<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 v-if="myuser.username !== userStore.my.username">
|
||||
<q-btn
|
||||
v-if="!userStore.IsMyFriendByUsername(myuser.username)"
|
||||
v-if="!userStore.IsMyFriendByUsername(myuser.username) && !userStore.IsAskedFriendByUsername(myuser.username)"
|
||||
icon="fas fa-user-plus"
|
||||
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 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">
|
||||
{{ myuser.profile.biografia }}
|
||||
</div>
|
||||
@@ -103,6 +113,7 @@
|
||||
<CSkill
|
||||
:filtercustom="filtroutente"
|
||||
:butt_modif_new="false"
|
||||
|
||||
>
|
||||
|
||||
</CSkill>
|
||||
|
||||
Reference in New Issue
Block a user