2019-03-30 02:57:40 +01:00
|
|
|
import Vue from 'vue'
|
|
|
|
|
import { Component, Prop, Watch } from 'vue-property-decorator'
|
|
|
|
|
|
|
|
|
|
import { tools } from '@src/store/Modules/tools'
|
2019-07-12 14:09:44 +02:00
|
|
|
import { toolsext } from '@src/store/Modules/toolsext'
|
2019-03-30 02:57:40 +01:00
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
name: 'CProgress'
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
export default class CProgress extends Vue {
|
|
|
|
|
public cpr_colProgress: string = 'blue'
|
|
|
|
|
public cpr_percProgress: string = 'cpr-percProgress'
|
2019-04-06 21:02:33 +02:00
|
|
|
public progressvalinternal: number = 0
|
2019-03-30 02:57:40 +01:00
|
|
|
|
|
|
|
|
@Watch('progressval')
|
|
|
|
|
public changeprogress() {
|
|
|
|
|
this.updateclasses()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Prop({ required: true }) public progressval: number
|
|
|
|
|
@Prop() public descr: string
|
2019-04-06 21:02:33 +02:00
|
|
|
@Prop({ default: false }) public slider: boolean
|
2019-04-29 01:01:31 +02:00
|
|
|
@Prop({ default: false }) public readonly: boolean
|
2019-04-06 21:02:33 +02:00
|
|
|
|
|
|
|
|
@Watch('progressval')
|
|
|
|
|
public valchanged(value) {
|
|
|
|
|
this.progressvalinternal = value
|
|
|
|
|
}
|
2019-03-30 02:57:40 +01:00
|
|
|
|
|
|
|
|
public updateclasses() {
|
2019-04-06 21:02:33 +02:00
|
|
|
this.cpr_colProgress = tools.getProgressColor(this.progressvalinternal)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public setchange(value) {
|
|
|
|
|
this.progressvalinternal = value
|
|
|
|
|
console.log('setchange', this.progressvalinternal)
|
|
|
|
|
this.$emit('input', this.progressvalinternal)
|
2019-03-30 02:57:40 +01:00
|
|
|
}
|
|
|
|
|
|
2019-04-06 21:02:33 +02:00
|
|
|
get getdescr() {
|
2019-03-30 02:57:40 +01:00
|
|
|
if (!!this.descr) {
|
2021-02-11 02:21:36 +01:00
|
|
|
return this.descr + ': '
|
2019-03-30 02:57:40 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public create() {
|
|
|
|
|
this.updateclasses()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|