- fix QSelect

- permessi none/friends/all
This commit is contained in:
paoloar77
2022-01-28 18:15:46 +01:00
parent 5f51c231eb
commit d7480fd489
32 changed files with 777 additions and 222 deletions

View File

@@ -34,16 +34,15 @@ export default defineComponent({
const searchList = ref(<ISearchList[]>[])
const idSector = computed(() => {
let myval = 0
searchList.value.forEach((rec) => {
console.log(' rec', rec)
if (rec.table === 'sectors') {
console.log('trovato')
myval = rec.value
}
})
console.log('IDSECTOR = ' + myval)
return myval
let myval: any = null
myval = searchList.value.find((rec) => (rec.table === 'sectors'))
if (myval) {
const ris = myval.value || 0
// console.log('idSector=', ris)
return ris
} else {
return 0
}
})
function mounted() {
@@ -109,7 +108,7 @@ export default defineComponent({
addall: true,
filter: getFilterSkills,
showcount: true,
useinput: true,
useinput: false,
},
{
label: 'Specializzazione',
@@ -122,6 +121,7 @@ export default defineComponent({
filter: getFilterSubSkills,
showcount: true,
useinput: false,
icon: 'far fa-id-card',
},
/*{
label: 'Regione',
@@ -143,6 +143,7 @@ export default defineComponent({
arrvalue: tools.getCookie(tools.COOK_SEARCH + 'provinces', [costanti.FILTER_TUTTI]),
filter: null,
useinput: true,
icon: 'flag',
},
{
label: 'Città',
@@ -177,6 +178,7 @@ export default defineComponent({
type: costanti.FieldType.multiselect,
filter: null,
useinput: false,
icon: 'mood',
},
{
label: 'Contributo',
@@ -187,6 +189,8 @@ export default defineComponent({
type: costanti.FieldType.multiselect,
filter: null,
useinput: false,
icon: 'currency_exchange',
//icon: 'swap_horizontal_circle',
},
]

View File

@@ -279,7 +279,17 @@ export default defineComponent({
if (item.table === 'skills') {
// console.log('---PRIMA ', item.value)
const valsaved = tools.getCookie(tools.COOK_SEARCH + 'skills' + '_' + newval, costanti.FILTER_TUTTI)
if (valsaved)
// check if exist
const recSkill = searchList.value.find((rec) => rec.table === 'skills')
let trovato = false
if (recSkill) {
console.log('recSkill.value', recSkill)
const arrvalues = valoriopt.value(recSkill.value, false)
console.log('arrvalues', arrvalues)
if (arrvalues)
trovato = arrvalues.find((rec: any) => rec[recSkill.key] === valsaved)
}
if (valsaved && trovato)
item.value = valsaved
else
item.value = costanti.FILTER_TUTTI
@@ -438,7 +448,7 @@ export default defineComponent({
}
}
console.log('filtersearch', filtersearch)
// console.log('filtersearch', filtersearch)
if (props.prop_search) {
let nosearch = false
@@ -450,7 +460,6 @@ export default defineComponent({
if (props.keyMain) {
nosearch = true
filtersearch.forEach((rec: any) => {
console.log('rec', rec)
if (!!rec[props.keyMain]) {
nosearch = false
}
@@ -464,7 +473,7 @@ export default defineComponent({
}
}
console.log('filtercustom', props.filtercustom)
// console.log('filtercustom', props.filtercustom)
let params: IParamsQuery = {
@@ -843,7 +852,7 @@ export default defineComponent({
function mounted() {
// console.log('GridTable mounted', tablesel.value)
console.log('props.filtercustom', props.filtercustom)
// console.log('props.filtercustom', props.filtercustom)
if (!!props.tablesList) {

View File

@@ -105,6 +105,7 @@
:class="$q.screen.lt.sm ? `` : `row` + ` text-blue `">
<span v-for="(item, index) in searchList" :key="index">
<CMySelect
:col="fieldsTable.getColByTable('myskills', item.key)"
v-if="(item.type === costanti.FieldType.select) || (item.type === costanti.FieldType.select_by_server)"
:label="labelcombo(item)"
v-model:value="item.value"
@@ -115,6 +116,7 @@
label-color="primary"
class="combowidth"
color="primary"
:icon_alternative="item.icon"
:optval="fieldsTable.getKeyByTable(item.table)"
:optlab="fieldsTable.getLabelByTable(item.table)"
:options="valoriopt(item, false)"
@@ -127,6 +129,7 @@
<CMySelect
v-if="item.type === costanti.FieldType.multiselect_by_server"
:col="fieldsTable.getColByTable('myskills', item.key)"
:multiselect_by_server="true"
:label="labelcombo(item)"
v-model:arrvalue="item.arrvalue"
@@ -138,6 +141,7 @@
label-color="primary"
class="combowidth"
color="primary"
:icon_alternative="item.icon"
:optval="fieldsTable.getKeyByTable(item.table)"
:optlab="fieldsTable.getLabelByTable(item.table)"
:options="valoriopt(item, false)"
@@ -164,6 +168,9 @@
:option-value="fieldsTable.getKeyByTable(item.table)"
>
<template v-if="item.icon" v-slot:prepend>
<q-icon :name="item.icon" />
</template>
<template
v-if="item.arrvalue.length >= 1"
v-slot:selected-item="scope">
@@ -389,7 +396,6 @@
class="q-ma-sm q-pa-sm colmodif col-grow rounded-borders " style="border: 1px solid #bbb"
@click="colclicksel = mycol">
mycol : {{mycol}}
<CMyPopupEdit
:table="mytable"
:canEdit="true"

View File

@@ -31,6 +31,11 @@ export default defineComponent({
required: false,
default: -1,
},
maxlength: {
type: Number,
required: false,
default: 0,
},
mysubsubkey: {
type: String,
required: false,
@@ -97,7 +102,7 @@ export default defineComponent({
const { t } = useI18n()
const globalStore = useGlobalStore()
const col = ref(<IColGridTable> { name: 'test' })
const col = ref(<IColGridTable> { name: 'test', fieldtype: 0, showWhen: costanti.showWhen.NewRec + costanti.showWhen.InEdit + costanti.showWhen.InView, visible: true, maxlength: props.maxlength })
const row = ref({})
const { setValDb, getValDb } = MixinBase()

View File

@@ -177,7 +177,7 @@ export default defineComponent({
const myImgGall = ref(<IImgGallery[]>[{}])
const col = ref(<IColGridTable> { name: 'test', fieldtype: 0 })
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')

View File

@@ -1,6 +1,6 @@
<template>
<div :class="getclassCol(col)">
<div v-if="tools.checkIfShowField(col, (isInModif ? tools.TIPOVIS_EDIT_RECORD : 0) + (insertMode ? tools.TIPOVIS_NEW_RECORD : 0), visulabel, myvalue)" style="flex-grow: 1;">
<div v-if="tools.checkIfShowField(col, insertMode ? tools.TIPOVIS_NEW_RECORD : (isInModif ? tools.TIPOVIS_EDIT_RECORD : tools.TIPOVIS_SHOW_RECORD), visulabel, myvalue)" style="flex-grow: 1;">
<div
:class="{ flex: !isInModif, 'justify-center': true }">
<div>
@@ -32,7 +32,6 @@
</div>
<div v-else-if="col.fieldtype === costanti.FieldType.string">
<div v-if="visulabel || isInModif" :class="{ flex: !isInModif}">
<q-input
v-bind="$attrs"
v-model="myvalue"
@@ -196,7 +195,6 @@
</div>
<div v-else-if="col.fieldtype === costanti.FieldType.date">
<CDateTime
v-if="myvalue"
:label="col.label"
class="cursor-pointer"
v-model:value="myvalue"

View File

@@ -115,6 +115,11 @@ export default defineComponent({
withToggle: {
type: Boolean,
default: false,
},
icon_alternative: {
type: String,
required: false,
default: '',
}
},
components: {},
@@ -317,6 +322,9 @@ export default defineComponent({
if (props.col.jointable) {
optionsreal.value = globalStore.getTableJoinByName(props.col.jointable, props.col.addall, props.col.filter)
// console.log('optionsreal.value', optionsreal.value)
} else {
optionsreal.value = props.options
}
myarr = optionsreal.value
@@ -326,7 +334,7 @@ export default defineComponent({
// console.log('needle', needle, 'props.multiple', props.multiple)
if (props.filter_table) {
// console.log(' FILTERTABLE', props.filter_field, myarr)
console.log(' FILTERTABLE', props.filter_field, myarr)
if (props.multiple) {
myarr = myarr.filter((rec: any) => rec[props.filter_field] === needle)
} else {
@@ -348,6 +356,7 @@ export default defineComponent({
// console.log(' myarr: ', myarr)
}
// console.log(' myarr: ', myarr)
return myarr
}
@@ -494,6 +503,15 @@ export default defineComponent({
}
}
function getIcon() {
if (props.icon_alternative)
return props.icon_alternative
if (props.col && props.col['icon']) {
return props.col['icon']
}
return ''
}
onMounted(mounted)
@@ -507,6 +525,7 @@ export default defineComponent({
checkIfShowRec,
abortFilterFn,
newvaluefuncfirst,
getIcon,
}
}
})

View File

@@ -25,6 +25,9 @@
:option-value="optval"
class="combowidth"
>
<template v-if="getIcon() && !sola_lettura" v-slot:prepend>
<q-icon :name="getIcon()" />
</template>
<template v-slot:no-option>
<q-item>
@@ -89,6 +92,9 @@
v-bind="$attrs"
style="width: 250px"
>
<template v-if="getIcon()" v-slot:prepend>
<q-icon :name="getIcon()" />
</template>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
@@ -128,6 +134,9 @@
:option-label="optlab"
:dense="dense">
<template v-if="getIcon()" v-slot:prepend>
<q-icon :name="getIcon()" />
</template>
<template
v-slot:selected-item="scope">
<div v-if="scope.opt[optlab]">
@@ -137,7 +146,6 @@
@remove="scope.removeAtIndex(scope.index)"
v-if="checkIfShowRec(scope.opt)"
color="white"
text-color="mycol"
class="q-my-none q-ml-xs q-mr-none"
>
<q-avatar color="primary" text-color="white" :icon="scope.opt.icon ? scope.opt.icon : ''" size="12px"/>
@@ -182,6 +190,9 @@
map-options
v-bind="$attrs"
class="combowidth">
<template v-if="getIcon()" v-slot:prepend>
<q-icon :name="getIcon()" />
</template>
<template v-slot:option="scope">
<q-item v-bind="scope.itemProps">
<q-item-section avatar>

View File

@@ -10,7 +10,7 @@
<q-item-section @click="naviga(`/my/` + contact.username)">
<q-item-label><strong>{{ contact.name }} {{ contact.surname }}</strong> ({{ contact.username }})
</q-item-label>
<q-item-label caption lines="1"><em>{{ contact.profile.qualifica }}</em></q-item-label>
<q-item-label v-if="contact.profile" caption lines="1"><em>{{ contact.profile.qualifica }}</em></q-item-label>
</q-item-section>
<q-item-section side v-if="visu === costanti.FRIENDS">