-Quando insersci l'username telegram sul Profilo, devo togliergli la chiocciola !

- anche nella ricerca User
This commit is contained in:
Surya Paolo
2024-02-28 17:04:34 +01:00
parent 965f32b65c
commit 8da93f3f4a
6 changed files with 72 additions and 20 deletions

View File

@@ -128,6 +128,11 @@ export default defineComponent({
required: false, required: false,
default: false, default: false,
}, },
notAllowAtChar: { // @
type: Boolean,
required: false,
default: false,
},
}, },
components: { CMyPopupEdit }, components: { CMyPopupEdit },
setup(props, { emit }) { setup(props, { emit }) {
@@ -152,7 +157,12 @@ export default defineComponent({
} }
function save(newval: any) { function save(newval: any) {
emit('save', newval) let valore = newval
if (props.notAllowAtChar) {
valore = tools.rimuoviAtPrimoCarattere(valore)
}
emit('save', valore)
} }
function withBorder() { function withBorder() {

View File

@@ -53,6 +53,7 @@
minuteinterval="1" minuteinterval="1"
@showandsave="showandsel" @showandsave="showandsel"
@save="save" @save="save"
:notAllowAtChar="notAllowAtChar"
> >
</CMyPopupEdit> </CMyPopupEdit>

View File

@@ -208,6 +208,11 @@ export default defineComponent({
required: false, required: false,
default: false, default: false,
}, },
notAllowAtChar: {
type: Boolean,
required: false,
default: false,
},
path: { path: {
type: String, type: String,
required: false, required: false,
@@ -377,10 +382,10 @@ export default defineComponent({
} }
function changevalRec(newval: any) { function changevalRec(newval: any) {
// console.log('changevalRec', newval) console.log('changevalRec', newval)
// if (!props.insertMode || (props.insertMode && col.value.fieldtype !== costanti.FieldType.multioption)) { // if (!props.insertMode || (props.insertMode && col.value.fieldtype !== costanti.FieldType.multioption)) {
if (col.value && col.value.allowchar === costanti.ALLOWCHAR_CODE) { if (col.value && col.value.allowchar === costanti.ALLOWCHAR_CODE) {
myvalue.value = tools.removespaces_slash(newval) newval = tools.removespaces_slash(newval)
} }
// console.log('popuppedit: changevalRec', newval, 'COLName', col.value.name) // console.log('popuppedit: changevalRec', newval, 'COLName', col.value.name)
@@ -390,6 +395,10 @@ export default defineComponent({
// console.log('image', newval) // console.log('image', newval)
} }
if (props.notAllowAtChar) {
newval = tools.rimuoviAtPrimoCarattere(newval)
}
myrow.value[col.value.name] = newval myrow.value[col.value.name] = newval
@@ -529,6 +538,12 @@ export default defineComponent({
} }
} }
if (props.notAllowAtChar) {
newVal = tools.rimuoviAtPrimoCarattere(newVal)
myvalue.value = newVal
}
console.log('newVal', newVal)
if (isFieldDb()) { if (isFieldDb()) {
savefield(newVal, valinitial, $q) savefield(newVal, valinitial, $q)

View File

@@ -147,7 +147,7 @@
color="green" color="green"
>online</q-badge >online</q-badge
> >
<q-badge <q-badge
v-if="tools.notisVerifiedByUser(row)" v-if="tools.notisVerifiedByUser(row)"
align="bottom" align="bottom"
@@ -205,7 +205,10 @@
col.fieldtype === costanti.FieldType.crypted col.fieldtype === costanti.FieldType.crypted
" "
> >
<div v-if="isInModif" :class="{ flex: !isInModif, 'q-mb-sm': true }"> <div
v-if="isInModif"
:class="{ flex: !isInModif, 'q-mb-sm': true }"
>
<q-input <q-input
v-bind="$attrs" v-bind="$attrs"
v-model="myvalue" v-model="myvalue"
@@ -228,10 +231,13 @@
> >
</q-input> </q-input>
<q-field v-if="col.showLinkResult"> <q-field v-if="col.showLinkResult">
Diventerà: <a :href="tools.generateURL(col.showLinkResult, myvalue)" target="_blank">{{tools.generateURL(col.showLinkResult, myvalue)}}</a> Diventerà:
<a
:href="tools.generateURL(col.showLinkResult, myvalue)"
target="_blank"
>{{ tools.generateURL(col.showLinkResult, myvalue) }}</a
>
</q-field> </q-field>
</div> </div>
<div <div
v-else-if="col.tipovisu === costanti.TipoVisu.TESTO_BORDATO" v-else-if="col.tipovisu === costanti.TipoVisu.TESTO_BORDATO"
@@ -284,11 +290,13 @@
:label="myvalue" :label="myvalue"
> >
</q-btn> </q-btn>
<span <span v-else>
v-else <span v-if="notAllowAtChar" class="text-h7">@</span>
:class="{ disabled: disable }" <span
v-html="visuValByType(myvalue, col, row)" :class="{ disabled: disable }"
></span> v-html="visuValByType(myvalue, col, row)"
></span>
</span>
</div> </div>
</div> </div>
<div <div
@@ -573,7 +581,7 @@
? $t(col.label_trans) ? $t(col.label_trans)
: '' : ''
" "
:class="{'cursor-pointer': canEdit}" :class="{ 'cursor-pointer': canEdit }"
v-model:value="myvalue" v-model:value="myvalue"
:readonly="false" :readonly="false"
:minuteinterval="minuteinterval" :minuteinterval="minuteinterval"
@@ -596,7 +604,7 @@
<div v-else-if="col.fieldtype === costanti.FieldType.onlydate"> <div v-else-if="col.fieldtype === costanti.FieldType.onlydate">
<CDateTime <CDateTime
:label="col.label ? col.label : $t(col.label_trans)" :label="col.label ? col.label : $t(col.label_trans)"
:class="{'cursor-pointer': canEdit}" :class="{ 'cursor-pointer': canEdit }"
:valueDate="myvalue" :valueDate="myvalue"
v-model:value="myvalue" v-model:value="myvalue"
:readonly="false" :readonly="false"
@@ -744,7 +752,7 @@
</div> </div>
<div v-else>(Scegli)</div> <div v-else>(Scegli)</div>
</div> </div>
<div v-else-if="col.fieldtype === costanti.FieldType.multioption"> <div v-else-if="col.fieldtype === costanti.FieldType.multioption">
<q-option-group <q-option-group
v-model="myvalue" v-model="myvalue"
:inline="col.inline" :inline="col.inline"
@@ -926,7 +934,11 @@
</div> </div>
<div v-else-if="col.fieldtype === costanti.FieldType.html"> <div v-else-if="col.fieldtype === costanti.FieldType.html">
<div v-if="isInModif"> <div v-if="isInModif">
<q-bar v-if="isInModif" :dense="dense" class="bg-primary text-white"> <q-bar
v-if="isInModif"
:dense="dense"
class="bg-primary text-white"
>
<span v-if="col.label_trans">{{ $t(col.label_trans) }}</span <span v-if="col.label_trans">{{ $t(col.label_trans) }}</span
><span v-else> {{ $t('event.testo_di_spiegazione') }}: </span> ><span v-else> {{ $t('event.testo_di_spiegazione') }}: </span>
<q-space /> <q-space />
@@ -1067,7 +1079,8 @@
col.fieldtype === costanti.FieldType.string || col.fieldtype === costanti.FieldType.string ||
col.fieldtype === costanti.FieldType.crypted col.fieldtype === costanti.FieldType.crypted
" "
> >
<q-input <q-input
v-bind="$attrs" v-bind="$attrs"
counter counter
@@ -1084,6 +1097,9 @@
@keyup.enter.stop @keyup.enter.stop
autofocus autofocus
> >
<template v-if="notAllowAtChar" v-slot:prepend>
<span class="text-h7 text-blue">@</span>
</template>
</q-input> </q-input>
</div> </div>
<div v-else-if="col.fieldtype === costanti.FieldType.number"> <div v-else-if="col.fieldtype === costanti.FieldType.number">
@@ -1360,7 +1376,7 @@
? $t(col.label_trans) ? $t(col.label_trans)
: '' : ''
" "
:class="{'cursor-pointer': canEdit}" :class="{ 'cursor-pointer': canEdit }"
v-model:value="myvalue" v-model:value="myvalue"
:readonly="false" :readonly="false"
:minuteinterval="minuteinterval" :minuteinterval="minuteinterval"
@@ -1374,7 +1390,7 @@
<div v-else-if="col.fieldtype === costanti.FieldType.onlydate"> <div v-else-if="col.fieldtype === costanti.FieldType.onlydate">
<CDateTime <CDateTime
:label="col.label ? col.label : $t(col.label_trans)" :label="col.label ? col.label : $t(col.label_trans)"
:class="{'cursor-pointer': canEdit}" :class="{ 'cursor-pointer': canEdit }"
:valueDate="myvalue" :valueDate="myvalue"
v-model:value="myvalue" v-model:value="myvalue"
:readonly="false" :readonly="false"

View File

@@ -8471,6 +8471,15 @@ export const tools = {
return circ ? circ.name : '' return circ ? circ.name : ''
}, },
rimuoviAtPrimoCarattere(stringa: string) {
if (stringa.charAt(0) === '@') {
return stringa.slice(1);
} else {
return stringa;
}
},
// FINE ! // FINE !
// getLocale() { // getLocale() {

View File

@@ -54,6 +54,7 @@
mykey="profile" mykey="profile"
mysubkey="username_telegram" mysubkey="username_telegram"
:type="costanti.FieldType.string" :type="costanti.FieldType.string"
:notAllowAtChar="true"
> >
</CMyFieldDb> </CMyFieldDb>
</div> </div>