ridotto la scheda, se noshowifnone: true

This commit is contained in:
paoloar77
2022-01-20 02:26:48 +01:00
parent 6c90b46454
commit 6e54fa06c4
6 changed files with 56 additions and 29 deletions

View File

@@ -13,14 +13,17 @@
<q-space></q-space> <q-space></q-space>
<div v-if="butt_modif_new"> <div v-if="butt_modif_new">
<q-btn <q-btn
v-if="mytable" rounded dense size="sm" flat :color="canEdit ? 'positive' : 'light-gray'" v-if="mytable && mytable !== 'myskills'" rounded dense size="sm" flat
:color="canEdit ? 'positive' : 'light-gray'"
:disable="disabilita()" :disable="disabilita()"
:val="lists.MenuAction.CAN_EDIT_TABLE" :val="lists.MenuAction.CAN_EDIT_TABLE"
icon="fas fa-pencil-alt" @update:model-value="changefuncAct" icon="fas fa-pencil-alt" @update:model-value="changefuncAct"
@click="canEdit = !canEdit"> @click="canEdit = !canEdit">
</q-btn> </q-btn>
<q-btn <q-btn
v-if="mytable" rounded dense size="sm" flat color="light-gray" v-if="mytable" rounded size="md" color="primary"
class="centermydiv"
label="Aggiungi"
:disable="loading" :disable="loading"
icon="fas fa-plus" icon="fas fa-plus"
@click="createNewRecord"> @click="createNewRecord">
@@ -231,9 +234,12 @@
<div v-if="pagination.rowsNumber > 1 && prop_search">{{ pagination.rowsNumber }} elementi trovati</div> <div v-if="pagination.rowsNumber > 1 && prop_search">{{ pagination.rowsNumber }} elementi trovati</div>
<div v-if="finder" class=""> <div v-if="finder" class="">
<q-radio v-model="myvertical" :val="2" label="Lista" @update:model-value="tools.setCookie('myv', myvertical) "/> <q-radio v-model="myvertical" :val="2" label="Lista"
<q-radio v-model="myvertical" :val="-1" label="Scheda" @update:model-value="tools.setCookie('myv', myvertical) "/> @update:model-value="tools.setCookie('myv', myvertical) "/>
<q-radio v-model="myvertical" :val="0" label="Tabella" @update:model-value="tools.setCookie('myv', myvertical) "/> <q-radio v-model="myvertical" :val="-1" label="Scheda"
@update:model-value="tools.setCookie('myv', myvertical) "/>
<q-radio v-model="myvertical" :val="0" label="Tabella"
@update:model-value="tools.setCookie('myv', myvertical) "/>
</div> </div>
</template> </template>
@@ -320,7 +326,10 @@
<q-card-section class="inset-shadow"> <q-card-section class="inset-shadow">
<q-list dense> <q-list dense>
<div v-for="col in mycolumns" :key="col.name"> <div v-for="col in mycolumns" :key="col.name">
<q-item v-if="colVisib.includes(col.field + col.subfield)" :class="clByCol(col)" class="riduci_pad"> <q-item v-if="colVisib.includes(col.field + col.subfield) &&
!col.noshowifnone || (col.noshowifnone && !!props.row.value)"
:class="clByCol(col)" class="riduci_pad">
<q-item-section avatar v-if="visuIntestazCol(col)"> <q-item-section avatar v-if="visuIntestazCol(col)">
<q-item-label class="q-table__col">{{ col.label }}</q-item-label> <q-item-label class="q-table__col">{{ col.label }}</q-item-label>
</q-item-section> </q-item-section>

View File

@@ -159,7 +159,7 @@
:pickup="pickup" :pickup="pickup"
:optval="fieldsTable.getKeyByTable(col.jointable)" :optval="fieldsTable.getKeyByTable(col.jointable)"
:optlab="fieldsTable.getLabelByTable(col.jointable)" :optlab="fieldsTable.getLabelByTable(col.jointable)"
:options="globalStore.getTableJoinByName(col.jointable)" :options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
:useinput="false"> :useinput="false">
</CMySelect> </CMySelect>
</div> </div>
@@ -177,7 +177,7 @@
:pickup="pickup" :pickup="pickup"
:optval="fieldsTable.getKeyByTable(col.jointable)" :optval="fieldsTable.getKeyByTable(col.jointable)"
:optlab="fieldsTable.getLabelByTable(col.jointable)" :optlab="fieldsTable.getLabelByTable(col.jointable)"
:options="globalStore.getTableJoinByName(col.jointable)" :options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
:useinput="false"> :useinput="false">
</CMySelect> </CMySelect>
</div> </div>
@@ -217,11 +217,11 @@
<div v-else-if="col.fieldtype === costanti.FieldType.binary"> <div v-else-if="col.fieldtype === costanti.FieldType.binary">
<div v-if="isInModif"> <div v-if="isInModif">
<span v-if="insertMode"> <span v-if="insertMode">
{{col.label }}: {{ col.label }}:
</span> </span>
<CMyToggleList <CMyToggleList
:label="col.titlepopupedit" :label="col.titlepopupedit"
:options="globalStore.getTableJoinByName(col.jointable)" :options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
v-model:value="myvalue" v-model:value="myvalue"
@update:value="changevalRec" @update:value="changevalRec"
:optval="fieldsTable.getKeyByTable(col.jointable)" :optval="fieldsTable.getKeyByTable(col.jointable)"
@@ -233,7 +233,7 @@
:type="costanti.FieldType.binary" :type="costanti.FieldType.binary"
:value="myvalue" :value="myvalue"
@update:value="changevalRec" @update:value="changevalRec"
:options="globalStore.getTableJoinByName(col.jointable)" :options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
:optval="fieldsTable.getKeyByTable(col.jointable)" :optval="fieldsTable.getKeyByTable(col.jointable)"
:optlab="fieldsTable.getLabelByTable(col.jointable)" :optlab="fieldsTable.getLabelByTable(col.jointable)"
:opticon="fieldsTable.getIconByTable(col.jointable)"></CMyChipList> :opticon="fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
@@ -253,7 +253,7 @@
:display-value="fieldsTable.getTitleByTable(col.jointable)" :display-value="fieldsTable.getTitleByTable(col.jointable)"
emit-value emit-value
map-options map-options
:options="globalStore.getTableJoinByName(col.jointable)" :options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
class="combowidth" class="combowidth"
:option-value="fieldsTable.getKeyByTable(col.jointable)" :option-value="fieldsTable.getKeyByTable(col.jointable)"
@update:model-value="changevalRec"> @update:model-value="changevalRec">
@@ -278,13 +278,14 @@
:type="col.fieldtype" :type="col.fieldtype"
@update:value="changevalRec" @update:value="changevalRec"
:value="myvalue" :value="myvalue"
:options="globalStore.getTableJoinByName(col.jointable)" :options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
:optval="fieldsTable.getKeyByTable(col.jointable)" :optval="fieldsTable.getKeyByTable(col.jointable)"
:optlab="fieldsTable.getLabelByTable(col.jointable)" :optlab="fieldsTable.getLabelByTable(col.jointable)"
:opticon="fieldsTable.getIconByTable(col.jointable)"></CMyChipList> :opticon="fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
</div> </div>
</div> </div>
<div v-else-if="(col.fieldtype === costanti.FieldType.select) || (col.fieldtype === costanti.FieldType.select_by_server)"> <div
v-else-if="(col.fieldtype === costanti.FieldType.select) || (col.fieldtype === costanti.FieldType.select_by_server)">
<div v-if="isInModif"> <div v-if="isInModif">
<CMySelect <CMySelect
:label="col.label" :label="col.label"
@@ -294,7 +295,7 @@
@update:value="changevalRec" @update:value="changevalRec"
:optval="fieldsTable.getKeyByTable(col.jointable)" :optval="fieldsTable.getKeyByTable(col.jointable)"
:optlab="fieldsTable.getLabelByTable(col.jointable)" :optlab="fieldsTable.getLabelByTable(col.jointable)"
:options="globalStore.getTableJoinByName(col.jointable)" :options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
:useinput="false"> :useinput="false">
</CMySelect> </CMySelect>
</div> </div>
@@ -304,7 +305,7 @@
:type="col.fieldtype" :type="col.fieldtype"
@update:value="changevalRec" @update:value="changevalRec"
v-model:value="myvalue" v-model:value="myvalue"
:options="globalStore.getTableJoinByName(col.jointable)" :options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
:optval="fieldsTable.getKeyByTable(col.jointable)" :optval="fieldsTable.getKeyByTable(col.jointable)"
:optlab="fieldsTable.getLabelByTable(col.jointable)" :optlab="fieldsTable.getLabelByTable(col.jointable)"
:opticon="fieldsTable.getIconByTable(col.jointable)"></CMyChipList> :opticon="fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
@@ -324,8 +325,9 @@
color="primary" color="primary"
:optval="fieldsTable.getKeyByTable(col.jointable)" :optval="fieldsTable.getKeyByTable(col.jointable)"
:optlab="fieldsTable.getLabelByTable(col.jointable)" :optlab="fieldsTable.getLabelByTable(col.jointable)"
:options="globalStore.getTableJoinByName(col.jointable)" :options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
:useinput="true"> :sola_lettura="!isInModif"
:useinput="isInModif">
</CMySelect> </CMySelect>
</div> </div>
<div v-else-if="col.fieldtype === costanti.FieldType.star5"> <div v-else-if="col.fieldtype === costanti.FieldType.star5">
@@ -336,7 +338,7 @@
@update:value="changevalRec" @update:value="changevalRec"
:optval="fieldsTable.getKeyByTable(col.jointable)" :optval="fieldsTable.getKeyByTable(col.jointable)"
:optlab="fieldsTable.getLabelByTable(col.jointable)" :optlab="fieldsTable.getLabelByTable(col.jointable)"
:options="globalStore.getTableJoinByName(col.jointable)" :options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
:useinput="false"> :useinput="false">
</CMySelect> </CMySelect>
</div> </div>
@@ -493,7 +495,8 @@
</q-input> </q-input>
</div> </div>
</div> </div>
<div v-else-if="(col.fieldtype === costanti.FieldType.select) || (col.fieldtype === costanti.FieldType.select_by_server)"> <div
v-else-if="(col.fieldtype === costanti.FieldType.select) || (col.fieldtype === costanti.FieldType.select_by_server)">
<CMySelect <CMySelect
:label="col.label" :label="col.label"
v-model:value="scope.value" v-model:value="scope.value"
@@ -501,12 +504,11 @@
:tablesel="col.type === costanti.FieldType.select_by_server ? tablesel : ''" :tablesel="col.type === costanti.FieldType.select_by_server ? tablesel : ''"
:optval="fieldsTable.getKeyByTable(col.jointable)" :optval="fieldsTable.getKeyByTable(col.jointable)"
:optlab="fieldsTable.getLabelByTable(col.jointable)" :optlab="fieldsTable.getLabelByTable(col.jointable)"
:options="globalStore.getTableJoinByName(col.jointable)" :options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
:useinput="false"> :useinput="false">
</CMySelect> </CMySelect>
</div> </div>
<div v-else-if="col.fieldtype === costanti.FieldType.multiselect_by_server"> <div v-else-if="col.fieldtype === costanti.FieldType.multiselect_by_server">
myvalue2 : {{scope.value}}
<CMySelect <CMySelect
:multiselect_by_server="true" :multiselect_by_server="true"
:label="col.label" :label="col.label"
@@ -520,7 +522,7 @@
color="primary" color="primary"
:optval="fieldsTable.getKeyByTable(col.jointable)" :optval="fieldsTable.getKeyByTable(col.jointable)"
:optlab="fieldsTable.getLabelByTable(col.jointable)" :optlab="fieldsTable.getLabelByTable(col.jointable)"
:options="globalStore.getTableJoinByName(col.jointable)" :options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
:useinput="true"> :useinput="true">
</CMySelect> </CMySelect>
</div> </div>
@@ -535,7 +537,7 @@
:display-value="fieldsTable.getTitleByTable(col.jointable)" :display-value="fieldsTable.getTitleByTable(col.jointable)"
emit-value emit-value
map-options map-options
:options="globalStore.getTableJoinByName(col.jointable)" :options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
class="combowidth" class="combowidth"
:option-value="fieldsTable.getKeyByTable(col.jointable)" :option-value="fieldsTable.getKeyByTable(col.jointable)"
@update:model-value="changeval"> @update:model-value="changeval">
@@ -588,7 +590,7 @@
<CMyToggleList <CMyToggleList
:label="col.titlepopupedit" :label="col.titlepopupedit"
:options="globalStore.getTableJoinByName(col.jointable)" :options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
v-model:value="scope.value" v-model:value="scope.value"
:optval="fieldsTable.getKeyByTable(col.jointable)" :optval="fieldsTable.getKeyByTable(col.jointable)"
:optlab="fieldsTable.getLabelByTable(col.jointable)"> :optlab="fieldsTable.getLabelByTable(col.jointable)">
@@ -600,7 +602,7 @@
v-model:value="scope.value" v-model:value="scope.value"
:optval="fieldsTable.getKeyByTable(col.jointable)" :optval="fieldsTable.getKeyByTable(col.jointable)"
:optlab="fieldsTable.getLabelByTable(col.jointable)" :optlab="fieldsTable.getLabelByTable(col.jointable)"
:options="globalStore.getTableJoinByName(col.jointable)" :options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
:useinput="false"> :useinput="false">
</CMySelect> </CMySelect>
</div> </div>

View File

@@ -78,6 +78,10 @@ export default defineComponent({
multiselect_by_server: { multiselect_by_server: {
type: Boolean, type: Boolean,
default: false, default: false,
},
sola_lettura: {
type: Boolean,
default: false,
} }
}, },
components: {}, components: {},

View File

@@ -2,6 +2,7 @@
<div class="text-center"> <div class="text-center">
<div v-if="multiselect_by_server"> <div v-if="multiselect_by_server">
<q-select <q-select
v-bind="$attrs"
:model-value="myarrvalue" :model-value="myarrvalue"
label-color="primary" label-color="primary"
:label="label" :label="label"
@@ -16,7 +17,8 @@
map-options map-options
stack-label stack-label
emit-value emit-value
:use-input="true" :readonly="sola_lettura"
:use-input="useinput"
:dense="dense" :dense="dense"
:input-class="myclass" :input-class="myclass"
:options="valori" :options="valori"
@@ -35,7 +37,7 @@
<template v-slot:selected-item="scope"> <template v-slot:selected-item="scope">
<div v-if="scope.opt[fieldsTable.getLabelByTable(tablesel)]"> <div v-if="scope.opt[fieldsTable.getLabelByTable(tablesel)]">
<q-chip <q-chip
removable :removable="!sola_lettura"
dense dense
@remove="scope.removeAtIndex(scope.index)" @remove="scope.removeAtIndex(scope.index)"
v-if="checkIfShowRec(scope.opt)" v-if="checkIfShowRec(scope.opt)"

View File

@@ -498,8 +498,11 @@ export interface IColGridTable {
tipovisu?: number tipovisu?: number
link?: string link?: string
jointable?: string jointable?: string
addall?: boolean
filter?: any
resultjoin?: string[] resultjoin?: string[]
visuonlyEditVal?: boolean visuonlyEditVal?: boolean
noshowifnone?: boolean
notShowInNewRec?: boolean notShowInNewRec?: boolean
tablesel?: string tablesel?: string
} }

View File

@@ -65,6 +65,9 @@ function AddCol(params: IColGridTable) {
askaction: (params.askaction === undefined) ? '' : params.askaction, askaction: (params.askaction === undefined) ? '' : params.askaction,
tablesel: (params.tablesel === undefined) ? '' : params.tablesel, tablesel: (params.tablesel === undefined) ? '' : params.tablesel,
jointable: (params.jointable === undefined) ? '' : params.jointable, jointable: (params.jointable === undefined) ? '' : params.jointable,
addall: (params.addall === undefined) ? false : params.addall,
filter: (params.filter === undefined) ? null : params.filter,
noshowifnone: (params.noshowifnone === undefined) ? false : params.noshowifnone,
notShowInNewRec: (params.notShowInNewRec === undefined) ? false : params.notShowInNewRec, notShowInNewRec: (params.notShowInNewRec === undefined) ? false : params.notShowInNewRec,
} }
} }
@@ -426,18 +429,21 @@ export const colmySkills = [
fieldtype: costanti.FieldType.star5, fieldtype: costanti.FieldType.star5,
required: true, required: true,
jointable: 'levels', jointable: 'levels',
noshowifnone: true,
}), }),
AddCol({ AddCol({
name: 'idStatusSkill', name: 'idStatusSkill',
label_trans: 'statusSkill.name', label_trans: 'statusSkill.name',
fieldtype: costanti.FieldType.multiselect, fieldtype: costanti.FieldType.multiselect,
jointable: 'statusSkills', jointable: 'statusSkills',
noshowifnone: true,
}), }),
AddCol({ AddCol({
name: 'idContribType', name: 'idContribType',
label_trans: 'contribtype.name', label_trans: 'contribtype.name',
fieldtype: costanti.FieldType.multiselect, fieldtype: costanti.FieldType.multiselect,
jointable: 'contribtypes', jointable: 'contribtypes',
noshowifnone: true,
}), }),
AddCol({ AddCol({
name: 'idCity', name: 'idCity',
@@ -451,9 +457,10 @@ export const colmySkills = [
label_trans: 'skill.photos', label_trans: 'skill.photos',
fieldtype: costanti.FieldType.listimages, fieldtype: costanti.FieldType.listimages,
jointable: '', jointable: '',
noshowifnone: true,
}), }),
AddCol({ name: 'subTitle', label_trans: 'skill.note', fieldtype: costanti.FieldType.string }), AddCol({ name: 'subTitle', label_trans: 'skill.note', fieldtype: costanti.FieldType.string }),
AddCol({ name: 'note', label_trans: 'proj.longdescr', fieldtype: costanti.FieldType.html }), AddCol({ name: 'note', label_trans: 'proj.longdescr', fieldtype: costanti.FieldType.html, noshowifnone: true }),
AddCol(DuplicateRec), AddCol(DuplicateRec),
AddCol(ModifRec), AddCol(ModifRec),
AddCol(DeleteRec), AddCol(DeleteRec),