Campo Citta di Nascita (nel profilo nuova maniera), manca ancora da sistemare l'edit
Se seleziono la Provincia , mi deve comparire la lista dei comuni
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { defineComponent, onMounted, onBeforeMount, PropType, ref, toRef, watch } from 'vue'
|
||||
import { defineComponent, onMounted, onBeforeMount, PropType, ref, toRef, watch, computed } from 'vue'
|
||||
import { useI18n } from '@src/boot/i18n'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
@@ -38,6 +38,11 @@ export default defineComponent({
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
rec: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
isrec: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
@@ -186,15 +191,20 @@ export default defineComponent({
|
||||
|
||||
const col = ref(<IColGridTable> { name: 'test', fieldtype: 0, showWhen: costanti.showWhen.NewRec + costanti.showWhen.InEdit + costanti.showWhen.InView, visible: true, maxlength: props.mycol ? props.mycol.maxlength : 0 })
|
||||
|
||||
const myrow = toRef(props, 'row')
|
||||
|
||||
const { setValDb, getValDb } = MixinBase()
|
||||
const { getMyUsername } = MixinUsers()
|
||||
|
||||
const myrealrow = toRef(props, 'row')
|
||||
|
||||
watch(() => props.row, (newval, oldval) => {
|
||||
refresh()
|
||||
})
|
||||
|
||||
|
||||
const myrow = computed(() => {
|
||||
return props.rec && props.isrec ? props.rec : props.row
|
||||
})
|
||||
|
||||
function crea() {
|
||||
// console.log('crea', isFieldDb())
|
||||
|
||||
@@ -321,12 +331,13 @@ export default defineComponent({
|
||||
function mounted() {
|
||||
|
||||
try {
|
||||
|
||||
// console.log('mounted', 'isFieldDb()', isFieldDb())
|
||||
if (isFieldDb() && !props.isrec) {
|
||||
|
||||
} else {
|
||||
if (props.subfield !== '') {
|
||||
if (props.row[props.field] === undefined) {
|
||||
if (myrow.value[props.field] === undefined) {
|
||||
myrow.value[props.field] = {}
|
||||
myvalue.value = ''
|
||||
} else {
|
||||
@@ -408,8 +419,13 @@ export default defineComponent({
|
||||
} else {
|
||||
if (props.field !== '')
|
||||
myrow.value[props.field] = newVal
|
||||
else
|
||||
myrow.value = newVal
|
||||
else {
|
||||
if (!props.isrec) {
|
||||
// @ts-ignore
|
||||
myrealrow.value = newVal
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
emit('save', newVal, valinitial)
|
||||
|
||||
Reference in New Issue
Block a user