From 1a57d5a2e38ec1598aac54b2dfd58cc7c048c409 Mon Sep 17 00:00:00 2001 From: Surya Paolo Date: Wed, 7 Jun 2023 17:25:14 +0200 Subject: [PATCH] Quando si inserisce un evento, su giunge alla fine, si salva, NON SI MEMORIZZANO foto, data e orario! --- src/components/CDateTime/CDateTime.ts | 18 +++ src/components/CDateTime/CDateTime.vue | 105 +++++++++++++++--- src/components/CGridTableRec/CGridTableRec.ts | 22 +++- .../CGridTableRec/CGridTableRec.vue | 5 + .../CMyCardService/CMyCardService.vue | 22 ++++ src/components/CMyPopupEdit/CMyPopupEdit.ts | 47 ++++---- src/statics/lang/it.js | 1 + src/store/Modules/fieldsTable.ts | 3 +- src/store/globalStore.ts | 15 +++ src/views/user/myprofile/myprofile.ts | 7 +- src/views/user/myprofile/myprofile.vue | 51 ++++++--- 11 files changed, 239 insertions(+), 57 deletions(-) diff --git a/src/components/CDateTime/CDateTime.ts b/src/components/CDateTime/CDateTime.ts index 6f2b945f..c6371de8 100755 --- a/src/components/CDateTime/CDateTime.ts +++ b/src/components/CDateTime/CDateTime.ts @@ -68,6 +68,8 @@ export default defineComponent({ const showDateTimeScroller = ref(false) const saveit = ref(false) const myvalue = ref('') + const mydate = ref(false) + const mytime = ref(false) const valueprec = ref('') // const myvalueDate = toRef(props, 'valueDate') @@ -88,6 +90,8 @@ export default defineComponent({ } function Closing() { + mydate.value = false + mytime.value = false // console.log('Closing') if (!saveit.value) { if (myvalue.value !== valueprec.value) { @@ -143,6 +147,16 @@ export default defineComponent({ emit('savetoclose', myvalue.value, valueprec.value) } + function replacevalue() { + // console.log('changeval', newval, 'value=', value, 'myvalue=', myvalue) + if (valueprec.value) { + emit('update:value', valueprec.value) + saveit.value = true + showDateTimeScroller.value = false + emit('savetoclose', valueprec.value, valueprec.value) + } + } + function mystyle() { if (props.label !== '') return '' @@ -172,6 +186,10 @@ export default defineComponent({ getclass, myvalue, showDateTimeScroller, + replacevalue, + mydate, + mytime, + tools, } }, }) diff --git a/src/components/CDateTime/CDateTime.vue b/src/components/CDateTime/CDateTime.vue index 782a3909..22c18d4b 100755 --- a/src/components/CDateTime/CDateTime.vue +++ b/src/components/CDateTime/CDateTime.vue @@ -27,33 +27,106 @@ color="blue-6" :bg-color="bgcolor" debounce="500" - :input-class="getclass()"> - + :input-class="getclass()" + > diff --git a/src/components/CGridTableRec/CGridTableRec.ts b/src/components/CGridTableRec/CGridTableRec.ts index 66af3fcc..444ad6a4 100755 --- a/src/components/CGridTableRec/CGridTableRec.ts +++ b/src/components/CGridTableRec/CGridTableRec.ts @@ -1447,7 +1447,7 @@ export default defineComponent({ // @ts-ignore newRecord.value = props.defaultnewrec } else { - newRecord.value = tools.getdefaultnewrec(mytable.value, {groupname: props.groupname}) + newRecord.value = tools.getdefaultnewrec(mytable.value, { groupname: props.groupname }) } if (!newRecord.value) { newRecord.value = {} @@ -1862,9 +1862,11 @@ export default defineComponent({ const showmsg = true - let myrec = recModif.value + let myrec = null if (newrec) { - myrec = newRecord.value + myrec = { ...newRecord.value } + } else { + myrec = { ...recModif.value } } // mycolumns.value.forEach((col: IColGridTable) => { @@ -2237,6 +2239,19 @@ export default defineComponent({ } } + function update_col(col: string, value: string) { + console.log('update_col', col, value) + + if (col) { + if (newRecordBool.value) { + newRecord.value[col] = value + } else { + recModif.value[col] = value + } + + } + } + /*function showNotification() { $router.push('/notifs') } */ @@ -2344,6 +2359,7 @@ export default defineComponent({ rowsel, showInnerDialog, lengthopt, + update_col, } } }) diff --git a/src/components/CGridTableRec/CGridTableRec.vue b/src/components/CGridTableRec/CGridTableRec.vue index 16f3f40d..b086f7a0 100755 --- a/src/components/CGridTableRec/CGridTableRec.vue +++ b/src/components/CGridTableRec/CGridTableRec.vue @@ -550,6 +550,7 @@ @save="SaveValue" @show="selItem(row, col)" @showandsave="showandsel" + > @@ -1194,6 +1195,7 @@ @show="selItem(rowclicksel, mycol)" @showandsave="showandsel" @annulla="annulla" + @update_col="update_col" > @@ -1214,6 +1216,7 @@ + newRecord: {{newRecord}}
@@ -1390,6 +1394,7 @@ @save="SaveValue" @show="selItem(recModif, col, true)" @showandsave="showandsel" + @update_col="update_col" > diff --git a/src/components/CMyCardService/CMyCardService.vue b/src/components/CMyCardService/CMyCardService.vue index 876bf110..c518583a 100644 --- a/src/components/CMyCardService/CMyCardService.vue +++ b/src/components/CMyCardService/CMyCardService.vue @@ -277,6 +277,28 @@ }} + + + + + + + + + + {{ globalStore.getStatusSkillById(recstatus) }} + + + + + diff --git a/src/components/CMyPopupEdit/CMyPopupEdit.ts b/src/components/CMyPopupEdit/CMyPopupEdit.ts index 70fc9f0f..2c62632f 100755 --- a/src/components/CMyPopupEdit/CMyPopupEdit.ts +++ b/src/components/CMyPopupEdit/CMyPopupEdit.ts @@ -33,7 +33,7 @@ import { useRouter } from 'vue-router' export default defineComponent({ name: 'CMyPopupEdit', - emits: ['showandsave', 'update:row', 'show', 'save', 'annulla'], + emits: ['showandsave', 'update:row', 'show', 'save', 'annulla', 'update_col'], props: { title: { type: String, @@ -337,8 +337,6 @@ export default defineComponent({ } if (props.isInModif) OpenEdit() - - } function getrealval(newval: any) { @@ -369,25 +367,30 @@ export default defineComponent({ } function changevalRec(newval: any) { - 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) - } - // console.log('popuppedit: changevalRec', newval, 'COLName', col.value.name) - - // console.log('row', props.row, 'col', props.mycol, 'newval', newval) - // console.log('row[col.value.name]', props.row[col.value.name]) - if (props.type === costanti.FieldType.image) { - // console.log('image', newval) - } - - myrow.value[col.value.name] = newval - - // console.log('changevalRec update:row', myrow.value) - emit('update:row', myrow.value) - if (props.isInModif) - OpenEdit() + // 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) } + // console.log('popuppedit: changevalRec', newval, 'COLName', col.value.name) + + // console.log('row', props.row, 'col', props.mycol, 'newval', newval) + // console.log('row[col.value.name]', props.row[col.value.name]) + if (props.type === costanti.FieldType.image) { + // console.log('image', newval) + } + + myrow.value[col.value.name] = newval + + + // console.log('changevalRec update:row', myrow.value) + // emit('update:row', myrow.value) + emit('update_col', col.value.name, newval) + if (props.isInModif) + OpenEdit() + + + // } } function changevalRecHours(newval: any) { @@ -501,7 +504,7 @@ export default defineComponent({ function SaveValueInt(newVal: any, valinitial: any) { - //console.log('SaveValueInt', newVal, valinitial) + console.log('SaveValueInt', newVal, valinitial) if (props.tablesel) { if (true) { diff --git a/src/statics/lang/it.js b/src/statics/lang/it.js index 6ba62231..3350fc01 100755 --- a/src/statics/lang/it.js +++ b/src/statics/lang/it.js @@ -1139,6 +1139,7 @@ const msg_it = { cancel_ask: 'Annulla la richiesta', refuse_ask: 'Rifiuta la richiesta', profile: 'Apri Profilo', + edit_profile: 'Modifica Profilo', cancel_ask_short: 'Annulla richiesta', refuse_ask_short: 'Rifiuta la richiesta', member: 'membro', diff --git a/src/store/Modules/fieldsTable.ts b/src/store/Modules/fieldsTable.ts index c2e55d64..0135c81a 100755 --- a/src/store/Modules/fieldsTable.ts +++ b/src/store/Modules/fieldsTable.ts @@ -1385,13 +1385,14 @@ export const colmyBachecas = [ AddCol({ name: 'idStatusSkill', label_trans: 'statusSkill.name', - fieldtype: costanti.FieldType.multiselect, + fieldtype: costanti.FieldType.multioption, jointable: 'statusSkills', showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist, noshowlabel: true, icon: 'mood', isadvanced_field: true, sortable: false, + typeobj: 'checkbox', }), AddCol({ name: 'descr', diff --git a/src/store/globalStore.ts b/src/store/globalStore.ts index b90a1e4c..086143c5 100644 --- a/src/store/globalStore.ts +++ b/src/store/globalStore.ts @@ -10,6 +10,7 @@ import { IParamsQuery, ISettings, ISites, + IStatusSkill, StateConnection, } from '@model' import { static_data } from '@src/db/static_data' @@ -198,6 +199,7 @@ export const useGlobalStore = defineStore('GlobalStore', { testpao1_getter_contatore: (state: IGlobalState) => (param1: number) => state.testp1.contatore + 100 + param1, testpao1_getter_array: (state: IGlobalState) => (param1: number) => state.testp1.mioarray.filter((item) => item).map((item) => item.valore), + getConfigbyId: (state: IGlobalState) => (id: string) => state.arrConfig.find((item) => item._id === id), getConfigStringbyId: (state: IGlobalState) => (params: any) => { const config = state.arrConfig.find((item) => item._id === params.id) @@ -207,6 +209,19 @@ export const useGlobalStore = defineStore('GlobalStore', { return params.default } }, + + getColByStatusSkills: (state: IGlobalState) => (id: number) => { + const ctrec = state.statusSkills.find((mystatus: IStatusSkill) => mystatus._id === id) + return (ctrec && ctrec.color) ? ctrec.color : 'green' + + }, + + getStatusSkillById: (state: IGlobalState) => (id: number) => { + const ctrec = state.statusSkills.find((mystatus: IStatusSkill) => mystatus._id === id) + return (ctrec) ? ctrec.descr : '' + + }, + isNewVersionAvailable: (state: IGlobalState) => { // console.log('cfgServer', cfgServer) const serversrec = state.cfgServer.find((x) => (x.chiave === toolsext.SERVKEY_VERS) && (x.idapp === process.env.APP_ID)) diff --git a/src/views/user/myprofile/myprofile.ts b/src/views/user/myprofile/myprofile.ts index 0014e973..a7c45c45 100755 --- a/src/views/user/myprofile/myprofile.ts +++ b/src/views/user/myprofile/myprofile.ts @@ -58,7 +58,7 @@ export default defineComponent({ const idnotif = computed(() => $route.query.idnotif ? $route.query.idnotif.toString() : '') const isDebugOn = computed(() => tools.isDebugOn()) - + const $router = useRouter() const filtroutente = ref([]) const showPic = ref(false) const caricato = ref(false) @@ -170,6 +170,10 @@ export default defineComponent({ onMounted(mounted) + function gotoPage(link: string) { + $router.push(link) + } + return { username, profile, @@ -205,6 +209,7 @@ export default defineComponent({ handshake_inCommon, globalStore, getLinkWebSite, + gotoPage, } } }) diff --git a/src/views/user/myprofile/myprofile.vue b/src/views/user/myprofile/myprofile.vue index f41ae88c..f639b97d 100755 --- a/src/views/user/myprofile/myprofile.vue +++ b/src/views/user/myprofile/myprofile.vue @@ -201,6 +201,24 @@
{{ userStore.userprofile.username }}
+ + + + + + + + {{ + $t('shared.edit_profile') + }} + + + +
-
+
- + {{ $t('handshake.remove_from_myhandshake') @@ -616,12 +640,7 @@ />
-
+
- +