ver 0.5.73:
- corretto invia monete da Conto Collettivo a Utente - Aggiunto Provincia (tutorial).. in corso...
This commit is contained in:
124
src/components/CMySelectCity/CMySelectCity.ts
Executable file
124
src/components/CMySelectCity/CMySelectCity.ts
Executable file
@@ -0,0 +1,124 @@
|
||||
import { computed, defineComponent, onMounted, PropType, ref, toRef, watch } from 'vue'
|
||||
import { useI18n } from '@src/boot/i18n'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { CMySelect } from '@/components/CMySelect'
|
||||
|
||||
import { costanti } from '@costanti'
|
||||
import { fieldsTable } from '@store/Modules/fieldsTable'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import MixinBase from '@/mixins/mixin-base'
|
||||
import { ISpecialField } from '@src/model'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMySelectCity',
|
||||
emits: ['update:modelValue'],
|
||||
props: {
|
||||
modelValue: [String, Number, Object],
|
||||
label: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: undefined,
|
||||
},
|
||||
table: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: ''
|
||||
},
|
||||
myclass: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: ''
|
||||
},
|
||||
jointable: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: ''
|
||||
},
|
||||
db_field: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
db_type: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 0,
|
||||
},
|
||||
db_subfield: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
db_subsubfield: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
db_specialField: {
|
||||
type: Object as PropType<ISpecialField>,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
db_id: {
|
||||
type: [String, Number],
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
db_rec: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
components: { CMySelect },
|
||||
setup(props, { emit }) {
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
const userStore = useUserStore()
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
const optFiltered = ref(<any>[])
|
||||
const valori = ref(<any>[])
|
||||
|
||||
const { setValDb, getValDb } = MixinBase()
|
||||
|
||||
const myvalue = ref(<string | number | object | undefined>'')
|
||||
|
||||
watch(() => myvalue.value, (value: any, oldval: any) => {
|
||||
update()
|
||||
},
|
||||
)
|
||||
|
||||
function mounted() {
|
||||
myvalue.value = props.modelValue
|
||||
update()
|
||||
}
|
||||
|
||||
function update() {
|
||||
//
|
||||
emit('update:modelValue', myvalue.value)
|
||||
}
|
||||
|
||||
function changevalRec(newval: any) {
|
||||
if (props.db_type > 0)
|
||||
setValDb($q, props.db_field, newval, props.db_type, false, props.table, props.db_subfield, props.db_id, 0, props.db_subsubfield, props.db_specialField)
|
||||
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
tools,
|
||||
costanti,
|
||||
globalStore,
|
||||
shared_consts,
|
||||
fieldsTable,
|
||||
myvalue,
|
||||
changevalRec,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user