ver 0.5.73:
- corretto invia monete da Conto Collettivo a Utente - Aggiunto Provincia (tutorial).. in corso...
This commit is contained in:
9
src/components/CMySelectCity/CMySelectCity.scss
Executable file
9
src/components/CMySelectCity/CMySelectCity.scss
Executable file
@@ -0,0 +1,9 @@
|
||||
.myflex{
|
||||
display: flex;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.hint{
|
||||
color: gray;
|
||||
font-style: italic;
|
||||
}
|
||||
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,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
32
src/components/CMySelectCity/CMySelectCity.vue
Executable file
32
src/components/CMySelectCity/CMySelectCity.vue
Executable file
@@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<div>
|
||||
<CMySelect
|
||||
:type_out="costanti.FieldType.object"
|
||||
:label="label"
|
||||
v-model="myvalue"
|
||||
:pickup="false"
|
||||
:addnone="true"
|
||||
:tablesel="table"
|
||||
:myclass="myclass"
|
||||
:optval="fieldsTable.getKeyByTable(jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(jointable)"
|
||||
:options="
|
||||
globalStore.getTableJoinByName(
|
||||
jointable,
|
||||
false,
|
||||
false,
|
||||
''
|
||||
)"
|
||||
:useinput="false"
|
||||
@update:value="changevalRec"
|
||||
>
|
||||
</CMySelect>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CMySelectCity.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CMySelectCity.scss';
|
||||
</style>
|
||||
1
src/components/CMySelectCity/index.ts
Executable file
1
src/components/CMySelectCity/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export {default as CMySelectCity} from './CMySelectCity.vue'
|
||||
Reference in New Issue
Block a user