|
@@ -717,6 +717,8 @@ export default {
|
|
|
},
|
|
|
(res) => {
|
|
|
if (res.code == "200") {
|
|
|
+ console.log("res");
|
|
|
+ console.log(res);
|
|
|
console.log(that.interveneId);
|
|
|
if (that.interveneId == 5 && id == 3) {
|
|
|
// that.interveneId = that.$route.query.id;
|
|
@@ -737,6 +739,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
if (result.question && result.question.includes("测评结果")) {
|
|
|
+ debugger;
|
|
|
//当时量表抑郁的时候是这样显示结果的
|
|
|
// let str = sessionStorage.getItem("testResults");
|
|
|
if (that.interveneId == 2) {
|
|
@@ -773,6 +776,23 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if (that.interveneId == 3) {
|
|
|
+ let str = sessionStorage.getItem("testResultsScore");
|
|
|
+ if (str <= 5) {
|
|
|
+ result.question =
|
|
|
+ "您的睡眠质量非常优秀。请继续保持健康的睡眠习惯,确保充足的休息时间,以维持良好的睡眠质量和日间功能。如有任何变化,请随时与我沟通。";
|
|
|
+ } else if (str >= 6 && str <= 10) {
|
|
|
+ result.question =
|
|
|
+ "您的睡眠质量较好。为了进一步提升睡眠品质,建议您关注睡眠环境,减少干扰因素。我会与您一同探讨更多优化睡眠的方法,让您的睡眠更加深沉和高效。";
|
|
|
+ } else if (str >= 11 && str <= 15) {
|
|
|
+ result.question =
|
|
|
+ "您的睡眠质量有待提升。请放心,我会提供专业的指导,帮助您改善入睡困难、睡眠干扰等问题。通过共同努力,我们能够让您享受到更健康的睡眠";
|
|
|
+ } else if (str >= 16) {
|
|
|
+ result.question =
|
|
|
+ "您的睡眠质量非常差,这可能对您的健康和日间功能造成了严重影响。我强烈建议您立即开始改善睡眠,包括调整作息时间、减少压力等。我会全力支持您,与您一起克服睡眠障碍,恢复良好的睡眠质量";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// result.question = str;
|
|
|
}
|
|
|
|
|
@@ -1012,6 +1032,9 @@ export default {
|
|
|
let data = res.data;
|
|
|
let anwserListx = [];
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
+ // if(data[i].questionType=='5'){
|
|
|
+
|
|
|
+ // }
|
|
|
anwserListx.push({
|
|
|
answer: data[i].answer,
|
|
|
checkItems: "",
|
|
@@ -1056,20 +1079,21 @@ export default {
|
|
|
});
|
|
|
} else if (data[0].questionType == 5) {
|
|
|
let dataTmp = JSON.parse(data[0].questionParam);
|
|
|
- // for (let i = 0; i < dataTmp.length; i++) {radi
|
|
|
- // if (dataTmp.length - 1 == i) {
|
|
|
- // checkIt += dataTmp[i].name;
|
|
|
- // } else {
|
|
|
- // checkIt += dataTmp[i].name + ";";
|
|
|
- // }
|
|
|
- // }
|
|
|
+ let checkIt = "";
|
|
|
+ for (let i = 0; i < dataTmp.length; i++) {
|
|
|
+ if (dataTmp.length - 1 == i) {
|
|
|
+ checkIt += dataTmp[i].label;
|
|
|
+ } else {
|
|
|
+ checkIt += dataTmp[i].label + ";";
|
|
|
+ }
|
|
|
+ }
|
|
|
this.chatContents.push({
|
|
|
index: 0,
|
|
|
from: 2,
|
|
|
disabled: false,
|
|
|
isScale: true,
|
|
|
isType: 5,
|
|
|
- question: dataTmp,
|
|
|
+ question: checkIt.split(";"),
|
|
|
from1: HeadImg,
|
|
|
});
|
|
|
}
|
|
@@ -1199,19 +1223,20 @@ export default {
|
|
|
});
|
|
|
} else if (this.questionList[i].questionType == 5) {
|
|
|
let dataTmp = JSON.parse(this.questionList[i].questionParam);
|
|
|
- // for (let j = 0; j < dataTmp.length; j++) {
|
|
|
- // if (dataTmp.length - 1 == i) {
|
|
|
- // checkIt += dataTmp[j].name;
|
|
|
- // } else {
|
|
|
- // checkIt += dataTmp[j].name + ";";
|
|
|
- // }
|
|
|
- // }
|
|
|
+ let checkIt = "";
|
|
|
+ for (let j = 0; j < dataTmp.length; j++) {
|
|
|
+ if (dataTmp.length - 1 == j) {
|
|
|
+ checkIt += dataTmp[j].label;
|
|
|
+ } else {
|
|
|
+ checkIt += dataTmp[j].label + ";";
|
|
|
+ }
|
|
|
+ }
|
|
|
this.chatContents.push({
|
|
|
index: i,
|
|
|
from: 2,
|
|
|
isScale: true,
|
|
|
isType: 5,
|
|
|
- question: dataTmp,
|
|
|
+ question: checkIt.split(";"),
|
|
|
from1: HeadImg,
|
|
|
});
|
|
|
}
|
|
@@ -1273,14 +1298,19 @@ export default {
|
|
|
sessionStorage.setItem("testResultsScore", score);
|
|
|
this.getNext(this.currentId);
|
|
|
} else if (this.interveneId == 3) {
|
|
|
- this.chatContents.push({
|
|
|
- from: 1,
|
|
|
- isScale: false,
|
|
|
- isType: -1,
|
|
|
- question: res.data.data.userRecordEntity.testResults,
|
|
|
- from1: HeadImg,
|
|
|
- });
|
|
|
- this.getQuestion(44, true);
|
|
|
+ debugger;
|
|
|
+ // let score = Number(testResult[0].newTableContext.result[0].score);
|
|
|
+ let score =Number(testResult[0].tableContext[7].value[0])
|
|
|
+ sessionStorage.setItem("testResultsScore", score);
|
|
|
+ this.getNext(this.currentId);
|
|
|
+ // this.chatContents.push({
|
|
|
+ // from: 1,
|
|
|
+ // isScale: false,
|
|
|
+ // isType: -1,
|
|
|
+ // question: res.data.data.userRecordEntity.testResults,
|
|
|
+ // from1: HeadImg,
|
|
|
+ // });
|
|
|
+ // this.getQuestion(44, true);
|
|
|
} else if (this.interveneId == 4) {
|
|
|
this.chatContents.push({
|
|
|
from: 1,
|
|
@@ -2109,9 +2139,10 @@ export default {
|
|
|
margin-left: 3%;
|
|
|
border-radius: 40px;
|
|
|
background: #f6f6f6;
|
|
|
+ /* display:flex; */
|
|
|
}
|
|
|
.chat-window {
|
|
|
- height: 70vh;
|
|
|
+ height: 82vh;
|
|
|
overflow: auto;
|
|
|
/* overflow-y:hidden; */
|
|
|
}
|