diff --git a/src/common/shared_vuejs.ts b/src/common/shared_vuejs.ts index 05de598..e776b50 100644 --- a/src/common/shared_vuejs.ts +++ b/src/common/shared_vuejs.ts @@ -1,5 +1,15 @@ export const shared_consts = { + FILTER_EXTRALIST_NOT_REGISTERED: 1, + FILTER_EXTRALIST_NOT_CONTACTED: 2, + FILTER_EXTRALIST_WITH_NOTE: 4, + FILTER_USER_NO_ZOOM: 8, + FILTER_USER_NO_INVITANTE: 16, + FILTER_USER_NO_TELEGRAM_ID: 32, + FILTER_USER_CODICE_AUTH_TELEGRAM: 64, + FILTER_USER_NO_EMAIL_VERIFICATA: 128, + FILTER_USER_NO_DREAM: 256, + Permissions: { Admin: { value: 1, diff --git a/src/components/CCardDiscipline/CCardDiscipline.ts b/src/components/CCardDiscipline/CCardDiscipline.ts index 99a4f25..04d3fa9 100644 --- a/src/components/CCardDiscipline/CCardDiscipline.ts +++ b/src/components/CCardDiscipline/CCardDiscipline.ts @@ -16,7 +16,7 @@ import { CalendarStore } from '../../store/Modules' components: { CMyTeacher } }) -export default class CCardDiscipline extends Vue { +export default class CCardDiscipline extends MixinBase { @Prop({ required: true }) public discipline: IDiscipline @Prop({ required: false, default: '' }) public mystyle: string @Prop({ required: false, default: false }) public autoplay: boolean diff --git a/src/components/CCopyBtn/CCopyBtn.vue b/src/components/CCopyBtn/CCopyBtn.vue index 9119fce..06295a3 100644 --- a/src/components/CCopyBtn/CCopyBtn.vue +++ b/src/components/CCopyBtn/CCopyBtn.vue @@ -1,14 +1,16 @@ diff --git a/src/components/CEventsCalendar/CEventsCalendar.ts b/src/components/CEventsCalendar/CEventsCalendar.ts index 8989008..663fa43 100644 --- a/src/components/CEventsCalendar/CEventsCalendar.ts +++ b/src/components/CEventsCalendar/CEventsCalendar.ts @@ -129,6 +129,14 @@ export default class CEventsCalendar extends MixinEvents { public draggedEvent = null public ignoreNextSwipe = false + get mythis() { + return this + } + + set mythis(aa) { + + } + public resources = [ { label: 'John' diff --git a/src/components/CEventsCalendar/CEventsCalendar.vue b/src/components/CEventsCalendar/CEventsCalendar.vue index 54f94a2..fc39f17 100644 --- a/src/components/CEventsCalendar/CEventsCalendar.vue +++ b/src/components/CEventsCalendar/CEventsCalendar.vue @@ -80,7 +80,7 @@
{{$t('cal.when')}}: - +

@@ -295,7 +295,7 @@

{{$t('cal.when')}}: - +
@@ -339,7 +339,7 @@ + @click="tools.CancelBookingEvent(mythis, myevent, bookEventForm._id, true)">
{{$t('cal.when')}}: - +
@@ -631,7 +631,7 @@
- +
diff --git a/src/components/CGallery/CGallery.ts b/src/components/CGallery/CGallery.ts index 34f813b..f8d1ef3 100644 --- a/src/components/CGallery/CGallery.ts +++ b/src/components/CGallery/CGallery.ts @@ -18,14 +18,31 @@ export default class CGallery extends MixinBase { @Prop({ required: true }) public edit: boolean @Prop({ required: true }) public gall: IGallery @Prop({ required: true }) public listimages: IImgGallery[] + public mygall: IGallery = {} + public mylistimages: IImgGallery[] = [] + + @Watch('gall') + public gallchanged() { + this.mygall = this.gall + } + + @Watch('listimages') + public listimageschanged() { + this.mylistimages = this.listimages + } + + public created() { + this.mygall = this.gall + this.mylistimages = this.listimages + } get tools() { return tools } get getlistimages() { - if (this.listimages) - return this.listimages.sort((a, b) => a.order - b.order) + if (this.mylistimages) + return this.mylistimages.slice().sort((a, b) => a.order - b.order) else return null } @@ -77,13 +94,13 @@ export default class CGallery extends MixinBase { return } - const myindex = this.listimages.findIndex((rec) => rec._id === draggedId) - const myrec: IImgGallery = this.listimages[myindex] + const myindex = this.mylistimages.findIndex((rec) => rec._id === draggedId) + const myrec: IImgGallery = this.mylistimages[myindex] let myrecprec: IImgGallery = null let myrecout: IImgGallery = null - const myindexout = this.listimages.findIndex((rec) => rec._id === dragout) - myrecout = this.listimages[myindexout] + const myindexout = this.mylistimages.findIndex((rec) => rec._id === dragout) + myrecout = this.mylistimages[myindexout] let myindexprec = myindexout - 1 if (myindexprec < 0) @@ -135,7 +152,7 @@ export default class CGallery extends MixinBase { get getlastord() { let myord = 0 - for (const file of this.listimages) { + for (const file of this.mylistimages) { if (file.order > myord) myord = file.order } @@ -146,29 +163,29 @@ export default class CGallery extends MixinBase { public uploaded(info) { console.log(info) for (const file of info.files) { - this.listimages.push({ imagefile: file.name, order: this.getlastord }) + this.mylistimages.push({ imagefile: file.name, order: this.getlastord }) } this.save() } public deleted(rec) { - console.table(this.listimages) + // console.table(this.mylistimages) - const index = this.listimages.findIndex((elem) => elem.imagefile === rec.imagefile) + const index = this.mylistimages.findIndex((elem) => elem.imagefile === rec.imagefile) if (index > -1) { - this.listimages.splice(index, 1) + this.mylistimages.splice(index, 1) } - // this.listimages = this.listimages.pop((elem) => elem.imagefile !== rec.imagefile) + // this.mylistimages = this.mylistimages.pop((elem) => elem.imagefile !== rec.imagefile) - console.table(this.listimages) + // console.table(this.mylistimages) this.save() } public getfullname(rec) { - return 'statics/upload/' + this.gall.directory + `/` + rec.imagefile + return 'statics/upload/' + this.mygall.directory + `/` + rec.imagefile } public copytoclipboard(rec) { @@ -187,7 +204,7 @@ export default class CGallery extends MixinBase { } public save() { - this.$emit('showandsave', this.listimages) + this.$emit('showandsave', this.mylistimages) } public getsrcimg(mygallery) { @@ -195,7 +212,7 @@ export default class CGallery extends MixinBase { if (tools.getextfile(mygallery.imagefile) === 'pdf') return 'statics/images/images/pdf.jpg' else - return 'statics/upload/' + this.gall.directory + `/` + mygallery.imagefile + return 'statics/upload/' + this.mygall.directory + `/` + mygallery.imagefile } } diff --git a/src/components/CGridTableRec/CGridTableRec.ts b/src/components/CGridTableRec/CGridTableRec.ts index 7b2389b..0919d61 100644 --- a/src/components/CGridTableRec/CGridTableRec.ts +++ b/src/components/CGridTableRec/CGridTableRec.ts @@ -1,11 +1,11 @@ import Vue from 'vue' -import { Component, Prop } from 'vue-property-decorator' +import { Component, Prop, Watch } from 'vue-property-decorator' import { GlobalStore, UserStore } from '../../store/Modules/index' import { tools } from '../../store/Modules/tools' import { shared_consts } from '../../common/shared_vuejs' -import { ICategory, IColGridTable, ITableRec } from '../../model' +import { ICategory, IColGridTable, IFilter, ITableRec } from '../../model' import { CTodo } from '../todos/CTodo' import { SingleProject } from '../projects/SingleProject' import { lists } from '../../store/Modules/lists' @@ -26,6 +26,7 @@ export default class CGridTableRec extends Vue { @Prop({ required: false, default: '' }) public nodataLabel: string @Prop({ required: false, default: '' }) public noresultLabel: string @Prop({ required: false, default: null }) public tablesList: ITableRec[] + @Prop({ required: false, default: null }) public arrfilters: IFilter[] public mytable: string public mytitle: string @@ -55,6 +56,7 @@ export default class CGridTableRec extends Vue { public separator: 'horizontal' public myfilter = undefined + public myfilterand = [] public rowsel: any public dark: boolean = true public canEdit: boolean = false @@ -190,6 +192,7 @@ export default class CGridTableRec extends Vue { // console.log('onRequest', 'myfilter = ', this.myfilter) const { page, rowsPerPage, rowsNumber, sortBy, descending } = props.pagination const myfilter = this.myfilter + const myfilterand = this.myfilterand if (!this.mytable) return @@ -212,7 +215,7 @@ export default class CGridTableRec extends Vue { this.serverData = [] // fetch data from "server" - this.fetchFromServer(startRow, endRow, myfilter, sortBy, descending).then((ris) => { + this.fetchFromServer(startRow, endRow, myfilter, myfilterand, sortBy, descending).then((ris) => { this.pagination.rowsNumber = this.getRowsNumberCount(myfilter) @@ -244,7 +247,7 @@ export default class CGridTableRec extends Vue { // emulate ajax call // SELECT * FROM ... WHERE...LIMIT... - public async fetchFromServer(startRow, endRow, myfilter, sortBy, descending) { + public async fetchFromServer(startRow, endRow, myfilter, myfilterand, sortBy, descending) { let myobj = null if (sortBy) { @@ -260,6 +263,7 @@ export default class CGridTableRec extends Vue { startRow, endRow, filter: myfilter, + filterand: myfilterand, sortBy: myobj, descending } @@ -565,4 +569,9 @@ export default class CGridTableRec extends Vue { return '' } } + + @Watch('myfilterand') + public changemyfilterand() { + this.refresh() + } } diff --git a/src/components/CGridTableRec/CGridTableRec.vue b/src/components/CGridTableRec/CGridTableRec.vue index ea6d3ea..278e54d 100644 --- a/src/components/CGridTableRec/CGridTableRec.vue +++ b/src/components/CGridTableRec/CGridTableRec.vue @@ -24,6 +24,7 @@ >