- {{getdescr}} {{progressval}}%
+
+
+
+
+
+
+ {{getdescr}} {{progressval}}%
+
diff --git a/src/components/index.ts b/src/components/index.ts
index 456faf1..79bfc95 100644
--- a/src/components/index.ts
+++ b/src/components/index.ts
@@ -2,3 +2,4 @@ export * from '../views/categories'
export * from './todos'
export * from './logo'
export * from './CProgress'
+export * from './CDate'
diff --git a/src/components/projects/SingleProject/SingleProject.ts b/src/components/projects/SingleProject/SingleProject.ts
index 80585d5..ad27402 100644
--- a/src/components/projects/SingleProject/SingleProject.ts
+++ b/src/components/projects/SingleProject/SingleProject.ts
@@ -36,6 +36,10 @@ export default class SingleProject extends Vue {
public $q: any
+ get tools() {
+ return tools
+ }
+
@Prop({ required: true }) public itemproject: IProject
// @Watch('itemproject.completed') valueChanged() {
@@ -103,6 +107,7 @@ export default class SingleProject extends Vue {
}
public watchupdate(field = '') {
+ console.log('watchupdate')
this.$emit('eventupdateproj', {myitem: this.itemproject, field } )
this.updateicon()
}
@@ -172,6 +177,7 @@ export default class SingleProject extends Vue {
if (!this.sel) {
if (!this.inEdit) {
// this.attivaEdit = true
+ this.$emit('deselectAllRowstodo', null, false)
this.$emit('deselectAllRowsproj', this.itemproject, true)
if (!this.sel) {
@@ -283,6 +289,7 @@ export default class SingleProject extends Vue {
this.inEdit = false
this.attivaEdit = false
this.updateClasses()
+ this.$emit('deselectAllRowstodo', null, false, false)
this.$emit('deselectAllRowsproj', this.itemproject, false, singola)
}
}
@@ -414,7 +421,7 @@ export default class SingleProject extends Vue {
}
public removeitem(id) {
- this.$emit('deleteItem', id)
+ this.$emit('deleteItemproj', id)
}
public enableExpiring() {
diff --git a/src/views/todo/todo.scss b/src/components/todos/CTodo/CTodo.scss
similarity index 100%
rename from src/views/todo/todo.scss
rename to src/components/todos/CTodo/CTodo.scss
diff --git a/src/views/todo/todo.ts b/src/components/todos/CTodo/CTodo.ts
similarity index 79%
rename from src/views/todo/todo.ts
rename to src/components/todos/CTodo/CTodo.ts
index 342f8fa..c953579 100644
--- a/src/views/todo/todo.ts
+++ b/src/components/todos/CTodo/CTodo.ts
@@ -1,42 +1,43 @@
import Vue from 'vue'
-import { Component, Watch } from 'vue-property-decorator'
+import { Component, Prop, Watch } from 'vue-property-decorator'
-import { IDrag, ITodo, ITodosState } from '../../model/index'
-import { SingleTodo } from '../../components/todos/SingleTodo/index'
+import { IDrag, IProject, ITodo, ITodosState } from '../../../model/index'
-import { tools } from '../../store/Modules/tools'
-import * as ApiTables from '../../store/Modules/ApiTables'
+import { tools } from '../../../store/Modules/tools'
+import * as ApiTables from '../../../store/Modules/ApiTables'
import { GlobalStore, Todos } from '@store'
import { UserStore } from '@store'
import { Getter } from 'vuex-class'
+import { SingleTodo } from '../SingleTodo'
+
const namespace: string = 'Todos'
@Component({
-
components: { SingleTodo },
filters: {
capitalize(value) {
- if (!value) {
- return ''
- }
- value = value.toString()
- return value.charAt(0).toUpperCase() + value.slice(1)
+ return tools.capitalize(value)
}
}
})
-export default class Todo extends Vue {
+export default class CTodo extends Vue {
public $q: any
public todotop: string = ''
public todobottom: string = ''
public polling = null
public service: any
public scrollable = true
- public categoryAtt: string = ''
public dragname: string = 'first'
+ @Prop({ required: true }) public categoryAtt: string
+ @Prop({ required: true }) public title: string
+ @Prop({ required: false, default: 'blue' }) public forecolor: string
+ @Prop({ required: false, default: 'lightblue' }) public backcolor: string
+ @Prop({ required: false, default: true }) public viewtaskTop: boolean
+
public $refs: {
single: SingleTodo[]
}
@@ -76,11 +77,6 @@ export default class Todo extends Vue {
@Getter('todos_completati', { namespace })
public todos_completati: (state: ITodosState, category: string) => ITodo[]
- @Watch('$route.params.category')
- public changecat() {
- this.categoryAtt = this.$route.params.category
- }
-
public showTask(field_value) {
return field_value === tools.MenuAction.SHOW_TASK
}
@@ -115,14 +111,11 @@ export default class Todo extends Vue {
}
public mounted() {
- this.categoryAtt = this.$route.params.category
-
tools.touchmove(this.scrollable)
}
- public async load() {
+ public load() {
console.log('LOAD TODO....')
- this.categoryAtt = this.$route.params.category
// Set last category selected
localStorage.setItem(tools.localStorage.categorySel, this.categoryAtt)
@@ -193,8 +186,16 @@ export default class Todo extends Vue {
}
+ public deselectAllRowsproj(item: IProject, check, onlythis: boolean = false) {
+ this.$emit('deselectAllRowsproj', item, check, onlythis)
+ }
+
+ public setitemsel(item: ITodo) {
+ this.$emit('setitemsel', item)
+ }
+
public deselectAllRowstodo(item: ITodo, check, onlythis: boolean = false) {
- // console.log('deselectAllRowstodo : ', item)
+ console.log('CTODO deselectAllRowstodo : ', item)
for (let i = 0; i < this.$refs.single.length; i++) {
@@ -206,7 +207,11 @@ export default class Todo extends Vue {
if (onlythis) {
des = item._id === id
} else {
- des = ((check && (item._id !== id)) || (!check))
+ if (!!check) {
+ des = ((check && (item._id !== id)) || (!check))
+ } else {
+ des = !check
+ }
}
if (des) {
// @ts-ignore
diff --git a/src/views/todo/todo.vue b/src/components/todos/CTodo/CTodo.vue
similarity index 90%
rename from src/views/todo/todo.vue
rename to src/components/todos/CTodo/CTodo.vue
index 0450d69..535429e 100644
--- a/src/views/todo/todo.vue
+++ b/src/components/todos/CTodo/CTodo.vue
@@ -1,9 +1,9 @@
-
+
-
{{categoryAtt | capitalize}}
+
{{title | capitalize}}
-
@@ -74,7 +74,7 @@
@@ -96,7 +96,7 @@
:key="mytodo._id" class="myitemdrag">
@@ -109,7 +109,7 @@
-
-
diff --git a/src/components/todos/CTodo/index.ts b/src/components/todos/CTodo/index.ts
new file mode 100644
index 0000000..f7924e2
--- /dev/null
+++ b/src/components/todos/CTodo/index.ts
@@ -0,0 +1 @@
+export {default as CTodo} from './CTodo.vue'
diff --git a/src/components/todos/SingleTodo/SingleTodo.ts b/src/components/todos/SingleTodo/SingleTodo.ts
index 3f30ebc..84912b8 100644
--- a/src/components/todos/SingleTodo/SingleTodo.ts
+++ b/src/components/todos/SingleTodo/SingleTodo.ts
@@ -42,6 +42,10 @@ export default class SingleTodo extends Vue {
public $q: any
+ get tools() {
+ return tools
+ }
+
@Prop({ required: true }) public itemtodo: ITodo
// @Watch('itemtodo.completed') valueChanged() {
@@ -188,6 +192,7 @@ export default class SingleTodo extends Vue {
if (!this.sel) {
if (!this.inEdit) {
+ this.$emit('deselectAllRowsproj', null, false, false)
this.$emit('deselectAllRowstodo', this.itemtodo, true)
if (!this.sel) {
@@ -231,6 +236,7 @@ export default class SingleTodo extends Vue {
}
public clickRow() {
+ this.$emit('setitemsel', this.itemtodo)
this.clickRiga()
}
@@ -277,6 +283,7 @@ export default class SingleTodo extends Vue {
// console.log('exitEdit')
this.inEdit = false
this.updateClasses()
+ this.$emit('deselectAllRowsproj', null, false, false)
this.$emit('deselectAllRowstodo', this.itemtodo, false, singola)
}
}
diff --git a/src/components/todos/index.ts b/src/components/todos/index.ts
index 37633a1..7fedfbd 100644
--- a/src/components/todos/index.ts
+++ b/src/components/todos/index.ts
@@ -1,3 +1,3 @@
export * from './SingleTodo'
export * from './SubMenus'
-export * from '../../views/todo'
+export * from './CTodo'
diff --git a/src/model/GlobalStore.ts b/src/model/GlobalStore.ts
index c600167..f4db9a0 100644
--- a/src/model/GlobalStore.ts
+++ b/src/model/GlobalStore.ts
@@ -1,5 +1,6 @@
import { costanti } from "@src/store/Modules/costanti"
import { UserStore } from "@store"
+import { tools } from '@src/store/Modules/tools'
export interface IPost {
title: string
diff --git a/src/router/route-config.ts b/src/router/route-config.ts
index 0c12185..28d8f09 100644
--- a/src/router/route-config.ts
+++ b/src/router/route-config.ts
@@ -58,7 +58,7 @@ export const routesList: IMyRouteConfig[] = [
{
path: '/todo/:category',
name: 'Todos',
- component: () => import('@/views/todo/todo.vue'),
+ component: () => import('@/views/todo-list/todo-list.vue'),
meta: {
requiresAuth: true,
async asyncData() {
diff --git a/src/store/Modules/GlobalStore.ts b/src/store/Modules/GlobalStore.ts
index c7586b0..b55160c 100644
--- a/src/store/Modules/GlobalStore.ts
+++ b/src/store/Modules/GlobalStore.ts
@@ -111,9 +111,10 @@ namespace Getters {
}, 'showtype')
const getmenu = b.read((state) => {
+ console.log('getmenu')
const arrlista = GlobalStore.state.listatodo
- const listatodo = []
+ const lista = []
arrlista.forEach((elem: IMenuList) => {
const item = {
@@ -122,7 +123,7 @@ namespace Getters {
name: 'pages.' + elem.description,
route: '/todo/' + elem.nametranslate
}
- listatodo.push(item)
+ lista.push(item)
})
@@ -145,7 +146,7 @@ namespace Getters {
if (!process.env.PROD) {
addRoute(arrroutes, { route: '/todo', faIcon: 'fa fa-list-alt', materialIcon: 'format_list_numbered', name: 'pages.Todo',
- routes2: listatodo,
+ routes2: lista,
level_parent: 0.5,
level_child: 0.5
})
@@ -173,6 +174,8 @@ namespace Getters {
return state.menulinks
+ console.log('state.menulinks', state.menulinks)
+
}, 'getmenu')
export const getters = {
diff --git a/src/store/Modules/Projects.ts b/src/store/Modules/Projects.ts
index fe517ba..d7fd092 100644
--- a/src/store/Modules/Projects.ts
+++ b/src/store/Modules/Projects.ts
@@ -38,13 +38,10 @@ function getarrByCategory(category: string) {
}
function initcat() {
-
- // return this.copy(objproj)
- let rec = Getters.getters.getRecordEmpty()
+ const rec = Getters.getters.getRecordEmpty()
rec.userId = UserStore.state.userId
return rec
-
}
namespace Getters {
diff --git a/src/store/Modules/Todos.ts b/src/store/Modules/Todos.ts
index 2ec9cec..54b59fc 100644
--- a/src/store/Modules/Todos.ts
+++ b/src/store/Modules/Todos.ts
@@ -36,7 +36,7 @@ function getindexbycategory(category: string) {
return state.categories.indexOf(category)
}
-function gettodosByCategory(category: string) {
+function gettodosByCategory(category: string): [] {
const indcat = state.categories.indexOf(category)
if (!state.todos[indcat]) {
return []
@@ -46,33 +46,40 @@ function gettodosByCategory(category: string) {
function initcat() {
- const tomorrow = new Date()
- tomorrow.setDate(tomorrow.getDate() + 1)
+ let rec = Getters.getters.getRecordEmpty()
+ rec.userId = UserStore.state.userId
- const objtodo: ITodo = {
- // _id: new Date().toISOString(), // Create NEW
- _id: objectId(),
- userId: UserStore.state.userId,
- descr: '',
- priority: tools.Priority.PRIORITY_NORMAL,
- status: tools.Status.OPENED,
- created_at: new Date(),
- modify_at: new Date(),
- completed_at: new Date(),
- category: '',
- expiring_at: tomorrow,
- enableExpiring: false,
- id_prev: '',
- pos: 0,
- modified: false,
- progress: 0
- }
- // return this.copy(objtodo)
- return objtodo
+ return rec
}
namespace Getters {
+ const getRecordEmpty = b.read((state: ITodosState) => (): ITodo => {
+
+ const tomorrow = new Date()
+ tomorrow.setDate(tomorrow.getDate() + 1)
+
+ const objtodo: ITodo = {
+ // _id: new Date().toISOString(), // Create NEW
+ _id: objectId(),
+ userId: UserStore.state.userId,
+ descr: '',
+ priority: tools.Priority.PRIORITY_NORMAL,
+ status: tools.Status.OPENED,
+ created_at: new Date(),
+ modify_at: new Date(),
+ completed_at: new Date(),
+ category: '',
+ expiring_at: tomorrow,
+ enableExpiring: false,
+ id_prev: '',
+ pos: 0,
+ modified: false,
+ progress: 0
+ }
+ // return this.copy(objtodo)
+ return objtodo
+ }, 'getRecordEmpty')
const items_dacompletare = b.read((state: ITodosState) => (cat: string): ITodo[] => {
const indcat = getindexbycategory(cat)
if (state.todos[indcat]) {
@@ -85,11 +92,14 @@ namespace Getters {
const todos_completati = b.read((state: ITodosState) => (cat: string): ITodo[] => {
const indcat = getindexbycategory(cat)
if (state.todos[indcat]) {
- if (state.showtype === costanti.ShowTypeTask.SHOW_LAST_N_COMPLETED) {
+ if (state.showtype === costanti.ShowTypeTask.SHOW_LAST_N_COMPLETED) { // Show only the first N completed
return state.todos[indcat].filter((todo) => todo.status === tools.Status.COMPLETED).slice(0, state.visuLastCompleted)
- } // Show only the first N completed
+ }
+ else if (state.showtype === costanti.ShowTypeTask.SHOW_ONLY_TOCOMPLETE) {
+ return []
+ }
else if (state.showtype === costanti.ShowTypeTask.SHOW_ALL) {
- return state.todos[indcat].filter((todo) => todo.completed === tools.Status.COMPLETED)
+ return state.todos[indcat].filter((todo) => todo.status === tools.Status.COMPLETED)
}
else {
return []
@@ -120,6 +130,9 @@ namespace Getters {
}, 'getRecordById')
export const getters = {
+ get getRecordEmpty() {
+ return getRecordEmpty()
+ },
get items_dacompletare() {
return items_dacompletare()
},
diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts
index ea6da32..1dc32a1 100644
--- a/src/store/Modules/tools.ts
+++ b/src/store/Modules/tools.ts
@@ -25,6 +25,9 @@ export const tools = {
FIRST_PROJ: '__PROJECTS',
+ WHAT_TODO: 1,
+ WHAT_PROJECT: 2,
+
arrLangUsed: ['enUs', 'it', 'es'],
SERVKEY_VERS: 'vers',
@@ -595,8 +598,8 @@ export const tools = {
if (itemdragend.field === 'priority') {
// get last elem priority
console.log('get last elem priority')
- itemdragend.newIndex = tools.getLastFirstElemPriority(itemdragend.category, itemdragend.prioritychosen, itemdragend.atfirst, itemdragend.idelemtochange)
- itemdragend.oldIndex = tools.getIndexById(itemdragend.category, itemdragend.idelemtochange)
+ itemdragend.newIndex = tools.getLastFirstElemPriority(myarr, itemdragend.prioritychosen, itemdragend.atfirst, itemdragend.idelemtochange)
+ itemdragend.oldIndex = tools.getIndexById(myarr, itemdragend.idelemtochange)
console.log('swapElems PRIORITY', itemdragend)
}
@@ -675,6 +678,7 @@ export const tools = {
},
getElemById(myarr, id) {
+ console.log('getElemById', myarr, id)
return myarr.find((elem) => elem._id === id)
},
@@ -984,5 +988,12 @@ export const tools = {
return date.formatDate(mytimestamp, 'DD-MM-YY')
},
+ capitalize(value) {
+ if (!value) {
+ return ''
+ }
+ value = value.toString()
+ return value.charAt(0).toUpperCase() + value.slice(1)
+ }
}
diff --git a/src/views/categories/tabledata/tabledata.scss b/src/views/categories/TableData/TableData.scss
similarity index 100%
rename from src/views/categories/tabledata/tabledata.scss
rename to src/views/categories/TableData/TableData.scss
diff --git a/src/views/categories/tabledata/tabledata.ts b/src/views/categories/TableData/TableData.ts
similarity index 77%
rename from src/views/categories/tabledata/tabledata.ts
rename to src/views/categories/TableData/TableData.ts
index 50619a9..9b4429d 100644
--- a/src/views/categories/tabledata/tabledata.ts
+++ b/src/views/categories/TableData/TableData.ts
@@ -2,23 +2,21 @@ import Vue from 'vue'
import { Component, Watch } from 'vue-property-decorator'
import { ICategory } from '../../../model/index'
-import globalroutines from "../../../globalroutines/index"
-import { tools } from "../../../store/Modules/tools"
+import { tools } from '../../../store/Modules/tools'
@Component({
})
-export default class Tabledata extends Vue {
- $q: any
+export default class TableData extends Vue {
+ public $q: any
+ public filter: boolean = false
+ public title: string = ''
+ public category: string = ''
+ public categories_loc: any[] = [{}]
+ public categories_arr: any[] = [{}]
+ public selected: any [] = []
+ public selectedSecond: any [] = []
- filter: boolean = false
- title: string = ''
- category: string = ''
- categories_loc: any[] = [{}]
- categories_arr: any[] = [{}]
- selected: any [] = []
- selectedSecond: any [] = []
-
- data: any [] = [{
+ public data: any [] = [{
id: 0,
descr_it: 'Frozen Yogurt',
descr_en: '',
@@ -31,7 +29,7 @@ export default class Tabledata extends Vue {
descr_es: ''
}]
- columns: any [] = [
+ public columns: any [] = [
{
name: 'descr_it',
required: true,
@@ -39,7 +37,7 @@ export default class Tabledata extends Vue {
align: 'left',
field: 'descr_it',
sortable: true,
- classes: 'my-class',
+ classes: 'my-class'
},
{
name: 'descr_en',
@@ -47,7 +45,7 @@ export default class Tabledata extends Vue {
align: 'left',
field: 'descr_en',
sortable: true,
- classes: 'my-class',
+ classes: 'my-class'
},
{
name: 'descr_es',
@@ -55,7 +53,7 @@ export default class Tabledata extends Vue {
align: 'left',
field: 'descr_es',
sortable: true,
- classes: 'my-class',
+ classes: 'my-class'
},
{
name: 'campo2bool',
@@ -63,26 +61,25 @@ export default class Tabledata extends Vue {
align: 'left',
field: 'campo2bool',
sortable: true,
- classes: 'my-class',
+ classes: 'my-class'
}
]
- @Watch('categories_loc') valueChanged() {
+ @Watch('categories_loc') public valueChanged() {
this.updatetable()
}
-
- created() {
+ public created() {
this.loadCat()
}
- async loadCat() {
- await this.$db.categories.toArray().then(ris => this.categories_loc = ris)
+ public async loadCat() {
+ await this.$db.categories.toArray().then((ris) => this.categories_loc = ris)
this.updatetable()
}
- initcat() {
+ public initcat() {
const objcat: ICategory = {
descr_it: '',
@@ -94,7 +91,7 @@ export default class Tabledata extends Vue {
}
- async insertCategory() {
+ public async insertCategory() {
const objcat = this.initcat()
@@ -116,7 +113,7 @@ export default class Tabledata extends Vue {
this.category = ''
}
- async deleteCategory(myarrobj) {
+ public async deleteCategory(myarrobj) {
for (const myobj of myarrobj) {
@@ -142,14 +139,14 @@ export default class Tabledata extends Vue {
}
- updatetable() {
+ public updatetable() {
this.filterCategories()
this.categories_arr = [...this.categories_loc]
}
- async filterCategories() {
+ public async filterCategories() {
if (this.filter) {
// #Todo If need to filter the output database ...
@@ -168,7 +165,7 @@ export default class Tabledata extends Vue {
}
}
- deleteRow() {
+ public deleteRow() {
console.log('SEL = ', this.selectedSecond)
const seldel = [...this.selectedSecond]
@@ -191,7 +188,7 @@ export default class Tabledata extends Vue {
});
*/
- async modify() {
+ public async modify() {
// esempio da sistemare
await this.$db.transaction('rw', [this.$db.categories], async () => {
const friend = await this.$db.get(1)
diff --git a/src/views/categories/tabledata/tabledata.vue b/src/views/categories/TableData/TableData.vue
similarity index 97%
rename from src/views/categories/tabledata/tabledata.vue
rename to src/views/categories/TableData/TableData.vue
index aea7ad9..1d9004e 100644
--- a/src/views/categories/tabledata/tabledata.vue
+++ b/src/views/categories/TableData/TableData.vue
@@ -57,9 +57,9 @@
-
diff --git a/src/views/categories/TableData/index.ts b/src/views/categories/TableData/index.ts
new file mode 100644
index 0000000..20bd0fe
--- /dev/null
+++ b/src/views/categories/TableData/index.ts
@@ -0,0 +1 @@
+export {default as TableData} from './TableData.vue'
diff --git a/src/views/categories/index.ts b/src/views/categories/index.ts
index 7501486..97862f7 100644
--- a/src/views/categories/index.ts
+++ b/src/views/categories/index.ts
@@ -1,3 +1,3 @@
-export * from './SingleCat/index'
-export * from './category/index'
-export * from './tabledata/index'
+export * from './SingleCat'
+export * from './category'
+export * from './TableData'
diff --git a/src/views/categories/tabledata/index.ts b/src/views/categories/tabledata/index.ts
deleted file mode 100644
index 5825f39..0000000
--- a/src/views/categories/tabledata/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export {default as TableData} from './tabledata.vue'
diff --git a/src/views/projects/proj-list/proj-list.scss b/src/views/projects/proj-list/proj-list.scss
index b93a31f..00b4dcb 100644
--- a/src/views/projects/proj-list/proj-list.scss
+++ b/src/views/projects/proj-list/proj-list.scss
@@ -2,9 +2,9 @@
min-width: 350px;
}
-.flex-container{
+.flex-container, .flex-container_col{
background-color: rgb(250, 250, 250);
- padding: 4px;
+ padding: 2px 4px 2px 4px;
margin: 2px;
display: flex;
align-items: center;
@@ -12,6 +12,9 @@
justify-content: space-between;
}
+.flex-container_col {
+ flex-direction: column;
+}
.mycard {
@@ -113,6 +116,7 @@
.flex-icon{
padding: 3px;
+ font-size: 1.5rem;
}
.titleSubMenu {
diff --git a/src/views/projects/proj-list/proj-list.ts b/src/views/projects/proj-list/proj-list.ts
index 21a199b..775d30a 100644
--- a/src/views/projects/proj-list/proj-list.ts
+++ b/src/views/projects/proj-list/proj-list.ts
@@ -1,25 +1,26 @@
import Vue from 'vue'
import { Component, Watch } from 'vue-property-decorator'
-import { IDrag, IProject, IProjectsState } from '../../../model/index'
+import { IDrag, IProject, IProjectsState, ITodo } from '../../../model/index'
import { SingleProject } from '../../../components/projects/SingleProject/index'
+import { CTodo } from '../../../components/todos/CTodo'
import { tools } from '../../../store/Modules/tools'
import * as ApiTables from '../../../store/Modules/ApiTables'
-import { GlobalStore, Projects } from '@store'
+import { GlobalStore, Projects, Todos } from '@store'
import { UserStore } from '@store'
import { Getter } from 'vuex-class'
import { Screen } from 'quasar'
-import { CProgress } from '@src/components/CProgress'
+import { CProgress } from '@components'
const namespace: string = 'Projects'
@Component({
- components: { SingleProject, CProgress },
+ components: { SingleProject, CProgress, CTodo },
filters: {
capitalize(value) {
if (!value) {
@@ -44,11 +45,14 @@ export default class ProjList extends Vue {
public itemproj: IProject = null
public idsel: string = ''
public itemsel: IProject = Projects.getters.getRecordEmpty()
+ public itemtodosel: ITodo = Todos.getters.getRecordEmpty()
+ public whatisSel: number = 0
public colProgress: string = 'blue'
public percProgress: string = 'percProgress'
public $refs: {
- singleproject: SingleProject[]
+ singleproject: SingleProject[],
+ ctodo: CTodo
}
get getrouteup() {
@@ -210,8 +214,9 @@ export default class ProjList extends Vue {
console.log('this.$refs.singleproject', this.$refs.singleproject)
for (const elem of this.$refs.singleproject) {
// @ts-ignore
- if (elem.itemproject._id === id)
+ if (elem.itemproject._id === id) {
return elem
+ }
}
}
@@ -232,8 +237,13 @@ export default class ProjList extends Vue {
public setidsel(id: string) {
this.idsel = id
+ this.whatisSel = tools.WHAT_PROJECT
this.itemsel = Projects.getters.getRecordById(this.idsel)
}
+ public setitemsel(item: ITodo) {
+ this.whatisSel = tools.WHAT_TODO
+ this.itemtodosel = item
+ }
public async updateitemproj({ myitem, field }) {
console.log('calling MODIFY updateitemproj', myitem, field)
@@ -251,10 +261,25 @@ export default class ProjList extends Vue {
}
- public deselectAllRowsproj(item: IProject, check, onlythis: boolean = false) {
- // console.log('deselectAllRowsproj : ', item)
+ public deselectAllRowstodo(item: ITodo, check, onlythis: boolean = false) {
+ console.log('PROJ-LIST deselectAllRowstodo : ', item)
- for (let i = 0; i < this.$refs.singleproject.length; i++) {
+ // @ts-ignore
+ for (const i in this.$refs.ctodo.$refs.single) {
+ // @ts-ignore
+ const contr = this.$refs.ctodo.$refs.single[i] as SingleTodo
+ const des = !check
+ if (des) {
+ // @ts-ignore
+ contr.deselectAndExitEdit()
+ }
+ }
+ }
+
+ public deselectAllRowsproj(item: IProject, check, onlythis: boolean = false) {
+ console.log('deselectAllRowsproj: ', item)
+
+ for (const i in this.$refs.singleproject) {
const contr = this.$refs.singleproject[i] as SingleProject
// @ts-ignore
@@ -264,7 +289,11 @@ export default class ProjList extends Vue {
if (onlythis) {
des = item._id === id
} else {
- des = ((check && (item._id !== id)) || (!check))
+ if (!!item) {
+ des = ((check && (item._id !== id)) || (!check))
+ } else {
+ des = !check
+ }
}
if (des) {
// @ts-ignore
@@ -290,9 +319,10 @@ export default class ProjList extends Vue {
}
get getCalcHoursWorked() {
- if (this.itemsel.hoursplanned <= 0)
+ if (this.itemsel.hoursplanned <= 0) {
return 0
- let myperc = Math.round(this.itemsel.hoursworked / this.itemsel.hoursplanned * 100)
+ }
+ const myperc = Math.round(this.itemsel.hoursworked / this.itemsel.hoursplanned * 100)
return myperc
diff --git a/src/views/projects/proj-list/proj-list.vue b/src/views/projects/proj-list/proj-list.vue
index e525d4b..a4f9884 100644
--- a/src/views/projects/proj-list/proj-list.vue
+++ b/src/views/projects/proj-list/proj-list.vue
@@ -84,30 +84,23 @@
-
-
-
-
-
-
-
-