Browse Source

H5样式修改

周玉佂 3 tháng trước cách đây
mục cha
commit
fa8ad5b528

BIN
public/static/task/key_des4.png


+ 17 - 1
src/components/cognitiveTask/cognitiveTaskReport.vue

@@ -14,7 +14,23 @@
 
     <PageModule v-if="allData.ifShow && allData.ifShow.totalScore" text="总分">
       <div class="total-score">
-        <span class="score">{{ allData.totalScore[0].totalScore }}</span>
+        <span
+          v-if="data.userRecordEntity.name === '工作记忆能力测试(空间记忆)'"
+          class="score"
+          >{{
+            allData.totalScore[0].totalScore &&
+            allData.totalScore[0].totalScore.indexOf("%") !== -1
+              ? allData.totalScore[0].totalScore.replace("%", "")
+              : allData.totalScore[0].totalScore
+          }}</span
+        >
+        <span v-else class="score">{{ allData.totalScore[0].totalScore }}</span>
+        <!--        <span class="lang-to fen">{{-->
+        <!--          allData.totalScore[0].totalScore &&-->
+        <!--          allData.totalScore[0].totalScore.indexOf("%") !== -1-->
+        <!--            ? allData.totalScore[0].totalScore.replace("%", "")-->
+        <!--            : allData.totalScore[0].totalScore-->
+        <!--        }}</span>-->
       </div>
       <div class="score-des">

+ 146 - 152
src/components/cognitiveTask/radarChart.vue

@@ -1,164 +1,158 @@
 <template>
-    <div class="radar-warp">
-        <div id="radarChart" ref="radarChart" style="width: 365px;height: 355px;"></div>
-    </div>
+  <div class="radar-warp">
+    <div
+      id="radarChart"
+      ref="radarChart"
+      style="width: 365px;height: 355px;"
+    ></div>
+  </div>
 </template>
 
 <script>
-    export default {
-        name: "radarChart",
-        components: {},
-        props: {
-            data: {
-                type: Object,
-                default: function () {
-                    return {}
-                },
-            },
-        },
-        data() {
-            return {
-                color: ['#FCEF9A', '#D54039', '#56743E', '#FF917C'],
-                radarIndicator: [],
-                radarData: [],
-            }
-        },
-        mounted() {
-            // this.myRadarEcharts();
-            this.radarDataHandle(this.data);
+export default {
+  name: "radarChart",
+  components: {},
+  props: {
+    data: {
+      type: Object,
+      default: function() {
+        return {};
+      }
+    }
+  },
+  data() {
+    return {
+      color: ["#FCEF9A", "#D54039", "#56743E", "#FF917C"],
+      radarIndicator: [],
+      radarData: []
+    };
+  },
+  mounted() {
+    // this.myRadarEcharts();
+    this.radarDataHandle(this.data);
+  },
+  computed: {},
+  watch: {},
+  methods: {
+    myRadarEcharts(radarIndicator, radarData) {
+      let myChart = this.$echarts.init(document.getElementById("radarChart"));
+
+      //配置图表
+      let option = {
+        color: ["#FCEF9A", "#D54039", "#56743E", "#FF917C"],
+        title: {
+          show: false
+          // text: ''
         },
-        computed: {},
-        watch: {
-
+        legend: {
+          show: false
+          // data: ['', '']
         },
-        methods: {
-            myRadarEcharts(radarIndicator,radarData){
-
-                let myChart = this.$echarts.init(document.getElementById('radarChart'));
-
-                //配置图表
-                let option = {
-                    color: ['#FCEF9A', '#D54039', '#56743E', '#FF917C'],
-                    title: {
-                        show: false,
-                        // text: ''
-                    },
-                    legend: {
-                        show: false,
-                        // data: ['', '']
-                    },
-                    radar: {
-                        // shape: 'circle',
-                        indicator: radarIndicator,
-                        //     [
-                        //     { name: '知觉辨别能力', max: 200 },
-                        //     { name: '抽象推理能力', max: 200 },
-                        //     { name: '系列关系能力', max: 200 },
-                        //     { name: '比较推理能力', max: 200 },
-                        //     { name: '雷同比较能力', max: 200 },
-                        // ],
-                        radius: 98,
-                        center: ['50%','50%'],
-                        axisName: {
-                            formatter: '{value}',
-                            color: '#2A4454'
-                        },
-                        splitArea: {
-                            areaStyle: {
-                                color: ['#A1CC7E'],
-                                shadowColor: 'rgba(0, 0, 0, 0.2)',
-                                shadowBlur: 10
-                            }
-                        },
-                        axisLine: {
-                            lineStyle: {
-                                color: 'rgba(86, 116, 62, 0.2)'
-                            }
-                        },
-                        splitLine: {
-                            lineStyle: {
-                                color: 'rgba(86, 116, 62, 0.2)'
-                            }
-                        }
-                    },
-                    series: [
-                        {
-                            // name: 'Budget vs spending',
-                            type: 'radar',
-                            data: radarData,
-                            // [
-                            //     {
-                            //         value: radarData,
-                            //         name: '123',
-                            //         areaStyle: {
-                            //             color: '#FCEF9A'
-                            //         }
-                            //         // label: {
-                            //         //     show: true,
-                            //         //     formatter: function (params) {
-                            //         //         return params.value;
-                            //         //     }
-                            //         // }
-                            //     },
-                            //     // {
-                            //     //     value: [5000, 14000, 28000, 26000, 42000],
-                            //     //     name: 'Actual Spending',
-                            //     //     areaStyle: {
-                            //     //         color: '#D54039'
-                            //     //     }
-                            //     //     // label: {
-                            //     //     //     show: true,
-                            //     //     //     formatter: function (params) {
-                            //     //     //         return params.value;
-                            //     //     //     }
-                            //     //     // }
-                            //     // }
-                            // ]
-                        }
-                    ]
-                };
-
-                radarData && option && myChart.setOption(option);
-            },
-            radarDataHandle(param){
-
-                this.radarData = [];
-
-                param.groupData.map((item,index) => {
-
-                    this.radarData.push({
-                        value: item.value,
-                        name: item.name,
-                        areaStyle: {
-                            color: this.color[index]
-                        }
-                    });
-
-                });
-
-                // param.map((item,index) => {
-                //     this.radarIndicator.push({
-                //         name: item.name,
-                //         max: item.maximum,
-                //     });
-                //     this.radarData.push(item.score);
-                //
-                // });
-                //
-                // this.myRadarEcharts(this.radarIndicator,this.radarData);
-
-                this.myRadarEcharts(param.indicator,this.radarData);
-
+        radar: {
+          // shape: 'circle',
+          indicator: radarIndicator,
+          //     [
+          //     { name: '知觉辨别能力', max: 200 },
+          //     { name: '抽象推理能力', max: 200 },
+          //     { name: '系列关系能力', max: 200 },
+          //     { name: '比较推理能力', max: 200 },
+          //     { name: '雷同比较能力', max: 200 },
+          // ],
+          radius: 65,
+          center: ["50%", "50%"],
+          axisName: {
+            formatter: "{value}",
+            color: "#2A4454"
+          },
+          splitArea: {
+            areaStyle: {
+              color: ["#A1CC7E"],
+              shadowColor: "rgba(0, 0, 0, 0.2)",
+              shadowBlur: 10
             }
-
-
+          },
+          axisLine: {
+            lineStyle: {
+              color: "rgba(86, 116, 62, 0.2)"
+            }
+          },
+          splitLine: {
+            lineStyle: {
+              color: "rgba(86, 116, 62, 0.2)"
+            }
+          }
         },
+        series: [
+          {
+            // name: 'Budget vs spending',
+            type: "radar",
+            data: radarData
+            // [
+            //     {
+            //         value: radarData,
+            //         name: '123',
+            //         areaStyle: {
+            //             color: '#FCEF9A'
+            //         }
+            //         // label: {
+            //         //     show: true,
+            //         //     formatter: function (params) {
+            //         //         return params.value;
+            //         //     }
+            //         // }
+            //     },
+            //     // {
+            //     //     value: [5000, 14000, 28000, 26000, 42000],
+            //     //     name: 'Actual Spending',
+            //     //     areaStyle: {
+            //     //         color: '#D54039'
+            //     //     }
+            //     //     // label: {
+            //     //     //     show: true,
+            //     //     //     formatter: function (params) {
+            //     //     //         return params.value;
+            //     //     //     }
+            //     //     // }
+            //     // }
+            // ]
+          }
+        ]
+      };
+
+      radarData && option && myChart.setOption(option);
+    },
+    radarDataHandle(param) {
+      this.radarData = [];
+
+      param.groupData.map((item, index) => {
+        this.radarData.push({
+          value: item.value,
+          name: item.name,
+          areaStyle: {
+            color: this.color[index]
+          }
+        });
+      });
+
+      // param.map((item,index) => {
+      //     this.radarIndicator.push({
+      //         name: item.name,
+      //         max: item.maximum,
+      //     });
+      //     this.radarData.push(item.score);
+      //
+      // });
+      //
+      // this.myRadarEcharts(this.radarIndicator,this.radarData);
+
+      this.myRadarEcharts(param.indicator, this.radarData);
     }
+  }
+};
 </script>
 
 <style scoped>
-    .radar-warp {
-        width: 100%;
-    }
-
-</style>
+.radar-warp {
+  width: 100%;
+}
+</style>

+ 41 - 34
src/components/cognitiveTask/scoreInterpretation-item.vue

@@ -1,11 +1,18 @@
 <template>
   <div class="score-interpretation-warp">
     <div class="score-interpretation-left">
-      <div id="pieChart" ref="pieChart" style="width: 100px;height: 100px;"></div>
+      <div
+        id="pieChart"
+        ref="pieChart"
+        style="width: 100px;height: 100px;"
+      ></div>
     </div>
     <div class="score-interpretation-right">
       <div class="score-interpretation-title">{{ data.name }}</div>
-      <div class="score-interpretation-subtitle">所获得分:{{ data.score }}</div>
+      <div class="score-interpretation-subtitle">
+        所获得分:{{ data.score }}
+        <!--        Math.abs(data.score)-->
+      </div>
       <div class="score-interpretation-des">
         {{ data.Describe }}
       </div>
@@ -20,8 +27,8 @@ export default {
   props: {
     data: {
       type: Object,
-      default: function () {
-        return {}
+      default: function() {
+        return {};
       }
     },
     order: {
@@ -31,74 +38,75 @@ export default {
   },
   data() {
     return {
-      color: [ '#A1CC7E', '#EECD4B', '#EE6D4B', '#5185E5', '#7ECCCB' ]
-    }
+      color: ["#A1CC7E", "#EECD4B", "#EE6D4B", "#5185E5", "#7ECCCB"]
+    };
   },
   mounted() {
-    this.myPieEcharts(this.data.score, this.data.maximum)
+    this.myPieEcharts(this.data.score, this.data.maximum);
   },
   computed: {},
   watch: {},
   methods: {
     myPieEcharts(pieData, pieMaxData) {
-      let myChart = this.$echarts.getInstanceByDom(this.$refs.pieChart)
+      let myChart = this.$echarts.getInstanceByDom(this.$refs.pieChart);
       // let myChart = this.$echarts.init(document.getElementById('pieChart'));
       if (myChart == null) {
-        myChart = this.$echarts.init(this.$refs.pieChart)
+        myChart = this.$echarts.init(this.$refs.pieChart);
       }
       //配置图表
       let option = {
         tooltip: {
-          trigger: 'item'
+          trigger: "item"
         },
         legend: {
           show: false,
-          top: '5%',
-          left: 'center'
+          top: "5%",
+          left: "center"
         },
         series: [
           {
-            name: '得分解读',
-            type: 'pie',
-            radius: [ '50%', '90%' ],
+            name: "得分解读",
+            type: "pie",
+            radius: ["50%", "90%"],
             avoidLabelOverlap: false,
             label: {
-              show: pieMaxData == '无' ? true : false,
-              formatter: '{c}',
-              position: 'center',
-              fontSize: '10'
+              show: pieMaxData == "无" ? true : false,
+              formatter: "{c}",
+              position: "center",
+              fontSize: "10"
               // fontWeight: 'bold'
             },
             emphasis: {
               label: {
                 show: false,
-                fontSize: '10',
-                fontWeight: 'bold'
+                fontSize: "10",
+                fontWeight: "bold"
               }
             },
             labelLine: {
               show: false
             },
             data: [
-              { value: Math.abs(pieData), name: '所获分数' },
-              { value: pieMaxData == '无' ? 0 : pieMaxData - pieData, name: '未获得分数' }
+              { value: Math.abs(pieData), name: "所获分数" },
+              {
+                value: pieMaxData == "无" ? 0 : pieMaxData - pieData,
+                name: "未获得分数"
+              }
             ],
             itemStyle: {
-              color: (colors) => {
-                let colorList = [ this.color[this.order], '#9E9E9E' ]
-                return colorList[colors.dataIndex]
+              color: colors => {
+                let colorList = [this.color[this.order], "#9E9E9E"];
+                return colorList[colors.dataIndex];
               }
             }
-
           }
         ]
-      }
+      };
 
-      Math.abs(pieData) >= 0 && option && myChart.setOption(option)
+      Math.abs(pieData) >= 0 && option && myChart.setOption(option);
     }
   }
-
-}
+};
 </script>
 
 <style scoped>
@@ -128,7 +136,8 @@ export default {
   line-height: 24px;
 }
 
-.score-interpretation-subtitle, .score-interpretation-des {
+.score-interpretation-subtitle,
+.score-interpretation-des {
   font-size: 12px;
   /*line-height: 25px;*/
   font-family: PingFang SC;
@@ -139,6 +148,4 @@ export default {
 .score-interpretation-subtitle {
   padding-bottom: 5px;
 }
-
-
 </style>

+ 7 - 1
src/views/cognitiveTask/memoryTest.vue

@@ -773,6 +773,9 @@ export default {
           this.code0Flag = false;
           this.code12Flag = true;
           this.buttonShow = true;
+          this.userResponseRecords = [];
+          this.userTestPicList = [];
+
           // this.screenState();
           // this.$message({
           //   message: "测试通过!",
@@ -833,7 +836,10 @@ export default {
           userScoreOne: this.userScoreOne,
           userScoreTwo: this.userScoreTwo,
           userId: this.userId,
-          userResponseRecords: this.userResponseRecords,
+          userResponseRecords: this.userResponseRecords.map((item, index) => {
+            item.index = index + 1;
+            return item;
+          }),
           testPlanId: this.$route.query.testPlanId || ""
         };
         // this.screenExit();

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 858 - 710
src/views/cognitiveTask/prospectiveMemoryAbility.vue


+ 0 - 1031
src/views/cognitiveTask/prospectiveMemoryAbility_bak.vue

@@ -1,1031 +0,0 @@
-<template>
-  <div class="app-container">
-    <Header />
-    <div :class="{ 'active-bg': testFlag }" class="main-container">
-      <van-nav-bar :title="subjectInfo.name" left-arrow @click-left="goBack" />
-      <div class="main-outline">
-        <div id="pm" class="txt-center activeTask">
-          <div class="glass">
-            <template>
-              <div class="bTitle">前瞻记忆</div>
-              <div
-                v-if="isBody2"
-                id="t1"
-                v-bind:text-content.prop="time1 + '(用时)'"
-              >
-                用时
-              </div>
-              <van-row style="margin-top: 10px">
-                <van-col span="24">
-                  <p style="text-align: left;font-size: 14px; padding: 0 10px;">
-                    该任务需要您判断所呈现的四字词语是否为成语,如果是成语,就按“F”键,如果不是成语,就按“J”键;感知条件下要求判断所呈现的模糊数字图片
-                    是否为“0”,是就按“F”键,否就按“J”键。需要注意的是当呈现的四字词语包含动物的名称或者数字下方出现黑色箭头时,按空格键反应。
-                    每一屏呈现时间(回答时间)为2s。
-                  </p>
-                </van-col>
-              </van-row>
-            </template>
-            <div v-if="!isclick" class="btn">
-              <!--          <el-button style="margin-left:10%;" class="start-bb" @click.once="begintime">点我开始学习</el-button>-->
-              <van-button
-                block
-                round
-                size="normal"
-                type="primary"
-                @click="begintime()"
-              >
-                点我开始学习
-              </van-button>
-            </div>
-            <div v-if="isBody2" id="body2">
-              <div>
-                <div
-                  style="width:48%;float:left;font-size:x-large;text-align:center;padding-top:100px;"
-                >
-                  <h1 v-if="isbreak">{{ this.randomName[id].idiomName }}</h1>
-                  <!--              <el-image v-else-if="isbreak==false&&isimg==true" :src="randomImg[this.imgid].img" style="width: 40%; height: 150px" />-->
-                  <img
-                    v-else-if="!isbreak && isimg"
-                    :src="randomImg[this.imgid].img"
-                    alt=""
-                    style="width: 40%; height: 150px"
-                  />
-                </div>
-                <div class="optionRight">
-                  <h2 style="text-align:center;margin-top:10px;">操作</h2>
-                  <div class="optionBtn">
-                    <!--                <el-button  style="width:40%;height:60px;" class="start-bb" @click="idomevent(2)">F键</el-button>-->
-                    <!--                <el-button  style="width:40%;height:60px;" class="start-bb" @click="idomevent(3)">J键</el-button>-->
-                    <van-button
-                      block
-                      round
-                      size="small"
-                      type="info"
-                      @click="idomevent(2)"
-                    >
-                      F键
-                    </van-button>
-                    <van-button
-                      block
-                      round
-                      size="small"
-                      type="info"
-                      @click="idomevent(3)"
-                    >
-                      J键
-                    </van-button>
-                  </div>
-                  <!--              <el-button  class="start-bb" style="margin-top:60px;width:40%;height:60px;" @click="idomevent(1)">空格</el-button>-->
-                  <div>
-                    <van-button
-                      block
-                      round
-                      size="small"
-                      type="info"
-                      @click="idomevent(1)"
-                    >
-                      空格
-                    </van-button>
-                  </div>
-                </div>
-              </div>
-            </div>
-
-            <!--        <div v-if="isBody3" style="margin-top:60px;text-align:center">-->
-            <!--          <h2 style="text-align:center;margin-bottom:20px;">测试结果</h2>-->
-            <!--          <div style="margin-left:25%;">-->
-            <!--            <el-table-->
-            <!--                :data="tableData"-->
-            <!--                border-->
-            <!--                style="width: 70%;">-->
-            <!--              <el-table-column-->
-            <!--                  prop="item"-->
-            <!--                  label="项目"-->
-            <!--                  width="160">-->
-            <!--              </el-table-column>-->
-            <!--              <el-table-column-->
-            <!--                  prop="accary1"-->
-            <!--                  label="全部正确率(%)"-->
-            <!--                  width="160">-->
-            <!--              </el-table-column>-->
-            <!--              <el-table-column-->
-            <!--                  prop="accary2"-->
-            <!--                  label="空格正确率(%)">-->
-            <!--              </el-table-column>-->
-            <!--            </el-table>-->
-            <!--          </div>-->
-            <!--          <el-button style="margin-top:20px;" class="start-bb"  @click="save1()">问卷调查</el-button>-->
-            <!--        </div>-->
-          </div>
-        </div>
-      </div>
-    </div>
-  </div>
-</template>
-
-<script>
-import Header from "@/components/header/index.vue";
-
-export default {
-  name: "prospectiveMemoryAbility",
-  components: { Header },
-  data() {
-    return {
-      tableData: [
-        { item: "四字成语", accary1: "", accary2: "" },
-        { item: "模糊数字", accary1: "", accary2: "" }
-      ],
-      rate1: "1",
-      rate2: "2",
-      rate3: "3",
-      rate4: "4",
-      digsum: 0,
-      abcsum: 0,
-      radio1: "",
-      radio2: "",
-      radio3: "",
-      id: 0, //name1数组游标
-      isimg: true,
-      imgid: 0,
-      tc: false,
-      isBody3: false,
-      isbreak: true,
-      complete: false,
-      quest: false,
-      isclick: false,
-      isBody2: false,
-      isok: false,
-      isin: false,
-      src: "",
-      cdv: false,
-      flag: 0, //定义图片进行游标,初始为0,展示数组imgGroup2的第一张图片
-      inputName: "",
-      time1: "00时00分00秒",
-      getNextButtonShow: true, //下一个按钮显示隐藏
-      countDownDivShow: false, //控制剩余时间显示隐藏
-      delayTestButtonShow: false, //控制剩余时间显示隐藏
-      remainingTime: 0, //延时测试剩余时间
-      changed: false, //用于查看数据20秒内是否发生变化
-      idomGrade: 0,
-      group: "1",
-      timer: 0,
-      memoryType: 1,
-      correlationMemory: "",
-      status: 1,
-      imgGroup2: [], //用于存放生成的随机展示的新数据
-      resultId: 0,
-      resuleArray: [0], //保存结果
-      resultNum: 0, //正确的个数
-      grade: 0,
-      phone: "",
-
-      beforeTime: true,
-      timer2: 0,
-      testName: [],
-      img: [
-        {
-          img: require("../../../public/static/assets/prospectMemory/0.png"),
-          flagid: 2
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/1.png"),
-          flagid: 1 //1
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/2.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/3.png"),
-          flagid: 1 //2
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/4.png"),
-          flagid: 1 //3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/5.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/6.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/7.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/8.png"),
-          flagid: 1 //4
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/9.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/10.png"),
-          flagid: 2
-        },
-
-        {
-          img: require("../../../public/static/assets/prospectMemory/11.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/12.png"),
-          flagid: 1 //5
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/13.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/14.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/15.png"),
-          flagid: 1 //6
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/16.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/17.png"),
-          flagid: 1 //7
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/18.png"),
-          flagid: 1 //8
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/19.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/20.png"),
-          flagid: 2
-        },
-
-        {
-          img: require("../../../public/static/assets/prospectMemory/21.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/22.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/23.png"),
-          flagid: 1 //9
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/24.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/25.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/26.png"),
-          flagid: 1 //10
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/27.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/28.png"),
-          flagid: 1 //11
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/29.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/30.png"),
-          flagid: 2
-        },
-
-        {
-          img: require("../../../public/static/assets/prospectMemory/31.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/32.png"),
-          flagid: 1 //12
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/33.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/34.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/35.png"),
-          flagid: 1 //13
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/36.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/37.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/38.png"),
-          flagid: 1 //14
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/39.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/40.png"),
-          flagid: 1 //15
-        },
-
-        {
-          img: require("../../../public/static/assets/prospectMemory/41.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/42.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/43.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/44.png"),
-          flagid: 1 //16
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/45.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/46.png"),
-          flagid: 1 //17
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/47.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/48.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/49.png"),
-          flagid: 1 //18
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/50.png"),
-          flagid: 2
-        },
-
-        {
-          img: require("../../../public/static/assets/prospectMemory/51.png"),
-          flagid: 1 //19
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/52.png"),
-          flagid: 1 //20
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/53.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/54.png"),
-          flagid: 1 //21
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/55.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/56.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/57.png"),
-          flagid: 1 //22
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/58.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/59.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/60.png"),
-          flagid: 2
-        },
-
-        {
-          img: require("../../../public/static/assets/prospectMemory/61.png"),
-          flagid: 1 //23
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/62.png"),
-          flagid: 1 //24
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/63.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/64.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/65.png"),
-          flagid: 1 //25
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/66.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/67.png"),
-          flagid: 1 //26
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/68.png"),
-          flagid: 1 //27
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/69.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/70.png"),
-          flagid: 2
-        },
-
-        {
-          img: require("../../../public/static/assets/prospectMemory/71.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/72.png"),
-          flagid: 1 //28
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/73.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/74.png"),
-          flagid: 1 //29
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/75.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/76.png"),
-          flagid: 1 //30
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/77.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/78.png"),
-          flagid: 3
-        },
-        {
-          img: require("../../../public/static/assets/prospectMemory/79.png"),
-          flagid: 1 //31
-        }
-      ],
-      name1: [
-        { flagid: 3, idiomName: "笔记本" },
-        { flagid: 3, idiomName: "越野车" },
-        { flagid: 3, idiomName: "显示器" },
-        { flagid: 3, idiomName: "一望无际" },
-        { flagid: 3, idiomName: "一触即发" },
-        { flagid: 3, idiomName: "半信半疑" },
-        { flagid: 3, idiomName: "空气污染" },
-        { flagid: 3, idiomName: "反复无常" },
-        { flagid: 3, idiomName: "拂袖而去" },
-        { flagid: 3, idiomName: "飞黄腾达" },
-        { flagid: 3, idiomName: "风花雪月" },
-        { flagid: 3, idiomName: "冠冕堂皇" },
-        { flagid: 3, idiomName: "宾至如归" },
-        { flagid: 3, idiomName: "会议室" },
-        { flagid: 3, idiomName: "人工智能" },
-        { flagid: 3, idiomName: "芯片封装" },
-        { flagid: 3, idiomName: "门诊楼" },
-        { flagid: 3, idiomName: "贸易战" },
-        { flagid: 3, idiomName: "环境保护" },
-        { flagid: 3, idiomName: "摩天大楼" },
-
-        { flagid: 2, idiomName: "战斗机" },
-        { flagid: 2, idiomName: "目标锁定" },
-        { flagid: 2, idiomName: "空地导弹" },
-        { flagid: 2, idiomName: "空空导弹" },
-        { flagid: 2, idiomName: "对地打击" },
-        { flagid: 2, idiomName: "对空防御" },
-        { flagid: 2, idiomName: "空速校准" },
-        { flagid: 2, idiomName: "失速警告" },
-        { flagid: 2, idiomName: "空地通信" },
-        { flagid: 2, idiomName: "敌我识别" },
-        { flagid: 2, idiomName: "紧急迫降" },
-        { flagid: 2, idiomName: "作战半径" },
-        { flagid: 2, idiomName: "电子对抗" },
-        { flagid: 2, idiomName: "滑跑方向" },
-        { flagid: 2, idiomName: "航迹偏差" },
-        { flagid: 2, idiomName: "滚转" },
-        { flagid: 2, idiomName: "抬轮" },
-        { flagid: 2, idiomName: "航迹角" },
-        { flagid: 2, idiomName: "地面效应" },
-        { flagid: 2, idiomName: "起落架" },
-
-        { flagid: 1, idiomName: "飞行高度" },
-        { flagid: 1, idiomName: "升降舵" },
-        { flagid: 1, idiomName: "高度计" },
-        { flagid: 1, idiomName: "指南针" },
-        { flagid: 1, idiomName: "紧急下降" },
-        { flagid: 1, idiomName: "下降气流" },
-        { flagid: 1, idiomName: "上升气流" },
-        { flagid: 1, idiomName: "低空飞行" },
-        { flagid: 1, idiomName: "高度保持" },
-        { flagid: 1, idiomName: "标高" },
-        { flagid: 1, idiomName: "东向航线" },
-        { flagid: 1, idiomName: "东磁航向" },
-        { flagid: 1, idiomName: "西方飞行" },
-        { flagid: 1, idiomName: "北向气流" },
-        { flagid: 1, idiomName: "南风面" },
-        { flagid: 1, idiomName: "中央航路" },
-        { flagid: 1, idiomName: "推力反推" },
-        { flagid: 1, idiomName: "进近" },
-        { flagid: 1, idiomName: "下降方向" },
-        { flagid: 1, idiomName: "低空飞行" },
-
-        { flagid: 1, idiomName: "南来北往" },
-        { flagid: 1, idiomName: "无问东西" },
-        { flagid: 1, idiomName: "七上八下" },
-        { flagid: 1, idiomName: "下楼" },
-        { flagid: 1, idiomName: "高山流水" },
-        { flagid: 1, idiomName: "北极圈" },
-        { flagid: 1, idiomName: "日薄西山" },
-        { flagid: 1, idiomName: "中流砥柱" },
-        { flagid: 1, idiomName: "东窗事发" },
-        { flagid: 1, idiomName: "北斗星" },
-        { flagid: 1, idiomName: "南辕北辙" },
-        { flagid: 1, idiomName: "南腔北调" },
-        { flagid: 1, idiomName: "西装革履" },
-        { flagid: 1, idiomName: "自上而下" },
-        { flagid: 1, idiomName: "下不为例" },
-        { flagid: 1, idiomName: "东施效颦" },
-        { flagid: 1, idiomName: "东山再起" },
-        { flagid: 1, idiomName: "西北坡" },
-        { flagid: 1, idiomName: "西部开发" },
-        { flagid: 1, idiomName: "南京市" }
-
-        //
-        //
-      ],
-      randomImg: [],
-      randomName: [],
-      wholeProcess: "1", //0-流程测试1-分项测试是否进行全流程测试
-      userId: "",
-      isImmediate: "0", //是否是即时测试,0-不是即时,1-即时测试
-      throttleTimer: null,
-      subjectInfo: {},
-      testPlanId: ""
-    };
-  },
-  created() {
-    // this.isImmediate = this.$route.query.isImmediate || this.isImmediate;
-    // this.wholeProcess = this.$route.query.wholeProcess || this.wholeProcess;
-    // this.userId = sessionStorage.getItem("b80bb7740288fda1f201890375a60c8f");
-    // this.phone = sessionStorage.getItem("f7a42fe7211f98ac7a60a285ac3a9e87");
-
-    this.testPlanId = this.$route.query.testPlanId || "";
-    this.userId = JSON.parse(sessionStorage.getItem("userInfo")).id;
-    this.subjectInfo = JSON.parse(sessionStorage.getItem("subjectInfo"));
-  },
-  mounted() {
-    // var that = this;
-    // document.onkeydown = function (e) {
-    //   // let key = window.event.keyCode;
-    //   let e1 = e || event || window.event || arguments.callee.caller.arguments[0];
-    //
-    //   if (e1.keyCode === 122) {
-    //     e.preventDefault();
-    //     screenfull.toggle();
-    //   }
-    // };
-    // document.onkeyup = function (e) {
-    //   let e1 = e || event || window.event || arguments.callee.caller.arguments[0];
-    //
-    //   if(that.isBody2 == true){
-    //     //任务监听事件触发点击按钮
-    //     if (e1.keyCode == 70) {
-    //       console.log("点了f")
-    //       that.idomevent(2)
-    //       e.preventDefault()
-    //     }
-    //     if (e1.keyCode == 74) {
-    //       console.log("点了J")
-    //       that.idomevent(3)
-    //       e.preventDefault()
-    //     }
-    //     if (e1.keyCode == 32) {
-    //       console.log("点了空格")
-    //       that.idomevent(1)
-    //       e.preventDefault()
-    //     }
-    //   }
-    // }
-  },
-  beforeMount() {
-    this.randomImg = this.getArrayItems(this.img);
-    this.randomName = this.getArrayItems(this.name1);
-
-    console.log(this.randomImg);
-    console.log(this.randomName);
-  },
-  methods: {
-    idomevent(i) {
-      console.log("flag", this.flag);
-      if (this.flag < 80) {
-        this.flag++;
-        console.log("执行了idom");
-        if (this.randomName[this.id].flagid == i && this.id <= 79) {
-          console.log("id:" + i);
-          if (this.randomName[this.id].flagid == 1) {
-            this.abcsum++;
-          }
-          this.resuleArray[this.resultId] = 1;
-          this.resultId++;
-          this.id++;
-        } else if (
-          this.randomName[this.id].flagid != i &&
-          i != 5 &&
-          this.id <= 79
-        ) {
-          this.resuleArray[this.resultId] = 0;
-          this.resultId++;
-          this.id++;
-        }
-      } else if (this.flag >= 80 && this.flag < 160) {
-        console.log("执行了img");
-        this.flag++;
-        if (this.randomImg[this.imgid].flagid == i && this.imgid <= 79) {
-          if (i == 1) {
-            this.digsum++;
-            console.log("数量:" + this.digsum);
-          }
-          this.resuleArray[this.resultId] = 1;
-          this.resultId++;
-          this.imgid++;
-        } else if (
-          this.randomImg[this.imgid].flagid != i &&
-          i != 5 &&
-          this.imgid <= 79
-        ) {
-          this.resuleArray[this.resultId] = 0;
-          this.resultId++;
-          this.imgid++;
-        }
-      }
-      this.getResultNUm();
-    },
-    getResultNUm() {
-      console.log(this.resuleArray);
-      this.resultNum = 0;
-      this.resuleArray.forEach(result => {
-        if (result == 1) {
-          this.resultNum++;
-        }
-      });
-      let total1 = 0;
-      let total2 = 0;
-      for (let i = 0; i < 80; i++) {
-        if (this.resuleArray[i] == 1) {
-          total1++;
-        }
-      }
-      for (let i = 80; i < 160; i++) {
-        if (this.resuleArray[i] == 1) {
-          total2++;
-        }
-      }
-      console.log("动物个数:" + this.abcsum + "  0个数:" + this.digsum);
-      this.rate1 = this.getResultRatio(total1, 80);
-      this.rate2 = this.getResultRatio(total2, 80);
-      this.rate3 = this.getResultRatio(this.abcsum, 40);
-      this.rate4 = this.getResultRatio(this.digsum, 31);
-
-      this.tableData[0].accary1 = this.rate1;
-      this.tableData[0].accary2 = this.rate3;
-      this.tableData[1].accary1 = this.rate2;
-      this.tableData[1].accary2 = this.rate4;
-      return this.resultNum;
-    },
-    getResultRatio(num, total) {
-      return Math.round((num / total) * 10000) / 100.0;
-    },
-
-    getArrayItems(arr) {
-      //随机生成数组用于初始
-      //新建一个数组,将传入的数组复制过来,用于运算,而不要直接操作传入的数组;
-      var temp_array = new Array();
-      for (var index in arr) {
-        temp_array.push(arr[index]);
-      }
-      //取出的数值项,保存在此数组
-      var return_array = new Array();
-      for (var i = 0; i < arr.length; i++) {
-        //判断如果数组还有可以取出的元素,以防下标越界
-        if (temp_array.length > 0) {
-          //在数组中产生一个随机索引
-          var arrIndex = Math.floor(Math.random() * temp_array.length);
-          //将此随机索引的对应的数组元素值复制出来
-          return_array[i] = temp_array[arrIndex];
-          //然后删掉此索引的数组元素,这时候temp_array变为新的数组
-          temp_array.splice(arrIndex, 1);
-        } else {
-          //数组中数据项取完后,退出循环,比如数组本来只有10项,但要求取出20项.
-          break;
-        }
-      }
-      return return_array;
-    },
-    begintime() {
-      // debugger;
-      this.isclick = true; //取反
-      this.isBody2 = true;
-      //this.changed=true;
-      // debugger;
-
-      var count = 0;
-      let _this = this;
-      this.timer = setInterval(function() {
-        var h = parseInt(count / 1000 / 60 / 60);
-        var m = parseInt(count / 1000 / 60) % 60;
-        var s = parseInt(count / 1000) % 60;
-        h = h < 10 ? "0" + h : h;
-        m = m < 10 ? "0" + m : m;
-        s = s < 10 ? "0" + s : s;
-        _this.time1 = h + "时" + m + "分" + s + "秒";
-        count = count + 1000;
-      }, 1000);
-
-      console.log("执行了什么");
-      this.check();
-    },
-    check() {
-      let _this = this;
-      this.timer2 = setTimeout(function() {
-        if (_this.changed == true) {
-          _this.changed = false;
-        } else {
-          _this.idomevent(4);
-          _this.changed = false;
-        }
-      }, 2000);
-    },
-    closeWindow() {
-      this.cdv = false;
-      this.tc = false;
-    },
-    save1() {
-      this.cdv = true;
-      this.tc = true;
-      clearInterval(this.timer);
-    },
-    save() {
-      // console.log(this.resuleArray);
-
-      for (let i = 0; i < this.resuleArray.length; i++) {
-        if (this.resuleArray[i] == 1) this.grade++;
-      }
-
-      // console.log("成绩为", this.grade);
-      // console.log("时间为", this.time1); //做题时间
-
-      // var question7 = {
-      //   questionNo: "7",
-      //   gradea: [this.rate1, this.rate3],
-      //   gradeb: [this.rate2, this.rate4],
-      //   gradec: this.grade,
-      //   mina: this.time1,
-      //   memoryType: this.memoryType,
-      //   correlationMemory: this.correlationMemory,
-      //   status: this.status,
-      // };
-
-      //提交成绩
-      if (!sessionStorage.getItem("userInfo")) {
-        this.$toast("请先登录!");
-        this.$router.push("/login");
-      } else {
-        //是即时测试并且是全流程保存数据
-        this.$http.post(
-          "/cognize/ProspectiveMemory",
-          {
-            userId: this.userId,
-            score: this.grade,
-            testPlanld: this.$route.query.testPlanld || ""
-          },
-          res => {
-            if (parseInt(res.code) === 200) {
-              this.$toast.success({
-                message: "数据提交成功!"
-              });
-
-              if (res.data && res.data != null) {
-                //跳转测试结果页
-                this.goTestResult(res.data);
-              } else {
-                //跳转列表选择页
-                this.$toast.fail(res.msg);
-              }
-            } else {
-              this.$toast.fail("服务器内部故障,请联系管理员");
-            }
-          }
-        );
-      }
-
-      //跳转路由
-    },
-    throttle() {
-      clearTimeout(this.throttleTimer);
-      this.throttleTimer = setTimeout(() => {
-        this.save();
-      }, 500);
-    }
-  },
-  watch: {
-    flag: {
-      handler() {
-        if (this.flag == 160) {
-          this.isimg = false;
-          this.complete = true;
-          this.getNextButtonShow = false;
-          clearInterval(this.timer);
-          clearTimeout(this.timer2);
-          this.isin = false;
-
-          this.isBody2 = false;
-          // this.isBody3 = true;
-          console.log("测试结束");
-          this.throttle();
-        }
-        if (this.flag == 80) {
-          this.isbreak = false;
-        }
-        this.changed = true;
-        clearTimeout(this.timer2);
-        this.changed = false;
-        this.check();
-        console.log(this.flag);
-      }
-    }
-  }
-};
-</script>
-
-<style lang="scss" scoped>
-.main-container {
-  &.active-bg {
-    background: url("~@/assets/congnitiveAblitity/zhixing.png") no-repeat center;
-    background-size: 100% 100%;
-  }
-
-  .glass {
-    background: transparent;
-  }
-}
-
-.bTitle {
-  /*font-size: 24px;*/
-  font-size: 18px;
-  color: #333333;
-  text-align: left;
-  text-indent: 10px;
-}
-
-#t1 {
-  font-size: 14px;
-  /* margin-top: 30px; */
-  height: 20px;
-  line-height: 20px;
-  background: rgba(0, 0, 0, 0.39);
-  border-radius: 24px;
-  color: #ffffff;
-  margin-left: 225px;
-  padding: 10px;
-}
-
-#body2 {
-  box-sizing: border-box;
-  padding: 0 5px;
-  margin-top: 15px;
-  width: 100%;
-  height: 360px;
-  border: 1px solid #000000;
-}
-
-.optionRight {
-  width: 50%;
-  height: 360px;
-  float: right;
-  border-left: 1px solid #000000;
-}
-
-.optionBtn {
-  margin: 70px 0 20px;
-  display: flex;
-  flex-direction: row;
-  justify-content: space-between;
-  align-items: center;
-}
-
-.item {
-  width: 200px;
-  height: 210px;
-  margin-top: 20px;
-  margin-right: 10px;
-  float: left;
-}
-
-.el-image {
-  width: 100%;
-  height: 100%;
-}
-
-.btn {
-  margin-top: 60px;
-  /*margin-left: -10%;*/
-  padding: 0 10px;
-}
-
-.pbg {
-  position: fixed;
-  left: 0;
-  top: 0;
-  right: 0;
-  bottom: 0;
-  z-index: 100;
-  background: rgba(0, 0, 0, 0.7);
-}
-
-.mainbody {
-  height: 550px;
-  width: 500px;
-  border: 2px solid black;
-  border-radius: 12px;
-  background: #ffffff;
-}
-
-/*居中效果*/
-.middle {
-  /*使左上角对应到父元素的中心*/
-
-  top: 50%;
-  left: 50%;
-  position: absolute;
-  /*向左向上偏移50%*/
-  transform: translate(-50%, -50%);
-}
-
-.activeTask3 {
-  background: url(../../assets/congnitiveAblitity/zhixing.png) no-repeat center;
-  background-size: cover;
-  /* background: black; */
-  /* position: fixed;
-  top: 0;
-  left: 0;
-  right: 0;
-  bottom: 0; */
-}
-
-.start-bb {
-  width: 170px;
-  height: 48px;
-  background: rgb(87, 172, 187);
-  border: 2px solid rgba(255, 255, 255, 0.8);
-  box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
-  opacity: 1;
-  border-radius: 39px;
-  color: white;
-}
-</style>

+ 872 - 0
src/views/cognitiveTask/prospectiveMemoryAbility_bak1.vue

@@ -0,0 +1,872 @@
+<template>
+  <div class="app-container">
+    <Header />
+    <div v-if="!running" class="main-container" style="padding-left: 1.5rem">
+      <van-nav-bar :title="subjectInfo.name" left-arrow @click-left="goBack" />
+
+      <div class="main-text-div">
+        {{
+          practiceFlag
+            ? "请先练习测试,练习完成后,即将正式测试。"
+            : "请开始正式测试!"
+        }}
+      </div>
+      <div class="start-btn">
+        <van-button
+          block
+          round
+          size="normal"
+          type="primary"
+          @click="startTest()"
+        >
+          {{ practiceFlag ? "开始练习" : "正式测试" }}
+        </van-button>
+      </div>
+    </div>
+
+    <div v-if="running" class="activeTask">
+      <van-progress
+        v-if="!practiceFlag"
+        :percentage="(currentIndex / collectedDataArray.length) * 100"
+        :show-pivot="false"
+      />
+      <div id="game" class="flex-row">
+        <img
+          v-if="showPic"
+          id="missile"
+          ref="missile"
+          :src="collectedDataArray[currentIndex].leftImg"
+          alt=""
+          draggable="false"
+        />
+        <img
+          v-if="showPic"
+          id="compass"
+          ref="compass"
+          :src="collectedDataArray[currentIndex].rightImg"
+          alt=""
+          draggable="false"
+        />
+      </div>
+
+      <div class="button-area flex-row">
+        <img
+          v-for="(item, index) in imgJSON"
+          :key="item.src"
+          :class="{ active: item.active }"
+          :src="`${imgBaseUrl}static/flying/${item.src}.png`"
+          alt=""
+          class="button-item"
+          @click="keyDown({ code: item.code }, index)"
+        />
+      </div>
+      <div v-if="false" id="tip">
+        <img v-if="currentArrowImg" id="arrow" :src="currentArrowImg" alt="" />
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { dateFormat } from "@/utils/utils";
+import Header from "@/components/header/index.vue";
+import { generateRandomRangeNumbers } from "../../utils/utils";
+
+export default {
+  name: "prospectiveMemoryAbility",
+  components: { Header },
+  data() {
+    return {
+      subjectInfo: {}, //认知任务详情
+      userId: "",
+
+      imgJSON: [
+        { active: false, src: "key_left", code: "ArrowLeft" },
+        { active: false, src: "key_a", code: "KeyA" },
+        { active: false, src: "key_s", code: "KeyS" },
+        { active: false, src: "key_d", code: "KeyD" },
+        { active: false, src: "key_space", code: "Space" },
+        { active: false, src: "key_right", code: "ArrowRight" }
+      ],
+      imgBaseUrl: process.env.NODE_ENV === "production" ? "/h5/" : "/",
+
+      disabled: true, // 是否处于注视点时长内,如果是,在不响应任何按键
+
+      running: false, // 游戏是否开始
+      practiceFlag: true, // 是否处于练习模式,默认是练习模式
+
+      currentIndex: 0,
+      selectedDirection: "", // 用户选择的方向,left 或 right
+      selectedKey: "", // 用户当前选择的按键,用于阻止重复选择
+      pseudoRandomArray: [
+        // 伪随机数组,前72个是主任务,后8个是前瞻性任务
+        // 第1-12个是左键-A键, 第13-24个是左键-S键, 第25-36个是左键-D键, 第37-48个是右键-A键, 第49-60个是右键-S键, 第61-72个是右键-D键, 第73-80个是空格键
+        { index: 0, missile: "m1s0", compass: "tjq3dc", taskType: "1" },
+        { index: 1, missile: "m1s1", compass: "tjq3dc", taskType: "1" },
+        { index: 2, missile: "m1s2", compass: "tjq3dc", taskType: "1" },
+        { index: 3, missile: "m2s0", compass: "tjq3dc", taskType: "1" },
+        { index: 4, missile: "m2s1", compass: "tjq3dc", taskType: "1" },
+        { index: 5, missile: "m2s2", compass: "tjq3dc", taskType: "1" },
+        { index: 6, missile: "m1s0", compass: "tjq2dc", taskType: "1" },
+        { index: 7, missile: "m1s1", compass: "tjq2dc", taskType: "1" },
+        { index: 8, missile: "m1s2", compass: "tjq2dc", taskType: "1" },
+        { index: 9, missile: "m2s0", compass: "tjq2dc", taskType: "1" },
+        { index: 10, missile: "m2s1", compass: "tjq2dc", taskType: "1" },
+        { index: 11, missile: "m2s2", compass: "tjq2dc", taskType: "1" },
+        { index: 12, missile: "m1s0", compass: "tjq1dc", taskType: "1" },
+        { index: 13, missile: "m1s1", compass: "tjq1dc", taskType: "1" },
+        { index: 14, missile: "m1s2", compass: "tjq1dc", taskType: "1" },
+        { index: 15, missile: "m2s0", compass: "tjq1dc", taskType: "1" },
+        { index: 16, missile: "m2s1", compass: "tjq1dc", taskType: "1" },
+        { index: 17, missile: "m2s2", compass: "tjq1dc", taskType: "1" },
+        { index: 18, missile: "m1s0", compass: "tjq4dc", taskType: "1" },
+        { index: 19, missile: "m1s1", compass: "tjq4dc", taskType: "1" },
+        { index: 20, missile: "m1s2", compass: "tjq4dc", taskType: "1" },
+        { index: 21, missile: "m2s0", compass: "tjq4dc", taskType: "1" },
+        { index: 22, missile: "m2s1", compass: "tjq4dc", taskType: "1" },
+        { index: 23, missile: "m2s2", compass: "tjq4dc", taskType: "1" },
+        { index: 24, missile: "m0s1", compass: "tjq3di", taskType: "1" },
+        { index: 25, missile: "m1s1", compass: "tjq3di", taskType: "1" },
+        { index: 26, missile: "m2s1", compass: "tjq3di", taskType: "1" },
+        { index: 27, missile: "m0s2", compass: "tjq3di", taskType: "1" },
+        { index: 28, missile: "m1s2", compass: "tjq3di", taskType: "1" },
+        { index: 29, missile: "m2s2", compass: "tjq3di", taskType: "1" },
+        { index: 30, missile: "m0s1", compass: "tjq2di", taskType: "1" },
+        { index: 31, missile: "m1s1", compass: "tjq2di", taskType: "1" },
+        { index: 32, missile: "m2s1", compass: "tjq2di", taskType: "1" },
+        { index: 33, missile: "m0s2", compass: "tjq2di", taskType: "1" },
+        { index: 34, missile: "m1s2", compass: "tjq2di", taskType: "1" },
+        { index: 35, missile: "m2s2", compass: "tjq2di", taskType: "1" },
+        { index: 36, missile: "m0s1", compass: "tjq1di", taskType: "1" },
+        { index: 37, missile: "m1s1", compass: "tjq1di", taskType: "1" },
+        { index: 38, missile: "m2s1", compass: "tjq1di", taskType: "1" },
+        { index: 39, missile: "m0s2", compass: "tjq1di", taskType: "1" },
+        { index: 40, missile: "m1s2", compass: "tjq1di", taskType: "1" },
+        { index: 41, missile: "m2s2", compass: "tjq1di", taskType: "1" },
+        { index: 42, missile: "m0s1", compass: "tjq4di", taskType: "1" },
+        { index: 43, missile: "m1s1", compass: "tjq4di", taskType: "1" },
+        { index: 44, missile: "m2s1", compass: "tjq4di", taskType: "1" },
+        { index: 45, missile: "m0s2", compass: "tjq4di", taskType: "1" },
+        { index: 46, missile: "m1s2", compass: "tjq4di", taskType: "1" },
+        { index: 47, missile: "m2s2", compass: "tjq4di", taskType: "1" },
+        { index: 48, missile: "m0s0", compass: "tyq2di", taskType: "1" },
+        { index: 49, missile: "m0s1", compass: "tyq3di", taskType: "1" },
+        { index: 50, missile: "m0s2", compass: "tyq2dc", taskType: "1" },
+        { index: 51, missile: "m1s0", compass: "tyq3dc", taskType: "1" },
+        { index: 52, missile: "m1s1", compass: "tyq2do", taskType: "1" },
+        { index: 53, missile: "m1s2", compass: "tyq3do", taskType: "1" },
+        { index: 54, missile: "m2s0", compass: "tyq2di", taskType: "1" },
+        { index: 55, missile: "m2s1", compass: "tyq3di", taskType: "1" },
+        { index: 56, missile: "m2s2", compass: "tyq2dc", taskType: "1" },
+        { index: 57, missile: "m0s1", compass: "tyq3dc", taskType: "1" },
+        { index: 58, missile: "m1s2", compass: "tyq2do", taskType: "1" },
+        { index: 59, missile: "m2s0", compass: "tyq3do", taskType: "1" },
+        { index: 60, missile: "m0s0", compass: "tyq1di", taskType: "1" },
+        { index: 61, missile: "m0s1", compass: "tyq4di", taskType: "1" },
+        { index: 62, missile: "m0s2", compass: "tyq1dc", taskType: "1" },
+        { index: 63, missile: "m1s0", compass: "tyq4dc", taskType: "1" },
+        { index: 64, missile: "m1s1", compass: "tyq1do", taskType: "1" },
+        { index: 65, missile: "m1s2", compass: "tyq4do", taskType: "1" },
+        { index: 66, missile: "m2s0", compass: "tyq1di", taskType: "1" },
+        { index: 67, missile: "m2s1", compass: "tyq4di", taskType: "1" },
+        { index: 68, missile: "m2s2", compass: "tyq1dc", taskType: "1" },
+        { index: 69, missile: "m0s1", compass: "tyq4dc", taskType: "1" },
+        { index: 70, missile: "m1s2", compass: "tyq1do", taskType: "1" },
+        { index: 71, missile: "m2s0", compass: "tyq4do", taskType: "1" },
+        { index: 72, missile: "m2s1", compass: "tnq1di", taskType: "2" },
+        { index: 73, missile: "m2s2", compass: "tnq2dc", taskType: "2" },
+        { index: 74, missile: "m0s1", compass: "tnq3do", taskType: "2" },
+        { index: 75, missile: "m1s2", compass: "tnq4dc", taskType: "2" },
+        { index: 76, missile: "m1s0", compass: "tjq1do", taskType: "2" },
+        { index: 77, missile: "m0s1", compass: "tjq2dc", taskType: "2" },
+        { index: 78, missile: "m1s2", compass: "tjq3do", taskType: "2" },
+        { index: 79, missile: "m0s0", compass: "tjq4di", taskType: "2" }
+      ],
+      currentMap: null,
+      collectedDataArray: [
+        // {
+        //   id: 1,
+        //   name: '1',
+        //   startTime: '',
+        //   missile: '',
+        //   compass: '',
+        //   taskType: '1', // 1 主任务,2 前瞻性任务
+        //   mainTaskDirectionReactionTime: '', // 主任务的方向选择反应时间
+        //   mainTaskMissileReactionTime: '', // 主任务的挂载反应时间
+        //   mainTaskDirectionCorrection: '', // 主任务的方向选择是否正确
+        //   mainTaskMissileCorrection: '', // 主任务的挂载选择是否正确
+        //   prospectiveTaskReactionTime: '', // 主任务的反应时间
+        //   prospectiveTaskCorrection: '', // 主任务的反应是否正确
+        // }
+      ],
+      collectedData: null,
+      directionKey: "",
+      missileKey: "",
+      prospectiveKey: "",
+      taskStartTime: 0, // 任务开始时间
+      taskEndTime: 0, // 任务结束时间
+      showPic: false,
+
+      showCurrentMissile: false, // 隐藏图片
+      showCurrentCompass: false // 隐藏图片
+    };
+  },
+  computed: {},
+  created() {
+    this.userId = JSON.parse(sessionStorage.getItem("userInfo")).id;
+    this.subjectInfo = JSON.parse(sessionStorage.getItem("subjectInfo"));
+
+    this.createData();
+  },
+  mounted() {},
+  watch: {},
+  methods: {
+    createData() {
+      this.pseudoRandomArray = this.pseudoRandomArray.map((item, index) => {
+        let newItem = {
+          id: 1,
+
+          leftImg: `${this.imgBaseUrl}static/flying/${item.missile}.png`,
+          rightImg: `${this.imgBaseUrl}static/flying/${item.compass}.png`,
+
+          startTime: "", // 本局开始时间
+          endTime: "", // 本局结束时间
+          onceStartTime: "",
+          onceEndTime: "",
+
+          mainTaskDirectionReactionTime: "", // 主任务的方向选择反应时间
+          mainTaskDirectionCorrection: "", // 主任务的方向选择是否正确
+          mainTaskDirectionStartTime: "", // 主任务方向选择的开始时间
+          mainTaskDirectionEndTime: "", // 主任务方向选择的结束时间
+          mainTaskDirectionCorrectionResponse: "", // 主任务方向正确反应 ['ArrowLeft' | 'ArrowRight' | '']
+          mainTaskDirectionActualResponse: "", // 主任务方向实际反应 ['ArrowLeft' | 'ArrowRight' | '其他任意按键' | '']
+
+          mainTaskMissileReactionTime: "", // 主任务的挂载反应时间
+          mainTaskMissileCorrection: "", // 主任务的挂载选择是否正确
+          mainTaskMissileStartTime: "", // 主任务武器选择的开始时间
+          mainTaskMissileEndTime: "", // 主任务武器选择的结束时间
+          mainTaskMissileCorrectionResponse: "", // 主任务挂载正确反应 ['KeyA' | 'KeyS' | 'KeyD' | '']
+          mainTaskMissileActualResponse: "", // 主任务挂载实际反应 ['KeyA' | 'KeyS' | 'KeyD' | '其他任意按键' | '']
+
+          prospectiveTaskReactionTime: "", // 前瞻性记忆任务的反应时间
+          prospectiveTaskCorrection: "", // 前瞻性记忆任务的反应是否正确
+          prospectiveTaskStartTime: "", // 前瞻性记忆任务反应的开始时间
+          prospectiveTaskEndTime: "", // 前瞻性记忆任务反应的结束时间
+          prospectiveTaskCorrectionResponse: "", // 前瞻性记忆任务正确反应  ['Space' | '']
+          prospectiveTaskActualResponse: "" // 前瞻性记忆任务实际反应  ['Space' | 'ArrowLeft' | 'ArrowRight' | '其他任意按键' | '']
+        };
+        // 第1-12个是左键-A键,
+        // 第13-24个是右键-A键,
+        // 第25-36个是左键-S键,
+        // 第37-48个是右键-S键,
+        // 第49-60个是左键-D键,
+        // 第61-72个是右键-D键,
+        // 第73-80个是空格键
+        if (index < 12) {
+          newItem.mainTaskDirectionCorrectionResponse = "ArrowLeft";
+          newItem.mainTaskMissileCorrectionResponse = "KeyA";
+        } else if (index >= 12 && index < 24) {
+          newItem.mainTaskDirectionCorrectionResponse = "ArrowRight";
+          newItem.mainTaskMissileCorrectionResponse = "KeyA";
+        } else if (index >= 24 && index < 36) {
+          newItem.mainTaskDirectionCorrectionResponse = "ArrowLeft";
+          newItem.mainTaskMissileCorrectionResponse = "KeyS";
+        } else if (index >= 36 && index < 48) {
+          newItem.mainTaskDirectionCorrectionResponse = "ArrowRight";
+          newItem.mainTaskMissileCorrectionResponse = "KeyS";
+        } else if (index >= 48 && index < 60) {
+          newItem.mainTaskDirectionCorrectionResponse = "ArrowLeft";
+          newItem.mainTaskMissileCorrectionResponse = "KeyD";
+        } else if (index >= 60 && index < 72) {
+          newItem.mainTaskDirectionCorrectionResponse = "ArrowRight";
+          newItem.mainTaskMissileCorrectionResponse = "KeyD";
+        } else {
+          newItem.prospectiveTaskCorrectionResponse = "Space";
+        }
+
+        return { ...item, ...newItem };
+      });
+    },
+
+    startTest() {
+      // 进入全屏
+      this.currentIndex = 0;
+      this.running = true;
+      if (this.practiceFlag) {
+        let tempArray = generateRandomRangeNumbers(1, 72, 6);
+        this.collectedDataArray = tempArray.map(index => {
+          return this.pseudoRandomArray[index - 1];
+        });
+        let tempArray_1 = generateRandomRangeNumbers(72, 80, 1);
+        this.collectedDataArray.push(
+          this.pseudoRandomArray[tempArray_1[0] - 1]
+        );
+      } else {
+        this.taskStartTime = Date.now();
+        this.collectedDataArray = this.pseudoRandomArray;
+      }
+      console.log("this.collectedDataArray: ", this.collectedDataArray);
+      this.collectedDataArray = this.collectedDataArray.sort(
+        () => Math.random() - 0.5
+      );
+      this.next();
+    },
+
+    next() {
+      console.log(
+        "currentIndex / collectedDataArray.length: ",
+        this.currentIndex / this.collectedDataArray.length
+      );
+      if (this.currentIndex < this.collectedDataArray.length) {
+        console.log(" ------------------------------------------ ");
+        console.log(
+          " ---- current:  ",
+          this.collectedDataArray[this.currentIndex]
+        );
+        console.log(" ------------------------------------------ ");
+        setTimeout(() => {
+          // 注视点时长300-500之间
+          setTimeout(
+            () => (this.disabled = false),
+            Math.floor(Math.random() * 200 + 300)
+          );
+          this.collectedDataArray[
+            this.currentIndex
+          ].startTime = performance.now();
+          this.collectedDataArray[this.currentIndex].onceStartTime = Date.now();
+          this.collectedDataArray[
+            this.currentIndex
+          ].mainTaskDirectionStartTime = performance.now();
+          this.collectedDataArray[
+            this.currentIndex
+          ].mainTaskMissileStartTime = performance.now();
+          this.collectedDataArray[
+            this.currentIndex
+          ].prospectiveTaskStartTime = performance.now();
+          this.showPic = true;
+        }, 240); // 空屏 500 毫秒
+
+        this.disabled = true; // 开启注视点时长控制
+      } else {
+        // 结束游戏
+        if (this.practiceFlag) {
+          // 游戏结束时,如果是练习模式,则不发送数据,,,并且
+          this.running = false; // 退出游戏
+          this.collectedDataArray = []; // 清理数据
+          // 否则进入正式测试模式
+          this.practiceFlag = false; // 将练习标识改成 false,下次开始游戏时,则为正式测试
+          console.log(
+            "--------------------------------------------------===============================================--------------------------------"
+          );
+        } else {
+          // 如果不是测试模式,则发送,发送完成后,退出游戏,退出全屏,清理数据
+          this.sendCollectedData();
+        }
+      }
+    },
+    sendCollectedData() {
+      // 计算各种反应时间,单位秒,保留两位小数
+      const result = this.collectedDataArray.map(data => {
+        return {
+          ...data,
+          startTime: dateFormat(
+            "YY-mm-dd HH:MM:SS",
+            new Date(data.onceStartTime)
+          ),
+          endTime: dateFormat("YY-mm-dd HH:MM:SS", new Date(data.onceEndTime)),
+          onceStartTime: dateFormat(
+            "YY-mm-dd HH:MM:SS",
+            new Date(data.onceStartTime)
+          ),
+          onceEndTime: dateFormat(
+            "YY-mm-dd HH:MM:SS",
+            new Date(data.onceEndTime)
+          ),
+          responseTime: (data.endTime - data.startTime).toFixed(2)
+        };
+      });
+
+      // 计算各种成绩和准确率
+      const {
+        prospectiveTaskScore,
+        prospectiveTaskCount,
+        prospectiveTaskRight,
+        mainTaskDirectionScore,
+        mainTaskDirectionCount,
+        mainTaskDirectionRight,
+        mainTaskMissileScore,
+        mainTaskMissileCount,
+        mainTaskMissileRight
+      } = result.reduce(
+        (obj, task) => {
+          if (task.taskType === "1") {
+            if (task.mainTaskDirectionCorrection === "1") {
+              obj.mainTaskDirectionScore++;
+              obj.mainTaskDirectionRight++;
+            }
+            obj.mainTaskDirectionCount++;
+            if (task.mainTaskDirectionCorrection === "1") {
+              obj.mainTaskMissileScore++;
+              obj.mainTaskMissileRight++;
+            }
+            obj.mainTaskMissileCount++;
+          } else {
+            if (task.prospectiveTaskCorrection === "1") {
+              obj.prospectiveTaskScore++;
+              obj.prospectiveTaskRight++;
+            }
+            obj.prospectiveTaskCount++;
+          }
+          return obj;
+        },
+        {
+          prospectiveTaskScore: 0, // 前瞻性任务成绩
+          prospectiveTaskCount: 0, // 前瞻性任务数量
+          prospectiveTaskRight: 0, // 前瞻性任务正确数量
+
+          mainTaskDirectionScore: 0, // 主任务方向选择成绩
+          mainTaskDirectionCount: 0, // 主任务方向选择数量
+          mainTaskDirectionRight: 0, // 主任务方向选择正确数量
+
+          mainTaskMissileScore: 0, // 主任务子弹选择成绩
+          mainTaskMissileCount: 0, // 主任务子弹选择数量
+          mainTaskMissileRight: 0 // 主任务子弹选择正确数量
+        }
+      );
+
+      const prospectiveTaskAccuracy = (
+        prospectiveTaskRight / prospectiveTaskCount
+      ).toFixed(4);
+      const mainTaskDirectionAccuracy = (
+        mainTaskDirectionRight / mainTaskDirectionCount
+      ).toFixed(4);
+      const mainTaskMissileAccuracy = (
+        mainTaskMissileRight / mainTaskMissileCount
+      ).toFixed(4);
+
+      this.taskEndTime = Date.now();
+      console.log(
+        "xxx前瞻性记忆任务:",
+        this.taskEndTime - this.taskStartTime + "ms"
+      );
+
+      const data = {
+        userId: this.userId,
+        testPlanId: this.$route.query.testPlanId || "",
+        prospectiveTaskScore, // 前瞻性任务成绩
+        prospectiveTaskAccuracy, // 前瞻性任务平均准确率
+        mainTaskDirectionScore, // 主任务方向选择成绩
+        mainTaskDirectionAccuracy, // 主任务方向选择平均准确率
+        mainTaskMissileScore, // 主任务子弹选择成绩
+        mainTaskMissileAccuracy, //  主任务子弹选择准确率
+        result,
+        taskStartTime: dateFormat(
+          "YY-mm-dd HH:MM:SS",
+          new Date(this.taskStartTime)
+        ),
+        taskEndTime: dateFormat("YY-mm-dd HH:MM:SS", new Date(this.taskEndTime))
+      };
+
+      console.log(" ------ 前瞻性任务提交数据:", data);
+      console.log(
+        " ------ 前瞻性任务提交数据:",
+        data.result.filter(item => item.taskType === "1").length
+      );
+      this.$http.post("/cognize/ProspectiveMemory", data, res => {
+        console.log(res);
+        if (parseInt(res.code) === 200) {
+          this.$toast({
+            type: "success",
+            message: "数据提交成功",
+            className: "rotate-90-toast"
+          });
+          if (res.data) {
+            //跳转测试结果页
+            this.goTestResult(res.data);
+          } else {
+            //跳转列表选择页
+            this.$toast({
+              type: "fail",
+              message: res.msg,
+              className: "rotate-90-toast"
+            });
+          }
+        } else {
+          this.$toast({
+            type: "fail",
+            message: "服务器内部故障,请联系管理员",
+            className: "rotate-90-toast"
+          });
+        }
+        // 退出游戏
+        this.running = false;
+        // 发送数据之后,清理数据
+        this.collectedDataArray = [];
+        this.maps.forEach(map => (map.count = 0));
+      });
+    },
+    keyDown(e, index) {
+      if (this.disabled) {
+        console.log("注视点时长内不响应任何按键");
+        return;
+      } // 注视点时长内不响应任何按键
+      this.disabled = true;
+
+      this.imgJSON[index].active = true;
+      setTimeout(() => {
+        this.imgJSON[index].active = false;
+      }, 200);
+
+      if (this.collectedDataArray[this.currentIndex].taskType === "1") {
+        // 主任务
+        console.log("主任务");
+
+        // 先选择方向
+        if (
+          this.collectedDataArray[this.currentIndex]
+            .mainTaskDirectionActualResponse === ""
+        ) {
+          // 主任务方向的实际反应
+
+          // 记录主任务的方向选择按键
+          this.collectedDataArray[
+            this.currentIndex
+          ].mainTaskDirectionActualResponse = e.code;
+          // 记录主任务的方向选择反应时间
+          this.collectedDataArray[
+            this.currentIndex
+          ].mainTaskDirectionEndTime = performance.now();
+          // 记录主任务的方向选择按键
+          this.collectedDataArray[
+            this.currentIndex
+          ].mainTaskDirectionReactionTime = (
+            this.collectedDataArray[this.currentIndex]
+              .mainTaskDirectionEndTime -
+            this.collectedDataArray[this.currentIndex]
+              .mainTaskDirectionStartTime
+          ).toFixed(2);
+
+          // 判断主任务方向反应是否正确 ‘1’:正确  '0':错误
+          if (
+            this.collectedDataArray[this.currentIndex]
+              .mainTaskDirectionActualResponse ===
+            this.collectedDataArray[this.currentIndex]
+              .mainTaskDirectionCorrectionResponse
+          ) {
+            this.collectedDataArray[
+              this.currentIndex
+            ].mainTaskDirectionCorrection = "1";
+            console.log("方向选择正确");
+            if (this.practiceFlag) {
+              this.$toast({
+                type: "success",
+                message: "方向反应正确",
+                className: "rotate-90-toast"
+              });
+            }
+            this.disabled = false;
+          } else {
+            this.collectedDataArray[
+              this.currentIndex
+            ].mainTaskDirectionCorrection = "0";
+            if (e.code === "Space") {
+              console.log("主任务不可以点击空格键");
+              if (this.practiceFlag) {
+                this.$toast({
+                  type: "fail",
+                  message: "方向反应错误,主任务不可以点击空格键",
+                  className: "rotate-90-toast"
+                });
+              }
+              this.collectedDataArray[
+                this.currentIndex
+              ].mainTaskMissileCorrection = "0";
+
+              this.collectedDataArray[
+                this.currentIndex
+              ].endTime = performance.now(); // 记录本局结束时间
+              this.collectedDataArray[
+                this.currentIndex
+              ].onceEndTime = Date.now(); // 记录本试次结束时间
+
+              setTimeout(() => {
+                this.disabled = false;
+                this.showPic = false;
+                // 本次主任务结束,进入下一次
+                this.currentIndex++;
+                this.next();
+              }, 500);
+            } else {
+              this.disabled = false;
+              console.log("方向反应错误");
+              if (this.practiceFlag) {
+                this.$toast({
+                  type: "fail",
+                  message: "方向反应错误",
+                  className: "rotate-90-toast"
+                });
+              }
+            }
+          }
+        } else {
+          // 如果方向键已经选择过,说明本次按键是为了选择武器挂载的
+          // 主任务挂载的实际反应
+          if (
+            this.collectedDataArray[this.currentIndex]
+              .mainTaskMissileActualResponse === ""
+          ) {
+            // 记录主任务的武器选择按键
+            this.collectedDataArray[
+              this.currentIndex
+            ].mainTaskMissileActualResponse = e.code;
+            // 记录主任务的武器选择反应时间
+            this.collectedDataArray[
+              this.currentIndex
+            ].mainTaskMissileEndTime = performance.now();
+            // 记录主任务的武器选择按键
+            this.collectedDataArray[
+              this.currentIndex
+            ].mainTaskMissileReactionTime = (
+              this.collectedDataArray[this.currentIndex]
+                .mainTaskMissileEndTime -
+              this.collectedDataArray[this.currentIndex]
+                .mainTaskMissileStartTime
+            ).toFixed(2);
+
+            // 判断主任务挂载反应是否正确 ‘1’:正确  '2':错误
+            if (
+              this.collectedDataArray[this.currentIndex]
+                .mainTaskMissileActualResponse ===
+              this.collectedDataArray[this.currentIndex]
+                .mainTaskMissileCorrectionResponse
+            ) {
+              this.collectedDataArray[
+                this.currentIndex
+              ].mainTaskMissileCorrection = "1";
+              console.log("武器选择正确");
+              if (this.practiceFlag) {
+                this.$toast({
+                  type: "success",
+                  message: "挂载反应正确",
+                  className: "rotate-90-toast"
+                });
+              }
+            } else {
+              this.collectedDataArray[
+                this.currentIndex
+              ].mainTaskMissileCorrection = "0";
+              console.log("武器选择错误");
+              if (this.practiceFlag) {
+                this.$toast({
+                  type: "fail",
+                  message:
+                    e.code === "Space"
+                      ? "挂载反应错误,主任务不可以点击空格键"
+                      : "挂载反应错误",
+                  className: "rotate-90-toast"
+                });
+              }
+            }
+          } else {
+            console.log("按键错误");
+          }
+
+          this.collectedDataArray[
+            this.currentIndex
+          ].endTime = performance.now(); // 记录本局结束时间
+          this.collectedDataArray[this.currentIndex].onceEndTime = Date.now(); // 记录本试次结束时间
+
+          setTimeout(() => {
+            this.disabled = false;
+            this.showPic = false;
+            // 本次主任务结束,进入下一次
+            this.currentIndex++;
+            this.next();
+          }, 500);
+        }
+      } else {
+        // 前瞻性记忆任务
+        console.log("前瞻性记忆任务");
+        // 前瞻性记忆任务的实际反应
+        if (
+          this.collectedDataArray[this.currentIndex]
+            .prospectiveTaskActualResponse === ""
+        ) {
+          // 前瞻性记忆任务选择按键
+          this.collectedDataArray[
+            this.currentIndex
+          ].prospectiveTaskActualResponse = e.code;
+          // 前瞻性记忆任务结束时间
+          this.collectedDataArray[
+            this.currentIndex
+          ].prospectiveTaskEndTime = performance.now();
+          // 前瞻性记忆任务反应时间
+          this.collectedDataArray[
+            this.currentIndex
+          ].prospectiveTaskReactionTime = (
+            this.collectedDataArray[this.currentIndex].prospectiveTaskEndTime -
+            this.collectedDataArray[this.currentIndex].prospectiveTaskStartTime
+          ).toFixed(2);
+
+          // 判断主任务挂载反应是否正确 ‘1’:正确  '2':错误
+          if (
+            this.collectedDataArray[this.currentIndex]
+              .prospectiveTaskActualResponse ===
+            this.collectedDataArray[this.currentIndex]
+              .prospectiveTaskCorrectionResponse
+          ) {
+            this.collectedDataArray[
+              this.currentIndex
+            ].prospectiveTaskCorrection = "1";
+            console.log("前瞻性记忆任务选择正确");
+            if (this.practiceFlag) {
+              this.$toast({
+                type: "success",
+                message: "前瞻性记忆任务反应正确",
+                className: "rotate-90-toast"
+              });
+            }
+          } else {
+            this.collectedDataArray[
+              this.currentIndex
+            ].prospectiveTaskCorrection = "0";
+            console.log("前瞻性记忆任务选择错误");
+            if (this.practiceFlag) {
+              this.$toast({
+                type: "fail",
+                message: "前瞻性记忆任务反应错误",
+                className: "rotate-90-toast"
+              });
+            }
+          }
+
+          this.collectedDataArray[
+            this.currentIndex
+          ].endTime = performance.now(); // 记录本局结束时间
+          this.collectedDataArray[this.currentIndex].onceEndTime = Date.now(); // 记录本试次结束时间
+
+          setTimeout(() => {
+            this.disabled = false;
+            this.showPic = false;
+            // 本次前瞻性记忆任务结束,进入下一次
+            this.currentIndex++;
+            this.next();
+          }, 500);
+        } else {
+          this.disabled = false;
+          this.showPic = false;
+          // 本次前瞻性记忆任务结束,进入下一次
+          this.currentIndex++;
+          this.next();
+        }
+      }
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.app-container {
+  transform: rotate(90deg);
+  transform-origin: right top;
+  width: 100vh; /* 适应横屏的高度 */
+  height: 100vw; /* 适应横屏的宽度 */
+  overflow-x: hidden;
+  position: fixed;
+  top: 100%;
+  right: 0;
+
+  .main-container {
+    width: 90vh;
+    height: 100vw;
+
+    .start-btn {
+      position: absolute;
+      bottom: 30px;
+      left: 50%;
+      transform: translateX(-50%);
+    }
+  }
+
+  .activeTask {
+    background: url(/static/flying/bg_game.png) no-repeat center;
+    background-size: cover;
+    position: fixed;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+
+    #game {
+      width: 100%;
+      height: calc(100% - 40px);
+      position: absolute;
+      top: 0;
+      left: 0;
+      //border: 1px solid black;
+      background-image: url(/static/flying/dashboard.png);
+      background-repeat: no-repeat;
+      background-size: 94% 98%;
+      background-position: center;
+      justify-content: space-around;
+
+      img {
+        margin-bottom: 1%;
+
+        &:first-child {
+          margin-left: 4%;
+          width: 34%;
+          height: 70%;
+        }
+
+        &:last-child {
+          margin-right: 1%;
+          width: 278px;
+          height: 277px;
+        }
+      }
+    }
+
+    .button-area {
+      width: 90%;
+      height: 40px;
+      position: absolute;
+      bottom: 0;
+      left: 5%;
+      justify-content: space-around;
+
+      .button-item {
+        width: 96px;
+        height: 36px;
+        display: block;
+        transition: all 0.12s linear;
+
+        &.active {
+          scale: 1.08;
+        }
+      }
+    }
+  }
+}
+
+#tip {
+  width: 809px;
+  height: 100px;
+  position: absolute;
+  left: 50%;
+  top: 800px;
+  transform: translateX(-50%);
+  background-color: #0abdc4;
+}
+
+#arrow {
+  width: 32px;
+  height: 32px;
+}
+</style>
+
+<style scoped>
+.van-toast {
+  transform: rotate(90deg) translate(-50%, 50%) !important;
+}
+</style>

+ 20 - 5
src/views/cognitiveTask/riskPolicy/formal.vue

@@ -309,8 +309,8 @@ export default {
           this.totalAerated += this.aeratedCount;
           // 记录原始数据
           this.userData.push({
-            onceStartTime: this.onceStartTime,
-            onceEndTime: Date.now(),
+            onceStartTime: dateFormat("YY-mm-dd HH:MM:SS", new Date()),
+            onceEndTime: dateFormat("YY-mm-dd HH:MM:SS", new Date()),
             index: this.currentLevel + 1,
             // currentEarn: this.currentEarn,
             currentEarn: 0,
@@ -373,8 +373,8 @@ export default {
         this.totalAerated += this.aeratedCount;
         // 记录原始数据
         this.userData.push({
-          onceStartTime: this.onceStartTime,
-          onceEndTime: Date.now(),
+          onceStartTime: dateFormat("YY-mm-dd HH:MM:SS", new Date()),
+          onceEndTime: dateFormat("YY-mm-dd HH:MM:SS", new Date()),
           index: this.currentLevel + 1,
           currentEarn: this.currentEarn,
           numberPumps: this.aeratedCount,
@@ -405,7 +405,22 @@ export default {
       this.taskEndTime = Date.now();
       console.log(
         "xxx决策倾向:",
-        this.taskEndTime - this.taskStartTime + "ms"
+        this.taskEndTime - this.taskStartTime + "ms",
+        {
+          userId: this.userId,
+          totalEarned: this.totalEarn,
+          rawData: this.userData,
+          testPlanId: this.$route.query.testPlanId || "",
+          totalAerated: this.totalAerated,
+          taskStartTime: dateFormat(
+            "YY-mm-dd HH:MM:SS",
+            new Date(this.taskStartTime)
+          ),
+          taskEndTime: dateFormat(
+            "YY-mm-dd HH:MM:SS",
+            new Date(this.taskEndTime)
+          )
+        }
       );
       this.$http.post(
         "cognize/RDT",

+ 10 - 1
src/views/cognitiveTask/shapeIntuition.vue

@@ -293,7 +293,16 @@ export default {
         this.testState = false;
         this.button0Show = false;
         this.button1Show = false;
-        console.log(this.userResponseRecords);
+        console.log(
+          this.userResponseRecords,
+          {
+            userId: this.userId,
+            userScore: userScore + "%",
+            userResponseRecords: this.userResponseRecords,
+            testPlanId: this.testPlanId
+          },
+          "hahahahhaahaha啊哈哈哈"
+        );
         this.$http.post(
           `/cognize/SHAPE`,
           {

+ 3 - 2
src/views/cognitiveTask/taskDetail.vue

@@ -4,7 +4,8 @@
     <div class="main-container">
       <van-nav-bar left-arrow title="认知任务" @click-left="goBack" />
       <div class="main-outline">
-        <div v-if="taskId == 9 || taskId == 10" class="task-swiper">
+        <!--        <div v-if="taskId == 9 || taskId == 10" class="task-swiper">-->
+        <div v-if="taskId == 10" class="task-swiper">
           <IntroduceSwiper v-if="taskId == 9" @end="goTest"></IntroduceSwiper>
           <IntroduceDemo
             v-if="taskId == 10"
@@ -27,7 +28,7 @@
             <p class="desc" v-html="subjectInfo.description"></p>
           </div>
         </div>
-        <div v-if="taskId == 9 || taskId == 10"></div>
+        <div v-if="taskId == 10"></div>
         <div v-else class="task-swiper">
           <van-button
             block

+ 25 - 9
src/views/user/cognitiveTaskOldTestRecord.vue

@@ -22,7 +22,13 @@
               <th>项目</th>
               <th>内容</th>
             </tr>
+            <!--            {{-->
+            <!--              resResult-->
+            <!--            }}-->
             <tr v-for="(item, index) in resResult" :key="index">
+              <!--              {{-->
+              <!--                resResult-->
+              <!--              }}-->
               <td class="td-result">{{ item.name }}</td>
               <td class="td-result">{{ item.score }}</td>
             </tr>
@@ -44,8 +50,8 @@
 
         <div class="btnArea">
           <van-button round size="small" type="primary" @click="download"
-            >下载测试结果</van-button
-          >
+            >下载测试结果
+          </van-button>
         </div>
       </div>
     </div>
@@ -74,7 +80,8 @@ export default {
       type: "", //量表类型0是量表,1是认知任务
       id: "", //来自测试列表
       from: "", //1-来自首页量表,2-来自测试记录列表页
-      testPlanId: "" //来自测试计划
+      testPlanId: "", //来自测试计划
+      testResultData: {}
     };
   },
   computed: {
@@ -106,18 +113,27 @@ export default {
     inits(id) {
       this.$http.get(`getRecordById?id=${id}`, {}, res => {
         //当返回正确的话
+        console.log(res.data.userRecordEntity, "res结果页面");
+        this.testResultData = res.data;
         if (res && res.code == 200) {
           this.type = res.data?.userRecordEntity.type;
           // console.log(res,"认知任务返回")
 
           const datas = res.data.userRecordEntity.testResult;
+          if (res.data.userRecordEntity.flag === "ProspectiveMemory") {
+            // this.getDataList(datas);
+            this.resResult.push({
+              name: "前瞻性记忆能力",
+              score: res.data.userRecordEntity.testResults
+            });
+          } else {
+            const resResultData =
+              typeof datas == "string"
+                ? JSON.parse(datas)[0].tableContext
+                : datas[0].tableContext;
 
-          const resResultData =
-            typeof datas == "string"
-              ? JSON.parse(datas)[0].tableContext
-              : datas[0].tableContext;
-
-          this.getDataList(resResultData);
+            this.getDataList(resResultData);
+          }
 
           //先获取到测试者
           let str = res.data.userRecordEntity.fileName;

+ 1 - 0
src/views/user/register.vue

@@ -92,6 +92,7 @@
             @focus="showAge = true"
           />
           <van-field
+            v-show="false"
             v-model="institutionNo"
             center
             clearable

+ 4 - 2
src/views/user/testRecordsSCl.vue

@@ -21,12 +21,14 @@
           <table class="inner-table">
             <tr class="table-th">
               <th>项目</th>
-              <th>内容(分数范围)</th>
+              <!--              <th>内容(分数范围)</th>-->
+              <th>内容</th>
             </tr>
             <tr v-for="(item, index) in resResult" :key="index">
               <td class="td-result">{{ item.name }}</td>
               <td class="td-result">
-                {{ item.score }}({{ item.reference }})
+                <!--                {{ item.score }}({{ item.reference }})-->
+                {{ item.score }}
               </td>
             </tr>
           </table>

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác