- Added TablesList page

- Added Insert Record empty
This commit is contained in:
Paolo Arena
2019-10-20 01:22:38 +02:00
parent 4a7c68fbd5
commit 313a7db77d
16 changed files with 292 additions and 148 deletions

View File

@@ -26,6 +26,7 @@ import router from '@router'
import { static_data } from '@src/db/static_data' import { static_data } from '@src/db/static_data'
import translate from '@src/globalroutines/util' import translate from '@src/globalroutines/util'
import { lists } from '../../store/Modules/lists' import { lists } from '../../store/Modules/lists'
import { GlobalStore } from '../../store/Modules'
@Component({ @Component({
name: 'CEventsCalendar', name: 'CEventsCalendar',
@@ -349,7 +350,7 @@ export default class CEventsCalendar extends Vue {
public getEndTime(eventparam) { public getEndTime(eventparam) {
let endTime = new Date(eventparam.date + ' ' + eventparam.time + ':00') let endTime = new Date(eventparam.date + ' ' + eventparam.time + ':00')
endTime = date.addToDate(endTime, { minutes: eventparam.duration }) endTime = date.addToDate(endTime, { minutes: eventparam.dur })
endTime = date.formatDate(endTime, 'HH:mm') endTime = date.formatDate(endTime, 'HH:mm')
return endTime return endTime
} }
@@ -394,7 +395,9 @@ export default class CEventsCalendar extends Vue {
public addBookEventMenu(eventparam) { public addBookEventMenu(eventparam) {
if (!UserStore.state.isLogged || !UserStore.state.verified_email) { if (!UserStore.state.isLogged || !UserStore.state.verified_email) {
this.$router.push('/signin') // Visu right Toolbar to make SignIn
GlobalStore.state.RightDrawerOpen = true
// this.$router.push('/signin')
} else { } else {
console.log('addBookEventMenu') console.log('addBookEventMenu')
this.resetForm() this.resetForm()
@@ -421,7 +424,7 @@ export default class CEventsCalendar extends Vue {
if (eventparam.time) { if (eventparam.time) {
timestamp = eventparam.date + ' ' + eventparam.time timestamp = eventparam.date + ' ' + eventparam.time
const startTime = new Date(timestamp) const startTime = new Date(timestamp)
const endTime = date.addToDate(startTime, { minutes: eventparam.duration }) const endTime = date.addToDate(startTime, { minutes: eventparam.dur })
this.eventForm.dateTimeStart = this.formatDate(startTime) + ' ' + this.formatTime(startTime) // endTime.toString() this.eventForm.dateTimeStart = this.formatDate(startTime) + ' ' + this.formatTime(startTime) // endTime.toString()
this.eventForm.dateTimeEnd = this.formatDate(endTime) + ' ' + this.formatTime(endTime) // endTime.toString() this.eventForm.dateTimeEnd = this.formatDate(endTime) + ' ' + this.formatTime(endTime) // endTime.toString()
} else { } else {
@@ -513,8 +516,8 @@ export default class CEventsCalendar extends Vue {
} }
const data: IEvents = { const data: IEvents = {
time: '', time: '',
duration: 0, dur: 0,
duration2: 0, dur2: 0,
title: form.title, title: form.title,
details: form.details, details: form.details,
icon: form.icon, icon: form.icon,
@@ -524,7 +527,7 @@ export default class CEventsCalendar extends Vue {
if (form.allDay === false) { if (form.allDay === false) {
// get time into separate var // get time into separate var
data.time = String(form.dateTimeStart).slice(11, 16) data.time = String(form.dateTimeStart).slice(11, 16)
data.duration = self.getDuration(form.dateTimeStart, form.dateTimeEnd, 'minutes') data.dur = self.getDuration(form.dateTimeStart, form.dateTimeEnd, 'minutes')
} }
if (update === true) { if (update === true) {
const index = self.findEventIndex(self.contextDay) const index = self.findEventIndex(self.contextDay)
@@ -648,7 +651,7 @@ export default class CEventsCalendar extends Vue {
public handleSwipe({ evt, ...info }) { public handleSwipe({ evt, ...info }) {
if (this.dragging === false) { if (this.dragging === false) {
if (info.duration >= 30 && this.ignoreNextSwipe === false) { if (info.dur >= 30 && this.ignoreNextSwipe === false) {
if (info.direction === 'right') { if (info.direction === 'right') {
this.calendarPrev() this.calendarPrev()
} else if (info.direction === 'left') { } else if (info.direction === 'left') {
@@ -743,7 +746,7 @@ export default class CEventsCalendar extends Vue {
s.top = timeStartPos(eventparam.time) + 'px' s.top = timeStartPos(eventparam.time) + 'px'
} }
if (timeDurationHeight) { if (timeDurationHeight) {
s.height = timeDurationHeight(eventparam.duration) + 'px' s.height = timeDurationHeight(eventparam.dur) + 'px'
} }
s['align-items'] = 'flex-start' s['align-items'] = 'flex-start'
return s return s
@@ -804,10 +807,10 @@ export default class CEventsCalendar extends Vue {
if (eventsloc.length > 0) { if (eventsloc.length > 0) {
// check for overlapping times // check for overlapping times
const startTime = new Date(CalendarStore.state.eventlist[i].date + ' ' + CalendarStore.state.eventlist[i].time) const startTime = new Date(CalendarStore.state.eventlist[i].date + ' ' + CalendarStore.state.eventlist[i].time)
const endTime = date.addToDate(startTime, { minutes: CalendarStore.state.eventlist[i].duration }) const endTime = date.addToDate(startTime, { minutes: CalendarStore.state.eventlist[i].dur })
for (let j = 0; j < eventsloc.length; ++j) { for (let j = 0; j < eventsloc.length; ++j) {
const startTime2 = new Date(eventsloc[j].date + ' ' + eventsloc[j].time) const startTime2 = new Date(eventsloc[j].date + ' ' + eventsloc[j].time)
const endTime2 = date.addToDate(startTime2, { minutes: eventsloc[j].duration2 }) const endTime2 = date.addToDate(startTime2, { minutes: eventsloc[j].dur2 })
if (date.isBetweenDates(startTime, startTime2, endTime2) || date.isBetweenDates(endTime, startTime2, endTime2)) { if (date.isBetweenDates(startTime, startTime2, endTime2) || date.isBetweenDates(endTime, startTime2, endTime2)) {
eventsloc[j].side = 'left' eventsloc[j].side = 'left'
// CalendarStore.state.eventlist[i].side = 'right' // CalendarStore.state.eventlist[i].side = 'right'

View File

@@ -1,10 +1,5 @@
$t('
<template> <template>
<div class="landing"> <div class="landing">
<CTitle imgbackground="../../statics/images/calendario_eventi.jpg"
headtitle="Calendario Eventi" sizes="max-height: 120px"></CTitle>
<q-page class="column"> <q-page class="column">
<!-- display an myevent --> <!-- display an myevent -->
<q-dialog v-model="displayEvent"> <q-dialog v-model="displayEvent">
@@ -469,7 +464,7 @@ $t('
<div v-if="event.date" class="listaev__date"> <div v-if="event.date" class="listaev__date">
{{func_tools.getDateStr(event.date)}} {{func_tools.getDateStr(event.date)}}
<span v-if="event.time" class="cal__hours-content"> - {{ event.time }} <span <span v-if="event.time" class="cal__hours-content"> - {{ event.time }} <span
v-if="event.duration">- {{ getEndTime(event) }}</span></span> v-if="event.dur">- {{ getEndTime(event) }}</span></span>
<span v-if="event.days > 1"><br/>{{func_tools.getDateStr(tools.addDays(event.date, event.days - 1))}}</span> <span v-if="event.days > 1"><br/>{{func_tools.getDateStr(tools.addDays(event.date, event.days - 1))}}</span>
</div> </div>
</div> </div>

View File

@@ -5,19 +5,28 @@ import { GlobalStore, UserStore } from '../../store/Modules/index'
import { tools } from '../../store/Modules/tools' import { tools } from '../../store/Modules/tools'
import { shared_consts } from '../../common/shared_vuejs' import { shared_consts } from '../../common/shared_vuejs'
import { ICategory, IColGridTable } from '../../model' import { ICategory, IColGridTable, ITableRec } from '../../model'
import { CTodo } from '../todos/CTodo' import { CTodo } from '../todos/CTodo'
import { SingleProject } from '../projects/SingleProject' import { SingleProject } from '../projects/SingleProject'
import { lists } from '../../store/Modules/lists' import { lists } from '../../store/Modules/lists'
@Component({}) @Component({})
export default class CGridTableRec extends Vue { export default class CGridTableRec extends Vue {
@Prop({ required: true }) public mytable: string @Prop({ required: false }) public prop_mytable: string
@Prop({ required: true }) public mytitle: string @Prop({ required: true }) public prop_mytitle: string
@Prop({ required: true }) public mycolumns: any[] @Prop({ required: false, default: [] }) public prop_mycolumns: any[]
@Prop({ required: true }) public colkey: string @Prop({ required: false, default: '' }) public prop_colkey: string
@Prop({ required: false, default: '' }) public nodataLabel: string @Prop({ required: false, default: '' }) public nodataLabel: string
@Prop({ required: false, default: '' }) public noresultLabel: string @Prop({ required: false, default: '' }) public noresultLabel: string
@Prop({ required: false, default: null }) public tablesList: ITableRec[]
public mytable: string
public mytitle: string
public mycolumns: any[]
public colkey: string
public tablesel: string = ''
public $q public $q
public $t public $t
public loading: boolean = false public loading: boolean = false
@@ -30,6 +39,7 @@ export default class CGridTableRec extends Vue {
} = { sortBy: '', descending: false, page: 1, rowsNumber: 10, rowsPerPage: 10 } } = { sortBy: '', descending: false, page: 1, rowsNumber: 10, rowsPerPage: 10 }
public serverData: any [] = [] public serverData: any [] = []
public spinner_visible: boolean = false
public idsel: string = '' public idsel: string = ''
public colsel: string = '' public colsel: string = ''
@@ -61,11 +71,11 @@ export default class CGridTableRec extends Vue {
} }
public selItem(item, colsel) { public selItem(item, colsel) {
console.log('item', item) // console.log('item', item)
this.selected = item this.selected = item
this.idsel = item._id this.idsel = item._id
this.colsel = colsel this.colsel = colsel
console.log('this.idsel', this.idsel) // console.log('this.idsel', this.idsel)
} }
public undoVal() { public undoVal() {
@@ -84,9 +94,7 @@ export default class CGridTableRec extends Vue {
// colkey: this.colkey, // colkey: this.colkey,
id: this.idsel, id: this.idsel,
table: this.mytable, table: this.mytable,
fieldsvalue: { fieldsvalue: {}
}
} }
mydata.fieldsvalue[this.colsel] = newVal mydata.fieldsvalue[this.colsel] = newVal
@@ -103,15 +111,28 @@ export default class CGridTableRec extends Vue {
public created() { public created() {
// this.serverData = this.mylist.slice() // [{ chiave: 'chiave1', valore: 'valore 1' }] // this.serverData = this.mylist.slice() // [{ chiave: 'chiave1', valore: 'valore 1' }]
this.mycolumns.forEach((elem) => {
if (elem.field !== '')
this.colVisib.push(elem.field)
if (elem.visible && elem.field === '') this.mytable = this.prop_mytable
this.colExtra.push(elem.name) this.mytitle = this.prop_mytitle
this.mycolumns = this.prop_mycolumns
this.colkey = this.prop_colkey
}) this.changeTable(false)
}
public updatedcol() {
if (this.mycolumns) {
this.colVisib = []
this.colExtra = []
this.mycolumns.forEach((elem) => {
if (elem.field !== '')
this.colVisib.push(elem.field)
if (elem.visible && elem.field === '')
this.colExtra.push(elem.name)
})
}
} }
get getrows() { get getrows() {
@@ -122,8 +143,13 @@ export default class CGridTableRec extends Vue {
const { page, rowsPerPage, rowsNumber, sortBy, descending } = props.pagination const { page, rowsPerPage, rowsNumber, sortBy, descending } = props.pagination
const filter = props.filter const filter = props.filter
if (!this.mytable)
return
this.loading = true this.loading = true
this.spinner_visible = true
// update rowsCount with appropriate value // update rowsCount with appropriate value
// get all rows if "All" (0) is selected // get all rows if "All" (0) is selected
@@ -133,13 +159,20 @@ export default class CGridTableRec extends Vue {
const startRow = (page - 1) * rowsPerPage const startRow = (page - 1) * rowsPerPage
const endRow = startRow + fetchCount const endRow = startRow + fetchCount
// fetch data from "server" // fetch data from "server"
this.fetchFromServer(startRow, endRow, filter, sortBy, descending).then((ris) => { this.fetchFromServer(startRow, endRow, filter, sortBy, descending).then((ris) => {
this.pagination.rowsNumber = this.getRowsNumberCount(filter) this.pagination.rowsNumber = this.getRowsNumberCount(filter)
// clear out existing data and add new // clear out existing data and add new
this.serverData.splice(0, this.serverData.length, ...this.returnedData) if (this.returnedData === []) {
this.serverData = []
} else {
if (this.serverData.length > 0)
this.serverData.splice(0, this.serverData.length, ...this.returnedData)
else
this.serverData = [...this.returnedData]
}
// don't forget to update local pagination object // don't forget to update local pagination object
this.pagination.page = page this.pagination.page = page
@@ -149,6 +182,7 @@ export default class CGridTableRec extends Vue {
// ...and turn of loading indicator // ...and turn of loading indicator
this.loading = false this.loading = false
this.spinner_visible = false
}) })
} }
@@ -174,8 +208,6 @@ export default class CGridTableRec extends Vue {
descending descending
} }
console.table(params)
const data = await GlobalStore.actions.loadTable(params) const data = await GlobalStore.actions.loadTable(params)
if (data) { if (data) {
@@ -186,7 +218,9 @@ export default class CGridTableRec extends Vue {
this.returnedCount = 0 this.returnedCount = 0
} }
// if (!filter) { return true
// if (!filter) {
// data = this.original.slice(startRow, startRow + count) // data = this.original.slice(startRow, startRow + count)
// } // }
// else { // else {
@@ -244,6 +278,21 @@ export default class CGridTableRec extends Vue {
return (col.disable || !this.canEdit) ? '' : 'colmodif' return (col.disable || !this.canEdit) ? '' : 'colmodif'
} }
public async createNewRecord() {
this.loading = true
const mydata = {
table: this.mytable,
data: {}
}
const data = await GlobalStore.actions.saveTable(mydata)
this.serverData.push(data)
this.pagination.rowsNumber++
this.loading = false
}
public saveFieldValue(mydata) { public saveFieldValue(mydata) {
console.log('saveFieldValue', mydata) console.log('saveFieldValue', mydata)
@@ -259,11 +308,11 @@ export default class CGridTableRec extends Vue {
} }
public mounted() { public mounted() {
this.mycolumns.forEach((rec: IColGridTable) => { this.changeTable(false)
if (rec.label_trans)
rec.label = this.$t(rec.label_trans)
})
}
public refresh() {
this.onRequest({ this.onRequest({
pagination: this.pagination, pagination: this.pagination,
filter: undefined filter: undefined
@@ -278,7 +327,8 @@ export default class CGridTableRec extends Vue {
public ActionAfterYes(action, item) { public ActionAfterYes(action, item) {
if (action === lists.MenuAction.DELETE_RECTABLE) { if (action === lists.MenuAction.DELETE_RECTABLE) {
this.serverData.splice(this.serverData.indexOf(item), 1) if (this.serverData.length > 0)
this.serverData.splice(this.serverData.indexOf(item), 1)
} }
} }
@@ -296,10 +346,51 @@ export default class CGridTableRec extends Vue {
public visuValByType(col, val) { public visuValByType(col, val) {
if (col.isdate) { if (col.isdate) {
return tools.getstrDateTime(val) if (val === undefined) {
return '[]'
} else {
return tools.getstrDateTime(val)
}
} else { } else {
return val if (val === undefined) {
return '[]'
} else {
let mystr = tools.firstchars(val, tools.MAX_CHARACTERS)
if (val.length > tools.MAX_CHARACTERS)
mystr += '...'
return mystr
}
} }
} }
public changeTable(mysel) {
// console.log('changeTable')
let mytab = null
if (this.tablesList) {
if (!this.tablesel) {
this.tablesel = this.tablesList[0].value
}
mytab = this.tablesList.find((rec) => rec.value === this.tablesel)
}
if (mytab) {
this.mytitle = mytab.label
this.colkey = mytab.colkey
this.mycolumns = [...mytab.columns]
}
this.mycolumns.forEach((rec: IColGridTable) => {
if (rec.label_trans)
rec.label = this.$t(rec.label_trans)
})
if (mytab) {
this.mytable = mytab.value
}
this.updatedcol()
this.refresh()
}
} }

View File

@@ -34,14 +34,20 @@
<!--<p style="color:red"> Rows: {{ getrows }}</p>--> <!--<p style="color:red"> Rows: {{ getrows }}</p>-->
<q-toggle v-model="funcActivated" :val="lists.MenuAction.CAN_EDIT_TABLE" <q-toggle v-if="mytable" v-model="funcActivated" :val="lists.MenuAction.CAN_EDIT_TABLE" class="q-mx-sm"
:label="$t('grid.editvalues')"></q-toggle> :label="$t('grid.editvalues')"></q-toggle>
<q-btn v-if="mytable" label="Refresh" color="primary" @click="refresh" class="q-mx-sm"></q-btn>
<q-btn v-if="mytable" flat dense color="primary" :disable="loading" label="Add Record"
@click="createNewRecord"></q-btn>
<q-space/> <q-space/>
<!--<q-toggle v-for="(mycol, index) in mycolumns" v-model="colVisib" :val="rec.field" :label="mycol.label"></q-toggle>--> <!--<q-toggle v-for="(mycol, index) in mycolumns" v-model="colVisib" :val="rec.field" :label="mycol.label"></q-toggle>-->
<q-select <q-select
v-if="mytable"
v-model="colVisib" v-model="colVisib"
multiple multiple
borderless borderless
@@ -56,18 +62,71 @@
</q-select> </q-select>
<q-select v-if="tablesList"
v-model="tablesel"
rounded
outlined
dense
:options="tablesList"
:display-value="mytitle"
emit-value
@input="changeTable"
>
</q-select>
<q-inner-loading :showing="spinner_visible">
<q-spinner-gears size="50px" color="primary"/>
</q-inner-loading>
</template> </template>
<q-tr slot="body" slot-scope="props" :props="props"> <q-tr v-if="mytable" slot="body" slot-scope="props" :props="props">
<q-td v-for="col in mycolumns" :key="col.name" :props="props" v-if="colVisib.includes(col.field)"> <q-td v-for="col in mycolumns" :key="col.name" :props="props" v-if="colVisib.includes(col.field)">
<div :class="getclassCol(col)"> <div v-if="col.isdate">
{{ visuValByType(col, props.row[col.name]) }} <div style="max-width: 250px">
<q-popup-edit v-if="canEdit" v-model="props.row[col.name]" :disable="col.disable" <q-input dense v-model="props.row[col.name]">
:title="col.title" buttons <template v-slot:prepend>
@save="SaveValue" @show="selItem(props.row, col.field)"> <q-icon name="event" class="cursor-pointer">
<q-input v-model="props.row[col.name]"/> <q-popup-edit transition-show="scale" transition-hide="scale" v-if="canEdit" v-model="props.row[col.name]" :disable="col.disable"
:title="col.title" buttons
@save="SaveValue" @show="selItem(props.row, col.field)">
<q-date v-model="props.row[col.name]" mask="YYYY-MM-DD HH:mm" />
</q-popup-edit> </q-popup-edit>
<!--<q-popup-proxy transition-show="scale" transition-hide="scale">-->
<!--<q-date v-model="props.row[col.name]" mask="YYYY-MM-DD HH:mm" />-->
<!--</q-popup-proxy>-->
</q-icon>
</template>
<template v-slot:append>
<q-icon name="access_time" class="cursor-pointer">
<q-popup-edit transition-show="scale" transition-hide="scale" v-if="canEdit" v-model="props.row[col.name]" :disable="col.disable"
:title="col.title" buttons
@save="SaveValue" @show="selItem(props.row, col.field)">
<q-time v-model="props.row[col.name]" mask="YYYY-MM-DD HH:mm" format24h />
</q-popup-edit>
<!--<q-popup-proxy transition-show="scale" transition-hide="scale">-->
<!--<q-time v-model="props.row[col.name]" mask="YYYY-MM-DD HH:mm" format24h />-->
<!--</q-popup-proxy>-->
</q-icon>
</template>
</q-input>
</div>
</div>
<div v-else>
<div :class="getclassCol(col)">
{{ visuValByType(col, props.row[col.name]) }}
<q-popup-edit v-if="canEdit" v-model="props.row[col.name]" :disable="col.disable"
:title="col.title" buttons
@save="SaveValue" @show="selItem(props.row, col.field)">
<q-input v-model="props.row[col.name]"/>
</q-popup-edit>
</div>
</div> </div>
</q-td> </q-td>
<q-td v-for="col in mycolumns" :key="col.name" :props="props" v-if="colExtra.includes(col.name)"> <q-td v-for="col in mycolumns" :key="col.name" :props="props" v-if="colExtra.includes(col.name)">

View File

@@ -1,36 +0,0 @@
import Vue from 'vue'
import { Component, Prop } from 'vue-property-decorator'
import { GlobalStore, UserStore } from '@store'
import { Logo } from '../../components/logo'
import { Footer } from '../../components/Footer'
import VueScrollReveal from 'vue-scroll-reveal'
import { tools } from '@src/store/Modules/tools'
import { toolsext } from '@src/store/Modules/toolsext'
import { Screen } from 'quasar'
Vue.use(VueScrollReveal, {
class: 'v-scroll-reveal', // A CSS class applied to elements with the v-scroll-reveal directive; useful for animation overrides.
duration: 1200,
scale: 0.95,
distance: '10px',
rotate: {
x: 0,
y: 0,
z: 0
}
// mobile: true
})
@Component({
name: 'CPage',
components: { Logo, Footer }
})
export default class CPage extends Vue {
@Prop({ required: true }) public imghead: string = ''
@Prop({ required: true }) public headtitle: string = ''
@Prop({ required: true }) public img1: string = ''
@Prop({ required: true }) public text1: string = ''
}

View File

@@ -1,28 +0,0 @@
<template>
<q-page class="text-white">
<div class="landing">
<CTitle :src="imghead" :title="headtitle">
</CTitle>
<section class="padding_testo bg-white text-grey-10 text-center" v-scroll-reveal.reset>
<div class="landing__features row items-start q-col-gutter-xs intro">
<div class="intro__associazione">
<!--<img src="../../statics/images/scuolaopbenessere/16427623_404497389905092_1266178961781563443_n.jpg">-->
<img :src="img1">
{{text1}}
</div>
</div>
</section>
<Footer></Footer>
</div>
</q-page>
</template>
<script lang="ts" src="./CPage.ts">
</script>
<style lang="scss" scoped>
@import './CPage.scss';
</style>

View File

@@ -1 +0,0 @@
export {default as CPage} from './CPage.vue'

View File

@@ -37,16 +37,11 @@ export default class Header extends Vue {
public clCloudDownload: string = '' public clCloudDownload: string = ''
public clCloudUp_Indexeddb: string = '' public clCloudUp_Indexeddb: string = ''
public clCloudDown_Indexeddb: string = 'clIndexeddbsend' public clCloudDown_Indexeddb: string = 'clIndexeddbsend'
public right: boolean = false
public photo = '' public photo = ''
public visuimg: boolean = true public visuimg: boolean = true
get getappname(){ get tools() {
if (Screen.width < 400) { return tools
return this.$t('msg.myAppNameShort')
} else {
return this.$t('msg.myAppName')
}
} }
get conn_changed() { get conn_changed() {
@@ -110,6 +105,14 @@ export default class Header extends Vue {
localStorage.setItem(tools.localStorage.leftDrawerOpen, value.toString()) localStorage.setItem(tools.localStorage.leftDrawerOpen, value.toString())
} }
get rightDrawerOpen() {
return GlobalStore.state.RightDrawerOpen
}
set rightDrawerOpen(value) {
GlobalStore.state.RightDrawerOpen = value
}
get lang() { get lang() {
return this.$q.lang.isoName return this.$q.lang.isoName
} }
@@ -380,7 +383,7 @@ export default class Header extends Vue {
} }
public clickregister() { public clickregister() {
this.right = false this.rightDrawerOpen = false
this.$router.replace('/signup') this.$router.replace('/signup')
} }
} }

View File

@@ -39,7 +39,7 @@
<q-avatar> <q-avatar>
<img :src="imglogo" height="27"> <img :src="imglogo" height="27">
</q-avatar> </q-avatar>
{{getappname}} {{tools.getappname()}}
<div slot="subtitle">{{$t('msg.myDescriz')}} {{ getAppVersion() }}</div> <div slot="subtitle">{{$t('msg.myDescriz')}} {{ getAppVersion() }}</div>
</q-toolbar-title> </q-toolbar-title>
@@ -105,10 +105,10 @@
<!-- BUTTON USER BAR --> <!-- BUTTON USER BAR -->
<q-btn v-if="static_data.functionality.SHOW_USER_MENU && !isLogged" dense flat round icon="menu" <q-btn v-if="static_data.functionality.SHOW_USER_MENU && !isLogged" dense flat round icon="menu"
@click="right = !right"> @click="rightDrawerOpen = !rightDrawerOpen">
</q-btn> </q-btn>
<q-btn v-if="static_data.functionality.SHOW_USER_MENU && isLogged" dense flat round <q-btn v-if="static_data.functionality.SHOW_USER_MENU && isLogged" dense flat round
icon="img:statics/images/avatar/avatar3_small.png" @click="right = !right"> icon="img:statics/images/avatar/avatar3_small.png" @click="rightDrawerOpen = !rightDrawerOpen">
</q-btn> </q-btn>
</q-toolbar> </q-toolbar>
@@ -128,7 +128,7 @@
</q-drawer> </q-drawer>
<!-- USER BAR --> <!-- USER BAR -->
<q-drawer v-if="static_data.functionality.SHOW_USER_MENU" v-model="right" side="right" elevated> <q-drawer v-if="static_data.functionality.SHOW_USER_MENU" v-model="rightDrawerOpen" side="right" elevated>
<div id="profile"> <div id="profile">
<q-img class="absolute-top" src="../../statics/images/landing_first_section.png" <q-img class="absolute-top" src="../../statics/images/landing_first_section.png"
style="height: 150px"> style="height: 150px">
@@ -139,7 +139,7 @@
<img src="../../statics/images/avatar/avatar3_small.png"> <img src="../../statics/images/avatar/avatar3_small.png">
</q-avatar> </q-avatar>
<q-btn class="absolute-top-right" style="margin-right: 10px; color: white;" <q-btn class="absolute-top-right" style="margin-right: 10px; color: white;"
dense flat round icon="close" @click="right = !right"> dense flat round icon="close" @click="rightDrawerOpen = !rightDrawerOpen">
</q-btn> </q-btn>
<div v-if="isLogged" class="text-weight-bold text-user">{{ Username }} - {{ myName }} <span <div v-if="isLogged" class="text-weight-bold text-user">{{ Username }} - {{ myName }} <span
v-if="isAdmin"> [Admin]</span><span v-if="isManager"> [Manager]</span></div> v-if="isAdmin"> [Admin]</span><span v-if="isManager"> [Manager]</span></div>

View File

@@ -4,7 +4,7 @@ export * from './logo'
export * from './CProgress' export * from './CProgress'
export * from './CCard' export * from './CCard'
export * from './CBook' export * from './CBook'
export * from './CPage' export * from './CMyPage'
export * from './CTitle' export * from './CTitle'
export * from './CImgText' export * from './CImgText'
export * from './CImgTitle' export * from './CImgTitle'

View File

@@ -1,11 +1,13 @@
export interface IEvents { export interface IEvents {
_id?: any _id?: any
time?: string typol?: string
duration?: number short_tit?: string
duration2?: number
title?: string title?: string
details?: string details?: string
time?: string
dur?: number
dur2?: number
date?: string date?: string
side?: string side?: string
bgcolor?: string bgcolor?: string
@@ -13,13 +15,19 @@ export interface IEvents {
icon?: string icon?: string
img?: string img?: string
where?: string where?: string
teacher?: string contribtype?: number
teacher2?: string teacher?: string // teacherid
teacher2?: string // teacherid2
avatar?: string avatar?: string
avatar2?: string avatar2?: string
infoextra?: string infoextra?: string
linkpage?: string
linkpdf?: string linkpdf?: string
nobookable?: boolean nobookable?: boolean
news?: boolean
dupId?: any
canceled?: boolean
deleted?: boolean
} }
export interface IBookedEvent { export interface IBookedEvent {

View File

@@ -48,6 +48,7 @@ export interface IGlobalState {
mobileMode: boolean mobileMode: boolean
menuCollapse: boolean menuCollapse: boolean
leftDrawerOpen: boolean leftDrawerOpen: boolean
RightDrawerOpen: boolean
category: string category: string
stateConnection: string stateConnection: string
networkDataReceived: boolean networkDataReceived: boolean
@@ -214,7 +215,7 @@ export interface IParamsQuery {
export interface IColGridTable { export interface IColGridTable {
name: string name: string
required: boolean required?: boolean
label?: string label?: string
label_trans?: string label_trans?: string
align?: string align?: string
@@ -227,4 +228,12 @@ export interface IColGridTable {
action?: any action?: any
foredit?: boolean foredit?: boolean
isdate?: boolean isdate?: boolean
visuonlyEditVal?: boolean
}
export interface ITableRec {
label: string
value: string
columns: IColGridTable[]
colkey: string
} }

View File

@@ -6,6 +6,7 @@ const msgglobal = {
editvalues: 'Modifica Valori', editvalues: 'Modifica Valori',
showprevedit: 'Mostra Eventi Passati', showprevedit: 'Mostra Eventi Passati',
columns: 'Colonne', columns: 'Colonne',
tableslist: 'Tabelle',
}, },
otherpages: { otherpages: {
admin : { admin : {
@@ -13,6 +14,7 @@ const msgglobal = {
eventlist: 'Le tue Prenotazioni', eventlist: 'Le tue Prenotazioni',
usereventlist: 'Prenotazioni Utenti', usereventlist: 'Prenotazioni Utenti',
userlist: 'Lista Utenti', userlist: 'Lista Utenti',
tableslist: 'Lista Tabelle',
}, },
manage: { manage: {
menu: 'Gestione' menu: 'Gestione'
@@ -78,6 +80,8 @@ const msgglobal = {
incorso: 'Registrazione in corso...', incorso: 'Registrazione in corso...',
richiesto: 'Campo Richiesto', richiesto: 'Campo Richiesto',
email: 'Email', email: 'Email',
cell: 'Móvil',
img: 'Imagen de archivo',
date_reg: 'Data Reg.', date_reg: 'Data Reg.',
perm: 'Permessi', perm: 'Permessi',
username: 'Nome Utente', username: 'Nome Utente',
@@ -239,6 +243,7 @@ const msgglobal = {
editvalues: 'Cambiar valores', editvalues: 'Cambiar valores',
showprevedit: 'Mostrar eventos pasados', showprevedit: 'Mostrar eventos pasados',
columns: 'Columnas', columns: 'Columnas',
tableslist: 'Tablas'
}, },
otherpages: { otherpages: {
admin : { admin : {
@@ -246,6 +251,7 @@ const msgglobal = {
eventlist: 'Sus Reservas', eventlist: 'Sus Reservas',
usereventlist: 'Reserva Usuarios', usereventlist: 'Reserva Usuarios',
userlist: 'Lista de usuarios', userlist: 'Lista de usuarios',
tableslist: 'Listado de tablas',
}, },
manage: { manage: {
menu: 'Gestionar' menu: 'Gestionar'
@@ -311,6 +317,8 @@ const msgglobal = {
incorso: 'Registro en curso...', incorso: 'Registro en curso...',
richiesto: 'Campo requerido', richiesto: 'Campo requerido',
email: 'Email', email: 'Email',
cell: 'Telefono',
img: 'File image',
date_reg: 'Fecha Reg.', date_reg: 'Fecha Reg.',
perm: 'Permisos', perm: 'Permisos',
username: 'Nombre usuario', username: 'Nombre usuario',
@@ -466,6 +474,7 @@ const msgglobal = {
editvalues: 'Changer les valeurs', editvalues: 'Changer les valeurs',
showprevedit: 'Afficher les événements passés', showprevedit: 'Afficher les événements passés',
columns: 'Colonnes', columns: 'Colonnes',
tableslist: 'Tables',
}, },
otherpages: { otherpages: {
admin : { admin : {
@@ -473,6 +482,7 @@ const msgglobal = {
eventlist: 'Vos réservations', eventlist: 'Vos réservations',
usereventlist: 'Réservation Utilisateur', usereventlist: 'Réservation Utilisateur',
userlist: 'Liste d\'utilisateurs', userlist: 'Liste d\'utilisateurs',
tableslist: 'Liste des tables',
}, },
manage: { manage: {
menu: 'Gérer' menu: 'Gérer'
@@ -537,6 +547,8 @@ const msgglobal = {
incorso: 'Inscription en cours...', incorso: 'Inscription en cours...',
richiesto: 'Champ obligatoire', richiesto: 'Champ obligatoire',
email: 'Email', email: 'Email',
cell: 'Téléphone',
img: 'Fichier image',
date_reg: 'Date Inscript.', date_reg: 'Date Inscript.',
perm: 'Autorisations', perm: 'Autorisations',
username: 'Nom d\'utilisateur', username: 'Nom d\'utilisateur',
@@ -692,6 +704,7 @@ const msgglobal = {
editvalues: 'Edit Values', editvalues: 'Edit Values',
showprevedit: 'Show Past Events', showprevedit: 'Show Past Events',
columns: 'Columns', columns: 'Columns',
tableslist: 'Tables',
}, },
otherpages: { otherpages: {
admin : { admin : {
@@ -699,6 +712,7 @@ const msgglobal = {
eventlist: 'Your Booking', eventlist: 'Your Booking',
usereventlist: 'Users Booking', usereventlist: 'Users Booking',
userlist: 'Users List', userlist: 'Users List',
tableslist: 'List of tables',
}, },
manage: { manage: {
menu: 'Manage' menu: 'Manage'
@@ -763,6 +777,8 @@ const msgglobal = {
incorso: 'Registration please wait...', incorso: 'Registration please wait...',
richiesto: 'Field Required', richiesto: 'Field Required',
email: 'Email', email: 'Email',
cell: 'Phone',
img: 'File Image',
date_reg: 'Reg. Date', date_reg: 'Reg. Date',
perm: 'Permissions', perm: 'Permissions',
username_login: 'Username or email', username_login: 'Username or email',
@@ -917,6 +933,7 @@ const msgglobal = {
editvalues: 'Edit Values', editvalues: 'Edit Values',
showprevedit: 'Show Past Events', showprevedit: 'Show Past Events',
columns: 'Columns', columns: 'Columns',
tableslist: 'Tables',
}, },
otherpages: { otherpages: {
admin : { admin : {
@@ -924,6 +941,7 @@ const msgglobal = {
eventlist: 'Your Booking', eventlist: 'Your Booking',
usereventlist: 'Users Booking', usereventlist: 'Users Booking',
userlist: 'Users List', userlist: 'Users List',
tableslist: 'List of tables',
}, },
manage: { manage: {
menu: 'Manage' menu: 'Manage'
@@ -989,6 +1007,8 @@ const msgglobal = {
incorso: 'Registration please wait...', incorso: 'Registration please wait...',
richiesto: 'Field Required', richiesto: 'Field Required',
email: 'Email', email: 'Email',
cell: 'Phone',
img: 'File Image',
date_reg: 'Reg. Date', date_reg: 'Reg. Date',
perm: 'Permissions', perm: 'Permissions',
username_login: 'Username or email', username_login: 'Username or email',

View File

@@ -17,7 +17,6 @@ import { GlobalStore, Projects, Todos, UserStore } from '@store'
import messages from '../../statics/i18n' import messages from '../../statics/i18n'
import globalroutines from './../../globalroutines/index' import globalroutines from './../../globalroutines/index'
import { cfgrouter } from '../../router/route-config' import { cfgrouter } from '../../router/route-config'
import { static_data } from '@src/db/static_data' import { static_data } from '@src/db/static_data'
import { IParamsQuery } from '@src/model/GlobalStore' import { IParamsQuery } from '@src/model/GlobalStore'
@@ -41,6 +40,7 @@ const state: IGlobalState = {
mobileMode: false, mobileMode: false,
menuCollapse: true, menuCollapse: true,
leftDrawerOpen: true, leftDrawerOpen: true,
RightDrawerOpen: false,
stateConnection: stateConnDefault, stateConnection: stateConnDefault,
networkDataReceived: false, networkDataReceived: false,
cfgServer: [], cfgServer: [],
@@ -504,15 +504,30 @@ namespace Actions {
} }
async function loadTable(context, params: IParamsQuery) { async function loadTable(context, params: IParamsQuery) {
console.log('loadTable', params) // console.log('loadTable', params)
return await Api.SendReq('/gettable', 'POST', params) return await Api.SendReq('/gettable', 'POST', params)
.then((res) => { .then((res) => {
console.table(res) // console.table(res)
return res.data return res.data
}) })
.catch((error) => { .catch((error) => {
console.log('error loadUsersList', error) console.log('error loadTable', error)
UserStore.mutations.setErrorCatch(error)
return null
})
}
async function saveTable(context, mydata: object) {
// console.log('saveTable', mydata)
return await Api.SendReq('/settable', 'POST', mydata)
.then((res) => {
// console.table(res)
return res.data
})
.catch((error) => {
console.log('error saveTable', error)
UserStore.mutations.setErrorCatch(error) UserStore.mutations.setErrorCatch(error)
return null return null
}) })
@@ -551,7 +566,6 @@ namespace Actions {
}) })
} }
export const actions = { export const actions = {
setConta: b.dispatch(setConta), setConta: b.dispatch(setConta),
createPushSubscription: b.dispatch(createPushSubscription), createPushSubscription: b.dispatch(createPushSubscription),
@@ -563,6 +577,7 @@ namespace Actions {
checkUpdates: b.dispatch(checkUpdates), checkUpdates: b.dispatch(checkUpdates),
saveFieldValue: b.dispatch(saveFieldValue), saveFieldValue: b.dispatch(saveFieldValue),
loadTable: b.dispatch(loadTable), loadTable: b.dispatch(loadTable),
saveTable: b.dispatch(saveTable),
DeleteRec: b.dispatch(DeleteRec) DeleteRec: b.dispatch(DeleteRec)
} }

View File

@@ -33,6 +33,7 @@ export interface INotify {
} }
export const tools = { export const tools = {
MAX_CHARACTERS: 60,
projects: 'projects', projects: 'projects',
todos: 'todos', todos: 'todos',
EMPTY: 0, EMPTY: 0,
@@ -1681,7 +1682,11 @@ export const tools = {
if (!value) { if (!value) {
return '' return ''
} }
return value.substring(0, numchars) + '...' try {
return value.substring(0, numchars) + '...'
}catch (e) {
return value
}
}, },
getDateNow() { getDateNow() {
@@ -1877,8 +1882,8 @@ export const tools = {
const maxh2 = this.heightGallVal() const maxh2 = this.heightGallVal()
console.log('maxh2', maxh2) // console.log('maxh2', maxh2)
console.log('maxheight', maxheight) // console.log('maxheight', maxheight)
let ris = 0 let ris = 0
@@ -1892,7 +1897,7 @@ export const tools = {
ris = parseInt(myheightmobile, 10) ris = parseInt(myheightmobile, 10)
} }
console.log('ris', ris) // console.log('ris', ris)
return ris return ris
}, },
@@ -2199,7 +2204,8 @@ export const tools = {
tools.showNotif(mythis.$q, mythis.$t('login.errato'), { color: 'negative', icon: 'notifications' }) tools.showNotif(mythis.$q, mythis.$t('login.errato'), { color: 'negative', icon: 'notifications' })
mythis.iswaitingforRes = false mythis.iswaitingforRes = false
if (ispageLogin) { if (ispageLogin) {
mythis.$router.push('/signin') GlobalStore.state.RightDrawerOpen = true
// mythis.$router.push('/signin')
} }
}) })