Reportistica Ore 1

This commit is contained in:
Paolo Arena
2021-02-21 02:05:39 +01:00
parent 5568547784
commit f8ad20d1ae
41 changed files with 2803 additions and 1692 deletions

View File

@@ -272,7 +272,7 @@ $graytext: #555;
position: absolute;
margin-top: -10px;
overflow: hidden;
z-index: 9999;
z-index: 1000;
box-sizing: border-box;
right: 0;
@media (max-width: 400px) {
@@ -297,3 +297,7 @@ $graytext: #555;
flex-flow: column;
}
}
.itemprenota{
align-self: center;
color: blue;
}

View File

@@ -74,6 +74,8 @@ export default class CEventsCalendar extends MixinEvents {
msgbooking: '',
infoevent: '',
numpeople: 1,
numpeopleLunch: 0,
numpeopleDinner: 0,
datebooked: tools.getDateNow(),
booked: false,
modified: false
@@ -137,29 +139,7 @@ export default class CEventsCalendar extends MixinEvents {
}
public resources = [
{
label: 'John'
},
{
label: 'Mary'
},
{
label: 'Susan'
},
{
label: 'Olivia'
},
{
label: 'Board Room'
},
{
label: 'Room-1'
},
{
label: 'Room-2'
}
]
public resources = []
// public eventdata =
// [
@@ -365,6 +345,8 @@ export default class CEventsCalendar extends MixinEvents {
get hasModifiedBooking() {
return (this.bookEventpage.bookedevent.numpeople !== this.bookEventForm.numpeople) ||
(this.bookEventpage.bookedevent.numpeopleLunch !== this.bookEventForm.numpeopleLunch) ||
(this.bookEventpage.bookedevent.numpeopleDinner !== this.bookEventForm.numpeopleDinner) ||
(this.bookEventpage.bookedevent.msgbooking !== this.bookEventForm.msgbooking) ||
(this.bookEventpage.bookedevent.booked !== this.bookEventForm.booked)
}
@@ -450,16 +432,18 @@ export default class CEventsCalendar extends MixinEvents {
this.eventForm = { ...this.formDefault }
}
public addEventMenu(day, type) {
// console.log('addeventmenu editable = ', this.editable)
public addEventMenu(day) {
console.log('addeventmenu', day)
if (this.calendarView === 'scheduler' || this.calendarView === 'week-scheduler' || this.calendarView === 'month-scheduler' || !this.editable) {
return
}
this.resetForm()
this.contextDay = { ...day }
this.contextDay = { ...day.scope }
this.eventForm.dateTimeStart = tools.getstrYYMMDDDateTime(day.date + ' 21:00:00')
this.eventForm.dateTimeEnd = tools.getstrYYMMDDDateTime(day.date + ' 22:00:00')
this.eventForm.dateTimeStart = tools.getstrYYMMDDDateTime(day.scope.date + ' 21:00:00')
this.eventForm.dateTimeEnd = tools.getstrYYMMDDDateTime(day.scope.date + ' 22:00:00')
console.log('eventForm', this.eventForm)
this.addEvent = true // show dialog
}
@@ -479,6 +463,8 @@ export default class CEventsCalendar extends MixinEvents {
this.myevent = eventparam
this.bookEventForm.msgbooking = ''
this.bookEventForm.numpeople = 1
this.bookEventForm.numpeopleLunch = 0
this.bookEventForm.numpeopleDinner = 0
this.bookEventForm.booked = true
this.bookEventpage.state = EState.Creating
@@ -703,6 +689,8 @@ export default class CEventsCalendar extends MixinEvents {
if (bookedevent) {
this.bookEventForm._id = bookedevent._id
this.bookEventForm.numpeople = bookedevent.numpeople
this.bookEventForm.numpeopleLunch = bookedevent.numpeopleLunch
this.bookEventForm.numpeopleDinner = bookedevent.numpeopleDinner
this.bookEventForm.infoevent = bookedevent.infoevent
this.bookEventForm.msgbooking = bookedevent.msgbooking
this.bookEventForm.booked = bookedevent.booked
@@ -755,6 +743,8 @@ export default class CEventsCalendar extends MixinEvents {
userId: UserStore.state.my._id,
id_bookedevent: myevent._id,
numpeople: self.bookEventForm.numpeople,
numpeopleLunch: self.bookEventForm.numpeopleLunch,
numpeopleDinner: self.bookEventForm.numpeopleDinner,
infoevent: tools.gettextevent(self, myevent),
msgbooking: self.bookEventForm.msgbooking,
booked: self.bookEventForm.booked,

View File

@@ -1,9 +1,18 @@
<template>
<div class="landing">
<div v-if="!tools.IsLogged()">
<div class="centermydiv">
<q-banner class="bg-secondary text-white">
Il Calendario sarà visibile solo dopo aver effettuato l'accesso
</q-banner>
</div>
</div>
<div v-else>
<!-- display an myevent -->
<q-dialog v-model="displayEvent">
<q-card v-if="myevent">
<q-toolbar class="bg-primary text-white" :style="`min-width: ` + tools.myheight_dialog() + `px;`">
<q-card v-if="myevent" :style="`min-width: ` + tools.myheight_dialog() + `px;`">
<q-toolbar class="bg-primary text-white">
<!--<q-toolbar :class="tools.displayClasses(myevent)"-->
<!--:style="tools.displayStyles(myevent) + ` min-width: `+ tools.myheight_dialog() + `px;`">-->
<q-toolbar-title>
@@ -47,11 +56,11 @@
:style="`background-color: ${myevent.bgcolor} !important; color: white !important;`"
text-color="white"
class="shadow-5 q-mb-md" dense>
{{myevent.title}}
{{ myevent.title }}
</q-chip>
<div class="cal__details" v-html="myevent.details"></div>
<div v-if="myevent.teacher" class="cal__teacher">
<span class="cal__teacher-title">{{$t('cal.teacher')}}: <span
<span class="cal__teacher-title">{{ $t('cal.teacher') }}: <span
class="margin_with"></span></span>
<!--<span class="cal__teacher-content">{{myevent.teacher}}</span>-->
<CMyTeacher :username="myevent.teacher"></CMyTeacher>
@@ -59,7 +68,7 @@
</div>
<div v-if="myevent.wherecode" class="cal__where">
<!--<span v-if="tools.isMobile()"><br/></span>-->
<span class="cal__where-title">{{$t('cal.where')}}: </span>
<span class="cal__where-title">{{ $t('cal.where') }}: </span>
<span class="cal__where-content">
<q-chip>
<q-avatar v-if="getWhereIcon(myevent.wherecode)">
@@ -68,18 +77,18 @@
</q-avatar>
<q-avatar v-else color="blue" font-size="20px" text-color="white" icon="home">
</q-avatar>
<span class="cal__teacher-content">{{getWhereName(myevent.wherecode)}}</span>
<span class="cal__teacher-content">{{ getWhereName(myevent.wherecode) }}</span>
</q-chip>
</span>
</div>
<div v-if="myevent.price && isShowPrice(myevent)" class="cal__quota">
<span class="cal__quota-title">{{$t('event.price')}}:</span>
<span class="cal__quota-title">{{ $t('event.price') }}:</span>
<q-chip>
<span class="cal__quota-content">{{getPrice(myevent)}}</span>
<span class="cal__quota-content">{{ getPrice(myevent) }}</span>
</q-chip>
</div>
<div v-if="myevent.dateTimeStart" class="cal__when">
<span class="cal__where-title">{{$t('cal.when')}}:
<span class="cal__where-title">{{ $t('cal.when') }}:
<span v-html="tools.getstrDateTimeEvent(mythis, myevent, true)"></span>
</span>
</div>
@@ -195,6 +204,12 @@
optlab="placename"
:options="getWhereArr" :useinput="false">
</CMySelect>
<q-checkbox class="myflex wrap" dense v-model="eventForm.internal"
:label="$t('event.internal')"></q-checkbox>
<q-checkbox class="myflex wrap" dense v-model="eventForm.lunchAvailable"
:label="$t('event.lunchAvailable')"></q-checkbox>
<q-checkbox class="myflex wrap" dense v-model="eventForm.dinnerAvailable"
:label="$t('event.dinnerAvailable')"></q-checkbox>
<q-checkbox class="myflex wrap" dense v-model="eventForm.news"
:label="$t('event.news')"></q-checkbox>
<q-checkbox class="myflex wrap" dense v-model="eventForm.nobookable"
@@ -274,7 +289,7 @@
<q-card v-if="bookEventpage.show" :style="`min-width: `+ tools.myheight_dialog() + `px;`">
<q-toolbar class="bg-primary text-white">
<q-toolbar-title>
{{$t('cal.booking')}}
{{ $t('cal.booking') }}
</q-toolbar-title>
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
</q-toolbar>
@@ -291,16 +306,17 @@
:style="`background-color: ${myevent.bgcolor} !important; color: white !important;`"
text-color="white"
class="shadow-5 q-mb-md" dense>
{{myevent.title}}
{{ myevent.title }}
</q-chip>
<div v-if="myevent.dateTimeStart" class="cal__when">
<span class="cal__where-title">{{$t('cal.when')}}:
<span class="cal__where-title">{{ $t('cal.when') }}:
<span v-html="tools.getstrDateTimeEvent(mythis, myevent, true)"></span>
</span>
</div>
<div class="q-pa-xs">
<q-card class="text-white windowcol" style="display: block; ">
<q-card-section class="q-pa-xs">
<div style="display: inline-flex; " class="q-px-xs centermydiv">
<q-checkbox
:disable="((bookEventpage.bookedevent && bookEventpage.bookedevent.booked) || (bookEventpage.bookedevent === undefined)) || !isEventEnabled(myevent)"
@@ -317,6 +333,32 @@
</q-select>
</div>
</div>
<div v-if="myevent.lunchAvailable" class="q-px-xs centermydiv" style="display: inline-flex; ">
<div style="display: inline-flex; " class="q-px-xs centermydiv">
<div class="itemprenota">{{ $t('cal.selnumpeopleLunch') }}</div>
<div class="q-gutter-xs"
style="min-width: 140px; margin-left: 10px;">
<q-select
rounded outlined v-model="bookEventForm.numpeopleLunch"
:options="tools.SelectListNumPeople"
:label="$t('cal.Lunch')" emit-value map-options>
</q-select>
</div>
</div>
</div>
<br>
<div v-if="myevent.dinnerAvailable" class="q-px-xs centermydiv" style="display: inline-flex; ">
<div style="display: inline-flex; " class="q-px-xs centermydiv">
<div class="itemprenota">{{ $t('cal.selnumpeopleDinner') }}</div>
<div class="q-gutter-xs " style="min-width: 140px; margin-left: 10px;">
<q-select
rounded outlined v-model="bookEventForm.numpeopleDinner"
:options="tools.SelectListNumPeople"
:label="$t('cal.Dinner')" emit-value map-options>
</q-select>
</div>
</div>
</div>
<q-input v-model="bookEventForm.msgbooking" :label="$t('cal.msgbooking')+':'"
type="textarea" debounce="500"
@@ -355,7 +397,7 @@
<q-card v-if="askInfopage.show" :style="`min-width: `+ tools.myheight_dialog() + `px;`">
<q-toolbar class="bg-primary text-white">
<q-toolbar-title>
{{$t('cal.booking')}}
{{ $t('cal.booking') }}
</q-toolbar-title>
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
</q-toolbar>
@@ -372,10 +414,10 @@
:style="`background-color: ${myevent.bgcolor} !important; color: white !important;`"
text-color="white"
class="shadow-5 q-mb-md" dense>
{{myevent.title}}
{{ myevent.title }}
</q-chip>
<div v-if="myevent.dateTimeStart" class="cal__when">
<span class="cal__where-title">{{$t('cal.when')}}:
<span class="cal__where-title">{{ $t('cal.when') }}:
<span v-html="tools.getstrDateTimeEvent(mythis, myevent, true)"></span>
</span>
</div>
@@ -577,7 +619,8 @@
<div class="q-mt-md">
<div v-if="!mysingleevent">
<p class="text-subtitle1 text-red bg-amber text-center ">LISTA PROSSIMI <span v-if="showfirstN > 0">{{ showfirstN }}</span>
<p class="text-subtitle1 text-red bg-amber text-center ">LISTA PROSSIMI <span
v-if="showfirstN > 0">{{ showfirstN }}</span>
EVENTI:</p>
<q-markup-table wrap-cells bordered separator="horizontal" class="listaev__table">
<tbody>
@@ -591,7 +634,7 @@
:alt="event.title">
<q-chip dense v-if="isAlreadyBooked(event)" class="cltexth4 chipbooked shadow-5 q-mb-md"
color="green" text-color="white"
icon="event_available">{{$t('cal.booked')}}
icon="event_available">{{ $t('cal.booked') }}
</q-chip>
<q-chip v-if="event === myevent && !displayEvent && editable"
@@ -625,7 +668,7 @@
color="red"
text-color="white" icon-right="star" icon="star" dense
style="">
{{$t('event.news')}}
{{ $t('event.news') }}
</q-chip>
</div>
@@ -666,7 +709,7 @@
<p class="listaev__details" v-html="event.details"></p>
<div v-if="event.teacher" class="">
<span class="cal__teacher-title">{{$t('cal.teacher')}}: <span
<span class="cal__teacher-title">{{ $t('cal.teacher') }}: <span
class="margin_with"></span></span>
<CMyTeacher :username="event.teacher"></CMyTeacher>
@@ -674,31 +717,34 @@
<span v-if="event.wherecode" class="">
<span v-if="tools.isMobile()"><br/></span>
<span class="cal__where-title">{{$t('cal.where')}}: </span>
<span class="cal__where-title">{{ $t('cal.where') }}: </span>
<q-chip>
<q-avatar v-if="getWhereIcon(event.wherecode)">
<img :src="`../../statics/images/avatar/` + getWhereIcon(event.wherecode)"
<img
:src="`../../statics/images/avatar/` + getWhereIcon(event.wherecode)"
:alt="event.wherecode">
</q-avatar>
<q-avatar color="blue" font-size="20px" text-color="white" icon="home">
</q-avatar>
<span class="cal__teacher-content">{{getWhereName(event.wherecode)}}</span>
<span
class="cal__teacher-content">{{ getWhereName(event.wherecode) }}</span>
</q-chip>
</span>
</div>
<div v-if="event.contribtype" class="">
<span class="cal__quota-title">{{$t('event.price')}}:<span
<span class="cal__quota-title">{{ $t('event.price') }}:<span
class="margin_with"></span></span>
<span v-if="!isShowPrice(event)" class="">
<q-chip class="glossy" color="orange" text-color="white">
<span class="cal__quota-content">{{getContribtypeById(event.contribtype)}}</span>
<span
class="cal__quota-content">{{ getContribtypeById(event.contribtype) }}</span>
</q-chip>
</span>
<q-chip v-if="event.price && isShowPrice(event)" class="glossy" color="orange"
text-color="white" icon-right="star">
<span class="cal__quota-content">{{getPrice(event)}}</span>
<span class="cal__quota-content">{{ getPrice(event) }}</span>
</q-chip>
</div>
@@ -766,9 +812,10 @@
</div>
</div>
</div>
</div>
</template>
<script lang="ts" src="./CEventsCalendar.ts">
</script>
<style lang="scss" scoped>
@import './CEventsCalendar.scss';
@import './CEventsCalendar.scss';
</style>

View File

@@ -16,4 +16,7 @@
padding-right: 2px;
padding-top: 0;
padding-bottom: 0;
&__title {
font-size: 1rem;
}
}

View File

@@ -5,7 +5,7 @@ import { GlobalStore, UserStore } from '../../store/Modules/index'
import { tools } from '../../store/Modules/tools'
import { shared_consts } from '../../common/shared_vuejs'
import { ICategory, IColGridTable, IFilter, ITableRec } from '../../model'
import { ICategory, IColGridTable, IFilter, ITableRec, IPagination } from '../../model'
import { CTodo } from '../todos/CTodo'
import { SingleProject } from '../projects/SingleProject'
import { lists } from '../../store/Modules/lists'
@@ -19,18 +19,28 @@ import { CMyDashboard } from '../CMyDashboard'
components: { CMyPopupEdit, CTitleBanner, CMyDashboard }
})
export default class CGridTableRec extends Vue {
private addRow: string = 'Aggiungi'
@Prop({ required: true }) public prop_mytitle: string
@Prop({ required: false }) public prop_mytable: string
@Prop({ required: false, default: null }) public prop_mycolumns: any[]
@Prop({ required: false, default: '' }) public prop_colkey: string
@Prop({ required: false, default: '' }) public prop_codeId: string
@Prop({ required: false, default: '' }) public nodataLabel: string
@Prop({ required: false, default: 'Aggiungi' }) public labelBtnAddRow: string
@Prop({ required: false, default: '' }) public noresultLabel: string
@Prop({ required: false, default: {} }) public defaultnewrec: any
@Prop({
required: false, default: function mydef() {
return true
}
}) public defaultnewrec: any
@Prop({ required: false, default: null }) public tablesList: ITableRec[]
@Prop({ required: false, default: null }) public arrfilters: IFilter[]
@Prop({ required: false, default: [] }) public filterdef: number[]
@Prop({ required: false, default: {} }) public extraparams: any
@Prop({
required: false,
default: { sortBy: '', descending: false, page: 1, rowsNumber: 10, rowsPerPage: 10 }
}) public pagination: IPagination
public newRecordBool: boolean = false
public newRecord: any = {}
@@ -47,13 +57,6 @@ export default class CGridTableRec extends Vue {
public $q
public $t
public loading: boolean = false
public pagination: {
sortBy: string,
descending: boolean
rowsNumber: number
page: number,
rowsPerPage: number // specifying this determines pagination is server-side
} = { sortBy: '', descending: false, page: 1, rowsNumber: 10, rowsPerPage: 10 }
public serverData: any [] = []
public spinner_visible: boolean = false
@@ -63,7 +66,7 @@ export default class CGridTableRec extends Vue {
public valPrec: string = ''
public separator: 'horizontal'
public myfilter = undefined
public myfilter: any = ''
public myfilterand = []
public rowsel: any = {}
public dark: boolean = true
@@ -210,9 +213,15 @@ export default class CGridTableRec extends Vue {
this.valPrec = valinitial
this.saveFieldValue(mydata)
}
public beforeMount() {
console.log('beforeMount')
}
public created() {
console.log('created')
// this.serverData = this.mylist.slice() // [{ chiave: 'chiave1', valore: 'valore 1' }]
this.mytable = this.prop_mytable
@@ -450,6 +459,7 @@ export default class CGridTableRec extends Vue {
}
public mounted() {
console.log('GridTable mounted', this.tablesel)
if (!!this.tablesList) {
this.canEdit = tools.getCookie(tools.CAN_EDIT, this.canEdit) === 'true'
@@ -684,6 +694,7 @@ export default class CGridTableRec extends Vue {
if (ris) {
// console.log('ris', ris)
this.newRecordBool = false
this.refresh()
}
})
}
@@ -694,4 +705,17 @@ export default class CGridTableRec extends Vue {
this.annulla(0)
}
}
get isfinishLoading() {
return GlobalStore.state.finishLoading
}
get getlabelAddRow() {
return this.labelBtnAddRow
}
get visButtRow() {
return this.labelBtnAddRow !== this.addRow
}
}

View File

@@ -1,9 +1,11 @@
<template>
<div class="q-pa-xs">
<q-btn v-if="mytable" flat dense color="primary"
:label="$t('grid.addrecord')"
<div class="q-pa-xs" v-if="isfinishLoading">
<div class="centermydiv q-ma-sm" style="text-align: center">
<q-btn v-if="mytable && visButtRow" rounded dense color="primary"
size="lg"
:label="getlabelAddRow"
@click="createNewRecordDialog"></q-btn>
</div>
<q-table
flat
@@ -23,8 +25,7 @@
:no-results-label="noresultLabel"
:selected-rows-label="getSelectedString"
selection="single"
:selected.sync="selected"
>
:selected.sync="selected">
<template v-slot:header="props">
@@ -45,7 +46,7 @@
</template>
<template v-slot:top="props">
<div class="col-2 q-table__title">{{ mytitle }}</div>
<div class="q-table__title" style="min-width: 150px;">{{ mytitle }}</div>
<!--<p style="color:red"> Rows: {{ getrows }}</p>-->

View File

@@ -1,7 +1,7 @@
import Vue from 'vue'
import { Component, Prop, Watch } from 'vue-property-decorator'
import { colTableHours } from '@src/store/Modules/fieldsTable'
import { colTableHours, colTableStorehouse } from '@src/store/Modules/fieldsTable'
import { CCard, CGridTableRec, CMyPage, CTitleBanner, CImgText } from '@components'
@@ -27,6 +27,10 @@ export default class CHours extends MixinBase {
// rowsNumber: xx if getting data from a server
}
public created() {
console.log('created CHours')
}
get extraparams() {
return {
lk_tab: 'users',
@@ -74,7 +78,7 @@ export default class CHours extends MixinBase {
return colTableHours
}
get defaultnewrec() {
get getdefaultnewrec() {
const myrec = {
todoId: this.todoId,
userId: UserStore.state.my._id,

View File

@@ -1,13 +1,6 @@
<template>
<div>
<span>{{ setmeta({
title: 'Lista Ore',
description: "",
keywords: '' } ) }}
</span>
<div class="q-ma-sm q-gutter-sm q-pa-xs">
<CTitleBanner title="Lista Ore"></CTitleBanner>
<CGridTableRec prop_mytable="hours"
prop_mytitle="Lista Ore"
:prop_mycolumns="getcolHours"
@@ -17,9 +10,9 @@
:arrfilters="myarrfilterand"
:filterdef="myfilterdef"
:prop_codeId="todoId"
:defaultnewrec="defaultnewrec"
:defaultnewrec="getdefaultnewrec"
:extraparams="extraparams"
>
labeladd="Aggiungi Ora">
</CGridTableRec>
</div>

View File

@@ -152,6 +152,13 @@
</q-input>
</div>
<div v-else-if="type === tools.FieldType.hours">
<CMySelect label="Ore" :value.sync="myvalue"
optval="_id" optlab="label"
:useinput="false"
:options="tools.SelectHours">
</CMySelect>
</div>
<div v-else-if="type === tools.FieldType.binary">
<CMyToggleList :label="col.title"
:options="db_fieldsTable.getTableJoinByName(col.jointable)"

View File

@@ -53,6 +53,9 @@ export default class CMyPopupEdit extends Vue {
}
public changevalRec(newval) {
if (this.col.fieldtype === tools.FieldType.hours) {
newval = newval.value
}
console.log('this.row', this.row, 'this.col', this.col, 'newval', newval)
console.log('this.row[this.col.name]', this.row[this.col.name])
this.row[this.col.name] = newval
@@ -248,4 +251,8 @@ export default class CMyPopupEdit extends Vue {
this.myvalue = '+' + coderec.dialCode
}
public createHours(value) {
}
}

View File

@@ -11,7 +11,7 @@
:label="col.label">
</q-input>
</div>
<div v-if="col.fieldtype === tools.FieldType.date">
<div v-else-if="col.fieldtype === tools.FieldType.date">
<CDateTime
:label="col.label"
class="cursor-pointer"
@@ -25,6 +25,21 @@
@show="OpenEdit">
</CDateTime>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.onlydate">
<CDateTime
:label="col.label"
class="cursor-pointer"
:valueDate="myvalue"
:readonly="false"
:minuteinterval="minuteinterval"
:dense="true"
@input="changevalRec"
canEdit="true"
@savetoclose="SaveValueInt"
@show="OpenEdit"
view="date">
</CDateTime>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.number">
<q-input v-model="myvalue" type="number"
autofocus
@@ -34,6 +49,81 @@
</q-input>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.hours">
<CMySelect label="Ore" :value.sync="myvalue"
optval="value" optlab="label"
:useinput="true"
@changeval="changevalRec"
:newvaluefunc="createHours"
:options="tools.SelectHours">
</CMySelect>
<!--<q-input v-model="myvalue" type="number"
autofocus
@input="changevalRec"
:label="col.label">
</q-input>
-->
</div>
<div v-else-if="col.fieldtype === tools.FieldType.listimages">
<CGallery :gall="row" :listimages="myvalue" :edit="isviewfield"
@showandsave="Savedb"
@input="changevalRec"
>
</CGallery>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.image">
<CGallery :gall="row" :listimages="myvalue" :edit="isviewfield"
@input="changevalRec"
@showandsave="Savedb">
</CGallery>
</div>
<div v-if="col.fieldtype === tools.FieldType.binary">
<CMyChipList
:type="tools.FieldType.binary"
:value="myvalue"
@input="changevalRec"
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
:optval="db_fieldsTable.getKeyByTable(col.jointable)"
:optlab="db_fieldsTable.getLabelByTable(col.jointable)"
:opticon="db_fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
</div>
<!-- Show Value -->
<div v-else-if="col.fieldtype === tools.FieldType.multiselect">
<CMyChipList
@input="changevalRec"
:type="tools.FieldType.multiselect"
:value="myvalue"
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
:optval="db_fieldsTable.getKeyByTable(col.jointable)"
:optlab="db_fieldsTable.getLabelByTable(col.jointable)"
:opticon="db_fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.select">
<CMyChipList
@input="changevalRec"
myclass="text-center"
:type="tools.FieldType.select"
:value="myvalue"
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
:optval="db_fieldsTable.getKeyByTable(col.jointable)"
:optlab="db_fieldsTable.getLabelByTable(col.jointable)"
:opticon="db_fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.boolean">
<q-toggle dark color="green" v-model="myvalue" :label="col.title"
:disable="disable && col.name !== 'profile.saw_zoom_presentation'"
@input="changevalRec"></q-toggle>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.html">
<div v-html="visuValByType(myvalue, col, row)" @click="visueditor = true">
</div>
</div>
</div>
</div>
<div v-else>
@@ -177,6 +267,12 @@
</q-input>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.hours">
<q-input v-model="myvalue" type="number"
autofocus>
</q-input>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.binary">
<CMyToggleList :label="col.title"
:options="db_fieldsTable.getTableJoinByName(col.jointable)"

View File

@@ -26,7 +26,9 @@ export default class CMySelect extends Vue {
}
public changeval(newval) {
console.log('changeval', newval)
this.$emit('update:value', newval)
this.$emit('changeval', newval)
}
public mounted() {

View File

@@ -43,6 +43,7 @@ export default class Header extends Vue {
public clCloudUpload: string = ''
public clCloudDownload: string = ''
public clCloudUp_Indexeddb: string = ''
public tabcmd: string = ''
public clCloudDown_Indexeddb: string = 'clIndexeddbsend'
public photo = ''
public visuimg: boolean = true
@@ -431,4 +432,9 @@ export default class Header extends Vue {
else
return 'bg-primary'
}
public changecmd(value) {
console.log('changecmd', value)
GlobalStore.mutations.changeCmdClick(value)
}
}

View File

@@ -119,7 +119,8 @@
</q-btn>
<q-btn class="q-mx-xs" v-if="static_data.functionality.ENABLE_ECOMMERCE && isLogged && getnumOrdersCart > 0" round dense flat
<q-btn class="q-mx-xs" v-if="static_data.functionality.ENABLE_ECOMMERCE && isLogged && getnumOrdersCart > 0"
round dense flat
to="/orderinfo" icon="fas fa-list-ol">
@@ -215,7 +216,7 @@
</div>
</div>
<div v-if="isLogged" class="q-mt-lg"><br><br></div>
<div v-if="isLogged" class="q-mt-lg"></div>
<slot></slot>

View File

@@ -1,5 +1,4 @@
$colcompleted: #a2a2a2;
$heightitem: 32px;
$heightothers: 32px;
@@ -56,26 +55,33 @@ $heightdescr: 20px;
}
.pos-item {
max-width: 24px;
min-width: 26px;
margin-left: 1px;
margin-right: 1px;
// max-width: 24px;
// min-width: 26px;
padding-left: 1px;
padding-right: 1px;
margin: 0px;
padding-top: 0px;
padding-bottom: 0px;
margin: 0;
padding-top: 0;
padding-bottom: 0;
//height: $heightitem;
line-height: $heightitem;
min-height: $heightitem;
text-align: center;
vertical-align: middle;
// background-color: #ff4081;
font-size: 1rem;
order: 2;
flex: 1;
// order: 1;
// flex: 1;
}
.pos-group {
order: 1;
}
.pos-go {
order: 1;
}
.titleLista-item {
@@ -92,8 +98,8 @@ $heightdescr: 20px;
.pos-item-popover{
max-width: 24px;
min-width: 24px;
// max-width: 24px;
// min-width: 24px;
padding: 0px;
text-align: center;
vertical-align: middle;
@@ -247,6 +253,7 @@ $heightdescr: 20px;
font-size: 1rem;
display: table;
flex: 1;
order: 1;
height: $heightitem;
vertical-align: middle;
}
@@ -386,5 +393,3 @@ $heightdescr: 20px;
flex: 1;
}
*/

View File

@@ -1,8 +1,26 @@
<template>
<div :class="getClassRow()" @click="clickProject">
<q-btn :disable="isDisable" class="flex-item donotdrag " size="sm" push color="primary" round icon="arrow_forward"
:to="getrouteto"></q-btn>
<q-btn
v-if="isProject()"
:class="(itemproject.respUsername !== '' && itemproject.viceRespUsername !== '') ? 'clresp' : 'clrespempty' + ' clButtPopover pos-item'"
:readonly="!CanIModifyProject"
size="sm"
dense
flat
@mousedown="clickRiga"
:disable="!CanIModifyProject"
icon="menu">
<q-menu ref="popmenu" self="top right">
<SubMenusProj :menuPopupProj="menuPopupProj" :itemproject="itemproject" @clickMenu="clickMenu"
@selectSubMenu="selectSubMenu"></SubMenusProj>
</q-menu>
</q-btn>
<!--<div :class="(itemproject.respUsername !== '' && itemproject.viceRespUsername !== '') ? 'clresp' : 'clrespempty' + ' pos-group flex-item'">
<q-icon class="" name="fas fa-user-friends"></q-icon>
</div>-->
<!--<div class="q-mx-xs"></div>-->
<div class="flex-item donotdrag divdescrTot">
<q-input v-if="(sel && inEdit)" hide-underline type="textarea" ref="inputprojdescr"
@@ -17,17 +35,20 @@
</q-input>
<div v-else :class="classDescr"
@keydown="keyDownRow"><div class="clpos">{{ itemproject.pos }}: </div> {{ itemproject.descr }}
@keydown="keyDownRow">
<!--<div class="clpos">{{ itemproject.pos }}.</div> -->
{{ itemproject.descr }}
</div>
</div>
<div>
<!--<div>
{{ tools.getGroupById(itemproject.groupId) }}
</div>
</div>-->
<div v-if="isProject()" class="flex-item progress-item shadow-1">
<div v-if="isProject()" class="flex-item donotdrag progress-item shadow-1">
<q-linear-progress
stripe
rounded
@@ -47,18 +68,12 @@
data_class="data_string">
</CDate>
</div>
<div v-if="isProject()" class="flex-item pos-item " @mousedown="clickRiga">
<q-btn flat
:class="clButtPopover"
:readonly="!CanIModifyProject"
:disable="!CanIModifyProject"
icon="menu">
<q-menu ref="popmenu" self="top right">
<SubMenusProj :menuPopupProj="menuPopupProj" :itemproject="itemproject" @clickMenu="clickMenu"
@selectSubMenu="selectSubMenu"></SubMenusProj>
</q-menu>
<q-btn :disable="isDisable" class="flex-item donotdrag pos-go" size="sm" push color="primary" round
icon="arrow_forward"
:to="getrouteto">
</q-btn>
</div>
</div>
</template>

View File

@@ -13,6 +13,7 @@ import { UserStore } from '@store'
import { Getter } from 'vuex-class'
import { SingleTodo } from '../SingleTodo'
import { costanti } from '@src/store/Modules/costanti'
const namespace: string = 'Todos'
@@ -91,6 +92,7 @@ export default class CTodo extends Vue {
}
public created() {
if (costanti.DRAGULA) {
const service = this.$dragula.$service
tools.dragula_option(service, this.dragname)
@@ -112,6 +114,7 @@ export default class CTodo extends Vue {
service.eventBus.$on('drop', (el, source) => {
this.scrollable = true
})
}
this.load()
}
@@ -167,8 +170,7 @@ export default class CTodo extends Vue {
// empty the field
if (atfirst) {
this.todotop = ''
}
else {
} else {
this.todobottom = ''
}
@@ -188,7 +190,13 @@ export default class CTodo extends Vue {
//
// await Todos.actions.swapElems(itemdragend)
await Todos.actions.modify({ myitem, field })
Todos.actions.modify({ myitem, field })
.then((ris) => {
if (ris)
tools.showPositiveNotif(this.$q, 'Campo Aggiornato')
else
tools.showNegativeNotif(this.$q, 'Campo non Aggiornato!')
})
}

View File

@@ -3,7 +3,10 @@
<div class="panel">
<div v-if="!!title" class="divtitlecat">
<div class="flex-container">
<div class="flex-item categorytitle" :style="`background-color: ${backcolor} !important; color: ${forecolor} !important;`">{{title | capitalize}}</div>
<div class="flex-item categorytitle"
:style="`background-color: ${backcolor} !important; color: ${forecolor} !important;`">
{{ title | capitalize }}
</div>
<div class="flex-item">
<q-btn push
size="sm"
@@ -15,7 +18,7 @@
<q-icon :name="field.icon"/>
</q-item-section>
<q-item-section>{{field.label}}</q-item-section>
<q-item-section>{{ field.label }}</q-item-section>
<q-item-section side v-if="showTask(field.value)">
<q-item-section side>
@@ -35,7 +38,7 @@
<q-icon :name="opt.icon" inverted color="primary"/>
</q-item-section>
<q-item-section>
{{opt.label}}
{{ opt.label }}
</q-item-section>
</q-item>
</q-list>
@@ -67,31 +70,34 @@
<div style="display: none">{{ prior = 0, priorcomplet = false }}</div>
<div>
<!--<q-infinite-scroll :handler="loadMoreTodo" :offset="7">-->
<div class="container" v-dragula="items_dacompletare(categoryAtt)" :drake="dragname">
<!--<div class="container" v-dragula="items_dacompletare(categoryAtt)" :drake="dragname">-->
<div class="container">
<div :id="tools.getmyid(mytodo._id)" :index="index"
v-for="(mytodo, index) in items_dacompletare(categoryAtt)"
:key="mytodo._id" class="myitemdrag">
<div v-if="(prior !== mytodo.priority) && mytodo.statustodo !== tools.Status.COMPLETED"
:class="tools.getTitlePriority(mytodo.priority)">
<label>{{tools.getPriorityByInd(mytodo.priority)}}</label>
<label>{{ tools.getPriorityByInd(mytodo.priority) }}</label>
</div>
<SingleTodo ref="single" @deleteItemtodo="mydeleteitemtodo(mytodo._id)" @eventupdate="updateitemtodo"
@setitemsel="setitemsel" @deselectAllRowstodo="deselectAllRowstodo" @deselectAllRowsproj="deselectAllRowsproj" @onEnd="onEndtodo"
@setitemsel="setitemsel" @deselectAllRowstodo="deselectAllRowstodo"
@deselectAllRowsproj="deselectAllRowsproj" @onEnd="onEndtodo"
:itemtodo='mytodo' :CanIModifyTodo="CanIModifyTodo">
</SingleTodo>
<!--<div :nametranslate="`REF${index}`" class="divdrag non-draggato"></div>-->
<div style="display: none">{{ prior = mytodo.priority, priorcomplet = (mytodo.statustodo === tools.Status.COMPLETED) }}
<div style="display: none">
{{ prior = mytodo.priority, priorcomplet = (mytodo.statustodo === tools.Status.COMPLETED) }}
</div>
</div>
</div>
<!--</q-infinite-scroll>-->
<div v-if="doneTodosCount > 0" class="titleCompleted">
<label>{{$t('todo.completed')}}</label>
<label>{{ $t('todo.completed') }}</label>
</div>
<!--<q-infinite-scroll :handler="loadMoreTodo" :offset="7">-->
@@ -101,12 +107,14 @@
:key="mytodo._id" class="myitemdrag">
<SingleTodo ref="single" @deleteItemtodo="mydeleteitemtodo(mytodo._id)" @eventupdate="updateitemtodo"
@setitemsel="setitemsel" @deselectAllRowstodo="deselectAllRowstodo" @deselectAllRowsproj="deselectAllRowsproj" @onEnd="onEndtodo"
@setitemsel="setitemsel" @deselectAllRowstodo="deselectAllRowstodo"
@deselectAllRowsproj="deselectAllRowsproj" @onEnd="onEndtodo"
:itemtodo='mytodo'/>
<!--<div :nametranslate="`REF${index}`" class="divdrag non-draggato"></div>-->
<div style="display: none">{{ prior = mytodo.priority, priorcomplet = (mytodo.statustodo === tools.Status.COMPLETED) }}
<div style="display: none">
{{ prior = mytodo.priority, priorcomplet = (mytodo.statustodo === tools.Status.COMPLETED) }}
</div>
</div>
</div>
@@ -159,5 +167,5 @@
<script lang="ts" src="./CTodo.ts">
</script>
<style lang="scss" scoped>
@import './CTodo.scss';
@import './CTodo.scss';
</style>

View File

@@ -10,7 +10,20 @@
</q-btn>
</div>
<q-icon :name="iconPriority"/>
<div :class="classMenuBtn" @mousedown="clickRiga">
<q-btn flat
:class="clButtPopover"
:readonly="!CanIModifyTodo"
icon="menu">
<q-menu v-if="CanIModifyTodo" ref="popmenu" self="top right">
<SubMenus :menuPopupTodo="menuPopupTodo" :itemtodo="itemtodo" @clickMenu="clickMenu"
@selectSubMenu="selectSubMenu"></SubMenus>
</q-menu>
</q-btn>
</div>
<!-- <q-icon :name="iconPriority"/> -->
<div class="flex-item donotdrag divdescrTot">
<q-input v-if="sel && inEdit && itemtodo.statustodo !== tools.Status.COMPLETED" hide-underline type="textarea"
@@ -24,7 +37,7 @@
@keydown="keyDownArea" v-on:keydown.esc="exitEdit" @blur="exitEdit(true)" @click="editTodo()"></q-input>
<div v-else :class="classDescr"
@keydown="keyDownRow"><div class="clpos">{{itemtodo.pos}}: </div> {{ itemtodo.descr }}
@keydown="keyDownRow">{{ itemtodo.descr }}
</div>
@@ -63,24 +76,11 @@
</div>
</div>
<div v-if="itemtodo.enableExpiring" :class="classExpiring">
<CDate :mydate="itemtodo.expiring_at" @input="itemtodo.expiring_at = new Date(arguments[0])"
data_class="data_string" :readonly="!CanIModifyTodo">
</CDate>
</div>
<div :class="classMenuBtn" @mousedown="clickRiga">
<q-btn flat
:class="clButtPopover"
:readonly="!CanIModifyTodo"
icon="menu">
<q-menu v-if="CanIModifyTodo" ref="popmenu" self="top right">
<SubMenus :menuPopupTodo="menuPopupTodo" :itemtodo="itemtodo" @clickMenu="clickMenu"
@selectSubMenu="selectSubMenu"></SubMenus>
</q-menu>
</q-btn>
</div>
</div>
</template>

View File

@@ -116,7 +116,7 @@ export default class MixinBase extends MixinMetaTags {
myrec.serv = serv
if ((myrec.type === tools.FieldType.date) || (myrec.type === tools.FieldType.onlydate))
myrec.value_date = value
else if (myrec.type === tools.FieldType.number)
else if ((myrec.type === tools.FieldType.number) || (myrec.type === tools.FieldType.hours))
myrec.value_num = value
else if (myrec.type === tools.FieldType.boolean)
myrec.value_bool = value

View File

@@ -24,6 +24,13 @@ export interface IEvents {
linkpage?: string
linkpdf?: string
nobookable?: boolean
lunchAvailable?: boolean
dinnerAvailable?: boolean
lunchType?: number
dinnerType?: number
lunchPrice?: number
dinnerPrice?: number
internal?: boolean
news?: boolean
canceled?: boolean
deleted?: boolean
@@ -36,6 +43,8 @@ export interface IBookedEvent {
userId: string
id_bookedevent?: any
numpeople: number
numpeopleLunch?: number
numpeopleDinner?: number
infoevent: string
msgbooking: string
datebooked?: Date

View File

@@ -166,6 +166,7 @@ export interface IGlobalState {
category: string
stateConnection: string
networkDataReceived: boolean
clickcmd?: string
cfgServer: ICfgServer[]
testp1: ITestp1
connData: IConnData
@@ -449,3 +450,11 @@ export const DefaultNewsState: INewsState = {
totunsubscribed: 0,
totsentlastid: 0
}
export interface IPagination {
sortBy: string,
descending: boolean
rowsNumber: number
page: number,
rowsPerPage: number // specifying this determines pagination is server-side
}

View File

@@ -62,7 +62,8 @@ export const Privacy = {
all: 'all',
friends: 'friends',
mygroup: 'mygroup',
onlyme: 'onlyme'
onlyme: 'onlyme',
inherited: 'inherited'
}
export const TypeProj = {

View File

@@ -30,7 +30,7 @@ export default class Eventlist extends Vue {
public getEventsBookedByIdEvent: (state: ICalendarState, id, showall) => IBookedEvent[]
@Getter('getNumParticipants', { namespace })
public getNumParticipants: (state: ICalendarState, event: IEvents, showall) => number
public getNumParticipants: (state: ICalendarState, event: IEvents, showall, tipo) => number
public getNameSurnameByUserId(userid) {
return UserStore.getters.getNameSurnameByUserId(userid)
@@ -51,7 +51,7 @@ export default class Eventlist extends Vue {
let add = true
if (!this.showall) {
add = CalendarStore.getters.getNumParticipants(myevent, this.showall) > 0
add = CalendarStore.getters.getNumParticipants(myevent, this.showall, 0) > 0
}
if (add) {
@@ -96,7 +96,7 @@ export default class Eventlist extends Vue {
let add = true
if (!this.showall) {
add = CalendarStore.getters.getNumParticipants(myevent, this.showall) > 0
add = CalendarStore.getters.getNumParticipants(myevent, this.showall, 0) > 0
}
if (add) {

View File

@@ -1,5 +1,6 @@
<template>
<CMyPage title="Events" keywords="" description="" imgbackground="../../statics/images/calendario_eventi.jpg" sizes="max-height: 120px">
<CMyPage title="Events" keywords="" description="" imgbackground="../../statics/images/calendario_eventi.jpg"
sizes="max-height: 120px">
<div class="q-ma-sm q-pa-xs">
<div v-if="!showall" class="text-h6 bg-red text-white text-center q-pa-xs shadow-max">Lista delle tue
@@ -15,18 +16,26 @@
<div>
<q-markup-table wrap-cells bordered separator="horizontal" class="listaev__table">
<thead>
<th>{{$t('cal.data')}}</th>
<th>{{$t('cal.event')}}</th>
<th v-if="!tools.isMobile()">{{$t('cal.teachertitle')}}</th>
<th v-if="showall"><span v-if="!tools.isMobile()">{{$t('cal.selnumpeople')}}</span><span v-else>{{$t('cal.selnumpeople_short')}}</span>
<th>{{ $t('cal.data') }}</th>
<th>{{ $t('cal.event') }}</th>
<th v-if="!tools.isMobile()">{{ $t('cal.teachertitle') }}</th>
<th v-if="showall">
<span v-if="!tools.isMobile()">{{ $t('cal.selnumpeople') }}</span>
<span v-else>{{ $t('cal.selnumpeople_short') }}</span>
</th>
<th>{{$t('cal.peoplebooked')}}</th>
<th v-if="showall">
{{ $t('cal.selnumpeopleLunch') }}
</th>
<th v-if="showall">
{{ $t('cal.selnumpeopleDinner') }}
</th>
<th>{{ $t('cal.peoplebooked') }}</th>
</thead>
<tbody>
<tr v-for="(event, index) in getEventList()" class="listaev listaev__table">
<td>
<div class="text-center text-blue">{{func_tools.getDateStr(event.dateTimeStart)}}</div>
<div class="text-center text-blue">{{ func_tools.getDateStr(event.dateTimeStart) }}</div>
</td>
<td :class="">
<div class="text-center boldhigh">{{ event.title }}</div>
@@ -37,7 +46,13 @@
</div>
</td>
<td v-if="showall">
<div class="text-center">{{ getNumParticipants(event, showall) }}</div>
<div class="text-center">{{ getNumParticipants(event, showall, '') }}</div>
</td>
<td v-if="showall">
<div class="text-center">{{ getNumParticipants(event, showall, 'lunch') }}</div>
</td>
<td v-if="showall">
<div class="text-center">{{ getNumParticipants(event, showall, 'dinner') }}</div>
</td>
<td class="text-center">
<q-btn v-if="getNumParticipants(event, showall) > 0"
@@ -52,8 +67,8 @@
</tbody>
</q-markup-table>
<q-dialog v-model="showpeople">
<q-card v-if="eventsel">
<q-toolbar class="bg-primary text-white" :style="`min-width: ` + tools.myheight_dialog() + `px;`">
<q-card v-if="eventsel" :style="`min-width: ` + tools.myheight_dialog() + `px;`">
<q-toolbar class="bg-primary text-white">
<q-toolbar-title>
{{ eventsel.title }}
</q-toolbar-title>
@@ -72,16 +87,22 @@
<tr v-for="(eventbook, index) in getEventsBookedByIdEvent(eventsel._id, showall)"
class="listaev listaev__table">
<td class="text-center">
<div>{{func_tools.getDateTimeShortStr(eventbook.datebooked)}}
<div>{{ func_tools.getDateTimeShortStr(eventbook.datebooked) }}
</div>
</td>
<td class="text-center">
<strong>{{getNameSurnameByUserId(eventbook.userId)}}</strong> <span
<strong>{{ getNameSurnameByUserId(eventbook.userId) }}</strong> <span
v-if="eventbook.msgbooking"> {{ $t('sendmsg.write') }}: </span><br>
{{ eventbook.msgbooking }}
</td>
<td class="text-center">
{{eventbook.numpeople}}
{{ eventbook.numpeople }}
</td>
<td class="text-center">
{{ eventbook.numpeopleLunch }}
</td>
<td class="text-center">
{{ eventbook.numpeopleDinner }}
</td>
<td class="text-center">
<q-btn flat round color="red" icon="fas fa-trash-alt" size="sm"
@@ -110,5 +131,5 @@
<script lang="ts" src="./eventlist.ts">
</script>
<style lang="scss" scoped>
@import './eventlist.scss';
@import './eventlist.scss';
</style>

View File

@@ -494,7 +494,7 @@ const msg_it = {
todo: {
titleprioritymenu: 'Priorità:',
inserttop: 'Inserisci il Task in cima',
insertbottom: 'Inserisci il Task in basso',
insertbottom: 'Inserisci quì una Nuova Attività',
edit: 'Descrizione Task:',
completed: 'Ultimi Completati',
usernotdefined: 'Attenzione, occorre essere Loggati per poter aggiungere un Todo',
@@ -589,6 +589,10 @@ const msg_it = {
eventstartdatetime: 'Inizio',
enterEndDateTime: 'Fine',
selnumpeople: 'Partecipanti',
Lunch: 'Pranzo',
Dinner: 'Cena',
selnumpeopleLunch: 'Persone a Pranzo',
selnumpeopleDinner: 'Persone a Cena',
selnumpeople_short: 'Num',
msgbooking: 'Messaggio da inviare',
showpdf: 'Vedi PDF',
@@ -630,6 +634,13 @@ const msg_it = {
linkpage: 'WebSite',
linkpdf: 'Link ad un PDF',
nobookable: 'Non Prenotabile',
internal: 'Evento Interno',
lunchAvailable: 'Disponibilità di Pranzare',
dinnerAvailable: 'Disponibilità di Cenare',
lunchType: 'Tipo di Pranzo',
dinnerType: 'Tipo di Cena',
lunchPrezzo: 'Contributo Pranzo',
dinnerPrezzo: 'Contributo Cena',
news: 'Novità',
dupId: 'Id Duplicato',
canceled: 'Cancellato',

View File

@@ -7,7 +7,8 @@ import { tools } from '@src/store/Modules/tools'
import { toolsext } from '@src/store/Modules/toolsext'
export const OtherTables = ['categories', 'config', 'swmsg']
export const MainTables = ['todos', 'projects']
// export const MainTables = ['todos', 'projects']
export const MainTables = []
export const allMethod = ['sync_post_', 'sync_patch_', 'delete_', 'hide_']
export function getLinkByTableName(nametable) {
@@ -44,7 +45,7 @@ export function allTables() {
async function dbInsertSave(call, item, method) {
let ret = true
if (!('serviceWorker' in navigator)) {
if (!useServiceWorker()) {
console.log('dbInsertSave', item, method)
@@ -76,7 +77,8 @@ async function dbInsertSave(call, item, method) {
async function dbDeleteItem(call, item) {
if (!('serviceWorker' in navigator)) {
let res = true
if (!useServiceWorker()) {
// console.log('dbdeleteItem', item)
if (UserStore.getters.isUserInvalid) {
return false
@@ -84,9 +86,10 @@ async function dbDeleteItem(call, item) {
call = '/' + call
const res = await Api.SendReq(call + item._id, 'DELETE', null)
res = await Api.SendReq(call + '/' + item._id, 'DELETE', null)
.then((myres) => {
console.log('dbdeleteItem to the Server')
// tools.showPositiveNotif(this.$q, 'Riga cancellata')
return myres
})
.catch((error) => {
@@ -96,11 +99,13 @@ async function dbDeleteItem(call, item) {
return res
}
return res
}
async function dbHideItem(call, item) {
if (!('serviceWorker' in navigator)) {
if (!useServiceWorker()) {
// console.log('dbdeleteItem', item)
if (UserStore.getters.isUserInvalid) {
return false
@@ -150,7 +155,7 @@ async function Sync_Execute(cmd, tablesync, nametab, method, item: ITodo, id, ms
// console.log('serviceWorker NON PRESENTE !')
// }
if ('serviceWorker' in navigator) {
if (useServiceWorker()) {
return await navigator.serviceWorker.ready
.then((sw) => {
// console.log('---------------------- navigator.serviceWorker.ready')
@@ -210,17 +215,18 @@ async function Sync_ExecuteCmd(cmd, nametab: string, method, item: ITodo, id, ms
const risdata = await Sync_Execute(cmd, tablesync, nametab, method, item, id, msg)
let ris = false
if (cmd === DB.CMD_SYNC_NEW) {
if ((method === 'POST') || (method === 'PATCH')) {
await dbInsertSave(nametab, item, method)
ris = await dbInsertSave(nametab, item, method)
}
} else if (cmd === DB.CMD_DELETE) {
await dbDeleteItem(nametab, item)
ris = await dbDeleteItem(nametab, item)
} else if (cmd === DB.CMD_HIDE) {
await dbHideItem(nametab, item)
ris = await dbHideItem(nametab, item)
}
return risdata
return ris
}
export async function Sync_SaveItem(nametab: string, method, item) {
@@ -246,7 +252,7 @@ export async function aftercalling(ris, checkPending: boolean, nametabindex: str
} else {
tools.consolelogpao('NETWORK UNREACHABLE ! (Error in fetch)', UserStore.getters.getServerCode, ris.status)
}
if ('serviceWorker' in navigator) {
if (useServiceWorker()) {
// Read all data from IndexedDB Store into Memory
await updatefromIndexedDbToState(nametabindex)
}
@@ -296,11 +302,16 @@ async function checkPendingMsg() {
}
function useServiceWorker() {
return false
// return 'serviceWorker' in navigator
}
// If something in the call of Service Worker went wrong (Network or Server Down), then retry !
async function sendSwMsgIfAvailable() {
let something = false
if ('serviceWorker' in navigator) {
if (useServiceWorker()) {
console.log(' -------- sendSwMsgIfAvailable')
const count = await checkPendingMsg()
@@ -344,7 +355,7 @@ async function sendSwMsgIfAvailable() {
})
}
async function waitAndRefreshData() {
export async function waitAndRefreshData() {
// #Todo++ waitAndRefreshData: Check if is OK
await Projects.actions.dbLoad({ checkPending: false, onlyiffirsttime: false })
return await Todos.actions.dbLoad({ checkPending: false })
@@ -428,14 +439,14 @@ function setmodifiedIfchanged(recOut, recIn, field) {
}
export async function table_ModifyRecord(nametable, myitem, listFieldsToChange, field) {
console.log('table_ModifyRecord ... ', nametable)
// console.log('table_ModifyRecord ... ', nametable)
if (myitem === null) {
return new Promise((resolve, reject) => {
resolve()
})
}
// console.log('--> table_ModifyRecord', nametable, myitem.descr)
console.log('--> table_ModifyRecord', nametable, myitem)
if ((field === 'status') && (nametable === 'todos') && (myitem.status === tools.Status.COMPLETED)) {
myitem.completed_at = tools.getDateNow()
@@ -443,17 +454,25 @@ export async function table_ModifyRecord(nametable, myitem, listFieldsToChange,
const myobjsaved = tools.jsonCopy(myitem)
let miorec = null
if (useServiceWorker()) {
// get record from IndexedDb
const miorec = await globalroutines(null, 'read', nametable, null, myobjsaved._id)
miorec = await globalroutines(null, 'read', nametable, null, myobjsaved._id)
if (miorec === undefined) {
console.log('~~~~~~~~~~~~~~~~~~~~ !!!!!!!!!!!!!!!!!! Record not Found !!!!!! id=', myobjsaved._id)
return
}
// Prova cmq a salvarlo sul server
return Sync_SaveItem(nametable, 'PATCH', miorec)
}
listFieldsToChange.forEach((myfield) => {
setmodifiedIfchanged(miorec, myobjsaved, myfield)
})
} else {
miorec = myitem
miorec.modified = true
}
console.log( ' ... 4 ')
if (miorec.modified) {
@@ -464,6 +483,7 @@ export async function table_ModifyRecord(nametable, myitem, listFieldsToChange,
// 1) Permit to Update the Views
tools.notifyarraychanged(miorec)
if (useServiceWorker()) {
// 2) Modify on IndexedDb
console.log('// 2) Modify on IndexedDb', miorec)
return globalroutines(null, 'write', nametable, miorec)
@@ -475,6 +495,9 @@ export async function table_ModifyRecord(nametable, myitem, listFieldsToChange,
})
// } else {
// console.log(' ', miorec.descr, 'NON MODIF!')
} else {
return Sync_SaveItem(nametable, 'PATCH', miorec)
}
}
}

View File

@@ -48,6 +48,7 @@ const state: IGlobalState = {
rightCartOpen: false,
stateConnection: stateConnDefault,
networkDataReceived: false,
clickcmd: '',
cfgServer: [],
testp1: { contatore: 0, mioarray: [] },
category: 'personal',
@@ -240,6 +241,10 @@ namespace Getters {
return mystate.settings.find((rec) => rec.key === key)
}, 'getrecSettingsByKey')
const getCmdClick = b.read((mystate: IGlobalState) => (): string => {
return mystate.clickcmd
}, 'getCmdClick')
const getValueSettingsByKey = b.read((mystate: IGlobalState) => (key, serv): any => {
const myrec = getters.getrecSettingsByKey(key, serv)
@@ -247,7 +252,7 @@ namespace Getters {
if (!!myrec) {
if ((myrec.type === tools.FieldType.date) || (myrec.type === tools.FieldType.onlydate))
return myrec.value_date
else if (myrec.type === tools.FieldType.number)
else if ((myrec.type === tools.FieldType.number) || (myrec.type === tools.FieldType.hours))
return myrec.value_num
else if (myrec.type === tools.FieldType.boolean)
return myrec.value_bool
@@ -303,6 +308,10 @@ namespace Getters {
return getListByTable()
},
get getCmdClick() {
return getCmdClick()
},
get getValueSettingsByKey() {
return getValueSettingsByKey()
},
@@ -354,6 +363,11 @@ namespace Mutations {
state.testp1.mioarray = newarr
}
function changeCmdClick(mystate: IGlobalState, value: string) {
console.log('changeCmdClick', value)
mystate.clickcmd = value
}
function setPaoArray_Delete(state: IGlobalState) {
state.testp1.mioarray.pop()
}
@@ -439,7 +453,7 @@ namespace Mutations {
if (!!myrec) {
if ((myrec.type === tools.FieldType.date) || (myrec.type === tools.FieldType.onlydate))
myrec.value_date = value
else if (myrec.type === tools.FieldType.number)
else if ((myrec.type === tools.FieldType.number) || (myrec.type === tools.FieldType.hours))
myrec.value_num = value
else if (myrec.type === tools.FieldType.boolean)
myrec.value_bool = value
@@ -457,6 +471,7 @@ namespace Mutations {
setCategorySel: b.commit(setCategorySel),
setStateConnection: b.commit(setStateConnection),
SetwasAlreadySubOnDb: b.commit(SetwasAlreadySubOnDb),
changeCmdClick: b.commit(changeCmdClick),
saveConfig: b.commit(saveConfig),
setPaoArray: b.commit(setPaoArray),
setPaoArray_Delete: b.commit(setPaoArray_Delete),

View File

@@ -37,6 +37,19 @@ const listFieldsUpdateCalculation: string [] = ['hoursplanned', 'hoursleft', 'ho
const b = storeBuilder.module<IProjectsState>('Projects', stateglob)
const stateGetter = b.state()
function getFirstInherited(proj, idparent, state) {
let myprojtocheck = null
while (proj.privacyread === Privacy.inherited) {
myprojtocheck = state.projects.find((rec) => rec._id === idparent)
if (!myprojtocheck)
return null
idparent = myprojtocheck.id_parent
proj = myprojtocheck
}
return myprojtocheck
}
function getarrByCategory(category: string) {
if (!stateglob.projects) {
return []
@@ -66,7 +79,7 @@ function getproj(projects, idproj, tipoproj: string) {
else if (tipoproj === RouteNames.projectsshared)
ris = projects.filter((proj) => (proj.id_parent === idproj) && (proj.userId === UserStore.state.my._id) && (proj.privacyread !== Privacy.onlyme))
else if (tipoproj === RouteNames.projectsall)
ris = projects.filter((proj) => (proj.id_parent === idproj) && (proj.userId !== UserStore.state.my._id) )
ris = projects.filter((proj) => (proj.id_parent === idproj) && (proj.userId !== UserStore.state.my._id))
if (ris)
ris = ris.sort((a, b) => a.pos - b.pos)
@@ -105,8 +118,8 @@ namespace Getters {
hoursplanned: 0,
hoursleft: 0,
progressCalc: 0,
privacyread: 'onlyme',
privacywrite: 'onlyme',
privacyread: 'inherited',
privacywrite: 'inherited',
begin_development: tools.getDateNull(),
begin_test: tools.getDateNull(),
hoursweeky_plannedtowork: 0,
@@ -147,6 +160,33 @@ namespace Getters {
}
}, 'listaprojects')
const listagerarchia = b.read((state: IProjectsState) => (tipoproj: string, idparent: string): IMenuList[] => {
if (state.projects) {
// console.log('listagerarchia', idparent)
const myarrgerarchia: IMenuList[] = []
let myidparent = idparent
let precmyparent = '-1'
while (state.projects && myidparent) {
const proj = state.projects.find((rec) => rec._id === myidparent)
if (proj) {
myarrgerarchia.push({ nametranslate: '', description: proj.descr, idelem: proj._id })
} else {
break
}
if (myidparent === proj.id_parent || (!proj.id_parent && (precmyparent === myidparent)))
break
precmyparent = myidparent
myidparent = proj.id_parent
}
// console.log(' myarrgerarchia', myarrgerarchia)
return myarrgerarchia.reverse()
} else {
return []
}
}, 'listagerarchia')
const getDescrById = b.read((state: IProjectsState) => (id: string): string => {
if (id === process.env.PROJECT_ID_MAIN)
return 'Projects'
@@ -177,9 +217,19 @@ namespace Getters {
if (UserStore.state.my._id === proj.userId) // If it's the owner
return true
return (proj.privacyread === Privacy.all) ||
(proj.privacyread === Privacy.friends) && (UserStore.getters.IsMyFriend(proj.userId))
|| ((proj.privacyread === Privacy.mygroup) && (UserStore.getters.IsMyGroup(proj.userId)))
let myprojtocheck = proj
if (proj.privacyread === Privacy.inherited) {
myprojtocheck = getFirstInherited(proj, proj.id_parent, state)
if (!myprojtocheck)
return true
}
console.log('privacyread', myprojtocheck.privacyread)
return (UserStore.state.my._id === myprojtocheck.userId) || (myprojtocheck.privacyread === Privacy.all) ||
(myprojtocheck.privacyread === Privacy.friends) && (UserStore.getters.IsMyFriend(myprojtocheck.userId))
|| ((myprojtocheck.privacyread === Privacy.mygroup) && (UserStore.getters.IsMyGroup(myprojtocheck.userId)))
} else {
return false
}
@@ -191,8 +241,18 @@ namespace Getters {
return false
if (!!UserStore) {
let myprojtocheck = proj
if (proj.privacywrite === Privacy.inherited) {
myprojtocheck = getFirstInherited(proj, proj.id_parent, state)
if (!myprojtocheck)
return true
}
if (!!UserStore.state)
return ((UserStore.state.my._id === proj.userId) || (proj.privacywrite === Privacy.all)) // If it's the owner
return (UserStore.state.my._id === myprojtocheck.userId) || (myprojtocheck.privacywrite === Privacy.all) ||
(myprojtocheck.privacywrite === Privacy.friends) && (UserStore.getters.IsMyFriend(myprojtocheck.userId))
|| ((myprojtocheck.privacywrite === Privacy.mygroup) && (UserStore.getters.IsMyGroup(myprojtocheck.userId)))
else
return false
}
@@ -215,6 +275,9 @@ namespace Getters {
get listaprojects() {
return listaprojects()
},
get listagerarchia() {
return listagerarchia()
},
get getDescrById() {
return getDescrById()
},
@@ -236,17 +299,16 @@ namespace Mutations {
}
if (atfirst) {
state.projects.unshift(objproj)
}
else {
} else {
state.projects.push(objproj)
}
}
function updateProject(state: IProjectsState, { objproj }) {
if (!!objproj) {
console.log('updateProject', objproj)
// console.log('updateProject', objproj)
const index = tools.getIndexById(state.projects, objproj._id)
console.log('index', index)
// console.log('index', index)
if (index >= 0) {
updateDataCalculated(state.projects[index], objproj)
@@ -263,7 +325,7 @@ namespace Mutations {
ApiTables.removeitemfromarray(state.projects, ind)
}
async function movemyitem(state: IProjectsState, { myitemorig, myitemdest } ) {
async function movemyitem(state: IProjectsState, { myitemorig, myitemdest }) {
const indorig = tools.getIndexById(state.projects, myitemorig._id)
state.projects.splice(indorig, 1)

View File

@@ -54,8 +54,8 @@ namespace Getters {
return mystate.bookedevent.find((bookedevent) => (bookedevent.id_bookedevent === myevent._id) && (bookedevent.userId === UserStore.state.my._id) && ((isconfirmed && bookedevent.booked) || (!isconfirmed)))
}, 'findEventBooked')
const getNumParticipants = b.read((mystate: ICalendarState) => (myevent: IEvents, showall) => {
const myarr = mystate.bookedevent.filter((bookedevent) => (bookedevent.id_bookedevent === myevent._id) && (bookedevent.booked) && (showall || (!showall && bookedevent.userId === UserStore.state.my._id) ))
const getNumParticipants = b.read((mystate: ICalendarState) => (myevent: IEvents, showall, tipo) => {
const myarr = mystate.bookedevent.filter((bookedevent) => (bookedevent.id_bookedevent === myevent._id) && (bookedevent.booked) && (showall || (!showall && bookedevent.userId === UserStore.state.my._id) ) && ((tipo === '') || ((tipo === 'lunch' && bookedevent.numpeopleLunch) || (tipo === 'dinner' && bookedevent.numpeopleDinner) )))
if (myarr)
return myarr.reduce((sum, bookedevent) => sum + bookedevent.numpeople, 0)
else
@@ -157,6 +157,8 @@ namespace Actions {
id_bookedevent: bookevent.id_bookedevent,
infoevent: bookevent.infoevent,
numpeople: bookevent.numpeople,
numpeopleLunch: bookevent.numpeopleLunch,
numpeopleDinner: bookevent.numpeopleDinner,
msgbooking: bookevent.msgbooking,
datebooked: bookevent.datebooked,
userId: UserStore.state.my._id,

View File

@@ -113,7 +113,7 @@ namespace Getters {
const todos_completati = b.read((stateparam: ITodosState) => (cat: string): ITodo[] => {
const indcat = getindexbycategory(cat)
console.log('todos_completati', cat, 'indcat=', indcat, 'state.categories=', state.categories)
// console.log('todos_completati', cat, 'indcat=', indcat, 'state.categories=', state.categories)
if (stateparam.todos[indcat]) {
let arrout = []
if (stateparam.showtype === costanti.ShowTypeTask.SHOW_LAST_N_COMPLETED) { // Show only the first N completed
@@ -234,7 +234,7 @@ namespace Mutations {
console.log('stateparam.categories', stateparam.categories)
console.log('myitemdest', myitemdest)
console.log('indcat', indcat, 'indcatdest', indcatdest, 'indorig', indorig)
// console.log('indcat', indcat, 'indcatdest', indcatdest, 'indorig', indorig)
if (indcatdest === -1) {
stateparam.categories.push(myitemdest.category)
@@ -288,7 +288,7 @@ namespace Actions {
// console.log('ARRAY TODOS = ', state.todos)
if (process.env.DEBUG === '1') {
console.log('dbLoad', 'state.todos', state.todos, 'state.categories', state.categories)
// console.log('dbLoad', 'state.todos', state.todos, 'state.categories', state.categories)
}
return res
@@ -438,7 +438,7 @@ namespace Actions {
}
async function modify(context, { myitem, field }) {
return await ApiTables.table_ModifyRecord(nametable, myitem, listFieldsToChange, field)
return ApiTables.table_ModifyRecord(nametable, myitem, listFieldsToChange, field)
}
async function swapElems(context, itemdragend: IDrag) {

View File

@@ -394,7 +394,6 @@ namespace Mutations {
}
function setusersList(mystate: IUserState, usersList: IUserFields[]) {
// console.log('setusersList', usersList)
mystate.usersList = [...usersList]
@@ -411,7 +410,6 @@ namespace Mutations {
localStorage.setItem(tools.localStorage.lang, state.lang)
}
function UpdatePwd(mystate: IUserState, x_auth_token: string) {
mystate.x_auth_token = x_auth_token
if (!mystate.my.tokens) {
@@ -670,6 +668,17 @@ namespace Actions {
})
}
async function reportload(context, paramquery) {
return await Api.SendReq('/report/load', 'POST', paramquery)
.then((res) => {
// console.log('res', res)
return res.data
}).catch((error) => {
return null
})
}
async function newsletter_setactivate(context, paramquery) {
return await Api.SendReq('/news/setactivate', 'POST', paramquery)
@@ -1065,6 +1074,7 @@ namespace Actions {
execDbOp: b.dispatch(execDbOp),
setLangServer: b.dispatch(setLangServer),
newsletterload: b.dispatch(newsletterload),
reportload: b.dispatch(reportload),
newsletter_setactivate: b.dispatch(newsletter_setactivate),
getDashboard: b.dispatch(getDashboard),
getDownline: b.dispatch(getDownline)

View File

@@ -14,5 +14,7 @@ export const costanti = {
CANCEL_BOOKING: 1
},
DRAGULA: false,
MAX_PHASES: 5,
}

View File

@@ -74,6 +74,8 @@ export const colgallery = [
fieldtype: tools.FieldType.listimages,
jointable: ''
}),
AddCol(DeleteRec),
AddCol(DuplicateRec)
]
export const colmsg_templates = [
@@ -90,7 +92,7 @@ export const colmsg_templates = [
AddCol({ name: 'title_pt', label_trans: 'Tit POR', fieldtype: tools.FieldType.string }),
AddCol({ name: 'msg_pt', label_trans: 'POR', fieldtype: tools.FieldType.html }),
AddCol({ name: 'title_fr', label_trans: 'Tit FRA', fieldtype: tools.FieldType.string }),
AddCol({ name: 'msg_fr', label_trans: 'FRA', fieldtype: tools.FieldType.html }),
AddCol({ name: 'msg_fr', label_trans: 'FRA', fieldtype: tools.FieldType.html })
]
export const colmypage = [
@@ -173,6 +175,8 @@ export const colTableProducer = [
AddCol({ name: 'city', label_trans: 'producer.city' }),
AddCol({ name: 'img', label_trans: 'producer.img' }),
AddCol({ name: 'website', label_trans: 'producer.website' }),
AddCol(DeleteRec),
AddCol(DuplicateRec)
]
export const getcolorderscart = [
@@ -182,42 +186,50 @@ export const getcolorderscart = [
AddCol({ name: 'items', label_trans: 'order.items' }),
AddCol({ name: 'userId', label_trans: 'order.users', fieldtype: tools.FieldType.select, jointable: 'users' }),
AddCol({ name: 'note', label_trans: 'order.note' }),
AddCol(DeleteRec),
AddCol(DuplicateRec)
]
export const colTableShareWithUs = [
AddCol({ name: 'description', label_trans: 'share.description' }),
AddCol({ name: 'numshared', label_trans: 'share.numshared', fieldtype: tools.FieldType.number }),
AddCol({ name: 'rating', label_trans: 'share.rating', fieldtype: tools.FieldType.number }),
AddCol(DeleteRec),
AddCol(DuplicateRec)
]
export const colTableHours = [
// AddCol({ name: 'userId', label_trans: 'hours.userId' }),
// AddCol({ name: 'todoId', label_trans: 'hours.todoId' }),
AddCol({ name: 'descr', label_trans: 'hours.descr' }),
AddCol({ name: 'username', label_trans: 'reg.username_short', notShowInNewRec: true }),
AddCol({ name: 'date', label_trans: 'hours.date', fieldtype: tools.FieldType.onlydate }),
AddCol({ name: 'hours', label_trans: 'hours.hours', fieldtype: tools.FieldType.hours }),
AddCol({ name: 'time_start', label_trans: 'hours.time_start', fieldtype: tools.FieldType.number }),
AddCol({ name: 'time_end', label_trans: 'hours.time_end', fieldtype: tools.FieldType.number }),
AddCol({ name: 'hours', label_trans: 'hours.hours', fieldtype: tools.FieldType.number }),
AddCol({ name: 'descr', label_trans: 'hours.note' }),
AddCol({ name: 'username', label_trans: 'reg.username_short', notShowInNewRec: true }),
AddCol(DeleteRec),
AddCol(DuplicateRec)
]
export const colTablegroups = [
AddCol({ name: 'descr', label_trans: 'share.description' }),
AddCol({ name: 'descr', label_trans: 'proj.longdescr' }),
AddCol({ name: 'resp', label_trans: 'reg.resp' }),
AddCol({ name: 'viceResp', label_trans: 'reg.viceResp' }),
AddCol({
name: 'assignedToUsers',
label_trans: 'reg.userslist',
fieldtype: tools.FieldType.multiselect,
jointable: 'users'
jointable: 'workers'
}),
AddCol(DeleteRec),
AddCol(DuplicateRec)
]
export const colTabledepartments = [
AddCol({ name: 'name', label_trans: 'store.name' }),
AddCol({ name: 'username', label_trans: 'store.username' })
AddCol({ name: 'username', label_trans: 'store.username' }),
AddCol(DeleteRec),
AddCol(DuplicateRec)
]
export const colTableStorehouse = [
@@ -229,6 +241,8 @@ export const colTableStorehouse = [
AddCol({ name: 'region', label_trans: 'store.region' }),
AddCol({ name: 'img', label_trans: 'store.img' }),
AddCol({ name: 'website', label_trans: 'store.website' }),
AddCol(DeleteRec),
AddCol(DuplicateRec)
]
export const colTableProducts = [
@@ -267,20 +281,23 @@ export const colTableProducts = [
AddCol({ name: 'weight', label_trans: 'products.weight', fieldtype: tools.FieldType.number }),
AddCol({ name: 'stars', label_trans: 'products.stars', fieldtype: tools.FieldType.number }),
AddCol({ name: 'date', label_trans: 'products.date', fieldtype: tools.FieldType.date }),
AddCol(DeleteRec)
AddCol(DeleteRec),
AddCol(DuplicateRec)
]
const colcontribtype = [
AddCol({ name: 'label', label_trans: 'proj.longdescr' }),
AddCol({ name: 'showprice', label_trans: 'event.showprice', fieldtype: tools.FieldType.boolean }),
AddCol(DeleteRec)
AddCol(DeleteRec),
AddCol(DuplicateRec)
]
const colpaymenttype = [
AddCol({ name: '_id', label_trans: 'others.value' }),
AddCol({ name: 'key', label_trans: 'reg.key' }),
AddCol({ name: 'label', label_trans: 'proj.longdescr' }),
AddCol(DeleteRec)
AddCol(DeleteRec),
AddCol(DuplicateRec)
]
const colworkers = [
@@ -288,7 +305,8 @@ const colworkers = [
AddCol({ name: 'username', label_trans: 'reg.username' }),
AddCol({ name: 'name', label_trans: 'reg.name' }),
AddCol({ name: 'surname', label_trans: 'reg.surname' }),
AddCol(DeleteRec)
AddCol(DeleteRec),
AddCol(DuplicateRec)
]
const colflotte = [
@@ -408,7 +426,8 @@ const coldisciplines = [
const colTablePermission = [
AddCol({ name: '_id', label_trans: 'others.value' }),
AddCol({ name: 'label', label_trans: 'proj.longdescr' }),
AddCol(DeleteRec)
AddCol(DeleteRec),
AddCol(DuplicateRec)
]
const colTableOperator = [
@@ -464,6 +483,7 @@ const colTableEvents = [
AddCol({ name: 'linkpage', label_trans: 'event.linkpage' }),
AddCol({ name: 'linkpdf', label_trans: 'event.linkpdf' }),
AddCol({ name: 'nobookable', label_trans: 'event.nobookable', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'internal', label_trans: 'event.internal', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'news', label_trans: 'event.news', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'canceled', label_trans: 'event.canceled', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'deleted', label_trans: 'event.deleted', fieldtype: tools.FieldType.boolean }),
@@ -529,7 +549,6 @@ export const fieldsTable = {
risultato = myris[collab]
}
if (key === 'username') {
console.log('key=', key, 'collab', collab, 'val', val)
console.log('myris', risultato)
@@ -625,7 +644,7 @@ export const fieldsTable = {
AddCol({ name: 'id_conf_zoom', label_trans: 'zoom.id_conf_zooom' }),
AddCol({ name: 'note', label_trans: 'zoom.note' }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
AddCol(DuplicateRec)
],
colTableUsersBase: [
@@ -1096,7 +1115,7 @@ export const fieldsTable = {
label: 'Lista Ingresso',
columns: collistaingresso,
colkey: '_id',
collabel: 'ind_order',
collabel: 'ind_order'
},
{
value: 'graduatorias',

View File

@@ -184,11 +184,13 @@ export const tools = {
multiselect: 256,
password: 512,
listimages: 1024,
image: 2048,
exact: 2048,
image: 3000,
nationality: 4096,
intcode: 5000,
multioption: 6000,
onlydate: 7000
onlydate: 7000,
hours: 8000
},
FieldTypeArr: [
@@ -201,7 +203,70 @@ export const tools = {
{ label: 'Number', value: 64 }
],
SelectHours: [
{
id: 0,
label: '0',
value: 0
},
{
id: 5,
label: '0.5',
value: 0.5
},
{
id: 10,
label: '1',
value: 1
},
{
id: 15,
label: '1.5',
value: 1.5
},
{
id: 20,
label: '2',
value: 2
},
{
id: 25,
label: '2.5',
value: 2.5
},
{
id: 30,
label: '3',
value: 3
},
{
id: 35,
label: '3.5',
value: 3.5
},
{
id: 40,
label: '4',
value: 4
},
{
id: 45,
label: '4.5',
value: 4.5
},
{
id: 50,
label: '5',
value: 5
}
],
SelectListNumPeople: [
{
id: 0,
label: '0',
value: 0
},
{
id: 1,
label: '1',
@@ -320,6 +385,11 @@ export const tools = {
id: 4,
label: translation.it.privacy.onlyme,
value: Privacy.onlyme
},
{
id: 5,
label: translation.it.privacy.inherited,
value: Privacy.inherited
}
],
es: [
@@ -342,6 +412,11 @@ export const tools = {
id: 4,
label: translation.es.privacy.onlyme,
value: Privacy.onlyme
},
{
id: 5,
label: translation.es.privacy.inherited,
value: Privacy.inherited
}
],
enUs: [
@@ -364,6 +439,11 @@ export const tools = {
id: 4,
label: translation.enUs.privacy.onlyme,
value: Privacy.onlyme
},
{
id: 5,
label: translation.enUs.privacy.inherited,
value: Privacy.inherited
}
]
},
@@ -1346,7 +1426,7 @@ export const tools = {
tools.notifyarraychanged(myarr)
console.log('arr FINALE', tools.logga_arrproj(myarr))
// console.log('arr FINALE', tools.logga_arrproj(myarr))
// Update the records:
}
@@ -1883,6 +1963,7 @@ export const tools = {
mycolor = 'primary'
}
q.notify({
// group: '',
message: msg,
icon: myicon,
classes: 'my-notif-class',
@@ -2561,14 +2642,14 @@ export const tools = {
getprivacyreadbytipoproj(tipoproj) {
if (tipoproj === RouteNames.myprojects)
return Privacy.onlyme
return Privacy.inherited
else
return Privacy.all
}
,
getprivacywritebytipoproj(tipoproj) {
return Privacy.onlyme
return Privacy.inherited
}
,
@@ -2736,13 +2817,13 @@ export const tools = {
} else if (Screen.width < 600) {
return '450'
} else if (Screen.width < 800) {
return '500'
return '550'
} else if (Screen.width < 900) {
return '700'
} else if (Screen.width < 1000) {
return '900'
return '800'
} else if (Screen.width < 1100) {
return '1000'
return '900'
} else {
return Screen.width - 200
}
@@ -4103,6 +4184,13 @@ export const tools = {
}
return mylist
},
IsLogged() {
if (!!UserStore)
return UserStore.state.isLogged
else
return false
}
// getLocale() {

View File

@@ -5,7 +5,8 @@ export const translation = {
all: 'Tutti',
friends: 'Amici',
mygroup: 'Gruppo',
onlyme: 'Solo io'
onlyme: 'Solo io',
inherited: 'Ereditato'
},
proj: {
newproj: 'Nuovo Progetto',
@@ -27,7 +28,8 @@ export const translation = {
all: 'Todos',
friends: 'Amigos',
mygroup: 'Grupos',
onlyme: 'Solo yo'
onlyme: 'Solo yo',
inherited: 'Ereditato'
},
proj: {
newproj: 'Nuevo Projecto',
@@ -49,7 +51,8 @@ export const translation = {
all: 'All',
friends: 'Friends',
mygroup: 'Group',
onlyme: 'Only me'
onlyme: 'Only me',
inherited: 'Inherited'
},
proj: {
newproj: 'New Project',

View File

@@ -1,7 +1,7 @@
import Vue from 'vue'
import { Component, Watch } from 'vue-property-decorator'
import { IAction, IDrag, IProject, IProjectsState, ITodo, Privacy, TypeProj } from '../../../model/index'
import { IAction, IDrag, IGlobalState, IProject, IProjectsState, ITodo, Privacy, TypeProj } from '../../../model/index'
import { SingleProject } from '../../../components/projects/SingleProject/index'
import { CTodo } from '../../../components/todos/CTodo'
@@ -10,7 +10,7 @@ import { toolsext } from '@src/store/Modules/toolsext'
import { lists } from '../../../store/Modules/lists'
import * as ApiTables from '../../../store/Modules/ApiTables'
import { GlobalStore, Projects, Todos } from '@store'
import { GlobalStore, Projects, Todos, UserStore } from '@store'
import { Getter } from 'vuex-class'
@@ -19,12 +19,18 @@ import { CProgress } from '../../../components/CProgress'
import { CDate } from '../../../components/CDate'
import { CMyFieldDb } from '../../../components/CMyFieldDb'
import { CHours } from '../../../components/CHours'
import { waitAndRefreshData } from '../../../store/Modules/ApiTables'
import { CGridTableRec } from '@components'
import { shared_consts } from '@src/common/shared_vuejs'
import { colTableHours } from '@src/store/Modules/fieldsTable'
import { costanti } from '@src/store/Modules/costanti'
const namespace: string = 'Projects'
const namespaceGS: string = 'GlobalState'
@Component({
components: { SingleProject, CProgress, CTodo, CDate, CMyFieldDb, CHours },
components: { SingleProject, CProgress, CTodo, CDate, CMyFieldDb, CHours, CGridTableRec },
filters: {
capitalize(value) {
if (!value) {
@@ -73,7 +79,20 @@ export default class ProjList extends Vue {
return cl
}
get tipoProj() {
get classTitleProjSelBread() {
let cl = 'flex-item shadow-4'
if (!!this.itemselproj) {
cl += ' text-' + this.itemselproj.themecolor + ' bg-' + this.itemselproj.themebgcolor
} else {
cl += ' text-black'
}
if (!tools.isMobile())
cl += ' full-width '
return cl
}
get gettipoProj() {
// console.log('this.$route.name', this.$route.name)
const myarr = this.$route.name.split('.')
if (myarr)
@@ -111,7 +130,28 @@ export default class ProjList extends Vue {
}
get getrouteup() {
return tools.getUrlByTipoProj(this.tipoProj) + this.itemproj.id_parent
let id = ''
if (!!this.itemselproj) {
id = this.itemselproj.id_parent
}
if (!!this.itemproj) {
id = this.itemproj.id_parent
}
this.tabproj = 'lista'
return tools.getUrlByTipoProj(this.gettipoProj) + id
}
public getroutebyid(id) {
return tools.getUrlByTipoProj(this.gettipoProj) + id
}
get idparentSel() {
if ((this.whatisSel === tools.WHAT_PROJECT) && !!this.itemselproj) {
return this.idProjAtt !== this.itemselproj._id
} else if ((this.whatisSel === tools.WHAT_TODO) && !!this.itemtodosel) {
return this.idProjAtt !== this.itemtodosel.category
}
return false
}
get tools() {
@@ -131,9 +171,17 @@ export default class ProjList extends Vue {
return this.idProjAtt === process.env.PROJECT_ID_MAIN
}
get isRootProjectAtt() {
if ((this.whatisSel === tools.WHAT_PROJECT) && (!!this.itemselproj.descr)) {
return this.itemselproj.descr === '__PROJECTS'
} else if ((this.whatisSel === tools.WHAT_TODO) && (!!this.itemtodosel.descr)) {
return this.itemproj.descr === '__PROJECTS'
}
}
get getIdParent() {
if (!!this.itemproj)
return this.itemproj.id_parent
if (!!this.itemselproj)
return this.itemselproj.id_parent
else
return ''
}
@@ -259,6 +307,7 @@ export default class ProjList extends Vue {
public idProjAtt: string = process.env.PROJECT_ID_MAIN
public splitterModel = 50 // start at 50%
public itemproj: IProject = null
public tipoproj: string = ''
public itemprojparent: IProject = null
public idsel: string = ''
public itemselproj: IProject = Projects.getters.getRecordEmpty()
@@ -267,6 +316,7 @@ export default class ProjList extends Vue {
public colProgress: string = 'blue'
public percProgress: string = 'percProgress'
public readonly: boolean = false
public tabcmd: string = ''
public selectStatus: any[] = tools.selectStatus[toolsext.getLocale()]
public selectPhase: any[] = tools.selectPhase[toolsext.getLocale()]
@@ -283,6 +333,27 @@ export default class ProjList extends Vue {
@Getter('projs_dacompletare', { namespace })
public projs_dacompletare: (state: IProjectsState, id_parent: string, tipoproj: string) => IProject[]
@Watch('GlobalStore.state.clickcmd')
public changeclickcmdOk(value) {
console.log('changeclickcmd', value)
if (GlobalStore.state.clickcmd !== '') {
const cmd = GlobalStore.state.clickcmd
if (cmd === 'back') {
this.tabproj = 'lista'
this.$router.replace(this.getrouteup)
} else if (cmd === 'ore') {
this.tabproj = 'ore'
} else if (cmd === 'stat') {
this.tabproj = 'stat'
} else if (cmd === 'nuovo') {
this.clickMenuProjList(lists.MenuAction.ADD_PROJECT)
}
GlobalStore.state.clickcmd = ''
}
}
// @Watch('projs_dacompletare')
// public changeitems() {
// this.updateindexProj()
@@ -291,16 +362,30 @@ export default class ProjList extends Vue {
@Watch('$route.name')
public changename() {
// console.log('tools.getUrlByTipoProj(this.tipoProj)', tools.getUrlByTipoProj(this.tipoProj))
// console.log('tools.getUrlByTipoProj(this.gettipoProj)', tools.getUrlByTipoProj(this.gettipoProj))
this.changeparent()
}
get listacrumb() {
let arrger = []
if (this.itemselproj)
arrger = Projects.getters.listagerarchia(this.gettipoProj, this.itemselproj._id)
else if (this.itemtodosel)
arrger = Projects.getters.listagerarchia(this.gettipoProj, this.itemtodosel.category)
return arrger
}
@Watch('$route.params.idProj')
public changeparent() {
// console.log('this.$route.params.idProj', this.$route.params)
console.log('this.$route.params.idProj', this.$route.params)
const oldtipoproj = this.tipoproj
this.idProjAtt = this.$route.params.idProj
this.tabproj = 'lista'
this.updateindexProj()
this.selproj()
if (oldtipoproj !== this.gettipoProj)
this.updateData()
}
@Watch('itemselproj.progressCalc')
@@ -308,6 +393,11 @@ export default class ProjList extends Vue {
this.updateclasses()
}
@Watch('itemselproj.groupid')
public change_group() {
this.updateclasses()
}
@Watch('itemselproj._id')
public changeidproj() {
this.aggiornastat()
@@ -358,6 +448,17 @@ export default class ProjList extends Vue {
Todos.actions.modify({ myitem: this.itemtodosel, field })
}
public modifyfieldproj(field) {
Projects.actions.modify({ myitem: this.itemselproj, field })
.then((ris) => {
console.log('ris', ris)
if (ris)
tools.showPositiveNotif(this.$q, 'Campo Aggiornato')
else
tools.showNegativeNotif(this.$q, 'Campo non Aggiornato!')
})
}
public selproj() {
this.deselectAllRowsproj(null, false, false)
this.deselectAllRowstodo(null, false, false)
@@ -374,6 +475,8 @@ export default class ProjList extends Vue {
}
public created() {
if (costanti.DRAGULA) {
const service = this.$dragula.$service
tools.dragula_option(service, this.dragname)
@@ -388,7 +491,7 @@ export default class ProjList extends Vue {
id_proj: this.idProjAtt,
newIndex: this.getElementIndex(args.el),
oldIndex: this.getElementOldIndex(args.el),
tipoproj: this.tipoProj
tipoproj: this.gettipoProj
}
// console.log('args', args, itemdragend)
@@ -402,6 +505,7 @@ export default class ProjList extends Vue {
service.eventBus.$on('drop', (el, source) => {
this.scrollable = true
})
}
this.load()
}
@@ -417,6 +521,10 @@ export default class ProjList extends Vue {
// this.splitterModel = 50
// }
this.idProjAtt = this.$route.params.idProj
if (!this.idProjAtt) {
this.idProjAtt = process.env.PROJECT_ID_MAIN
}
console.log('this.idProjAtt', this.idProjAtt)
this.updateindexProj()
tools.touchmove(this.scrollable)
@@ -424,16 +532,21 @@ export default class ProjList extends Vue {
public async load() {
// console.log('LOAD PROJECTS....')
if (!!this.$route.params.idProj) {
this.idProjAtt = this.$route.params.idProj
if (!this.idProjAtt) {
this.idProjAtt = process.env.PROJECT_ID_MAIN
}
console.log('LOAD this.idProjAtt', this.idProjAtt)
if (!!this.idProjAtt) {
this.updateindexProj()
this.selproj()
}
this.selectGroup = tools.getGroupList()[toolsext.getLocale()]
this.selectResp = tools.getRespList()[toolsext.getLocale()]
this.selectWorkers = tools.getWorkersList()[toolsext.getLocale()]
console.log('this.selectGroup', this.selectGroup)
// console.log('this.selectGroup', this.selectGroup)
// Set last category selected
// localStorage.setItem(tools.localStorage.categorySel, this.categoryAtt)
@@ -463,13 +576,13 @@ export default class ProjList extends Vue {
this.projbottom = ''
return this.addProject(descr, this.tipoProj)
return this.addProject(descr, this.gettipoProj)
}
public async clickMenuProjList(action) {
// console.log('clickMenuProjList: ', action)
if (action === lists.MenuAction.ADD_PROJECT) {
const idnewelem = await this.addProject('test...', this.tipoProj)
const idnewelem = await this.addProject('inserisci qui...', this.gettipoProj)
// console.log('idnewelem', idnewelem)
// get element by id
const elem = this.getCompProjectById(idnewelem)
@@ -562,8 +675,10 @@ export default class ProjList extends Vue {
}
public setidsel(id: string) {
// console.log('setidsel', id)
this.idsel = id
this.whatisSel = tools.WHAT_PROJECT
this.tipoproj = this.gettipoProj
this.itemtodosel = null
this.itemselproj = Projects.getters.getRecordById(this.idsel)
if ((this.itemselproj === undefined || this.itemselproj === null))
@@ -571,6 +686,8 @@ export default class ProjList extends Vue {
// console.log('readonly = true')
this.readonly = true
// console.log(' itemselproj', this.itemselproj)
this.checkiftoenable()
}
@@ -613,6 +730,12 @@ export default class ProjList extends Vue {
// console.log('calling MODIFY updateitemproj', myitem, field)
await Projects.actions.modify({ myitem, field })
.then((ris) => {
if (ris)
tools.showPositiveNotif(this.$q, 'Campo Aggiornato')
else
tools.showNegativeNotif(this.$q, 'Campo non Aggiornato!')
})
}
@@ -621,10 +744,13 @@ export default class ProjList extends Vue {
// return false
try {
// @ts-ignore
for (const i in this.$refs.ctodo.$refs.single) {
// for (const i in this.$refs.ctodo.$refs.single) {
for (const elem of this.$refs.ctodo.$refs.single) {
// @ts-ignore
const contr = this.$refs.ctodo.$refs.single[i] as SingleTodo
// const contr = this.$refs.ctodo.$refs.single[i] as SingleTodo
const contr = elem as SingleTodo
let des = true
if (check) {
const id = contr.itemtodo._id
@@ -644,6 +770,9 @@ export default class ProjList extends Vue {
contr.deselectAndExitEdit()
}
}
} catch (e) {
}
}
public deselectAllRowsproj(item: IProject, check, onlythis: boolean = false, deselectRiga: boolean = false) {
@@ -664,9 +793,10 @@ export default class ProjList extends Vue {
if (this.$refs.singleproject === undefined)
return
for (const i in this.$refs.singleproject) {
try {
for (const elem of this.$refs.singleproject) {
const contr = this.$refs.singleproject[i] as SingleProject
const contr = elem as SingleProject
// @ts-ignore
const id = contr.itemproject._id
// Don't deselect the actual clicked!
@@ -685,6 +815,9 @@ export default class ProjList extends Vue {
contr.deselectAndExitEdit()
}
}
} catch (e) {
}
}
public updateclasses() {
@@ -699,6 +832,11 @@ export default class ProjList extends Vue {
ApiTables.waitAndcheckPendingMsg()
}
public updateData() {
ApiTables.waitAndRefreshData()
}
private updateindexProj() {
// console.log('idProjAtt', this.idProjAtt)
this.itemproj = Projects.getters.getRecordById(this.idProjAtt)
@@ -731,4 +869,101 @@ export default class ProjList extends Vue {
return iconpriority
}
get canShow() {
return ((this.whatisSel === tools.WHAT_PROJECT) && (!!this.itemselproj.descr)) ||
(this.whatisSel === tools.WHAT_TODO) && (!!this.itemtodosel.descr)
}
get showDescr() {
let mystr = ''
if ((this.whatisSel === tools.WHAT_PROJECT) && (!!this.itemselproj.descr)) {
mystr = this.itemselproj.descr
} else if ((this.whatisSel === tools.WHAT_TODO) && (!!this.itemtodosel.descr)) {
mystr = this.itemtodosel.descr
}
if (this.isRootProjectAtt)
return ''
return mystr
}
public clickrouteup() {
this.tabproj = 'lista'
this.selproj()
}
public pagination = {
sortBy: 'hours',
descending: true,
page: 2,
rowsPerPage: 5
// rowsNumber: xx if getting data from a server
}
get extraparams() {
return {
lk_tab: 'users',
lk_LF: 'userId',
lk_FF: '_id',
lk_as: 'user',
lk_proj: {
todoId: 1, userId: 1, descr: 1, date: 1, time_start: 1, time_end: 1, hours: 1,
username: 1, name: 1, surname: 1
}
}
}
public arrfilterand = [
{
label: 'Tutte le ore',
value: shared_consts.FILTER_HOURS_ALL
}
]
get myfilterdef() {
return [shared_consts.FILTER_HOURS_MYLIST]
}
get myarrfilterand() {
const myfiltrodef = {
label: 'Mie Ore',
value: shared_consts.FILTER_HOURS_MYLIST,
hide: true,
default: true
}
let myarr = []
myarr.push(myfiltrodef)
if (this.arrfilterand)
myarr = [...myarr, ...this.arrfilterand]
console.log('myarr', myarr)
return myarr
}
public selected = []
public dataPages = []
get getcolHours() {
return colTableHours
}
get getdefaultnewrec() {
const myrec = {
todoId: '',
userId: UserStore.state.my._id,
descr: '',
hours: 0
}
if (!!this.itemtodosel) {
myrec.todoId = this.itemtodosel._id
} else if (!!this.itemselproj) {
myrec.todoId = this.itemselproj._id
} else {
return null
}
return myrec
}
}

View File

@@ -1,52 +1,37 @@
<template>
<q-page>
<div class="panel">
<q-tabs
v-model="tabproj"
dense
class="bg-blue text-white shadow-2"
indicator-color="white"
align="center"
>
<q-tab name="lista" icon="fas fa-list-alt" :label="$t('gallery.list')"></q-tab>
<q-tab name="info" icon="fas fa-check" :label="$t('dashboard.info')" :disable="!whatisSel"></q-tab>
<q-tab v-if="(whatisSel === tools.WHAT_TODO) && (!!itemtodosel.descr)" name="ore" icon="fas fa-chart-line" :label="$t('pages.hours')" :disable="!whatisSel"></q-tab>
<q-tab name="stat" icon="fas fa-chart-line" :label="$t('pages.status')" :disable="!whatisSel"></q-tab>
</q-tabs>
<!--<q-splitter
v-model="splitterModel"
:horizontal="isHorizontal"
:style="myStyle"
:limits="[50, 100]"
<template v-slot:before>
>-->
<div v-if="(whatisSel === tools.WHAT_PROJECT) && (!!itemselproj.descr)">
</div>
<div v-else-if="(whatisSel === tools.WHAT_TODO) && (!!itemtodosel.descr)" name="info">
</div>
<q-tab-panels v-model="tabproj" animated>
<q-tab-panel name="lista">
<div>
<!-- idProjAtt: {{ idProjAtt }} -->
<div class="divtitlecat clMain">
<div class="flex-container clMain">
<q-btn v-if="!!getIdParent && CanISeeProjectParent" size="sm" push color="secondary" round
<div class="q-ml-md">
<div v-if="canShow">
<q-btn v-if="!isRootProjectAtt" size="md" push
color="secondary" round
icon="arrow_back"
@click="clickrouteup"
:to="getrouteup">
</q-btn>
</div>
</div>
<div :class="classTitleProjSelBread">
<div :class="classTitle">{{ descrProject | capitalize }}</div>
<div v-if="canShow">
<q-breadcrumbs gutter="xs">
<q-breadcrumbs-el v-for="(crumb, index) in listacrumb"
:key="index"
:label="crumb.description"
:to="getroutebyid(crumb.idelem)"/>
</q-breadcrumbs>
</div>
<div v-else>
Progetti:
</div>
<div class="flex-item">
</div>
<q-btn push
size="sm"
size="md"
icon="settings">
<q-menu id="popconfig" self="top right">
<q-list link separator no-border class="todo-menu">
@@ -99,16 +84,30 @@
</q-menu>
</q-btn>
</div>
<div class="flex-item categorytitle" v-if="(whatisSel === tools.WHAT_TODO)"> {{ showDescr }}</div>
</div>
</div>
<!--<q-splitter
v-model="splitterModel"
:horizontal="isHorizontal"
:style="myStyle"
:limits="[50, 100]"
<template v-slot:before>
>-->
<q-tab-panels v-model="tabproj" animated>
<q-tab-panel name="lista">
<div>
<!--idProjAtt: {{ idProjAtt }}-->
<div style="display: none">{{ prior = 0, priorcomplet = false }}</div>
<div>
<!--<q-infinite-scroll :handler="loadMoreTodo" :offset="7">-->
<div class="container" v-dragula="projs_dacompletare(idProjAtt, tipoProj)" drake="second">
<!--<div class="container" v-dragula="projs_dacompletare(idProjAtt, gettipoProj)" drake="second"> -->
<div class="container">
<div :id="tools.getmyid(myproj._id)" :index="index"
v-for="(myproj, index) in projs_dacompletare(idProjAtt, tipoProj)"
v-for="(myproj, index) in projs_dacompletare(idProjAtt, gettipoProj)"
:key="myproj._id" class="myitemdrag">
<SingleProject ref="singleproject" @deleteItemproj="mydeleteitemproj(myproj._id)"
@@ -155,16 +154,7 @@
</q-tab-panel>
<q-tab-panel name="info">
<div v-if="(whatisSel === tools.WHAT_PROJECT) && (!!itemselproj.descr)">
<div class="q-pa-xs clMain">
<div class="flex-container clMain">
<q-icon class="flex-item flex-icon" name="format_align_center"/>
<div :class="classTitleProjSel">
{{ itemselproj.descr }}
</div>
</div>
<div class="q-pa-xs q-mb-xl clMain">
<div class="flex-container clMain">
<q-icon class="flex-item flex-icon" name="border_color"/>
@@ -175,6 +165,7 @@
:label="$t('proj.longdescr')"
outlined
debounce="1000"
@input="modifyfieldproj('privacywrite')"
autogrow
style="flex: auto">
</q-input>
@@ -200,7 +191,8 @@
<q-select style="min-width: 200px"
:readonly="readonly_PanelPrivacySel"
rounded outlined v-model="itemselproj.groupId" :options="selectGroup"
:label="$t('proj.group')" emit-value map-options>
:label="$t('proj.group')" emit-value map-options
@input="modifyfieldproj('groupId')">
</q-select>
</div>
</div>
@@ -210,7 +202,8 @@
<q-select style="min-width: 200px"
:readonly="readonly_PanelPrivacySel"
rounded outlined v-model="itemselproj.respUsername" :options="selectResp"
:label="$t('proj.respUsername')" emit-value map-options>
:label="$t('proj.respUsername')" emit-value map-options
@input="modifyfieldproj('respUsername')">
</q-select>
</div>
</div>
@@ -220,7 +213,8 @@
<q-select style="min-width: 200px"
:readonly="readonly_PanelPrivacySel"
rounded outlined v-model="itemselproj.viceRespUsername" :options="selectResp"
:label="$t('proj.viceRespUsername')" emit-value map-options>
:label="$t('proj.viceRespUsername')" emit-value map-options
@input="modifyfieldproj('viceRespUsername')">
</q-select>
</div>
</div>
@@ -230,7 +224,8 @@
<q-select style="min-width: 200px"
:readonly="readonly_PanelPrivacySel"
rounded outlined v-model="itemselproj.privacyread" :options="selectPrivacy"
:label="$t('proj.privacyread')" emit-value map-options>
:label="$t('proj.privacyread')" emit-value map-options
@input="modifyfieldproj('privacyread')">
</q-select>
</div>
</div>
@@ -239,7 +234,8 @@
<div class="flex-item itemstatus">
<q-select style="min-width: 200px" :readonly="readonly_PanelPrivacySel" rounded outlined
v-model="itemselproj.privacywrite" :options="selectPrivacy"
:label="$t('proj.privacywrite')" emit-value map-options>
:label="$t('proj.privacywrite')" emit-value map-options
@input="modifyfieldproj('privacywrite')">
</q-select>
</div>
</div>
@@ -248,7 +244,7 @@
</div>
</div>
<div v-else-if="(whatisSel === tools.WHAT_TODO) && (!!itemtodosel.descr)">
<div class="q-pa-xs clMain">
<div class="q-pa-xs q-mb-xl clMain">
<div class="flex-container clMain">
<q-icon class="flex-item flex-icon" name="border_color"/>
@@ -261,6 +257,7 @@
:label="$t('proj.longdescr')"
outlined
:readonly="readonly_PanelPrivacy"
@input="modifyfieldtodo('descr')"
debounce="1000"
autogrow
style="flex: auto">
@@ -276,15 +273,19 @@
v-model="itemtodosel.pos"
type="number"
debounce="500"
@input="modifyfieldtodo('pos')"
rounded outlined
style="max-width: 100px;"
:label="$t('dashboard.posizione')"></q-input>
:label="$t('dashboard.posizione')">
</q-input>
</div>
</div>
<div class="flex-item itemstatus">
<q-select style="min-width: 200px"
:readonly="readonly_PanelPrivacy"
@input="modifyfieldtodo('assigned_to_userId')"
rounded outlined v-model="itemtodosel.assigned_to_userId" :options="selectWorkers"
:label="$t('todo.assigned_to_userId')" emit-value map-options>
</q-select>
@@ -295,6 +296,7 @@
:idmain="itemtodosel.category"
table="todos"
mykey="assignedToUsers"
@input="modifyfieldtodo('assignedToUsers')"
:type="tools.FieldType.multiselect"
jointable="workers">
</CMyFieldDb>
@@ -307,6 +309,7 @@
:readonly="readonly_PanelPrivacy"
:label="$t('todo.status')" emit-value map-options
@input="modifyfieldtodo('statustodo')">
</q-select>
</div>
</div>
@@ -315,38 +318,52 @@
</div>
</q-tab-panel>
<q-tab-panel name="ore">
<div v-if="(whatisSel === tools.WHAT_PROJECT) && (!!itemselproj.descr)">
<div class="q-pa-xs clMain">
<div class="flex-container clMain">
<div v-if="(whatisSel === tools.WHAT_TODO) && (!!itemtodosel.descr)">
<!--<CHours v-if="!!itemtodosel" :todoId="itemtodosel._id"></CHours>-->
<q-icon class="flex-item flex-icon" name="format_align_center"/>
<div :class="classTitleProjSel">
{{ itemselproj.descr }}
<div v-if="!!itemtodosel">
<CGridTableRec prop_mytable="hours"
prop_mytitle="Lista Ore"
:prop_mycolumns="getcolHours"
prop_colkey="descr"
nodataLabel="Nessuna Lista Ore"
noresultLabel="Il filtro selezionato non ha trovato nessun risultato"
:arrfilters="myarrfilterand"
:filterdef="myfilterdef"
:prop_codeId="itemtodosel._id"
:defaultnewrec="getdefaultnewrec"
labelBtnAddRow="Aggiungi Ore"
:extraparams="extraparams">
</CGridTableRec>
</div>
</div>
<div v-else-if="(whatisSel === tools.WHAT_PROJECT) && (!!itemselproj.descr)">
<!--<CHours v-if="!!itemtodosel" :todoId="itemtodosel._id"></CHours>-->
<div v-if="!!itemselproj">
<CGridTableRec prop_mytable="hours"
prop_mytitle="Lista Ore"
:prop_mycolumns="getcolHours"
prop_colkey="descr"
nodataLabel="Nessuna Lista Ore"
noresultLabel="Il filtro selezionato non ha trovato nessun risultato"
:arrfilters="myarrfilterand"
:filterdef="myfilterdef"
:prop_codeId="itemselproj._id"
:defaultnewrec="getdefaultnewrec"
labelBtnAddRow="Aggiungi Ore"
:extraparams="extraparams">
</CGridTableRec>
</div>
</div>
</div>
<div v-else-if="(whatisSel === tools.WHAT_TODO) && (!!itemtodosel.descr)">
<CHours v-if="!!itemtodosel" :todoId="itemtodosel._id"></CHours>
</div>
<div class="q-ma-lg"></div>
</q-tab-panel>
<q-tab-panel name="stat">
<div v-if="(whatisSel === tools.WHAT_PROJECT) && (!!itemselproj.descr)">
<div class="q-pa-xs clMain">
<div class="flex-container clMain">
<q-icon class="flex-item flex-icon" name="format_align_center"/>
<div :class="classTitleProjSel">
{{ itemselproj.descr }}
</div>
</div>
</div>
<div v-if="CanISeeProjectSel">
<div v-if="!!itemselproj">
itemselproj._id: {{ itemselproj._id }}
<!-- itemselproj._id: {{ itemselproj._id }} -->
</div>
<div class="flex-container clMain">
<q-icon class="flex-item flex-icon" name="work_outline"/>
@@ -371,6 +388,7 @@
readonly
v-model="itemselproj.hoursplanned"
rounded outlined
@input="modifyfieldproj('hoursplanned')"
:label="$t('proj.hoursplanned')"
debounce="500">
@@ -383,14 +401,14 @@
<q-icon class="flex-item flex-icon" name="developer_mode"/>
<div class="flex-item itemdata">
<CDate :readonly="readonly_PanelPrivacySel" :mydate="itemselproj.begin_development"
@input="itemselproj.begin_development = new Date(arguments[0])"
@input="itemselproj.begin_development = new Date(arguments[0]); modifyfieldproj('begin_development')"
:label="$t('proj.begin_development')">
</CDate>
</div>
<div style="margin: 10px;"></div>
<div class="flex-item itemdata">
<CDate :readonly="readonly_PanelPrivacySel" :mydate="itemselproj.begin_test"
@input="itemselproj.begin_test = new Date(arguments[0])"
@input="itemselproj.begin_test = new Date(arguments[0]); modifyfieldproj('begin_test')"
:label="$t('proj.begin_test')">
</CDate>
</div>
@@ -401,6 +419,7 @@
<q-select style="min-width: 150px" :readonly="readonly_PanelPrivacySel" rounded outlined
v-model="itemselproj.actualphase"
:options="selectPhase"
@input="modifyfieldproj('actualphase')"
:label="$t('proj.actualphase')" emit-value map-options>
</q-select>
</div>
@@ -409,6 +428,7 @@
<q-select style="min-width: 150px"
:readonly="readonly_PanelPrivacySel" rounded outlined v-model="itemselproj.totalphases"
:options="selectPhase"
@input="modifyfieldproj('totalphases')"
:label="$t('proj.totalphases')" emit-value map-options>
</q-select>
</div>
@@ -441,17 +461,7 @@
</div>
<div v-else-if="(whatisSel === tools.WHAT_TODO) && (!!itemtodosel.descr)">
<div class="q-pa-xs clMain">
<div class="flex-container clMain">
<q-icon class="flex-item flex-icon" name="format_align_center"/>
<div :class="classTitleProjSel">
{{ itemtodosel.descr }}
</div>
</div>
</div>
<div>
itemtodosel._id: {{ itemtodosel._id }}
<div class="flex-container clMain">
<q-icon class="flex-item flex-icon" name="work_outline"/>
<div class="flex-item itemdescr">
@@ -493,7 +503,7 @@
<div class="flex-item itemdata">
<CDate :mydate="itemtodosel.start_date"
:readonly="readonly_PanelPrivacy"
@input="itemtodosel.start_date = new Date(arguments[0])"
@input="itemtodosel.start_date = new Date(arguments[0]); modifyfieldtodo('start_date')"
:label="$t('todo.start_date')">
</CDate>
@@ -503,7 +513,7 @@
<div class="flex-item itemdata">
<CDate :readonly="((itemtodosel.statustodo !== tools.Status.COMPLETED) || readonly_PanelPrivacy)"
:mydate="itemtodosel.completed_at"
@input="itemtodosel.completed_at = new Date(arguments[0])"
@input="itemtodosel.completed_at = new Date(arguments[0]); modifyfieldtodo('completed_at')"
:label="$t('todo.completed_at')">
</CDate>
</div>
@@ -513,6 +523,7 @@
<div class="flex-item itemstatus">
<q-select rounded outlined v-model="itemtodosel.phase" :options="selectPhase"
:readonly="readonly_PanelPrivacy"
@input="modifyfieldtodo('phase')"
:label="$t('todo.phase')" emit-value map-options>
</q-select>
</div>
@@ -521,7 +532,18 @@
</div>
</q-tab-panel>
</q-tab-panels>
</div>
<q-page-sticky position="bottom-right" :offset="[9, 9]" padding="md">
<q-btn fab icon="fas fa-list-alt" color="orange" @click="tabproj = 'lista'"
:disable="!whatisSel && !isRootProjectAtt"/>
<q-btn fab icon="fas fa-info" color="blue" @click="tabproj = 'info'"
:disable="!whatisSel && !isRootProjectAtt"/>
<q-btn fab icon="fas fa-hourglass" color="green" @click="tabproj = 'ore'"
:disable="!whatisSel && !isRootProjectAtt"/>
<q-btn fab icon="fas fa-chart-line" color="accent" @click="tabproj = 'stat'"
:disable="!whatisSel && !isRootProjectAtt"/>
<q-btn fab icon="add" color="blue" @click="tabproj = 'lista'; clickMenuProjList(200)"/>
</q-page-sticky>
</q-page>
</template>

View File

@@ -0,0 +1,181 @@
$heightBtn: 100%;
.clMain {
min-width: 350px;
}
.clVista {
max-height: 400px !important;
}
.flex-container, .flex-container_col {
background-color: rgb(250, 250, 250);
padding: 2px 4px 2px 4px;
margin: 2px;
display: flex;
align-items: center;
flex-direction: row;
justify-content: space-between;
}
.q-tab-panel {
padding: 8px;
}
.flex-container_col {
flex-direction: column;
}
.mycard {
visibility: hidden;
}
.myitemdrag {
padding: 2px;
//margin-top: 4px;
border-width: 1px 0px 0px 0px;
//border: solid 1px #ccc;
border-style: solid;
border-color: #ccc;
transition: all .4s;
}
.titlePriority, .titleCompleted {
border-width: 0px 0px 1px 0px;
border-style: solid;
border-color: #ccc;
color: white;
}
.titleCompleted {
background-color: #ccc;
}
.high_priority {
background-color: #4caf50;
}
.medium_priority {
background-color: #3846af;
}
.low_priority {
background-color: #af2218;
}
.myitemdrag-enter, .myitemdrag-leave-active {
opacity: 0;
}
.drag {
//background-color: green;
}
.dragArea {
min-height: 10px;
}
.categorytitle {
color: blue;
background-color: lightblue;
font-size: 1.25rem !important;
font-weight: bold;
text-align: center;
flex: 1;
}
.projecttitle {
color: white;
// color:blue;
background-color: rgba(65, 152, 239, 0.6);
font-size: 1.25rem;
font-weight: bold;
text-align: center;
flex: 1;
}
.itemdescr {
font-size: 1rem;
flex: 1;
}
.itemstatus {
flex: 1;
padding: 2px;
}
.itemdata {
font-size: 1rem;
flex: 1;
padding: 1px;
}
.progress-item {
margin: 1px;
padding: 2px;
padding-top: 4px;
padding-bottom: 4px;
flex: 1;
order: 1;
}
.progrbar-item {
//height: 10px
padding-top: 7px;
height: 10px;
}
.flex-icon {
padding: 3px;
font-size: 1.5rem;
}
.titleSubMenu {
font-size: 0.7rem;
font-weight: 350;
}
.draggatodraggato2 {
display: inline-block;
}
.non-draggato {
display: none;
}
@keyframes fadeIn {
from {
transform: translateY(-100%);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 0.3;
}
}
.divdrag {
animation: fadeIn 0.2s ease-in 1 forwards;
min-height: 50px;
background-color: #9f9f9f;
}
.menuInputCompleted > div:nth-child(2) > div > input {
min-width: 30px;
width: 30px;
}
.percProgress {
padding-top: 3px;
color: #888;
vertical-align: middle;
text-align: center;
//line-height: $heightitem;
}
.endwork_estimate {
color: blue;
}

View File

@@ -0,0 +1,129 @@
import Vue from 'vue'
import { Component, Watch } from 'vue-property-decorator'
import MixinBase from '@src/mixins/mixin-base'
import { CTitleBanner } from '@components'
import Global = WebAssembly.Global
import { CalendarStore, GlobalStore, UserStore } from '@store'
import { colors, Screen, Platform, date } from 'quasar'
import { tools } from '@src/store/Modules/tools'
@Component({
components: { CTitleBanner }
})
export default class Report extends MixinBase {
public dateFormatter: any = ''
public selectedDate = ''
public arrhour: {} = {}
public listaResidenti: any[] = []
public $refs: {
calendar: any
}
public mounted() {
const date_start = tools.addDays(new Date(tools.getTimestampsNow()), -90)
const date_end = tools.addDays(new Date(tools.getTimestampsNow()), 365)
UserStore.actions.reportload({ date_start, date_end })
.then((myris) => {
if (!!myris) {
console.log('myris', myris)
this.arrhour = myris.arrhour
this.listaResidenti = myris.listaResidenti
}
})
}
public calendarNext() {
this.$refs.calendar.next()
}
public calendarPrev() {
this.$refs.calendar.prev()
}
public getEventDate(eventparam) {
const parts = eventparam.dateTimeStart.split('-')
const mydate = new Date(parts[0], parts[1] - 1, parts[2])
return this.dateFormatter.format(mydate)
}
public badgeClasses(eventparam, type) {
const cssColor = tools.isCssColor(eventparam.bgcolor)
const isHeader = type === 'header'
return {
[`text-white bg-${eventparam.bgcolor}`]: !cssColor,
'full-width': !isHeader && (!eventparam.side || eventparam.side === 'full'),
'left-side': !isHeader && eventparam.side === 'left',
'right-side': !isHeader && eventparam.side === 'right'
}
}
public isEventEnabled(myevent) {
// check if event is in the past
const datenow = tools.addDays(tools.getDateNow(), -1)
// console.log('datenow', datenow, 'end', myevent.dateTimeEnd)
return (new Date(myevent.dateTimeEnd) >= datenow)
}
public badgeStyles(eventparam, type, timeStartPos, timeDurationHeight) {
const s = { color: '', top: '', height: '', opacity: 1 }
if (tools.isCssColor(eventparam.bgcolor)) {
s['background-color'] = eventparam.bgcolor
s.color = colors.luminosity(eventparam.bgcolor) > 0.5 ? 'black' : 'white'
}
if (timeStartPos) {
s.top = timeStartPos(tools.getstrTime(eventparam.dateTimeStart)) + 'px'
}
if (timeDurationHeight) {
s.height = timeDurationHeight(this.func_tools.getMinutesDuration(eventparam.dateTimeStart, eventparam.dateTimeEnd)) + 'px'
}
if (!this.isEventEnabled(eventparam)) {
s.opacity = 0.5
}
s['align-items'] = 'flex-start'
return s
}
public getEvents(dt, objres) {
console.log('dt', dt, 'objres', objres)
const eventsloc = []
if (!!this.arrhour[objres.username]) {
if (this.arrhour[objres.username].length > 0) {
this.arrhour[objres.username].forEach((item) => {
if (item) {
if (tools.getstrYYMMDDDate(item.date) === dt) {
if (eventsloc.length > 0) {
// check for overlapping times
eventsloc.push(item)
}
}
}
})
}
}
return eventsloc
}
get resources() {
const arr = []
if (!!this.listaResidenti) {
for (const user of this.listaResidenti) {
const rec = {
label: user.name + ' ' + user.surname,
username: user.username
}
arr.push(rec)
}
}
return arr
}
}

View File

@@ -0,0 +1,48 @@
<template>
<q-page>
<div>
<CTitleBanner title="Report"></CTitleBanner>
<q-calendar
v-model="selectedDate"
ref="calendar"
view="week-scheduler"
animated
transition-prev="slide-right"
transition-next="slide-left"
:resources="resources"
:locale="toolsext.getLocale()"
>
<!-- eslint-disable vue/no-unused-vars -->
<template #scheduler-resources-header>
<div class="row justify-center items-center">
<q-btn flat icon="fas fa-chevron-left" @click="calendarPrev" />
<q-btn flat icon="fas fa-chevron-right" @click="calendarNext" />
</div>
<!--<div class="full-height row justify-center items-center">
<q-btn label="here"/>
</div>-->
</template>
<template #scheduler-resource-day="{ timestamp, /* index, */ resource }">
<template v-for="(event, index) in getEvents(timestamp, resource)">
<q-badge
:key="index"
class="my-event justify-center ellipsis"
>
<!--<q-icon v-if="event.icon" :name="event.icon" class="q-mr-xs"></q-icon>-->
<span class="ellipsis">{{ event.title }}</span>
</q-badge>
</template>
</template>
</q-calendar>
</div>
</q-page>
</template>
<script lang="ts" src="./report.ts">
</script>
<style lang="scss" scoped>
@import './report';
</style>