- Profile
- Bot Telegram - fixed Chip multiselect
This commit is contained in:
@@ -45,6 +45,7 @@ export default class CDateTime extends Vue {
|
||||
this.valueDate = new Date()
|
||||
this.myvalue = tools.getstrYYMMDDDateTime(this.valueDate)
|
||||
}
|
||||
// console.log('Opening', this.valueDate, this.myvalue)
|
||||
this.$emit('show')
|
||||
}
|
||||
|
||||
|
||||
@@ -142,9 +142,9 @@ export default class CGridTableRec extends Vue {
|
||||
|
||||
if (this.colsel.subfield !== '') {
|
||||
if (mydata.fieldsvalue[this.colsel.field] === undefined) {
|
||||
mydata.fieldsvalue[this.colsel.field] = {}
|
||||
mydata.fieldsvalue[this.colsel.field + '.' + this.colsel.subfield] = newVal
|
||||
}
|
||||
mydata.fieldsvalue[this.colsel.field][this.colsel.subfield] = newVal
|
||||
// mydata.fieldsvalue[this.colsel.field][this.colsel.subfield] = newVal
|
||||
} else {
|
||||
mydata.fieldsvalue[this.colsel.field] = newVal
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
.clchip{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
//flex: 1;
|
||||
//flex-direction: column;
|
||||
}
|
||||
|
||||
@@ -35,52 +35,84 @@ export default class CMyChipList extends Vue {
|
||||
this.myarrvalues = []
|
||||
|
||||
// console.table(this.options)
|
||||
this.options.forEach((rec, index) => {
|
||||
if (this.type === tools.FieldType.multiselect) {
|
||||
if (this.value.includes(rec[this.optval])) {
|
||||
const mydata = {
|
||||
label: null,
|
||||
value: rec[this.optval],
|
||||
// myris = mylist.filter((myrec) => arrval.includes(myrec[key]))
|
||||
valbool: true,
|
||||
icon: '',
|
||||
color: tools.getColorByIndexBest(index)
|
||||
if (this.options) {
|
||||
this.options.forEach((rec, index) => {
|
||||
if (this.type === tools.FieldType.multiselect) {
|
||||
if (!!this.value) {
|
||||
if (this.value.includes(rec[this.optval])) {
|
||||
const mydata = {
|
||||
label: null,
|
||||
value: rec[this.optval],
|
||||
// myris = mylist.filter((myrec) => arrval.includes(myrec[key]))
|
||||
valbool: true,
|
||||
icon: '',
|
||||
color: tools.getColorByIndexBest(index)
|
||||
}
|
||||
|
||||
if (tools.isObject(this.optlab)) {
|
||||
mydata.label = this.options.filter((myrec) => myrec[this.optval] === mydata.value).map(this.optlab)
|
||||
if (mydata.label)
|
||||
mydata.label = mydata.label[0]
|
||||
} else {
|
||||
mydata.label = rec[this.optlab]
|
||||
}
|
||||
|
||||
if (this.opticon)
|
||||
mydata.icon = rec[this.opticon]
|
||||
if (this.optcolor)
|
||||
mydata.color = rec[this.optcolor]
|
||||
|
||||
this.myarrvalues.push(mydata)
|
||||
}
|
||||
}
|
||||
} else if (this.type === tools.FieldType.select) {
|
||||
if (this.value === rec[this.optval]) {
|
||||
const mydata = {
|
||||
label: null,
|
||||
value: this.value,
|
||||
valbool: true,
|
||||
icon: '',
|
||||
color: tools.getColorByIndexBest(index)
|
||||
}
|
||||
|
||||
// console.log('mydata', mydata, 'optlab', this.optlab, 'value', this.value)
|
||||
|
||||
if (tools.isObject(this.optlab)) {
|
||||
mydata.label = this.options.filter((myrec) => myrec[this.optval] === mydata.value).map(this.optlab)
|
||||
if (mydata.label)
|
||||
mydata.label = mydata.label[0]
|
||||
} else {
|
||||
mydata.label = rec[this.optlab]
|
||||
}
|
||||
|
||||
if (this.opticon)
|
||||
mydata.icon = rec[this.opticon]
|
||||
if (this.optcolor)
|
||||
mydata.color = rec[this.optcolor]
|
||||
|
||||
this.myarrvalues.push(mydata)
|
||||
}
|
||||
|
||||
if (tools.isObject(this.optlab)) {
|
||||
mydata.label = this.options.filter((myrec) => myrec[this.optval] === mydata.value).map(this.optlab)
|
||||
if (mydata.label)
|
||||
mydata.label = mydata.label[0]
|
||||
} else {
|
||||
mydata.label = rec[this.optlab]
|
||||
} else {
|
||||
if (tools.isBitActive(this.value, rec[this.optval])) {
|
||||
const mydata = {
|
||||
label: this.$t(rec[this.optlab]),
|
||||
value: rec[this.optval],
|
||||
valbool: tools.isBitActive(this.value, rec[this.optval]),
|
||||
icon: '',
|
||||
color: tools.getColorByIndexBest(index)
|
||||
}
|
||||
|
||||
if (this.opticon)
|
||||
mydata.icon = rec[this.opticon]
|
||||
if (this.optcolor)
|
||||
mydata.color = rec[this.optcolor]
|
||||
|
||||
this.myarrvalues.push(mydata)
|
||||
}
|
||||
|
||||
if (this.opticon)
|
||||
mydata.icon = rec[this.opticon]
|
||||
if (this.optcolor)
|
||||
mydata.color = rec[this.optcolor]
|
||||
|
||||
this.myarrvalues.push(mydata)
|
||||
}
|
||||
} else {
|
||||
if (tools.isBitActive(this.value, rec[this.optval])) {
|
||||
const mydata = {
|
||||
label: this.$t(rec[this.optlab]),
|
||||
value: rec[this.optval],
|
||||
valbool: tools.isBitActive(this.value, rec[this.optval]),
|
||||
icon: '',
|
||||
color: tools.getColorByIndexBest(index)
|
||||
}
|
||||
|
||||
if (this.opticon)
|
||||
mydata.icon = rec[this.opticon]
|
||||
if (this.optcolor)
|
||||
mydata.color = rec[this.optcolor]
|
||||
|
||||
this.myarrvalues.push(mydata)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
if (this.myarrvalues.length === 0)
|
||||
this.myarrvalues.push({ label: this.$t('otherpages.manage.nessuno'), color: 'gray' })
|
||||
|
||||
@@ -10,10 +10,11 @@ import { fieldsTable } from '../../store/Modules/fieldsTable'
|
||||
import { IColGridTable } from '../../model'
|
||||
import { CMySelect } from '../CMySelect'
|
||||
import { GlobalStore, UserStore } from '../../store/Modules'
|
||||
import { CMyChipList } from '../CMyChipList'
|
||||
|
||||
@Component({
|
||||
name: 'CMyFieldDb',
|
||||
components: { CMyEditor, CMySelect }
|
||||
components: { CMyEditor, CMySelect, CMyChipList }
|
||||
})
|
||||
|
||||
export default class CMyFieldDb extends MixinBase {
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
:opticon="db_fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
|
||||
</div>
|
||||
<!-- Show Value -->
|
||||
<div v-else-if="col.fieldtype === tools.FieldType.nationality">
|
||||
<div v-else-if="type === tools.FieldType.nationality">
|
||||
<q-input
|
||||
input-class="cursor-pointer text-center"
|
||||
:readonly="true"
|
||||
@@ -54,9 +54,9 @@
|
||||
|
||||
</q-input>
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === tools.FieldType.intcode">
|
||||
<div v-else-if="type === tools.FieldType.intcode">
|
||||
|
||||
{{ myvalue }}
|
||||
{{ myvalprinted }}
|
||||
|
||||
</div>
|
||||
<div v-else-if="type === tools.FieldType.multiselect">
|
||||
@@ -68,6 +68,16 @@
|
||||
:optlab="db_fieldsTable.getLabelByTable(col.jointable)"
|
||||
:opticon="db_fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
|
||||
</div>
|
||||
<div v-else-if="type === tools.FieldType.select">
|
||||
<CMyChipList
|
||||
myclass="text-center"
|
||||
:type="tools.FieldType.select"
|
||||
:value="myvalue"
|
||||
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
|
||||
:optval="db_fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="db_fieldsTable.getLabelByTable(col.jointable)"
|
||||
:opticon="db_fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
|
||||
</div>
|
||||
<div v-else-if="type === tools.FieldType.html">
|
||||
<div v-html="myvalprinted">
|
||||
|
||||
@@ -186,7 +196,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div v-else-if="type === tools.FieldType.multiselect">
|
||||
<div v-else-if="col.fieldtype === tools.FieldType.multiselect">
|
||||
<q-select
|
||||
v-model="myvalue"
|
||||
rounded
|
||||
|
||||
@@ -72,7 +72,7 @@ export default class CMyPopupEdit extends Vue {
|
||||
|
||||
public SaveValueInt(newVal, valinitial) {
|
||||
|
||||
// console.log('SaveValueInt', newVal)
|
||||
console.log('SaveValueInt', newVal, valinitial)
|
||||
|
||||
// Update value in table memory
|
||||
if (this.subfield !== '') {
|
||||
|
||||
@@ -58,6 +58,16 @@
|
||||
:optlab="db_fieldsTable.getLabelByTable(col.jointable)"
|
||||
:opticon="db_fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === tools.FieldType.select">
|
||||
<CMyChipList
|
||||
myclass="text-center"
|
||||
:type="tools.FieldType.select"
|
||||
:value="myvalue"
|
||||
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
|
||||
:optval="db_fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="db_fieldsTable.getLabelByTable(col.jointable)"
|
||||
:opticon="db_fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === tools.FieldType.boolean">
|
||||
<q-toggle dark color="green" v-model="myvalue" :label="col.title"
|
||||
@input="Savedb"></q-toggle>
|
||||
@@ -174,6 +184,8 @@
|
||||
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === tools.FieldType.multiselect">
|
||||
<div>join: {{col.jointable}}</div>
|
||||
|
||||
<q-select
|
||||
v-model="myvalue"
|
||||
rounded
|
||||
|
||||
@@ -126,7 +126,7 @@ export default class CSignUp extends MixinBase {
|
||||
public errorMsg(cosa: string, item: any) {
|
||||
try {
|
||||
if (!item.$error) { return '' }
|
||||
console.log('errorMsg', cosa, item)
|
||||
// console.log('errorMsg', cosa, item)
|
||||
if (item.$params.email && !item.email) { return this.$t('reg.err.email') }
|
||||
|
||||
if (cosa === 'repeatpassword') {
|
||||
@@ -135,7 +135,7 @@ export default class CSignUp extends MixinBase {
|
||||
}
|
||||
}
|
||||
|
||||
console.log('item', item)
|
||||
// console.log('item', item)
|
||||
|
||||
if (item.minLength !== undefined) {
|
||||
if (!item.minLength) {
|
||||
@@ -155,7 +155,7 @@ export default class CSignUp extends MixinBase {
|
||||
}
|
||||
}
|
||||
|
||||
console.log(' ....avanti')
|
||||
// console.log(' ....avanti')
|
||||
if (cosa === 'email') {
|
||||
// console.log("EMAIL " + item.isUnique);
|
||||
// console.log(item);
|
||||
@@ -166,7 +166,7 @@ export default class CSignUp extends MixinBase {
|
||||
} else if (cosa === 'aportador_solidario') {
|
||||
// console.log(item);
|
||||
if (!item.aportadorexist) {
|
||||
console.log('!item.aportadorexist !')
|
||||
// console.log('!item.aportadorexist !')
|
||||
return this.$t('reg.err.aportador_not_exist')
|
||||
}
|
||||
} else if ((cosa === 'name') || (cosa === 'surname')) {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
@blur="$v.signup.aportador_solidario.$touch"
|
||||
:error="$v.signup.aportador_solidario.$error"
|
||||
:error-message="errorMsg('aportador_solidario', $v.signup.aportador_solidario)"
|
||||
|
||||
maxlength="20"
|
||||
debounce="1000"
|
||||
|
||||
:label="$t('reg.aportador_solidario')">
|
||||
@@ -35,7 +35,7 @@
|
||||
@blur="$v.signup.email.$touch"
|
||||
:error="$v.signup.email.$error"
|
||||
:error-message="errorMsg('email', $v.signup.email)"
|
||||
|
||||
maxlength="50"
|
||||
debounce="1000"
|
||||
:label="$t('reg.email')">
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
@blur="$v.signup.username.$touch"
|
||||
:error="$v.signup.username.$error"
|
||||
@keydown.space="(event) => event.preventDefault()"
|
||||
|
||||
maxlength="20"
|
||||
debounce="1000"
|
||||
:error-message="errorMsg('username', $v.signup.username)"
|
||||
:label="$t('reg.username')">
|
||||
@@ -67,7 +67,7 @@
|
||||
rounded outlined
|
||||
@blur="$v.signup.name.$touch"
|
||||
:error="$v.signup.name.$error"
|
||||
|
||||
maxlength="30"
|
||||
debounce="1000"
|
||||
:error-message="errorMsg('name', $v.signup.name)"
|
||||
:label="$t('reg.name')">
|
||||
@@ -83,7 +83,7 @@
|
||||
rounded outlined
|
||||
@blur="$v.signup.surname.$touch"
|
||||
:error="$v.signup.surname.$error"
|
||||
|
||||
maxlength="30"
|
||||
debounce="1000"
|
||||
:error-message="errorMsg('surname', $v.signup.surname)"
|
||||
:label="$t('reg.surname')">
|
||||
@@ -101,7 +101,7 @@
|
||||
@blur="$v.signup.password.$touch"
|
||||
:error="$v.signup.password.$error"
|
||||
:error-message="`${errorMsg('password', $v.signup.password)}`"
|
||||
|
||||
maxlength="30"
|
||||
:label="$t('reg.password')">
|
||||
|
||||
<template v-slot:prepend>
|
||||
@@ -113,6 +113,7 @@
|
||||
<q-input
|
||||
v-model="signup.repeatPassword"
|
||||
type="password"
|
||||
maxlength="30"
|
||||
rounded outlined
|
||||
@blur="$v.signup.repeatPassword.$touch"
|
||||
:error="$v.signup.repeatPassword.$error"
|
||||
@@ -155,6 +156,7 @@
|
||||
@country-changed="intcode_change"
|
||||
v-model="signup.profile.cell"
|
||||
:placeholder="$t('reg.cell')"
|
||||
maxlength="20"
|
||||
:enabledCountryCode="true"
|
||||
inputClasses="clCell"
|
||||
wrapperClasses="clCellCode">
|
||||
|
||||
Reference in New Issue
Block a user