|
|
@@ -35,7 +35,7 @@ |
|
|
|
<p>{{ resetDate(weekResult.StartDate,weekResult.EndDate) || '--' }}</p> |
|
|
|
</div> |
|
|
|
<div class="count"> |
|
|
|
<p>监测次数:{{ weekResult.Total || '--' }}次</p> |
|
|
|
<p>监测次数:{{ weekResult.LastTotal || '--' }}次</p> |
|
|
|
</div> |
|
|
|
<!-- 趋势对比-饼状图 --> |
|
|
|
<div class="pie-chart-con"> |
|
|
@@ -61,8 +61,8 @@ |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="status"> |
|
|
|
<img :src="calcImg(item.scale)" alt="" /> |
|
|
|
<span v-if="item.scale != 0" :style="{color: item.color}">{{ Math.abs(item.scale)}}%</span> |
|
|
|
<img :src="calcImg(item.percentage, item.lastPercentage)" alt="" /> |
|
|
|
<span :style="{color: calcImg(item.percentage, item.lastPercentage, true) != 0 ? item.color : ''}">{{ calcImg(item.percentage, item.lastPercentage, true) ? Math.abs(calcImg(item.percentage, item.lastPercentage, true)) + '%' : '持平'}}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@@ -534,10 +534,25 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
calcImg(value) { |
|
|
|
// 计算显示是上升or下降的图片 |
|
|
|
/** |
|
|
|
* |
|
|
|
* @param { 本周情绪比例} current |
|
|
|
* @param { 上周情绪比例 } last |
|
|
|
* @param { 是否返回对比比例 } isCallBackCompare |
|
|
|
*/ |
|
|
|
calcImg(current, last, isCallBackCompare) { |
|
|
|
let imgUrl = ''; |
|
|
|
imgUrl = value > 0 ? this.upImg : value == 0 ? '' : this.downImg |
|
|
|
return imgUrl; |
|
|
|
let compare = ''; |
|
|
|
if(isNotNull(current) && isNotNull(last)) { |
|
|
|
compare = Number(current) - Number(last); |
|
|
|
imgUrl = compare > 0 ? this.upImg : compare == 0 ? '' : this.downImg |
|
|
|
} |
|
|
|
if(isCallBackCompare) { |
|
|
|
return compare |
|
|
|
} else { |
|
|
|
return imgUrl; |
|
|
|
} |
|
|
|
}, |
|
|
|
async loadParams() { |
|
|
|
let params = this.$route.query; |
|
|
@@ -643,7 +658,11 @@ export default { |
|
|
|
), |
|
|
|
text: `无${this.emoName}倾向`, |
|
|
|
color: "#62BD48", |
|
|
|
scale: data.NoneRatio |
|
|
|
scale: data.NoneRatio, |
|
|
|
lastPercentage: this.calcPercentage( |
|
|
|
data.LastNone, |
|
|
|
data.LastTotal |
|
|
|
) |
|
|
|
}; |
|
|
|
let Mild = { |
|
|
|
count: data.Mild, |
|
|
@@ -653,7 +672,11 @@ export default { |
|
|
|
), |
|
|
|
text: `轻度${this.emoName}倾向`, |
|
|
|
color: "#ffde00", |
|
|
|
scale: data.MildRatio |
|
|
|
scale: data.MildRatio, |
|
|
|
lastPercentage: this.calcPercentage( |
|
|
|
data.LastMild, |
|
|
|
data.LastTotal |
|
|
|
) |
|
|
|
}; |
|
|
|
let Moderate = { |
|
|
|
count: data.Moderate, |
|
|
@@ -663,7 +686,11 @@ export default { |
|
|
|
), |
|
|
|
text: `中度${this.emoName}倾向`, |
|
|
|
color: "#ff8a00", |
|
|
|
scale: data.ModerateRatio |
|
|
|
scale: data.ModerateRatio, |
|
|
|
lastPercentage: this.calcPercentage( |
|
|
|
data.LastModerate, |
|
|
|
data.LastTotal |
|
|
|
) |
|
|
|
}; |
|
|
|
let Severe = { |
|
|
|
count: data.Severe, |
|
|
@@ -673,7 +700,11 @@ export default { |
|
|
|
), |
|
|
|
text: `重度${this.emoName}倾向`, |
|
|
|
color: "#d70d0d", |
|
|
|
scale: data.SevereRatio |
|
|
|
scale: data.SevereRatio, |
|
|
|
lastPercentage: this.calcPercentage( |
|
|
|
data.LastSevere, |
|
|
|
data.LastTotal |
|
|
|
) |
|
|
|
}; |
|
|
|
// 饼状图右边数据 |
|
|
|
this.pieRightList.push(None); |
|
|
|