Browse Source

修生物反馈及认知干预记录

plg 10 months ago
parent
commit
d7a769c952
41 changed files with 107 additions and 52 deletions
  1. 1 1
      package.json
  2. 1 1
      src/main/index.js
  3. 33 18
      src/renderer/components/AnimationDes.vue
  4. 41 21
      src/renderer/components/AnimationDouble.vue
  5. 2 2
      src/renderer/components/TopPage.vue
  6. 29 9
      src/renderer/components/treatDepression.vue
  7. 0 0
      static/loong_4/Build/Bulid.data
  8. 0 0
      static/loong_4/Build/Bulid.framework.js
  9. 0 0
      static/loong_4/Build/Bulid.loader.js
  10. 0 0
      static/loong_4/Build/Bulid.wasm
  11. 0 0
      static/loong_4/ServiceWorker.js
  12. 0 0
      static/loong_4/TemplateData/favicon.ico
  13. 0 0
      static/loong_4/TemplateData/icons/unity-logo-dark.png
  14. 0 0
      static/loong_4/TemplateData/icons/unity-logo-light.png
  15. 0 0
      static/loong_4/TemplateData/progress-bar-empty-dark.png
  16. 0 0
      static/loong_4/TemplateData/progress-bar-empty-light.png
  17. 0 0
      static/loong_4/TemplateData/progress-bar-full-dark.png
  18. 0 0
      static/loong_4/TemplateData/progress-bar-full-light.png
  19. 0 0
      static/loong_4/TemplateData/style.css
  20. 0 0
      static/loong_4/TemplateData/unity-logo-dark.png
  21. 0 0
      static/loong_4/TemplateData/unity-logo-light.png
  22. 0 0
      static/loong_4/index.html
  23. 0 0
      static/loong_4/manifest.webmanifest
  24. 0 0
      static/tianping1/.vscode/settings.json
  25. 0 0
      static/tianping1/Build/Bulid.data
  26. 0 0
      static/tianping1/Build/Bulid.framework.js
  27. 0 0
      static/tianping1/Build/Bulid.loader.js
  28. 0 0
      static/tianping1/Build/Bulid.wasm
  29. 0 0
      static/tianping1/ServiceWorker.js
  30. 0 0
      static/tianping1/TemplateData/favicon.ico
  31. 0 0
      static/tianping1/TemplateData/icons/unity-logo-dark.png
  32. 0 0
      static/tianping1/TemplateData/icons/unity-logo-light.png
  33. 0 0
      static/tianping1/TemplateData/progress-bar-empty-dark.png
  34. 0 0
      static/tianping1/TemplateData/progress-bar-empty-light.png
  35. 0 0
      static/tianping1/TemplateData/progress-bar-full-dark.png
  36. 0 0
      static/tianping1/TemplateData/progress-bar-full-light.png
  37. 0 0
      static/tianping1/TemplateData/style.css
  38. 0 0
      static/tianping1/TemplateData/unity-logo-dark.png
  39. 0 0
      static/tianping1/TemplateData/unity-logo-light.png
  40. 0 0
      static/tianping1/index.html
  41. 0 0
      static/tianping1/manifest.webmanifest

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "projectGy",
-  "version": "1.3.3",
+  "version": "1.3.4",
   "author": "",
   "description": "",
   "license": null,

+ 1 - 1
src/main/index.js

@@ -140,7 +140,7 @@ function createWindow() {
   //mainWindow.loadURL(loadingURL)
   mainWindow.loadURL(winURL)
   mainWindow.setMenu(null)
-  // mainWindow.webContents.openDevTools();
+  mainWindow.webContents.openDevTools();
   mainWindow.on('closed', () => {
     mainWindow = null
   })

+ 33 - 18
src/renderer/components/AnimationDes.vue

@@ -429,8 +429,8 @@ export default {
       focusNao: [],
       // 全量
       focusNaoAll: [],
-      urlThreeP: "../../../static/loong_3/index.html",
-      // urlThreeP: __static + "/loong_3/index.html",
+      // urlThreeP: "../../../static/loong_4/index.html",
+      urlThreeP: __static + "/loong_4/index.html",
       pubsrc: __static,
       userLink: {
         num: "",
@@ -628,12 +628,11 @@ export default {
 
           let a = data1.rmssd.toFixed(2);
           if (this.equipment == 2 && this.buttonFlag == "结束") {
-            if(a=='NaN'){
+            if (a == "NaN") {
               this.userLink.targetList.push(0);
-            }else{
+            } else {
               this.userLink.targetList.push(a);
             }
-           
           }
 
           let b = (a - 15) * 4;
@@ -671,9 +670,21 @@ export default {
     //单人人向传输数据
     sendAtten() {
       let val = this.attentionAnimation;
-      let a = parseFloat(val / 100);
+      let a = null;
+      if (this.gameDifficulty == 1) {
+        a = parseFloat(val / 100);
+      } else if (this.gameDifficulty == 2) {
+        a = parseFloat(val / 100) * 0.9;
+      } else if (this.gameDifficulty == 3) {
+        a = parseFloat(val / 100) * 0.8;
+      }
+
       //判断是结束了在发送
       if (this.buttonFlag == "结束") {
+        //判断难度是多少等级。
+        //如果是简单就不变
+        //如果是普通 就乘以0.9
+        //如果是困难就乘以0.8
         this.send(a);
       }
     },
@@ -1595,12 +1606,14 @@ export default {
         this.timeShow = this.formatterTimeFun(this.gameTimeReserve);
         this.gameTimeReserve--;
         if (this.gameTimeReserve == 0) {
-          clearInterval(this.gameTimeTimer);
+          clearInterval(that.gameTimeTimer);
+
           //当倒计时为0
           //按钮状态改为结束
           this.gameTimeTimerFlag = false;
           this.buttonFlag = "开始";
-          this.startTest("false");
+          // this.startTest("false");
+          this.sendStart("false");
           if (this.equipment == 1) {
             //当倒计时完成的时候需要
             //对数据进行保存//保存完成可以清空数据
@@ -1614,7 +1627,6 @@ export default {
             //调用保存数据的方法
             that.saveAnimation();
           }
-          this.resetData();
         }
       }, 1000);
     },
@@ -1749,8 +1761,6 @@ export default {
         }
 
         //改变按钮状态
-        this.clearDataFun();
-        this.resetData();
       }
     },
     //方法返回指标数据
@@ -1911,7 +1921,8 @@ export default {
         };
       }
 
-      console.log(params);
+      console.log(JSON.stringify(params));
+      debugger;
 
       that.$http.post(
         `/v1/game/record/save`,
@@ -1919,6 +1930,8 @@ export default {
           ...params,
         },
         (res) => {
+          that.clearDataFun();
+          that.resetData();
           if (res.data.code == 200) {
             this.$message.success("记录保存成功");
             // this.$message.success("保存成功");
@@ -1935,9 +1948,11 @@ export default {
     getSize() {
       let that = this;
       // this.changeSize(100, 100);
-      that.visibleFlag = false;
+      // that.visibleFlag = false;
+      that.widthIframe = 100;
+      that.heightIframe = 100;
       setTimeout(() => {
-        that.visibleFlag = true;
+        // that.visibleFlag = true;
         let width = that.$refs.animationFlow.clientWidth;
         let height = that.$refs.animationFlow.clientHeight - 40;
         that.widthIframe = width;
@@ -1971,8 +1986,8 @@ export default {
       // this.clearDataFun();
       switch (val) {
         case 1:
-          // this.urlThreeP = "../../../static/loong_3/index.html";
-          this.urlThreeP = __static + "/loong_3/index.html";
+          // this.urlThreeP = "../../../static/loong_4/index.html";
+          this.urlThreeP = __static + "/loong_4/index.html";
           this.delayTime();
           break;
         case 2:
@@ -2001,8 +2016,8 @@ export default {
           this.delayTime();
           break;
         default:
-          // this.urlThreeP = "../../../static/loong_3/index.html";
-          this.urlThreeP = __static + "/loong_3/index.html";
+          // this.urlThreeP = "../../../static/loong_4/index.html";
+          this.urlThreeP = __static + "/loong_4/index.html";
       }
       this.gameScene = val;
       this.flag = this.gameScene;

+ 41 - 21
src/renderer/components/AnimationDouble.vue

@@ -82,11 +82,11 @@
             v-show="equipment == '2' && pulseTimeNum < 180 && pulseTimeNum > 0"
             >还剩{{ timeShow }}开始</span
           > -->
-          <!-- <span
+          <span
             style="font-size: 12px"
             v-show="buttonFlag == '结束' && gameTimeTimerFlag"
             >{{ timeShow }}</span
-          > -->
+          >
           <div class="animation-middle-m">&nbsp;</div>
           <el-button
             @click="startTest"
@@ -545,8 +545,8 @@ export default {
       focusNao: [],
       // 全量
       focusNaoAll: [],
-      // urlThreeP: "../../../static/tianping/index.html",
-      urlThreeP: __static + "/tianping/index.html",
+      // urlThreeP: "../../../static/tianping1/index.html",
+      urlThreeP: __static + "/tianping1/index.html",
       pubsrc: __static,
       userLink: {
         num: "",
@@ -974,21 +974,38 @@ export default {
 
     //双人向传输数据
     sendAtten() {
+      //如果是简单不变
+      //如果是普通就乘以0.9
+      //如果是困难就乘以0.8
+
+      let a=null;
+      let b=null;
+      if(this.gameDifficulty==1){
+        a=parseFloat(this.attentionAnimation / 100);
+        b=parseFloat(this.attentionSecondAnimation / 100);
+      }else if(this.gameDifficulty==2){
+        a=parseFloat(this.attentionAnimation / 100)*0.9
+        b=parseFloat(this.attentionSecondAnimation / 100)*0.9;
+      }else if(this.gameDifficulty==3){
+        a=parseFloat(this.attentionAnimation / 100)*0.8
+        b=parseFloat(this.attentionSecondAnimation / 100)*0.8;
+      }
+
       let one =
-        parseFloat(this.attentionAnimation / 100) +
+       a +
         "," +
-        parseFloat(this.attentionSecondAnimation / 100);
+        b;
       // console.log(one);
       //当按钮状态是结束时
       if (this.buttonFlag == "结束") {
         this.send(one);
-        let left=`Player1,${this.userLink.num}, ${parseFloat(this.attentionAnimation / 100)},${this.userLink.mac}`;
-        let right =`Player2,${this.userTwoLink.num},${parseFloat(this.attentionSecondAnimation / 100)},${this.userTwoLink.mac}`
-        this.sendTarget();
+        let left = `Player1,${this.userLink.num}, ${a},${this.userLink.mac}`;
+        let right = `Player2,${this.userTwoLink.num},${b},${this.userTwoLink.mac}`;
+        this.sendTarget(left,right);
       }
     },
-    sendTarget(valLeft,valRight){
-      this.$refs.unityIframe.contentWindow.towPersion(valLeft,valRight);
+    sendTarget(valLeft, valRight) {
+      this.$refs.unityIframe.contentWindow.towPersion(valLeft, valRight);
     },
     //如果为0的话不显示
     rssiFormatter(val) {
@@ -2083,6 +2100,7 @@ export default {
       this.attentionAnimation = 0;
       //脑电--第二个人的测试数据
       this.attentionSecondAnimation = 0;
+
       this.userLink = {
         num: "",
         mac: "",
@@ -2294,16 +2312,16 @@ export default {
             // 保存脑电数据
             //参数进行保存
             //调用保存数据的方法
-            that.saveAnimation(params);
+            that.saveAnimation();
           }
           if (this.equipment == 2) {
             // 保存心电数据
             //参数进行保存
 
             //调用保存数据的方法
-            that.saveAnimation(params);
+            that.saveAnimation();
           }
-          this.resetData();
+          // this.resetData();
         }
       }, 1000);
     },
@@ -2378,6 +2396,8 @@ export default {
           ...params,
         },
         (res) => {
+          that.clearDataFun();
+          that.resetData();
           if (res.data.code == 200) {
             this.$message.success("记录保存成功");
             // this.$message.success("保存成功");
@@ -2649,8 +2669,6 @@ export default {
           this.saveAnimation();
         }
         //改变按钮状态
-        this.clearDataFun();
-        this.resetData();
       }
     },
     //清除第一个图表
@@ -2761,9 +2779,11 @@ export default {
     setUrl() {},
     getSize() {
       let that = this;
-      that.visibleFlag = false;
+      // that.visibleFlag = false;
+      that.widthIframe = 100;
+      that.heightIframe = 100;
       setTimeout(() => {
-        that.visibleFlag = true;
+        // that.visibleFlag = true;
         let width = this.$refs.animationFlow.clientWidth;
         let height = this.$refs.animationFlow.clientHeight - 40;
         that.widthIframe = width;
@@ -2791,8 +2811,8 @@ export default {
       // this.clearDataFun();
       switch (val) {
         case 1:
-          this.urlThreeP = __static + "/tianping/index.html";
-          // this.urlThreeP = "../../../static/tianping/index.html";
+          this.urlThreeP = __static + "/tianping1/index.html";
+          // this.urlThreeP = "../../../static/tianping1/index.html";
           this.delayTime();
           break;
         case 2:
@@ -2822,7 +2842,7 @@ export default {
           break;
         default:
           // this.urlThreeP = this.pubSrc + "/candle/index.html";
-          this.urlThreeP = __static + "/tianping/index.html";
+          this.urlThreeP = __static + "/tianping1/index.html";
       }
       this.gameScene = val;
       this.flag = this.gameScene;

+ 2 - 2
src/renderer/components/TopPage.vue

@@ -107,9 +107,9 @@
             本计算机程序受著作权法和国际公约的保护,未经授权擅自复制或传播本程序的部分或全部,
             可能受到严厉的民事及刑事制裁,并将在法律许可的范围内受到最大可能的起诉.
           </p>
-          <p><span>Version:</span> 1.3.3</p>
+          <p><span>Version:</span> 1.3.4</p>
           <p><span>Build:</span>#900ae1a50e</p>
-          <p><span>Build on:</span>2024/04/19</p>
+          <p><span>Build on:</span>2024/05/08</p>
           <p><span>Windows:</span>{{ windowsVersion }}</p>
         </el-col>
       </el-row>

+ 29 - 9
src/renderer/components/treatDepression.vue

@@ -792,6 +792,22 @@ export default {
                     "您的睡眠质量非常差,这可能对您的健康和日间功能造成了严重影响。我强烈建议您立即开始改善睡眠,包括调整作息时间、减少压力等。我会全力支持您,与您一起克服睡眠障碍,恢复良好的睡眠质量";
                 }
               }
+              if (that.interveneId == 4) {
+                let str = sessionStorage.getItem("testResultsScore");
+                if (str <= 49) {
+                  result.question =
+                    "您的得分在正常范围内,显示您目前的焦虑水平是正常的。请继续保持心态平和,有效管理压力。如有任何焦虑情绪出现,请及时与我沟通,共同守护您的心理健康。";
+                } else if (str >= 50 && str <= 59) {
+                  result.question =
+                    "您可能有轻度焦虑。请放心,我会提供专业的心理支持,帮助您学习应对焦虑的技巧。一起努力,让您的心情更加轻松自在。";
+                } else if (str >= 60 && str <= 69) {
+                  result.question =
+                    "您的焦虑症状已较明显。我建议您接受系统的心理咨询,如放松训练、认知重构等,以减轻焦虑对您生活的影响。我会与您同行,共克时艰。";
+                } else if (str >= 70) {
+                  result.question =
+                    "您可能正面临严重的焦虑症状。我强烈建议您立即寻求专业医疗和心理援助。我会全力支持您,与您一起应对这个挑战,直至您重获内心的安宁。";
+                }
+              }
 
               // result.question = str;
             }
@@ -1300,7 +1316,7 @@ export default {
           } else if (this.interveneId == 3) {
             debugger;
             // let score = Number(testResult[0].newTableContext.result[0].score);
-            let score =Number(testResult[0].tableContext[7].value[0])
+            let score = Number(testResult[0].tableContext[7].value[0]);
             sessionStorage.setItem("testResultsScore", score);
             this.getNext(this.currentId);
             // this.chatContents.push({
@@ -1312,14 +1328,18 @@ export default {
             // });
             // this.getQuestion(44, true);
           } else if (this.interveneId == 4) {
-            this.chatContents.push({
-              from: 1,
-              isScale: false,
-              isType: -1,
-              question: res.data.data.userRecordEntity.testResults,
-              from1: HeadImg,
-            });
-            this.getQuestion(46, true);
+            debugger;
+            let score = Number(testResult[0].tableContext[0].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(46, true);
           }
         }
       });

+ 0 - 0
static/loong_3/Build/Bulid.data → static/loong_4/Build/Bulid.data


+ 0 - 0
static/loong_3/Build/Bulid.framework.js → static/loong_4/Build/Bulid.framework.js


+ 0 - 0
static/loong_3/Build/Bulid.loader.js → static/loong_4/Build/Bulid.loader.js


+ 0 - 0
static/loong_3/Build/Bulid.wasm → static/loong_4/Build/Bulid.wasm


+ 0 - 0
static/loong_3/ServiceWorker.js → static/loong_4/ServiceWorker.js


+ 0 - 0
static/loong_3/TemplateData/favicon.ico → static/loong_4/TemplateData/favicon.ico


+ 0 - 0
static/loong_3/TemplateData/icons/unity-logo-dark.png → static/loong_4/TemplateData/icons/unity-logo-dark.png


+ 0 - 0
static/loong_3/TemplateData/icons/unity-logo-light.png → static/loong_4/TemplateData/icons/unity-logo-light.png


+ 0 - 0
static/loong_3/TemplateData/progress-bar-empty-dark.png → static/loong_4/TemplateData/progress-bar-empty-dark.png


+ 0 - 0
static/loong_3/TemplateData/progress-bar-empty-light.png → static/loong_4/TemplateData/progress-bar-empty-light.png


+ 0 - 0
static/loong_3/TemplateData/progress-bar-full-dark.png → static/loong_4/TemplateData/progress-bar-full-dark.png


+ 0 - 0
static/loong_3/TemplateData/progress-bar-full-light.png → static/loong_4/TemplateData/progress-bar-full-light.png


+ 0 - 0
static/loong_3/TemplateData/style.css → static/loong_4/TemplateData/style.css


+ 0 - 0
static/loong_3/TemplateData/unity-logo-dark.png → static/loong_4/TemplateData/unity-logo-dark.png


+ 0 - 0
static/loong_3/TemplateData/unity-logo-light.png → static/loong_4/TemplateData/unity-logo-light.png


+ 0 - 0
static/loong_3/index.html → static/loong_4/index.html


+ 0 - 0
static/loong_3/manifest.webmanifest → static/loong_4/manifest.webmanifest


+ 0 - 0
static/tianping/.vscode/settings.json → static/tianping1/.vscode/settings.json


+ 0 - 0
static/tianping/Build/Bulid.data → static/tianping1/Build/Bulid.data


+ 0 - 0
static/tianping/Build/Bulid.framework.js → static/tianping1/Build/Bulid.framework.js


+ 0 - 0
static/tianping/Build/Bulid.loader.js → static/tianping1/Build/Bulid.loader.js


+ 0 - 0
static/tianping/Build/Bulid.wasm → static/tianping1/Build/Bulid.wasm


+ 0 - 0
static/tianping/ServiceWorker.js → static/tianping1/ServiceWorker.js


+ 0 - 0
static/tianping/TemplateData/favicon.ico → static/tianping1/TemplateData/favicon.ico


+ 0 - 0
static/tianping/TemplateData/icons/unity-logo-dark.png → static/tianping1/TemplateData/icons/unity-logo-dark.png


+ 0 - 0
static/tianping/TemplateData/icons/unity-logo-light.png → static/tianping1/TemplateData/icons/unity-logo-light.png


+ 0 - 0
static/tianping/TemplateData/progress-bar-empty-dark.png → static/tianping1/TemplateData/progress-bar-empty-dark.png


+ 0 - 0
static/tianping/TemplateData/progress-bar-empty-light.png → static/tianping1/TemplateData/progress-bar-empty-light.png


+ 0 - 0
static/tianping/TemplateData/progress-bar-full-dark.png → static/tianping1/TemplateData/progress-bar-full-dark.png


+ 0 - 0
static/tianping/TemplateData/progress-bar-full-light.png → static/tianping1/TemplateData/progress-bar-full-light.png


+ 0 - 0
static/tianping/TemplateData/style.css → static/tianping1/TemplateData/style.css


+ 0 - 0
static/tianping/TemplateData/unity-logo-dark.png → static/tianping1/TemplateData/unity-logo-dark.png


+ 0 - 0
static/tianping/TemplateData/unity-logo-light.png → static/tianping1/TemplateData/unity-logo-light.png


+ 0 - 0
static/tianping/index.html → static/tianping1/index.html


+ 0 - 0
static/tianping/manifest.webmanifest → static/tianping1/manifest.webmanifest