Parcourir la source

fix

- 修复 心理监测详情中间组件颜色与接口返回的等级颜色不一致的问题
test
chenJinxu il y a 7 mois
Parent
révision
355b1f7268
5 fichiers modifiés avec 50 ajouts et 11 suppressions
  1. +7
    -1
      README.md
  2. +1
    -1
      src/config/models.js
  3. +25
    -1
      src/views/health/psychological-main/index.vue
  4. +5
    -1
      src/views/health/psychological/index.vue
  5. +12
    -7
      src/views/health/psychological/report/index.vue

+ 7
- 1
README.md Voir le fichier

@@ -914,4 +914,10 @@ update
## v1.0.117 ## v1.0.117
`2024.3.21` `2024.3.21`
update update
- ‘抑郁’文字 通过页面传过来的参数 改成‘焦虑’,否则不变
- ‘抑郁’文字 通过页面传过来的参数 改成‘焦虑’,否则不变


## v1.0.118
`2024.3.25`
fix
- 修复 心理监测详情中间组件颜色与接口返回的等级颜色不一致的问题

+ 1
- 1
src/config/models.js Voir le fichier

@@ -8,7 +8,7 @@
import store from "@/store"; import store from "@/store";
// 情绪模型 // 情绪模型
const appTypeList = ['1']; const appTypeList = ['1'];
export const VERSION_MODEL = '1.0.117F'; //版本号
export const VERSION_MODEL = '1.0.118F'; //版本号
export const IMAGE_URL = { export const IMAGE_URL = {
production: 'http://zfb.ssjlai.com/web/', production: 'http://zfb.ssjlai.com/web/',
test: 'http://zfb.ssjlai.com/web/', test: 'http://zfb.ssjlai.com/web/',


+ 25
- 1
src/views/health/psychological-main/index.vue Voir le fichier

@@ -13,7 +13,7 @@
<div class="main"> <div class="main">
<div class="list"> <div class="list">
<div v-for="(item, index) in healhtList" :key="index" :class="['item', item.class]" @click="onClick(item)"> <div v-for="(item, index) in healhtList" :key="index" :class="['item', item.class]" @click="onClick(item)">
<p class="health-value" :style="{ color: calcColor(item.value) }">
<p class="health-value" :style="{ color: calcResultColor(item.level) }">
{{ item.value || "--" }} {{ item.value || "--" }}
</p> </p>
<p class="health-name"> <p class="health-name">
@@ -236,6 +236,30 @@ export default {
} }
return color; return color;
}, },
// 计算结果采用哪种颜色
calcResultColor(value, isCallBackClass) {
let color = "";
let className = "";
switch (Number(value)) {
case 0:
color = "#62BD48";
className = "none";
break;
case 1:
color = "#ffde00";
className = "mild";
break;
case 2:
color = "#ff8a00";
className = "moderate";
break;
case 3:
color = "#d70d0d";
className = "severe";
break;
}
return isCallBackClass ? className : color;
},
}, },
}; };
</script> </script>


+ 5
- 1
src/views/health/psychological/index.vue Voir le fichier

@@ -102,7 +102,7 @@
</div> </div>


<div class="middle"> <div class="middle">
<span :style="{ color: calcColor(item.value) }">{{
<span :style="{ color: calcResultColor(item.level) }">{{
item.value || "--" item.value || "--"
}}</span> }}</span>
</div> </div>
@@ -926,6 +926,7 @@ export default {
? this.$dayjs(data.MaxDesc).format("HH:mm") ? this.$dayjs(data.MaxDesc).format("HH:mm")
: this.$dayjs(data.MaxDesc).format("MM/DD HH:mm") : this.$dayjs(data.MaxDesc).format("MM/DD HH:mm")
: "", : "",
level: data.MaxLevel
}; };
let Min = { let Min = {
label: "最小值", label: "最小值",
@@ -935,6 +936,7 @@ export default {
? this.$dayjs(data.MinDesc).format("HH:mm") ? this.$dayjs(data.MinDesc).format("HH:mm")
: this.$dayjs(data.MinDesc).format("MM/DD HH:mm") : this.$dayjs(data.MinDesc).format("MM/DD HH:mm")
: "", : "",
level: data.MinLevel
}; };
let Avg = { let Avg = {
label: "平均值", label: "平均值",
@@ -944,6 +946,7 @@ export default {
? this.$dayjs(data.AvgDesc).format("HH:mm") ? this.$dayjs(data.AvgDesc).format("HH:mm")
: this.$dayjs(data.AvgDesc).format("MM/DD HH:mm") : this.$dayjs(data.AvgDesc).format("MM/DD HH:mm")
: "", : "",
level: data.AvgLevel
}; };
let Current = { let Current = {
label: "最近值", label: "最近值",
@@ -953,6 +956,7 @@ export default {
? this.$dayjs(data.CurrentDesc).format("HH:mm") ? this.$dayjs(data.CurrentDesc).format("HH:mm")
: this.$dayjs(data.CurrentDesc).format("MM/DD HH:mm") : this.$dayjs(data.CurrentDesc).format("MM/DD HH:mm")
: "", : "",
level: data.CurrentLevel
}; };
this.statisticsList.push(Max); this.statisticsList.push(Max);
this.statisticsList.push(Min); this.statisticsList.push(Min);


+ 12
- 7
src/views/health/psychological/report/index.vue Voir le fichier

@@ -90,7 +90,7 @@
</div> </div>


<div class="middle"> <div class="middle">
<span :style="{ color: calcColor(item.value) }">{{
<span :style="{ color: calcResultColor(item.level) }">{{
item.value || "--" item.value || "--"
}}</span> }}</span>
</div> </div>
@@ -681,6 +681,7 @@ export default {
return item.Key; return item.Key;
}) })
: []; : [];
console.log("chartData", chartData);
if (data) { if (data) {
this.monitoringCount = data.Total; this.monitoringCount = data.Total;
this.pieRightList = []; this.pieRightList = [];
@@ -750,6 +751,7 @@ export default {
? this.$dayjs(data.MaxDesc).format("HH:mm") ? this.$dayjs(data.MaxDesc).format("HH:mm")
: this.$dayjs(data.MaxDesc).format("MM/DD HH:mm") : this.$dayjs(data.MaxDesc).format("MM/DD HH:mm")
: "", : "",
level: data.MaxLevel
}; };
let Min = { let Min = {
label: "最小值", label: "最小值",
@@ -759,6 +761,7 @@ export default {
? this.$dayjs(data.MinDesc).format("HH:mm") ? this.$dayjs(data.MinDesc).format("HH:mm")
: this.$dayjs(data.MinDesc).format("MM/DD HH:mm") : this.$dayjs(data.MinDesc).format("MM/DD HH:mm")
: "", : "",
level: data.MinLevel
}; };
let Avg = { let Avg = {
label: "平均值", label: "平均值",
@@ -768,6 +771,7 @@ export default {
? this.$dayjs(data.AvgDesc).format("HH:mm") ? this.$dayjs(data.AvgDesc).format("HH:mm")
: this.$dayjs(data.AvgDesc).format("MM/DD HH:mm") : this.$dayjs(data.AvgDesc).format("MM/DD HH:mm")
: "", : "",
level: data.AvgLevel
}; };
this.statisticsList.push(Max); this.statisticsList.push(Max);
this.statisticsList.push(Min); this.statisticsList.push(Min);
@@ -805,7 +809,7 @@ export default {
this.emotionList.push(ModerateDay); this.emotionList.push(ModerateDay);
this.emotionList.push(SevereDay); this.emotionList.push(SevereDay);
// 图表数据 // 图表数据
this.emotionData = chartData.map((item) => {
this.emotionData = chartData.map(item => {
return { return {
value: item.Value, value: item.Value,
itemStyle: { itemStyle: {
@@ -813,6 +817,7 @@ export default {
}, },
}; };
}); });
console.log("emotionData", this.emotionData);
this.weekAndMonData = chartData.map((item, index) => { this.weekAndMonData = chartData.map((item, index) => {
return { return {
value: [index, item.MinValue, item.MaxValue], value: [index, item.MinValue, item.MaxValue],
@@ -1001,20 +1006,20 @@ export default {
calcResultColor(value, isCallBackClass) { calcResultColor(value, isCallBackClass) {
let color = ""; let color = "";
let className = ""; let className = "";
switch (value) {
case ("0", 0):
switch (Number(value)) {
case 0:
color = "#62BD48"; color = "#62BD48";
className = "none"; className = "none";
break; break;
case ("1", 1):
case 1:
color = "#ffde00"; color = "#ffde00";
className = "mild"; className = "mild";
break; break;
case ("2", 2):
case 2:
color = "#ff8a00"; color = "#ff8a00";
className = "moderate"; className = "moderate";
break; break;
case ("3", 3):
case 3:
color = "#d70d0d"; color = "#d70d0d";
className = "severe"; className = "severe";
break; break;


Chargement…
Annuler
Enregistrer