Browse Source

修改生物反馈保存记录仅前台修改

plg 1 year ago
parent
commit
b717871c01

+ 9 - 6
src/renderer/componentSub/TestResults/Record.vue

@@ -27,7 +27,7 @@
                   v-if="testResultData && testResultData.userRecordEntity"
                 >
                   <span class="first-floor-name-txt"
-                    >测试者:{{ testResultData.userRecordEntity.phone }}</span
+                    >测试者:{{ testResultData.userInfo.userName }}</span
                   >
                   <span>/{{ testResultData.userRecordEntity.testDate }}</span>
                 </div>
@@ -35,7 +35,7 @@
                   class="first-floor-scale-title"
                   v-if="testResultData && testResultData.userRecordEntity"
                 >
-                  量表名称:{{ testResultData.userRecordEntity.name }}
+                  量表名称:{{ testResultData.subject.name }}
                 </div>
                 <div class="first-floor-desc">
                   <div class="first-floor-desc-title">报告阅读说明</div>
@@ -523,7 +523,7 @@ export default {
       let testPlanId = this.$route.query.testPlanId || "";
       let comes = this.$route.query.come || ""; //1-来自量表测试,2-来自测试记录列表页,3-来自管理端量表测试报告,4-来自管理端测试报告进入的量表报告
 
-      this.$router.go(-1)
+      this.$router.go(-1);
     },
     drawLine() {
       this.$nextTick(() => {
@@ -658,13 +658,16 @@ export default {
       // if (this.tableName == "画钟测试") {
       //   window.open(`${baseUrl}result/download/CDTImg?id=${this.id}`, "_blank");
       // }
-      window.open(`${baseUrl}result/download/testResult?id=${this.id}`, "_blank");
+      window.location.href = `http://localhost:8088/result/download/testResult?id=${this.id}`;
+      // window.open(`http://localhost:8088/result/download/testResult?id=${this.id}`, "_blank");
     },
     downloadReport() {
-      window.open(`${baseUrl}result/download/testResultPdf?id=${this.id}`, "_blank");
+      window.location.href = `http://localhost:8088/result/download/testResultPdf?id=${this.id}`;
+      // window.open(`http://localhost:8088/result/download/testResultPdf?id=${this.id}`, "_blank");
     },
     downloadPDF() {
-      window.open(`${baseUrl}result/download/testResultPdf?id=${this.id}`, "_blank");
+      window.location.href = `http://localhost:8088/result/download/testResultPdf?id=${this.id}`;
+      // window.open(`http://localhost:8088/result/download/testResultPdf?id=${this.id}`, "_blank");
     },
   },
 };

+ 98 - 96
src/renderer/components/AnimationDes.vue

@@ -476,6 +476,7 @@ export default {
 
       //心电刷新频率控制器
       ecgTimeFlag: null,
+      filePath:''
     };
   },
   mounted() {
@@ -518,7 +519,7 @@ export default {
       that.getSize();
     }, 0);
     setTimeout(() => {
-      console.log(that.$route.query.gameType)
+      console.log(that.$route.query.gameType);
       that.changeGame(parseInt(that.$route.query.gameType));
     }, 0);
     that.singleFlag = that.$route.query.single;
@@ -606,7 +607,7 @@ export default {
           },
         ];
         //当选项选选择的是心电//切按钮状态不为开始时
-        if (this.equipment == 2 && this.buttonFlag !== "开始") {
+        if (this.equipment == 2 && this.buttonFlag == "结束") {
           this.userLink.targetList.push(0);
         }
       } else {
@@ -626,7 +627,7 @@ export default {
           // },
 
           let a = data1.rmssd.toFixed(2);
-          if (this.equipment == 2 && this.buttonFlag !== "开始") {
+          if (this.equipment == 2 && this.buttonFlag == "结束") {
             this.userLink.targetList.push(a);
           }
 
@@ -656,7 +657,7 @@ export default {
           ];
         } else {
           this.attentionAnimation = 0;
-          if (this.equipment == 2 && this.buttonFlag !== "开始") {
+          if (this.equipment == 2 && this.buttonFlag == "结束") {
             this.userLink.targetList.push(0);
           }
         }
@@ -1588,51 +1589,13 @@ export default {
             //对数据进行保存//保存完成可以清空数据
 
             //需要获取当前的设备//难度//游戏时间//游戏特定指标//以及用户编号
-            let params = {
-              type: "1", //1表示是单人模式    2代表是双人模式
-              num: [{ num: sessionStorage.getItem("num") }], //个人编号
-              gameScene: that.getGameSence(that.$route.query.gameType), //游戏场景
-              equipmentType: "脑电", //设备类型
-              gameDifficulty: that.getGameDiff(that.gameDifficulty), //游戏难度
-              gameTime: that.formatterGameTime(that.gameTime), //游戏时间
-              targetType: that.formatterTargetType(that.gameTargetObj), //选择的指标
-              //原始数据--但是不包括 原始信号--因为原始信号比较大,导致数据库储存查询慢
-              animationSourceList: JSON.stringify(that.dataHistory()),
-              //指标数据--指的是选择指标的数据
-              //指标数据--  //判断当前选中过的是哪个指标,并进行指标保存
-              //在原始数据中其实已经保存了--在这里其实没必要保存了
-              //指标类型
-              targetType: that.formatterTargetType(that.gameTargetObj),
-              animationTarget: "", //指标数据
-              //文件名称表示--该文件中出储存的原始脑电原始数据
-              fileNameOne: that.dataFilename(),
-
-              saveTime: that.getCurrentTimeFun(), //保存数据的时间
-            };
+
             //调用保存数据的方法
-            that.saveAnimation(params);
+            that.saveAnimation();
           }
           if (this.equipment == 2) {
-            let params = {
-              type: "1", //1表示是单人模式    2代表是双人模式
-              num: [{ num: sessionStorage.getItem("num") }], //个人编号
-              gameScene: that.getGameSence(that.$route.query.gameType), //游戏场景
-              equipmentType: "心电", //设备类型
-              gameDifficulty: that.getGameDiff(that.gameDifficulty), //游戏难度
-              gameTime: that.formatterGameTime(that.gameTime), //游戏时间
-
-              animationSourceList: "", //原始数据
-              targetType: that.formatterTargetType(that.gameTargetObj),
-              //数据传空就行了,因为原始数据已经储存到文件中去了
-
-              fileNameOne: that.dataFilename(),
-              //指标数据进行数据保存。
-              animationTarget: this.userLink.targetList, //指标数据
-
-              saveTime: that.getCurrentTimeFun(), //保存数据的时间
-            };
             //调用保存数据的方法
-            that.saveAnimation(params);
+            that.saveAnimation();
           }
           this.resetData();
         }
@@ -1759,61 +1722,13 @@ export default {
         //调用 保存方法
         //主动点击结束的方法
         if (this.equipment == 1) {
-          //当倒计时完成的时候需要
-          //对数据进行保存//保存完成可以清空数据
-
-          //需要获取当前的设备//难度//游戏时间//游戏特定指标//以及用户编号
-          let params = {
-            type: "1", //1表示是单人模式    2代表是双人模式
-            num: [{ num: sessionStorage.getItem("num") }], //个人编号
-            gameScene: that.getGameSence(that.$route.query.gameType), //游戏场景
-            equipmentType: "脑电", //设备类型
-            gameDifficulty: that.getGameDiff(that.gameDifficulty), //游戏难度
-            gameTime: this.attentionData.length, //游戏时间
-            //指标类型
-            //targetType: that.formatterTargetType(that.gameTargetObj),
-
-            animationSourceList: JSON.stringify(that.dataHistory()),
-            //指标数据--指的是选择指标的数据
-            //指标数据--  //判断当前选中过的是哪个指标,并进行指标保存
-            //在原始数据中其实已经保存了--在这里其实没必要保存了
-            //指标类型
-            targetType: that.formatterTargetType(that.gameTargetObj),
-            animationTarget: "", //指标数据
-            //文件名称表示--该文件中出储存的原始脑电原始数据
-            fileNameOne: that.dataFilename(),
-            // animationSourceList: that.animationSourceList, //原始数据
-            // fileName: "-",
-            // animationTarget: "", //指标数据
-            saveTime: that.getCurrentTimeFun(), //保存数据的时间
-          };
           //调用保存数据的方法
-          that.saveAnimation(params);
+          that.saveAnimation();
         }
         if (this.equipment == 2) {
           //获取心电数据
-          let params = {
-            type: "1", //1表示是单人模式    2代表是双人模式
-            num: [{ num: sessionStorage.getItem("num") }], //个人编号
-            gameScene: that.getGameSence(that.$route.query.gameType), //游戏场景
-            equipmentType: "心电", //设备类型
-            gameDifficulty: that.getGameDiff(that.gameDifficulty), //游戏难度
-            gameTime: Math.floor(that.userLink.ecgAllList.length / 100), //游戏时间
-
-            animationSourceList: "", //原始数据
-            targetType: that.formatterTargetType(that.gameTargetObj),
-            //数据传空就行了,因为原始数据已经储存到文件中去了
-
-            fileNameOne: that.dataFilename(),
-            //指标数据进行数据保存。
-            animationTarget: this.userLink.targetList, //指标数据
-            // animationSourceList: that.animationSourceList, //原始数据
-            // fileName: "-",
-            // animationTarget: "", //指标数据
-            saveTime: that.getCurrentTimeFun(), //保存数据的时间
-          };
           //调用保存数据的方法
-          that.saveAnimation(params);
+          that.saveAnimation();
         }
 
         //改变按钮状态
@@ -1839,6 +1754,29 @@ export default {
       };
       return pa;
     },
+    dataTarget() {
+      let para = null;
+      //判断当前是脑电还是心电
+      //是脑电的情况下
+
+      if (this.equipment == 1) {
+        //需要判断是选择的注意力指标
+        //还是放松度指标
+        //gameTarget
+        //专注度
+        if (this.gameTarget == 1) {
+          para = this.attentionDataAll;
+          return para;
+        }
+        if (this.gameTarget == 2) {
+          para = this.meditationDataAll;
+          return para;
+        }
+      } else {
+        para = this.userLink.targetList;
+        return para;
+      }
+    },
     formatterTargetType(val) {
       if (val == 1) {
         return "专注度";
@@ -1891,7 +1829,71 @@ export default {
       this.focusNao = [];
     },
     //保存游戏数据
-    saveAnimation(params) {
+    saveAnimation() {
+      let that = this;
+      let params = {};
+      //判断是脑电还是心电
+      if (this.equipment == 1) {
+        params = {
+          type: "1", //1表示是单人模式    2代表是双人模式
+          gameScene: that.getGameSence(that.$route.query.gameType), //游戏场景
+          equipmentType: "脑电", //设备类型
+          gameDifficulty: that.getGameDiff(that.gameDifficulty), //游戏难度
+          gameTime: that.formatterGameTime(that.gameTime), //游戏时间
+          targetType: that.formatterTargetType(that.gameTargetObj), //选择的指标
+          //个人编号
+          num1: sessionStorage.getItem("num"), //个人编号
+          num2: "", //第二个人的编号
+          //原始数据--但是不包括 原始信号--因为原始信号比较大,导致数据库储存查询慢
+          //第一个人的原始数据
+          animationSourceList1: JSON.stringify(that.dataHistory()),
+          //第二个人的原始数据
+          animationSourceList2: "",
+          //指标数据--指的是选择指标的数据
+          //指标数据--  //判断当前选中过的是哪个指标,并进行指标保存
+          //在原始数据中其实已经保存了--在这里其实没必要保存了
+          //指标类型
+          //指标显示的数据1
+          animationTarget1: that.dataTarget(), //指标数据
+          //显示指标数据2
+          animationTarget2: "", //指标数据
+
+          //文件名称表示--该文件中出储存的原始脑电原始数据
+          fileName1: that.dataFilename(),
+          fileName2: "",
+
+          saveTime: that.getCurrentTimeFun(), //保存数据的时间
+        };
+      } else {
+        params = {
+          type: "1", //1表示是单人模式    2代表是双人模式
+          gameScene: that.getGameSence(that.$route.query.gameType), //游戏场景
+          equipmentType: "心电", //设备类型
+          gameDifficulty: that.getGameDiff(that.gameDifficulty), //游戏难度
+          gameTime: that.formatterGameTime(that.gameTime), //游戏时间
+          //指标类型
+          targetType: that.formatterTargetType(that.gameTargetObj),
+          //第一个人用户编号
+          num1: sessionStorage.getItem("num"), //个人编号
+          //第二个人用户编号
+          num2: "",
+          //心电的话原始数据都在文件里进行存取
+          animationSourceList1: "", //原始数据
+          animationSourceList2: "", //原始数据
+
+          //数据传空就行了,因为原始数据已经储存到文件中去了
+
+          fileName1: that.dataFilename(),
+
+          fileName2: "",
+          //指标数据进行数据保存。
+          animationTarget1: that.dataTarget(), //指标数据
+          animationTarget2: "", //指标数据
+
+          saveTime: that.getCurrentTimeFun(), //保存数据的时间
+        };
+      }
+
       console.log(params);
       console.log("游戏和数据保存");
     },

+ 338 - 40
src/renderer/components/AnimationDouble.vue

@@ -359,6 +359,8 @@ const fs = require("fs");
 const { ipcRenderer } = require("electron");
 const RingBuffer = require("ringbufferjs");
 // import  RingBuffer from 'ringbufferjs'
+var os = require("os");
+var userInfo = os.userInfo();
 export default {
   data() {
     return {
@@ -553,6 +555,7 @@ export default {
         ecgAllList: [], //心电数据部分
         ecgSectionList: [], //心电数据全部
         //开始脑电各个部分的数据
+        targetList: [],
       },
       userTwoLink: {
         num: "",
@@ -561,6 +564,7 @@ export default {
         ecgAllList: [], //心电数据部分
         ecgSectionList: [], //心电数据全部
         //开始脑电各个部分的数据
+        targetList: [],
       },
       //用户2的脑电变量//脑电变量
       waveDataSecond: [],
@@ -670,6 +674,7 @@ export default {
       //心电刷新频率控制器
       ecgTimeFlag: null,
       visibleFlag: true,
+      filePath: "",
     };
   },
   mounted() {
@@ -759,6 +764,16 @@ export default {
       ];
       this.gameTarget = 1;
     }
+    let url = userInfo.homedir;
+    let downloadsUrl = url.replace(/\\/g, "/");
+
+    this.filePath = downloadsUrl + "/rzgy";
+    fs.exists(that.filePath, function (exists) {
+      // var that = this;
+      if (!exists) {
+        fs.mkdirSync(that.filePath);
+      }
+    });
   },
   beforeDestroy() {
     clearTimeout(this.attentionTime);
@@ -781,8 +796,6 @@ export default {
   methods: {
     initHRV(event, arg) {
       let that = this;
-      console.log("INITHRV");
-      console.log(arg);
       let data1 = "";
       //判断arg是否为空
       if (arg === "") {
@@ -803,13 +816,20 @@ export default {
             section: "1.5~2.0",
           },
         ];
+        //当选项选选择的是心电//切按钮状态不为开始时
+        if (this.equipment == 2 && this.buttonFlag == "结束") {
+          this.userLink.targetList.push(0);
+        }
       } else {
         data1 = arg.data1;
         //判断返回值是否包含rmssd对象
         // data1.hasOwnProperty('rmssd')
-        console.log(data1.hasOwnProperty("rmssd"));
+
         if (data1.hasOwnProperty("rmssd")) {
           let a = data1.rmssd.toFixed(2);
+          if (this.equipment == 2 && this.buttonFlag == "结束") {
+            this.userLink.targetList.push(a);
+          }
           let b = (a - 15) * 4;
           if (b < 0) {
             b = 0;
@@ -836,13 +856,15 @@ export default {
           ];
         } else {
           this.attentionAnimation = 0;
+          if (this.equipment == 2 && this.buttonFlag == "结束") {
+            this.userLink.targetList.push(0);
+          }
         }
       }
     },
     initTwoHRV(event, arg) {
       let that = this;
-      console.log("INITHRV");
-      console.log(arg);
+
       let data1 = "";
       //判断arg是否为空
       if (arg === "") {
@@ -863,13 +885,18 @@ export default {
             section: "1.5~2.0",
           },
         ];
+        if (this.equipment == 2 && this.buttonFlag == "结束") {
+          this.userTwoLink.targetList.push(0);
+        }
       } else {
         data1 = arg.data1;
         //判断返回值是否包含rmssd对象
         // data1.hasOwnProperty('rmssd')
-        console.log(data1.hasOwnProperty("rmssd"));
         if (data1.hasOwnProperty("rmssd")) {
           let a = data1.rmssd.toFixed(2);
+          if (this.equipment == 2 && this.buttonFlag == "结束") {
+            this.userTwoLink.targetList.push(a);
+          }
           let b = (a - 15) * 4;
           if (b < 0) {
             b = 0;
@@ -896,6 +923,9 @@ export default {
           ];
         } else {
           this.attentionSecondAnimation = 0;
+          if (this.equipment == 2 && this.buttonFlag == "结束") {
+            this.userTwoLink.targetList.push(0);
+          }
         }
       }
     },
@@ -933,7 +963,7 @@ export default {
         ipcRenderer.send("asynchronoushrv-filter_two_ecg", cc);
       }
     },
- 
+
     //双人向传输数据
     sendAtten() {
       let one =
@@ -1970,7 +2000,7 @@ export default {
       this.pulseTimeNum = 180;
       //3.重置开始的按钮
       this.buttonFlag = "开始";
-      this.sendStart('false')
+      this.sendStart("false");
       this.gameTimeTimerFlag = false;
       //4.重置数据
       this.resetData();
@@ -1979,7 +2009,7 @@ export default {
     resetData() {
       // this.send(0);
       this.buttonFlag = "开始";
-      this.sendStart('false')
+      this.sendStart("false");
       if (this.gameTime == 1) {
         this.gameTimeReserve = 180;
         this.timeShow = "03:00";
@@ -2110,10 +2140,10 @@ export default {
       let gameName = "";
       switch (val) {
         case "1":
-          gameName = "心灵之火";
+          gameName = "天平倾斜";
           break;
         case "2":
-          gameName = "心之花";
+          gameName = "双人奔跑";
           break;
         case "3":
           gameName = "急速赛车";
@@ -2217,40 +2247,17 @@ export default {
           //按钮状态改为结束
           this.gameTimeTimerFlag = false;
           this.buttonFlag = "开始";
-          this.sendStart('false')
+          this.sendStart("false");
           if (this.equipment == 1) {
             // 保存脑电数据
             //参数进行保存
-            let params = {
-              type: "2", //1表示是单人模式    2代表是双人模式
-              num: [{ num: that.userLink.num }, { num: that.userTwoLink.num }], //个人编号
-              gameScene: that.getGameSence(that.$route.query.gameType), //游戏场景
-              equipmentType: "脑电", //设备类型
-              gameDifficulty: that.getGameDiff(that.gameDifficulty), //游戏难度
-              gameTime: that.formatterGameTime(that.gameTime), //游戏时间
-              // animationSourceList: that.animationSourceList, //原始数据
-              // fileName: "-",
-              // animationTarget: "", //指标数据
-              saveTime: that.getCurrentTimeFun(), //保存数据的时间
-            };
             //调用保存数据的方法
             that.saveAnimation(params);
           }
           if (this.equipment == 2) {
             // 保存心电数据
             //参数进行保存
-            let params = {
-              type: "2", //1表示是单人模式    2代表是双人模式
-              num: [{ num: that.userLink.num }, { num: that.userTwoLink.num }], //个人编号
-              gameScene: that.getGameSence(that.$route.query.gameType), //游戏场景
-              equipmentType: "心电", //设备类型
-              gameDifficulty: that.getGameDiff(that.gameDifficulty), //游戏难度
-              gameTime: that.formatterGameTime(that.gameTime), //游戏时间
-              // animationSourceList: that.animationSourceList, //原始数据
-              // fileName: "-",
-              // animationTarget: "", //指标数据
-              saveTime: that.getCurrentTimeFun(), //保存数据的时间
-            };
+
             //调用保存数据的方法
             that.saveAnimation(params);
           }
@@ -2259,10 +2266,292 @@ export default {
       }, 1000);
     },
     //保存游戏数据
-    saveAnimation(params) {
+    saveAnimation() {
+      let that = this;
+      let params = {};
+      //判断是脑电还是心电
+      if (this.equipment == 1) {
+        params = {
+          type: "1", //1表示是单人模式    2代表是双人模式
+          gameScene: that.getGameSence(that.$route.query.gameType), //游戏场景
+          equipmentType: "脑电", //设备类型
+          gameDifficulty: that.getGameDiff(that.gameDifficulty), //游戏难度
+          gameTime: that.formatterGameTime(that.gameTime), //游戏时间
+          targetType: that.formatterTargetType(that.gameTargetObj), //选择的指标
+          //个人编号
+          num1: that.userLink.num, //个人编号
+          num2: that.userTwoLink.num, //第二个人的编号
+          //原始数据--但是不包括 原始信号--因为原始信号比较大,导致数据库储存查询慢
+          //第一个人的原始数据
+          animationSourceList1: JSON.stringify(that.dataHistory1()),
+          //第二个人的原始数据
+          animationSourceList2: JSON.stringify(that.dataHistory2()),
+          //指标数据--指的是选择指标的数据
+          //指标数据--  //判断当前选中过的是哪个指标,并进行指标保存
+          //在原始数据中其实已经保存了--在这里其实没必要保存了
+          //指标类型
+          //指标显示的数据1
+          animationTarget1: that.dataTarget1(), //指标数据
+          //显示指标数据2
+          animationTarget2: that.dataTarget2(), //指标数据
+
+          //文件名称表示--该文件中出储存的原始脑电原始数据
+          fileName1: that.dataFilename1(),
+          fileName2: that.dataFilename2(),
+
+          saveTime: that.getCurrentTimeFun(), //保存数据的时间
+        };
+      } else {
+        params = {
+          type: "1", //1表示是单人模式    2代表是双人模式
+          gameScene: that.getGameSence(that.$route.query.gameType), //游戏场景
+          equipmentType: "心电", //设备类型
+          gameDifficulty: that.getGameDiff(that.gameDifficulty), //游戏难度
+          gameTime: that.formatterGameTime(that.gameTime), //游戏时间
+          //指标类型
+          targetType: that.formatterTargetType(that.gameTargetObj),
+          //个人编号
+          num1: that.userLink.num, //个人编号
+          num2: that.userTwoLink.num, //第二个人的编号
+          //心电的话原始数据都在文件里进行存取
+          animationSourceList1: "", //原始数据
+          animationSourceList2: "", //原始数据
+
+          //数据传空就行了,因为原始数据已经储存到文件中去了
+
+          //指标数据进行数据保存。
+          animationTarget1: that.dataTarget1(), //指标数据
+          animationTarget2: that.dataTarget2(), //指标数据
+
+          fileName1: that.dataFilename1(),
+
+          fileName2: that.dataFilename2(),
+
+          saveTime: that.getCurrentTimeFun(), //保存数据的时间
+        };
+      }
+
       console.log(params);
       console.log("游戏和数据保存");
     },
+    formatterTargetType(val) {
+      if (val == 1) {
+        return "专注度";
+      }
+      if (val == 2) {
+        return "放松度";
+      }
+      if (val == 3) {
+        return "心率变异性";
+      }
+    },
+    formateDate() {
+      let current = new Date();
+      let year = this.formateNewTime(current.getFullYear());
+      let month = this.formateNewTime(current.getMonth() + 1);
+      let day = this.formateNewTime(current.getDate());
+      let hour = this.formateNewTime(current.getHours());
+      let min = this.formateNewTime(current.getMinutes());
+      let ss = this.formateNewTime(current.getSeconds());
+      let mm = this.formateNewMm(current.getMilliseconds());
+      return (
+        year +
+        "年" +
+        month +
+        "月" +
+        day +
+        "日" +
+        hour +
+        "时" +
+        min +
+        "分" +
+        ss +
+        "秒" +
+        mm
+      );
+    },
+    formateNewTime(val) {
+      if (val < 10) {
+        return "0" + val;
+      } else {
+        return val + "";
+      }
+    },
+    formateNewMm(val) {
+      if (val < 10) {
+        return "00" + val;
+      } else if (val < 100) {
+        return "0" + val;
+      } else {
+        return val + "";
+      }
+    },
+    //用户1的指标数据
+    dataTarget1() {
+      let para = null;
+      //判断当前是脑电还是心电
+      //是脑电的情况下
+
+      if (this.equipment == 1) {
+        //需要判断是选择的注意力指标
+        //还是放松度指标
+        //gameTarget
+        //专注度
+        if (this.gameTarget == 1) {
+          para = this.attentionDataAll;
+          return para;
+        }
+        if (this.gameTarget == 2) {
+          para = this.meditationDataAll;
+          return para;
+        }
+      } else {
+        para = this.userLink.targetList;
+        return para;
+      }
+    },
+    //用户2的指标数据
+    dataTarget2() {
+      let para = null;
+      //判断当前是脑电还是心电
+      //是脑电的情况下
+
+      if (this.equipment == 1) {
+        //需要判断是选择的注意力指标
+        //还是放松度指标
+        //gameTarget
+        //专注度
+        if (this.gameTarget == 1) {
+          para = this.attentionDataAllSecond;
+          return para;
+        }
+        if (this.gameTarget == 2) {
+          para = this.meditationDataAllSecond;
+          return para;
+        }
+      } else {
+        para = this.userTwoLink.targetList;
+        return para;
+      }
+    },
+    //判断当前是脑电还是心电
+    dataFilename1() {
+      let that = this;
+      let fileName = "";
+      //当时脑电的情况下
+      let acount = that.userLink.num;
+      if (this.equipment == 1) {
+        let timeStamp = that.formateDate();
+
+        fileName = acount + "-" + timeStamp + "脑电";
+        let test_result_tmp = that.waveDataAll;
+        fs.writeFile(
+          `${that.filePath}/${fileName}.txt`,
+          test_result_tmp,
+          "binary",
+          function (err) {
+            if (err) {
+              that.$message.error("失败");
+            } else {
+            }
+          }
+        );
+        return fileName;
+      } else {
+        //心电
+        let timeStamp = that.formateDate();
+
+        fileName = acount + "-" + timeStamp + "心电";
+        let test_result_tmp = that.userLink.ecgAllList;
+        fs.writeFile(
+          `${that.filePath}/${fileName}.txt`,
+          test_result_tmp,
+          "binary",
+          function (err) {
+            if (err) {
+              that.$message.error("失败");
+            } else {
+            }
+          }
+        );
+        return fileName;
+      }
+    },
+    //判断当前是脑电还是心电
+    dataFilename2() {
+      let that = this;
+      let fileName = "";
+      //当时脑电的情况下
+      let acount = that.userTwoLink.num;
+      if (this.equipment == 1) {
+        let timeStamp = that.formateDate();
+
+        fileName = acount + "-" + timeStamp + "脑电";
+        let test_result_tmp = that.waveDataAllSecond;
+        fs.writeFile(
+          `${that.filePath}/${fileName}.txt`,
+          test_result_tmp,
+          "binary",
+          function (err) {
+            if (err) {
+              that.$message.error("失败");
+            } else {
+            }
+          }
+        );
+        return fileName;
+      } else {
+        //心电
+        let timeStamp = that.formateDate();
+
+        fileName = acount + "-" + timeStamp + "心电";
+        let test_result_tmp = that.userTwoLink.ecgAllList;
+        fs.writeFile(
+          `${that.filePath}/${fileName}.txt`,
+          test_result_tmp,
+          "binary",
+          function (err) {
+            if (err) {
+              that.$message.error("失败");
+            } else {
+            }
+          }
+        );
+        return fileName;
+      }
+    },
+    dataHistory1() {
+      let pa = {
+        deltaDataFlagAll: this.deltaDataFlagAll,
+        thetaDataAll: this.thetaDataAll,
+        lowAlphaDataAll: this.lowAlphaDataAll,
+        highAlphaDataAll: this.highAlphaDataAll,
+        lowBetaDataAll: this.lowBetaDataAll,
+        highBetaDataAll: this.highBetaDataAll,
+        lowGammaDataAll: this.lowGammaDataAll,
+        midGammaDataAll: this.midGammaDataAll,
+        noiseDataAll: this.noiseDataAll,
+        attentionDataAll: this.attentionDataAll,
+        meditationDataAll: this.meditationDataAll,
+      };
+      return pa;
+    },
+    dataHistory2() {
+      let pa = {
+        deltaDataFlagAll: this.deltaDataFlagAllSecond,
+        thetaDataAll: this.thetaDataAllSecond,
+        lowAlphaDataAll: this.lowAlphaDataAllSecond,
+        highAlphaDataAll: this.highAlphaDataAllSecond,
+        lowBetaDataAll: this.lowBetaDataAllSecond,
+        highBetaDataAll: this.highBetaDataAllSecond,
+        lowGammaDataAll: this.lowGammaDataAllSecond,
+        midGammaDataAll: this.midGammaDataAllSecond,
+        noiseDataAll: this.noiseDataAllSecond,
+        attentionDataAll: this.attentionDataAllSecond,
+        meditationDataAll: this.meditationDataAllSecond,
+      };
+      return pa;
+    },
     startTest() {
       //首先先判断是脑电还是脉搏
       if (this.buttonFlag == "开始") {
@@ -2270,7 +2559,7 @@ export default {
           //如果是脑电.则需要判断脑电是否连接
           if (this.userLink.linkStatus && this.userTwoLink.linkStatus) {
             this.buttonFlag = "结束";
-            this.sendStart('true')
+            this.sendStart("true");
             this.clearNaoData();
             this.timeCom();
           } else {
@@ -2289,12 +2578,21 @@ export default {
             this.userTwoLink.ecgAllList = [];
             this.userTwoLink.ecgSectionList = [];
             this.buttonFlag = "结束";
-            this.sendStart('true')
+            this.sendStart("true");
           } else {
             this.$message.warning("请先连接心电设备");
           }
         }
-      } else {
+      } else if (this.buttonFlag == "结束") {
+        if (this.equipment == 1) {
+          //调用保存数据的方法
+          that.saveAnimation();
+        }
+        if (this.equipment == 2) {
+          //获取心电数据
+          //调用保存数据的方法
+          that.saveAnimation();
+        }
         //改变按钮状态
         this.clearDataFun();
         this.resetData();

+ 367 - 55
src/renderer/components/ManageElectrical.vue

@@ -1,66 +1,131 @@
 <template>
   <div class="main_right_height">
     <TopDes :flag="false" topDesFont="生物反馈记录"></TopDes>
-    <!-- <div>
-      <el-row>
-        <el-col :span="1">&nbsp;</el-col>
-        <el-col :span="22">
-          <span class="musicTitle">脑电测试记录</span>
-          <el-divider></el-divider>
-        </el-col>
-        <el-col :span="1">&nbsp;</el-col>
-      </el-row>
-    </div> -->
     <div>
       <el-row>
         <el-col :span="1">&nbsp;</el-col>
-        <el-col :span="6">
-          <div style="margin-top: 15px; margin-bottom: 15px" class="xl_input">
-            <el-input
-              placeholder="请输入用户姓名"
-              v-model="nameSearch"
-              @input="searchEle"
-              prefix-icon="el-icon-search"
+        <el-col :span="20" style="margin-top: 15px">
+          <div style="display: flex" class="xl_input">
+            <el-date-picker
+              v-model="value1"
+              type="daterange"
+              range-separator="至"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+              @change="timeChange"
             >
-              <!-- <el-button
-                slot="append"
-                @click="searchEle"
-                icon="el-icon-search"
-              ></el-button> -->
-            </el-input>
+            </el-date-picker>
+            &nbsp;&nbsp;&nbsp;&nbsp;
+            <el-select
+              @change="queryEle"
+              v-model="type_value"
+              placeholder="请选择类型"
+              class="userClass"
+              :clearable="true"
+            >
+              <el-option
+                v-for="item in options_type"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+            &nbsp;&nbsp;&nbsp;&nbsp;
+            <div class="user_out">
+              <el-input
+                clearable
+                class="userClass"
+                placeholder="请输入用户姓名"
+                v-model="nameSearch"
+                @input="searchEle"
+                prefix-icon="el-icon-search"
+              >
+              </el-input>
+            </div>
+
+            
           </div>
         </el-col>
+        <!-- <el-col :span="6">
+          
+        </el-col> -->
+        <!-- <el-col :span="8">&nbsp;</el-col> -->
+      </el-row>
+      <el-row style="margin-top: 15px">
+        <el-col :span="1">&nbsp;</el-col>
+        <el-col :span="22" style="text-align: left">
+          <!-- <el-button
+            size="small"
+            @click="download(1, 1)"
+            class="xl_down_button"
+            :disabled="multipleSelection.length === 0 && disableFlag"
+          >
+            批量下载(原始数据)</el-button
+          >
+          <el-button
+            size="small"
+            :disabled="tableData.length === 0 && disableFlag"
+            @click="download(1, 2)"
+            class="xl_down_button"
+          >
+            全部下载(原始数据)</el-button
+          > -->
+          <el-button
+            size="small"
+            @click="download(2, 1)"
+            class="xl_down_button"
+            :disabled="multipleSelection.length === 0 && disableFlag"
+          >
+            批量下载</el-button
+          >
+          <el-button
+            size="small"
+            :disabled="tableData.length === 0 && disableFlag"
+            class="xl_down_button"
+            @click="batchDownloadOriginalAll()"
+          >
+            全部下载</el-button
+          >
+        </el-col>
+        <el-col :span="1">&nbsp;</el-col>
       </el-row>
     </div>
-    <div>
+    <div style="margin-top: 16px">
       <el-row>
         <el-col :span="1"> &nbsp;</el-col>
         <el-col :span="22">
           <el-table
             :data="tableData"
+            style="width: 100%"
+            @selection-change="handleSelectionChange"
             :header-cell-style="{
               background: '#66B497',
               color: '#FFFFFF',
               'letter-spacing': '4px',
             }"
             :row-class-name="tableRowClassName"
-          
-            style="width: 100%"
           >
+            <el-table-column type="selection" align="center" width="55">
+            </el-table-column>
             <el-table-column prop="userName" align="center" label="姓名">
             </el-table-column>
+            <el-table-column prop="identifier" align="center" label="编号">
+            </el-table-column>
             <el-table-column
-              prop="identifier"
+              prop="createTime"
               align="center"
-              label="编号"
+              label="测试时间"
+              :formatter="dateForMa"
             ></el-table-column>
+            <!-- <el-table-column prop="profession" label="职业"></el-table-column> -->
             <el-table-column label="操作" align="center">
               <template slot-scope="scope">
                 <el-button
                   class="xl_d_button"
                   size="mini"
-                  @click="handleEdit(scope.$index, scope.row)"
-                  >查看记录</el-button
+                  @click="singleDownload(scope.$index, scope.row)"
+                  >下载</el-button
                 >
               </template>
             </el-table-column>
@@ -75,7 +140,8 @@
         @current-change="handleCurrentChange"
         :current-page="pageNum"
         :page-size="pageSize"
-        layout="total,  prev, pager, next, jumper"
+        :page-sizes="[10, , 50, 100, 200, 300, 400]"
+        layout="total, sizes, prev, pager, next, jumper"
         :total="totolSize"
       >
       </el-pagination>
@@ -83,28 +149,168 @@
   </div>
 </template>
 <script>
+import axios from "axios";
+import jsFileDownload from "js-file-download";
 export default {
   data() {
     return {
       head_style: "#f5f7fa",
+      value1: "",
+      startDate: "",
+      endDate: "",
+      identifier: "",
       pageNum: 1,
       pageSize: 10,
       totolSize: 10,
       nameSearch: "",
       tableData: [],
+      multipleSelection: [],
+      flag: "",
+      disableFlag: true,
+      options_type: [
+        {
+          value: "1",
+          label: "战胜焦虑",
+        },
+        {
+          value: "2",
+          label: "走出抑郁",
+        },
+        {
+          value: "3",
+          label: "远离失眠",
+        },
+        {
+          value: "4",
+          label: "克服应激",
+        },
+      ],
+      type_value: "",
     };
   },
   mounted() {
+    this.flag = this.$route.query.flag;
     this.queryEle();
   },
   methods: {
-    tableRowClassName({ rowIndex }) {
-      if (rowIndex % 2 === 0) {
-        return "warning-row";
-      } else if (rowIndex % 2 === 1) {
-        return "success-row";
+    dateForMa(row) {
+      let date = new Date(row.createTime);
+      let formattedDate = `${date.getFullYear()}-${("0" + (date.getMonth() + 1)).slice(
+        -2
+      )}-${("0" + date.getDate()).slice(-2)} ${("0" + date.getHours()).slice(-2)}:${(
+        "0" + date.getMinutes()
+      ).slice(-2)}:${("0" + date.getSeconds()).slice(-2)}`;
+      return formattedDate;
+    },
+    //返回上一页
+    goBack() {
+      this.$router.go(-1);
+    },
+    //批量下载
+    download(val, value) {
+      //获取数组集合
+      let idArr = [];
+      for (let i = 0; i < this.multipleSelection.length; i++) {
+        idArr.push(this.multipleSelection[i].id);
+      }
+      this.batchDownloadOriginal(val, value, idArr);
+    },
+    //全部下载(原始数据)
+    batchDownloadOriginalAll() {
+      let that = this;
+      let arr = [];
+      //原始数据批量下载路径
+      let path = `chat/chatRecord/AllDownload?identifier=${that.nameSearch}&beginDate=${that.startDate}&endDate=${that.endDate}`;
+      // let path = `record/download`;
+      let baseUrl = sessionStorage.getItem("baseUrl");
+      //window.location.href = `${baseUrl}${path}?ids=${arr}`;
+      let a = arr.join();
+      axios({
+        method: "get",
+        url: `${baseUrl}${path}`,
+        timeout: 600000, // 请求超时时间,数据量多后台响应慢的情况可以调大点,没生效的话可能是vue.config.js里的配置影响了
+        responseType: "blob", // 返回类型为数据流
+        data: {
+          // ids: arr,
+          // flag: that.flag,
+          // startDate: that.startDate,
+          // endDate: that.endDate,
+          // userName: that.nameSearch,
+        }, // 需要传参的话,在这传
+      }).then((res) => {
+        if (res && res.data) {
+          // console.log(decodeURIComponent(res.headers["filename"]))
+          // 调用js-file-download下载文件,第一个参数是数据流,第二个参数是文件名,我这后端返回时把文件名放到响应的header的filename字段中,所以用这种方式取出
+          jsFileDownload(res.data, decodeURIComponent(res.headers["filename"]));
+        }
+      });
+    },
+    //批量下载(原始数据)
+    batchDownloadOriginal(val, value, idArr) {
+      let that = this;
+      let arr = [];
+      //原始数据批量下载路径
+      let path = `v1/record/download/source`;
+      if (val === 2) {
+        path = `chat/chatRecord/batchDownload`;
+      }
+      if ((val === 1 && value === 1) || (val === 2 && value === 1)) {
+        arr = idArr;
+      } else {
+        arr = [];
+      }
+      // let path = `record/download`;
+      let baseUrl = sessionStorage.getItem("baseUrl");
+      //window.location.href = `${baseUrl}${path}?ids=${arr}`;
+      let a = arr.join();
+      axios({
+        method: "get",
+        url: `${baseUrl}${path}?ids=${a}`,
+        timeout: 600000, // 请求超时时间,数据量多后台响应慢的情况可以调大点,没生效的话可能是vue.config.js里的配置影响了
+        responseType: "blob", // 返回类型为数据流
+        data: {
+          ids: arr,
+          flag: that.flag,
+          startDate: that.startDate,
+          endDate: that.endDate,
+          userName: that.nameSearch,
+        }, // 需要传参的话,在这传
+      }).then((res) => {
+        if (res && res.data) {
+          // console.log(decodeURIComponent(res.headers["filename"]))
+          // 调用js-file-download下载文件,第一个参数是数据流,第二个参数是文件名,我这后端返回时把文件名放到响应的header的filename字段中,所以用这种方式取出
+          jsFileDownload(res.data, decodeURIComponent(res.headers["filename"]));
+        }
+      });
+    },
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+    },
+    timeChange(val) {
+      if (val === null) {
+        this.startDate = "";
+        this.endDate = "";
+      } else {
+        this.startDate = this.fomatterDate(this.value1[0]);
+        this.endDate = this.fomatterDate(this.value1[1]);
+      }
+      this.pageNum = 1;
+      this.queryEle();
+    },
+    //格式化时间格式
+    fomatterDate(val) {
+      var date = new Date(val);
+      let year = date.getFullYear();
+      let month = this.fomatterM(date.getMonth() + 1);
+      let currentDay = this.fomatterM(date.getDate());
+      return year + "-" + month + "-" + currentDay;
+    },
+    fomatterM(val) {
+      if (val < 10) {
+        return "0" + val;
+      } else {
+        return val + "";
       }
-      return "success-row";
     },
     searchEle() {
       this.pageNum = 1;
@@ -112,21 +318,20 @@ export default {
     },
     queryEle() {
       let that = this;
-      that.$http.post(
-        `v1/recordPhy/user`,
+      that.$http.get(
+        `/chat/chat/list?identifier=${that.nameSearch}&beginDate=${that.startDate}&endDate=${that.endDate}&pageNum=${that.pageNum}&pageSize=${that.pageSize}`,
         {
-          pageNum: that.pageNum,
-          pageSize: that.pageSize,
-          startDate: "",
-          endDate: "",
-          type: 3,
-          filaName: "",
-          userName: that.nameSearch,
+          // pageNum: that.pageNum,
+          // pageSize: that.pageSize,
+          // flag: that.flag,
+          // startDate: that.startDate,
+          // endDate: that.endDate,
+          // userName: that.nameSearch,
         },
         (res) => {
-          if (res.data.code == 200) {
-            that.tableData = res.data.data.data;
-            that.totolSize = res.data.data.allNum;
+          if (res.code == 200) {
+            that.tableData = res.data.content;
+            that.totolSize = res.data.totalElements;
           } else {
             this.$message.error("访问服务器失败!");
           }
@@ -134,6 +339,7 @@ export default {
       );
     },
     handleSizeChange(val) {
+      this.pageSize = val;
       this.queryEle();
     },
     handleCurrentChange(val) {
@@ -142,13 +348,96 @@ export default {
       // this.pageNum = val;
       // this.queryList();
     },
-    handleEdit(index, row) {
-      this.$router.push({
-        path: "/menu/manageElectricalRecord",
-        query: { identifier: row.identifier },
+    singleDownload(index, row) {
+      let baseUrl = sessionStorage.getItem("baseUrl");
+      let path = `/chat/chatRecord/download?id=${row.id}`;
+      // let arr = [row.id];
+      axios({
+        method: "get",
+        url: `${baseUrl}${path}`,
+        timeout: 600000, // 请求超时时间,数据量多后台响应慢的情况可以调大点,没生效的话可能是vue.config.js里的配置影响了
+        responseType: "blob", // 返回类型为数据流
+        data: {
+          // ids: arr,
+        }, // 需要传参的话,在这传
+      }).then((res) => {
+        if (res && res.data) {
+          console.log(res.headers["filename"]);
+          // console.log(decodeURIComponent(res.headers["filename"]))
+          // 调用js-file-download下载文件,第一个参数是数据流,第二个参数是文件名,我这后端返回时把文件名放到响应的header的filename字段中,所以用这种方式取出
+          jsFileDownload(res.data, decodeURIComponent(res.headers["filename"]));
+        }
       });
     },
+    getAnswerQuestionPaymentSuccess(id) {
+      sessionStorage.setItem("back_page", "3");
+      let _this = this;
+
+      _this.$http.post(`v1/record/find/${id}`, {}, (res) => {
+        if (res.data.code == 200 && res.data.data) {
+          _this.resultJsonParams = res.data.data;
+          // let sleep = JSON.parse(
+          //   _this.resultJsonParams.userRecordEntity.testResult
+          // );
+          // sleep = sleep[0].newTableContext.result[0].improvementSuggestions;
+          // if (_this.scale_flag === "20210910163158") {
+          //   _this.askEnd(sleep);
+          //   this.inputFlag = 0;
+          // }
+          // if (_this.scale_flag === "20220805135201") {
+          //   _this.askEnd(sleep);
+          //   this.inputFlag = 0;
+          // }
+
+          // let testResult = JSON.parse(res.data.userRecordEntity.testResult)[0]
+          //   .version;
+          let testResult = JSON.parse(res.data.data.userRecordEntity.testResult)[0]
+            .version;
+
+          if (testResult == 2) {
+            _this.$router.push({
+              name: "scaleResultSCl",
+              params: { tableData: _this.resultJsonParams },
+            });
+          } else {
+            _this.$router.push({
+              name: "scaleResult",
+              params: { tableData: _this.resultJsonParams },
+            });
+          }
+        }
+      });
+      // _this.$http.get(`/getRecordById?id=${id}`, {}, (res) => {
+      //   if (res.code == 200) {
+      //     _this.resultJsonParams = res.data;
+      //     let testResult = JSON.parse(res.data?.userRecordEntity?.testResult)[0]
+      //       .version;
+
+      //     if (testResult == 2) {
+      //       _this.$router.push({
+      //         name: "scaleResultSCl",
+      //         query: _this.resultJsonParams,
+      //       });
+      //     } else {
+      //       _this.$router.push({
+      //         name: "ScaleResult",
+      //         query: JSON.stringify(_this.resultJsonParams),
+      //       });
+      //     }
+      //   }
+
+      //   console.log("请求数据的list", res);
+      // });
+    },
     handleDelete(index, row) {},
+    tableRowClassName({ rowIndex }) {
+      if (rowIndex % 2 === 0) {
+        return "warning-row";
+      } else if (rowIndex % 2 === 1) {
+        return "success-row";
+      }
+      return "success-row";
+    },
   },
 };
 </script>
@@ -159,5 +448,28 @@ export default {
   overflow-y: auto !important;
   background: #ffffff;
 }
-
-</style>
+.el-input-group {
+  line-height: normal;
+  display: inline-table;
+  width: 200px !important;
+  border-collapse: separate;
+  border-spacing: 0;
+}
+.userClass >>> .el-input__inner {
+  width: 240px !important;
+}
+.user_out >>> .el-input {
+  width: 240px !important;
+}
+.xl_input >>> .el-input__inner {
+  width: 240px;
+  line-height: 64px;
+  background: #f5f5f5;
+  border-radius: 15px 15px 15px 15px !important;
+  opacity: 1;
+  box-sizing: border-box;
+  font-weight: 400;
+  border: none;
+  /* color: #929292; */
+}
+</style>

+ 76 - 27
src/renderer/components/ManagePluse.vue

@@ -34,18 +34,35 @@
             >
             </el-date-picker>
             &nbsp;&nbsp;&nbsp;&nbsp;
-            <el-input
-              placeholder="请输入用户姓名"
-              v-model="nameSearch"
-              @input="searchEle"
-              prefix-icon="el-icon-search"
+            <el-select
+              @change="queryEle"
+              v-model="type_value"
+              placeholder="请选择类型"
+              class="userClass"
+              :clearable="true"
             >
-              <!-- <el-button
-                slot="append"
-                @click="searchEle"
-                icon="el-icon-search"
-              ></el-button> -->
-            </el-input>
+              <el-option
+                v-for="item in options_type"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+            &nbsp;&nbsp;&nbsp;&nbsp;
+            <div class="user_out">
+              <el-input
+                clearable
+                class="userClass"
+                placeholder="请输入用户姓名"
+                v-model="nameSearch"
+                @input="searchEle"
+                prefix-icon="el-icon-search"
+              >
+              </el-input>
+            </div>
+
+            
           </div>
         </el-col>
         <!-- <el-col :span="6">
@@ -120,7 +137,7 @@
               :formatter="dateForMa"
             ></el-table-column>
             <!-- <el-table-column prop="profession" label="职业"></el-table-column> -->
-            <el-table-column label="查看测试记录" align="center">
+            <el-table-column label="操作" align="center">
               <template slot-scope="scope">
                 <el-button
                   class="xl_d_button"
@@ -168,6 +185,25 @@ export default {
       multipleSelection: [],
       flag: "",
       disableFlag: true,
+      options_type: [
+        {
+          value: "1",
+          label: "战胜焦虑",
+        },
+        {
+          value: "2",
+          label: "走出抑郁",
+        },
+        {
+          value: "3",
+          label: "远离失眠",
+        },
+        {
+          value: "4",
+          label: "克服应激",
+        },
+      ],
+      type_value: "",
     };
   },
   mounted() {
@@ -177,14 +213,11 @@ export default {
   methods: {
     dateForMa(row) {
       let date = new Date(row.createTime);
-      let formattedDate = `${date.getFullYear()}-${(
-        "0" +
-        (date.getMonth() + 1)
-      ).slice(-2)}-${("0" + date.getDate()).slice(-2)} ${(
-        "0" + date.getHours()
-      ).slice(-2)}:${("0" + date.getMinutes()).slice(-2)}:${(
-        "0" + date.getSeconds()
-      ).slice(-2)}`;
+      let formattedDate = `${date.getFullYear()}-${("0" + (date.getMonth() + 1)).slice(
+        -2
+      )}-${("0" + date.getDate()).slice(-2)} ${("0" + date.getHours()).slice(-2)}:${(
+        "0" + date.getMinutes()
+      ).slice(-2)}:${("0" + date.getSeconds()).slice(-2)}`;
       return formattedDate;
     },
     //返回上一页
@@ -200,7 +233,7 @@ export default {
       }
       this.batchDownloadOriginal(val, value, idArr);
     },
-     //全部下载(原始数据)
+    //全部下载(原始数据)
     batchDownloadOriginalAll() {
       let that = this;
       let arr = [];
@@ -209,7 +242,7 @@ export default {
       // let path = `record/download`;
       let baseUrl = sessionStorage.getItem("baseUrl");
       //window.location.href = `${baseUrl}${path}?ids=${arr}`;
-      let a =arr.join();
+      let a = arr.join();
       axios({
         method: "get",
         url: `${baseUrl}${path}`,
@@ -247,7 +280,7 @@ export default {
       // let path = `record/download`;
       let baseUrl = sessionStorage.getItem("baseUrl");
       //window.location.href = `${baseUrl}${path}?ids=${arr}`;
-      let a =arr.join();
+      let a = arr.join();
       axios({
         method: "get",
         url: `${baseUrl}${path}?ids=${a}`,
@@ -376,9 +409,8 @@ export default {
 
           // let testResult = JSON.parse(res.data.userRecordEntity.testResult)[0]
           //   .version;
-          let testResult = JSON.parse(
-            res.data.data.userRecordEntity.testResult
-          )[0].version;
+          let testResult = JSON.parse(res.data.data.userRecordEntity.testResult)[0]
+            .version;
 
           if (testResult == 2) {
             _this.$router.push({
@@ -441,4 +473,21 @@ export default {
   border-collapse: separate;
   border-spacing: 0;
 }
-</style>
+.userClass >>> .el-input__inner {
+  width: 240px !important;
+}
+.user_out >>> .el-input {
+  width: 240px !important;
+}
+.xl_input >>> .el-input__inner {
+  width: 240px;
+  line-height: 64px;
+  background: #f5f5f5;
+  border-radius: 15px 15px 15px 15px !important;
+  opacity: 1;
+  box-sizing: border-box;
+  font-weight: 400;
+  border: none;
+  /* color: #929292; */
+}
+</style>

+ 384 - 47
src/renderer/components/ManageUserScale.vue

@@ -1,60 +1,148 @@
 <template>
   <div class="main_right_height">
     <TopDes :flag="false" topDesFont="用户聊天记录"></TopDes>
+    <!-- <div>
+      <el-row>
+        <el-col :span="1">&nbsp;</el-col>
+        <el-col :span="22">
+          <div style="display: flex">
+            <i
+              class="el-icon-arrow-left"
+              style="cursor: pointer; line-height: 1.5"
+              @click="goBack()"
+            ></i>
+            <span class="musicTitle">量表测试记录</span>
+          </div>
+          <el-divider></el-divider>
+        </el-col>
+
+        <el-col :span="1">&nbsp;</el-col>
+      </el-row>
+    </div> -->
     <div>
       <el-row>
         <el-col :span="1">&nbsp;</el-col>
-        <el-col :span="6">
-          <div style="margin-top: 15px; margin-bottom: 15px" class="xl_input">
-            <el-input
-              placeholder="请输入用户姓名"
-              v-model="nameSearch"
-              prefix-icon="el-icon-search"
-              @input="searchEle"
+        <el-col :span="20" style="margin-top: 15px">
+          <div style="display: flex" class="xl_input">
+            <el-date-picker
+              v-model="value1"
+              type="daterange"
+              range-separator="至"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+              @change="timeChange"
+            >
+            </el-date-picker>
+            <!-- &nbsp;&nbsp;&nbsp;&nbsp;
+            <el-select
+              v-model="type_value"
+              placeholder="请选择类型"
+              class="userClass"
+              :clearable="true"
             >
-              <!-- <el-button
-                slot="append"
-                @click="searchEle"
-                icon="el-icon-search"
-              ></el-button> -->
-            </el-input>
+              <el-option
+                v-for="item in options_type"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select> -->
+            &nbsp;&nbsp;&nbsp;&nbsp;
+            <div class="user_out">
+              <el-input
+                clearable
+                class="userClass"
+                placeholder="请输入用户姓名"
+                v-model="nameSearch"
+                @input="searchEle"
+                prefix-icon="el-icon-search"
+              >
+              </el-input>
+            </div>
+
+            
           </div>
         </el-col>
+        <!-- <el-col :span="6">
+          
+        </el-col> -->
+        <!-- <el-col :span="8">&nbsp;</el-col> -->
+      </el-row>
+      <el-row style="margin-top: 15px">
+        <el-col :span="1">&nbsp;</el-col>
+        <el-col :span="22" style="text-align: left">
+          <!-- <el-button
+            size="small"
+            @click="download(1, 1)"
+            class="xl_down_button"
+            :disabled="multipleSelection.length === 0 && disableFlag"
+          >
+            批量下载(原始数据)</el-button
+          >
+          <el-button
+            size="small"
+            :disabled="tableData.length === 0 && disableFlag"
+            @click="download(1, 2)"
+            class="xl_down_button"
+          >
+            全部下载(原始数据)</el-button
+          > -->
+          <el-button
+            size="small"
+            @click="download(2, 1)"
+            class="xl_down_button"
+            :disabled="multipleSelection.length === 0 && disableFlag"
+          >
+            批量下载</el-button
+          >
+          <el-button
+            size="small"
+            :disabled="tableData.length === 0 && disableFlag"
+            class="xl_down_button"
+            @click="batchDownloadOriginalAll()"
+          >
+            全部下载</el-button
+          >
+        </el-col>
+        <el-col :span="1">&nbsp;</el-col>
       </el-row>
     </div>
-    <div>
+    <div style="margin-top: 16px">
       <el-row>
         <el-col :span="1"> &nbsp;</el-col>
         <el-col :span="22">
           <el-table
             :data="tableData"
+            style="width: 100%"
+            @selection-change="handleSelectionChange"
             :header-cell-style="{
               background: '#66B497',
               color: '#FFFFFF',
               'letter-spacing': '4px',
             }"
             :row-class-name="tableRowClassName"
-            style="width: 100%"
           >
+            <el-table-column type="selection" align="center" width="55">
+            </el-table-column>
             <el-table-column prop="userName" align="center" label="姓名">
             </el-table-column>
+            <el-table-column prop="identifier" align="center" label="编号">
+            </el-table-column>
             <el-table-column
-              prop="identifier"
-              align="center"
-              label="编号"
-            ></el-table-column>
-            <el-table-column
-              prop="age"
+              prop="createTime"
               align="center"
-              label="年龄"
+              label="测试时间"
+              :formatter="dateForMa"
             ></el-table-column>
+            <!-- <el-table-column prop="profession" label="职业"></el-table-column> -->
             <el-table-column label="操作" align="center">
               <template slot-scope="scope">
                 <el-button
                   class="xl_d_button"
                   size="mini"
-                  @click="handleEdit(scope.$index, scope.row)"
-                  >查看记录</el-button
+                  @click="singleDownload(scope.$index, scope.row)"
+                  >下载</el-button
                 >
               </template>
             </el-table-column>
@@ -69,7 +157,8 @@
         @current-change="handleCurrentChange"
         :current-page="pageNum"
         :page-size="pageSize"
-        layout="total,  prev, pager, next, jumper"
+        :page-sizes="[10, , 50, 100, 200, 300, 400]"
+        layout="total, sizes, prev, pager, next, jumper"
         :total="totolSize"
       >
       </el-pagination>
@@ -77,28 +166,168 @@
   </div>
 </template>
 <script>
+import axios from "axios";
+import jsFileDownload from "js-file-download";
 export default {
   data() {
     return {
       head_style: "#f5f7fa",
+      value1: "",
+      startDate: "",
+      endDate: "",
+      identifier: "",
       pageNum: 1,
       pageSize: 10,
       totolSize: 10,
       nameSearch: "",
       tableData: [],
+      multipleSelection: [],
+      flag: "",
+      disableFlag: true,
+      options_type: [
+        {
+          value: "1",
+          label: "战胜焦虑",
+        },
+        {
+          value: "2",
+          label: "走出抑郁",
+        },
+        {
+          value: "3",
+          label: "远离失眠",
+        },
+        {
+          value: "4",
+          label: "克服应激",
+        },
+      ],
+      type_value: "",
     };
   },
   mounted() {
+    this.flag = this.$route.query.flag;
     this.queryEle();
   },
   methods: {
-     tableRowClassName({ rowIndex }) {
-      if (rowIndex % 2 === 0) {
-        return "warning-row";
-      } else if (rowIndex % 2 === 1) {
-        return "success-row";
+    dateForMa(row) {
+      let date = new Date(row.createTime);
+      let formattedDate = `${date.getFullYear()}-${("0" + (date.getMonth() + 1)).slice(
+        -2
+      )}-${("0" + date.getDate()).slice(-2)} ${("0" + date.getHours()).slice(-2)}:${(
+        "0" + date.getMinutes()
+      ).slice(-2)}:${("0" + date.getSeconds()).slice(-2)}`;
+      return formattedDate;
+    },
+    //返回上一页
+    goBack() {
+      this.$router.go(-1);
+    },
+    //批量下载
+    download(val, value) {
+      //获取数组集合
+      let idArr = [];
+      for (let i = 0; i < this.multipleSelection.length; i++) {
+        idArr.push(this.multipleSelection[i].id);
+      }
+      this.batchDownloadOriginal(val, value, idArr);
+    },
+    //全部下载(原始数据)
+    batchDownloadOriginalAll() {
+      let that = this;
+      let arr = [];
+      //原始数据批量下载路径
+      let path = `chat/chatRecord/AllDownload?identifier=${that.nameSearch}&beginDate=${that.startDate}&endDate=${that.endDate}`;
+      // let path = `record/download`;
+      let baseUrl = sessionStorage.getItem("baseUrl");
+      //window.location.href = `${baseUrl}${path}?ids=${arr}`;
+      let a = arr.join();
+      axios({
+        method: "get",
+        url: `${baseUrl}${path}`,
+        timeout: 600000, // 请求超时时间,数据量多后台响应慢的情况可以调大点,没生效的话可能是vue.config.js里的配置影响了
+        responseType: "blob", // 返回类型为数据流
+        data: {
+          // ids: arr,
+          // flag: that.flag,
+          // startDate: that.startDate,
+          // endDate: that.endDate,
+          // userName: that.nameSearch,
+        }, // 需要传参的话,在这传
+      }).then((res) => {
+        if (res && res.data) {
+          // console.log(decodeURIComponent(res.headers["filename"]))
+          // 调用js-file-download下载文件,第一个参数是数据流,第二个参数是文件名,我这后端返回时把文件名放到响应的header的filename字段中,所以用这种方式取出
+          jsFileDownload(res.data, decodeURIComponent(res.headers["filename"]));
+        }
+      });
+    },
+    //批量下载(原始数据)
+    batchDownloadOriginal(val, value, idArr) {
+      let that = this;
+      let arr = [];
+      //原始数据批量下载路径
+      let path = `v1/record/download/source`;
+      if (val === 2) {
+        path = `chat/chatRecord/batchDownload`;
+      }
+      if ((val === 1 && value === 1) || (val === 2 && value === 1)) {
+        arr = idArr;
+      } else {
+        arr = [];
+      }
+      // let path = `record/download`;
+      let baseUrl = sessionStorage.getItem("baseUrl");
+      //window.location.href = `${baseUrl}${path}?ids=${arr}`;
+      let a = arr.join();
+      axios({
+        method: "get",
+        url: `${baseUrl}${path}?ids=${a}`,
+        timeout: 600000, // 请求超时时间,数据量多后台响应慢的情况可以调大点,没生效的话可能是vue.config.js里的配置影响了
+        responseType: "blob", // 返回类型为数据流
+        data: {
+          ids: arr,
+          flag: that.flag,
+          startDate: that.startDate,
+          endDate: that.endDate,
+          userName: that.nameSearch,
+        }, // 需要传参的话,在这传
+      }).then((res) => {
+        if (res && res.data) {
+          // console.log(decodeURIComponent(res.headers["filename"]))
+          // 调用js-file-download下载文件,第一个参数是数据流,第二个参数是文件名,我这后端返回时把文件名放到响应的header的filename字段中,所以用这种方式取出
+          jsFileDownload(res.data, decodeURIComponent(res.headers["filename"]));
+        }
+      });
+    },
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+    },
+    timeChange(val) {
+      if (val === null) {
+        this.startDate = "";
+        this.endDate = "";
+      } else {
+        this.startDate = this.fomatterDate(this.value1[0]);
+        this.endDate = this.fomatterDate(this.value1[1]);
+      }
+      this.pageNum = 1;
+      this.queryEle();
+    },
+    //格式化时间格式
+    fomatterDate(val) {
+      var date = new Date(val);
+      let year = date.getFullYear();
+      let month = this.fomatterM(date.getMonth() + 1);
+      let currentDay = this.fomatterM(date.getDate());
+      return year + "-" + month + "-" + currentDay;
+    },
+    fomatterM(val) {
+      if (val < 10) {
+        return "0" + val;
+      } else {
+        return val + "";
       }
-      return "success-row";
     },
     searchEle() {
       this.pageNum = 1;
@@ -106,20 +335,20 @@ export default {
     },
     queryEle() {
       let that = this;
-      that.$http.post(
-        `v1/record/users`,
+      that.$http.get(
+        `/chat/chat/list?identifier=${that.nameSearch}&beginDate=${that.startDate}&endDate=${that.endDate}&pageNum=${that.pageNum}&pageSize=${that.pageSize}`,
         {
-          pageNum: that.pageNum,
-          pageSize: that.pageSize,
-          userName: that.nameSearch,
-          startTime: "",
-          endTime: "",
-          flag: "",
+          // pageNum: that.pageNum,
+          // pageSize: that.pageSize,
+          // flag: that.flag,
+          // startDate: that.startDate,
+          // endDate: that.endDate,
+          // userName: that.nameSearch,
         },
         (res) => {
-          if (res.data.code == 200) {
-            that.tableData = res.data.data.data;
-            that.totolSize = res.data.data.allNum;
+          if (res.code == 200) {
+            that.tableData = res.data.content;
+            that.totolSize = res.data.totalElements;
           } else {
             this.$message.error("访问服务器失败!");
           }
@@ -127,6 +356,7 @@ export default {
       );
     },
     handleSizeChange(val) {
+      this.pageSize = val;
       this.queryEle();
     },
     handleCurrentChange(val) {
@@ -135,13 +365,96 @@ export default {
       // this.pageNum = val;
       // this.queryList();
     },
-    handleEdit(index, row) {
-      this.$router.push({
-        path: "/menu/manageUserScaleRecord",
-        query: { identifier: row.identifier },
+    singleDownload(index, row) {
+      let baseUrl = sessionStorage.getItem("baseUrl");
+      let path = `/chat/chatRecord/download?id=${row.id}`;
+      // let arr = [row.id];
+      axios({
+        method: "get",
+        url: `${baseUrl}${path}`,
+        timeout: 600000, // 请求超时时间,数据量多后台响应慢的情况可以调大点,没生效的话可能是vue.config.js里的配置影响了
+        responseType: "blob", // 返回类型为数据流
+        data: {
+          // ids: arr,
+        }, // 需要传参的话,在这传
+      }).then((res) => {
+        if (res && res.data) {
+          console.log(res.headers["filename"]);
+          // console.log(decodeURIComponent(res.headers["filename"]))
+          // 调用js-file-download下载文件,第一个参数是数据流,第二个参数是文件名,我这后端返回时把文件名放到响应的header的filename字段中,所以用这种方式取出
+          jsFileDownload(res.data, decodeURIComponent(res.headers["filename"]));
+        }
+      });
+    },
+    getAnswerQuestionPaymentSuccess(id) {
+      sessionStorage.setItem("back_page", "3");
+      let _this = this;
+
+      _this.$http.post(`v1/record/find/${id}`, {}, (res) => {
+        if (res.data.code == 200 && res.data.data) {
+          _this.resultJsonParams = res.data.data;
+          // let sleep = JSON.parse(
+          //   _this.resultJsonParams.userRecordEntity.testResult
+          // );
+          // sleep = sleep[0].newTableContext.result[0].improvementSuggestions;
+          // if (_this.scale_flag === "20210910163158") {
+          //   _this.askEnd(sleep);
+          //   this.inputFlag = 0;
+          // }
+          // if (_this.scale_flag === "20220805135201") {
+          //   _this.askEnd(sleep);
+          //   this.inputFlag = 0;
+          // }
+
+          // let testResult = JSON.parse(res.data.userRecordEntity.testResult)[0]
+          //   .version;
+          let testResult = JSON.parse(res.data.data.userRecordEntity.testResult)[0]
+            .version;
+
+          if (testResult == 2) {
+            _this.$router.push({
+              name: "scaleResultSCl",
+              params: { tableData: _this.resultJsonParams },
+            });
+          } else {
+            _this.$router.push({
+              name: "scaleResult",
+              params: { tableData: _this.resultJsonParams },
+            });
+          }
+        }
       });
+      // _this.$http.get(`/getRecordById?id=${id}`, {}, (res) => {
+      //   if (res.code == 200) {
+      //     _this.resultJsonParams = res.data;
+      //     let testResult = JSON.parse(res.data?.userRecordEntity?.testResult)[0]
+      //       .version;
+
+      //     if (testResult == 2) {
+      //       _this.$router.push({
+      //         name: "scaleResultSCl",
+      //         query: _this.resultJsonParams,
+      //       });
+      //     } else {
+      //       _this.$router.push({
+      //         name: "ScaleResult",
+      //         query: JSON.stringify(_this.resultJsonParams),
+      //       });
+      //     }
+      //   }
+
+      //   console.log("请求数据的list", res);
+      // });
     },
     handleDelete(index, row) {},
+    tableRowClassName({ rowIndex }) {
+      if (rowIndex % 2 === 0) {
+        return "warning-row";
+      } else if (rowIndex % 2 === 1) {
+        return "success-row";
+      }
+      return "success-row";
+    },
   },
 };
 </script>
@@ -152,4 +465,28 @@ export default {
   overflow-y: auto !important;
   background: #ffffff;
 }
-</style>
+.el-input-group {
+  line-height: normal;
+  display: inline-table;
+  width: 200px !important;
+  border-collapse: separate;
+  border-spacing: 0;
+}
+.userClass >>> .el-input__inner {
+  width: 240px !important;
+}
+.user_out >>> .el-input {
+  width: 240px !important;
+}
+.xl_input >>> .el-input__inner {
+  width: 240px;
+  line-height: 64px;
+  background: #f5f5f5;
+  border-radius: 15px 15px 15px 15px !important;
+  opacity: 1;
+  box-sizing: border-box;
+  font-weight: 400;
+  border: none;
+  /* color: #929292; */
+}
+</style>

+ 6 - 2
src/renderer/components/ScaleListResult.vue

@@ -36,7 +36,8 @@
             <div class="card" @click="queryDetail(item.id)">
               <img src="../assets/newImage/xl1.png" alt="" class="img_card" />
               <div style="display: block; margin-left: 1vw">
-                <h3 class="h3_card">{{ item.name }}</h3>
+                <!-- <h3 class="h3_card">{{ item.name }}</h3> -->
+                <h3 class="h3_card" :title="item.name">{{ formatTitle(item.name)}}</h3>
                 <div class="time_card">
                   {{ formatData(item.testDate) }}
                 </div>
@@ -203,10 +204,13 @@ export default {
       str = str.replace(/秒/g, "");
       return str;
     },
-
+    
     formatDesc(str) {
       return str.length < 30 ? str : str.substring(0, 30) + "...";
     },
+    formatTitle(str) {
+      return str.length < 8 ? str : str.substring(0, 8) + "...";
+    },
   },
 };
 </script>

+ 54 - 63
src/renderer/components/ScaleTestPage.vue

@@ -1,68 +1,45 @@
 <template>
   <div class="main_right_height">
     <TopDes :flag="true" topDesFont="量表详情"></TopDes>
-    <el-row style="overflow-y: scroll; height: 70vh">
-      <el-col :span="1">&nbsp;</el-col>
-      <el-col :span="22" style="margin-top: 10px">
-        <p class="question_index">
-          问题{{ scale_index + 1
-          }}<span class="question_default">/{{ scale_infos.length }}</span>
-        </p>
-        <p v-show="scale_infos[scale_index].answer.length > 0" class="question_desc">
-          {{ scale_index + 1 }}.{{ scale_infos[scale_index].answer }}
-        </p>
-        <!-- 单选题答案区域 -->
-        <div class="answer" v-if="this.scale_infos[scale_index].questionType == '0'">
-          <div class="answer_list">
-            <div
-              class="answer_item"
-              v-for="(item, index) in scale_checkItems"
-              :key="index"
-              @click="choiceTriger(item, index)"
-              :class="{ active: index === activeIndex }"
-            >
-              <span>{{ item }}</span>
-            </div>
-            <!-- <el-radio
-              class="scala_detail_radio"
-              style="
-                height: 50px;
-                background: rgba(255, 255, 255, 0.39);
-                box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.16);
-                opacity: 1;
-                border-radius: 12px;
-              "
-              v-for="(item, index) in scale_checkItems"
-              :key="index"
-              v-model="radio"
-              :label="item"
-              :disabled="disableRadio"
-              fill="#57ACBB"
-              @change="choiceTriger(item)"
-              border
-              ><p class="radioSpan">{{ item }}</p></el-radio
-            > -->
+    <p class="question_index">
+      问题{{ scale_index + 1
+      }}<span class="question_default">/{{ scale_infos.length }}</span>
+    </p>
+    <p v-show="scale_infos[scale_index].answer.length > 0" class="question_desc">
+      {{ scale_index + 1 }}.{{ scale_infos[scale_index].answer }}
+    </p>
+    <!-- 单选题答案区域 -->
+    <div style="flex:1;overflow-y:auto;margin-bottom:16vh">
+      <div class="answer" v-if="this.scale_infos[scale_index].questionType == '0'">
+        <div class="answer_list">
+          <div
+            class="answer_item"
+            v-for="(item, index) in scale_checkItems"
+            :key="index"
+            @click="choiceTriger(item, index)"
+            :class="{ active: index === activeIndex }"
+          >
+            <span>{{ item }}</span>
           </div>
         </div>
-        <!--3数字答案类型区域-->
-        <div class="answer" v-if="scale_infos[scale_index].questionType == '3'">
-          <el-slider v-model="radio" style="width:'300px"></el-slider>
-        </div>
-        <!--5下拉答案类型区域-->
-        <div class="answer" v-if="scale_infos[scale_index].questionType == '5'">
-          <el-select v-model="radio" placeholder="请选择">
-            <el-option
-              v-for="item in scale_checkItems_arr"
-              :key="item.label"
-              :label="item.name"
-              :value="item.label"
-            >
-            </el-option>
-          </el-select>
-        </div>
-      </el-col>
-      <el-col :span="1">&nbsp;</el-col>
-    </el-row>
+      </div>
+      <!--3数字答案类型区域-->
+      <div class="answer answer_number" v-if="scale_infos[scale_index].questionType == '3'">
+        <el-slider v-model="radio" style="width:'300px"></el-slider>
+      </div>
+      <!--5下拉答案类型区域-->
+      <div class="answer answer_select" v-if="scale_infos[scale_index].questionType == '5'">
+        <el-select v-model="radio" placeholder="请选择">
+          <el-option
+            v-for="item in scale_checkItems_arr"
+            :key="item.label"
+            :label="item.name"
+            :value="item.label"
+          >
+          </el-option>
+        </el-select>
+      </div>
+    </div>
     <div class="pagin_class">
       <div
         v-if="scale_index != 0"
@@ -159,6 +136,11 @@ export default {
       };
     },
     choiceTriger(item, index) {
+      //进来后判断是否是可点击状态
+      if (this.disableRadio) {
+        return;
+      }
+      this.disableRadio = true;
       this.activeIndex = index;
       let that = this;
       that.radioChange(item, index);
@@ -337,7 +319,7 @@ export default {
 
               if (res.data.code == 200) {
                 this.resultJson = res.data.data;
-
+                this.disableRadio = false;
                 if (this.scale_flag == "20210725100704") {
                   if (this.resultJson["PSQI总分"] <= 5) {
                     this.pointColor = "#32CD32";
@@ -376,6 +358,7 @@ export default {
           this.scale_checkItems_arr = this.scale_infos[this.scale_index].questionParam
             ? JSON.parse(this.scale_infos[this.scale_index].questionParam)
             : [];
+          this.disableRadio = false;
         }
       }
     },
@@ -465,6 +448,7 @@ p.radioSpan {
   color: #999999;
   line-height: 2;
   margin-top: 30px;
+  overflow-y: auto;
 }
 .el-radio.is-bordered {
   padding: 0px 20px 0 10px !important;
@@ -476,9 +460,9 @@ p.radioSpan {
 }
 .main_right_height {
   height: 100vh !important;
-  display: block !important;
-  overflow-y: auto !important;
+  display: flex !important;
   background: #ffffff;
+  flex-direction: column;
 }
 
 .answer_list {
@@ -558,4 +542,11 @@ p.radioSpan {
   position: absolute;
   right: 0;
 }
+.answer_select{
+  text-align: center;
+}
+.answer_number{
+  width:80%;
+  margin-left:10%;
+}
 </style>

+ 12 - 2
src/renderer/components/Smart1.vue

@@ -318,7 +318,12 @@ export default {
       let syncData = cmd.runSync("netstat -ano|findstr 9999");
       //假如数据库正在运行不动数据库状态
       if (syncData.data == null) {
-        this.$message.info("情绪判别模型尚未启动");
+        // this.$message.info("情绪判别模型尚未启动");
+        this.$message({
+          message:'情绪判别模型尚未启动',
+          type:'info',
+          duration:1000
+        })
       }
       // if (syncData.data.includes("RUNNING")) {
       // }else{
@@ -328,7 +333,12 @@ export default {
       let syncData1 = cmd.runSync("netstat -ano|findstr 9999");
       //假如数据库正在运行不动数据库状态
       if (syncData1.data == null) {
-        this.$message.info("对话模型尚未启动");
+        // this.$message.info("对话模型尚未启动");
+        this.$message({
+          message:'对话模型尚未启动',
+          type:'info',
+          duration:1000
+        })
       }
       // if (syncData1.data.includes("RUNNING")) {
       // }else{