++ aggiunta la prenotazione negli eventi. con la lista degli utenti.

This commit is contained in:
Surya Paolo
2023-04-17 00:11:45 +02:00
parent 6f1f962c0a
commit 3cf4562285
38 changed files with 2016 additions and 1278 deletions

View File

@@ -283,7 +283,12 @@ export default defineComponent({
type: String,
required: false,
default: 'elementi trovati',
}
},
groupname: {
type: String,
required: false,
default: '',
},
},
components: {
CMyPopupEdit, CTitleBanner, CMyFieldDb, CMySelect, CMyFriends, CMyGroups,
@@ -350,7 +355,7 @@ export default defineComponent({
const separator = 'horizontal'
const myfilter = ref('')
const myfilterand: any = ref([])
let rowsel: any = {}
const rowsel: any = ref({})
const dark = true
const canEdit = ref(false)
@@ -1274,7 +1279,7 @@ export default defineComponent({
console.log('newRecord', newRecord)
}
}
rowsel = item
rowsel.value = item
idsel = item._id
colsel.value = col
}
@@ -1284,11 +1289,11 @@ export default defineComponent({
// console.table(serverData)
if (colsel.value) {
if (colsel.value.subfield !== '') {
if (rowsel[colsel.value.field!] === undefined)
rowsel[colsel.value.field!] = {}
rowsel[colsel.value.field!][colsel.value.subfield!] = valPrec
if (rowsel.value[colsel.value.field!] === undefined)
rowsel.value[colsel.value.field!] = {}
rowsel.value[colsel.value.field!][colsel.value.subfield!] = valPrec
} else {
rowsel[colsel.value.field!] = valPrec
rowsel.value[colsel.value.field!] = valPrec
}
}
@@ -1308,8 +1313,8 @@ export default defineComponent({
function showandsel(row: any, col: any, newval: any, valinitial: any) {
// console.log('showandsel CGridTable', row, col, newval)
rowsel = row
console.log('showandsel CGridTable', row, col, newval)
rowsel.value = row
colsel.value = col
idsel = row._id
SaveValue(newval, valinitial)
@@ -1335,7 +1340,7 @@ export default defineComponent({
}
function SaveValue(newVal: any, valinitial: any) {
// console.log('SaveValue', newVal)
console.log('SaveValue', newVal)
// console.log('rowsel', rowsel, 'colsel', colsel.value)
let myfield = ''
let subf = ''
@@ -1344,15 +1349,19 @@ export default defineComponent({
subf = colsel.value.subfield!
}
let myrec = rowsel.value
if (newRecordBool.value)
myrec = newRecord.value
if (myfield) {
if (colsel.value) {
// Update value in table memory
if (subf !== '') {
if (rowsel[myfield] === undefined)
rowsel[myfield] = {}
rowsel[myfield][subf] = newVal
if (myrec[myfield] === undefined)
myrec[myfield] = {}
myrec[myfield][subf] = newVal
} else {
rowsel[myfield] = newVal
myrec[myfield] = newVal
}
}
@@ -1374,13 +1383,8 @@ export default defineComponent({
}
}
// if (colsel.value)
// console.log(' -> rowsel[myfield]', rowsel[myfield])
valPrec = valinitial
// console.log('rowsel FINALE', rowsel)
saveFieldValue(mydata)
}
}
@@ -1431,7 +1435,9 @@ export default defineComponent({
// @ts-ignore
if (props.defaultnewrec) {
// @ts-ignore
newRecord.value = props.defaultnewrec()
newRecord.value = props.defaultnewrec
} else {
newRecord.value = tools.getdefaultnewrec(mytable.value, {groupname: props.groupname})
}
if (!newRecord.value) {
newRecord.value = {}
@@ -2089,6 +2095,14 @@ export default defineComponent({
function cmdExt(cmd: any, id: any, val2: any) {
console.log('cmd', cmd)
if (cmd === costanti.CMD_CLONE) {
const myarr = serverData.value.find((rec: any) => rec._id === id)
newRecord.value = myarr
newRecord.value._id = 0
newRecordBool.value = true
return true;
}
if (cmd === costanti.CMD_SHOW_PAGE) {
visupagedialog.value = true
myrecdialog.value = id
@@ -2103,6 +2117,8 @@ export default defineComponent({
action = lists.MenuAction.DELETE_RECTABLE
} else if (cmd === costanti.CMD_MODIFY) {
action = lists.MenuAction.CAN_EDIT_TABLE
} else if (cmd === costanti.CMD_DUPLICATE) {
action = lists.MenuAction.DUPLICATE_RECTABLE
}
@@ -2314,6 +2330,7 @@ export default defineComponent({
ordinam,
ordinam_desc,
getNumFilterSelected,
rowsel,
}
}
})