From 8da93f3f4ae354a0e64e522ea9fc921055f32205 Mon Sep 17 00:00:00 2001 From: Surya Paolo Date: Wed, 28 Feb 2024 17:04:34 +0100 Subject: [PATCH] -Quando insersci l'username telegram sul Profilo, devo togliergli la chiocciola ! - anche nella ricerca User --- src/components/CMyFieldDb/CMyFieldDb.ts | 12 ++++- src/components/CMyFieldDb/CMyFieldDb.vue | 1 + src/components/CMyPopupEdit/CMyPopupEdit.ts | 19 +++++++- src/components/CMyPopupEdit/CMyPopupEdit.vue | 50 +++++++++++++------- src/store/Modules/tools.ts | 9 ++++ src/views/user/editprofile/editprofile.vue | 1 + 6 files changed, 72 insertions(+), 20 deletions(-) diff --git a/src/components/CMyFieldDb/CMyFieldDb.ts b/src/components/CMyFieldDb/CMyFieldDb.ts index 31212f9d..d87f25e5 100755 --- a/src/components/CMyFieldDb/CMyFieldDb.ts +++ b/src/components/CMyFieldDb/CMyFieldDb.ts @@ -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() { diff --git a/src/components/CMyFieldDb/CMyFieldDb.vue b/src/components/CMyFieldDb/CMyFieldDb.vue index 7c69834b..9905cc41 100755 --- a/src/components/CMyFieldDb/CMyFieldDb.vue +++ b/src/components/CMyFieldDb/CMyFieldDb.vue @@ -53,6 +53,7 @@ minuteinterval="1" @showandsave="showandsel" @save="save" + :notAllowAtChar="notAllowAtChar" > diff --git a/src/components/CMyPopupEdit/CMyPopupEdit.ts b/src/components/CMyPopupEdit/CMyPopupEdit.ts index b6e311dd..404f45f0 100755 --- a/src/components/CMyPopupEdit/CMyPopupEdit.ts +++ b/src/components/CMyPopupEdit/CMyPopupEdit.ts @@ -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) diff --git a/src/components/CMyPopupEdit/CMyPopupEdit.vue b/src/components/CMyPopupEdit/CMyPopupEdit.vue index d10fe746..6a1a9368 100755 --- a/src/components/CMyPopupEdit/CMyPopupEdit.vue +++ b/src/components/CMyPopupEdit/CMyPopupEdit.vue @@ -147,7 +147,7 @@ color="green" >online - + -
+
- Diventerà: {{tools.generateURL(col.showLinkResult, myvalue)}} - + Diventerà: + {{ tools.generateURL(col.showLinkResult, myvalue) }} -
- + + @ + +
(Scegli)
-
+
- + {{ $t(col.label_trans) }} {{ $t('event.testo_di_spiegazione') }}: @@ -1067,7 +1079,8 @@ col.fieldtype === costanti.FieldType.string || col.fieldtype === costanti.FieldType.crypted " - > + > + +
@@ -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 @@