- adding Progress %
This commit is contained in:
@@ -42,7 +42,10 @@
|
||||
.pos-item {
|
||||
max-width: 24px;
|
||||
min-width: 24px;
|
||||
margin: 0 auto;
|
||||
margin-left: 1px;
|
||||
margin-right: 1px;
|
||||
padding-left: 1px;
|
||||
padding-right: 1px;
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
text-align: center;
|
||||
@@ -122,6 +125,38 @@
|
||||
min-width: 24px;
|
||||
}
|
||||
|
||||
.progress-item {
|
||||
max-width: 32px;
|
||||
min-width: 24px;
|
||||
flex: 1;
|
||||
order: 2;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
|
||||
.percProgress {
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.menuProgress {
|
||||
width:50px;
|
||||
}
|
||||
|
||||
.colProgress {
|
||||
}
|
||||
|
||||
.lowperc {
|
||||
color: red;
|
||||
}
|
||||
.medperc {
|
||||
color: blue;
|
||||
}
|
||||
.highperc {
|
||||
color: green;
|
||||
}
|
||||
|
||||
.myexpired {
|
||||
padding-top: 0px;
|
||||
padding-bottom: 0px;
|
||||
|
||||
@@ -27,6 +27,9 @@ export default class SingleTodo extends Vue {
|
||||
public sel: boolean = false
|
||||
public inEdit: boolean = false
|
||||
public precDescr: string = ''
|
||||
public menuProgress: string = 'menuprogress'
|
||||
public percProgress: string = 'percProgress'
|
||||
public colProgress: string = 'blue'
|
||||
$q: any
|
||||
|
||||
@Prop({ required: true }) itemtodo: ITodo
|
||||
@@ -48,10 +51,15 @@ export default class SingleTodo extends Vue {
|
||||
this.watchupdate()
|
||||
}
|
||||
|
||||
|
||||
@Watch('itemtodo.descr') valueChanged5() {
|
||||
this.precDescr = this.itemtodo.descr
|
||||
}
|
||||
|
||||
@Watch('itemtodo.progress') valueChanged6() {
|
||||
this.updateClasses()
|
||||
}
|
||||
|
||||
isTodo() {
|
||||
return this.isTodoByElem(this.itemtodo)
|
||||
}
|
||||
@@ -82,6 +90,23 @@ export default class SingleTodo extends Vue {
|
||||
this.classExpiringEx += ' status_completed'
|
||||
}
|
||||
|
||||
this.menuProgress = 'menuProgress'
|
||||
this.percProgress = 'percProgress'
|
||||
|
||||
let mycolcl = ''
|
||||
if (this.itemtodo.progress < 33) {
|
||||
mycolcl = ' lowperc'
|
||||
} else if (this.itemtodo.progress < 66) {
|
||||
mycolcl = ' medperc'
|
||||
} else {
|
||||
mycolcl = ' highperc'
|
||||
}
|
||||
|
||||
this.colProgress = mycolcl
|
||||
|
||||
this.menuProgress += mycolcl
|
||||
this.percProgress += mycolcl
|
||||
|
||||
// if (this.inEdit) {
|
||||
// this.classDescr += ' hide'
|
||||
// this.classDescrEdit += ' show'
|
||||
@@ -293,4 +318,11 @@ export default class SingleTodo extends Vue {
|
||||
|
||||
// this.$q.notify('setPriority: ' + elem)
|
||||
}
|
||||
|
||||
getPercentageProgress() {
|
||||
if (this.itemtodo.completed)
|
||||
return 100
|
||||
else
|
||||
return this.itemtodo.progress
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div :class="getClassRow()" >
|
||||
<div :class="getClassRow()">
|
||||
<q-context-menu>
|
||||
<q-list link separator no-border class="todo-menu">
|
||||
<q-item v-for="field in menuPopupTodo" :key="field.value"
|
||||
@@ -16,6 +16,16 @@
|
||||
<q-item-side v-if="field.value === 110">
|
||||
<q-checkbox v-model="itemtodo.completed"/>
|
||||
</q-item-side>
|
||||
|
||||
<q-item-side v-if="field.value === 120">
|
||||
<q-slider :class="menuProgress" v-model="itemtodo.progress" :min="0" :max="100"/>
|
||||
</q-item-side>
|
||||
<q-item-side v-if="field.value === 120">
|
||||
<div :class="percProgress">
|
||||
{{getPercentageProgress()}}%
|
||||
</div>
|
||||
</q-item-side>
|
||||
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-context-menu>
|
||||
@@ -41,6 +51,14 @@
|
||||
<q-item-side v-if="field.value === 110">
|
||||
<q-checkbox v-model="itemtodo.completed"/>
|
||||
</q-item-side>
|
||||
<q-item-side v-if="field.value === 120">
|
||||
<q-slider :class="menuProgress" v-model="itemtodo.progress" :min="0" :max="100"/>
|
||||
</q-item-side>
|
||||
<q-item-side v-if="field.value === 120">
|
||||
<div :class="percProgress">
|
||||
{{getPercentageProgress()}}%
|
||||
</div>
|
||||
</q-item-side>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-popover>
|
||||
@@ -87,16 +105,29 @@
|
||||
<!--:after="[{icon: 'arrow_forward', content: true, handler () {}}]"-->
|
||||
|
||||
<!--<div :class="classDescr" @mousedown.left="editTodo()">-->
|
||||
<!--<q-field>{{ itemtodo.descr }}</q-field>-->
|
||||
<!--<q-field>{{ itemtodo.descr }}</q-field>-->
|
||||
<!--</div>-->
|
||||
|
||||
<div v-if="isTodo()" class="flex-item progress-item">
|
||||
<q-progress
|
||||
:percentage="getPercentageProgress()"
|
||||
class="progress-item"
|
||||
:color="colProgress"
|
||||
>
|
||||
</q-progress>
|
||||
<div :class="percProgress">
|
||||
{{getPercentageProgress()}}%
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div v-if="itemtodo.enableExpiring">
|
||||
<div :class="classExpiring">
|
||||
<q-datetime
|
||||
:class="classExpiringEx"
|
||||
v-model="itemtodo.expiring_at"
|
||||
class="myexpired"/>
|
||||
class="myexpired">
|
||||
</q-datetime>
|
||||
</div>
|
||||
</div>
|
||||
<!--<div class="flex-item btn-item">-->
|
||||
|
||||
@@ -263,7 +263,8 @@ export default class Todo extends Vue {
|
||||
id_prev: 0,
|
||||
id_next: 0,
|
||||
pos: 0,
|
||||
modified: true
|
||||
modified: true,
|
||||
progress: 0
|
||||
}
|
||||
return objtodo
|
||||
|
||||
@@ -546,6 +547,8 @@ export default class Todo extends Vue {
|
||||
this.modifyField(miorec, myobj, 'id_next')
|
||||
this.modifyField(miorec, myobj, 'pos')
|
||||
this.modifyField(miorec, myobj, 'enableExpiring')
|
||||
this.modifyField(miorec, myobj, 'progress')
|
||||
|
||||
|
||||
if (miorec.modified) {
|
||||
miorec.modify_at = new Date()
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
<div class="panel">
|
||||
<p class="caption"></p>
|
||||
|
||||
<q-input ref="insertTask" v-model="todo" inverted :float-label="$t('todo.insert')"
|
||||
:after="[{icon: 'arrow_forward', content: true, handler () {}}]"
|
||||
v-on:keyup.enter="insertTodo"/>
|
||||
|
||||
|
||||
<div style="display: none">{{ prior = 0, priorcomplet = false }}</div>
|
||||
<div class="drag">
|
||||
@@ -31,6 +27,9 @@
|
||||
</transition-group>
|
||||
</draggable>
|
||||
</div>
|
||||
<q-input ref="insertTask" v-model="todo" inverted :float-label="$t('todo.insert')"
|
||||
:after="[{icon: 'arrow_forward', content: true, handler () {}}]"
|
||||
v-on:keyup.enter="insertTodo"/>
|
||||
|
||||
</div>
|
||||
</q-page>
|
||||
|
||||
Reference in New Issue
Block a user