Se aggiungo un campo nuovo, non viene visualizzato il campo, sistemare il cookie come viene gestito
Aggiungere campo Offro/Cerco Aggiungere HOME con pulsantoni grandi Aggiunto Link per condividere la APP ai propri Amici
This commit is contained in:
0
src/components/CBigBtn/CBigBtn.scss
Executable file
0
src/components/CBigBtn/CBigBtn.scss
Executable file
45
src/components/CBigBtn/CBigBtn.ts
Executable file
45
src/components/CBigBtn/CBigBtn.ts
Executable file
@@ -0,0 +1,45 @@
|
||||
import { defineComponent, ref, computed, PropType, toRef } from 'vue'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CBigBtn',
|
||||
components: {},
|
||||
props: {
|
||||
label: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
to: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: ''
|
||||
},
|
||||
icon: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: ''
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: 'grey'
|
||||
},
|
||||
},
|
||||
setup(props, { emit }) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
const $router = useRouter()
|
||||
const globalStore = useGlobalStore()
|
||||
const { t } = useI18n();
|
||||
|
||||
return {
|
||||
userStore,
|
||||
tools,
|
||||
}
|
||||
}
|
||||
})
|
||||
17
src/components/CBigBtn/CBigBtn.vue
Executable file
17
src/components/CBigBtn/CBigBtn.vue
Executable file
@@ -0,0 +1,17 @@
|
||||
<template>
|
||||
<div class="q-pa-xs col-xs-6 col-sm-6 col-md-4 col-lg-2">
|
||||
<div class="q-ma-sm">
|
||||
<q-btn :color="color" rounded :to="to" v-bind="$attrs">
|
||||
<q-icon class="q-ma-sm" size="4em" :name="icon"/>
|
||||
<div class="q-ma-sm text-h5">{{ label }}</div>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CBigBtn.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CBigBtn.scss';
|
||||
</style>
|
||||
1
src/components/CBigBtn/index.ts
Executable file
1
src/components/CBigBtn/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export {default as CBigBtn} from './CBigBtn.vue'
|
||||
@@ -343,7 +343,7 @@
|
||||
</q-form>
|
||||
</q-card-section>
|
||||
<q-card-actions align="right">
|
||||
<q-btn flat :label="$t('dialog.ok')" color="primary" @click="saveEvent"></q-btn>
|
||||
<q-btn :label="$t('dialog.ok')" color="primary" @click="saveEvent"></q-btn>
|
||||
<q-btn flat :label="$t('dialog.cancel')" color="primary" v-close-popup></q-btn>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
|
||||
@@ -252,6 +252,7 @@ export default defineComponent({
|
||||
let returnedData: any = ref([])
|
||||
let returnedCount = 0
|
||||
const colVisib: any = ref([])
|
||||
const colNotVisib: any = ref([])
|
||||
const colExtra: any = ref([])
|
||||
|
||||
const rowclicksel = ref(<any>null)
|
||||
@@ -816,6 +817,7 @@ export default defineComponent({
|
||||
// console.log('updatedcol')
|
||||
if (mycolumns.value) {
|
||||
colVisib.value = []
|
||||
colNotVisib.value = []
|
||||
colExtra.value = []
|
||||
mycolumns.value.forEach((elem: IColGridTable) => {
|
||||
|
||||
@@ -824,6 +826,8 @@ export default defineComponent({
|
||||
if (elem.field !== costanti.NOFIELD) {
|
||||
if (checkIfColShow(elem.field)) {
|
||||
colVisib.value.push(elem.field + mysub)
|
||||
} else {
|
||||
colNotVisib.value.push(elem.field + mysub)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1041,7 +1045,23 @@ export default defineComponent({
|
||||
function changeCol(newval: any) {
|
||||
// console.log('changecol', mytable.value)
|
||||
if (!!mytable.value) {
|
||||
tools.setCookie(mytable.value, colVisib.value.join('|'))
|
||||
let arrcol = []
|
||||
let col: IColGridTable = {name: ''}
|
||||
for (col of mycolumns.value) {
|
||||
if (col.field !== costanti.NOFIELD) {
|
||||
let obj = {
|
||||
n: col.field + (col.subfield ? col.subfield : ''),
|
||||
v: 0
|
||||
}
|
||||
obj.v = colVisib.value.includes(obj.n) ? 1 : 0
|
||||
if (obj.v === 0) {
|
||||
// scrive solo quelli da nascondere !
|
||||
arrcol.push(obj.n + ',' + obj.v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tools.setCookie(mytable.value + '_', arrcol.join('|'))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1100,17 +1120,46 @@ export default defineComponent({
|
||||
updatedcol()
|
||||
|
||||
if (!!mytable.value) {
|
||||
const myselcol = tools.getCookie(mytable.value, '')
|
||||
// Leggi la lista delle colonne visibili:
|
||||
const myselcol = tools.getCookie(mytable.value + '_', '')
|
||||
|
||||
colVisib.value = []
|
||||
|
||||
let elem: IColGridTable
|
||||
for (elem of mycolumns.value) {
|
||||
if (elem.field !== costanti.NOFIELD) {
|
||||
if (checkIfColShow(elem.field)) {
|
||||
colVisib.value.push(elem.field! + elem.subfield!)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!!myselcol && myselcol.length > 0) {
|
||||
colVisib.value = myselcol.split('|')
|
||||
} else {
|
||||
mycolumns.value.forEach((elem: any) => {
|
||||
if (elem.field !== costanti.NOFIELD) {
|
||||
if (checkIfColShow(elem.field)) {
|
||||
colVisib.value.push(elem.field + elem.subfield)
|
||||
const arrselcol = myselcol.split('|')
|
||||
|
||||
for (const col of arrselcol) {
|
||||
const arrv = col.split(',')
|
||||
if (arrv.length > 1) {
|
||||
let field = arrv[0]
|
||||
let visib = arrv[1]
|
||||
const rec = mycolumns.value.find((rec: any) => (rec.field + rec.subfield) === field)
|
||||
|
||||
|
||||
if (rec) {
|
||||
if (field) {
|
||||
if (visib === '1') {
|
||||
if (!colVisib.value.includes(field))
|
||||
colVisib.value.push(field) // se non incluso allora lo aggiungi
|
||||
} else if (visib === '0') {
|
||||
// Se da togliere, lo togli
|
||||
if (colVisib.value.includes(field))
|
||||
colVisib.value = colVisib.value.filter((rec: any) => rec !== field)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -349,7 +349,10 @@
|
||||
<q-card :class="props.selected ? 'bg-grey-2 my-card-withshadow no-padding' : 'my-card-withshadow no-padding'"
|
||||
style="background: radial-gradient(circle, #ffffff 0%, #bbddff 100%)">
|
||||
<q-bar v-if="!visuinpage && canModifyThisRec(props.row)" dense class="bg-primary text-white full-height">
|
||||
<span v-if="props.row['username']">{{props.row['username']}}</span>
|
||||
<q-badge v-if="props.row['adType']" :color="props.row['adType'] === 1 ? 'green' : 'red'">
|
||||
{{ fieldsTable.getValByTabAndId(tablesel, 'adType', props.row['adType']) }}<q-icon :name="props.row['adType'] === 1 ? 'fas fa-street-view' : 'fas fa-search'" color="white" class="q-ml-xs" />
|
||||
</q-badge>
|
||||
|
||||
<q-space/>
|
||||
|
||||
<q-btn
|
||||
@@ -464,7 +467,7 @@
|
||||
<div
|
||||
v-for="col in mycolumns" :key="col.name" class="newrec_fields">
|
||||
<div
|
||||
v-if="showColCheck(col, tools.TIPOVIS_NEW_RECORD, true, 0, newRecord) && col.foredit">
|
||||
v-if="showColCheck(col, tools.TIPOVIS_NEW_RECORD, true, 0, newRecord) && col.foredit ">
|
||||
<div class="">
|
||||
<CMyPopupEdit
|
||||
:table="mytable"
|
||||
@@ -490,7 +493,7 @@
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-card-actions align="center">
|
||||
<q-btn flat :label="$t('dialog.ok')" color="primary" @click="saveNewRecord"></q-btn>
|
||||
<q-btn :label="$t('dialog.ok')" color="primary" @click="saveNewRecord"></q-btn>
|
||||
<q-btn flat :label="$t('dialog.cancel')" color="primary" v-close-popup @click="annulla"></q-btn>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
@@ -530,7 +533,7 @@
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-card-actions align="center">
|
||||
<q-btn flat :label="$t('dialog.ok')" color="primary" @click="saverecModif"></q-btn>
|
||||
<q-btn :label="$t('dialog.ok')" color="primary" @click="saverecModif"></q-btn>
|
||||
<q-btn flat :label="$t('dialog.cancel')" color="primary" @click="cancelrecModif"></q-btn>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
|
||||
0
src/components/CMainView/CMainView.scss
Executable file
0
src/components/CMainView/CMainView.scss
Executable file
26
src/components/CMainView/CMainView.ts
Executable file
26
src/components/CMainView/CMainView.ts
Executable file
@@ -0,0 +1,26 @@
|
||||
import { defineComponent, ref, computed, PropType, toRef } from 'vue'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { CBigBtn } from '@/components/CBigBtn'
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMainView',
|
||||
components: { CBigBtn },
|
||||
props: {},
|
||||
setup(props, { emit }) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
const $router = useRouter()
|
||||
const globalStore = useGlobalStore()
|
||||
const { t } = useI18n()
|
||||
|
||||
return {
|
||||
userStore,
|
||||
tools,
|
||||
}
|
||||
}
|
||||
})
|
||||
34
src/components/CMainView/CMainView.vue
Executable file
34
src/components/CMainView/CMainView.vue
Executable file
@@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="row q-ma-sm shadow" style="border-radius: 4px;border: 1px solid rgba(0, 0, 0, 0.12);">
|
||||
<CBigBtn
|
||||
label="Lavoro" to="/work" icon="fas fa-bullhorn" color="blue">
|
||||
</CBigBtn>
|
||||
<CBigBtn
|
||||
label="Scuola" to="/school" icon="fas fa-book-reader" color="orange" disable>
|
||||
</CBigBtn>
|
||||
<CBigBtn
|
||||
label="Luoghi" to="/places" icon="fas fa-map-marker-alt" color="blue-grey" disable>
|
||||
</CBigBtn>
|
||||
<CBigBtn
|
||||
label="Mobilità" to="/mobility" icon="fas fa-car-side" color="red" disable>
|
||||
</CBigBtn>
|
||||
<CBigBtn
|
||||
label="Alimentari" to="/grocery" icon="fas fa-utensils" color="green" disable>
|
||||
</CBigBtn>
|
||||
<CBigBtn
|
||||
label="Socializza" to="/socialising" icon="fas fa-users" color="purple" disable>
|
||||
</CBigBtn>
|
||||
|
||||
</div>
|
||||
<div class="text-center">P.S: Attualmente è attivo solo il bottone <b>Lavoro</b>.<br>
|
||||
Gli altri verranno attivati nei prossimi giorni.</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CMainView.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CMainView.scss';
|
||||
</style>
|
||||
1
src/components/CMainView/index.ts
Executable file
1
src/components/CMainView/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export {default as CMainView} from './CMainView.vue'
|
||||
@@ -40,7 +40,7 @@
|
||||
</form>
|
||||
</q-card-section>
|
||||
<q-card-actions v-if="showButtons" align="center">
|
||||
<q-btn v-if="canModify" flat :label="$t('dialog.ok')" color="primary" @click="saveval"></q-btn>
|
||||
<q-btn v-if="canModify" :label="$t('dialog.ok')" color="primary" @click="saveval"></q-btn>
|
||||
<q-btn v-if="canModify" flat :label="$t('dialog.cancel')" color="primary" v-close-popup @click="annulla"></q-btn>
|
||||
<q-btn v-if="!canModify" :label="$t('dialog.ok')" color="primary" v-close-popup></q-btn>
|
||||
</q-card-actions>
|
||||
|
||||
@@ -705,6 +705,7 @@ export default defineComponent({
|
||||
noPopupeditByCol,
|
||||
getTitleEditor,
|
||||
getToByCol,
|
||||
t,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -417,9 +417,10 @@
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.html">
|
||||
<div v-if="isInModif">
|
||||
<p v-if="isInModif" class="text-center">
|
||||
{{ $t('event.testo_di_spiegazione') }}:
|
||||
</p>
|
||||
<q-bar v-if="isInModif" dense class="bg-primary text-white">
|
||||
<span v-if="col.label_trans">{{t(col.label_trans)}}</span><span v-else> {{ $t('event.testo_di_spiegazione') }}: </span>
|
||||
<q-space/>
|
||||
</q-bar>
|
||||
<div v-if="!isFieldDb()">
|
||||
<CMyEditor
|
||||
v-model:value="myvalue" :title="!isInModif ? getTitleEditor(col, row) : ''" @keyup.enter.stop
|
||||
|
||||
@@ -40,4 +40,6 @@ export * from './CVerifyTelegram'
|
||||
export * from './CMyFriends'
|
||||
export * from './CMyGroups'
|
||||
export * from './CDashboard'
|
||||
export * from './CMainView'
|
||||
export * from './CBigBtn'
|
||||
// export * from './CPreloadImages'
|
||||
|
||||
Reference in New Issue
Block a user