- Creazione "AbitareGliIblei"
- Mappa Interattiva con i markers
This commit is contained in:
@@ -11,6 +11,7 @@ import { CLabel } from '../CLabel'
|
||||
import { CMyToggleList } from '../CMyToggleList'
|
||||
import { CMySelect } from '../CMySelect'
|
||||
import { CCurrencyValue } from '../CCurrencyValue'
|
||||
import { CMapEditAddressByCoord } from '../CMapEditAddressByCoord'
|
||||
import { CMyEditor } from '../CMyEditor'
|
||||
import { CGallery } from '../CGallery'
|
||||
import { CSelectImage } from '../CSelectImage'
|
||||
@@ -221,7 +222,7 @@ export default defineComponent({
|
||||
},
|
||||
components: {
|
||||
CMyChipList, CDateTime, CDate, CMyToggleList, CMySelect, CMyEditor, CGallery,
|
||||
CCurrencyValue, CLabel, CAccomodation, CSelectImage
|
||||
CCurrencyValue, CLabel, CAccomodation, CSelectImage, CMapEditAddressByCoord,
|
||||
},
|
||||
setup(props, { emit }) {
|
||||
const $q = useQuasar()
|
||||
@@ -240,6 +241,8 @@ export default defineComponent({
|
||||
|
||||
const $router = useRouter()
|
||||
|
||||
const loaded = ref(false)
|
||||
|
||||
const col = ref(<IColGridTable>{
|
||||
name: 'test',
|
||||
fieldtype: 0,
|
||||
@@ -389,7 +392,23 @@ export default defineComponent({
|
||||
return null
|
||||
}
|
||||
|
||||
function changeValRecCoordAddr(newval: any) {
|
||||
// console.log('changeValRecCoordAddr', newval, 'myrow', myrow.value[col.value.name])
|
||||
if (!myrow.value[col.value.name]) {
|
||||
myrow.value[col.value.name] = {}
|
||||
}
|
||||
if (newval.coordinates && newval.coordinates.lat) {
|
||||
newval.coordinates.lat = tools.convertToDecimal6(newval.coordinates.lat)
|
||||
newval.coordinates.lng = tools.convertToDecimal6(newval.coordinates.lng)
|
||||
}
|
||||
// console.log('newval...', newval)
|
||||
return changevalRecOrig(newval)
|
||||
}
|
||||
function changevalRec(newval: any) {
|
||||
return changevalRecOrig(newval, '')
|
||||
}
|
||||
|
||||
function changevalRecOrig(newval: any, subcol: string = '') {
|
||||
// console.log('changevalRec', newval)
|
||||
// if (!props.insertMode || (props.insertMode && col.value.fieldtype !== costanti.FieldType.multioption)) {
|
||||
if (col.value && col.value.allowchar === costanti.ALLOWCHAR_CODE) {
|
||||
@@ -407,7 +426,15 @@ export default defineComponent({
|
||||
newval = tools.rimuoviAtPrimoCarattere(newval)
|
||||
}
|
||||
|
||||
myrow.value[col.value.name] = newval
|
||||
if (subcol) {
|
||||
if (!myrow.value[col.value.name]) {
|
||||
myrow.value[col.value.name] = {}
|
||||
}
|
||||
myrow.value[col.value.name][subcol] = newval
|
||||
// console.log('myrow.value[col.value.name]', myrow.value[col.value.name])
|
||||
} else {
|
||||
myrow.value[col.value.name] = newval
|
||||
}
|
||||
|
||||
|
||||
// console.log('changevalRec update:row', myrow.value)
|
||||
@@ -434,6 +461,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function mounted() {
|
||||
console.log('mounted')
|
||||
|
||||
myrow.value = props.rec && props.isrec ? { ...props.rec } : { ...props.row }
|
||||
|
||||
@@ -466,30 +494,50 @@ export default defineComponent({
|
||||
|
||||
// console.log('popupedit: myvalue.value', myvalue.value)
|
||||
|
||||
if (col.value.fieldtype === costanti.FieldType.listimages) {
|
||||
if (myvalue.value === '' || myvalue.value === undefined) {
|
||||
// console.log('set default myvalue.value ')
|
||||
myvalue.value = {
|
||||
title: 'Galleria',
|
||||
directory: 'none',
|
||||
list: []
|
||||
}
|
||||
}
|
||||
} else if (col.value.fieldtype === costanti.FieldType.listobj) {
|
||||
if (myvalue.value === '' || myvalue.value === undefined) {
|
||||
// console.log('set default myvalue.value ')
|
||||
myvalue.value = [{
|
||||
type: 0, // Letto matrimoniale / letto singolo / divano-letto / almaca / a terra sul tappeto (per sacco a pelo)
|
||||
location: 0, // in camera privata / in camera condivisa / in soggiorno / in camper / in tenda / in giardino / all'aperto
|
||||
num: 0,
|
||||
}]
|
||||
}
|
||||
}
|
||||
// console.log('myvalue.value', myvalue.value)
|
||||
myvalueprec.value = myvalue.value
|
||||
|
||||
crea()
|
||||
|
||||
if (!loaded.value) {
|
||||
|
||||
if (col.value.fieldtype === costanti.FieldType.listimages) {
|
||||
if (myvalue.value === '' || myvalue.value === undefined) {
|
||||
// console.log('set default myvalue.value ')
|
||||
myvalue.value = {
|
||||
title: 'Galleria',
|
||||
directory: 'none',
|
||||
list: []
|
||||
}
|
||||
}
|
||||
} else if (col.value.fieldtype === costanti.FieldType.listobj) {
|
||||
if (myvalue.value === '' || myvalue.value === undefined) {
|
||||
// console.log('set default myvalue.value ')
|
||||
myvalue.value = [{
|
||||
type: 0, // Letto matrimoniale / letto singolo / divano-letto / almaca / a terra sul tappeto (per sacco a pelo)
|
||||
location: 0, // in camera privata / in camera condivisa / in soggiorno / in camper / in tenda / in giardino / all'aperto
|
||||
num: 0,
|
||||
}]
|
||||
}
|
||||
} else if (col.value.fieldtype === costanti.FieldType.coordinates) {
|
||||
if (myvalue.value === '' || myvalue.value === undefined) {
|
||||
// console.log('set default myvalue.value ')
|
||||
myvalue.value = {
|
||||
address: '',
|
||||
coordinates: [0, 0]
|
||||
}
|
||||
}
|
||||
if (!myvalue.value.address) {
|
||||
myvalue.value.address = ''
|
||||
}
|
||||
if (!myvalue.value.coordinates) {
|
||||
myvalue.value.coordinates = [0, 0]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
loaded.value = true
|
||||
|
||||
// console.log('myvalueprec', myvalueprec)
|
||||
}
|
||||
|
||||
@@ -868,6 +916,7 @@ export default defineComponent({
|
||||
nameKeydown,
|
||||
gotoPage,
|
||||
mypath,
|
||||
changeValRecCoordAddr,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user