root преди 1 година
родител
ревизия
d31eb7bffc
променени са 1 файла, в които са добавени 23 реда и са изтрити 22 реда
  1. 23 22
      src/renderer/components/treatDepression.vue

+ 23 - 22
src/renderer/components/treatDepression.vue

@@ -23,7 +23,7 @@
                 <div class="message-wrapper message-wrapper-left">
                   <div class="message" v-if="content.isScale">
                     <el-radio-group
-                      v-model="answerList[content.index].answer"
+                      v-model="answerList[content.index].checkItems"
                       @input="nextHandle(content.index)"
                       :disabled="content.disabled"
                     >
@@ -233,7 +233,7 @@ export default {
             disabled: false,
             question: result,
             from1: HeadImg,
-            radio: ''
+            radio: "",
           });
           let contant1 = document.getElementById("contant1");
           this.sleep(101).then(() => {
@@ -251,7 +251,7 @@ export default {
         for (var i = 0; i < data.length; i++) {
           anwserListx.push({
             answer: data[i].answer,
-            checkItems: data[i].checkItems,
+            checkItems: "",
             flag: data[i].flag,
             id: data[i].id,
             questionNo: data[i].questionNo,
@@ -331,33 +331,34 @@ export default {
             res.data.data.userRecordEntity.testResult
           );
           let score = Number(testResult[0].newTableContext.result[0].score);
-          //   if (score < 10) {
-          //     this.chatContents.push({
-          //       index: 0,
-          //       from: 1,
-          //       isScale: false,
-          //       question: "根据测试,你很健康,无抑郁表现",
-          //       from1: HeadImg,
-          //     });
-          //   } else if (score < 19) {
-          //     this.getNext("轻度抑郁或有抑郁症状");
-          //   } else {
-          //     this.getNext("重度抑郁");
-          //   }
-          this.getNext("轻度抑郁或有抑郁症状");
+          debugger;
+          if (score < 10) {
+            this.chatContents.push({
+              index: 0,
+              from: 1,
+              isScale: false,
+              question: "根据测试,你很健康,无抑郁表现",
+              from1: HeadImg,
+            });
+          } else if (score < 19) {
+            this.getNext("轻度抑郁或有抑郁症状");
+          } else {
+            this.getNext("重度抑郁");
+          }
         }
       });
     },
 
     getNext(result) {
       this.$http.get(
-        `chat/getNextQuestionByScaleResult?label=2&result=${result}`,{},
+        `chat/getNextQuestionByScaleResult?label=2&result=${result}`,
+        {},
         (res) => {
-            if(res.code == 200) {
-                if(res.data && res.data.nextQuestionNo) {
-                    this.getQuestion(res.data.nextQuestionNo);
-                }
+          if (res.code == 200) {
+            if (res.data && res.data.nextQuestionNo) {
+              this.getQuestion(res.data.nextQuestionNo);
             }
+          }
         }
       );
     },