Aggiunta del Bottone "Aggiungi"

This commit is contained in:
Surya Paolo
2022-12-01 21:44:33 +01:00
parent bf1e9fc982
commit 07f5f1c4c9
14 changed files with 864 additions and 550 deletions

View File

@@ -8,8 +8,6 @@
<!--<CPreloadImages :arrimg="static_data.preLoadImages">
</CPreloadImages>-->
<app-footer></app-footer>
<q-page-container id="mypage" :class="(darkcookie && !finishLoading) ? `bg-black`: ``">
<div v-if="finishLoading">
<CFirstPageApp></CFirstPageApp>
@@ -22,6 +20,9 @@
</q-spinner-tail>
</q-inner-loading>
</q-page-container>
<app-footer></app-footer>
</q-layout>
</div>
<BannerCookies urlInfo="/policy"></BannerCookies>

View File

@@ -49,13 +49,15 @@
.barselection {
padding: 0;
flex-wrap: nowrap;
display: flex;
align-items: center;
justify-content: space-around;
justify-content: space-between;
}
.myitem {
padding: 0px 6px 0px 6px !important;
padding: 0px 0px 0px 0px !important;
}
.myitem-0 {
@@ -68,5 +70,9 @@
}
.myitem-2 {
flex-grow: 0;
}
.myitem-3 {
flex-grow: 1;
}

View File

@@ -39,6 +39,7 @@ import { CMyCardPopup } from '@/components/CMyCardPopup'
import { CMyCardGrpPopup } from '@/components/CMyCardGrpPopup'
import { CMyCardCircuitPopup } from '@/components/CMyCardCircuitPopup'
import { useRouter } from 'vue-router'
import { table } from 'console'
export default defineComponent({
name: 'CBarSelection',
@@ -276,7 +277,7 @@ export default defineComponent({
}
function visButtRow() {
return false
return true
}
function gotoPageSel() {
@@ -286,6 +287,10 @@ export default defineComponent({
}
}
function createNewRecordDialog() {
globalStore.addNewRecord = tablesel.value
}
created()
onMounted(mounted)
@@ -329,6 +334,7 @@ export default defineComponent({
optionsMainCards,
tablesel,
gotoPageSel,
createNewRecordDialog,
}
}
})

View File

@@ -6,204 +6,195 @@
<div
class="centermydiv q-mx-sm"
:style="`text-align: center; background-color: ${mycolor}`"
>
<q-btn
v-if="table && visButtRow()"
rounded
dense
color="primary"
size="lg"
:label="getlabelAddRow()"
@click="createNewRecordDialog"
></q-btn>
</div>
></div>
<div>
<div v-if="prop_search || canEdit" class="q-my-xs text-right">
<q-btn
size="sm"
dense
icon="fas fa-filter"
:label="!showfilter ? $t('grid.showfilters') : $t('grid.hidefilters')"
:label="$t('grid.showfilters')"
@click="showfilter = !showfilter"
></q-btn>
</div>
<q-slide-transition>
<div v-show="true">
<div v-show="searchList" class="barselection">
<div class="myitem myitem-0">
<q-icon :name="myicon" size="xs" />
</div>
<div class="myitem myitem-1 mybanner">
<q-select
filled
v-model="tablesel"
:options="optionsMainCards"
emit-value
borderless
map-options
behavior="menu"
@update:model-value="gotoPageSel"
>
<template v-slot:option="scope">
<q-item v-bind="scope.itemProps">
<q-item-section avatar>
<q-icon :name="scope.opt.icon" />
</q-item-section>
<q-item-section>
<q-item-label>{{ scope.opt.label }}</q-item-label>
<!--<q-item-label caption>{{
<div class="row no-wrap shadow-1">
<q-header elevated>
<q-toolbar class="glossy" style="">
<div class="col-3">
<q-select
v-model="tablesel"
:options="optionsMainCards"
emit-value
borderless
map-options
behavior="menu"
@update:model-value="gotoPageSel"
>
<template v-slot:option="scope">
<q-item v-bind="scope.itemProps">
<q-item-section avatar>
<q-icon :name="scope.opt.icon" />
</q-item-section>
<q-item-section>
<q-item-label>{{ scope.opt.label }}</q-item-label>
<!--<q-item-label caption>{{
scope.opt.description
}}</q-item-label>-->
</q-item-section>
</q-item>
</template>
</q-select>
</div>
</q-item-section>
</q-item>
</template>
</q-select>
</div>
<q-space />
<q-btn
<div
class="myitem myitem-2"
v-for="(item, index) in searchList"
:key="index"
>
<CMySelect
:col="fieldsTable.getColByColumns(mycolumns, item.key)"
v-if="
item.type === costanti.FieldType.select ||
item.type === costanti.FieldType.select_by_server
"
:label="labelcombo(item)"
v-model:value="item.value"
@update:value="searchval(item.value, item.table)"
:addall="item.addall"
:addnone="item.addnone"
:addlast="true"
:tablesel="
item.type === costanti.FieldType.select_by_server
? item.tablesel
: ''
"
:pickup="item.type === costanti.FieldType.select_by_server"
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)"
:filter="item.filter"
:filter_extra="item.filter_extra"
:useinput="
item.useinput &&
item.type !== costanti.FieldType.select_by_server
"
size="sm"
class="col-1 q-mx-xs"
icon="fas fa-plus"
@click="createNewRecordDialog"
>
</CMySelect>
</q-btn>
<div class="col" v-for="(item, index) in searchList" :key="index">
<CMySelect
:col="fieldsTable.getColByColumns(mycolumns, item.key)"
v-if="
item.type === costanti.FieldType.select ||
item.type === costanti.FieldType.select_by_server
"
:label="item.value ? '' : labelcombo(item)"
v-model:value="item.value"
@update:value="searchval(item.value, item.table)"
:addall="item.addall"
:addnone="item.addnone"
:addlast="true"
:tablesel="
item.type === costanti.FieldType.select_by_server
? item.tablesel
: ''
"
:pickup="item.type === costanti.FieldType.select_by_server"
label-color="white"
class="combowidth"
color="primary"
:icon_alternative="item.icon"
:optval="fieldsTable.getKeyByTable(item.table)"
:optlab="fieldsTable.getLabelByTable(item.table)"
:options="valoriopt(item, false)"
:filter="item.filter"
:filter_extra="item.filter_extra"
:useinput="
item.useinput &&
item.type !== costanti.FieldType.select_by_server
"
>
</CMySelect>
<!--<div v-if="item.type === costanti.FieldType.multiselect_by_server">
<!--<div v-if="item.type === costanti.FieldType.multiselect_by_server">
item: {{ item}}
</div>-->
<CMySelect
v-if="item.type === costanti.FieldType.multiselect_by_server"
:col="fieldsTable.getColByColumns(mycolumns, item.key)"
:multiselect_by_server="true"
:label="labelcombo(item)"
v-model:arrvalue="item.arrvalue"
@update:arrvalue="searchval(item.arrvalue, item.table)"
:addall="item.addall"
:addnone="item.addnone"
:addlast="true"
:tablesel="item.tablesel"
:pickup="true"
:param1="item.param1"
label-color="primary"
class="combowidth"
color="primary"
:icon_alternative="item.icon"
:optval="fieldsTable.getKeyByTable(item.table)"
:optlab="fieldsTable.getLabelByTable(item.table)"
:filter="item.filter"
:filter_extra="item.filter_extra"
:options="valoriopt(item, false)"
:useinput="true"
>
</CMySelect>
<CMySelect
v-if="item.type === costanti.FieldType.multiselect_by_server"
:col="fieldsTable.getColByColumns(mycolumns, item.key)"
:multiselect_by_server="true"
:label="labelcombo(item)"
v-model:arrvalue="item.arrvalue"
@update:arrvalue="searchval(item.arrvalue, item.table)"
:addall="item.addall"
:addnone="item.addnone"
:addlast="true"
:tablesel="item.tablesel"
:pickup="true"
:param1="item.param1"
label-color="primary"
class="combowidth"
color="primary"
:icon_alternative="item.icon"
:optval="fieldsTable.getKeyByTable(item.table)"
:optlab="fieldsTable.getLabelByTable(item.table)"
:filter="item.filter"
:filter_extra="item.filter_extra"
:options="valoriopt(item, false)"
:useinput="true"
>
</CMySelect>
<q-select
v-if="item.type === costanti.FieldType.multiselect"
v-model="item.arrvalue"
label-color="primary"
:label="labelcombo(item)"
@update:model-value="searchval(item.arrvalue, item.table)"
rounded
dense
outlined
multiple
options-dense
emit-value
map-options
stack-label
:useinput="item.useinput"
:options="valoriopt(item, item.addall, item.addnone)"
:filter="item.filter"
class="combowidth"
: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"
<q-select
v-if="item.type === costanti.FieldType.multiselect"
v-model="item.arrvalue"
label-color="primary"
:label="labelcombo(item)"
@update:model-value="searchval(item.arrvalue, item.table)"
rounded
dense
outlined
multiple
options-dense
emit-value
map-options
:useinput="item.useinput"
:options="valoriopt(item, item.addall, item.addnone)"
:filter="item.filter"
class="combowidth"
:option-value="fieldsTable.getKeyByTable(item.table)"
>
<div
v-if="
scope.opt[fieldsTable.getLabelByTable(item.table)] ||
(scope.opt && checkIfShowRec(scope.opt))
"
<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"
>
<q-chip
removable
dense
@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="item.icon"
size="12px"
/>
{{
<div
v-if="
scope.opt[fieldsTable.getLabelByTable(item.table)] ||
scope.opt
}}
</q-chip>
</div>
</template>
<template
v-slot:option="{ itemProps, opt, selected, toggleOption }"
>
<q-item v-bind="itemProps">
<q-item-section>
<q-item-label>{{
opt[fieldsTable.getLabelByTable(item.table)]
}}</q-item-label>
</q-item-section>
<q-item-section side>
<q-toggle
:model-value="selected"
@update:model-value="toggleOption(opt)"
/>
</q-item-section>
</q-item>
</template>
</q-select>
</div>
</div>
(scope.opt && checkIfShowRec(scope.opt))
"
>
<q-chip
removable
dense
@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="item.icon"
size="12px"
/>
{{
scope.opt[fieldsTable.getLabelByTable(item.table)] ||
scope.opt
}}
</q-chip>
</div>
</template>
<template
v-slot:option="{ itemProps, opt, selected, toggleOption }"
>
<q-item v-bind="itemProps">
<q-item-section>
<q-item-label>{{
opt[fieldsTable.getLabelByTable(item.table)]
}}</q-item-label>
</q-item-section>
<q-item-section side>
<q-toggle
:model-value="selected"
@update:model-value="toggleOption(opt)"
/>
</q-item-section>
</q-item>
</template>
</q-select>
</div>
</q-toolbar>
</q-header>
</div>
</q-slide-transition>

View File

@@ -55,10 +55,6 @@ export default defineComponent({
const globalStore = useGlobalStore()
const userStore = useUserStore()
const myselector = ref({})
provide('myselector', myselector)
const arrfilterand: any = ref([])
const filtercustom: any = ref([])
const searchList_Servizi = ref(<ISearchList[]>[])

View File

@@ -49,7 +49,6 @@
:nodataLabel="noMsgRecord"
:prop_search="true"
:finder="true"
:labelBtnAddExtra="noButtAdd ? `` : `Aggiungi ${strextra}`"
:choose_visutype="visuType"
:butt_modif_new="true && !noButtAdd"
noresultLabel="Il filtro selezionato non ha trovato nessun risultato"
@@ -58,11 +57,14 @@
:prop_searchList="searchList"
:defaultnewrec="getdefaultnewrec"
:selector="selector"
labelBtnAddRow="NONE"
:labelBtnAddExtra="noButtAdd ? `` : ``"
:extraparams="extraparams()"
>
</CGridTableRec>
</div>
<q-page-scroller
position="bottom-right"
:scroll-offset="850"

View File

@@ -326,8 +326,6 @@ export default defineComponent({
const myvertical = ref(props.vertical)
//const myselector = inject('myselector', {})
const myselector = computed(() => globalStore.myselector)
const valoriopt = computed(() => (item: any, addall: boolean, addnone: boolean) => {
// console.log('valoriopt', item.table)
@@ -341,9 +339,16 @@ export default defineComponent({
return lab
})
watch(() => globalStore.addNewRecord, (value: any, oldval: any) => {
if (globalStore.addNewRecord === props.prop_mytable) {
createNewRecordDialog()
globalStore.addNewRecord = ''
}
})
watch(() => globalStore.myselector, (value: any, oldval: any) => {
console.log('******* CGRIDTABLEREC : globalStore.myselector', globalStore.myselector)
console.log(' . value', value)
// console.log('******* CGRIDTABLEREC : globalStore.myselector', globalStore.myselector)
// console.log(' . value', value)
const rec = searchList.value.find((myrec) => myrec.table === globalStore.myselector.table) // check if exist
if (rec) {
rec.value = globalStore.myselector.data
@@ -1854,7 +1859,7 @@ export default defineComponent({
}
function visButtRow() {
return props.labelBtnAddRow !== addRow.value
return (props.labelBtnAddRow !== addRow.value) && props.labelBtnAddRow !== 'NONE'
}
function checkIfShowRec(rec: any) {
@@ -2108,7 +2113,6 @@ export default defineComponent({
myinfscroll,
t,
exportTable,
myselector,
}
}
})

File diff suppressed because it is too large Load Diff

View File

@@ -15,7 +15,7 @@
multiple
options-dense
map-options
stack-label
:stack-label="label ? true : false"
emit-value
:readonly="sola_lettura"
:use-input="useinput"

View File

@@ -1,61 +1,67 @@
<template>
<q-footer
v-if="tools.isUserOk() && site && site.confpages"
:class="($q.dark.isActive ? `bg-black` : `bg-white`) + ` small-screen-only`"
bordered
>
<q-tabs
dense
:class="($q.dark.isActive ? `text-white bg-black` : `text-grey-10 bg-white`) + ` mylabfooter mysmalltabs`"
style="padding: 0px !important;"
content-class="mysmalltabs"
:active-color="$q.dark.isActive ? `primary`: `primary`"
no-caps
indicator-color="transparent"
>
<q-route-tab
v-if="site.confpages.showButtHome"
to="/"
class="mylabfooter"
:label="$t('tabdown.home')"
icon="fas fa-home"
/>
<q-route-tab
v-if="site.confpages.showViewGroups"
class="mylabfooter"
:label="$t('tabdown.groups')"
to="/groups"
icon="fas fa-users"
/>
<q-route-tab
v-if="site.confpages.showViewCircuits"
class="mylabfooter"
:label="$t('tabdown.circuits')"
to="/circuits"
icon="fas fa-coins"
/>
<q-route-tab
v-if="site.confpages.showViewUsers"
class="mylabfooter"
:label="$t('tabdown.friends')"
to="/friends"
icon="fas fa-user-friends"
/>
<q-route-tab
v-if="site.confpages.showViewBooking"
class="mylabfooter"
:label="$t('tabdown.bookings')"
to="/admin/eventlist"
icon="fas fa-calendar-plus"
/>
<q-route-tab
v-if="site.confpages.showViewProfile"
class="mylabfooter"
:label="$t('tabdown.profile')"
:to="`/my/`+getMyUsername()"
icon="person"
/>
</q-tabs>
v-if="tools.isUserOk() && site && site.confpages" :class="($q.dark.isActive
? `bg-black` : `bg-white`) + ` small-screen-only`" bordered >
<q-toolbar>
<q-toolbar-title>
<q-tabs
dense
:class="
($q.dark.isActive
? `text-white bg-black`
: `text-grey-10 bg-white`) + ` mylabfooter mysmalltabs`
"
style="padding: 0px !important"
content-class="mysmalltabs"
:active-color="$q.dark.isActive ? `primary` : `primary`"
no-caps
indicator-color="transparent"
>
<q-route-tab
v-if="site.confpages.showButtHome"
to="/"
class="mylabfooter"
:label="$t('tabdown.home')"
icon="fas fa-home"
/>
<q-route-tab
v-if="site.confpages.showViewGroups"
class="mylabfooter"
:label="$t('tabdown.groups')"
to="/groups"
icon="fas fa-users"
/>
<q-route-tab
v-if="site.confpages.showViewCircuits"
class="mylabfooter"
:label="$t('tabdown.circuits')"
to="/circuits"
icon="fas fa-coins"
/>
<q-route-tab
v-if="site.confpages.showViewUsers"
class="mylabfooter"
:label="$t('tabdown.friends')"
to="/friends"
icon="fas fa-user-friends"
/>
<q-route-tab
v-if="site.confpages.showViewBooking"
class="mylabfooter"
:label="$t('tabdown.bookings')"
to="/admin/eventlist"
icon="fas fa-calendar-plus"
/>
<q-route-tab
v-if="site.confpages.showViewProfile"
class="mylabfooter"
:label="$t('tabdown.profile')"
:to="`/my/` + getMyUsername()"
icon="person"
/>
</q-tabs>
</q-toolbar-title>
</q-toolbar>
</q-footer>
</template>

View File

@@ -449,6 +449,7 @@ export interface IGlobalState {
selElem?: IMyElem,
editOn?: boolean,
myselector: ISelector,
addNewRecord: string,
}
export interface IMenuList {

View File

@@ -8,7 +8,6 @@
<CFinder
:ind="1"
:table="toolsext.TABMYSKILLS"
:selector="myselector"
/>
<!--<CDashboard></CDashboard>-->

View File

@@ -20,7 +20,7 @@ const msg_it = {
columns: 'Colonne',
tableslist: 'Tabelle',
nodata: 'Nessun Dato',
showfilters: 'Mostra Filtri',
showfilters: 'Filtri',
hidefilters: 'Nascondi Filtri',
},
gallery: {

View File

@@ -178,7 +178,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
mygroups: [],
selElem: {},
editOn: false,
myselector: { data: {}, table: ''}
myselector: { data: {}, table: ''},
addNewRecord: '',
}),
getters: {