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

View File

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

View File

@@ -208,6 +208,11 @@ export default defineComponent({
required: false,
default: false,
},
notAllowAtChar: {
type: Boolean,
required: false,
default: false,
},
path: {
type: String,
required: false,
@@ -377,10 +382,10 @@ export default defineComponent({
}
function changevalRec(newval: any) {
// console.log('changevalRec', newval)
console.log('changevalRec', newval)
// if (!props.insertMode || (props.insertMode && col.value.fieldtype !== costanti.FieldType.multioption)) {
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)
@@ -390,6 +395,10 @@ export default defineComponent({
// console.log('image', newval)
}
if (props.notAllowAtChar) {
newval = tools.rimuoviAtPrimoCarattere(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()) {
savefield(newVal, valinitial, $q)

View File

@@ -205,7 +205,10 @@
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
v-bind="$attrs"
v-model="myvalue"
@@ -228,10 +231,13 @@
>
</q-input>
<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>
</div>
<div
v-else-if="col.tipovisu === costanti.TipoVisu.TESTO_BORDATO"
@@ -284,11 +290,13 @@
:label="myvalue"
>
</q-btn>
<span
v-else
:class="{ disabled: disable }"
v-html="visuValByType(myvalue, col, row)"
></span>
<span v-else>
<span v-if="notAllowAtChar" class="text-h7">@</span>
<span
:class="{ disabled: disable }"
v-html="visuValByType(myvalue, col, row)"
></span>
</span>
</div>
</div>
<div
@@ -573,7 +581,7 @@
? $t(col.label_trans)
: ''
"
:class="{'cursor-pointer': canEdit}"
:class="{ 'cursor-pointer': canEdit }"
v-model:value="myvalue"
:readonly="false"
:minuteinterval="minuteinterval"
@@ -596,7 +604,7 @@
<div v-else-if="col.fieldtype === costanti.FieldType.onlydate">
<CDateTime
:label="col.label ? col.label : $t(col.label_trans)"
:class="{'cursor-pointer': canEdit}"
:class="{ 'cursor-pointer': canEdit }"
:valueDate="myvalue"
v-model:value="myvalue"
:readonly="false"
@@ -926,7 +934,11 @@
</div>
<div v-else-if="col.fieldtype === costanti.FieldType.html">
<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-else> {{ $t('event.testo_di_spiegazione') }}: </span>
<q-space />
@@ -1068,6 +1080,7 @@
col.fieldtype === costanti.FieldType.crypted
"
>
<q-input
v-bind="$attrs"
counter
@@ -1084,6 +1097,9 @@
@keyup.enter.stop
autofocus
>
<template v-if="notAllowAtChar" v-slot:prepend>
<span class="text-h7 text-blue">@</span>
</template>
</q-input>
</div>
<div v-else-if="col.fieldtype === costanti.FieldType.number">
@@ -1360,7 +1376,7 @@
? $t(col.label_trans)
: ''
"
:class="{'cursor-pointer': canEdit}"
:class="{ 'cursor-pointer': canEdit }"
v-model:value="myvalue"
:readonly="false"
:minuteinterval="minuteinterval"
@@ -1374,7 +1390,7 @@
<div v-else-if="col.fieldtype === costanti.FieldType.onlydate">
<CDateTime
:label="col.label ? col.label : $t(col.label_trans)"
:class="{'cursor-pointer': canEdit}"
:class="{ 'cursor-pointer': canEdit }"
:valueDate="myvalue"
v-model:value="myvalue"
:readonly="false"

View File

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

View File

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