Ora cambiando Settore, la Categoria viene sbiancata su "Nessuno" (anche se ancora rimane visivamente selezionato)
i campi obbligatori non funziona il controllo? (Erano i campi di tipo Array) Aggiunta Categoria Ecovillaggi / Comunità + AutoProduzione Aggiunte consulenza, affrancamento, supporto.. su temi di LAVORO Quando inserisci un nuovo annuncio, prendi di default tutti i filtri visualizzati Aggiungere bottone "Condividi Pagina" sui gruppi
This commit is contained in:
@@ -60,7 +60,7 @@ export default defineComponent({
|
||||
/*
|
||||
const idSectorServizi = computed(() => {
|
||||
let myval: any = null
|
||||
myval = searchList_Servizi.value.find((rec) => (rec.table === 'sectors'))
|
||||
myval = searchList_Servizi.value.find((rec) => (rec.table === toolsext.TABSECTORS))
|
||||
if (myval) {
|
||||
const ris = myval.value || 0
|
||||
// console.log('idSectorServizi=', ris)
|
||||
@@ -165,9 +165,9 @@ export default defineComponent({
|
||||
|
||||
|
||||
function getFilterSkills(recSkill: any, index: number, arr: any) {
|
||||
const recsectors: any = searchList.value.find((rec) => rec.table === 'sectors')
|
||||
const recsectors: any = searchList.value.find((rec) => rec.table === toolsext.TABSECTORS)
|
||||
// console.log('getFilterSkills', recSkill.idSector, recsectors.value)
|
||||
if (recsectors) {
|
||||
if (recsectors && recSkill.idSector) {
|
||||
return recSkill.idSector.includes(recsectors.value)
|
||||
} else {
|
||||
return true
|
||||
@@ -177,7 +177,7 @@ export default defineComponent({
|
||||
function getFilterGoods(recGood: any, index: number, arr: any) {
|
||||
const recsectorGoods: any = searchList.value.find((rec) => rec.table === 'sectorgoods')
|
||||
// console.log('getFilterSkills', recSkill.idSector, recsectors.value)
|
||||
if (recsectorGoods) {
|
||||
if (recsectorGoods && recGood.idSectorGood) {
|
||||
return recGood.idSectorGood.includes(recsectorGoods.value)
|
||||
} else {
|
||||
return true
|
||||
@@ -281,9 +281,9 @@ export default defineComponent({
|
||||
},
|
||||
{
|
||||
label: 'Settore',
|
||||
table: 'sectors',
|
||||
table: toolsext.TABSECTORS,
|
||||
key: 'idSector',
|
||||
value: tools.getCookie(tools.COOK_SEARCH + 'sectors', 0),
|
||||
value: tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORS, 0),
|
||||
arrvalue: [],
|
||||
type: costanti.FieldType.select,
|
||||
filter: null,
|
||||
@@ -295,7 +295,7 @@ export default defineComponent({
|
||||
label: 'Categoria',
|
||||
table: 'skills',
|
||||
key: 'idSkill',
|
||||
value: tools.getCookie(tools.COOK_SEARCH + 'skills' + '_' + tools.getCookie(tools.COOK_SEARCH + 'sectors', costanti.FILTER_TUTTI), costanti.FILTER_TUTTI),
|
||||
value: tools.getCookie(tools.COOK_SEARCH + 'skills' + '_' + tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORS, costanti.FILTER_TUTTI), costanti.FILTER_TUTTI),
|
||||
arrvalue: [],
|
||||
type: costanti.FieldType.select,
|
||||
addall: true,
|
||||
@@ -444,9 +444,9 @@ export default defineComponent({
|
||||
},
|
||||
{
|
||||
label: 'Settore',
|
||||
table: 'sectors',
|
||||
table: toolsext.TABSECTORS,
|
||||
key: 'idSector',
|
||||
value: tools.getCookie(tools.COOK_SEARCH + 'sectors', 0),
|
||||
value: tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORS, 0),
|
||||
arrvalue: [],
|
||||
type: costanti.FieldType.select,
|
||||
filter: null,
|
||||
@@ -458,7 +458,7 @@ export default defineComponent({
|
||||
label: 'Categoria',
|
||||
table: 'skills',
|
||||
key: 'idSkill',
|
||||
value: tools.getCookie(tools.COOK_SEARCH + 'skills' + '_' + tools.getCookie(tools.COOK_SEARCH + 'sectors', costanti.FILTER_TUTTI), costanti.FILTER_TUTTI),
|
||||
value: tools.getCookie(tools.COOK_SEARCH + 'skills' + '_' + tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORS, costanti.FILTER_TUTTI), costanti.FILTER_TUTTI),
|
||||
arrvalue: [],
|
||||
type: costanti.FieldType.select,
|
||||
addall: true,
|
||||
@@ -672,9 +672,9 @@ export default defineComponent({
|
||||
table: 'cities',
|
||||
key: 'idCity',
|
||||
type: costanti.FieldType.select_by_server,
|
||||
value: 0,
|
||||
arrvalue: [],
|
||||
addall: true,
|
||||
arrvalue: tools.getCookie(tools.COOK_SEARCH + 'cities', costanti.FILTER_TUTTI),
|
||||
value: tools.getCookie(tools.COOK_SEARCH + 'cities', costanti.FILTER_TUTTI),
|
||||
useinput: true,
|
||||
filter: null,
|
||||
// filter: getFilterCitiesByProvince,
|
||||
@@ -891,7 +891,7 @@ export default defineComponent({
|
||||
}
|
||||
},
|
||||
lookup3: {
|
||||
lk_tab: 'sectors',
|
||||
lk_tab: toolsext.TABSECTORS,
|
||||
lk_LF: 'recSkill.idSector',
|
||||
lk_FF: '_id',
|
||||
lk_as: 'sector',
|
||||
@@ -952,7 +952,7 @@ export default defineComponent({
|
||||
}
|
||||
},
|
||||
lookup3: {
|
||||
lk_tab: 'sectors',
|
||||
lk_tab: toolsext.TABSECTORS,
|
||||
lk_LF: 'recSkill.idSector',
|
||||
lk_FF: '_id',
|
||||
lk_as: 'sector',
|
||||
|
||||
@@ -280,15 +280,15 @@ export default defineComponent({
|
||||
|
||||
const myvertical = ref(props.vertical)
|
||||
|
||||
const valoriopt = computed(() => (item: any, addall: boolean) => {
|
||||
const valoriopt = computed(() => (item: any, addall: boolean, addnone: boolean) => {
|
||||
// console.log('valoriopt', item.table)
|
||||
return globalStore.getTableJoinByName(item.table, addall, item.filter)
|
||||
return globalStore.getTableJoinByName(item.table, addall, addnone, item.filter)
|
||||
})
|
||||
|
||||
const labelcombo = computed(() => (item: any) => {
|
||||
let lab = item.label
|
||||
if (item.showcount)
|
||||
lab += ' (' + valoriopt.value(item, false).length + ')'
|
||||
lab += ' (' + valoriopt.value(item, false, false).length + ')'
|
||||
return lab
|
||||
})
|
||||
|
||||
@@ -319,7 +319,7 @@ export default defineComponent({
|
||||
let trovato = false
|
||||
let arrvalues = []
|
||||
if (rec) {
|
||||
arrvalues = valoriopt.value(rec.value, false)
|
||||
arrvalues = valoriopt.value(rec.value, false, false)
|
||||
if (arrvalues)
|
||||
trovato = arrvalues.find((rec: any) => rec[rec.key] === valsaved)
|
||||
}
|
||||
@@ -336,11 +336,16 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function searchval(newval: any, table: any) {
|
||||
// console.log('searchval', newval, table)
|
||||
console.log('searchval', newval, table)
|
||||
tools.setCookie(tools.COOK_SEARCH + table, newval)
|
||||
|
||||
if (table === 'sectors') {
|
||||
setCategBySector('skills', table, newval)
|
||||
if (table === toolsext.TABSKILLS) {
|
||||
const recSector = searchList.value.find((rec) => rec.table === 'sectors')
|
||||
if (recSector) {
|
||||
tools.setCookie(tools.COOK_SEARCH + table + '_' + recSector.value, newval)
|
||||
}
|
||||
} else if (table === toolsext.TABSECTORS) {
|
||||
setCategBySector(toolsext.TABSKILLS, table, newval)
|
||||
}else if (table === 'goods') {
|
||||
setCategBySector('sectorgoods', table, newval)
|
||||
}
|
||||
@@ -400,7 +405,7 @@ export default defineComponent({
|
||||
let idRegion = 0
|
||||
let idSkill = 0
|
||||
if (searchList.value) {
|
||||
recSector = searchList.value.find((item: ISearchList) => item.table === 'sectors')
|
||||
recSector = searchList.value.find((item: ISearchList) => item.table === toolsext.TABSECTORS)
|
||||
idSector = recSector ? recSector.value : 0
|
||||
}
|
||||
if (searchList.value) {
|
||||
@@ -420,7 +425,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
if (searchList.value) {
|
||||
recSkill = searchList.value.find((item: ISearchList) => item.table === 'skills')
|
||||
recSkill = searchList.value.find((item: ISearchList) => item.table === toolsext.TABSKILLS)
|
||||
idSkill = recSkill ? recSkill.value : 0
|
||||
console.log('recSkill', idSkill)
|
||||
}
|
||||
@@ -514,7 +519,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
} else {
|
||||
if ((item.table === 'skills') && item.value === costanti.FILTER_TUTTI) {
|
||||
if ((item.table === toolsext.TABSKILLS) && item.value === costanti.FILTER_TUTTI) {
|
||||
let obj2: any = {}
|
||||
|
||||
if (idSector > 0) {
|
||||
@@ -776,12 +781,20 @@ export default defineComponent({
|
||||
|
||||
function selItem(item: any, col: IColGridTable, inmodif?: boolean) {
|
||||
console.log('selItem', item, col)
|
||||
rowsel = item
|
||||
idsel = item._id
|
||||
colsel.value = col
|
||||
if (inmodif) {
|
||||
|
||||
}
|
||||
if (col.jointable === toolsext.TABSECTORS) {
|
||||
// Sbianca la select della Categoria
|
||||
|
||||
if (item && item.hasOwnProperty('idSkill')) {
|
||||
item['idSkill'] = costanti.FILTER_NESSUNO
|
||||
newRecord.value['idSkill'] = item['idSkill']
|
||||
}
|
||||
}
|
||||
rowsel = item
|
||||
idsel = item._id
|
||||
colsel.value = col
|
||||
}
|
||||
|
||||
function undoVal() {
|
||||
@@ -1328,14 +1341,23 @@ export default defineComponent({
|
||||
|
||||
let ok = true
|
||||
|
||||
mycolumns.value.forEach((col: IColGridTable) => {
|
||||
//mycolumns.value.forEach((col: IColGridTable) => {
|
||||
let col: IColGridTable
|
||||
|
||||
for (col of mycolumns.value) {
|
||||
if (col.required) {
|
||||
// console.log('newRecord.value', newRecord.value, newRecord.value[col.name])
|
||||
if (!newRecord.value[col.name]) {
|
||||
ok = false
|
||||
if (tools.isArray(newRecord.value[col.name])) {
|
||||
if (newRecord.value[col.name].length <= 0) {
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
if (!newRecord.value[col.name]) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
||||
@@ -1347,9 +1369,15 @@ export default defineComponent({
|
||||
for (col of mycolumns.value) {
|
||||
if (col.required) {
|
||||
// console.log('newRecord.value', newRecord.value, newRecord.value[col.name])
|
||||
if (!newRecord.value[col.name]) {
|
||||
// console.log('col.name', col.name)
|
||||
return translate(col.label_trans)
|
||||
if (tools.isArray(newRecord.value[col.name])) {
|
||||
if (newRecord.value[col.name].length <= 0){
|
||||
return translate(col.label_trans)
|
||||
}
|
||||
} else {
|
||||
if (!newRecord.value[col.name]) {
|
||||
// console.log('col.name', col.name)
|
||||
return translate(col.label_trans)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,6 +151,7 @@
|
||||
v-model:value="item.value"
|
||||
@update:value="searchval(item.value, item.table)"
|
||||
:addall="item.addall"
|
||||
:addnone="item.addnone"
|
||||
:tablesel="item.type === costanti.FieldType.select_by_server ? item.tablesel : ''"
|
||||
:pickup="item.type === costanti.FieldType.select_by_server"
|
||||
label-color="primary"
|
||||
@@ -177,6 +178,7 @@
|
||||
v-model:arrvalue="item.arrvalue"
|
||||
@update:arrvalue="searchval(item.arrvalue, item.table)"
|
||||
:addall="item.addall"
|
||||
:addnone="item.addnone"
|
||||
:tablesel="item.tablesel"
|
||||
:pickup="true"
|
||||
:param1="item.param1"
|
||||
@@ -207,7 +209,7 @@
|
||||
map-options
|
||||
stack-label
|
||||
:useinput="item.useinput"
|
||||
:options="valoriopt(item, item.addall)"
|
||||
:options="valoriopt(item, item.addall, item.addnone)"
|
||||
:filter="item.filter"
|
||||
class="combowidth"
|
||||
:option-value="fieldsTable.getKeyByTable(item.table)"
|
||||
|
||||
@@ -74,6 +74,10 @@ export default defineComponent({
|
||||
load()
|
||||
}
|
||||
|
||||
function condividipag() {
|
||||
return tools.copyStringToClipboard($q, self.location.host + tools.getPathByGroup(myrec.value, props.table), true)
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
@@ -90,6 +94,7 @@ export default defineComponent({
|
||||
colCitys,
|
||||
toolsext,
|
||||
col,
|
||||
condividipag,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
|
||||
<q-img
|
||||
v-if="tools.getValue(myrec, 'photos', '')"
|
||||
:src="tools.getFullFileName(tools.getValue(myrec, 'photos', ''), table, myrec.username, myrec.groupname)" class="img"
|
||||
:src="tools.getFullFileName(tools.getValue(myrec, 'photos', ''), table, myrec.username, myrec.groupname)"
|
||||
class="img"
|
||||
alt="immagine del gruppo"></q-img>
|
||||
</div>
|
||||
|
||||
@@ -65,11 +66,19 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text-center">
|
||||
<q-btn
|
||||
icon="far fa-file-alt" label="Apri Pagina" color="primary" text-color="white"
|
||||
:to="tools.getToByCol(col, table, myrec)"
|
||||
/>
|
||||
<div class="row q-ma-sm q-pa-sm justify-center">
|
||||
<div class="q-ma-sm">
|
||||
<q-btn
|
||||
icon="far fa-file-alt" label="Apri Pagina" color="primary" text-color="white"
|
||||
:to="tools.getToByCol(col, table, myrec)"
|
||||
/>
|
||||
|
||||
</div>
|
||||
<div class="q-ma-sm">
|
||||
<q-btn
|
||||
color="primary" text-color="white" icon="fas fa-copy" label="Condividi Pagina"
|
||||
@click="condividipag"></q-btn>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br><br>
|
||||
|
||||
@@ -78,10 +78,6 @@ export default defineComponent({
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
function getPathByGroup(grp: IMyGroup){
|
||||
return '/' + tools.getDirectoryByTable(table.value) + '/' + grp.groupname
|
||||
}
|
||||
|
||||
return {
|
||||
grp,
|
||||
costanti,
|
||||
@@ -92,7 +88,7 @@ export default defineComponent({
|
||||
userStore,
|
||||
tools,
|
||||
$q,
|
||||
getPathByGroup,
|
||||
table,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
<div v-if="tools.isUserOk()">
|
||||
<div v-if="grp">
|
||||
<q-item class="q-my-sm" clickable>
|
||||
<q-item-section avatar @click="naviga(getPathByGroup(grp))">
|
||||
<q-item-section avatar @click="naviga(tools.getPathByGroup(grp, table))">
|
||||
<q-avatar size="60px">
|
||||
<q-img :src="getImgGroup(grp)" :alt="grp.groupname" img-class="imgprofile" height="60px"/>
|
||||
</q-avatar>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section @click="naviga(getPathByGroup(grp))">
|
||||
<q-item-section @click="naviga(tools.getPathByGroup(grp, table))">
|
||||
<q-item-label><strong>{{ grp.title }}</strong> ({{ grp.groupname }})
|
||||
</q-item-label>
|
||||
<q-item-label v-if="grp.descr" caption lines="1"><em>{{ grp.descr }}</em></q-item-label>
|
||||
|
||||
@@ -233,7 +233,7 @@
|
||||
:pickup="pickup"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
:useinput="false">
|
||||
</CMySelect>
|
||||
</div>
|
||||
@@ -254,7 +254,7 @@
|
||||
:pickup="pickup"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
:useinput="false">
|
||||
</CMySelect>
|
||||
</div>
|
||||
@@ -306,7 +306,7 @@
|
||||
</span>
|
||||
<CMyToggleList
|
||||
:label="col.titlepopupedit"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
v-model:value="myvalue"
|
||||
@update:value="changevalRec"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
@@ -319,7 +319,7 @@
|
||||
:type="costanti.FieldType.binary"
|
||||
:value="myvalue"
|
||||
@update:value="changevalRec"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:opticon="fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
|
||||
@@ -342,12 +342,13 @@
|
||||
v-model:arrvalue="myvalue"
|
||||
@update:arrvalue="changevalRec"
|
||||
:addall="false"
|
||||
:addnone="false"
|
||||
label-color="primary"
|
||||
class="combowidth"
|
||||
color="primary"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
:sola_lettura="!isInModif"
|
||||
:useinput="col.allowNewValue"
|
||||
:newvaluefunc="addNewValue">
|
||||
@@ -363,7 +364,7 @@
|
||||
:display-value="fieldsTable.getTitleByTable(col.jointable)"
|
||||
emit-value
|
||||
map-options
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
class="combowidth"
|
||||
:option-value="fieldsTable.getKeyByTable(col.jointable)"
|
||||
@update:model-value="changevalRec">
|
||||
@@ -390,7 +391,7 @@
|
||||
:type_out="col.field_outtype"
|
||||
@update:value="changevalRec"
|
||||
:value="myvalue"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:opticon="fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
|
||||
@@ -410,11 +411,12 @@
|
||||
@update:value="changevalRec"
|
||||
:newvaluefunc="addNewValue"
|
||||
:filter_table="col.filter_table"
|
||||
:addnone="col.addnone"
|
||||
:filter_field="col.filter_field"
|
||||
:value_extra="value_extra"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
:useinput="col.allowNewValue">
|
||||
</CMySelect>
|
||||
</div>
|
||||
@@ -425,7 +427,7 @@
|
||||
row: {{row}}
|
||||
col.jointable {{col.jointable}}
|
||||
myvalue {{myvalue}}
|
||||
opt: {{globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)}}
|
||||
opt: {{globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)}}
|
||||
val: {{fieldsTable.getKeyByTable(col.jointable)}}
|
||||
lab: {{fieldsTable.getLabelByTable(col.jointable)}}-->
|
||||
<CMyChipList
|
||||
@@ -438,7 +440,7 @@
|
||||
:labelifblank="canEdit ? 'Selezionare' : '' "
|
||||
:filter_table="col.filter_table"
|
||||
:filter_field="col.filter_field"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:opticon="fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
|
||||
@@ -455,6 +457,7 @@
|
||||
v-model:arrvalue="myvalue"
|
||||
@update:arrvalue="changevalRec"
|
||||
:addall="false"
|
||||
:addnone="false"
|
||||
:tablesel="col.tablesel"
|
||||
:pickup="true"
|
||||
:filter_table="col.filter_table"
|
||||
@@ -465,7 +468,7 @@
|
||||
color="primary"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
:sola_lettura="!isInModif"
|
||||
:useinput="isInModif">
|
||||
</CMySelect>
|
||||
@@ -484,7 +487,7 @@
|
||||
:value_extra="value_extra"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
:useinput="false">
|
||||
</CMySelect>
|
||||
</div>
|
||||
@@ -678,6 +681,7 @@
|
||||
:label="col.label ? col.label : t(col.label_trans)"
|
||||
v-model:value="scope.value"
|
||||
:pickup="col.fieldtype === costanti.FieldType.select_by_server"
|
||||
:addnone="col.addnone"
|
||||
:tablesel="col.fieldtype === costanti.FieldType.select_by_server ? tablesel : ''"
|
||||
:filter_table="col.filter_table"
|
||||
:filter_field="col.filter_field"
|
||||
@@ -685,7 +689,7 @@
|
||||
:newvaluefunc="addNewValue"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
:useinput="col.allowNewValue">
|
||||
</CMySelect>
|
||||
</div>
|
||||
@@ -699,6 +703,7 @@
|
||||
v-model:arrvalue="scope.value"
|
||||
@update:arrvalue="changevalRec"
|
||||
:addall="false"
|
||||
:addnone="false"
|
||||
:tablesel="tablesel"
|
||||
:filter_table="col.filter_table"
|
||||
:filter_field="col.filter_field"
|
||||
@@ -709,7 +714,7 @@
|
||||
color="primary"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
:useinput="true">
|
||||
</CMySelect>
|
||||
</div>
|
||||
@@ -724,7 +729,7 @@
|
||||
:display-value="fieldsTable.getTitleByTable(col.jointable)"
|
||||
emit-value
|
||||
map-options
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
class="combowidth"
|
||||
:useinput="col.allowNewValue"
|
||||
:newvaluefunc="addNewValue"
|
||||
@@ -816,7 +821,7 @@
|
||||
|
||||
<CMyToggleList
|
||||
:label="col.titlepopupedit"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
v-model:value="scope.value"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)">
|
||||
@@ -831,7 +836,7 @@
|
||||
v-model:value="scope.value"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
|
||||
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter)"
|
||||
:useinput="false">
|
||||
</CMySelect>
|
||||
</div>
|
||||
|
||||
@@ -97,6 +97,11 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
addnone: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
dense: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
@@ -220,7 +225,6 @@ export default defineComponent({
|
||||
// localStorage.setItem(props.tablesel + '_' + newval, valori.value[newval])
|
||||
|
||||
if (props.type_out === costanti.FieldType.object) {
|
||||
// debugger;
|
||||
const arrout = []
|
||||
for (const val of newval) {
|
||||
let obj: any = {}
|
||||
@@ -264,7 +268,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function update() {
|
||||
// console.log('update')
|
||||
console.log('update')
|
||||
// console.log(' #### mounted myselect', props.options, 'arrvalue', myarrvalue.value)
|
||||
let rec: any
|
||||
if (optionsreal.value) {
|
||||
@@ -285,6 +289,15 @@ export default defineComponent({
|
||||
|
||||
arrtempOpt.value.push(myobj)
|
||||
}
|
||||
if (props.addnone) {
|
||||
let myobj: any = {}
|
||||
if (typeof props.optlab === 'string') {
|
||||
myobj[props.optlab] = '[Nessuno]'
|
||||
myobj[props.optval] = costanti.FILTER_NESSUNO
|
||||
}
|
||||
|
||||
arrtempOpt.value = [myobj, ...arrtempOpt.value]
|
||||
}
|
||||
for (let i = 0; i < num; i++) {
|
||||
const itemId = parseInt(localStorage.getItem(props.tablesel + i + props.optval)!)
|
||||
const itemlab = localStorage.getItem(props.tablesel + i + props.optlab)
|
||||
@@ -326,6 +339,16 @@ export default defineComponent({
|
||||
myarrvalue.value.push(rec[`${props.optval}`])
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (props.addnone) {
|
||||
let myobj: any = {}
|
||||
if (typeof props.optlab === 'string') {
|
||||
myobj[props.optlab] = '[Nessuno]'
|
||||
myobj[props.optval] = costanti.FILTER_NESSUNO
|
||||
}
|
||||
|
||||
myarrvalue.value = [myobj, ...myarrvalue.value]
|
||||
}
|
||||
}
|
||||
|
||||
if (props.tablesel === 'friendsandme') {
|
||||
@@ -383,7 +406,7 @@ export default defineComponent({
|
||||
|
||||
// console.log(props.col.jointable, props.filter)
|
||||
if (props.col.jointable) {
|
||||
optionsreal.value = globalStore.getTableJoinByName(props.col.jointable, props.col.addall, props.filter)
|
||||
optionsreal.value = globalStore.getTableJoinByName(props.col.jointable, props.col.addall, props.col.addnone, props.filter)
|
||||
// console.log('optionsreal.value', optionsreal.value)
|
||||
} else {
|
||||
optionsreal.value = props.options
|
||||
@@ -402,7 +425,13 @@ export default defineComponent({
|
||||
if (props.multiple) {
|
||||
myarr = myarr.filter((rec: any) => rec[props.filter_field] === needle)
|
||||
} else {
|
||||
myarr = myarr.filter((rec: any) => rec[props.filter_field].includes(needle))
|
||||
|
||||
myarr = myarr.filter((rec: any) => {
|
||||
if (tools.isArray(rec[props.filter_field]))
|
||||
return rec[props.filter_field].includes(needle)
|
||||
else
|
||||
return false
|
||||
})
|
||||
}
|
||||
// console.log(' RISSSSSSSSS: ', myarr)
|
||||
}
|
||||
@@ -420,6 +449,17 @@ export default defineComponent({
|
||||
// console.log(' myarr: ', myarr)
|
||||
}
|
||||
|
||||
if (props.addnone) {
|
||||
let myobj: any = {}
|
||||
if (typeof props.optlab === 'string') {
|
||||
myobj[props.optlab] = '[Nessuno]'
|
||||
myobj[props.optval] = costanti.FILTER_NESSUNO
|
||||
}
|
||||
|
||||
if (myarr)
|
||||
myarr = [myobj, ...myarr]
|
||||
}
|
||||
|
||||
// console.log(' myarr: ', myarr)
|
||||
return myarr
|
||||
}
|
||||
@@ -505,6 +545,15 @@ export default defineComponent({
|
||||
myobj[props.optval] = costanti.FILTER_TUTTI
|
||||
}
|
||||
|
||||
myarr = [myobj, ...myarr]
|
||||
}
|
||||
if (props.addnone) {
|
||||
let myobj: any = {}
|
||||
if (typeof props.optlab === 'string') {
|
||||
myobj[props.optlab] = '[Nessuno]'
|
||||
myobj[props.optval] = costanti.FILTER_NESSUNO
|
||||
}
|
||||
|
||||
myarr = [myobj, ...myarr]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user