Updated Project calculation for hours and progress.
This commit is contained in:
@@ -27,10 +27,15 @@ $heightBtn: 100%;
|
||||
|
||||
.cpr-progrbar-item {
|
||||
//height: 10px
|
||||
padding-top: 7px;
|
||||
margin-top: 11px;
|
||||
margin-bottom: 11px;
|
||||
height:15px;
|
||||
}
|
||||
|
||||
.cpr-slider-item {
|
||||
//height: 10px
|
||||
}
|
||||
|
||||
.cpr-percProgress {
|
||||
padding-top: 3px;
|
||||
color: #888;
|
||||
|
||||
@@ -10,6 +10,7 @@ import { tools } from '@src/store/Modules/tools'
|
||||
export default class CProgress extends Vue {
|
||||
public cpr_colProgress: string = 'blue'
|
||||
public cpr_percProgress: string = 'cpr-percProgress'
|
||||
public progressvalinternal: number = 0
|
||||
|
||||
@Watch('progressval')
|
||||
public changeprogress() {
|
||||
@@ -18,12 +19,24 @@ export default class CProgress extends Vue {
|
||||
|
||||
@Prop({ required: true }) public progressval: number
|
||||
@Prop() public descr: string
|
||||
@Prop({ default: false }) public slider: boolean
|
||||
|
||||
public updateclasses() {
|
||||
this.cpr_colProgress = tools.getProgressColor(this.progressval)
|
||||
@Watch('progressval')
|
||||
public valchanged(value) {
|
||||
this.progressvalinternal = value
|
||||
}
|
||||
|
||||
get getdescr(){
|
||||
public updateclasses() {
|
||||
this.cpr_colProgress = tools.getProgressColor(this.progressvalinternal)
|
||||
}
|
||||
|
||||
public setchange(value) {
|
||||
this.progressvalinternal = value
|
||||
console.log('setchange', this.progressvalinternal)
|
||||
this.$emit('input', this.progressvalinternal)
|
||||
}
|
||||
|
||||
get getdescr() {
|
||||
if (!!this.descr) {
|
||||
return this.descr + ' : '
|
||||
}
|
||||
|
||||
@@ -1,7 +1,16 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="flex-item progress-item shadow-1">
|
||||
<q-slider v-if="slider" label
|
||||
class="cpr-slider-item"
|
||||
:value="progressval"
|
||||
:min="0"
|
||||
:max="100"
|
||||
@change="setchange"
|
||||
:step="5">
|
||||
</q-slider>
|
||||
<q-linear-progress
|
||||
v-else
|
||||
stripe
|
||||
rounded
|
||||
:value="progressval / 100"
|
||||
|
||||
@@ -233,7 +233,7 @@ export default class SingleProject extends Vue {
|
||||
this.editProject()
|
||||
}
|
||||
|
||||
get getrouteto(){
|
||||
get getrouteto() {
|
||||
return '/projects/' + this.itemproject._id
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div :class="getClassRow()" @click="clickProject" >
|
||||
|
||||
<q-btn class="flex-item donotdrag " size="sm" push color="primary" round icon="arrow_forward"
|
||||
:to="getrouteto" />
|
||||
:to="getrouteto"/>
|
||||
|
||||
<div class="flex-item donotdrag divdescrTot">
|
||||
<q-input v-if="(sel && inEdit)" hide-underline type="textarea" ref="inputdescr"
|
||||
|
||||
@@ -74,7 +74,7 @@ export default class SingleTodo extends Vue {
|
||||
console.log('itemtodo.hoursplanned', this.itemtodo.hoursplanned)
|
||||
this.watchupdate('hoursplanned')
|
||||
}
|
||||
@Watch('itemtodo.status', { immediate: true, deep: true }) public valueChangedstatus() {
|
||||
@Watch('itemtodo.status') public valueChangedstatus() {
|
||||
console.log('itemtodo.status', this.itemtodo.status)
|
||||
this.watchupdate('status')
|
||||
}
|
||||
@@ -125,6 +125,7 @@ export default class SingleTodo extends Vue {
|
||||
}
|
||||
|
||||
public watchupdate(field = '') {
|
||||
console.log('watchupdate', field)
|
||||
this.$emit('eventupdate', {myitem: this.itemtodo, field } )
|
||||
this.updateicon()
|
||||
}
|
||||
@@ -396,9 +397,9 @@ export default class SingleTodo extends Vue {
|
||||
this.updateClasses()
|
||||
}
|
||||
|
||||
public aggiornaProgress(value, initialval){
|
||||
public aggiornaProgress(value, initialval) {
|
||||
if (value !== initialval) {
|
||||
this.itemtodo.progress = value
|
||||
this.itemtodo.progress = parseInt(value, 10)
|
||||
this.updatedata('progress')
|
||||
this.deselectAndExitEdit()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user