소스 검색

bug修改

周玉佂 3 달 전
부모
커밋
4fd22e5901
3개의 변경된 파일36개의 추가작업 그리고 67개의 파일을 삭제
  1. 2 2
      src/components/login/Login.vue
  2. 32 65
      src/views/CognitiveAbilityTask/face_dot.vue
  3. 2 0
      src/views/Welcome.vue

+ 2 - 2
src/components/login/Login.vue

@@ -342,8 +342,8 @@
       </el-form>
       <div class="grid-content bg-purple-dark account-style-button">
         <div >
-          <el-radio v-model="userInfo.roleType" label="1"> 普通用户 </el-radio>
-          <el-radio v-model="userInfo.roleType" label="2"> 管理员 </el-radio>
+          <el-radio v-show="false" v-model="userInfo.roleType" label="1"> 普通用户 </el-radio>
+          <el-radio v-show="false" v-model="userInfo.roleType" label="2"> 管理员 </el-radio>
         </div>
         <el-button
           type="success"

+ 32 - 65
src/views/CognitiveAbilityTask/face_dot.vue

@@ -226,7 +226,9 @@ export default {
       //随机挑选12个人
       await this.randomList();
       //根据情绪等级初始化数组
-      this.randomArr.map((item, index) => {
+      let randomArrList = [...new Set(this.randomArr)].concat(['02','06']);
+      console.log(randomArrList,'randomArrList')
+      randomArrList.map((item, index) => {
         //开心-1
         this.blockList1.push({
           type: 0, //0-block1,1-block2 数据类型
@@ -583,6 +585,7 @@ export default {
         resultData.push(this.blockList1[i]);
         resultData.push(this.blockList2[i]);
       }
+      console.log(resultData,'resultData')
       resultData.map((item, i) => {
         return (item.index = i);
       });
@@ -708,40 +711,22 @@ export default {
         data: resultData,
         result: {
           block1: {
-            totalCorrectRate:
-                ((blockRight1.length / 96) * 100).toFixed(2) + "%",
-            posCorrectRate:
-                ((happyRight1.length / happy1.length) * 100).toFixed(2) + "%",
-            posAverageTime: (happyAllTime1 / happyResponse1.length).toFixed(
-                2
-            ),
-            negCorrectRate:
-                ((fearRight1.length / fear1.length) * 100).toFixed(2) + "%",
-            negAverageTime: (fearAllTime1 / fearResponse1.length).toFixed(2),
-            neuCorrectRate:
-                ((neutralRight1.length / neutral1.length) * 100).toFixed(2) +
-                "%",
-            neuAverageTime: (
-                neutralAllTime1 / neutralResponse1.length
-            ).toFixed(2),
+            totalCorrectRate: ((blockRight1.length / 96) * 100).toFixed(2) + "%",
+            posCorrectRate: ((happyRight1.length / happy1.length) * 100).toFixed(2) + "%",
+            posAverageTime: (happyAllTime1 / happyResponse1.length)?(happyAllTime1 / happyResponse1.length).toFixed(2):0,
+            negCorrectRate: ((fearRight1.length / fear1.length) * 100).toFixed(2) + "%",
+            negAverageTime: (fearAllTime1 / fearResponse1.length)?(fearAllTime1 / fearResponse1.length).toFixed(2):0,
+            neuCorrectRate: ((neutralRight1.length / neutral1.length) * 100).toFixed(2) + "%",
+            neuAverageTime: (neutralAllTime1 / neutralResponse1.length)?(neutralAllTime1 / neutralResponse1.length).toFixed(2):0,
           },
           block2: {
-            totalCorrectRate:
-                ((blockRight2.length / 96) * 100).toFixed(2) + "%",
-            posCorrectRate:
-                ((happyRight2.length / happy2.length) * 100).toFixed(2) + "%",
-            posAverageTime: (happyAllTime2 / happyResponse2.length).toFixed(
-                2
-            ),
-            negCorrectRate:
-                ((fearRight2.length / fear2.length) * 100).toFixed(2) + "%",
-            negAverageTime: (fearAllTime2 / fearResponse2.length).toFixed(2),
-            neuCorrectRate:
-                ((neutralRight2.length / neutral2.length) * 100).toFixed(2) +
-                "%",
-            neuAverageTime: (
-                neutralAllTime1 / neutralResponse1.length
-            ).toFixed(2),
+            totalCorrectRate: ((blockRight2.length / 96) * 100).toFixed(2) + "%",
+            posCorrectRate: ((happyRight2.length / happy2.length) * 100).toFixed(2) + "%",
+            posAverageTime: (happyAllTime2 / happyResponse2.length)?(happyAllTime2 / happyResponse2.length).toFixed(2):0,
+            negCorrectRate: ((fearRight2.length / fear2.length) * 100).toFixed(2) + "%",
+            negAverageTime: (fearAllTime2 / fearResponse2.length)?(fearAllTime2 / fearResponse2.length).toFixed(2):0,
+            neuCorrectRate: ((neutralRight2.length / neutral2.length) * 100).toFixed(2) + "%",
+            neuAverageTime: (neutralAllTime1 / neutralResponse1.length)?(neutralAllTime1 / neutralResponse1.length).toFixed(2):0,
           },
         },
       },'hahaha')
@@ -753,40 +738,22 @@ export default {
           data: resultData,
           result: {
             block1: {
-              totalCorrectRate:
-                ((blockRight1.length / 96) * 100).toFixed(2) + "%",
-              posCorrectRate:
-                ((happyRight1.length / happy1.length) * 100).toFixed(2) + "%",
-              posAverageTime: (happyAllTime1 / happyResponse1.length).toFixed(
-                2
-              ),
-              negCorrectRate:
-                ((fearRight1.length / fear1.length) * 100).toFixed(2) + "%",
-              negAverageTime: (fearAllTime1 / fearResponse1.length).toFixed(2),
-              neuCorrectRate:
-                ((neutralRight1.length / neutral1.length) * 100).toFixed(2) +
-                "%",
-              neuAverageTime: (
-                neutralAllTime1 / neutralResponse1.length
-              ).toFixed(2),
+              totalCorrectRate: ((blockRight1.length / 96) * 100).toFixed(2) + "%",
+              posCorrectRate: ((happyRight1.length / happy1.length) * 100).toFixed(2) + "%",
+              posAverageTime: (happyAllTime1 / happyResponse1.length)?(happyAllTime1 / happyResponse1.length).toFixed(2):0.00,
+              negCorrectRate: ((fearRight1.length / fear1.length) * 100).toFixed(2) + "%",
+              negAverageTime: (fearAllTime1 / fearResponse1.length)?(fearAllTime1 / fearResponse1.length).toFixed(2):0.00,
+              neuCorrectRate: ((neutralRight1.length / neutral1.length) * 100).toFixed(2) + "%",
+              neuAverageTime: (neutralAllTime1 / neutralResponse1.length)?(neutralAllTime1 / neutralResponse1.length).toFixed(2):0.00,
             },
             block2: {
-              totalCorrectRate:
-                ((blockRight2.length / 96) * 100).toFixed(2) + "%",
-              posCorrectRate:
-                ((happyRight2.length / happy2.length) * 100).toFixed(2) + "%",
-              posAverageTime: (happyAllTime2 / happyResponse2.length).toFixed(
-                2
-              ),
-              negCorrectRate:
-                ((fearRight2.length / fear2.length) * 100).toFixed(2) + "%",
-              negAverageTime: (fearAllTime2 / fearResponse2.length).toFixed(2),
-              neuCorrectRate:
-                ((neutralRight2.length / neutral2.length) * 100).toFixed(2) +
-                "%",
-              neuAverageTime: (
-                neutralAllTime1 / neutralResponse1.length
-              ).toFixed(2),
+              totalCorrectRate: ((blockRight2.length / 96) * 100).toFixed(2) + "%",
+              posCorrectRate: ((happyRight2.length / happy2.length) * 100).toFixed(2) + "%",
+              posAverageTime: (happyAllTime2 / happyResponse2.length)?(happyAllTime2 / happyResponse2.length).toFixed(2):0.00,
+              negCorrectRate: ((fearRight2.length / fear2.length) * 100).toFixed(2) + "%",
+              negAverageTime: (fearAllTime2 / fearResponse2.length)?(fearAllTime2 / fearResponse2.length).toFixed(2):0.00,
+              neuCorrectRate: ((neutralRight2.length / neutral2.length) * 100).toFixed(2) + "%",
+              neuAverageTime: (neutralAllTime2 / neutralResponse2.length)?(neutralAllTime2 / neutralResponse2.length).toFixed(2):0.00,
             },
           },
         },

+ 2 - 0
src/views/Welcome.vue

@@ -1335,6 +1335,8 @@ export default {
         this.searchShow = true;
         this.dialogTitle = '个人中心'
         this.userDialogVisiblephone1 = true;
+        console.log('个人中心')
+        this.userRuleForm = JSON.parse(sessionStorage.getItem("user-all-info"))
         // this.userRuleForm.phone = sessionStorage.getItem("f7a42fe7211f98ac7a60a285ac3a9e87")
         // if (this.userRuleForm.phone1 == 0) {
         //   this.userDialogVisiblephone1 = true;