End "project and Todos": what could modify or readonly.

This commit is contained in:
Paolo Arena
2019-04-22 01:43:53 +02:00
parent 18acf720db
commit 08e2ece604
18 changed files with 214 additions and 1051 deletions

View File

@@ -16,6 +16,7 @@ import { Getter } from 'vuex-class'
import { date, Screen } from 'quasar'
import { CProgress } from '../../../components/CProgress'
import { CDate } from '../../../components/CDate'
import { RouteNames } from '@src/router/route-names'
const namespace: string = 'Projects'
@@ -60,14 +61,19 @@ export default class ProjList extends Vue {
ctodo: CTodo
}
@Getter('items_dacompletare', { namespace })
public items_dacompletare: (state: IProjectsState, id_parent: string) => IProject[]
@Getter('projs_dacompletare', { namespace })
public projs_dacompletare: (state: IProjectsState, id_parent: string, miei: boolean) => IProject[]
@Watch('items_dacompletare')
@Watch('projs_dacompletare')
public changeitems() {
this.updateindexProj()
}
@Watch('$route.name')
public changename() {
console.log('tools.getUrlByTipoProj(this.areMyProjects)', tools.getUrlByTipoProj(this.areMyProjects))
}
@Watch('$route.params.idProj')
public changeparent() {
this.idProjAtt = this.$route.params.idProj
@@ -81,13 +87,20 @@ export default class ProjList extends Vue {
}
private updateindexProj() {
console.log('idProjAtt', this.idProjAtt)
// console.log('idProjAtt', this.idProjAtt)
this.itemproj = Projects.getters.getRecordById(this.idProjAtt)
this.itemprojparent = Projects.getters.getRecordById(this.itemproj.id_parent)
console.log('this.itemproj', this.itemproj)
if (!!this.itemproj) {
this.itemprojparent = Projects.getters.getRecordById(this.itemproj.id_parent)
console.log('this.itemproj.descr', this.itemproj.descr)
}
// console.log('idproj', this.idProjAtt, 'params' , this.$route.params)
}
get areMyProjects() {
console.log('this.$route.name', this.$route.name)
return this.$route.name === RouteNames.myprojects
}
get readonly_PanelPrivacy() {
return !this.CanIModifyPanelPrivacy
}
@@ -117,7 +130,7 @@ export default class ProjList extends Vue {
}
get getrouteup() {
return '/projects/' + this.itemproj.id_parent
return tools.getUrlByTipoProj(this.areMyProjects) + this.itemproj.id_parent
}
get tools() {
@@ -245,6 +258,7 @@ export default class ProjList extends Vue {
}
public async onEndproj(itemdragend) {
console.log('onEndproj...')
await Projects.actions.swapElems(itemdragend)
}
@@ -256,15 +270,19 @@ export default class ProjList extends Vue {
$service.eventBus.$on('dragend', (args) => {
const itemdragend: IDrag = {
field: '',
id_proj: this.idProjAtt,
newIndex: this.getElementIndex(args.el),
oldIndex: this.getElementOldIndex(args.el)
}
// console.log('args proj-list', args)
if (args.name === this.dragname) {
const itemdragend: IDrag = {
field: '',
id_proj: this.idProjAtt,
newIndex: this.getElementIndex(args.el),
oldIndex: this.getElementOldIndex(args.el),
mieiproj: this.areMyProjects
}
// console.log('args', args, itemdragend)
this.onEndproj(itemdragend)
// console.log('args', args, itemdragend)
this.onEndproj(itemdragend)
}
})
$service.eventBus.$on('drag', (el, source) => {
@@ -279,7 +297,8 @@ export default class ProjList extends Vue {
public mounted() {
console.log('Screen.width', Screen.width)
// console.log('Screen.width', Screen.width)
// console.log('this.$route', this.$route)
if (Screen.width < 400) {
this.splitterModel = 100
@@ -403,7 +422,7 @@ export default class ProjList extends Vue {
}
public deselectAllRowstodo(item: ITodo, check, onlythis: boolean = false) {
console.log('PROJ-LIST deselectAllRowstodo : ', item)
// console.log('PROJ-LIST deselectAllRowstodo : ', item)
return false
@@ -433,7 +452,7 @@ export default class ProjList extends Vue {
}
public deselectAllRowsproj(item: IProject, check, onlythis: boolean = false) {
console.log('deselectAllRowsproj: ', item)
// console.log('deselectAllRowsproj: ', item)
for (const i in this.$refs.singleproject) {

View File

@@ -1,7 +1,6 @@
<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
<template>
<q-page>
<div class="panel">
<q-splitter
v-model="splitterModel"
:limits="[50, 100]"
@@ -9,6 +8,7 @@
<template v-slot:before class="clMain">
<div>
<!--{{idProjAtt}}-->
<div class="divtitlecat clMain">
<div class="flex-container clMain">
<q-btn v-if="!!getIdParent && CanISeeProjectParent" size="sm" push color="secondary" round
@@ -16,6 +16,7 @@
:to="getrouteup">
</q-btn>
<div class="flex-item categorytitle shadow-4">{{descrProject | capitalize}}</div>
<div class="flex-item">
<q-btn push
@@ -78,9 +79,9 @@
<div style="display: none">{{ prior = 0, priorcomplet = false }}</div>
<div>
<!--<q-infinite-scroll :handler="loadMoreTodo" :offset="7">-->
<div class="container" v-dragula="items_dacompletare(idProjAtt)" drake="second">
<div class="container" v-dragula="projs_dacompletare(idProjAtt, areMyProjects)" drake="second">
<div :id="tools.getmyid(myproj._id)" :index="index"
v-for="(myproj, index) in items_dacompletare(idProjAtt)"
v-for="(myproj, index) in projs_dacompletare(idProjAtt, areMyProjects)"
:key="myproj._id" class="myitemdrag">
<SingleProject ref="singleproject" @deleteItemproj="mydeleteitemproj(myproj._id)"
@@ -97,10 +98,10 @@
</div>
<q-separator></q-separator>
CanIModifyPanelPrivacy = {{CanIModifyPanelPrivacy}}<br>
CanIModifyPanelPrivacySel = {{CanIModifyPanelPrivacySel}}<br>
CanISeeProject = {{CanISeeProject}}<br>
CanISeeProjectSel = {{CanISeeProjectSel}}
<!--CanIModifyPanelPrivacy = {{CanIModifyPanelPrivacy}}<br>-->
<!--CanIModifyPanelPrivacySel = {{CanIModifyPanelPrivacySel}}<br>-->
<!--CanISeeProject = {{CanISeeProject}}<br>-->
<!--CanISeeProjectSel = {{CanISeeProjectSel}}-->
<CTodo ref="ctodo" @setitemsel="setitemsel" :categoryAtt="idProjAtt" title="" backcolor="white"
forecolor="black" :viewtaskTop="false" @deselectAllRowsproj="deselectAllRowsproj"
@@ -112,7 +113,7 @@
</div>
</template>
<template v-if="(whatisSel === tools.WHAT_PROJECT) && (!!itemselproj.descr)" v-slot:after>
ID = {{itemselproj._id}}
<!--ID = {{itemselproj._id}}-->
<div class="q-pa-xs clMain">
<div class="flex-container clMain">
<q-icon class="flex-item flex-icon" name="format_align_center"/>
@@ -134,7 +135,7 @@
</div>
</div>
<div v-if="isMainProject || true" class="flex-container clMain">
<div v-if="CanISeeProjectSel" class="flex-container clMain">
<q-icon class="flex-item flex-icon" name="lock"/>
<div class="flex-item itemstatus">
<q-select :readonly="readonly_PanelPrivacySel"