|
|
@@ -95,11 +95,11 @@ export default { |
|
|
|
const data = res.data.response; |
|
|
|
this.healhtList = [ |
|
|
|
// 抑郁 |
|
|
|
{ value: data.DepScore, name: '抑郁倾向', class: 'depression', result: data.DepDesc, time: data.DepMeasureTime ? this.$dayjs(data.DepMeasureTime).format('HH:mm'): '', level: data.DepLevel, img: this.calcImg(data.DepLevel) }, |
|
|
|
{ value: data.DepScore, name: '抑郁倾向', class: 'depression', result: data.DepDesc, time: data.DepMeasureTime ? this.$dayjs(data.DepMeasureTime).format('HH:mm'): '', level: data.DepLevel, img: data.DepScore ? this.calcImg(data.DepLevel, 'depression') : ''}, |
|
|
|
// 压力 |
|
|
|
{ value: data.StressScore, name: '压力', class: 'stress', result: data.StressDesc, time: data.StressMeasureTime ? this.$dayjs(data.StressMeasureTime).format('HH:mm') : '', level: data.StressLevel, img: this.calcImg(data.StressLevel) }, |
|
|
|
{ value: data.StressScore, name: '压力', class: 'stress', result: data.StressDesc, time: data.StressMeasureTime ? this.$dayjs(data.StressMeasureTime).format('HH:mm') : '', level: data.StressLevel, img: data.StressScore ? this.calcImg(data.StressLevel, 'stress') : ''}, |
|
|
|
// 疲劳 |
|
|
|
{ value: data.TirScore, name: '疲劳', class: 'tiredness', result: data.TirDesc, time: data.TirMeasureTime ? this.$dayjs(data.TirMeasureTime).format('HH:mm') : '', level: data.TirLevel, img: this.calcImg(data.TirLevel) }, |
|
|
|
{ value: data.TirScore, name: '疲劳', class: 'tiredness', result: data.TirDesc, time: data.TirMeasureTime ? this.$dayjs(data.TirMeasureTime).format('HH:mm') : '', level: data.TirLevel, img: data.TirScore ? this.calcImg(data.TirLevel, 'tiredness') : '' }, |
|
|
|
]; |
|
|
|
this.$toast.success('数据加载完成'); |
|
|
|
}).catch(() =>{}).finally(() => { this.$toast.clear() }) |
|
|
@@ -125,11 +125,15 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
// 计算表情 |
|
|
|
calcImg(level) { |
|
|
|
calcImg(level, name) { |
|
|
|
let imgUrl = ''; |
|
|
|
switch(level) { |
|
|
|
/* imgUrl = require(`@/assets/img/psychological/${name}_${level}.png`); */ |
|
|
|
let numLevel = Number(level); |
|
|
|
console.log(`@/assets/img/psychological/${name}_${numLevel}.png`); |
|
|
|
imgUrl = require(`@/assets/img/psychological/${name}_${numLevel + 1}.png`); |
|
|
|
/* switch(level) { |
|
|
|
case '0': |
|
|
|
imgUrl = require('@/assets/img/regardless.png'); |
|
|
|
imgUrl = require(`@/assets/img/psychological/${name}_${numLevel + 1}.png`); |
|
|
|
break; |
|
|
|
case '1': |
|
|
|
imgUrl = require('@/assets/img/regardless.png'); |
|
|
@@ -140,7 +144,7 @@ export default { |
|
|
|
case '3': |
|
|
|
imgUrl = require('@/assets/img/moderate.png'); |
|
|
|
break; |
|
|
|
} |
|
|
|
} */ |
|
|
|
return imgUrl; |
|
|
|
}, |
|
|
|
// 计算颜色 |
|
|
|