Reportistica Ore 1
This commit is contained in:
@@ -272,7 +272,7 @@ $graytext: #555;
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
margin-top: -10px;
|
margin-top: -10px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
z-index: 9999;
|
z-index: 1000;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
right: 0;
|
right: 0;
|
||||||
@media (max-width: 400px) {
|
@media (max-width: 400px) {
|
||||||
@@ -297,3 +297,7 @@ $graytext: #555;
|
|||||||
flex-flow: column;
|
flex-flow: column;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.itemprenota{
|
||||||
|
align-self: center;
|
||||||
|
color: blue;
|
||||||
|
}
|
||||||
|
|||||||
@@ -74,6 +74,8 @@ export default class CEventsCalendar extends MixinEvents {
|
|||||||
msgbooking: '',
|
msgbooking: '',
|
||||||
infoevent: '',
|
infoevent: '',
|
||||||
numpeople: 1,
|
numpeople: 1,
|
||||||
|
numpeopleLunch: 0,
|
||||||
|
numpeopleDinner: 0,
|
||||||
datebooked: tools.getDateNow(),
|
datebooked: tools.getDateNow(),
|
||||||
booked: false,
|
booked: false,
|
||||||
modified: false
|
modified: false
|
||||||
@@ -137,29 +139,7 @@ export default class CEventsCalendar extends MixinEvents {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public resources = [
|
public resources = []
|
||||||
{
|
|
||||||
label: 'John'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Mary'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Susan'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Olivia'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Board Room'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Room-1'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Room-2'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
// public eventdata =
|
// public eventdata =
|
||||||
// [
|
// [
|
||||||
@@ -365,6 +345,8 @@ export default class CEventsCalendar extends MixinEvents {
|
|||||||
|
|
||||||
get hasModifiedBooking() {
|
get hasModifiedBooking() {
|
||||||
return (this.bookEventpage.bookedevent.numpeople !== this.bookEventForm.numpeople) ||
|
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.msgbooking !== this.bookEventForm.msgbooking) ||
|
||||||
(this.bookEventpage.bookedevent.booked !== this.bookEventForm.booked)
|
(this.bookEventpage.bookedevent.booked !== this.bookEventForm.booked)
|
||||||
}
|
}
|
||||||
@@ -450,16 +432,18 @@ export default class CEventsCalendar extends MixinEvents {
|
|||||||
this.eventForm = { ...this.formDefault }
|
this.eventForm = { ...this.formDefault }
|
||||||
}
|
}
|
||||||
|
|
||||||
public addEventMenu(day, type) {
|
public addEventMenu(day) {
|
||||||
// console.log('addeventmenu editable = ', this.editable)
|
console.log('addeventmenu', day)
|
||||||
if (this.calendarView === 'scheduler' || this.calendarView === 'week-scheduler' || this.calendarView === 'month-scheduler' || !this.editable) {
|
if (this.calendarView === 'scheduler' || this.calendarView === 'week-scheduler' || this.calendarView === 'month-scheduler' || !this.editable) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.resetForm()
|
this.resetForm()
|
||||||
this.contextDay = { ...day }
|
this.contextDay = { ...day.scope }
|
||||||
|
|
||||||
this.eventForm.dateTimeStart = tools.getstrYYMMDDDateTime(day.date + ' 21:00:00')
|
this.eventForm.dateTimeStart = tools.getstrYYMMDDDateTime(day.scope.date + ' 21:00:00')
|
||||||
this.eventForm.dateTimeEnd = tools.getstrYYMMDDDateTime(day.date + ' 22:00:00')
|
this.eventForm.dateTimeEnd = tools.getstrYYMMDDDateTime(day.scope.date + ' 22:00:00')
|
||||||
|
|
||||||
|
console.log('eventForm', this.eventForm)
|
||||||
|
|
||||||
this.addEvent = true // show dialog
|
this.addEvent = true // show dialog
|
||||||
}
|
}
|
||||||
@@ -479,6 +463,8 @@ export default class CEventsCalendar extends MixinEvents {
|
|||||||
this.myevent = eventparam
|
this.myevent = eventparam
|
||||||
this.bookEventForm.msgbooking = ''
|
this.bookEventForm.msgbooking = ''
|
||||||
this.bookEventForm.numpeople = 1
|
this.bookEventForm.numpeople = 1
|
||||||
|
this.bookEventForm.numpeopleLunch = 0
|
||||||
|
this.bookEventForm.numpeopleDinner = 0
|
||||||
this.bookEventForm.booked = true
|
this.bookEventForm.booked = true
|
||||||
this.bookEventpage.state = EState.Creating
|
this.bookEventpage.state = EState.Creating
|
||||||
|
|
||||||
@@ -703,6 +689,8 @@ export default class CEventsCalendar extends MixinEvents {
|
|||||||
if (bookedevent) {
|
if (bookedevent) {
|
||||||
this.bookEventForm._id = bookedevent._id
|
this.bookEventForm._id = bookedevent._id
|
||||||
this.bookEventForm.numpeople = bookedevent.numpeople
|
this.bookEventForm.numpeople = bookedevent.numpeople
|
||||||
|
this.bookEventForm.numpeopleLunch = bookedevent.numpeopleLunch
|
||||||
|
this.bookEventForm.numpeopleDinner = bookedevent.numpeopleDinner
|
||||||
this.bookEventForm.infoevent = bookedevent.infoevent
|
this.bookEventForm.infoevent = bookedevent.infoevent
|
||||||
this.bookEventForm.msgbooking = bookedevent.msgbooking
|
this.bookEventForm.msgbooking = bookedevent.msgbooking
|
||||||
this.bookEventForm.booked = bookedevent.booked
|
this.bookEventForm.booked = bookedevent.booked
|
||||||
@@ -755,6 +743,8 @@ export default class CEventsCalendar extends MixinEvents {
|
|||||||
userId: UserStore.state.my._id,
|
userId: UserStore.state.my._id,
|
||||||
id_bookedevent: myevent._id,
|
id_bookedevent: myevent._id,
|
||||||
numpeople: self.bookEventForm.numpeople,
|
numpeople: self.bookEventForm.numpeople,
|
||||||
|
numpeopleLunch: self.bookEventForm.numpeopleLunch,
|
||||||
|
numpeopleDinner: self.bookEventForm.numpeopleDinner,
|
||||||
infoevent: tools.gettextevent(self, myevent),
|
infoevent: tools.gettextevent(self, myevent),
|
||||||
msgbooking: self.bookEventForm.msgbooking,
|
msgbooking: self.bookEventForm.msgbooking,
|
||||||
booked: self.bookEventForm.booked,
|
booked: self.bookEventForm.booked,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -16,4 +16,7 @@
|
|||||||
padding-right: 2px;
|
padding-right: 2px;
|
||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
|
&__title {
|
||||||
|
font-size: 1rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { GlobalStore, UserStore } from '../../store/Modules/index'
|
|||||||
import { tools } from '../../store/Modules/tools'
|
import { tools } from '../../store/Modules/tools'
|
||||||
|
|
||||||
import { shared_consts } from '../../common/shared_vuejs'
|
import { shared_consts } from '../../common/shared_vuejs'
|
||||||
import { ICategory, IColGridTable, IFilter, ITableRec } from '../../model'
|
import { ICategory, IColGridTable, IFilter, ITableRec, IPagination } from '../../model'
|
||||||
import { CTodo } from '../todos/CTodo'
|
import { CTodo } from '../todos/CTodo'
|
||||||
import { SingleProject } from '../projects/SingleProject'
|
import { SingleProject } from '../projects/SingleProject'
|
||||||
import { lists } from '../../store/Modules/lists'
|
import { lists } from '../../store/Modules/lists'
|
||||||
@@ -19,18 +19,28 @@ import { CMyDashboard } from '../CMyDashboard'
|
|||||||
components: { CMyPopupEdit, CTitleBanner, CMyDashboard }
|
components: { CMyPopupEdit, CTitleBanner, CMyDashboard }
|
||||||
})
|
})
|
||||||
export default class CGridTableRec extends Vue {
|
export default class CGridTableRec extends Vue {
|
||||||
|
private addRow: string = 'Aggiungi'
|
||||||
@Prop({ required: true }) public prop_mytitle: string
|
@Prop({ required: true }) public prop_mytitle: string
|
||||||
@Prop({ required: false }) public prop_mytable: string
|
@Prop({ required: false }) public prop_mytable: string
|
||||||
@Prop({ required: false, default: null }) public prop_mycolumns: any[]
|
@Prop({ required: false, default: null }) public prop_mycolumns: any[]
|
||||||
@Prop({ required: false, default: '' }) public prop_colkey: string
|
@Prop({ required: false, default: '' }) public prop_colkey: string
|
||||||
@Prop({ required: false, default: '' }) public prop_codeId: string
|
@Prop({ required: false, default: '' }) public prop_codeId: string
|
||||||
@Prop({ required: false, default: '' }) public nodataLabel: 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 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 tablesList: ITableRec[]
|
||||||
@Prop({ required: false, default: null }) public arrfilters: IFilter[]
|
@Prop({ required: false, default: null }) public arrfilters: IFilter[]
|
||||||
@Prop({ required: false, default: [] }) public filterdef: number[]
|
@Prop({ required: false, default: [] }) public filterdef: number[]
|
||||||
@Prop({ required: false, default: {} }) public extraparams: any
|
@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 newRecordBool: boolean = false
|
||||||
public newRecord: any = {}
|
public newRecord: any = {}
|
||||||
@@ -47,13 +57,6 @@ export default class CGridTableRec extends Vue {
|
|||||||
public $q
|
public $q
|
||||||
public $t
|
public $t
|
||||||
public loading: boolean = false
|
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 serverData: any [] = []
|
||||||
public spinner_visible: boolean = false
|
public spinner_visible: boolean = false
|
||||||
@@ -63,9 +66,9 @@ export default class CGridTableRec extends Vue {
|
|||||||
public valPrec: string = ''
|
public valPrec: string = ''
|
||||||
|
|
||||||
public separator: 'horizontal'
|
public separator: 'horizontal'
|
||||||
public myfilter = undefined
|
public myfilter: any = ''
|
||||||
public myfilterand = []
|
public myfilterand = []
|
||||||
public rowsel: any = {}
|
public rowsel: any = {}
|
||||||
public dark: boolean = true
|
public dark: boolean = true
|
||||||
public canEdit: boolean = false
|
public canEdit: boolean = false
|
||||||
|
|
||||||
@@ -210,9 +213,15 @@ export default class CGridTableRec extends Vue {
|
|||||||
this.valPrec = valinitial
|
this.valPrec = valinitial
|
||||||
|
|
||||||
this.saveFieldValue(mydata)
|
this.saveFieldValue(mydata)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public beforeMount() {
|
||||||
|
console.log('beforeMount')
|
||||||
}
|
}
|
||||||
|
|
||||||
public created() {
|
public created() {
|
||||||
|
console.log('created')
|
||||||
// this.serverData = this.mylist.slice() // [{ chiave: 'chiave1', valore: 'valore 1' }]
|
// this.serverData = this.mylist.slice() // [{ chiave: 'chiave1', valore: 'valore 1' }]
|
||||||
|
|
||||||
this.mytable = this.prop_mytable
|
this.mytable = this.prop_mytable
|
||||||
@@ -450,6 +459,7 @@ export default class CGridTableRec extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public mounted() {
|
public mounted() {
|
||||||
|
console.log('GridTable mounted', this.tablesel)
|
||||||
|
|
||||||
if (!!this.tablesList) {
|
if (!!this.tablesList) {
|
||||||
this.canEdit = tools.getCookie(tools.CAN_EDIT, this.canEdit) === 'true'
|
this.canEdit = tools.getCookie(tools.CAN_EDIT, this.canEdit) === 'true'
|
||||||
@@ -684,6 +694,7 @@ export default class CGridTableRec extends Vue {
|
|||||||
if (ris) {
|
if (ris) {
|
||||||
// console.log('ris', ris)
|
// console.log('ris', ris)
|
||||||
this.newRecordBool = false
|
this.newRecordBool = false
|
||||||
|
this.refresh()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -694,4 +705,17 @@ export default class CGridTableRec extends Vue {
|
|||||||
this.annulla(0)
|
this.annulla(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isfinishLoading() {
|
||||||
|
return GlobalStore.state.finishLoading
|
||||||
|
}
|
||||||
|
|
||||||
|
get getlabelAddRow() {
|
||||||
|
return this.labelBtnAddRow
|
||||||
|
}
|
||||||
|
|
||||||
|
get visButtRow() {
|
||||||
|
return this.labelBtnAddRow !== this.addRow
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="q-pa-xs">
|
<div class="q-pa-xs" v-if="isfinishLoading">
|
||||||
<q-btn v-if="mytable" flat dense color="primary"
|
<div class="centermydiv q-ma-sm" style="text-align: center">
|
||||||
:label="$t('grid.addrecord')"
|
<q-btn v-if="mytable && visButtRow" rounded dense color="primary"
|
||||||
@click="createNewRecordDialog"></q-btn>
|
size="lg"
|
||||||
|
:label="getlabelAddRow"
|
||||||
|
@click="createNewRecordDialog"></q-btn>
|
||||||
|
</div>
|
||||||
|
|
||||||
<q-table
|
<q-table
|
||||||
flat
|
flat
|
||||||
@@ -23,8 +25,7 @@
|
|||||||
:no-results-label="noresultLabel"
|
:no-results-label="noresultLabel"
|
||||||
:selected-rows-label="getSelectedString"
|
:selected-rows-label="getSelectedString"
|
||||||
selection="single"
|
selection="single"
|
||||||
:selected.sync="selected"
|
:selected.sync="selected">
|
||||||
>
|
|
||||||
|
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
|
|
||||||
@@ -45,7 +46,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot:top="props">
|
<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>-->
|
<!--<p style="color:red"> Rows: {{ getrows }}</p>-->
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import { Component, Prop, Watch } from 'vue-property-decorator'
|
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'
|
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
|
// rowsNumber: xx if getting data from a server
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public created() {
|
||||||
|
console.log('created CHours')
|
||||||
|
}
|
||||||
|
|
||||||
get extraparams() {
|
get extraparams() {
|
||||||
return {
|
return {
|
||||||
lk_tab: 'users',
|
lk_tab: 'users',
|
||||||
@@ -74,7 +78,7 @@ export default class CHours extends MixinBase {
|
|||||||
return colTableHours
|
return colTableHours
|
||||||
}
|
}
|
||||||
|
|
||||||
get defaultnewrec() {
|
get getdefaultnewrec() {
|
||||||
const myrec = {
|
const myrec = {
|
||||||
todoId: this.todoId,
|
todoId: this.todoId,
|
||||||
userId: UserStore.state.my._id,
|
userId: UserStore.state.my._id,
|
||||||
|
|||||||
@@ -1,13 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<span>{{ setmeta({
|
|
||||||
title: 'Lista Ore',
|
|
||||||
description: "",
|
|
||||||
keywords: '' } ) }}
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<div class="q-ma-sm q-gutter-sm q-pa-xs">
|
<div class="q-ma-sm q-gutter-sm q-pa-xs">
|
||||||
<CTitleBanner title="Lista Ore"></CTitleBanner>
|
|
||||||
<CGridTableRec prop_mytable="hours"
|
<CGridTableRec prop_mytable="hours"
|
||||||
prop_mytitle="Lista Ore"
|
prop_mytitle="Lista Ore"
|
||||||
:prop_mycolumns="getcolHours"
|
:prop_mycolumns="getcolHours"
|
||||||
@@ -17,9 +10,9 @@
|
|||||||
:arrfilters="myarrfilterand"
|
:arrfilters="myarrfilterand"
|
||||||
:filterdef="myfilterdef"
|
:filterdef="myfilterdef"
|
||||||
:prop_codeId="todoId"
|
:prop_codeId="todoId"
|
||||||
:defaultnewrec="defaultnewrec"
|
:defaultnewrec="getdefaultnewrec"
|
||||||
:extraparams="extraparams"
|
:extraparams="extraparams"
|
||||||
>
|
labeladd="Aggiungi Ora">
|
||||||
|
|
||||||
</CGridTableRec>
|
</CGridTableRec>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -152,6 +152,13 @@
|
|||||||
|
|
||||||
</q-input>
|
</q-input>
|
||||||
</div>
|
</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">
|
<div v-else-if="type === tools.FieldType.binary">
|
||||||
<CMyToggleList :label="col.title"
|
<CMyToggleList :label="col.title"
|
||||||
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
|
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
|
||||||
|
|||||||
@@ -53,6 +53,9 @@ export default class CMyPopupEdit extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public changevalRec(newval) {
|
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.row, 'this.col', this.col, 'newval', newval)
|
||||||
console.log('this.row[this.col.name]', this.row[this.col.name])
|
console.log('this.row[this.col.name]', this.row[this.col.name])
|
||||||
this.row[this.col.name] = newval
|
this.row[this.col.name] = newval
|
||||||
@@ -248,4 +251,8 @@ export default class CMyPopupEdit extends Vue {
|
|||||||
this.myvalue = '+' + coderec.dialCode
|
this.myvalue = '+' + coderec.dialCode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public createHours(value) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
:label="col.label">
|
:label="col.label">
|
||||||
</q-input>
|
</q-input>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="col.fieldtype === tools.FieldType.date">
|
<div v-else-if="col.fieldtype === tools.FieldType.date">
|
||||||
<CDateTime
|
<CDateTime
|
||||||
:label="col.label"
|
:label="col.label"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
@@ -25,6 +25,21 @@
|
|||||||
@show="OpenEdit">
|
@show="OpenEdit">
|
||||||
</CDateTime>
|
</CDateTime>
|
||||||
</div>
|
</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">
|
<div v-else-if="col.fieldtype === tools.FieldType.number">
|
||||||
<q-input v-model="myvalue" type="number"
|
<q-input v-model="myvalue" type="number"
|
||||||
autofocus
|
autofocus
|
||||||
@@ -34,6 +49,81 @@
|
|||||||
|
|
||||||
</q-input>
|
</q-input>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
@@ -177,6 +267,12 @@
|
|||||||
|
|
||||||
</q-input>
|
</q-input>
|
||||||
</div>
|
</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">
|
<div v-else-if="col.fieldtype === tools.FieldType.binary">
|
||||||
<CMyToggleList :label="col.title"
|
<CMyToggleList :label="col.title"
|
||||||
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
|
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
|
||||||
|
|||||||
@@ -26,7 +26,9 @@ export default class CMySelect extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public changeval(newval) {
|
public changeval(newval) {
|
||||||
|
console.log('changeval', newval)
|
||||||
this.$emit('update:value', newval)
|
this.$emit('update:value', newval)
|
||||||
|
this.$emit('changeval', newval)
|
||||||
}
|
}
|
||||||
|
|
||||||
public mounted() {
|
public mounted() {
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ export default class Header extends Vue {
|
|||||||
public clCloudUpload: string = ''
|
public clCloudUpload: string = ''
|
||||||
public clCloudDownload: string = ''
|
public clCloudDownload: string = ''
|
||||||
public clCloudUp_Indexeddb: string = ''
|
public clCloudUp_Indexeddb: string = ''
|
||||||
|
public tabcmd: string = ''
|
||||||
public clCloudDown_Indexeddb: string = 'clIndexeddbsend'
|
public clCloudDown_Indexeddb: string = 'clIndexeddbsend'
|
||||||
public photo = ''
|
public photo = ''
|
||||||
public visuimg: boolean = true
|
public visuimg: boolean = true
|
||||||
@@ -431,4 +432,9 @@ export default class Header extends Vue {
|
|||||||
else
|
else
|
||||||
return 'bg-primary'
|
return 'bg-primary'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public changecmd(value) {
|
||||||
|
console.log('changecmd', value)
|
||||||
|
GlobalStore.mutations.changeCmdClick(value)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,7 +119,8 @@
|
|||||||
</q-btn>
|
</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">
|
to="/orderinfo" icon="fas fa-list-ol">
|
||||||
|
|
||||||
|
|
||||||
@@ -215,7 +216,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div v-if="isLogged" class="q-mt-lg"><br><br></div>
|
<div v-if="isLogged" class="q-mt-lg"></div>
|
||||||
|
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
|
|
||||||
|
|
||||||
$colcompleted: #a2a2a2;
|
$colcompleted: #a2a2a2;
|
||||||
$heightitem: 32px;
|
$heightitem: 32px;
|
||||||
$heightothers: 32px;
|
$heightothers: 32px;
|
||||||
@@ -56,26 +55,33 @@ $heightdescr: 20px;
|
|||||||
}
|
}
|
||||||
|
|
||||||
.pos-item {
|
.pos-item {
|
||||||
max-width: 24px;
|
// max-width: 24px;
|
||||||
min-width: 26px;
|
// min-width: 26px;
|
||||||
margin-left: 1px;
|
|
||||||
margin-right: 1px;
|
|
||||||
padding-left: 1px;
|
padding-left: 1px;
|
||||||
padding-right: 1px;
|
padding-right: 1px;
|
||||||
margin: 0px;
|
margin: 0;
|
||||||
padding-top: 0px;
|
padding-top: 0;
|
||||||
padding-bottom: 0px;
|
padding-bottom: 0;
|
||||||
//height: $heightitem;
|
//height: $heightitem;
|
||||||
line-height: $heightitem;
|
line-height: $heightitem;
|
||||||
min-height: $heightitem;
|
min-height: $heightitem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
vertical-align: middle;
|
||||||
// background-color: #ff4081;
|
// background-color: #ff4081;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
order: 2;
|
// order: 1;
|
||||||
flex: 1;
|
// flex: 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pos-group {
|
||||||
|
order: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pos-go {
|
||||||
|
order: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.titleLista-item {
|
.titleLista-item {
|
||||||
@@ -92,8 +98,8 @@ $heightdescr: 20px;
|
|||||||
|
|
||||||
|
|
||||||
.pos-item-popover{
|
.pos-item-popover{
|
||||||
max-width: 24px;
|
// max-width: 24px;
|
||||||
min-width: 24px;
|
// min-width: 24px;
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
@@ -247,6 +253,7 @@ $heightdescr: 20px;
|
|||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
display: table;
|
display: table;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
order: 1;
|
||||||
height: $heightitem;
|
height: $heightitem;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
@@ -386,5 +393,3 @@ $heightdescr: 20px;
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :class="getClassRow()" @click="clickProject">
|
<div :class="getClassRow()" @click="clickProject">
|
||||||
|
|
||||||
<q-btn :disable="isDisable" class="flex-item donotdrag " size="sm" push color="primary" round icon="arrow_forward"
|
<q-btn
|
||||||
:to="getrouteto"></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">
|
<div class="flex-item donotdrag divdescrTot">
|
||||||
<q-input v-if="(sel && inEdit)" hide-underline type="textarea" ref="inputprojdescr"
|
<q-input v-if="(sel && inEdit)" hide-underline type="textarea" ref="inputprojdescr"
|
||||||
@@ -17,17 +35,20 @@
|
|||||||
</q-input>
|
</q-input>
|
||||||
|
|
||||||
<div v-else :class="classDescr"
|
<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>
|
||||||
|
|
||||||
<div>
|
<!--<div>
|
||||||
{{ tools.getGroupById(itemproject.groupId) }}
|
{{ 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
|
<q-linear-progress
|
||||||
stripe
|
stripe
|
||||||
rounded
|
rounded
|
||||||
@@ -47,18 +68,12 @@
|
|||||||
data_class="data_string">
|
data_class="data_string">
|
||||||
</CDate>
|
</CDate>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="isProject()" class="flex-item pos-item " @mousedown="clickRiga">
|
|
||||||
<q-btn flat
|
<q-btn :disable="isDisable" class="flex-item donotdrag pos-go" size="sm" push color="primary" round
|
||||||
:class="clButtPopover"
|
icon="arrow_forward"
|
||||||
:readonly="!CanIModifyProject"
|
:to="getrouteto">
|
||||||
:disable="!CanIModifyProject"
|
|
||||||
icon="menu">
|
</q-btn>
|
||||||
<q-menu ref="popmenu" self="top right">
|
|
||||||
<SubMenusProj :menuPopupProj="menuPopupProj" :itemproject="itemproject" @clickMenu="clickMenu"
|
|
||||||
@selectSubMenu="selectSubMenu"></SubMenusProj>
|
|
||||||
</q-menu>
|
|
||||||
</q-btn>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import { UserStore } from '@store'
|
|||||||
|
|
||||||
import { Getter } from 'vuex-class'
|
import { Getter } from 'vuex-class'
|
||||||
import { SingleTodo } from '../SingleTodo'
|
import { SingleTodo } from '../SingleTodo'
|
||||||
|
import { costanti } from '@src/store/Modules/costanti'
|
||||||
|
|
||||||
const namespace: string = 'Todos'
|
const namespace: string = 'Todos'
|
||||||
|
|
||||||
@@ -91,27 +92,29 @@ export default class CTodo extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public created() {
|
public created() {
|
||||||
const service = this.$dragula.$service
|
if (costanti.DRAGULA) {
|
||||||
tools.dragula_option(service, this.dragname)
|
const service = this.$dragula.$service
|
||||||
|
tools.dragula_option(service, this.dragname)
|
||||||
|
|
||||||
service.eventBus.$on('dragend', (args) => {
|
service.eventBus.$on('dragend', (args) => {
|
||||||
// console.log('args', args)
|
// console.log('args', args)
|
||||||
if (args.name === this.dragname) {
|
if (args.name === this.dragname) {
|
||||||
const itemdragend: IDrag = {
|
const itemdragend: IDrag = {
|
||||||
category: this.categoryAtt,
|
category: this.categoryAtt,
|
||||||
newIndex: this.getElementIndex(args.el),
|
newIndex: this.getElementIndex(args.el),
|
||||||
oldIndex: this.getElementOldIndex(args.el)
|
oldIndex: this.getElementOldIndex(args.el)
|
||||||
|
}
|
||||||
|
this.onEndtodo(itemdragend)
|
||||||
}
|
}
|
||||||
this.onEndtodo(itemdragend)
|
})
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
service.eventBus.$on('drag', (el, source) => {
|
service.eventBus.$on('drag', (el, source) => {
|
||||||
this.scrollable = false
|
this.scrollable = false
|
||||||
})
|
})
|
||||||
service.eventBus.$on('drop', (el, source) => {
|
service.eventBus.$on('drop', (el, source) => {
|
||||||
this.scrollable = true
|
this.scrollable = true
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
this.load()
|
this.load()
|
||||||
}
|
}
|
||||||
@@ -167,8 +170,7 @@ export default class CTodo extends Vue {
|
|||||||
// empty the field
|
// empty the field
|
||||||
if (atfirst) {
|
if (atfirst) {
|
||||||
this.todotop = ''
|
this.todotop = ''
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
this.todobottom = ''
|
this.todobottom = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,7 +190,13 @@ export default class CTodo extends Vue {
|
|||||||
//
|
//
|
||||||
// await Todos.actions.swapElems(itemdragend)
|
// 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!')
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,163 +1,171 @@
|
|||||||
<template>
|
<template>
|
||||||
<q-page>
|
<q-page>
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
<div v-if="!!title" class="divtitlecat">
|
<div v-if="!!title" class="divtitlecat">
|
||||||
<div class="flex-container">
|
<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"
|
||||||
<div class="flex-item">
|
:style="`background-color: ${backcolor} !important; color: ${forecolor} !important;`">
|
||||||
<q-btn push
|
{{ title | capitalize }}
|
||||||
size="sm"
|
</div>
|
||||||
icon="settings">
|
<div class="flex-item">
|
||||||
<q-menu id="popconfig" self="top right">
|
<q-btn push
|
||||||
<q-list link separator no-border class="todo-menu">
|
size="sm"
|
||||||
<q-item clickable v-for="field in menuPopupConfigTodo" :key="field.value">
|
icon="settings">
|
||||||
<q-item-section avatar>
|
<q-menu id="popconfig" self="top right">
|
||||||
<q-icon :name="field.icon"/>
|
<q-list link separator no-border class="todo-menu">
|
||||||
</q-item-section>
|
<q-item clickable v-for="field in menuPopupConfigTodo" :key="field.value">
|
||||||
|
<q-item-section avatar>
|
||||||
|
<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 v-if="showTask(field.value)">
|
||||||
<q-item-section side>
|
<q-item-section side>
|
||||||
<q-icon name="keyboard_arrow_right"/>
|
<q-icon name="keyboard_arrow_right"/>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
|
|
||||||
<q-menu auto-close anchor="bottom middle" self="top middle">
|
<q-menu auto-close anchor="bottom middle" self="top middle">
|
||||||
<q-list dense>
|
<q-list dense>
|
||||||
<q-item side :icon="field.icon">
|
<q-item side :icon="field.icon">
|
||||||
|
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<q-list dense>
|
<q-list dense>
|
||||||
<q-item clickable v-ripple v-for="opt in listOptionShowTask"
|
<q-item clickable v-ripple v-for="opt in listOptionShowTask"
|
||||||
:key="opt.value"
|
:key="opt.value"
|
||||||
@click="showtype = opt.value">
|
@click="showtype = opt.value">
|
||||||
<q-item-section avatar>
|
<q-item-section avatar>
|
||||||
<q-icon :name="opt.icon" inverted color="primary"/>
|
<q-icon :name="opt.icon" inverted color="primary"/>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
{{opt.label}}
|
{{ opt.label }}
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
</q-list>
|
</q-list>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
</q-list>
|
</q-list>
|
||||||
</q-menu>
|
</q-menu>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
</q-list>
|
</q-list>
|
||||||
</q-menu>
|
</q-menu>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<q-input v-if="viewtaskTop" ref="insertTask" color="blue-12" v-model="todotop" :label="$t('todo.inserttop')"
|
|
||||||
style="margin-left: 6px;"
|
|
||||||
debounce="1000"
|
|
||||||
:after="[{icon: 'arrow_forward', content: true, handler () {}}]"
|
|
||||||
v-on:keyup.enter="dbInsert(true)">
|
|
||||||
<template v-slot:prepend>
|
|
||||||
<q-icon name="add"/>
|
|
||||||
</template>
|
|
||||||
</q-input>
|
|
||||||
|
|
||||||
<!--categoryAtt: {{categoryAtt}}<br>-->
|
|
||||||
|
|
||||||
<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 :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>
|
|
||||||
</div>
|
|
||||||
<SingleTodo ref="single" @deleteItemtodo="mydeleteitemtodo(mytodo._id)" @eventupdate="updateitemtodo"
|
|
||||||
@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>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!--</q-infinite-scroll>-->
|
|
||||||
|
|
||||||
<div v-if="doneTodosCount > 0" class="titleCompleted">
|
|
||||||
<label>{{$t('todo.completed')}}</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!--<q-infinite-scroll :handler="loadMoreTodo" :offset="7">-->
|
|
||||||
<div class="container">
|
|
||||||
<div :id="tools.getmyid(mytodo._id)" :index="index"
|
|
||||||
v-for="(mytodo, index) in todos_completati(categoryAtt)"
|
|
||||||
:key="mytodo._id" class="myitemdrag">
|
|
||||||
|
|
||||||
<SingleTodo ref="single" @deleteItemtodo="mydeleteitemtodo(mytodo._id)" @eventupdate="updateitemtodo"
|
|
||||||
@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>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!--</q-infinite-scroll>-->
|
|
||||||
</div>
|
|
||||||
<!--CanIModifyTodo : {{CanIModifyTodo}}-->
|
|
||||||
|
|
||||||
<q-input v-if="(TodosCount > 0 || !viewtaskTop) && CanIModifyTodo" ref="insertTaskBottom" v-model="todobottom"
|
|
||||||
style="margin-left: 6px;"
|
|
||||||
color="blue-12"
|
|
||||||
debounce="1000"
|
|
||||||
:label="$t('todo.insertbottom')"
|
|
||||||
:after="[{icon: 'arrow_forward', content: true, handler () {}}]"
|
|
||||||
v-on:keyup.enter="dbInsert(false)">
|
|
||||||
|
|
||||||
</q-input>
|
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
<!--{{ tmpstrTodos }}-->
|
|
||||||
|
|
||||||
<!--<div class="flex-item btn-item">-->
|
|
||||||
<!--<q-btn class="mybtn" round color="" icon="lock" @click="getArrTodos">Get Todo</q-btn>-->
|
|
||||||
<!--<!–<q-btn class="mybtn" round color="" icon="person" @click="setArrTodos">Set Todo</q-btn>–>-->
|
|
||||||
<!--<!–<q-btn class="mybtn" round color="" icon="list" @click="reload_fromServer++">Reload</q-btn>–>-->
|
|
||||||
<!--</div>-->
|
|
||||||
|
|
||||||
<!--
|
|
||||||
<!--<!–<q-input v-model="testPao" float-label="testPao"/>–>-->
|
|
||||||
<!--<q-input v-model="todos_changed" float-label="todos_changed"/>-->
|
|
||||||
|
|
||||||
<!--<q-input v-model="reload_fromServer" float-label="reload_fromServer"/>-->
|
|
||||||
|
|
||||||
<!--<div class="flex-item btn-item">-->
|
|
||||||
<!--<q-btn class="mybtn" round color="" icon="lock" @click="clicktest()"></q-btn>-->
|
|
||||||
<!--<q-btn class="mybtn" round color="" icon="person" @click="clicktest2()"></q-btn>-->
|
|
||||||
<!--<q-btn class="mybtn" round color="" icon="list" @click="checkUpdate()"></q-btn>-->
|
|
||||||
<!--</div>-->
|
|
||||||
<!--–>-->
|
|
||||||
|
|
||||||
<!--<q-btn class="mybtn" round color="" icon="lock" @click="clickaggshowtype()"></q-btn>-->
|
|
||||||
|
|
||||||
|
|
||||||
<!--<span style="white-space: pre;">{{ todos_vista }}</span>-->
|
|
||||||
</div>
|
</div>
|
||||||
</q-page>
|
</div>
|
||||||
|
|
||||||
|
<q-input v-if="viewtaskTop" ref="insertTask" color="blue-12" v-model="todotop" :label="$t('todo.inserttop')"
|
||||||
|
style="margin-left: 6px;"
|
||||||
|
debounce="1000"
|
||||||
|
:after="[{icon: 'arrow_forward', content: true, handler () {}}]"
|
||||||
|
v-on:keyup.enter="dbInsert(true)">
|
||||||
|
<template v-slot:prepend>
|
||||||
|
<q-icon name="add"/>
|
||||||
|
</template>
|
||||||
|
</q-input>
|
||||||
|
|
||||||
|
<!--categoryAtt: {{categoryAtt}}<br>-->
|
||||||
|
|
||||||
|
<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">
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
|
<SingleTodo ref="single" @deleteItemtodo="mydeleteitemtodo(mytodo._id)" @eventupdate="updateitemtodo"
|
||||||
|
@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>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--</q-infinite-scroll>-->
|
||||||
|
|
||||||
|
<div v-if="doneTodosCount > 0" class="titleCompleted">
|
||||||
|
<label>{{ $t('todo.completed') }}</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!--<q-infinite-scroll :handler="loadMoreTodo" :offset="7">-->
|
||||||
|
<div class="container">
|
||||||
|
<div :id="tools.getmyid(mytodo._id)" :index="index"
|
||||||
|
v-for="(mytodo, index) in todos_completati(categoryAtt)"
|
||||||
|
:key="mytodo._id" class="myitemdrag">
|
||||||
|
|
||||||
|
<SingleTodo ref="single" @deleteItemtodo="mydeleteitemtodo(mytodo._id)" @eventupdate="updateitemtodo"
|
||||||
|
@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>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--</q-infinite-scroll>-->
|
||||||
|
</div>
|
||||||
|
<!--CanIModifyTodo : {{CanIModifyTodo}}-->
|
||||||
|
|
||||||
|
<q-input v-if="(TodosCount > 0 || !viewtaskTop) && CanIModifyTodo" ref="insertTaskBottom" v-model="todobottom"
|
||||||
|
style="margin-left: 6px;"
|
||||||
|
color="blue-12"
|
||||||
|
debounce="1000"
|
||||||
|
:label="$t('todo.insertbottom')"
|
||||||
|
:after="[{icon: 'arrow_forward', content: true, handler () {}}]"
|
||||||
|
v-on:keyup.enter="dbInsert(false)">
|
||||||
|
|
||||||
|
</q-input>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<!--{{ tmpstrTodos }}-->
|
||||||
|
|
||||||
|
<!--<div class="flex-item btn-item">-->
|
||||||
|
<!--<q-btn class="mybtn" round color="" icon="lock" @click="getArrTodos">Get Todo</q-btn>-->
|
||||||
|
<!--<!–<q-btn class="mybtn" round color="" icon="person" @click="setArrTodos">Set Todo</q-btn>–>-->
|
||||||
|
<!--<!–<q-btn class="mybtn" round color="" icon="list" @click="reload_fromServer++">Reload</q-btn>–>-->
|
||||||
|
<!--</div>-->
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<!--<!–<q-input v-model="testPao" float-label="testPao"/>–>-->
|
||||||
|
<!--<q-input v-model="todos_changed" float-label="todos_changed"/>-->
|
||||||
|
|
||||||
|
<!--<q-input v-model="reload_fromServer" float-label="reload_fromServer"/>-->
|
||||||
|
|
||||||
|
<!--<div class="flex-item btn-item">-->
|
||||||
|
<!--<q-btn class="mybtn" round color="" icon="lock" @click="clicktest()"></q-btn>-->
|
||||||
|
<!--<q-btn class="mybtn" round color="" icon="person" @click="clicktest2()"></q-btn>-->
|
||||||
|
<!--<q-btn class="mybtn" round color="" icon="list" @click="checkUpdate()"></q-btn>-->
|
||||||
|
<!--</div>-->
|
||||||
|
<!--–>-->
|
||||||
|
|
||||||
|
<!--<q-btn class="mybtn" round color="" icon="lock" @click="clickaggshowtype()"></q-btn>-->
|
||||||
|
|
||||||
|
|
||||||
|
<!--<span style="white-space: pre;">{{ todos_vista }}</span>-->
|
||||||
|
</div>
|
||||||
|
</q-page>
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" src="./CTodo.ts">
|
<script lang="ts" src="./CTodo.ts">
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import './CTodo.scss';
|
@import './CTodo.scss';
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -10,7 +10,20 @@
|
|||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</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">
|
<div class="flex-item donotdrag divdescrTot">
|
||||||
<q-input v-if="sel && inEdit && itemtodo.statustodo !== tools.Status.COMPLETED" hide-underline type="textarea"
|
<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>
|
@keydown="keyDownArea" v-on:keydown.esc="exitEdit" @blur="exitEdit(true)" @click="editTodo()"></q-input>
|
||||||
|
|
||||||
<div v-else :class="classDescr"
|
<div v-else :class="classDescr"
|
||||||
@keydown="keyDownRow"><div class="clpos">{{itemtodo.pos}}: </div> {{ itemtodo.descr }}
|
@keydown="keyDownRow">{{ itemtodo.descr }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -63,24 +76,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div v-if="itemtodo.enableExpiring" :class="classExpiring">
|
<div v-if="itemtodo.enableExpiring" :class="classExpiring">
|
||||||
<CDate :mydate="itemtodo.expiring_at" @input="itemtodo.expiring_at = new Date(arguments[0])"
|
<CDate :mydate="itemtodo.expiring_at" @input="itemtodo.expiring_at = new Date(arguments[0])"
|
||||||
data_class="data_string" :readonly="!CanIModifyTodo">
|
data_class="data_string" :readonly="!CanIModifyTodo">
|
||||||
</CDate>
|
</CDate>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ export default class MixinBase extends MixinMetaTags {
|
|||||||
myrec.serv = serv
|
myrec.serv = serv
|
||||||
if ((myrec.type === tools.FieldType.date) || (myrec.type === tools.FieldType.onlydate))
|
if ((myrec.type === tools.FieldType.date) || (myrec.type === tools.FieldType.onlydate))
|
||||||
myrec.value_date = value
|
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
|
myrec.value_num = value
|
||||||
else if (myrec.type === tools.FieldType.boolean)
|
else if (myrec.type === tools.FieldType.boolean)
|
||||||
myrec.value_bool = value
|
myrec.value_bool = value
|
||||||
|
|||||||
@@ -24,6 +24,13 @@ export interface IEvents {
|
|||||||
linkpage?: string
|
linkpage?: string
|
||||||
linkpdf?: string
|
linkpdf?: string
|
||||||
nobookable?: boolean
|
nobookable?: boolean
|
||||||
|
lunchAvailable?: boolean
|
||||||
|
dinnerAvailable?: boolean
|
||||||
|
lunchType?: number
|
||||||
|
dinnerType?: number
|
||||||
|
lunchPrice?: number
|
||||||
|
dinnerPrice?: number
|
||||||
|
internal?: boolean
|
||||||
news?: boolean
|
news?: boolean
|
||||||
canceled?: boolean
|
canceled?: boolean
|
||||||
deleted?: boolean
|
deleted?: boolean
|
||||||
@@ -36,6 +43,8 @@ export interface IBookedEvent {
|
|||||||
userId: string
|
userId: string
|
||||||
id_bookedevent?: any
|
id_bookedevent?: any
|
||||||
numpeople: number
|
numpeople: number
|
||||||
|
numpeopleLunch?: number
|
||||||
|
numpeopleDinner?: number
|
||||||
infoevent: string
|
infoevent: string
|
||||||
msgbooking: string
|
msgbooking: string
|
||||||
datebooked?: Date
|
datebooked?: Date
|
||||||
|
|||||||
@@ -166,6 +166,7 @@ export interface IGlobalState {
|
|||||||
category: string
|
category: string
|
||||||
stateConnection: string
|
stateConnection: string
|
||||||
networkDataReceived: boolean
|
networkDataReceived: boolean
|
||||||
|
clickcmd?: string
|
||||||
cfgServer: ICfgServer[]
|
cfgServer: ICfgServer[]
|
||||||
testp1: ITestp1
|
testp1: ITestp1
|
||||||
connData: IConnData
|
connData: IConnData
|
||||||
@@ -449,3 +450,11 @@ export const DefaultNewsState: INewsState = {
|
|||||||
totunsubscribed: 0,
|
totunsubscribed: 0,
|
||||||
totsentlastid: 0
|
totsentlastid: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IPagination {
|
||||||
|
sortBy: string,
|
||||||
|
descending: boolean
|
||||||
|
rowsNumber: number
|
||||||
|
page: number,
|
||||||
|
rowsPerPage: number // specifying this determines pagination is server-side
|
||||||
|
}
|
||||||
|
|||||||
@@ -62,7 +62,8 @@ export const Privacy = {
|
|||||||
all: 'all',
|
all: 'all',
|
||||||
friends: 'friends',
|
friends: 'friends',
|
||||||
mygroup: 'mygroup',
|
mygroup: 'mygroup',
|
||||||
onlyme: 'onlyme'
|
onlyme: 'onlyme',
|
||||||
|
inherited: 'inherited'
|
||||||
}
|
}
|
||||||
|
|
||||||
export const TypeProj = {
|
export const TypeProj = {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export default class Eventlist extends Vue {
|
|||||||
public getEventsBookedByIdEvent: (state: ICalendarState, id, showall) => IBookedEvent[]
|
public getEventsBookedByIdEvent: (state: ICalendarState, id, showall) => IBookedEvent[]
|
||||||
|
|
||||||
@Getter('getNumParticipants', { namespace })
|
@Getter('getNumParticipants', { namespace })
|
||||||
public getNumParticipants: (state: ICalendarState, event: IEvents, showall) => number
|
public getNumParticipants: (state: ICalendarState, event: IEvents, showall, tipo) => number
|
||||||
|
|
||||||
public getNameSurnameByUserId(userid) {
|
public getNameSurnameByUserId(userid) {
|
||||||
return UserStore.getters.getNameSurnameByUserId(userid)
|
return UserStore.getters.getNameSurnameByUserId(userid)
|
||||||
@@ -51,7 +51,7 @@ export default class Eventlist extends Vue {
|
|||||||
let add = true
|
let add = true
|
||||||
|
|
||||||
if (!this.showall) {
|
if (!this.showall) {
|
||||||
add = CalendarStore.getters.getNumParticipants(myevent, this.showall) > 0
|
add = CalendarStore.getters.getNumParticipants(myevent, this.showall, 0) > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
if (add) {
|
if (add) {
|
||||||
@@ -96,7 +96,7 @@ export default class Eventlist extends Vue {
|
|||||||
let add = true
|
let add = true
|
||||||
|
|
||||||
if (!this.showall) {
|
if (!this.showall) {
|
||||||
add = CalendarStore.getters.getNumParticipants(myevent, this.showall) > 0
|
add = CalendarStore.getters.getNumParticipants(myevent, this.showall, 0) > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
if (add) {
|
if (add) {
|
||||||
|
|||||||
@@ -1,114 +1,135 @@
|
|||||||
<template>
|
<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 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
|
<div v-if="!showall" class="text-h6 bg-red text-white text-center q-pa-xs shadow-max">Lista delle tue
|
||||||
prenotazioni agli Eventi:
|
prenotazioni agli Eventi:
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<q-space></q-space>
|
||||||
|
|
||||||
|
<q-toggle v-model="showPrev" :val="lists.MenuAction.SHOW_PREV_REC"
|
||||||
|
:label="$t('grid.showprevedit')"></q-toggle>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
<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>
|
||||||
|
</td>
|
||||||
|
<td :class="">
|
||||||
|
<div class="text-center boldhigh">{{ event.title }}</div>
|
||||||
|
</td>
|
||||||
|
<td v-if="!tools.isMobile()">
|
||||||
|
<div class="text-center">{{ getTeacherByUsername(event.teacher) }}
|
||||||
|
<span v-if="isValidUsername(event.teacher2)"> - {{ getTeacherByUsername(event.teacher2) }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
</td>
|
||||||
<q-space></q-space>
|
<td v-if="showall">
|
||||||
|
<div class="text-center">{{ getNumParticipants(event, showall, '') }}</div>
|
||||||
<q-toggle v-model="showPrev" :val="lists.MenuAction.SHOW_PREV_REC"
|
</td>
|
||||||
:label="$t('grid.showprevedit')"></q-toggle>
|
<td v-if="showall">
|
||||||
</div>
|
<div class="text-center">{{ getNumParticipants(event, showall, 'lunch') }}</div>
|
||||||
|
</td>
|
||||||
<div>
|
<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"
|
||||||
|
dense
|
||||||
|
round
|
||||||
|
@click="showpeople = true; eventsel = event"
|
||||||
|
aria-label="Menu">
|
||||||
|
<q-icon name="info"/>
|
||||||
|
</q-btn>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</q-markup-table>
|
||||||
|
<q-dialog v-model="showpeople">
|
||||||
|
<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>
|
||||||
|
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
|
||||||
|
</q-toolbar>
|
||||||
|
<q-card-section class="q-pa-xs inset-shadow">
|
||||||
<q-markup-table wrap-cells bordered separator="horizontal" class="listaev__table">
|
<q-markup-table wrap-cells bordered separator="horizontal" class="listaev__table">
|
||||||
<thead>
|
<thead>
|
||||||
<th>{{$t('cal.data')}}</th>
|
<th>Data</th>
|
||||||
<th>{{$t('cal.event')}}</th>
|
<th>Messaggio</th>
|
||||||
<th v-if="!tools.isMobile()">{{$t('cal.teachertitle')}}</th>
|
<th>Num</th>
|
||||||
<th v-if="showall"><span v-if="!tools.isMobile()">{{$t('cal.selnumpeople')}}</span><span v-else>{{$t('cal.selnumpeople_short')}}</span>
|
<th>Azione</th>
|
||||||
</th>
|
</thead>
|
||||||
<th>{{$t('cal.peoplebooked')}}</th>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="(event, index) in getEventList()" class="listaev listaev__table">
|
<tr v-for="(eventbook, index) in getEventsBookedByIdEvent(eventsel._id, showall)"
|
||||||
<td>
|
class="listaev listaev__table">
|
||||||
<div class="text-center text-blue">{{func_tools.getDateStr(event.dateTimeStart)}}</div>
|
<td class="text-center">
|
||||||
</td>
|
<div>{{ func_tools.getDateTimeShortStr(eventbook.datebooked) }}
|
||||||
<td :class="">
|
</div>
|
||||||
<div class="text-center boldhigh">{{ event.title }}</div>
|
</td>
|
||||||
</td>
|
<td class="text-center">
|
||||||
<td v-if="!tools.isMobile()">
|
<strong>{{ getNameSurnameByUserId(eventbook.userId) }}</strong> <span
|
||||||
<div class="text-center">{{ getTeacherByUsername(event.teacher) }}
|
v-if="eventbook.msgbooking"> {{ $t('sendmsg.write') }}: </span><br>
|
||||||
<span v-if="isValidUsername(event.teacher2)"> - {{ getTeacherByUsername(event.teacher2) }}</span>
|
{{ eventbook.msgbooking }}
|
||||||
</div>
|
</td>
|
||||||
</td>
|
<td class="text-center">
|
||||||
<td v-if="showall">
|
{{ eventbook.numpeople }}
|
||||||
<div class="text-center">{{ getNumParticipants(event, showall) }}</div>
|
</td>
|
||||||
</td>
|
<td class="text-center">
|
||||||
<td class="text-center">
|
{{ eventbook.numpeopleLunch }}
|
||||||
<q-btn v-if="getNumParticipants(event, showall) > 0"
|
</td>
|
||||||
dense
|
<td class="text-center">
|
||||||
round
|
{{ eventbook.numpeopleDinner }}
|
||||||
@click="showpeople = true; eventsel = event"
|
</td>
|
||||||
aria-label="Menu">
|
<td class="text-center">
|
||||||
<q-icon name="info"/>
|
<q-btn flat round color="red" icon="fas fa-trash-alt" size="sm"
|
||||||
</q-btn>
|
@click="tools.CancelBookingEvent(mythis, eventsel, eventbook._id, false)"></q-btn>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</q-markup-table>
|
</q-markup-table>
|
||||||
<q-dialog v-model="showpeople">
|
</q-card-section>
|
||||||
<q-card v-if="eventsel">
|
</q-card>
|
||||||
<q-toolbar class="bg-primary text-white" :style="`min-width: ` + tools.myheight_dialog() + `px;`">
|
</q-dialog>
|
||||||
<q-toolbar-title>
|
<div v-if="numrec === 0">
|
||||||
{{ eventsel.title }}
|
<div v-if="!showPrev" class="text-blue text-center q-pa-xs shadow">
|
||||||
</q-toolbar-title>
|
Attualmente non hai nessuna Prenotazione futura.
|
||||||
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
|
|
||||||
</q-toolbar>
|
|
||||||
<q-card-section class="q-pa-xs inset-shadow">
|
|
||||||
<q-markup-table wrap-cells bordered separator="horizontal" class="listaev__table">
|
|
||||||
<thead>
|
|
||||||
<th>Data</th>
|
|
||||||
<th>Messaggio</th>
|
|
||||||
<th>Num</th>
|
|
||||||
<th>Azione</th>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
<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>
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
<strong>{{getNameSurnameByUserId(eventbook.userId)}}</strong> <span
|
|
||||||
v-if="eventbook.msgbooking"> {{ $t('sendmsg.write') }}: </span><br>
|
|
||||||
{{ eventbook.msgbooking }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{eventbook.numpeople}}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
<q-btn flat round color="red" icon="fas fa-trash-alt" size="sm"
|
|
||||||
@click="tools.CancelBookingEvent(mythis, eventsel, eventbook._id, false)"></q-btn>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</q-markup-table>
|
|
||||||
</q-card-section>
|
|
||||||
</q-card>
|
|
||||||
</q-dialog>
|
|
||||||
<div v-if="numrec === 0">
|
|
||||||
<div v-if="!showPrev" class="text-blue text-center q-pa-xs shadow">
|
|
||||||
Attualmente non hai nessuna Prenotazione futura.
|
|
||||||
</div>
|
|
||||||
<div v-else class="text-blue text-center q-pa-xs shadow">
|
|
||||||
Non hai nessuna Prenotazione passata.
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<br>
|
|
||||||
</div>
|
</div>
|
||||||
</CMyPage>
|
<div v-else class="text-blue text-center q-pa-xs shadow">
|
||||||
|
Non hai nessuna Prenotazione passata.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
</div>
|
||||||
|
</CMyPage>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" src="./eventlist.ts">
|
<script lang="ts" src="./eventlist.ts">
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import './eventlist.scss';
|
@import './eventlist.scss';
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -494,7 +494,7 @@ const msg_it = {
|
|||||||
todo: {
|
todo: {
|
||||||
titleprioritymenu: 'Priorità:',
|
titleprioritymenu: 'Priorità:',
|
||||||
inserttop: 'Inserisci il Task in cima',
|
inserttop: 'Inserisci il Task in cima',
|
||||||
insertbottom: 'Inserisci il Task in basso',
|
insertbottom: 'Inserisci quì una Nuova Attività',
|
||||||
edit: 'Descrizione Task:',
|
edit: 'Descrizione Task:',
|
||||||
completed: 'Ultimi Completati',
|
completed: 'Ultimi Completati',
|
||||||
usernotdefined: 'Attenzione, occorre essere Loggati per poter aggiungere un Todo',
|
usernotdefined: 'Attenzione, occorre essere Loggati per poter aggiungere un Todo',
|
||||||
@@ -589,6 +589,10 @@ const msg_it = {
|
|||||||
eventstartdatetime: 'Inizio',
|
eventstartdatetime: 'Inizio',
|
||||||
enterEndDateTime: 'Fine',
|
enterEndDateTime: 'Fine',
|
||||||
selnumpeople: 'Partecipanti',
|
selnumpeople: 'Partecipanti',
|
||||||
|
Lunch: 'Pranzo',
|
||||||
|
Dinner: 'Cena',
|
||||||
|
selnumpeopleLunch: 'Persone a Pranzo',
|
||||||
|
selnumpeopleDinner: 'Persone a Cena',
|
||||||
selnumpeople_short: 'Num',
|
selnumpeople_short: 'Num',
|
||||||
msgbooking: 'Messaggio da inviare',
|
msgbooking: 'Messaggio da inviare',
|
||||||
showpdf: 'Vedi PDF',
|
showpdf: 'Vedi PDF',
|
||||||
@@ -630,6 +634,13 @@ const msg_it = {
|
|||||||
linkpage: 'WebSite',
|
linkpage: 'WebSite',
|
||||||
linkpdf: 'Link ad un PDF',
|
linkpdf: 'Link ad un PDF',
|
||||||
nobookable: 'Non Prenotabile',
|
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à',
|
news: 'Novità',
|
||||||
dupId: 'Id Duplicato',
|
dupId: 'Id Duplicato',
|
||||||
canceled: 'Cancellato',
|
canceled: 'Cancellato',
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ import { tools } from '@src/store/Modules/tools'
|
|||||||
import { toolsext } from '@src/store/Modules/toolsext'
|
import { toolsext } from '@src/store/Modules/toolsext'
|
||||||
|
|
||||||
export const OtherTables = ['categories', 'config', 'swmsg']
|
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 const allMethod = ['sync_post_', 'sync_patch_', 'delete_', 'hide_']
|
||||||
|
|
||||||
export function getLinkByTableName(nametable) {
|
export function getLinkByTableName(nametable) {
|
||||||
@@ -44,7 +45,7 @@ export function allTables() {
|
|||||||
async function dbInsertSave(call, item, method) {
|
async function dbInsertSave(call, item, method) {
|
||||||
|
|
||||||
let ret = true
|
let ret = true
|
||||||
if (!('serviceWorker' in navigator)) {
|
if (!useServiceWorker()) {
|
||||||
|
|
||||||
console.log('dbInsertSave', item, method)
|
console.log('dbInsertSave', item, method)
|
||||||
|
|
||||||
@@ -76,7 +77,8 @@ async function dbInsertSave(call, item, method) {
|
|||||||
|
|
||||||
async function dbDeleteItem(call, item) {
|
async function dbDeleteItem(call, item) {
|
||||||
|
|
||||||
if (!('serviceWorker' in navigator)) {
|
let res = true
|
||||||
|
if (!useServiceWorker()) {
|
||||||
// console.log('dbdeleteItem', item)
|
// console.log('dbdeleteItem', item)
|
||||||
if (UserStore.getters.isUserInvalid) {
|
if (UserStore.getters.isUserInvalid) {
|
||||||
return false
|
return false
|
||||||
@@ -84,9 +86,10 @@ async function dbDeleteItem(call, item) {
|
|||||||
|
|
||||||
call = '/' + call
|
call = '/' + call
|
||||||
|
|
||||||
const res = await Api.SendReq(call + item._id, 'DELETE', null)
|
res = await Api.SendReq(call + '/' + item._id, 'DELETE', null)
|
||||||
.then((myres) => {
|
.then((myres) => {
|
||||||
console.log('dbdeleteItem to the Server')
|
console.log('dbdeleteItem to the Server')
|
||||||
|
// tools.showPositiveNotif(this.$q, 'Riga cancellata')
|
||||||
return myres
|
return myres
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@@ -96,11 +99,13 @@ async function dbDeleteItem(call, item) {
|
|||||||
|
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
async function dbHideItem(call, item) {
|
async function dbHideItem(call, item) {
|
||||||
|
|
||||||
if (!('serviceWorker' in navigator)) {
|
if (!useServiceWorker()) {
|
||||||
// console.log('dbdeleteItem', item)
|
// console.log('dbdeleteItem', item)
|
||||||
if (UserStore.getters.isUserInvalid) {
|
if (UserStore.getters.isUserInvalid) {
|
||||||
return false
|
return false
|
||||||
@@ -150,7 +155,7 @@ async function Sync_Execute(cmd, tablesync, nametab, method, item: ITodo, id, ms
|
|||||||
// console.log('serviceWorker NON PRESENTE !')
|
// console.log('serviceWorker NON PRESENTE !')
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if ('serviceWorker' in navigator) {
|
if (useServiceWorker()) {
|
||||||
return await navigator.serviceWorker.ready
|
return await navigator.serviceWorker.ready
|
||||||
.then((sw) => {
|
.then((sw) => {
|
||||||
// console.log('---------------------- navigator.serviceWorker.ready')
|
// 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)
|
const risdata = await Sync_Execute(cmd, tablesync, nametab, method, item, id, msg)
|
||||||
|
|
||||||
|
let ris = false
|
||||||
if (cmd === DB.CMD_SYNC_NEW) {
|
if (cmd === DB.CMD_SYNC_NEW) {
|
||||||
if ((method === 'POST') || (method === 'PATCH')) {
|
if ((method === 'POST') || (method === 'PATCH')) {
|
||||||
await dbInsertSave(nametab, item, method)
|
ris = await dbInsertSave(nametab, item, method)
|
||||||
}
|
}
|
||||||
} else if (cmd === DB.CMD_DELETE) {
|
} else if (cmd === DB.CMD_DELETE) {
|
||||||
await dbDeleteItem(nametab, item)
|
ris = await dbDeleteItem(nametab, item)
|
||||||
} else if (cmd === DB.CMD_HIDE) {
|
} 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) {
|
export async function Sync_SaveItem(nametab: string, method, item) {
|
||||||
@@ -246,7 +252,7 @@ export async function aftercalling(ris, checkPending: boolean, nametabindex: str
|
|||||||
} else {
|
} else {
|
||||||
tools.consolelogpao('NETWORK UNREACHABLE ! (Error in fetch)', UserStore.getters.getServerCode, ris.status)
|
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
|
// Read all data from IndexedDB Store into Memory
|
||||||
await updatefromIndexedDbToState(nametabindex)
|
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 !
|
// If something in the call of Service Worker went wrong (Network or Server Down), then retry !
|
||||||
async function sendSwMsgIfAvailable() {
|
async function sendSwMsgIfAvailable() {
|
||||||
let something = false
|
let something = false
|
||||||
|
|
||||||
if ('serviceWorker' in navigator) {
|
if (useServiceWorker()) {
|
||||||
console.log(' -------- sendSwMsgIfAvailable')
|
console.log(' -------- sendSwMsgIfAvailable')
|
||||||
|
|
||||||
const count = await checkPendingMsg()
|
const count = await checkPendingMsg()
|
||||||
@@ -344,7 +355,7 @@ async function sendSwMsgIfAvailable() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async function waitAndRefreshData() {
|
export async function waitAndRefreshData() {
|
||||||
// #Todo++ waitAndRefreshData: Check if is OK
|
// #Todo++ waitAndRefreshData: Check if is OK
|
||||||
await Projects.actions.dbLoad({ checkPending: false, onlyiffirsttime: false })
|
await Projects.actions.dbLoad({ checkPending: false, onlyiffirsttime: false })
|
||||||
return await Todos.actions.dbLoad({ checkPending: 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) {
|
export async function table_ModifyRecord(nametable, myitem, listFieldsToChange, field) {
|
||||||
console.log('table_ModifyRecord ... ', nametable)
|
// console.log('table_ModifyRecord ... ', nametable)
|
||||||
if (myitem === null) {
|
if (myitem === null) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log('--> table_ModifyRecord', nametable, myitem.descr)
|
console.log('--> table_ModifyRecord', nametable, myitem)
|
||||||
|
|
||||||
if ((field === 'status') && (nametable === 'todos') && (myitem.status === tools.Status.COMPLETED)) {
|
if ((field === 'status') && (nametable === 'todos') && (myitem.status === tools.Status.COMPLETED)) {
|
||||||
myitem.completed_at = tools.getDateNow()
|
myitem.completed_at = tools.getDateNow()
|
||||||
@@ -443,16 +454,24 @@ export async function table_ModifyRecord(nametable, myitem, listFieldsToChange,
|
|||||||
|
|
||||||
const myobjsaved = tools.jsonCopy(myitem)
|
const myobjsaved = tools.jsonCopy(myitem)
|
||||||
|
|
||||||
// get record from IndexedDb
|
let miorec = null
|
||||||
const miorec = await globalroutines(null, 'read', nametable, null, myobjsaved._id)
|
if (useServiceWorker()) {
|
||||||
if (miorec === undefined) {
|
// get record from IndexedDb
|
||||||
console.log('~~~~~~~~~~~~~~~~~~~~ !!!!!!!!!!!!!!!!!! Record not Found !!!!!! id=', myobjsaved._id)
|
miorec = await globalroutines(null, 'read', nametable, null, myobjsaved._id)
|
||||||
return
|
if (miorec === undefined) {
|
||||||
}
|
console.log('~~~~~~~~~~~~~~~~~~~~ !!!!!!!!!!!!!!!!!! Record not Found !!!!!! id=', myobjsaved._id)
|
||||||
|
|
||||||
listFieldsToChange.forEach((myfield) => {
|
// Prova cmq a salvarlo sul server
|
||||||
setmodifiedIfchanged(miorec, myobjsaved, myfield)
|
return Sync_SaveItem(nametable, 'PATCH', miorec)
|
||||||
})
|
}
|
||||||
|
listFieldsToChange.forEach((myfield) => {
|
||||||
|
setmodifiedIfchanged(miorec, myobjsaved, myfield)
|
||||||
|
})
|
||||||
|
|
||||||
|
} else {
|
||||||
|
miorec = myitem
|
||||||
|
miorec.modified = true
|
||||||
|
}
|
||||||
|
|
||||||
console.log( ' ... 4 ')
|
console.log( ' ... 4 ')
|
||||||
|
|
||||||
@@ -464,17 +483,21 @@ export async function table_ModifyRecord(nametable, myitem, listFieldsToChange,
|
|||||||
// 1) Permit to Update the Views
|
// 1) Permit to Update the Views
|
||||||
tools.notifyarraychanged(miorec)
|
tools.notifyarraychanged(miorec)
|
||||||
|
|
||||||
// 2) Modify on IndexedDb
|
if (useServiceWorker()) {
|
||||||
console.log('// 2) Modify on IndexedDb', miorec)
|
// 2) Modify on IndexedDb
|
||||||
return globalroutines(null, 'write', nametable, miorec)
|
console.log('// 2) Modify on IndexedDb', miorec)
|
||||||
.then((ris) => {
|
return globalroutines(null, 'write', nametable, miorec)
|
||||||
|
.then((ris) => {
|
||||||
|
|
||||||
// 3) Modify on the Server (call)
|
// 3) Modify on the Server (call)
|
||||||
return Sync_SaveItem(nametable, 'PATCH', miorec)
|
return Sync_SaveItem(nametable, 'PATCH', miorec)
|
||||||
|
|
||||||
})
|
})
|
||||||
// } else {
|
// } else {
|
||||||
// console.log(' ', miorec.descr, 'NON MODIF!')
|
// console.log(' ', miorec.descr, 'NON MODIF!')
|
||||||
|
} else {
|
||||||
|
return Sync_SaveItem(nametable, 'PATCH', miorec)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ const state: IGlobalState = {
|
|||||||
rightCartOpen: false,
|
rightCartOpen: false,
|
||||||
stateConnection: stateConnDefault,
|
stateConnection: stateConnDefault,
|
||||||
networkDataReceived: false,
|
networkDataReceived: false,
|
||||||
|
clickcmd: '',
|
||||||
cfgServer: [],
|
cfgServer: [],
|
||||||
testp1: { contatore: 0, mioarray: [] },
|
testp1: { contatore: 0, mioarray: [] },
|
||||||
category: 'personal',
|
category: 'personal',
|
||||||
@@ -240,6 +241,10 @@ namespace Getters {
|
|||||||
return mystate.settings.find((rec) => rec.key === key)
|
return mystate.settings.find((rec) => rec.key === key)
|
||||||
}, 'getrecSettingsByKey')
|
}, 'getrecSettingsByKey')
|
||||||
|
|
||||||
|
const getCmdClick = b.read((mystate: IGlobalState) => (): string => {
|
||||||
|
return mystate.clickcmd
|
||||||
|
}, 'getCmdClick')
|
||||||
|
|
||||||
const getValueSettingsByKey = b.read((mystate: IGlobalState) => (key, serv): any => {
|
const getValueSettingsByKey = b.read((mystate: IGlobalState) => (key, serv): any => {
|
||||||
|
|
||||||
const myrec = getters.getrecSettingsByKey(key, serv)
|
const myrec = getters.getrecSettingsByKey(key, serv)
|
||||||
@@ -247,7 +252,7 @@ namespace Getters {
|
|||||||
if (!!myrec) {
|
if (!!myrec) {
|
||||||
if ((myrec.type === tools.FieldType.date) || (myrec.type === tools.FieldType.onlydate))
|
if ((myrec.type === tools.FieldType.date) || (myrec.type === tools.FieldType.onlydate))
|
||||||
return myrec.value_date
|
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
|
return myrec.value_num
|
||||||
else if (myrec.type === tools.FieldType.boolean)
|
else if (myrec.type === tools.FieldType.boolean)
|
||||||
return myrec.value_bool
|
return myrec.value_bool
|
||||||
@@ -303,6 +308,10 @@ namespace Getters {
|
|||||||
return getListByTable()
|
return getListByTable()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
get getCmdClick() {
|
||||||
|
return getCmdClick()
|
||||||
|
},
|
||||||
|
|
||||||
get getValueSettingsByKey() {
|
get getValueSettingsByKey() {
|
||||||
return getValueSettingsByKey()
|
return getValueSettingsByKey()
|
||||||
},
|
},
|
||||||
@@ -354,6 +363,11 @@ namespace Mutations {
|
|||||||
state.testp1.mioarray = newarr
|
state.testp1.mioarray = newarr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function changeCmdClick(mystate: IGlobalState, value: string) {
|
||||||
|
console.log('changeCmdClick', value)
|
||||||
|
mystate.clickcmd = value
|
||||||
|
}
|
||||||
|
|
||||||
function setPaoArray_Delete(state: IGlobalState) {
|
function setPaoArray_Delete(state: IGlobalState) {
|
||||||
state.testp1.mioarray.pop()
|
state.testp1.mioarray.pop()
|
||||||
}
|
}
|
||||||
@@ -439,7 +453,7 @@ namespace Mutations {
|
|||||||
if (!!myrec) {
|
if (!!myrec) {
|
||||||
if ((myrec.type === tools.FieldType.date) || (myrec.type === tools.FieldType.onlydate))
|
if ((myrec.type === tools.FieldType.date) || (myrec.type === tools.FieldType.onlydate))
|
||||||
myrec.value_date = value
|
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
|
myrec.value_num = value
|
||||||
else if (myrec.type === tools.FieldType.boolean)
|
else if (myrec.type === tools.FieldType.boolean)
|
||||||
myrec.value_bool = value
|
myrec.value_bool = value
|
||||||
@@ -457,6 +471,7 @@ namespace Mutations {
|
|||||||
setCategorySel: b.commit(setCategorySel),
|
setCategorySel: b.commit(setCategorySel),
|
||||||
setStateConnection: b.commit(setStateConnection),
|
setStateConnection: b.commit(setStateConnection),
|
||||||
SetwasAlreadySubOnDb: b.commit(SetwasAlreadySubOnDb),
|
SetwasAlreadySubOnDb: b.commit(SetwasAlreadySubOnDb),
|
||||||
|
changeCmdClick: b.commit(changeCmdClick),
|
||||||
saveConfig: b.commit(saveConfig),
|
saveConfig: b.commit(saveConfig),
|
||||||
setPaoArray: b.commit(setPaoArray),
|
setPaoArray: b.commit(setPaoArray),
|
||||||
setPaoArray_Delete: b.commit(setPaoArray_Delete),
|
setPaoArray_Delete: b.commit(setPaoArray_Delete),
|
||||||
|
|||||||
@@ -37,6 +37,19 @@ const listFieldsUpdateCalculation: string [] = ['hoursplanned', 'hoursleft', 'ho
|
|||||||
const b = storeBuilder.module<IProjectsState>('Projects', stateglob)
|
const b = storeBuilder.module<IProjectsState>('Projects', stateglob)
|
||||||
const stateGetter = b.state()
|
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) {
|
function getarrByCategory(category: string) {
|
||||||
if (!stateglob.projects) {
|
if (!stateglob.projects) {
|
||||||
return []
|
return []
|
||||||
@@ -66,7 +79,7 @@ function getproj(projects, idproj, tipoproj: string) {
|
|||||||
else if (tipoproj === RouteNames.projectsshared)
|
else if (tipoproj === RouteNames.projectsshared)
|
||||||
ris = projects.filter((proj) => (proj.id_parent === idproj) && (proj.userId === UserStore.state.my._id) && (proj.privacyread !== Privacy.onlyme))
|
ris = projects.filter((proj) => (proj.id_parent === idproj) && (proj.userId === UserStore.state.my._id) && (proj.privacyread !== Privacy.onlyme))
|
||||||
else if (tipoproj === RouteNames.projectsall)
|
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)
|
if (ris)
|
||||||
ris = ris.sort((a, b) => a.pos - b.pos)
|
ris = ris.sort((a, b) => a.pos - b.pos)
|
||||||
@@ -105,8 +118,8 @@ namespace Getters {
|
|||||||
hoursplanned: 0,
|
hoursplanned: 0,
|
||||||
hoursleft: 0,
|
hoursleft: 0,
|
||||||
progressCalc: 0,
|
progressCalc: 0,
|
||||||
privacyread: 'onlyme',
|
privacyread: 'inherited',
|
||||||
privacywrite: 'onlyme',
|
privacywrite: 'inherited',
|
||||||
begin_development: tools.getDateNull(),
|
begin_development: tools.getDateNull(),
|
||||||
begin_test: tools.getDateNull(),
|
begin_test: tools.getDateNull(),
|
||||||
hoursweeky_plannedtowork: 0,
|
hoursweeky_plannedtowork: 0,
|
||||||
@@ -147,6 +160,33 @@ namespace Getters {
|
|||||||
}
|
}
|
||||||
}, 'listaprojects')
|
}, '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 => {
|
const getDescrById = b.read((state: IProjectsState) => (id: string): string => {
|
||||||
if (id === process.env.PROJECT_ID_MAIN)
|
if (id === process.env.PROJECT_ID_MAIN)
|
||||||
return 'Projects'
|
return 'Projects'
|
||||||
@@ -177,9 +217,19 @@ namespace Getters {
|
|||||||
if (UserStore.state.my._id === proj.userId) // If it's the owner
|
if (UserStore.state.my._id === proj.userId) // If it's the owner
|
||||||
return true
|
return true
|
||||||
|
|
||||||
return (proj.privacyread === Privacy.all) ||
|
let myprojtocheck = proj
|
||||||
(proj.privacyread === Privacy.friends) && (UserStore.getters.IsMyFriend(proj.userId))
|
if (proj.privacyread === Privacy.inherited) {
|
||||||
|| ((proj.privacyread === Privacy.mygroup) && (UserStore.getters.IsMyGroup(proj.userId)))
|
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 {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@@ -191,8 +241,18 @@ namespace Getters {
|
|||||||
return false
|
return false
|
||||||
|
|
||||||
if (!!UserStore) {
|
if (!!UserStore) {
|
||||||
|
|
||||||
|
let myprojtocheck = proj
|
||||||
|
if (proj.privacywrite === Privacy.inherited) {
|
||||||
|
myprojtocheck = getFirstInherited(proj, proj.id_parent, state)
|
||||||
|
if (!myprojtocheck)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
if (!!UserStore.state)
|
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
|
else
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@@ -215,6 +275,9 @@ namespace Getters {
|
|||||||
get listaprojects() {
|
get listaprojects() {
|
||||||
return listaprojects()
|
return listaprojects()
|
||||||
},
|
},
|
||||||
|
get listagerarchia() {
|
||||||
|
return listagerarchia()
|
||||||
|
},
|
||||||
get getDescrById() {
|
get getDescrById() {
|
||||||
return getDescrById()
|
return getDescrById()
|
||||||
},
|
},
|
||||||
@@ -236,17 +299,16 @@ namespace Mutations {
|
|||||||
}
|
}
|
||||||
if (atfirst) {
|
if (atfirst) {
|
||||||
state.projects.unshift(objproj)
|
state.projects.unshift(objproj)
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
state.projects.push(objproj)
|
state.projects.push(objproj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateProject(state: IProjectsState, { objproj }) {
|
function updateProject(state: IProjectsState, { objproj }) {
|
||||||
if (!!objproj) {
|
if (!!objproj) {
|
||||||
console.log('updateProject', objproj)
|
// console.log('updateProject', objproj)
|
||||||
const index = tools.getIndexById(state.projects, objproj._id)
|
const index = tools.getIndexById(state.projects, objproj._id)
|
||||||
console.log('index', index)
|
// console.log('index', index)
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
updateDataCalculated(state.projects[index], objproj)
|
updateDataCalculated(state.projects[index], objproj)
|
||||||
|
|
||||||
@@ -263,7 +325,7 @@ namespace Mutations {
|
|||||||
ApiTables.removeitemfromarray(state.projects, ind)
|
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)
|
const indorig = tools.getIndexById(state.projects, myitemorig._id)
|
||||||
|
|
||||||
state.projects.splice(indorig, 1)
|
state.projects.splice(indorig, 1)
|
||||||
|
|||||||
@@ -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)))
|
return mystate.bookedevent.find((bookedevent) => (bookedevent.id_bookedevent === myevent._id) && (bookedevent.userId === UserStore.state.my._id) && ((isconfirmed && bookedevent.booked) || (!isconfirmed)))
|
||||||
}, 'findEventBooked')
|
}, 'findEventBooked')
|
||||||
|
|
||||||
const getNumParticipants = b.read((mystate: ICalendarState) => (myevent: IEvents, showall) => {
|
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) ))
|
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)
|
if (myarr)
|
||||||
return myarr.reduce((sum, bookedevent) => sum + bookedevent.numpeople, 0)
|
return myarr.reduce((sum, bookedevent) => sum + bookedevent.numpeople, 0)
|
||||||
else
|
else
|
||||||
@@ -157,6 +157,8 @@ namespace Actions {
|
|||||||
id_bookedevent: bookevent.id_bookedevent,
|
id_bookedevent: bookevent.id_bookedevent,
|
||||||
infoevent: bookevent.infoevent,
|
infoevent: bookevent.infoevent,
|
||||||
numpeople: bookevent.numpeople,
|
numpeople: bookevent.numpeople,
|
||||||
|
numpeopleLunch: bookevent.numpeopleLunch,
|
||||||
|
numpeopleDinner: bookevent.numpeopleDinner,
|
||||||
msgbooking: bookevent.msgbooking,
|
msgbooking: bookevent.msgbooking,
|
||||||
datebooked: bookevent.datebooked,
|
datebooked: bookevent.datebooked,
|
||||||
userId: UserStore.state.my._id,
|
userId: UserStore.state.my._id,
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ namespace Getters {
|
|||||||
|
|
||||||
const todos_completati = b.read((stateparam: ITodosState) => (cat: string): ITodo[] => {
|
const todos_completati = b.read((stateparam: ITodosState) => (cat: string): ITodo[] => {
|
||||||
const indcat = getindexbycategory(cat)
|
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]) {
|
if (stateparam.todos[indcat]) {
|
||||||
let arrout = []
|
let arrout = []
|
||||||
if (stateparam.showtype === costanti.ShowTypeTask.SHOW_LAST_N_COMPLETED) { // Show only the first N completed
|
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('stateparam.categories', stateparam.categories)
|
||||||
console.log('myitemdest', myitemdest)
|
console.log('myitemdest', myitemdest)
|
||||||
console.log('indcat', indcat, 'indcatdest', indcatdest, 'indorig', indorig)
|
// console.log('indcat', indcat, 'indcatdest', indcatdest, 'indorig', indorig)
|
||||||
|
|
||||||
if (indcatdest === -1) {
|
if (indcatdest === -1) {
|
||||||
stateparam.categories.push(myitemdest.category)
|
stateparam.categories.push(myitemdest.category)
|
||||||
@@ -288,7 +288,7 @@ namespace Actions {
|
|||||||
|
|
||||||
// console.log('ARRAY TODOS = ', state.todos)
|
// console.log('ARRAY TODOS = ', state.todos)
|
||||||
if (process.env.DEBUG === '1') {
|
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
|
return res
|
||||||
@@ -438,7 +438,7 @@ namespace Actions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function modify(context, { myitem, field }) {
|
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) {
|
async function swapElems(context, itemdragend: IDrag) {
|
||||||
|
|||||||
@@ -394,7 +394,6 @@ namespace Mutations {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function setusersList(mystate: IUserState, usersList: IUserFields[]) {
|
function setusersList(mystate: IUserState, usersList: IUserFields[]) {
|
||||||
// console.log('setusersList', usersList)
|
// console.log('setusersList', usersList)
|
||||||
mystate.usersList = [...usersList]
|
mystate.usersList = [...usersList]
|
||||||
@@ -411,7 +410,6 @@ namespace Mutations {
|
|||||||
localStorage.setItem(tools.localStorage.lang, state.lang)
|
localStorage.setItem(tools.localStorage.lang, state.lang)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function UpdatePwd(mystate: IUserState, x_auth_token: string) {
|
function UpdatePwd(mystate: IUserState, x_auth_token: string) {
|
||||||
mystate.x_auth_token = x_auth_token
|
mystate.x_auth_token = x_auth_token
|
||||||
if (!mystate.my.tokens) {
|
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) {
|
async function newsletter_setactivate(context, paramquery) {
|
||||||
|
|
||||||
return await Api.SendReq('/news/setactivate', 'POST', paramquery)
|
return await Api.SendReq('/news/setactivate', 'POST', paramquery)
|
||||||
@@ -1065,6 +1074,7 @@ namespace Actions {
|
|||||||
execDbOp: b.dispatch(execDbOp),
|
execDbOp: b.dispatch(execDbOp),
|
||||||
setLangServer: b.dispatch(setLangServer),
|
setLangServer: b.dispatch(setLangServer),
|
||||||
newsletterload: b.dispatch(newsletterload),
|
newsletterload: b.dispatch(newsletterload),
|
||||||
|
reportload: b.dispatch(reportload),
|
||||||
newsletter_setactivate: b.dispatch(newsletter_setactivate),
|
newsletter_setactivate: b.dispatch(newsletter_setactivate),
|
||||||
getDashboard: b.dispatch(getDashboard),
|
getDashboard: b.dispatch(getDashboard),
|
||||||
getDownline: b.dispatch(getDownline)
|
getDownline: b.dispatch(getDownline)
|
||||||
|
|||||||
@@ -14,5 +14,7 @@ export const costanti = {
|
|||||||
CANCEL_BOOKING: 1
|
CANCEL_BOOKING: 1
|
||||||
},
|
},
|
||||||
|
|
||||||
|
DRAGULA: false,
|
||||||
|
|
||||||
MAX_PHASES: 5,
|
MAX_PHASES: 5,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,6 +74,8 @@ export const colgallery = [
|
|||||||
fieldtype: tools.FieldType.listimages,
|
fieldtype: tools.FieldType.listimages,
|
||||||
jointable: ''
|
jointable: ''
|
||||||
}),
|
}),
|
||||||
|
AddCol(DeleteRec),
|
||||||
|
AddCol(DuplicateRec)
|
||||||
]
|
]
|
||||||
|
|
||||||
export const colmsg_templates = [
|
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: 'title_pt', label_trans: 'Tit POR', fieldtype: tools.FieldType.string }),
|
||||||
AddCol({ name: 'msg_pt', label_trans: 'POR', fieldtype: tools.FieldType.html }),
|
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: '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 = [
|
export const colmypage = [
|
||||||
@@ -173,6 +175,8 @@ export const colTableProducer = [
|
|||||||
AddCol({ name: 'city', label_trans: 'producer.city' }),
|
AddCol({ name: 'city', label_trans: 'producer.city' }),
|
||||||
AddCol({ name: 'img', label_trans: 'producer.img' }),
|
AddCol({ name: 'img', label_trans: 'producer.img' }),
|
||||||
AddCol({ name: 'website', label_trans: 'producer.website' }),
|
AddCol({ name: 'website', label_trans: 'producer.website' }),
|
||||||
|
AddCol(DeleteRec),
|
||||||
|
AddCol(DuplicateRec)
|
||||||
]
|
]
|
||||||
|
|
||||||
export const getcolorderscart = [
|
export const getcolorderscart = [
|
||||||
@@ -182,42 +186,50 @@ export const getcolorderscart = [
|
|||||||
AddCol({ name: 'items', label_trans: 'order.items' }),
|
AddCol({ name: 'items', label_trans: 'order.items' }),
|
||||||
AddCol({ name: 'userId', label_trans: 'order.users', fieldtype: tools.FieldType.select, jointable: 'users' }),
|
AddCol({ name: 'userId', label_trans: 'order.users', fieldtype: tools.FieldType.select, jointable: 'users' }),
|
||||||
AddCol({ name: 'note', label_trans: 'order.note' }),
|
AddCol({ name: 'note', label_trans: 'order.note' }),
|
||||||
|
AddCol(DeleteRec),
|
||||||
|
AddCol(DuplicateRec)
|
||||||
]
|
]
|
||||||
|
|
||||||
export const colTableShareWithUs = [
|
export const colTableShareWithUs = [
|
||||||
AddCol({ name: 'description', label_trans: 'share.description' }),
|
AddCol({ name: 'description', label_trans: 'share.description' }),
|
||||||
AddCol({ name: 'numshared', label_trans: 'share.numshared', fieldtype: tools.FieldType.number }),
|
AddCol({ name: 'numshared', label_trans: 'share.numshared', fieldtype: tools.FieldType.number }),
|
||||||
AddCol({ name: 'rating', label_trans: 'share.rating', fieldtype: tools.FieldType.number }),
|
AddCol({ name: 'rating', label_trans: 'share.rating', fieldtype: tools.FieldType.number }),
|
||||||
|
AddCol(DeleteRec),
|
||||||
|
AddCol(DuplicateRec)
|
||||||
]
|
]
|
||||||
|
|
||||||
export const colTableHours = [
|
export const colTableHours = [
|
||||||
// AddCol({ name: 'userId', label_trans: 'hours.userId' }),
|
// AddCol({ name: 'userId', label_trans: 'hours.userId' }),
|
||||||
// AddCol({ name: 'todoId', label_trans: 'hours.todoId' }),
|
// 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: '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_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: '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(DeleteRec),
|
||||||
AddCol(DuplicateRec)
|
AddCol(DuplicateRec)
|
||||||
]
|
]
|
||||||
|
|
||||||
export const colTablegroups = [
|
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: 'resp', label_trans: 'reg.resp' }),
|
||||||
AddCol({ name: 'viceResp', label_trans: 'reg.viceResp' }),
|
AddCol({ name: 'viceResp', label_trans: 'reg.viceResp' }),
|
||||||
AddCol({
|
AddCol({
|
||||||
name: 'assignedToUsers',
|
name: 'assignedToUsers',
|
||||||
label_trans: 'reg.userslist',
|
label_trans: 'reg.userslist',
|
||||||
fieldtype: tools.FieldType.multiselect,
|
fieldtype: tools.FieldType.multiselect,
|
||||||
jointable: 'users'
|
jointable: 'workers'
|
||||||
}),
|
}),
|
||||||
|
AddCol(DeleteRec),
|
||||||
|
AddCol(DuplicateRec)
|
||||||
]
|
]
|
||||||
|
|
||||||
export const colTabledepartments = [
|
export const colTabledepartments = [
|
||||||
AddCol({ name: 'name', label_trans: 'store.name' }),
|
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 = [
|
export const colTableStorehouse = [
|
||||||
@@ -229,6 +241,8 @@ export const colTableStorehouse = [
|
|||||||
AddCol({ name: 'region', label_trans: 'store.region' }),
|
AddCol({ name: 'region', label_trans: 'store.region' }),
|
||||||
AddCol({ name: 'img', label_trans: 'store.img' }),
|
AddCol({ name: 'img', label_trans: 'store.img' }),
|
||||||
AddCol({ name: 'website', label_trans: 'store.website' }),
|
AddCol({ name: 'website', label_trans: 'store.website' }),
|
||||||
|
AddCol(DeleteRec),
|
||||||
|
AddCol(DuplicateRec)
|
||||||
]
|
]
|
||||||
|
|
||||||
export const colTableProducts = [
|
export const colTableProducts = [
|
||||||
@@ -267,20 +281,23 @@ export const colTableProducts = [
|
|||||||
AddCol({ name: 'weight', label_trans: 'products.weight', fieldtype: tools.FieldType.number }),
|
AddCol({ name: 'weight', label_trans: 'products.weight', fieldtype: tools.FieldType.number }),
|
||||||
AddCol({ name: 'stars', label_trans: 'products.stars', 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({ name: 'date', label_trans: 'products.date', fieldtype: tools.FieldType.date }),
|
||||||
AddCol(DeleteRec)
|
AddCol(DeleteRec),
|
||||||
|
AddCol(DuplicateRec)
|
||||||
]
|
]
|
||||||
|
|
||||||
const colcontribtype = [
|
const colcontribtype = [
|
||||||
AddCol({ name: 'label', label_trans: 'proj.longdescr' }),
|
AddCol({ name: 'label', label_trans: 'proj.longdescr' }),
|
||||||
AddCol({ name: 'showprice', label_trans: 'event.showprice', fieldtype: tools.FieldType.boolean }),
|
AddCol({ name: 'showprice', label_trans: 'event.showprice', fieldtype: tools.FieldType.boolean }),
|
||||||
AddCol(DeleteRec)
|
AddCol(DeleteRec),
|
||||||
|
AddCol(DuplicateRec)
|
||||||
]
|
]
|
||||||
|
|
||||||
const colpaymenttype = [
|
const colpaymenttype = [
|
||||||
AddCol({ name: '_id', label_trans: 'others.value' }),
|
AddCol({ name: '_id', label_trans: 'others.value' }),
|
||||||
AddCol({ name: 'key', label_trans: 'reg.key' }),
|
AddCol({ name: 'key', label_trans: 'reg.key' }),
|
||||||
AddCol({ name: 'label', label_trans: 'proj.longdescr' }),
|
AddCol({ name: 'label', label_trans: 'proj.longdescr' }),
|
||||||
AddCol(DeleteRec)
|
AddCol(DeleteRec),
|
||||||
|
AddCol(DuplicateRec)
|
||||||
]
|
]
|
||||||
|
|
||||||
const colworkers = [
|
const colworkers = [
|
||||||
@@ -288,7 +305,8 @@ const colworkers = [
|
|||||||
AddCol({ name: 'username', label_trans: 'reg.username' }),
|
AddCol({ name: 'username', label_trans: 'reg.username' }),
|
||||||
AddCol({ name: 'name', label_trans: 'reg.name' }),
|
AddCol({ name: 'name', label_trans: 'reg.name' }),
|
||||||
AddCol({ name: 'surname', label_trans: 'reg.surname' }),
|
AddCol({ name: 'surname', label_trans: 'reg.surname' }),
|
||||||
AddCol(DeleteRec)
|
AddCol(DeleteRec),
|
||||||
|
AddCol(DuplicateRec)
|
||||||
]
|
]
|
||||||
|
|
||||||
const colflotte = [
|
const colflotte = [
|
||||||
@@ -408,7 +426,8 @@ const coldisciplines = [
|
|||||||
const colTablePermission = [
|
const colTablePermission = [
|
||||||
AddCol({ name: '_id', label_trans: 'others.value' }),
|
AddCol({ name: '_id', label_trans: 'others.value' }),
|
||||||
AddCol({ name: 'label', label_trans: 'proj.longdescr' }),
|
AddCol({ name: 'label', label_trans: 'proj.longdescr' }),
|
||||||
AddCol(DeleteRec)
|
AddCol(DeleteRec),
|
||||||
|
AddCol(DuplicateRec)
|
||||||
]
|
]
|
||||||
|
|
||||||
const colTableOperator = [
|
const colTableOperator = [
|
||||||
@@ -464,6 +483,7 @@ const colTableEvents = [
|
|||||||
AddCol({ name: 'linkpage', label_trans: 'event.linkpage' }),
|
AddCol({ name: 'linkpage', label_trans: 'event.linkpage' }),
|
||||||
AddCol({ name: 'linkpdf', label_trans: 'event.linkpdf' }),
|
AddCol({ name: 'linkpdf', label_trans: 'event.linkpdf' }),
|
||||||
AddCol({ name: 'nobookable', label_trans: 'event.nobookable', fieldtype: tools.FieldType.boolean }),
|
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: 'news', label_trans: 'event.news', fieldtype: tools.FieldType.boolean }),
|
||||||
AddCol({ name: 'canceled', label_trans: 'event.canceled', 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 }),
|
AddCol({ name: 'deleted', label_trans: 'event.deleted', fieldtype: tools.FieldType.boolean }),
|
||||||
@@ -529,7 +549,6 @@ export const fieldsTable = {
|
|||||||
risultato = myris[collab]
|
risultato = myris[collab]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (key === 'username') {
|
if (key === 'username') {
|
||||||
console.log('key=', key, 'collab', collab, 'val', val)
|
console.log('key=', key, 'collab', collab, 'val', val)
|
||||||
console.log('myris', risultato)
|
console.log('myris', risultato)
|
||||||
@@ -625,7 +644,7 @@ export const fieldsTable = {
|
|||||||
AddCol({ name: 'id_conf_zoom', label_trans: 'zoom.id_conf_zooom' }),
|
AddCol({ name: 'id_conf_zoom', label_trans: 'zoom.id_conf_zooom' }),
|
||||||
AddCol({ name: 'note', label_trans: 'zoom.note' }),
|
AddCol({ name: 'note', label_trans: 'zoom.note' }),
|
||||||
AddCol(DeleteRec),
|
AddCol(DeleteRec),
|
||||||
AddCol(DuplicateRec),
|
AddCol(DuplicateRec)
|
||||||
],
|
],
|
||||||
|
|
||||||
colTableUsersBase: [
|
colTableUsersBase: [
|
||||||
@@ -1096,7 +1115,7 @@ export const fieldsTable = {
|
|||||||
label: 'Lista Ingresso',
|
label: 'Lista Ingresso',
|
||||||
columns: collistaingresso,
|
columns: collistaingresso,
|
||||||
colkey: '_id',
|
colkey: '_id',
|
||||||
collabel: 'ind_order',
|
collabel: 'ind_order'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 'graduatorias',
|
value: 'graduatorias',
|
||||||
|
|||||||
@@ -184,11 +184,13 @@ export const tools = {
|
|||||||
multiselect: 256,
|
multiselect: 256,
|
||||||
password: 512,
|
password: 512,
|
||||||
listimages: 1024,
|
listimages: 1024,
|
||||||
image: 2048,
|
exact: 2048,
|
||||||
|
image: 3000,
|
||||||
nationality: 4096,
|
nationality: 4096,
|
||||||
intcode: 5000,
|
intcode: 5000,
|
||||||
multioption: 6000,
|
multioption: 6000,
|
||||||
onlydate: 7000
|
onlydate: 7000,
|
||||||
|
hours: 8000
|
||||||
},
|
},
|
||||||
|
|
||||||
FieldTypeArr: [
|
FieldTypeArr: [
|
||||||
@@ -201,7 +203,70 @@ export const tools = {
|
|||||||
{ label: 'Number', value: 64 }
|
{ 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: [
|
SelectListNumPeople: [
|
||||||
|
{
|
||||||
|
id: 0,
|
||||||
|
label: '0',
|
||||||
|
value: 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
label: '1',
|
label: '1',
|
||||||
@@ -320,6 +385,11 @@ export const tools = {
|
|||||||
id: 4,
|
id: 4,
|
||||||
label: translation.it.privacy.onlyme,
|
label: translation.it.privacy.onlyme,
|
||||||
value: Privacy.onlyme
|
value: Privacy.onlyme
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 5,
|
||||||
|
label: translation.it.privacy.inherited,
|
||||||
|
value: Privacy.inherited
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
es: [
|
es: [
|
||||||
@@ -342,6 +412,11 @@ export const tools = {
|
|||||||
id: 4,
|
id: 4,
|
||||||
label: translation.es.privacy.onlyme,
|
label: translation.es.privacy.onlyme,
|
||||||
value: Privacy.onlyme
|
value: Privacy.onlyme
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 5,
|
||||||
|
label: translation.es.privacy.inherited,
|
||||||
|
value: Privacy.inherited
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
enUs: [
|
enUs: [
|
||||||
@@ -364,6 +439,11 @@ export const tools = {
|
|||||||
id: 4,
|
id: 4,
|
||||||
label: translation.enUs.privacy.onlyme,
|
label: translation.enUs.privacy.onlyme,
|
||||||
value: 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)
|
tools.notifyarraychanged(myarr)
|
||||||
|
|
||||||
console.log('arr FINALE', tools.logga_arrproj(myarr))
|
// console.log('arr FINALE', tools.logga_arrproj(myarr))
|
||||||
|
|
||||||
// Update the records:
|
// Update the records:
|
||||||
}
|
}
|
||||||
@@ -1883,6 +1963,7 @@ export const tools = {
|
|||||||
mycolor = 'primary'
|
mycolor = 'primary'
|
||||||
}
|
}
|
||||||
q.notify({
|
q.notify({
|
||||||
|
// group: '',
|
||||||
message: msg,
|
message: msg,
|
||||||
icon: myicon,
|
icon: myicon,
|
||||||
classes: 'my-notif-class',
|
classes: 'my-notif-class',
|
||||||
@@ -2561,14 +2642,14 @@ export const tools = {
|
|||||||
|
|
||||||
getprivacyreadbytipoproj(tipoproj) {
|
getprivacyreadbytipoproj(tipoproj) {
|
||||||
if (tipoproj === RouteNames.myprojects)
|
if (tipoproj === RouteNames.myprojects)
|
||||||
return Privacy.onlyme
|
return Privacy.inherited
|
||||||
else
|
else
|
||||||
return Privacy.all
|
return Privacy.all
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
|
|
||||||
getprivacywritebytipoproj(tipoproj) {
|
getprivacywritebytipoproj(tipoproj) {
|
||||||
return Privacy.onlyme
|
return Privacy.inherited
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
|
|
||||||
@@ -2736,13 +2817,13 @@ export const tools = {
|
|||||||
} else if (Screen.width < 600) {
|
} else if (Screen.width < 600) {
|
||||||
return '450'
|
return '450'
|
||||||
} else if (Screen.width < 800) {
|
} else if (Screen.width < 800) {
|
||||||
return '500'
|
return '550'
|
||||||
} else if (Screen.width < 900) {
|
} else if (Screen.width < 900) {
|
||||||
return '700'
|
return '700'
|
||||||
} else if (Screen.width < 1000) {
|
} else if (Screen.width < 1000) {
|
||||||
return '900'
|
return '800'
|
||||||
} else if (Screen.width < 1100) {
|
} else if (Screen.width < 1100) {
|
||||||
return '1000'
|
return '900'
|
||||||
} else {
|
} else {
|
||||||
return Screen.width - 200
|
return Screen.width - 200
|
||||||
}
|
}
|
||||||
@@ -4103,6 +4184,13 @@ export const tools = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return mylist
|
return mylist
|
||||||
|
},
|
||||||
|
|
||||||
|
IsLogged() {
|
||||||
|
if (!!UserStore)
|
||||||
|
return UserStore.state.isLogged
|
||||||
|
else
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// getLocale() {
|
// getLocale() {
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ export const translation = {
|
|||||||
all: 'Tutti',
|
all: 'Tutti',
|
||||||
friends: 'Amici',
|
friends: 'Amici',
|
||||||
mygroup: 'Gruppo',
|
mygroup: 'Gruppo',
|
||||||
onlyme: 'Solo io'
|
onlyme: 'Solo io',
|
||||||
|
inherited: 'Ereditato'
|
||||||
},
|
},
|
||||||
proj: {
|
proj: {
|
||||||
newproj: 'Nuovo Progetto',
|
newproj: 'Nuovo Progetto',
|
||||||
@@ -27,7 +28,8 @@ export const translation = {
|
|||||||
all: 'Todos',
|
all: 'Todos',
|
||||||
friends: 'Amigos',
|
friends: 'Amigos',
|
||||||
mygroup: 'Grupos',
|
mygroup: 'Grupos',
|
||||||
onlyme: 'Solo yo'
|
onlyme: 'Solo yo',
|
||||||
|
inherited: 'Ereditato'
|
||||||
},
|
},
|
||||||
proj: {
|
proj: {
|
||||||
newproj: 'Nuevo Projecto',
|
newproj: 'Nuevo Projecto',
|
||||||
@@ -49,7 +51,8 @@ export const translation = {
|
|||||||
all: 'All',
|
all: 'All',
|
||||||
friends: 'Friends',
|
friends: 'Friends',
|
||||||
mygroup: 'Group',
|
mygroup: 'Group',
|
||||||
onlyme: 'Only me'
|
onlyme: 'Only me',
|
||||||
|
inherited: 'Inherited'
|
||||||
},
|
},
|
||||||
proj: {
|
proj: {
|
||||||
newproj: 'New Project',
|
newproj: 'New Project',
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import { Component, Watch } from 'vue-property-decorator'
|
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 { SingleProject } from '../../../components/projects/SingleProject/index'
|
||||||
import { CTodo } from '../../../components/todos/CTodo'
|
import { CTodo } from '../../../components/todos/CTodo'
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@ import { toolsext } from '@src/store/Modules/toolsext'
|
|||||||
import { lists } from '../../../store/Modules/lists'
|
import { lists } from '../../../store/Modules/lists'
|
||||||
import * as ApiTables from '../../../store/Modules/ApiTables'
|
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'
|
import { Getter } from 'vuex-class'
|
||||||
|
|
||||||
@@ -19,12 +19,18 @@ import { CProgress } from '../../../components/CProgress'
|
|||||||
import { CDate } from '../../../components/CDate'
|
import { CDate } from '../../../components/CDate'
|
||||||
import { CMyFieldDb } from '../../../components/CMyFieldDb'
|
import { CMyFieldDb } from '../../../components/CMyFieldDb'
|
||||||
import { CHours } from '../../../components/CHours'
|
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 namespace: string = 'Projects'
|
||||||
|
const namespaceGS: string = 'GlobalState'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
|
||||||
components: { SingleProject, CProgress, CTodo, CDate, CMyFieldDb, CHours },
|
components: { SingleProject, CProgress, CTodo, CDate, CMyFieldDb, CHours, CGridTableRec },
|
||||||
filters: {
|
filters: {
|
||||||
capitalize(value) {
|
capitalize(value) {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
@@ -73,7 +79,20 @@ export default class ProjList extends Vue {
|
|||||||
return cl
|
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)
|
// console.log('this.$route.name', this.$route.name)
|
||||||
const myarr = this.$route.name.split('.')
|
const myarr = this.$route.name.split('.')
|
||||||
if (myarr)
|
if (myarr)
|
||||||
@@ -111,7 +130,28 @@ export default class ProjList extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get getrouteup() {
|
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() {
|
get tools() {
|
||||||
@@ -131,9 +171,17 @@ export default class ProjList extends Vue {
|
|||||||
return this.idProjAtt === process.env.PROJECT_ID_MAIN
|
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() {
|
get getIdParent() {
|
||||||
if (!!this.itemproj)
|
if (!!this.itemselproj)
|
||||||
return this.itemproj.id_parent
|
return this.itemselproj.id_parent
|
||||||
else
|
else
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
@@ -259,6 +307,7 @@ export default class ProjList extends Vue {
|
|||||||
public idProjAtt: string = process.env.PROJECT_ID_MAIN
|
public idProjAtt: string = process.env.PROJECT_ID_MAIN
|
||||||
public splitterModel = 50 // start at 50%
|
public splitterModel = 50 // start at 50%
|
||||||
public itemproj: IProject = null
|
public itemproj: IProject = null
|
||||||
|
public tipoproj: string = ''
|
||||||
public itemprojparent: IProject = null
|
public itemprojparent: IProject = null
|
||||||
public idsel: string = ''
|
public idsel: string = ''
|
||||||
public itemselproj: IProject = Projects.getters.getRecordEmpty()
|
public itemselproj: IProject = Projects.getters.getRecordEmpty()
|
||||||
@@ -267,6 +316,7 @@ export default class ProjList extends Vue {
|
|||||||
public colProgress: string = 'blue'
|
public colProgress: string = 'blue'
|
||||||
public percProgress: string = 'percProgress'
|
public percProgress: string = 'percProgress'
|
||||||
public readonly: boolean = false
|
public readonly: boolean = false
|
||||||
|
public tabcmd: string = ''
|
||||||
|
|
||||||
public selectStatus: any[] = tools.selectStatus[toolsext.getLocale()]
|
public selectStatus: any[] = tools.selectStatus[toolsext.getLocale()]
|
||||||
public selectPhase: any[] = tools.selectPhase[toolsext.getLocale()]
|
public selectPhase: any[] = tools.selectPhase[toolsext.getLocale()]
|
||||||
@@ -283,6 +333,27 @@ export default class ProjList extends Vue {
|
|||||||
@Getter('projs_dacompletare', { namespace })
|
@Getter('projs_dacompletare', { namespace })
|
||||||
public projs_dacompletare: (state: IProjectsState, id_parent: string, tipoproj: string) => IProject[]
|
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')
|
// @Watch('projs_dacompletare')
|
||||||
// public changeitems() {
|
// public changeitems() {
|
||||||
// this.updateindexProj()
|
// this.updateindexProj()
|
||||||
@@ -291,16 +362,30 @@ export default class ProjList extends Vue {
|
|||||||
@Watch('$route.name')
|
@Watch('$route.name')
|
||||||
public changename() {
|
public changename() {
|
||||||
|
|
||||||
// console.log('tools.getUrlByTipoProj(this.tipoProj)', tools.getUrlByTipoProj(this.tipoProj))
|
// console.log('tools.getUrlByTipoProj(this.gettipoProj)', tools.getUrlByTipoProj(this.gettipoProj))
|
||||||
this.changeparent()
|
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')
|
@Watch('$route.params.idProj')
|
||||||
public changeparent() {
|
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.idProjAtt = this.$route.params.idProj
|
||||||
|
this.tabproj = 'lista'
|
||||||
this.updateindexProj()
|
this.updateindexProj()
|
||||||
this.selproj()
|
this.selproj()
|
||||||
|
if (oldtipoproj !== this.gettipoProj)
|
||||||
|
this.updateData()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Watch('itemselproj.progressCalc')
|
@Watch('itemselproj.progressCalc')
|
||||||
@@ -308,6 +393,11 @@ export default class ProjList extends Vue {
|
|||||||
this.updateclasses()
|
this.updateclasses()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Watch('itemselproj.groupid')
|
||||||
|
public change_group() {
|
||||||
|
this.updateclasses()
|
||||||
|
}
|
||||||
|
|
||||||
@Watch('itemselproj._id')
|
@Watch('itemselproj._id')
|
||||||
public changeidproj() {
|
public changeidproj() {
|
||||||
this.aggiornastat()
|
this.aggiornastat()
|
||||||
@@ -358,6 +448,17 @@ export default class ProjList extends Vue {
|
|||||||
Todos.actions.modify({ myitem: this.itemtodosel, field })
|
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() {
|
public selproj() {
|
||||||
this.deselectAllRowsproj(null, false, false)
|
this.deselectAllRowsproj(null, false, false)
|
||||||
this.deselectAllRowstodo(null, false, false)
|
this.deselectAllRowstodo(null, false, false)
|
||||||
@@ -374,34 +475,37 @@ export default class ProjList extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public created() {
|
public created() {
|
||||||
const service = this.$dragula.$service
|
|
||||||
tools.dragula_option(service, this.dragname)
|
|
||||||
|
|
||||||
this.updateclasses()
|
if (costanti.DRAGULA) {
|
||||||
|
const service = this.$dragula.$service
|
||||||
|
tools.dragula_option(service, this.dragname)
|
||||||
|
|
||||||
service.eventBus.$on('dragend', (args) => {
|
this.updateclasses()
|
||||||
|
|
||||||
// console.log('args proj-list', args)
|
service.eventBus.$on('dragend', (args) => {
|
||||||
if (args.name === this.dragname) {
|
|
||||||
const itemdragend: IDrag = {
|
// console.log('args proj-list', args)
|
||||||
field: '',
|
if (args.name === this.dragname) {
|
||||||
id_proj: this.idProjAtt,
|
const itemdragend: IDrag = {
|
||||||
newIndex: this.getElementIndex(args.el),
|
field: '',
|
||||||
oldIndex: this.getElementOldIndex(args.el),
|
id_proj: this.idProjAtt,
|
||||||
tipoproj: this.tipoProj
|
newIndex: this.getElementIndex(args.el),
|
||||||
|
oldIndex: this.getElementOldIndex(args.el),
|
||||||
|
tipoproj: this.gettipoProj
|
||||||
|
}
|
||||||
|
|
||||||
|
// console.log('args', args, itemdragend)
|
||||||
|
this.onEndproj(itemdragend)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// console.log('args', args, itemdragend)
|
service.eventBus.$on('drag', (el, source) => {
|
||||||
this.onEndproj(itemdragend)
|
this.scrollable = false
|
||||||
}
|
})
|
||||||
})
|
service.eventBus.$on('drop', (el, source) => {
|
||||||
|
this.scrollable = true
|
||||||
service.eventBus.$on('drag', (el, source) => {
|
})
|
||||||
this.scrollable = false
|
}
|
||||||
})
|
|
||||||
service.eventBus.$on('drop', (el, source) => {
|
|
||||||
this.scrollable = true
|
|
||||||
})
|
|
||||||
|
|
||||||
this.load()
|
this.load()
|
||||||
}
|
}
|
||||||
@@ -417,6 +521,10 @@ export default class ProjList extends Vue {
|
|||||||
// this.splitterModel = 50
|
// this.splitterModel = 50
|
||||||
// }
|
// }
|
||||||
this.idProjAtt = this.$route.params.idProj
|
this.idProjAtt = this.$route.params.idProj
|
||||||
|
if (!this.idProjAtt) {
|
||||||
|
this.idProjAtt = process.env.PROJECT_ID_MAIN
|
||||||
|
}
|
||||||
|
console.log('this.idProjAtt', this.idProjAtt)
|
||||||
this.updateindexProj()
|
this.updateindexProj()
|
||||||
|
|
||||||
tools.touchmove(this.scrollable)
|
tools.touchmove(this.scrollable)
|
||||||
@@ -424,16 +532,21 @@ export default class ProjList extends Vue {
|
|||||||
|
|
||||||
public async load() {
|
public async load() {
|
||||||
// console.log('LOAD PROJECTS....')
|
// console.log('LOAD PROJECTS....')
|
||||||
if (!!this.$route.params.idProj) {
|
if (!this.idProjAtt) {
|
||||||
this.idProjAtt = this.$route.params.idProj
|
this.idProjAtt = process.env.PROJECT_ID_MAIN
|
||||||
|
}
|
||||||
|
console.log('LOAD this.idProjAtt', this.idProjAtt)
|
||||||
|
|
||||||
|
if (!!this.idProjAtt) {
|
||||||
this.updateindexProj()
|
this.updateindexProj()
|
||||||
|
this.selproj()
|
||||||
}
|
}
|
||||||
|
|
||||||
this.selectGroup = tools.getGroupList()[toolsext.getLocale()]
|
this.selectGroup = tools.getGroupList()[toolsext.getLocale()]
|
||||||
this.selectResp = tools.getRespList()[toolsext.getLocale()]
|
this.selectResp = tools.getRespList()[toolsext.getLocale()]
|
||||||
this.selectWorkers = tools.getWorkersList()[toolsext.getLocale()]
|
this.selectWorkers = tools.getWorkersList()[toolsext.getLocale()]
|
||||||
|
|
||||||
console.log('this.selectGroup', this.selectGroup)
|
// console.log('this.selectGroup', this.selectGroup)
|
||||||
|
|
||||||
// Set last category selected
|
// Set last category selected
|
||||||
// localStorage.setItem(tools.localStorage.categorySel, this.categoryAtt)
|
// localStorage.setItem(tools.localStorage.categorySel, this.categoryAtt)
|
||||||
@@ -463,13 +576,13 @@ export default class ProjList extends Vue {
|
|||||||
|
|
||||||
this.projbottom = ''
|
this.projbottom = ''
|
||||||
|
|
||||||
return this.addProject(descr, this.tipoProj)
|
return this.addProject(descr, this.gettipoProj)
|
||||||
}
|
}
|
||||||
|
|
||||||
public async clickMenuProjList(action) {
|
public async clickMenuProjList(action) {
|
||||||
// console.log('clickMenuProjList: ', action)
|
// console.log('clickMenuProjList: ', action)
|
||||||
if (action === lists.MenuAction.ADD_PROJECT) {
|
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)
|
// console.log('idnewelem', idnewelem)
|
||||||
// get element by id
|
// get element by id
|
||||||
const elem = this.getCompProjectById(idnewelem)
|
const elem = this.getCompProjectById(idnewelem)
|
||||||
@@ -562,8 +675,10 @@ export default class ProjList extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public setidsel(id: string) {
|
public setidsel(id: string) {
|
||||||
|
// console.log('setidsel', id)
|
||||||
this.idsel = id
|
this.idsel = id
|
||||||
this.whatisSel = tools.WHAT_PROJECT
|
this.whatisSel = tools.WHAT_PROJECT
|
||||||
|
this.tipoproj = this.gettipoProj
|
||||||
this.itemtodosel = null
|
this.itemtodosel = null
|
||||||
this.itemselproj = Projects.getters.getRecordById(this.idsel)
|
this.itemselproj = Projects.getters.getRecordById(this.idsel)
|
||||||
if ((this.itemselproj === undefined || this.itemselproj === null))
|
if ((this.itemselproj === undefined || this.itemselproj === null))
|
||||||
@@ -571,6 +686,8 @@ export default class ProjList extends Vue {
|
|||||||
// console.log('readonly = true')
|
// console.log('readonly = true')
|
||||||
this.readonly = true
|
this.readonly = true
|
||||||
|
|
||||||
|
// console.log(' itemselproj', this.itemselproj)
|
||||||
|
|
||||||
this.checkiftoenable()
|
this.checkiftoenable()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -613,6 +730,12 @@ export default class ProjList extends Vue {
|
|||||||
// console.log('calling MODIFY updateitemproj', myitem, field)
|
// console.log('calling MODIFY updateitemproj', myitem, field)
|
||||||
|
|
||||||
await Projects.actions.modify({ 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,28 +744,34 @@ export default class ProjList extends Vue {
|
|||||||
|
|
||||||
// return false
|
// return false
|
||||||
|
|
||||||
// @ts-ignore
|
try {
|
||||||
for (const i in this.$refs.ctodo.$refs.single) {
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const contr = this.$refs.ctodo.$refs.single[i] as SingleTodo
|
// for (const i in this.$refs.ctodo.$refs.single) {
|
||||||
let des = true
|
for (const elem of this.$refs.ctodo.$refs.single) {
|
||||||
if (check) {
|
// @ts-ignore
|
||||||
const id = contr.itemtodo._id
|
// const contr = this.$refs.ctodo.$refs.single[i] as SingleTodo
|
||||||
// Don't deselect the actual clicked!
|
const contr = elem as SingleTodo
|
||||||
if (onlythis) {
|
let des = true
|
||||||
des = item._id === id
|
if (check) {
|
||||||
} else {
|
const id = contr.itemtodo._id
|
||||||
if (!!item) {
|
// Don't deselect the actual clicked!
|
||||||
des = ((check && (item._id !== id)) || (!check))
|
if (onlythis) {
|
||||||
|
des = item._id === id
|
||||||
} else {
|
} else {
|
||||||
des = !check
|
if (!!item) {
|
||||||
|
des = ((check && (item._id !== id)) || (!check))
|
||||||
|
} else {
|
||||||
|
des = !check
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (des) {
|
||||||
|
// @ts-ignore
|
||||||
|
contr.deselectAndExitEdit()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (des) {
|
} catch (e) {
|
||||||
// @ts-ignore
|
|
||||||
contr.deselectAndExitEdit()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -664,26 +793,30 @@ export default class ProjList extends Vue {
|
|||||||
if (this.$refs.singleproject === undefined)
|
if (this.$refs.singleproject === undefined)
|
||||||
return
|
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
|
// @ts-ignore
|
||||||
const id = contr.itemproject._id
|
const id = contr.itemproject._id
|
||||||
// Don't deselect the actual clicked!
|
// Don't deselect the actual clicked!
|
||||||
let des = false
|
let des = false
|
||||||
if (onlythis) {
|
if (onlythis) {
|
||||||
des = item._id === id
|
des = item._id === id
|
||||||
} else {
|
|
||||||
if (!!item) {
|
|
||||||
des = ((check && (item._id !== id)) || (!check))
|
|
||||||
} else {
|
} else {
|
||||||
des = !check
|
if (!!item) {
|
||||||
|
des = ((check && (item._id !== id)) || (!check))
|
||||||
|
} else {
|
||||||
|
des = !check
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (des) {
|
||||||
|
// @ts-ignore
|
||||||
|
contr.deselectAndExitEdit()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (des) {
|
} catch (e) {
|
||||||
// @ts-ignore
|
|
||||||
contr.deselectAndExitEdit()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -699,6 +832,11 @@ export default class ProjList extends Vue {
|
|||||||
ApiTables.waitAndcheckPendingMsg()
|
ApiTables.waitAndcheckPendingMsg()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public updateData() {
|
||||||
|
ApiTables.waitAndRefreshData()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private updateindexProj() {
|
private updateindexProj() {
|
||||||
// console.log('idProjAtt', this.idProjAtt)
|
// console.log('idProjAtt', this.idProjAtt)
|
||||||
this.itemproj = Projects.getters.getRecordById(this.idProjAtt)
|
this.itemproj = Projects.getters.getRecordById(this.idProjAtt)
|
||||||
@@ -731,4 +869,101 @@ export default class ProjList extends Vue {
|
|||||||
return iconpriority
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
181
src/views/projects/report/report.scss
Executable file
181
src/views/projects/report/report.scss
Executable 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;
|
||||||
|
}
|
||||||
129
src/views/projects/report/report.ts
Executable file
129
src/views/projects/report/report.ts
Executable 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
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
48
src/views/projects/report/report.vue
Executable file
48
src/views/projects/report/report.vue
Executable 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>
|
||||||
Reference in New Issue
Block a user