- User Profile
- DashBoard start
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
import Vue from 'vue'
|
|
||||||
import VueIdb from 'vue-idb'
|
import VueIdb from 'vue-idb'
|
||||||
|
|
||||||
export default ({ Vue }) => {
|
export default ({ Vue }) => {
|
||||||
|
|||||||
@@ -17,6 +17,6 @@ export class Patterns {
|
|||||||
*
|
*
|
||||||
* 8 to 20 characters string with at least one digit, one upper case letter, one lower case letter and one special symbol
|
* 8 to 20 characters string with at least one digit, one upper case letter, one lower case letter and one special symbol
|
||||||
*/
|
*/
|
||||||
public static Password: RegExp = /^((?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,30})/i
|
public static Password: RegExp = /^((?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,20})/i
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export default class CGridTableRec extends Vue {
|
|||||||
public mytable: string
|
public mytable: string
|
||||||
public mytitle: string
|
public mytitle: string
|
||||||
public mycolumns: any[]
|
public mycolumns: any[]
|
||||||
public colkey: string
|
public colkey: string = ''
|
||||||
public search: string = ''
|
public search: string = ''
|
||||||
|
|
||||||
public tablesel: string = ''
|
public tablesel: string = ''
|
||||||
@@ -66,7 +66,7 @@ export default class CGridTableRec extends Vue {
|
|||||||
public rowclicksel: any = null
|
public rowclicksel: any = null
|
||||||
public colclicksel: any = null
|
public colclicksel: any = null
|
||||||
|
|
||||||
public selected: any = []
|
public selected = []
|
||||||
|
|
||||||
get lists() {
|
get lists() {
|
||||||
return lists
|
return lists
|
||||||
@@ -517,8 +517,11 @@ export default class CGridTableRec extends Vue {
|
|||||||
|
|
||||||
public clickrowcol(row, col) {
|
public clickrowcol(row, col) {
|
||||||
if (!this.canEdit) {
|
if (!this.canEdit) {
|
||||||
if (this.rowclicksel) {
|
if (!this.selected[0]) {
|
||||||
|
const uguali = this.rowclicksel._id === row._id
|
||||||
|
console.log('id', this.rowclicksel._id, 'id2', row._id)
|
||||||
this.rowclicksel = null
|
this.rowclicksel = null
|
||||||
|
this.colclicksel = null
|
||||||
} else {
|
} else {
|
||||||
this.rowclicksel = row
|
this.rowclicksel = row
|
||||||
this.colclicksel = col
|
this.colclicksel = col
|
||||||
@@ -532,4 +535,19 @@ export default class CGridTableRec extends Vue {
|
|||||||
else
|
else
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
public getSelectedString() {
|
||||||
|
return this.selected.length === 0 ? '' : `${this.selected.length} record${this.selected.length > 1 ? 's' : ''} selected of ${this.serverData.length}`
|
||||||
|
}
|
||||||
|
public selectionclick(details) {
|
||||||
|
console.log('selectionclick this.selected', this.selected, 'details', details)
|
||||||
|
if (details.added) {
|
||||||
|
this.rowclicksel = details.rows[0]
|
||||||
|
this.colclicksel = details.keys[0]
|
||||||
|
} else {
|
||||||
|
this.rowclicksel = null
|
||||||
|
this.colclicksel = null
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('this.rowclicksel', this.rowclicksel)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,168 +1,181 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="q-pa-xs">
|
<div class="q-pa-xs">
|
||||||
|
|
||||||
<q-table
|
|
||||||
:data="serverData"
|
<q-table
|
||||||
:columns="mycolumns"
|
:data="serverData"
|
||||||
:filter="myfilter"
|
:columns="mycolumns"
|
||||||
:pagination.sync="pagination"
|
:filter="myfilter"
|
||||||
:row-key="colkey"
|
:pagination.sync="pagination"
|
||||||
:loading="loading"
|
:row-key="colkey"
|
||||||
@request="onRequest"
|
:loading="loading"
|
||||||
binary-state-sort
|
@request="onRequest"
|
||||||
:visible-columns="colVisib"
|
@selection="selectionclick"
|
||||||
:no-data-label="nodataLabel"
|
binary-state-sort
|
||||||
:no-results-label="noresultLabel"
|
:visible-columns="colVisib"
|
||||||
|
:no-data-label="nodataLabel"
|
||||||
|
:no-results-label="noresultLabel"
|
||||||
|
:selected-rows-label="getSelectedString"
|
||||||
|
selection="single"
|
||||||
|
:selected.sync="selected"
|
||||||
|
>
|
||||||
|
|
||||||
|
<template v-slot:header="props">
|
||||||
|
<q-tr :props="props">
|
||||||
|
<q-th>
|
||||||
|
|
||||||
|
</q-th>
|
||||||
|
<q-th
|
||||||
|
v-for="col in props.cols"
|
||||||
|
v-if="colVisib.includes(col.field + col.subfield)"
|
||||||
|
:key="col.name"
|
||||||
|
:props="props"
|
||||||
|
class="text-italic text-weight-bold"
|
||||||
|
>
|
||||||
|
{{ col.label }}
|
||||||
|
</q-th>
|
||||||
|
</q-tr>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template v-slot:top="props">
|
||||||
|
<div class="col-2 q-table__title">{{ mytitle }}</div>
|
||||||
|
|
||||||
|
<!--<p style="color:red"> Rows: {{ getrows }}</p>-->
|
||||||
|
|
||||||
|
<q-input v-model="search" filled dense type="search" debounce="500" hint="Search"
|
||||||
|
v-on:keyup.enter="doSearch">
|
||||||
|
<template v-slot:after>
|
||||||
|
<q-btn v-if="mytable" label="" color="primary" @click="refresh" icon="search"></q-btn>
|
||||||
|
</template>
|
||||||
|
</q-input>
|
||||||
|
<q-toggle v-if="mytable" v-model="canEdit" :val="lists.MenuAction.CAN_EDIT_TABLE" class="q-mx-sm"
|
||||||
|
:label="$t('grid.editvalues')" @input="changefuncAct"
|
||||||
|
></q-toggle>
|
||||||
|
|
||||||
|
<q-btn v-if="mytable" flat dense color="primary" :disable="loading || !canEdit"
|
||||||
|
:label="$t('grid.addrecord')"
|
||||||
|
@click="createNewRecord"></q-btn>
|
||||||
|
|
||||||
|
<q-space/>
|
||||||
|
|
||||||
|
|
||||||
|
<!--<q-toggle v-for="(mycol, index) in mycolumns" v-model="colVisib" :val="rec.field" :label="mycol.label"></q-toggle>-->
|
||||||
|
|
||||||
|
<q-select
|
||||||
|
v-if="mytable"
|
||||||
|
v-model="colVisib"
|
||||||
|
rounded
|
||||||
|
outlined
|
||||||
|
multiple
|
||||||
|
dense
|
||||||
|
options-dense
|
||||||
|
:display-value="$t('grid.columns')"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
:options="mycolumns"
|
||||||
|
option-value="name"
|
||||||
|
style="min-width: 150px"
|
||||||
|
@input="changeCol">
|
||||||
|
|
||||||
|
</q-select>
|
||||||
|
|
||||||
|
<q-select v-if="tablesList"
|
||||||
|
v-model="tablesel"
|
||||||
|
rounded
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
:options="tablesList"
|
||||||
|
:display-value="mytitle"
|
||||||
|
emit-value
|
||||||
|
@input="changeTable"
|
||||||
>
|
>
|
||||||
|
</q-select>
|
||||||
|
|
||||||
|
|
||||||
<template v-slot:header="props">
|
<q-inner-loading :showing="spinner_visible">
|
||||||
<q-tr :props="props">
|
<q-spinner-tail size="2em" color="primary"/>
|
||||||
<q-th
|
</q-inner-loading>
|
||||||
v-for="col in props.cols"
|
|
||||||
v-if="colVisib.includes(col.field + col.subfield)"
|
|
||||||
:key="col.name"
|
|
||||||
:props="props"
|
|
||||||
class="text-italic text-weight-bold"
|
|
||||||
>
|
|
||||||
{{ col.label }}
|
|
||||||
</q-th>
|
|
||||||
</q-tr>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template v-slot:top="props">
|
</template>
|
||||||
<div class="col-2 q-table__title">{{ mytitle }}</div>
|
|
||||||
|
|
||||||
<!--<p style="color:red"> Rows: {{ getrows }}</p>-->
|
<template v-slot:body="props">
|
||||||
|
|
||||||
<q-input v-model="search" filled dense type="search" debounce="500" hint="Search"
|
<q-tr :props="props">
|
||||||
v-on:keyup.enter="doSearch">
|
<q-td auto-width>
|
||||||
<template v-slot:after>
|
<q-checkbox dense v-model="props.selected"></q-checkbox>
|
||||||
<q-btn v-if="mytable" label="" color="primary" @click="refresh" icon="search"></q-btn>
|
</q-td>
|
||||||
</template>
|
<q-td v-for="col in mycolumns" :key="col.name" :props="props"
|
||||||
</q-input>
|
v-if="colVisib.includes(col.field + col.subfield)">
|
||||||
<q-toggle v-if="mytable" v-model="canEdit" :val="lists.MenuAction.CAN_EDIT_TABLE" class="q-mx-sm"
|
<div :class="getclrow(props.row)">
|
||||||
:label="$t('grid.editvalues')" @input="changefuncAct"
|
<CMyPopupEdit :canEdit="canEdit"
|
||||||
></q-toggle>
|
:col="col"
|
||||||
|
:row.sync="props.row"
|
||||||
|
:field="col.field"
|
||||||
|
:subfield="col.subfield"
|
||||||
|
minuteinterval="1"
|
||||||
|
@save="SaveValue"
|
||||||
|
@show="selItem(props.row, col)"
|
||||||
|
@showandsave="showandsel">
|
||||||
|
|
||||||
<q-btn v-if="mytable" flat dense color="primary" :disable="loading || !canEdit"
|
</CMyPopupEdit>
|
||||||
:label="$t('grid.addrecord')"
|
|
||||||
@click="createNewRecord"></q-btn>
|
|
||||||
|
|
||||||
<q-space/>
|
|
||||||
|
|
||||||
|
|
||||||
<!--<q-toggle v-for="(mycol, index) in mycolumns" v-model="colVisib" :val="rec.field" :label="mycol.label"></q-toggle>-->
|
|
||||||
|
|
||||||
<q-select
|
|
||||||
v-if="mytable"
|
|
||||||
v-model="colVisib"
|
|
||||||
rounded
|
|
||||||
outlined
|
|
||||||
multiple
|
|
||||||
dense
|
|
||||||
options-dense
|
|
||||||
:display-value="$t('grid.columns')"
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
:options="mycolumns"
|
|
||||||
option-value="name"
|
|
||||||
style="min-width: 150px"
|
|
||||||
@input="changeCol">
|
|
||||||
|
|
||||||
</q-select>
|
|
||||||
|
|
||||||
<q-select v-if="tablesList"
|
|
||||||
v-model="tablesel"
|
|
||||||
rounded
|
|
||||||
outlined
|
|
||||||
dense
|
|
||||||
:options="tablesList"
|
|
||||||
:display-value="mytitle"
|
|
||||||
emit-value
|
|
||||||
@input="changeTable"
|
|
||||||
>
|
|
||||||
</q-select>
|
|
||||||
|
|
||||||
|
|
||||||
<q-inner-loading :showing="spinner_visible">
|
|
||||||
<q-spinner-tail size="2em" color="primary"/>
|
|
||||||
</q-inner-loading>
|
|
||||||
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<q-tr v-if="mytable" slot="body" slot-scope="props" :props="props">
|
|
||||||
<q-td v-for="col in mycolumns" :key="col.name" :props="props"
|
|
||||||
v-if="colVisib.includes(col.field + col.subfield)" @click="clickrowcol(props.row, col)">
|
|
||||||
<div :class="getclrow(props.row)">
|
|
||||||
<CMyPopupEdit :canEdit="canEdit"
|
|
||||||
:col="col"
|
|
||||||
:row.sync="props.row"
|
|
||||||
:field="col.field"
|
|
||||||
:subfield="col.subfield"
|
|
||||||
minuteinterval="1"
|
|
||||||
@save="SaveValue"
|
|
||||||
@show="selItem(props.row, col)"
|
|
||||||
@showandsave="showandsel">
|
|
||||||
|
|
||||||
</CMyPopupEdit>
|
|
||||||
</div>
|
|
||||||
</q-td>
|
|
||||||
<q-td v-for="col in mycolumns" :key="col.name" :props="props" v-if="colExtra.includes(col.name)">
|
|
||||||
<div v-if="col.action && visCol(col)">
|
|
||||||
<q-btn flat round color="red" :icon="col.icon" size="sm"
|
|
||||||
@click="clickFunz(props.row, col)"></q-btn>
|
|
||||||
</div>
|
|
||||||
</q-td>
|
|
||||||
</q-tr>
|
|
||||||
<!--
|
|
||||||
<q-btn
|
|
||||||
flat round dense
|
|
||||||
:icon="props.inFullscreen ? 'fullscreen_exit' : 'fullscreen'"
|
|
||||||
@click="props.toggleFullscreen"
|
|
||||||
class="q-ml-md">
|
|
||||||
</q-btn>
|
|
||||||
-->
|
|
||||||
<!---->
|
|
||||||
</q-table>
|
|
||||||
|
|
||||||
<div v-if="rowclicksel">
|
|
||||||
<CTitleBanner title="Record:"></CTitleBanner>
|
|
||||||
|
|
||||||
<div class="q-ma-xs q-pa-xs text-center rounded-borders q-list--bordered"
|
|
||||||
v-for="mycol in mycolumns" :key="mycol.name"
|
|
||||||
v-if="colVisib.includes(mycol.field + mycol.subfield)">
|
|
||||||
<div class="row items-center justify-center q-gutter-md q-ma-xs">
|
|
||||||
<div class="q-ma-xs">
|
|
||||||
<q-field rounded outlined bg-color="orange-3" dense>
|
|
||||||
<template v-slot:control>
|
|
||||||
<div class="self-center full-width no-outline" tabindex="0">{{mycol.label}}</div>
|
|
||||||
</template>
|
|
||||||
</q-field>
|
|
||||||
</div>
|
|
||||||
<div class="q-ma-sm q-pa-sm colmodif col-grow rounded-borders " style="border: 1px solid #bbb"
|
|
||||||
@click="colclicksel = mycol">
|
|
||||||
<CMyPopupEdit :canEdit="true"
|
|
||||||
view="field"
|
|
||||||
:col="mycol"
|
|
||||||
:showall="true"
|
|
||||||
:row="rowclicksel"
|
|
||||||
:field="mycol.field"
|
|
||||||
:subfield="mycol.subfield"
|
|
||||||
@save="SaveValdb"
|
|
||||||
@show="selItem(rowclicksel, mycol)"
|
|
||||||
@showandsave="showandsel">
|
|
||||||
|
|
||||||
</CMyPopupEdit>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</q-td>
|
||||||
|
<q-td v-for="col in mycolumns" :key="col.name" :props="props" v-if="colExtra.includes(col.name)">
|
||||||
|
<div v-if="col.action && visCol(col)">
|
||||||
|
<q-btn flat round color="red" :icon="col.icon" size="sm"
|
||||||
|
@click="clickFunz(props.row, col)"></q-btn>
|
||||||
|
</div>
|
||||||
|
</q-td>
|
||||||
|
</q-tr>
|
||||||
|
</template>
|
||||||
|
<!--
|
||||||
|
<q-btn
|
||||||
|
flat round dense
|
||||||
|
:icon="props.inFullscreen ? 'fullscreen_exit' : 'fullscreen'"
|
||||||
|
@click="props.toggleFullscreen"
|
||||||
|
class="q-ml-md">
|
||||||
|
</q-btn>
|
||||||
|
-->
|
||||||
|
<!---->
|
||||||
|
</q-table>
|
||||||
|
|
||||||
|
<div v-if="rowclicksel">
|
||||||
|
<CTitleBanner title="Record:"></CTitleBanner>
|
||||||
|
|
||||||
|
<div class="q-ma-xs q-pa-xs text-center rounded-borders q-list--bordered"
|
||||||
|
v-for="mycol in mycolumns" :key="mycol.name"
|
||||||
|
v-if="colVisib.includes(mycol.field + mycol.subfield)">
|
||||||
|
<div class="row items-center justify-center q-gutter-md q-ma-xs">
|
||||||
|
<div class="q-ma-xs">
|
||||||
|
<q-field rounded outlined bg-color="orange-3" dense>
|
||||||
|
<template v-slot:control>
|
||||||
|
<div class="self-center full-width no-outline" tabindex="0">{{mycol.label}}</div>
|
||||||
|
</template>
|
||||||
|
</q-field>
|
||||||
|
</div>
|
||||||
|
<div class="q-ma-sm q-pa-sm colmodif col-grow rounded-borders " style="border: 1px solid #bbb"
|
||||||
|
@click="colclicksel = mycol">
|
||||||
|
<CMyPopupEdit :canEdit="true"
|
||||||
|
view="field"
|
||||||
|
:col="mycol"
|
||||||
|
:showall="true"
|
||||||
|
:row="rowclicksel"
|
||||||
|
:field="mycol.field"
|
||||||
|
:subfield="mycol.subfield"
|
||||||
|
@save="SaveValdb"
|
||||||
|
@show="selItem(rowclicksel, mycol)"
|
||||||
|
@showandsave="showandsel">
|
||||||
|
|
||||||
|
</CMyPopupEdit>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" src="./CGridTableRec.ts">
|
<script lang="ts" src="./CGridTableRec.ts">
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import './CGridTableRec.scss';
|
@import './CGridTableRec.scss';
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -30,12 +30,14 @@ export default class CMyFieldDb extends MixinBase {
|
|||||||
public myvalue = ''
|
public myvalue = ''
|
||||||
public col: IColGridTable = { name: 'test' }
|
public col: IColGridTable = { name: 'test' }
|
||||||
public canEdit: boolean = true
|
public canEdit: boolean = true
|
||||||
|
public countryname = ''
|
||||||
|
|
||||||
public created() {
|
public created() {
|
||||||
this.myvalue = this.getValDb(this.mykey, this.serv, '', this.table, this.mysubkey)
|
this.myvalue = this.getValDb(this.mykey, this.serv, '', this.table, this.mysubkey)
|
||||||
this.col.jointable = this.jointable
|
this.col.jointable = this.jointable
|
||||||
this.col.fieldtype = this.type
|
this.col.fieldtype = this.type
|
||||||
this.col.label = this.title
|
this.col.label = this.title
|
||||||
|
|
||||||
// console.log('created', this.myvalue)
|
// console.log('created', this.myvalue)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,4 +103,14 @@ export default class CMyFieldDb extends MixinBase {
|
|||||||
this.setValDb(this.mykey, this.myvalue, this.type, this.serv, this.table, this.mysubkey)
|
this.setValDb(this.mykey, this.myvalue, this.type, this.serv, this.table, this.mysubkey)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public selectcountry({name, iso2, dialCode}) {
|
||||||
|
// console.log(name, iso2, dialCode)
|
||||||
|
this.myvalue = iso2
|
||||||
|
this.countryname = name
|
||||||
|
}
|
||||||
|
|
||||||
|
public intcode_change(coderec) {
|
||||||
|
this.myvalue = '+' + coderec.dialCode
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,33 @@
|
|||||||
:opticon="db_fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
|
:opticon="db_fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
|
||||||
</div>
|
</div>
|
||||||
<!-- Show Value -->
|
<!-- Show Value -->
|
||||||
|
<div v-else-if="col.fieldtype === tools.FieldType.nationality">
|
||||||
|
<q-input
|
||||||
|
input-class="cursor-pointer"
|
||||||
|
:readonly="true"
|
||||||
|
v-model="countryname"
|
||||||
|
rounded outlined
|
||||||
|
debounce="1000"
|
||||||
|
:label="$t('reg.nationality')">
|
||||||
|
|
||||||
|
<div class="hidden">
|
||||||
|
<vue-country-code
|
||||||
|
:defaultCountry="myvalue"
|
||||||
|
:disabledFetchingCountry="true"
|
||||||
|
@onSelect="selectcountry"
|
||||||
|
:preferredCountries="tools.getprefCountries"
|
||||||
|
:dropdownOptions="{ disabledDialCode: true }">
|
||||||
|
|
||||||
|
</vue-country-code>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</q-input>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="col.fieldtype === tools.FieldType.intcode">
|
||||||
|
|
||||||
|
{{ myvalue }}
|
||||||
|
|
||||||
|
</div>
|
||||||
<div v-else-if="type === tools.FieldType.multiselect">
|
<div v-else-if="type === tools.FieldType.multiselect">
|
||||||
<CMyChipList
|
<CMyChipList
|
||||||
:type="tools.FieldType.multiselect"
|
:type="tools.FieldType.multiselect"
|
||||||
@@ -111,6 +138,52 @@
|
|||||||
:useinput="false">
|
:useinput="false">
|
||||||
</CMySelect>
|
</CMySelect>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-else-if="col.fieldtype === tools.FieldType.nationality">
|
||||||
|
<div class="justify-center q-gutter-sm clgutter q-mt-sm">
|
||||||
|
<q-input
|
||||||
|
v-model="countryname"
|
||||||
|
:readonly="true"
|
||||||
|
rounded outlined
|
||||||
|
debounce="1000"
|
||||||
|
:label="$t('reg.nationality')">
|
||||||
|
|
||||||
|
<template v-slot:prepend>
|
||||||
|
<div style="font-size: 1rem;">
|
||||||
|
<vue-country-code
|
||||||
|
:defaultCountry="myvalue"
|
||||||
|
:disabledFetchingCountry="true"
|
||||||
|
@onSelect="selectcountry"
|
||||||
|
:preferredCountries="tools.getprefCountries"
|
||||||
|
:dropdownOptions="{ disabledDialCode: true }">
|
||||||
|
|
||||||
|
</vue-country-code>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</q-input>
|
||||||
|
<div style="height: 180px;">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="col.fieldtype === tools.FieldType.intcode">
|
||||||
|
|
||||||
|
<div class="justify-center q-gutter-sm clgutter q-mt-sm">
|
||||||
|
<vue-tel-input
|
||||||
|
@country-changed="intcode_change"
|
||||||
|
v-model="myvalue"
|
||||||
|
:disabledFetchingCountry="true"
|
||||||
|
:preferredCountries="tools.getprefCountries"
|
||||||
|
:placeholder="$t('reg.cell')"
|
||||||
|
:enabledCountryCode="true"
|
||||||
|
inputClasses="clCell"
|
||||||
|
wrapperClasses="clCellCode">
|
||||||
|
</vue-tel-input>
|
||||||
|
<div style="height: 180px;">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
<div v-else-if="type === tools.FieldType.multiselect">
|
<div v-else-if="type === tools.FieldType.multiselect">
|
||||||
<q-select
|
<q-select
|
||||||
v-model="myvalue"
|
v-model="myvalue"
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ export default class CMyPopupEdit extends Vue {
|
|||||||
@Prop({ required: false, default: '5' }) public minuteinterval
|
@Prop({ required: false, default: '5' }) public minuteinterval
|
||||||
|
|
||||||
public myvalue = ''
|
public myvalue = ''
|
||||||
|
public countryname = ''
|
||||||
|
|
||||||
get tools() {
|
get tools() {
|
||||||
return tools
|
return tools
|
||||||
@@ -44,6 +45,10 @@ export default class CMyPopupEdit extends Vue {
|
|||||||
this.$emit('update:row', newval)
|
this.$emit('update:row', newval)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public updatedata() {
|
||||||
|
this.mounted()
|
||||||
|
}
|
||||||
|
|
||||||
public mounted() {
|
public mounted() {
|
||||||
if ((this.subfield !== '') && (this.subfield !== '')) {
|
if ((this.subfield !== '') && (this.subfield !== '')) {
|
||||||
if (this.row[this.field] === undefined) {
|
if (this.row[this.field] === undefined) {
|
||||||
@@ -165,4 +170,15 @@ export default class CMyPopupEdit extends Vue {
|
|||||||
public changeCol() {
|
public changeCol() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public selectcountry({name, iso2, dialCode}) {
|
||||||
|
// console.log(name, iso2, dialCode)
|
||||||
|
this.myvalue = iso2
|
||||||
|
this.countryname = name
|
||||||
|
}
|
||||||
|
|
||||||
|
public intcode_change(coderec) {
|
||||||
|
this.myvalue = '+' + coderec.dialCode
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,16 @@
|
|||||||
|
|
||||||
</CGallery>
|
</CGallery>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-else-if="col.fieldtype === tools.FieldType.nationality">
|
||||||
|
<div>
|
||||||
|
{{myvalue}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="col.fieldtype === tools.FieldType.intcode">
|
||||||
|
<div>
|
||||||
|
{{myvalue}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<!-- Edit Value -->
|
<!-- Edit Value -->
|
||||||
<span v-if="col.fieldtype === tools.FieldType.date">
|
<span v-if="col.fieldtype === tools.FieldType.date">
|
||||||
@@ -124,6 +134,45 @@
|
|||||||
:useinput="false">
|
:useinput="false">
|
||||||
</CMySelect>
|
</CMySelect>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-else-if="col.fieldtype === tools.FieldType.nationality">
|
||||||
|
<div class="justify-center q-gutter-sm clgutter q-mt-sm">
|
||||||
|
<q-input
|
||||||
|
v-model="countryname"
|
||||||
|
:readonly="true"
|
||||||
|
rounded outlined
|
||||||
|
debounce="1000"
|
||||||
|
:label="$t('reg.nationality')">
|
||||||
|
|
||||||
|
<template v-slot:prepend>
|
||||||
|
<div style="font-size: 1rem;">
|
||||||
|
<vue-country-code
|
||||||
|
:defaultCountry="myvalue"
|
||||||
|
:disabledFetchingCountry="true"
|
||||||
|
@onSelect="selectcountry"
|
||||||
|
:preferredCountries="tools.getprefCountries"
|
||||||
|
:dropdownOptions="{ disabledDialCode: true }">
|
||||||
|
|
||||||
|
</vue-country-code>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</q-input>
|
||||||
|
<div style="height: 180px;">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="col.fieldtype === tools.FieldType.intcode">
|
||||||
|
|
||||||
|
<vue-tel-input
|
||||||
|
@country-changed="intcode_change"
|
||||||
|
v-model="myvalue"
|
||||||
|
:placeholder="$t('reg.cell')"
|
||||||
|
:enabledCountryCode="true"
|
||||||
|
inputClasses="clCell"
|
||||||
|
wrapperClasses="clCellCode">
|
||||||
|
</vue-tel-input>
|
||||||
|
|
||||||
|
</div>
|
||||||
<div v-else-if="col.fieldtype === tools.FieldType.multiselect">
|
<div v-else-if="col.fieldtype === tools.FieldType.multiselect">
|
||||||
<q-select
|
<q-select
|
||||||
v-model="myvalue"
|
v-model="myvalue"
|
||||||
|
|||||||
@@ -1,22 +1,18 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import { GlobalStore } from '@store'
|
import { GlobalStore } from '@store'
|
||||||
import { UserStore } from '../../store/Modules'
|
import { UserStore } from '../../store/Modules'
|
||||||
import { Component, Prop, Watch } from 'vue-property-decorator'
|
import { Component, Prop } from 'vue-property-decorator'
|
||||||
import { serv_constants } from '../../store/Modules/serv_constants'
|
import { serv_constants } from '../../store/Modules/serv_constants'
|
||||||
import { tools } from '../../store/Modules/tools'
|
import { tools } from '../../store/Modules/tools'
|
||||||
import { toolsext } from '@src/store/Modules/toolsext'
|
import { toolsext } from '@src/store/Modules/toolsext'
|
||||||
|
|
||||||
import { ISigninOptions, IUserState } from 'model'
|
import { ISigninOptions, IUserState } from 'model'
|
||||||
import { TSignin, validations } from './CSignIn-validate'
|
import { validations } from './CSignIn-validate'
|
||||||
|
|
||||||
import { validationMixin } from 'vuelidate'
|
import { validationMixin } from 'vuelidate'
|
||||||
|
|
||||||
import { Logo } from '../logo'
|
import { Logo } from '../logo'
|
||||||
|
|
||||||
import router from '@router'
|
|
||||||
|
|
||||||
import globalroutines from '../../globalroutines/index'
|
|
||||||
import { ICategory } from '../../model'
|
|
||||||
import { static_data } from '../../db/static_data'
|
import { static_data } from '../../db/static_data'
|
||||||
|
|
||||||
// import {Loading, QSpinnerFacebook, QSpinnerGears} from 'quasar'
|
// import {Loading, QSpinnerFacebook, QSpinnerGears} from 'quasar'
|
||||||
|
|||||||
@@ -13,11 +13,13 @@ export const validations = {
|
|||||||
},
|
},
|
||||||
password: {
|
password: {
|
||||||
complexity,
|
complexity,
|
||||||
required
|
required,
|
||||||
|
minLength: minLength(8)
|
||||||
},
|
},
|
||||||
username: {
|
username: {
|
||||||
registereduser,
|
registereduser,
|
||||||
required
|
required,
|
||||||
|
minLength: minLength(6)
|
||||||
},
|
},
|
||||||
name: {
|
name: {
|
||||||
required
|
required
|
||||||
|
|||||||
@@ -10,3 +10,33 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.clCellCode {
|
||||||
|
border-radius: 32px;
|
||||||
|
border-right: #2d2260;
|
||||||
|
height: 50px;
|
||||||
|
font-size: 1rem;
|
||||||
|
padding: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clCell {
|
||||||
|
border-radius: 32px;
|
||||||
|
border-right: #2d2260;
|
||||||
|
height: 50px;
|
||||||
|
font-size: 1rem;
|
||||||
|
padding: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vue-country-select{
|
||||||
|
border-radius: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clAportador{
|
||||||
|
background-color: lightblue;
|
||||||
|
border-radius: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.q-field--readonly {
|
||||||
|
border: 1px solid rgba(0,0,0,0.2);
|
||||||
|
border-radius: 32px;
|
||||||
|
}
|
||||||
|
|||||||
@@ -10,21 +10,32 @@ import { validations, TSignup } from './CSignUp-validate'
|
|||||||
import { validationMixin } from 'vuelidate'
|
import { validationMixin } from 'vuelidate'
|
||||||
|
|
||||||
import { Logo } from '../../components/logo'
|
import { Logo } from '../../components/logo'
|
||||||
|
import { DefaultProfile } from '../../store/Modules/UserStore'
|
||||||
|
|
||||||
|
import 'vue-country-code/dist/vue-country-code.css'
|
||||||
|
import { serv_constants } from '@src/store/Modules/serv_constants'
|
||||||
|
|
||||||
|
import VueCountryCode from 'vue-country-code'
|
||||||
|
import { CTitleBanner } from '../CTitleBanner'
|
||||||
|
|
||||||
|
Vue.use(VueCountryCode)
|
||||||
// import {Loading, QSpinnerFacebook, QSpinnerGears} from 'quasar'
|
// import {Loading, QSpinnerFacebook, QSpinnerGears} from 'quasar'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
name: 'CSignUp',
|
name: 'CSignUp',
|
||||||
mixins: [validationMixin],
|
mixins: [validationMixin],
|
||||||
validations,
|
validations,
|
||||||
components: { Logo }
|
components: { Logo, CTitleBanner }
|
||||||
})
|
})
|
||||||
|
|
||||||
export default class CSignUp extends Vue {
|
export default class CSignUp extends Vue {
|
||||||
@Prop({ required: false, default: false }) public adult: boolean
|
@Prop({ required: false, default: false }) public showadultcheck: boolean
|
||||||
|
@Prop({ required: false, default: false }) public showcell: boolean
|
||||||
public $v
|
public $v
|
||||||
public $q
|
public $q
|
||||||
public $t: any
|
public $t: any
|
||||||
|
public countryname: string = ''
|
||||||
|
public iamadult: boolean = false
|
||||||
|
|
||||||
public duplicate_email: boolean = false
|
public duplicate_email: boolean = false
|
||||||
public duplicate_username: boolean = false
|
public duplicate_username: boolean = false
|
||||||
@@ -37,6 +48,7 @@ export default class CSignUp extends Vue {
|
|||||||
password: process.env.TEST_PASSWORD || '',
|
password: process.env.TEST_PASSWORD || '',
|
||||||
repeatPassword: process.env.TEST_PASSWORD || '',
|
repeatPassword: process.env.TEST_PASSWORD || '',
|
||||||
terms: !process.env.PROD,
|
terms: !process.env.PROD,
|
||||||
|
profile: DefaultProfile
|
||||||
}
|
}
|
||||||
|
|
||||||
public created() {
|
public created() {
|
||||||
@@ -57,7 +69,11 @@ export default class CSignUp extends Vue {
|
|||||||
|
|
||||||
get allowSubmit() {
|
get allowSubmit() {
|
||||||
|
|
||||||
const error = this.$v.$error || this.$v.$invalid
|
let error = this.$v.$error || this.$v.$invalid || this.signup.profile.cell.length <= 6
|
||||||
|
|
||||||
|
if (this.showadultcheck)
|
||||||
|
error = error || !this.iamadult
|
||||||
|
|
||||||
return !error
|
return !error
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,6 +120,7 @@ export default class CSignUp extends Vue {
|
|||||||
public errorMsg(cosa: string, item: any) {
|
public errorMsg(cosa: string, item: any) {
|
||||||
try {
|
try {
|
||||||
if (!item.$error) { return '' }
|
if (!item.$error) { return '' }
|
||||||
|
console.log('errorMsg', cosa, item)
|
||||||
if (item.$params.email && !item.email) { return this.$t('reg.err.email') }
|
if (item.$params.email && !item.email) { return this.$t('reg.err.email') }
|
||||||
|
|
||||||
if (cosa === 'repeatpassword') {
|
if (cosa === 'repeatpassword') {
|
||||||
@@ -112,6 +129,10 @@ export default class CSignUp extends Vue {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!item.minLength) { return this.$t('reg.err.atleast') + ` ${item.$params.minLength.min} ` + this.$t('reg.err.char') }
|
||||||
|
if (!item.complexity) { return this.$t('reg.err.complexity') }
|
||||||
|
// if (!item.maxLength) { return this.$t('reg.err.notmore') + ` ${item.$params.maxLength.max} ` + this.$t('reg.err.char') }
|
||||||
|
|
||||||
if (!item.required) { return this.$t('reg.err.required') }
|
if (!item.required) { return this.$t('reg.err.required') }
|
||||||
if (cosa === 'email') {
|
if (cosa === 'email') {
|
||||||
// console.log("EMAIL " + item.isUnique);
|
// console.log("EMAIL " + item.isUnique);
|
||||||
@@ -122,12 +143,9 @@ export default class CSignUp extends Vue {
|
|||||||
if (!item.isUnique) { return this.$t('reg.err.duplicate_username') }
|
if (!item.isUnique) { return this.$t('reg.err.duplicate_username') }
|
||||||
} else if ((cosa === 'name') || (cosa === 'surname')) {
|
} else if ((cosa === 'name') || (cosa === 'surname')) {
|
||||||
// console.log(item);
|
// console.log(item);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!item.complexity) { return this.$t('reg.err.complexity') }
|
|
||||||
if (!item.minLength) { return this.$t('reg.err.atleast') + ` ${item.$params.minLength.min} ` + this.$t('reg.err.char') }
|
|
||||||
if (!item.maxLength) { return this.$t('reg.err.notmore') + ` ${item.$params.maxLength.max} ` + this.$t('reg.err.char') }
|
|
||||||
return ''
|
return ''
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// console.log("ERR : " + error);
|
// console.log("ERR : " + error);
|
||||||
@@ -136,9 +154,9 @@ export default class CSignUp extends Vue {
|
|||||||
|
|
||||||
public SignUpcheckErrors(riscode: number) {
|
public SignUpcheckErrors(riscode: number) {
|
||||||
console.log('SignUpcheckErrors', riscode)
|
console.log('SignUpcheckErrors', riscode)
|
||||||
if (riscode === tools.DUPLICATE_EMAIL_ID) {
|
if (riscode === serv_constants.RIS_CODE_EMAIL_ALREADY_EXIST) {
|
||||||
tools.showNotif(this.$q, this.$t('reg.err.duplicate_email'))
|
tools.showNotif(this.$q, this.$t('reg.err.duplicate_email'))
|
||||||
} else if (riscode === tools.DUPLICATE_USERNAME_ID) {
|
} else if (riscode === serv_constants.RIS_CODE_USERNAME_ALREADY_EXIST) {
|
||||||
tools.showNotif(this.$q, this.$t('reg.err.duplicate_username'))
|
tools.showNotif(this.$q, this.$t('reg.err.duplicate_username'))
|
||||||
} else if (riscode === tools.ERR_SERVERFETCH) {
|
} else if (riscode === tools.ERR_SERVERFETCH) {
|
||||||
tools.showNotif(this.$q, this.$t('fetch.errore_server'))
|
tools.showNotif(this.$q, this.$t('fetch.errore_server'))
|
||||||
@@ -184,4 +202,16 @@ export default class CSignUp extends Vue {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public intcode_change(coderec) {
|
||||||
|
// console.log('intcode', coderec)
|
||||||
|
this.signup.profile.intcode_cell = '+' + coderec.dialCode
|
||||||
|
this.signup.profile.iso2_cell = coderec.iso2
|
||||||
|
}
|
||||||
|
|
||||||
|
public selectcountry({name, iso2, dialCode}) {
|
||||||
|
// console.log(name, iso2, dialCode)
|
||||||
|
this.signup.profile.nationality = iso2
|
||||||
|
this.countryname = name
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<p>
|
<p>
|
||||||
<logo></logo>
|
<logo></logo><CTitleBanner :title="$t('pages.SignUp')"></CTitleBanner>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -11,10 +11,11 @@
|
|||||||
<div class="q-gutter-xs">
|
<div class="q-gutter-xs">
|
||||||
|
|
||||||
<q-input
|
<q-input
|
||||||
|
class="clAportador"
|
||||||
:readonly="true"
|
:readonly="true"
|
||||||
v-model="signup.aportador_solidario"
|
v-model="signup.aportador_solidario"
|
||||||
rounded outlined dense
|
rounded outlined dense
|
||||||
bottom-slots
|
|
||||||
:label="$t('reg.aportador_solidario')">
|
:label="$t('reg.aportador_solidario')">
|
||||||
|
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
@@ -29,7 +30,7 @@
|
|||||||
@blur="$v.signup.email.$touch"
|
@blur="$v.signup.email.$touch"
|
||||||
:error="$v.signup.email.$error"
|
:error="$v.signup.email.$error"
|
||||||
:error-message="errorMsg('email', $v.signup.email)"
|
:error-message="errorMsg('email', $v.signup.email)"
|
||||||
bottom-slots
|
|
||||||
debounce="1000"
|
debounce="1000"
|
||||||
:label="$t('reg.email')">
|
:label="$t('reg.email')">
|
||||||
|
|
||||||
@@ -44,7 +45,7 @@
|
|||||||
rounded outlined
|
rounded outlined
|
||||||
@blur="$v.signup.username.$touch"
|
@blur="$v.signup.username.$touch"
|
||||||
:error="$v.signup.username.$error"
|
:error="$v.signup.username.$error"
|
||||||
bottom-slots
|
|
||||||
debounce="1000"
|
debounce="1000"
|
||||||
:error-message="errorMsg('username', $v.signup.username)"
|
:error-message="errorMsg('username', $v.signup.username)"
|
||||||
:label="$t('reg.username')">
|
:label="$t('reg.username')">
|
||||||
@@ -60,7 +61,7 @@
|
|||||||
rounded outlined
|
rounded outlined
|
||||||
@blur="$v.signup.name.$touch"
|
@blur="$v.signup.name.$touch"
|
||||||
:error="$v.signup.name.$error"
|
:error="$v.signup.name.$error"
|
||||||
bottom-slots
|
|
||||||
debounce="1000"
|
debounce="1000"
|
||||||
:error-message="errorMsg('name', $v.signup.name)"
|
:error-message="errorMsg('name', $v.signup.name)"
|
||||||
:label="$t('reg.name')">
|
:label="$t('reg.name')">
|
||||||
@@ -76,7 +77,7 @@
|
|||||||
rounded outlined
|
rounded outlined
|
||||||
@blur="$v.signup.surname.$touch"
|
@blur="$v.signup.surname.$touch"
|
||||||
:error="$v.signup.surname.$error"
|
:error="$v.signup.surname.$error"
|
||||||
bottom-slots
|
|
||||||
debounce="1000"
|
debounce="1000"
|
||||||
:error-message="errorMsg('surname', $v.signup.surname)"
|
:error-message="errorMsg('surname', $v.signup.surname)"
|
||||||
:label="$t('reg.surname')">
|
:label="$t('reg.surname')">
|
||||||
@@ -94,7 +95,7 @@
|
|||||||
@blur="$v.signup.password.$touch"
|
@blur="$v.signup.password.$touch"
|
||||||
:error="$v.signup.password.$error"
|
:error="$v.signup.password.$error"
|
||||||
:error-message="`${errorMsg('password', $v.signup.password)}`"
|
:error-message="`${errorMsg('password', $v.signup.password)}`"
|
||||||
bottom-slots
|
|
||||||
:label="$t('reg.password')">
|
:label="$t('reg.password')">
|
||||||
|
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
@@ -110,7 +111,7 @@
|
|||||||
@blur="$v.signup.repeatPassword.$touch"
|
@blur="$v.signup.repeatPassword.$touch"
|
||||||
:error="$v.signup.repeatPassword.$error"
|
:error="$v.signup.repeatPassword.$error"
|
||||||
:error-message="`${errorMsg('repeatpassword', $v.signup.repeatPassword)}`"
|
:error-message="`${errorMsg('repeatpassword', $v.signup.repeatPassword)}`"
|
||||||
bottom-slots
|
|
||||||
:label="$t('reg.repeatPassword')">
|
:label="$t('reg.repeatPassword')">
|
||||||
|
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
@@ -121,6 +122,39 @@
|
|||||||
|
|
||||||
<!--:hint="$t('reg.tips.repeatpassword')"-->
|
<!--:hint="$t('reg.tips.repeatpassword')"-->
|
||||||
|
|
||||||
|
<q-input
|
||||||
|
v-model="countryname"
|
||||||
|
:readonly="true"
|
||||||
|
rounded outlined
|
||||||
|
|
||||||
|
debounce="1000"
|
||||||
|
:label="$t('reg.nationality')">
|
||||||
|
|
||||||
|
<template v-slot:prepend>
|
||||||
|
<vue-country-code
|
||||||
|
@onSelect="selectcountry"
|
||||||
|
:preferredCountries="tools.getprefCountries"
|
||||||
|
:dropdownOptions="{ disabledDialCode: true }"
|
||||||
|
>
|
||||||
|
|
||||||
|
</vue-country-code>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</q-input>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<vue-tel-input
|
||||||
|
v-if="showcell"
|
||||||
|
@country-changed="intcode_change"
|
||||||
|
v-model="signup.profile.cell"
|
||||||
|
:placeholder="$t('reg.cell')"
|
||||||
|
:enabledCountryCode="true"
|
||||||
|
inputClasses="clCell"
|
||||||
|
wrapperClasses="clCellCode">
|
||||||
|
</vue-tel-input>
|
||||||
|
|
||||||
|
|
||||||
<q-checkbox
|
<q-checkbox
|
||||||
v-model="signup.terms"
|
v-model="signup.terms"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
@@ -132,12 +166,9 @@
|
|||||||
</q-checkbox>
|
</q-checkbox>
|
||||||
|
|
||||||
<q-checkbox
|
<q-checkbox
|
||||||
v-if="adult"
|
v-if="showadultcheck"
|
||||||
v-model="signup.onlyadult"
|
v-model="iamadult"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
@blur="$v.signup.onlyadult.$touch"
|
|
||||||
:error="$v.signup.onlyadult.$error"
|
|
||||||
:error-message="`${errorMsg('onlyadult', $v.signup.onlyadult)}`"
|
|
||||||
:label="$t('reg.onlyadult')">
|
:label="$t('reg.onlyadult')">
|
||||||
</q-checkbox>
|
</q-checkbox>
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ export default class CTitleBanner extends Vue {
|
|||||||
@Prop({ required: false, default: '' }) public myclasstext: string
|
@Prop({ required: false, default: '' }) public myclasstext: string
|
||||||
@Prop({ required: false, default: '' }) public icon: string
|
@Prop({ required: false, default: '' }) public icon: string
|
||||||
@Prop({ required: false, default: true }) public visible: boolean
|
@Prop({ required: false, default: true }) public visible: boolean
|
||||||
|
@Prop({ required: false, default: false }) public canopen: boolean
|
||||||
|
|
||||||
public myvisible: boolean = true
|
public myvisible: boolean = true
|
||||||
|
|
||||||
|
|||||||
@@ -8,10 +8,10 @@
|
|||||||
@click="myvisible = !myvisible"
|
@click="myvisible = !myvisible"
|
||||||
>
|
>
|
||||||
<template v-slot:avatar>
|
<template v-slot:avatar>
|
||||||
<q-icon :name="icon" color="white" />
|
<q-icon v-if="canopen" :name="icon" color="white" />
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:action>
|
<template v-slot:action>
|
||||||
<q-icon :name="iconopen" color="white" />
|
<q-icon v-if="canopen" :name="iconopen" color="white" />
|
||||||
</template>
|
</template>
|
||||||
<span :class="`mybanner `+ myclasstext" :style="mystyle">{{title}}</span>
|
<span :class="`mybanner `+ myclasstext" :style="mystyle">{{title}}</span>
|
||||||
</q-banner>
|
</q-banner>
|
||||||
|
|||||||
@@ -8,6 +8,9 @@ const enum ESexType {
|
|||||||
|
|
||||||
export interface IUserProfile {
|
export interface IUserProfile {
|
||||||
img?: string
|
img?: string
|
||||||
|
nationality?: string
|
||||||
|
intcode_cell?: string
|
||||||
|
iso2_cell?: string
|
||||||
cell?: string
|
cell?: string
|
||||||
dateofbirth?: Date
|
dateofbirth?: Date
|
||||||
sex?: ESexType
|
sex?: ESexType
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { IUserProfile } from '@src/model/UserStore'
|
||||||
|
|
||||||
export interface ISignupOptions {
|
export interface ISignupOptions {
|
||||||
email?: string
|
email?: string
|
||||||
@@ -9,4 +10,5 @@ export interface ISignupOptions {
|
|||||||
repeatPassword?: string
|
repeatPassword?: string
|
||||||
terms?: boolean
|
terms?: boolean
|
||||||
aportador_solidario?: string
|
aportador_solidario?: string
|
||||||
|
profile?: IUserProfile
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,13 +104,18 @@ const msgglobal = {
|
|||||||
content2: 'Contenuto 2',
|
content2: 'Contenuto 2',
|
||||||
options: 'Opzioni',
|
options: 'Opzioni',
|
||||||
},
|
},
|
||||||
|
dashboard: {
|
||||||
|
downline: 'Persone che hai Invitato',
|
||||||
|
},
|
||||||
reg: {
|
reg: {
|
||||||
aportador_solidario: 'Chi ti ha Invitato',
|
aportador_solidario: 'Chi ti ha Invitato',
|
||||||
page_title: 'Registrazione',
|
page_title: 'Registrazione',
|
||||||
incorso: 'Registrazione in corso...',
|
incorso: 'Registrazione in corso...',
|
||||||
richiesto: 'Campo Richiesto',
|
richiesto: 'Campo Richiesto',
|
||||||
email: 'Email',
|
email: 'Email',
|
||||||
cell: 'Telefono',
|
intcode_cell: 'Prefisso Int.',
|
||||||
|
cell: 'Cellulare',
|
||||||
|
nationality: 'Nazionalità',
|
||||||
email_paypal: 'Email Paypal',
|
email_paypal: 'Email Paypal',
|
||||||
username_telegram: 'Username Telegram',
|
username_telegram: 'Username Telegram',
|
||||||
img: 'Immagine',
|
img: 'Immagine',
|
||||||
@@ -134,7 +139,6 @@ const msgglobal = {
|
|||||||
email: 'inserire una email valida',
|
email: 'inserire una email valida',
|
||||||
errore_generico: 'Si prega di compilare correttamente i campi',
|
errore_generico: 'Si prega di compilare correttamente i campi',
|
||||||
atleast: 'dev\'essere lungo almeno di',
|
atleast: 'dev\'essere lungo almeno di',
|
||||||
// complexity: 'deve contenere almeno 1 minuscola, 1 maiuscola, 1 cifra e 1 carattere speciale (!,$,#,%,-) ',
|
|
||||||
complexity: 'deve contenere almeno 1 minuscola, 1 maiuscola, 1 cifra',
|
complexity: 'deve contenere almeno 1 minuscola, 1 maiuscola, 1 cifra',
|
||||||
notmore: 'non dev\'essere lungo più di',
|
notmore: 'non dev\'essere lungo più di',
|
||||||
char: 'caratteri',
|
char: 'caratteri',
|
||||||
@@ -473,13 +477,18 @@ const msgglobal = {
|
|||||||
content2: 'Contenuto 2',
|
content2: 'Contenuto 2',
|
||||||
options: 'Opciones',
|
options: 'Opciones',
|
||||||
},
|
},
|
||||||
|
dashboard: {
|
||||||
|
downline: 'Personas que has invitado',
|
||||||
|
},
|
||||||
reg: {
|
reg: {
|
||||||
aportador_solidario: 'Aportador Solidario',
|
aportador_solidario: 'Aportador Solidario',
|
||||||
page_title: 'Registro',
|
page_title: 'Registro',
|
||||||
incorso: 'Registro en curso...',
|
incorso: 'Registro en curso...',
|
||||||
richiesto: 'Campo requerido',
|
richiesto: 'Campo requerido',
|
||||||
email: 'Email',
|
email: 'Email',
|
||||||
|
intcode_cell: 'Prefijo Int.',
|
||||||
cell: 'Móvil',
|
cell: 'Móvil',
|
||||||
|
nationality: 'Nacionalidad',
|
||||||
email_paypal: 'Email Paypal',
|
email_paypal: 'Email Paypal',
|
||||||
username_telegram: 'Usuario Telegram',
|
username_telegram: 'Usuario Telegram',
|
||||||
img: 'File image',
|
img: 'File image',
|
||||||
@@ -832,12 +841,17 @@ const msgglobal = {
|
|||||||
content2: 'Contenu 2',
|
content2: 'Contenu 2',
|
||||||
options: 'Options',
|
options: 'Options',
|
||||||
},
|
},
|
||||||
|
dashboard: {
|
||||||
|
downline: 'Les personnes que vous avez invitées',
|
||||||
|
},
|
||||||
reg: {
|
reg: {
|
||||||
aportador_solidario: 'Contributeur de solidarité',
|
aportador_solidario: 'Contributeur de solidarité',
|
||||||
incorso: 'Inscription en cours...',
|
incorso: 'Inscription en cours...',
|
||||||
richiesto: 'Champ obligatoire',
|
richiesto: 'Champ obligatoire',
|
||||||
email: 'Email',
|
email: 'Email',
|
||||||
|
intcode_cell: 'Préfixe int.',
|
||||||
cell: 'Téléphone',
|
cell: 'Téléphone',
|
||||||
|
nationality: 'Nationalité',
|
||||||
email_paypal: 'Email Paypal',
|
email_paypal: 'Email Paypal',
|
||||||
username_telegram: 'Nom d\'utilisateur du Telegram',
|
username_telegram: 'Nom d\'utilisateur du Telegram',
|
||||||
img: 'Fichier image',
|
img: 'Fichier image',
|
||||||
@@ -1190,12 +1204,17 @@ const msgglobal = {
|
|||||||
content2: 'Content 2',
|
content2: 'Content 2',
|
||||||
options: 'Options',
|
options: 'Options',
|
||||||
},
|
},
|
||||||
|
dashboard: {
|
||||||
|
downline: 'People you\'ve invited',
|
||||||
|
},
|
||||||
reg: {
|
reg: {
|
||||||
aportador_solidario: 'Solidarity Contributor',
|
aportador_solidario: 'Solidarity Contributor',
|
||||||
incorso: 'Registration please wait...',
|
incorso: 'Registration please wait...',
|
||||||
richiesto: 'Field Required',
|
richiesto: 'Field Required',
|
||||||
email: 'Email',
|
email: 'Email',
|
||||||
cell: 'Phone',
|
intcode_cell: 'International Code',
|
||||||
|
cell: 'Mobile Phone',
|
||||||
|
nationality: 'Nationality',
|
||||||
email_paypal: 'Email Paypal',
|
email_paypal: 'Email Paypal',
|
||||||
username_telegram: 'Username Telegram',
|
username_telegram: 'Username Telegram',
|
||||||
img: 'File Image',
|
img: 'File Image',
|
||||||
@@ -1547,13 +1566,18 @@ const msgglobal = {
|
|||||||
content2: 'Content 2',
|
content2: 'Content 2',
|
||||||
options: 'Options',
|
options: 'Options',
|
||||||
},
|
},
|
||||||
|
dashboard: {
|
||||||
|
downline: 'People you\'ve invited',
|
||||||
|
},
|
||||||
reg: {
|
reg: {
|
||||||
aportador_solidario: 'Solidarity Contributor',
|
aportador_solidario: 'Solidarity Contributor',
|
||||||
page_title: 'Registration',
|
page_title: 'Registration',
|
||||||
incorso: 'Registration please wait...',
|
incorso: 'Registration please wait...',
|
||||||
richiesto: 'Field Required',
|
richiesto: 'Field Required',
|
||||||
email: 'Email',
|
email: 'Email',
|
||||||
cell: 'Phone',
|
intcode_cell: 'International Code',
|
||||||
|
cell: 'Mobile Phone',
|
||||||
|
nationality: 'Nationality',
|
||||||
email_paypal: 'Email Paypal',
|
email_paypal: 'Email Paypal',
|
||||||
username_telegram: 'Username Telegram',
|
username_telegram: 'Username Telegram',
|
||||||
img: 'File Image',
|
img: 'File Image',
|
||||||
|
|||||||
@@ -34,8 +34,10 @@ const DefaultUser: IUserFields = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const DefaultProfile: IUserProfile = {
|
export const DefaultProfile: IUserProfile = {
|
||||||
img: '',
|
img: '',
|
||||||
|
nationality: '',
|
||||||
|
intcode_cell: '',
|
||||||
cell: '',
|
cell: '',
|
||||||
dateofbirth: new Date(),
|
dateofbirth: new Date(),
|
||||||
sex: 0,
|
sex: 0,
|
||||||
@@ -516,6 +518,7 @@ namespace Actions {
|
|||||||
|
|
||||||
return bcrypt.hash(authData.password, bcrypt.genSaltSync(12))
|
return bcrypt.hash(authData.password, bcrypt.genSaltSync(12))
|
||||||
.then((hashedPassword: string) => {
|
.then((hashedPassword: string) => {
|
||||||
|
/*
|
||||||
const usertosend = {
|
const usertosend = {
|
||||||
lang: mylang,
|
lang: mylang,
|
||||||
email: authData.email,
|
email: authData.email,
|
||||||
@@ -524,12 +527,15 @@ namespace Actions {
|
|||||||
name: authData.name,
|
name: authData.name,
|
||||||
surname: authData.surname
|
surname: authData.surname
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(usertosend)
|
console.log(usertosend)
|
||||||
|
|
||||||
|
*/
|
||||||
|
authData.lang = mylang
|
||||||
|
authData.password = String(hashedPassword)
|
||||||
|
|
||||||
Mutations.mutations.setServerCode(tools.CALLING)
|
Mutations.mutations.setServerCode(tools.CALLING)
|
||||||
|
|
||||||
return Api.SendReq('/users', 'POST', usertosend)
|
return Api.SendReq('/users', 'POST', authData)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
|
||||||
const newuser = res.data
|
const newuser = res.data
|
||||||
@@ -569,6 +575,7 @@ namespace Actions {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
console.log('Err', error)
|
||||||
UserStore.mutations.setErrorCatch(error)
|
UserStore.mutations.setErrorCatch(error)
|
||||||
return UserStore.getters.getServerCode
|
return UserStore.getters.getServerCode
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -378,7 +378,10 @@ export const fieldsTable = {
|
|||||||
AddCol({ name: 'name', label_trans: 'reg.name' }),
|
AddCol({ name: 'name', label_trans: 'reg.name' }),
|
||||||
AddCol({ name: 'surname', label_trans: 'reg.surname' }),
|
AddCol({ name: 'surname', label_trans: 'reg.surname' }),
|
||||||
AddCol({ name: 'email', label_trans: 'reg.email' }),
|
AddCol({ name: 'email', label_trans: 'reg.email' }),
|
||||||
AddCol({ name: 'profile.cell', field: 'profile', subfield: 'cell', label_trans: 'reg.cell' }),
|
AddCol({ name: 'profile.nationality', field: 'profile', subfield: 'nationality', label_trans: 'reg.nationality', fieldtype: tools.FieldType.nationality }),
|
||||||
|
AddCol({ name: 'profile.intcode_cell', field: 'profile', subfield: 'intcode_cell', label_trans: 'reg.intcode_cell', fieldtype: tools.FieldType.intcode }),
|
||||||
|
AddCol({ name: 'profile.iso2_cell', field: 'profile', subfield: 'iso2_cell', label_trans: 'reg.iso2_cell' }),
|
||||||
|
AddCol({ name: 'profile.cell', field: 'profile', subfield: 'cell', label_trans: 'reg.cell', fieldtype: tools.FieldType.intcode }),
|
||||||
AddCol({ name: 'profile.email_paypal', field: 'profile', subfield: 'email_paypal', label_trans: 'reg.email_paypal' }),
|
AddCol({ name: 'profile.email_paypal', field: 'profile', subfield: 'email_paypal', label_trans: 'reg.email_paypal' }),
|
||||||
AddCol({ name: 'profile.username_telegram', field: 'profile', subfield: 'username_telegram', label_trans: 'reg.username_telegram' }),
|
AddCol({ name: 'profile.username_telegram', field: 'profile', subfield: 'username_telegram', label_trans: 'reg.username_telegram' }),
|
||||||
AddCol({ name: 'profile.img', field: 'profile', subfield: 'img', label_trans: 'reg.img', sortable: false }),
|
AddCol({ name: 'profile.img', field: 'profile', subfield: 'img', label_trans: 'reg.img', sortable: false }),
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ export const serv_constants = {
|
|||||||
RIS_CODE_ERR: -99,
|
RIS_CODE_ERR: -99,
|
||||||
RIS_CODE_EMAIL_ALREADY_VERIFIED: -5,
|
RIS_CODE_EMAIL_ALREADY_VERIFIED: -5,
|
||||||
RIS_CODE_EMAIL_VERIFIED: 1,
|
RIS_CODE_EMAIL_VERIFIED: 1,
|
||||||
|
|
||||||
|
RIS_CODE_USERNAME_ALREADY_EXIST: -60,
|
||||||
|
RIS_CODE_EMAIL_ALREADY_EXIST: -50,
|
||||||
|
RIS_CODE_EMAIL_NOT_SENT: -40,
|
||||||
RIS_CODE_ERR_UNAUTHORIZED: -30,
|
RIS_CODE_ERR_UNAUTHORIZED: -30,
|
||||||
|
|
||||||
RIS_CODE_LOGIN_ERR_GENERIC: -20,
|
RIS_CODE_LOGIN_ERR_GENERIC: -20,
|
||||||
|
|||||||
@@ -47,6 +47,8 @@ export interface INotify {
|
|||||||
export const tools = {
|
export const tools = {
|
||||||
CAN_EDIT: 'q-ce',
|
CAN_EDIT: 'q-ce',
|
||||||
|
|
||||||
|
getprefCountries: ['it', 'us', 'es', 'uk', 'fr', 'de', 'ch'],
|
||||||
|
|
||||||
APORTADOR_SOLIDARIO: 'apsol',
|
APORTADOR_SOLIDARIO: 'apsol',
|
||||||
|
|
||||||
listBestColor: [
|
listBestColor: [
|
||||||
@@ -83,8 +85,6 @@ export const tools = {
|
|||||||
ERR_GENERICO: -1,
|
ERR_GENERICO: -1,
|
||||||
ERR_SERVERFETCH: -2,
|
ERR_SERVERFETCH: -2,
|
||||||
ERR_AUTHENTICATION: -5,
|
ERR_AUTHENTICATION: -5,
|
||||||
DUPLICATE_EMAIL_ID: 11000,
|
|
||||||
DUPLICATE_USERNAME_ID: 11100,
|
|
||||||
|
|
||||||
NOFIELD: 'nofield',
|
NOFIELD: 'nofield',
|
||||||
|
|
||||||
@@ -144,6 +144,8 @@ export const tools = {
|
|||||||
password: 512,
|
password: 512,
|
||||||
listimages: 1024,
|
listimages: 1024,
|
||||||
image: 2048,
|
image: 2048,
|
||||||
|
nationality: 4096,
|
||||||
|
intcode: 5000,
|
||||||
},
|
},
|
||||||
|
|
||||||
FieldTypeArr: [
|
FieldTypeArr: [
|
||||||
@@ -2572,9 +2574,9 @@ export const tools = {
|
|||||||
|
|
||||||
SignUpcheckErrors(mythis, riscode: number) {
|
SignUpcheckErrors(mythis, riscode: number) {
|
||||||
console.log('SignUpcheckErrors', riscode)
|
console.log('SignUpcheckErrors', riscode)
|
||||||
if (riscode === tools.DUPLICATE_EMAIL_ID) {
|
if (riscode === serv_constants.RIS_CODE_EMAIL_ALREADY_EXIST) {
|
||||||
tools.showNotif(mythis.$q, mythis.$t('reg.err.duplicate_email'))
|
tools.showNotif(mythis.$q, mythis.$t('reg.err.duplicate_email'))
|
||||||
} else if (riscode === tools.DUPLICATE_USERNAME_ID) {
|
} else if (riscode === serv_constants.RIS_CODE_USERNAME_ALREADY_EXIST) {
|
||||||
tools.showNotif(mythis.$q, mythis.$t('reg.err.duplicate_username'))
|
tools.showNotif(mythis.$q, mythis.$t('reg.err.duplicate_username'))
|
||||||
} else if (riscode === tools.ERR_SERVERFETCH) {
|
} else if (riscode === tools.ERR_SERVERFETCH) {
|
||||||
tools.showNotif(mythis.$q, mythis.$t('fetch.errore_server'))
|
tools.showNotif(mythis.$q, mythis.$t('fetch.errore_server'))
|
||||||
@@ -2746,7 +2748,7 @@ export const tools = {
|
|||||||
},
|
},
|
||||||
getCookie(mytok, def?) {
|
getCookie(mytok, def?) {
|
||||||
const ris = Cookies.get(mytok)
|
const ris = Cookies.get(mytok)
|
||||||
console.log('getCookie', ris)
|
// console.log('getCookie', ris)
|
||||||
if (!!ris) {
|
if (!!ris) {
|
||||||
return ris
|
return ris
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<q-page padding class="signup">
|
<q-page padding class="signup">
|
||||||
<CSignUp :adult="adult">
|
<CSignUp :showadultcheck="false">
|
||||||
|
|
||||||
</CSignUp>
|
</CSignUp>
|
||||||
</q-page>
|
</q-page>
|
||||||
|
|||||||
Reference in New Issue
Block a user