Преглед на файлове

修改认知任务情绪识别+点探测

plg преди 3 месеца
родител
ревизия
8b299e9167

+ 14 - 2
src/api/plan.ts

@@ -8,7 +8,7 @@ const saveSacleUrl = '/record/saveScaleRecord'
 //保存gonogo路径
 const saveGoNoGoUrl = '/record/saveSuppressionRecord'
 
-const saveFaceDotUrl = '/record/saveEmotionRecord'
+const saveFaceDotUrl = '/record/saveEmotionRecord3'
 const getDataUrl = '/plan/findCompletePlanByUser'
 
 //获取报告内容
@@ -26,7 +26,9 @@ const queryScaleDetailUrl = '/subject/findByFlag'
 const queryCognizeDetailUrl = '/cognitive/findByFlag'
 
 
-const getCurrentTimeUrl = '/system/getSystemTime  '
+const getCurrentTimeUrl = '/system/getSystemTime'
+
+const saveETBUrl = '/record/saveEmotionRecord'
 //首页API
 export const homeApi = (val: any) => {
     return http<any>(
@@ -153,5 +155,15 @@ export const getCurrentTimeApi = () => {
     })
 }
 
+//保存认知任务信息
+export const saveETBApi = (val: any) => {
+    return http<any>({
+        method: 'post',
+        url: saveETBUrl,
+        data: { ...val }
+    })
+
+}
+
 
 

BIN
src/assets/cognize/rememberAbilityTask.png


+ 0 - 1
src/components/CpmdQuestionnaire.vue

@@ -52,7 +52,6 @@ const questionList = ref<any>()
 const queryQuestion = async (planId: string) => {
     //
     questionList.value = [];
-    console.log(userInfo.userInfo.roleType)
     let paramsNum = ''
     if (userInfo.userInfo.roleType == '2') {
         paramsNum = '1'

+ 6 - 1
src/router/index.ts

@@ -110,7 +110,7 @@ const routes = [
     component: () => import('@/views/CognizeGoNoGo.vue')
 
   }, {
-    path: '/cognizeFaceDot/:currentType/:planId/:planName/:flag/:flagName/:num',
+    path: '/cognizeFaceDot/:planId/:planName/:flag/:flagName/:formalTest',
     name: 'cognizeFaceDot',
     component: () => import('@/views/CognizeFaceDot.vue')
 
@@ -118,6 +118,11 @@ const routes = [
     path: '/shapeIntuition_random/:planId/:planName/:flag/:flagName:/:formalTest',
     name: 'shapeIntuitionRandom',
     component: () => import('@/views/shapeIntuition_random.vue')
+  },
+  {
+    path: '/ETBexperiment_new/:planId/:planName/:flag/:flagName:/:formalTest',
+    name: 'ETBexperimentNew',
+    component: () => import('@/views/ETBexperiment_new.vue')
   }
 ]
 const router = createRouter({

+ 18 - 5
src/stores/modules/userInfo.ts

@@ -17,12 +17,23 @@ const userInfoStore = defineStore(
       account: ''
     })
     //信息--查看是否做过了练习测试
+    //这个是形状知觉测试的练习测试通过标志
     const isPass = ref<boolean>(false)
-
-
+    //这个是人脸测试通过的标志
+    const isPassETB01 = ref<boolean>(false)
+    //这是点探测的标志
+    const isPassDot = ref<boolean>(false)
     //将通过状态改变为通过false
-    const saveIspass = () => {
-      isPass.value = true;
+    const saveIspass = (flag: string) => {
+      //这个是形状知觉的练习测试通过标志
+      if (flag == '') {
+        isPass.value = true;
+      } else if (flag == 'ETB01') {
+        isPassETB01.value = true;
+      } else if (flag == 'FDOT') {
+        isPassDot.value = true
+      }
+
     }
     //保存正在进行中的计划的文本
     const savePlanCurrentNum = (val: number) => {
@@ -51,10 +62,12 @@ const userInfoStore = defineStore(
       userInfo.value = { account: '' }
       token.value = ''
       isPass.value = false
+      isPassETB01.value = false
+      isPassDot.value = false
       planCurrentNum.value = 0
       unreadNum.value = 0
     }
-    return { planCurrentNum, clearUserInfo, savePlanCurrentNum, token, saveToken, userInfo, saveUserInfo, isPass, saveIspass, unreadNum, saveUnreadNum }
+    return { planCurrentNum, clearUserInfo, savePlanCurrentNum, token, saveToken, userInfo, saveUserInfo, isPass, isPassETB01, isPassDot, saveIspass, unreadNum, saveUnreadNum }
   },
   { persist: true }
 )

+ 4 - 1
src/utils/http.ts

@@ -22,6 +22,9 @@ const menuStatus = menuStatusStore()
 // const base_url = 'http://172.28.50.2:8089'
 //少锋本地
 // const base_url = 'http://10.113.248.4:8089/'
+
+//少锋本地 版本2
+const base_url = 'http://10.113.248.4:8090/'
 //30
 // const base_url = 'http://43.143.198.30:8089/'
 //红朵
@@ -32,7 +35,7 @@ const menuStatus = menuStatusStore()
 //新服务器
 // const base_url = 'http://123.57.18.29:8089'
 //第二个版本
-const base_url = 'http://123.57.18.29:8090'
+// const base_url = 'http://123.57.18.29:8090'
 
 
 //设置axios 默认访问路径

+ 32 - 8
src/views/Cognize.vue

@@ -10,7 +10,7 @@ import { useRoute, useRouter } from 'vue-router';
 import { queryCognizeDetailApi } from '@/api/plan';
 import { userInfoStore } from '@/stores';
 
-const isPass = userInfoStore().isPass
+
 const router = useRouter()
 const route = useRoute()
 
@@ -22,7 +22,7 @@ const planId = ref<string>('')
 const type = ref<string>('')
 
 const cognizeDetail = ref<any>({})
-
+const isPass = ref<boolean>(false)
 // 查看PDF
 //刚进入页面就将高度设置为页面需要的
 onMounted(() => {
@@ -35,7 +35,12 @@ onMounted(() => {
     planId.value = route.params.planId as string
     planName.value = route.params.planName as string
     type.value = route.params.type as string
-
+    if (flag.value == 'ETB01') {
+        isPass.value = userInfoStore().isPassETB01
+    }
+    if (flag.value == 'FDOT') {
+        isPass.value = userInfoStore().isPassDot
+    }
     //根据flag 查询认知任务详情
 
     //进到界面开始轮询
@@ -61,11 +66,30 @@ const requireImg = (name: string) => {
 }
 
 const startCog = (val: number) => {
-    router.push(
-        {
-            name: 'shapeIntuitionRandom',
-            params: { planId: planId.value, planName: planName.value, flag: flag.value, flagName: cognizeDetail.value.name, formalTest: val }
-        })
+    // router.push(
+    //     {
+    //         name: 'shapeIntuitionRandom',
+    //         params: { planId: planId.value, planName: planName.value, flag: flag.value, flagName: cognizeDetail.value.name, formalTest: val }
+    //     })
+
+    //更改到 跳转到人脸表情这里的认知任务
+    if (flag.value == 'ETB01') {
+        router.push(
+            {
+                name: 'ETBexperimentNew',
+                params: { planId: planId.value, planName: planName.value, flag: flag.value, flagName: cognizeDetail.value.name, formalTest: val }
+            })
+    }
+    if (flag.value == 'FDOT') {
+        router.push(
+            {
+                name: 'cognizeFaceDot',
+                params: { planId: planId.value, planName: planName.value, flag: flag.value, flagName: cognizeDetail.value.name, formalTest: val }
+            })
+    }
+
+
+
     // if (num.value == '3') {
     //     router.push({ name: 'cognizeGoNoGo', params: { currentType: val } })
     // } else if (num.value == '4') {

+ 57 - 21
src/views/CognizeFaceDot.vue

@@ -1,12 +1,14 @@
 <script setup lang="ts">
 
-
+import CpdmMessage from '../components/CpdmMessage.vue'
 import { ElMessage, ElLoading } from 'element-plus';
 import { onMounted, onUnmounted, ref } from 'vue'
 import { useRoute, useRouter } from 'vue-router';
 import { userInfoStore } from '@/stores'
 import { format } from 'date-fns/format';
-import { saveFaceDotApi } from '@/api/plan';
+import { getCurrentTimeApi, saveFaceDotApi } from '@/api/plan';
+import { userPlanDetailApi } from '@/api/home';
+import { getUnread, planNumGet } from '@/utils/test';
 const userInfo = userInfoStore()
 const route = useRoute()
 const router = useRouter()
@@ -72,16 +74,20 @@ const requireWav = (name: string) => {
     return new URL(`../assets/cognize/${name}.wav`, import.meta.url).href
 }
 
+const formalTest = ref<string>()
+const cpdmMe = ref<any>()
 onMounted(() => {
     countDownStr.value = '马上开始'
-    currentType.value = parseInt(route.params.currentType as string)
+    currentType.value = parseInt(route.params.formalTest as string)
 
     flag1.value = route.params.flag as string;
     planId.value = route.params.planId as string
     planName.value = route.params.planName as string
     flagName.value = route.params.flagName as string
-    num.value = route.params.num as string
+    formalTest.value = route.params.formalTest as string
     getStartTime()
+
+
     // init()
     // //传输1是练习测试
     // //传输2是正式测试
@@ -90,9 +96,8 @@ onMounted(() => {
     // } else {
     //     startTest(1)
     // }
-    if (currentType.value) {
+    if (formalTest.value !== '0') {
         turnsNumber.value = 95
-
     } else {
         turnsNumber.value = 10
     }
@@ -113,9 +118,9 @@ onMounted(() => {
 
 
 })
-const getStartTime = () => {
-    let date = new Date()
-    startTime1.value = format(date, "yyyy-MM-dd HH:mm:ss");
+const getStartTime = async () => {
+    let res: any = await getCurrentTimeApi();
+    startTime1.value = res.data;
 }
 onUnmounted(() => {
     clearInterval(myInterval.value);
@@ -500,11 +505,13 @@ const submitData = async () => {
     neutralResponse2.map((item) => {
         neutralAllTime2 += item.responseTime;
     });
-    ElMessage({
-        message: `正确率为${((blockRight1.length / turnsNumber.value) * 100).toFixed(2)}%`,
-        type: "info"
-    })
+
+    userInfo.saveIspass('FDOT')
     if (!currentType.value) {
+        ElMessage({
+            message: `正确率为${((blockRight1.length / turnsNumber.value) * 100).toFixed(2)}%`,
+            type: "info"
+        })
         setTimeout(() => {
             router.go(-1)
         }, 1500)
@@ -564,15 +571,43 @@ const submitData = async () => {
 
         let res: any = await saveFaceDotApi(params)
         if (res.code == 200) {
-            router.push({
-                name: 'scaleMid', params: {
-                    planId: planId.value,
-                    planName: planName.value,
-                    flag: flag1.value,
-                    flagName: flagName.value,
-                    num: num.value
-                }
+            // router.push({
+            //     name: 'scaleMid', params: {
+            //         planId: planId.value,
+            //         planName: planName.value,
+            //         flag: flag1.value,
+            //         flagName: flagName.value,
+            //         num: num.value
+            //     }
+            // })
+            //查看后边是否还有需要测试的数据
+            let paramsCu = {
+                planId: planId.value,
+                userNo: userInfo.userInfo.userNo
+            }
+
+            let temp: any = await userPlanDetailApi(paramsCu)
+            let listT = temp.data;
+            let listP = []
+            listP = listT.filter((item: any) => {
+                return item.isCompleted == '0' && item.contentType == '1'
             })
+
+            //等--认知任务如果有未测试的话--需要跳转到测试计划页面
+            //否则--跳转到测试计划页面
+            if (listP.length > 0) {
+                router.push({ name: 'plan' })
+            } else {
+                //当测试完了以后--需要弹出确认的弹出框
+                //把弹出框的内容   及用户信息 进行处理 进行发布
+                //这是测试完了--测试完成后调用测试记录
+
+                cpdmMe.value.open()
+                planNumGet()
+                getUnread()
+                // this.$router.push({ name: 'testRecord' })
+            }
+
         } else {
             ElMessage({
                 message: `${res.msg}`,
@@ -923,6 +958,7 @@ const userClick = (param: any) => {
                 {{ activeBlock?.dotPos == "1" ? activeBlock?.dot : "" }}
             </div>
         </div>
+        <CpdmMessage ref="cpdmMe" />
     </div>
 </template>
 <style lang="scss">

+ 895 - 0
src/views/ETBexperiment_new.vue

@@ -0,0 +1,895 @@
+<template>
+    <div>
+        <div v-if="testFlag" class="desc_wrap">
+            <!-- 提示内容 -->
+        </div>
+
+        <div v-else class="activeTask">
+
+            <div style="width: 50%; margin-left: 10%; margin-top: 24px; z-index: 10">
+                <p v-if="testMode === 0" style='margin-top:50px'>&nbsp;</p>
+                <el-progress v-else class="main_progress" color="linear-gradient(to right, #3854f1, #92bbf0)"
+                    :text-inside="true" :format="format" :stroke-width="48" :percentage="((cumulation) / 71) * 100">
+                    <span style="color: #000;font-size: 20px;">{{ cumulation }}/{{ 71 }}</span>
+                </el-progress>
+            </div>
+
+            <p v-if="timingShow" class="timingBox">{{ countDownStr }}</p>
+
+            <div v-if="crossShow && !expressionShow && !buttonShow" style="text-align: center">
+                <img src="../assets/cognize/whiteFlag-new.png" alt=""
+                    style="width: 50px; height: 50px; margin-top: 20%" />
+            </div>
+            <div class="shape_glass">
+                <img v-if="expressionShow && !crossShow" class="active-img addImg" :src="examImgUrl" alt="" />
+            </div>
+
+            <div v-if="buttonShow && !crossShow" class="btn-content">
+                <el-button v-for="item in emoList" :key="item.val" class="butt"
+                    :class="{ active: item.val === resultData[cumulation]?.emoType && showGuider }"
+                    @click="userClick(item.val)">
+                    {{ item.name }}
+                </el-button>
+            </div>
+            <div class="guider" v-show="showGuider">
+                <div class="txt">
+                    <p class="explain">
+                        观察图片中人物的面部表情,想象人物有着怎样的情绪。点击下方按钮,选择对应的情绪
+                    </p>
+                </div>
+            </div>
+        </div>
+        <CpdmMessage ref="cpdmMe" />
+    </div>
+</template>
+
+<script lang="ts" setup>
+import CpdmMessage from '../components/CpdmMessage.vue'
+import { format as formatTime } from 'date-fns/format';
+import { ref, onMounted, onUnmounted, computed } from 'vue';
+import { ElButton, ElProgress, ElMessage } from 'element-plus';
+import { oSessionStorage, preloader } from '@/utils/utils';
+import { useRoute, useRouter } from 'vue-router';
+import { userInfoStore } from '@/stores';
+import { error } from 'echarts/types/src/util/log.js';
+import { getCurrentTimeApi, saveETBApi } from '@/api/plan';
+import { userPlanDetailApi } from '@/api/home';
+import { getUnread, planNumGet } from '@/utils/test';
+const userInfo = userInfoStore()
+const route = useRoute()
+const router = useRouter()
+interface EmoItem {
+    name: string;
+    val: string;
+}
+
+interface ResultDataItem {
+    index: number;
+    emoType: string;
+    emoAmp: number;
+    userSelectEmoType: string;
+    responseTime: string;
+    correct: string;
+    imgUrl: string;
+}
+const cpdmMe = ref<any>()
+
+const testMode = ref<number | null>(null);
+const buttonShowTime = ref<number>(2000);
+const cycles = ref<number>(71);
+const showGuider = ref<boolean>(false);
+const startTime1 = ref<string>('')
+const testFlag = ref(true);
+const timingShow = ref(true);
+const timingNum = ref(5);
+const countDownStr = ref('测试马上开始!');
+const crossShow = ref(false);
+const expressionShow = ref(false);
+const buttonShow = ref(false);
+
+const commonTime = ref(0);
+const cumulation = ref(0);
+const examImgUrl = ref('');
+const arrList = ref(['01', '02', '03', '04', '05', '06', '07', '08', '09', '10']);
+const randomArr = ref<string[]>([]);
+const resultData = ref<any>([]);
+const emoList = ref<EmoItem[]>([
+    { name: '开心', val: 'happy' },
+    { name: '害怕', val: 'fear' },
+    { name: '生气', val: 'angry' },
+    { name: '厌恶', val: 'disgust' },
+    { name: '悲伤', val: 'sad' },
+    { name: '惊讶', val: 'surprise' },
+]);
+
+
+const userId = ref<string>('');
+
+
+const timingFlag = ref<any>();
+
+const timingOne = ref<any>();
+const timingTwo = ref<any>();
+const timingThree = ref<any>();
+const flagTime = ref<any>()
+
+const planId = ref<string>('');
+const planName = ref<string>('')
+const flag = ref<string>('');
+const flagName = ref<string>('');
+const formalTest = ref<string>('')
+onMounted(() => {
+    planId.value = route.params.planId as string;
+
+    planName.value = route.params.planName as string;
+
+    flag.value = route.params.flag as string
+
+    flagName.value = route.params.flagName as string
+
+    formalTest.value = route.params.formalTest as string
+    // this.formalTest = this.$route.params.formalTest;
+
+    userId.value = userInfo.userInfo.id;
+
+    //测试模式
+    testMode.value = parseInt(route.params.formalTest as string);
+    // testMode.value = parseInt((window as any).$route.query.testMode || '0', 10);
+
+    if (testMode.value === 0) {
+        buttonShowTime.value = 20000000;
+        cycles.value = 6;
+        startTiming();
+    } else {
+        buttonShowTime.value = 2000;
+        cycles.value = 71;
+        startTiming();
+        getStartTime();
+    }
+});
+
+const format = (percentage: number) => {
+    return percentage === 100 ? '任务已完成' : '任务进度';
+};
+
+
+const startTiming = () => {
+
+    if (!userId.value) {
+        ElMessage({
+            type: 'warning',
+            message: '请先登录'
+        })
+        return;
+    }
+
+    testFlag.value = false;
+
+    timingFlag.value = setInterval(() => {
+        if (timingNum.value === 0) {
+            countDownStr.value = '开始';
+
+            setTimeout(() => {
+                timingShow.value = false;
+                if (timingFlag.value) clearInterval(timingFlag.value);
+                startTest();
+            }, 1000);
+
+            if (timingFlag.value) clearInterval(timingFlag.value);
+        } else {
+            countDownStr.value = `${timingNum.value}`;
+            timingNum.value--;
+        }
+    }, 1000);
+};
+
+const startTime = () => {
+    commonTime.value = 0;
+    flagTime.value = setInterval(() => {
+        commonTime.value++;
+    }, 10);
+};
+
+const endTime = () => {
+    if (flagTime.value) clearInterval(flagTime.value);
+};
+
+const randomList = () => {
+    randomArr.value = [];
+    for (let k = 0; k < 3; k++) {
+        let id = Math.floor(Math.random() * 10);
+        if (k < 10) {
+            if (randomArr.value.indexOf(arrList.value[id]) === -1) {
+                randomArr.value.push(arrList.value[id]);
+            } else {
+                k -= 1;
+                continue;
+            }
+        } else {
+            randomArr.value.push(arrList.value[id]);
+        }
+    }
+};
+
+const shuffle = async (arr: any[]) => {
+    for (let i = 1; i < arr.length; i++) {
+        const random = Math.floor(Math.random() * (i + 1));
+        [arr[i], arr[random]] = [arr[random], arr[i]];
+    }
+    return arr;
+};
+const requireImg = (name: string) => {
+    return new URL(`../assets/cognize/ETBnew/${name}.jpg`, import.meta.url).href
+}
+const initImgList = async (rank: number) => {
+    randomList();
+
+
+    randomArr.value.forEach((item) => {
+        //  `${item >= '06' ? 'm' + item : 'f' + item}-happy-0${rank + 1}`
+        // 开心
+        resultData.value.push({
+            emoType: 'happy',
+            emoAmp: rank,
+            userSelectEmoType: '',
+            responseTime: '',
+            correct: '',
+            imgUrl: requireImg(`${item >= '06' ? 'm' + item : 'f' + item}-happy-0${rank + 1}`),
+            // imgUrl: require(`../../assets/congnitiveAblitity/ETBnew/${item >= '06' ? 'm' + item : 'f' + item}-happy-0${rank + 1}.jpg`), 
+        });
+        // 害怕
+        resultData.value.push({
+            emoType: 'fear',
+            emoAmp: rank,
+            userSelectEmoType: '',
+            responseTime: '',
+            correct: '',
+            imgUrl: requireImg(`${item >= '06' ? 'm' + item : 'f' + item}-fear-0${rank + 1}`),
+            // imgUrl: require(`../../assets/congnitiveAblitity/ETBnew/${item >= '06' ? 'm' + item : 'f' + item}-fear-0${rank + 1}.jpg`),
+        });
+        // 生气
+        resultData.value.push({
+            emoType: 'angry',
+            emoAmp: rank,
+            userSelectEmoType: '',
+            responseTime: '',
+            correct: '',
+            imgUrl: requireImg(`${item >= '06' ? 'm' + item : 'f' + item}-angry-0${rank + 1}`),
+            // imgUrl: require(`../../assets/congnitiveAblitity/ETBnew/${item >= '06' ? 'm' + item : 'f' + item}-angry-0${rank + 1}.jpg`),
+        });
+        // 厌恶
+        resultData.value.push({
+            emoType: 'disgust',
+            emoAmp: rank,
+            userSelectEmoType: '',
+            responseTime: '',
+            correct: '',
+            imgUrl: requireImg(`${item >= '06' ? 'm' + item : 'f' + item}-disgust-0${rank + 1}`),
+            // imgUrl: require(`../../assets/congnitiveAblitity/ETBnew/${item >= '06' ? 'm' + item : 'f' + item}-disgust-0${rank + 1}.jpg`),
+        });
+        // 悲伤
+        resultData.value.push({
+            emoType: 'sad',
+            emoAmp: rank,
+            userSelectEmoType: '',
+            responseTime: '',
+            correct: '',
+            imgUrl: requireImg(`${item >= '06' ? 'm' + item : 'f' + item}-sad-0${rank + 1}`),
+            // imgUrl: require(`../../assets/congnitiveAblitity/ETBnew/${item >= '06' ? 'm' + item : 'f' + item}-sad-0${rank + 1}.jpg`),
+        });
+        // 惊讶
+        resultData.value.push({
+            emoType: 'surprise',
+            emoAmp: rank,
+            userSelectEmoType: '',
+            responseTime: '',
+            correct: '',
+            imgUrl: requireImg(`${item >= '06' ? 'm' + item : 'f' + item}-surprise-0${rank + 1}`),
+            // imgUrl: require(`../../assets/congnitiveAblitity/ETBnew/${item >= '06' ? 'm' + item : 'f' + item}-surprise-0${rank + 1}.jpg`),
+        });
+    });
+};
+
+const imgListSerialize = async () => {
+    await initImgList(0);
+    await initImgList(1);
+    await initImgList(2);
+    await initImgList(3);
+    await shuffle(resultData.value);
+    resultData.value.forEach((item: { index: any; }, i: any) => {
+        item.index = i;
+    });
+
+    preloader(resultData.value, () => {
+        changeImg(cumulation.value);
+        showCross();
+    });
+};
+
+const changeImg = (num: number) => {
+    examImgUrl.value = resultData.value[num].imgUrl;
+};
+
+const showCross = () => {
+    crossShow.value = true;
+    expressionShow.value = false;
+    buttonShow.value = false;
+
+    timingOne.value = setTimeout(() => {
+        showImg();
+    }, 750);
+};
+
+const showImg = () => {
+    crossShow.value = false;
+    expressionShow.value = true;
+    if (testMode.value === 0) {
+        buttonShow.value = true;
+    } else {
+        buttonShow.value = false;
+    }
+
+    timingTwo.value = setTimeout(() => {
+        showBtn();
+    }, 500);
+};
+
+const showBtn = () => {
+    startTime();
+    crossShow.value = false;
+    if (testMode.value === 0) {
+        expressionShow.value = true;
+    } else {
+        expressionShow.value = false;
+    }
+    buttonShow.value = true;
+
+    timingThree.value = setTimeout(() => {
+        buttonShow.value = false;
+        endTime();
+
+        resultData.value[cumulation.value].userSelectEmoType = 'NO';
+        resultData.value[cumulation.value].responseTime = 'NULL';
+        resultData.value[cumulation.value].correct = 'False';
+
+        if (cumulation.value >= cycles.value) {
+            submitData();
+        } else {
+            cumulation.value++;
+            changeImg(cumulation.value);
+            showCross();
+        }
+    }, buttonShowTime.value);
+};
+
+const userClick = (param: string) => {
+    if (showGuider.value && resultData.value[cumulation.value]?.emoType !== param) {
+        ElMessage({
+            type: 'error',
+            message: '点击错误,请点击闪烁的正确选项'
+
+        })
+        return;
+    }
+
+    if (timingThree.value) clearTimeout(timingThree.value);
+    endTime();
+
+    resultData.value[cumulation.value].userSelectEmoType = param;
+    resultData.value[cumulation.value].responseTime = (commonTime.value * 10).toString();
+    resultData.value[cumulation.value].correct = param === resultData.value[cumulation.value].emoType ? 'True' : 'False';
+
+    if (cumulation.value >= cycles.value) {
+        if (testMode.value === 0) {
+            userInfo.saveIspass(flag.value)
+            ElMessage({
+                type: 'success',
+                message: '引导结束'
+            })
+
+            router.go(-1);
+        } else {
+            submitData();
+        }
+    } else {
+        cumulation.value++;
+        changeImg(cumulation.value);
+        showCross();
+    }
+};
+const submitData = async () => {
+    const correctNum: ResultDataItem[] = [];
+    const happy1: ResultDataItem[] = [];
+    const happy2: ResultDataItem[] = [];
+    const happy3: ResultDataItem[] = [];
+    const happy4: ResultDataItem[] = [];
+    const fear1: ResultDataItem[] = [];
+    const fear2: ResultDataItem[] = [];
+    const fear3: ResultDataItem[] = [];
+    const fear4: ResultDataItem[] = [];
+    const angry1: ResultDataItem[] = [];
+    const angry2: ResultDataItem[] = [];
+    const angry3: ResultDataItem[] = [];
+    const angry4: ResultDataItem[] = [];
+    const disgust1: ResultDataItem[] = [];
+    const disgust2: ResultDataItem[] = [];
+    const disgust3: ResultDataItem[] = [];
+    const disgust4: ResultDataItem[] = [];
+    const sad1: ResultDataItem[] = [];
+    const sad2: ResultDataItem[] = [];
+    const sad3: ResultDataItem[] = [];
+    const sad4: ResultDataItem[] = [];
+    const surprise1: ResultDataItem[] = [];
+    const surprise2: ResultDataItem[] = [];
+    const surprise3: ResultDataItem[] = [];
+    const surprise4: ResultDataItem[] = [];
+
+    resultData.value.forEach((item: ResultDataItem) => {
+        if (item.correct === 'True') correctNum.push(item);
+    });
+
+    correctNum.forEach((item) => {
+        if (item.emoType === 'happy' && item.emoAmp === 0) happy1.push(item);
+        if (item.emoType === 'happy' && item.emoAmp === 1) happy2.push(item);
+        if (item.emoType === 'happy' && item.emoAmp === 2) happy3.push(item);
+        if (item.emoType === 'happy' && item.emoAmp === 3) happy4.push(item);
+        if (item.emoType === 'fear' && item.emoAmp === 0) fear1.push(item);
+        if (item.emoType === 'fear' && item.emoAmp === 1) fear2.push(item);
+        if (item.emoType === 'fear' && item.emoAmp === 2) fear3.push(item);
+        if (item.emoType === 'fear' && item.emoAmp === 3) fear4.push(item);
+        if (item.emoType === 'angry' && item.emoAmp === 0) angry1.push(item);
+        if (item.emoType === 'angry' && item.emoAmp === 1) angry2.push(item);
+        if (item.emoType === 'angry' && item.emoAmp === 2) angry3.push(item);
+        if (item.emoType === 'angry' && item.emoAmp === 3) angry4.push(item);
+        if (item.emoType === 'disgust' && item.emoAmp === 0) disgust1.push(item);
+        if (item.emoType === 'disgust' && item.emoAmp === 1) disgust2.push(item);
+        if (item.emoType === 'disgust' && item.emoAmp === 2) disgust3.push(item);
+        if (item.emoType === 'disgust' && item.emoAmp === 3) disgust4.push(item);
+        if (item.emoType === 'sad' && item.emoAmp === 0) sad1.push(item);
+        if (item.emoType === 'sad' && item.emoAmp === 1) sad2.push(item);
+        if (item.emoType === 'sad' && item.emoAmp === 2) sad3.push(item);
+        if (item.emoType === 'sad' && item.emoAmp === 3) sad4.push(item);
+        if (item.emoType === 'surprise' && item.emoAmp === 0) surprise1.push(item);
+        if (item.emoType === 'surprise' && item.emoAmp === 1) surprise2.push(item);
+        if (item.emoType === 'surprise' && item.emoAmp === 2) surprise3.push(item);
+        if (item.emoType === 'surprise' && item.emoAmp === 3) surprise4.push(item);
+    });
+
+    // http.post(
+    //     `/cognize/ETB01`,
+    //     {
+    //         userId: userId.value,
+    //         testPlanId: (window as any).$route.query.testPlanId || '',
+    //         data: resultData.value,
+    //         result: {
+    //             totalResult: ((correctNum.length / 72) * 100).toFixed(2) + '%',
+    //             happy: {
+    //                 level1: ((happy1.length / 3) * 100).toFixed(2) + '%',
+    //                 level2: ((happy2.length / 3) * 100).toFixed(2) + '%',
+    //                 level3: ((happy3.length / 3) * 100).toFixed(2) + '%',
+    //                 level4: ((happy4.length / 3) * 100).toFixed(2) + '%',
+    //             },
+    //             fear: {
+    //                 level1: ((fear1.length / 3) * 100).toFixed(2) + '%',
+    //                 level2: ((fear2.length / 3) * 100).toFixed(2) + '%',
+    //                 level3: ((fear3.length / 3) * 100).toFixed(2) + '%',
+    //                 level4: ((fear4.length / 3) * 100).toFixed(2) + '%',
+    //             },
+    //             angry: {
+    //                 level1: ((angry1.length / 3) * 100).toFixed(2) + '%',
+    //                 level2: ((angry2.length / 3) * 100).toFixed(2) + '%',
+    //                 level3: ((angry3.length / 3) * 100).toFixed(2) + '%',
+    //                 level4: ((angry4.length / 3) * 100).toFixed(2) + '%',
+    //             },
+    //             disgust: {
+    //                 level1: ((disgust1.length / 3) * 100).toFixed(2) + '%',
+    //                 level2: ((disgust2.length / 3) * 100).toFixed(2) + '%',
+    //                 level3: ((disgust3.length / 3) * 100).toFixed(2) + '%',
+    //                 level4: ((disgust4.length / 3) * 100).toFixed(2) + '%',
+    //             },
+    //             sad: {
+    //                 level1: ((sad1.length / 3) * 100).toFixed(2) + '%',
+    //                 level2: ((sad2.length / 3) * 100).toFixed(2) + '%',
+    //                 level3: ((sad3.length / 3) * 100).toFixed(2) + '%',
+    //                 level4: ((sad4.length / 3) * 100).toFixed(2) + '%',
+    //             },
+    //             surprise: {
+    //                 level1: ((surprise1.length / 3) * 100).toFixed(2) + '%',
+    //                 level2: ((surprise2.length / 3) * 100).toFixed(2) + '%',
+    //                 level3: ((surprise3.length / 3) * 100).toFixed(2) + '%',
+    //                 level4: ((surprise4.length / 3) * 100).toFixed(2) + '%',
+    //             },
+    //         },
+    //     },
+    //     (response: { code: string; }) => {
+    //         if (response && response.code === '200') {
+
+    //             ElMessage({
+    //                 type: 'success',
+    //                 message: '测试结束'
+    //             })
+
+    //             // 跳转到结果页面
+    //             // (window as any).$router.push({
+    //             //   name: 'TestResult',
+    //             //   params: {
+    //             //     result: [
+    //             //       {
+    //             //         name: '总正确率',
+    //             //         value: ((correctNum.length / 72) * 100).toFixed(2) + '%',
+    //             //       },
+    //             //       // 其他结果项...
+    //             //     ],
+    //             //   },
+    //             // });
+    //         } else {
+    //             ElMessage({
+    //                 type: 'error',
+    //                 message: '结束数据出错'
+    //             })
+    //         }
+    //     }
+    // );
+
+    let testResult = {
+
+        totalScore: ((correctNum.length / 72) * 100).toFixed(2),
+        happy: {
+            level1: ((happy1.length / 3) * 100).toFixed(2),
+            level2: ((happy2.length / 3) * 100).toFixed(2),
+            level3: ((happy3.length / 3) * 100).toFixed(2),
+            level4: ((happy4.length / 3) * 100).toFixed(2),
+        },
+        fear: {
+            level1: ((fear1.length / 3) * 100).toFixed(2),
+            level2: ((fear2.length / 3) * 100).toFixed(2),
+            level3: ((fear3.length / 3) * 100).toFixed(2),
+            level4: ((fear4.length / 3) * 100).toFixed(2),
+        },
+        angry: {
+            level1: ((angry1.length / 3) * 100).toFixed(2),
+            level2: ((angry2.length / 3) * 100).toFixed(2),
+            level3: ((angry3.length / 3) * 100).toFixed(2),
+            level4: ((angry4.length / 3) * 100).toFixed(2),
+        },
+        disgust: {
+            level1: ((disgust1.length / 3) * 100).toFixed(2),
+            level2: ((disgust2.length / 3) * 100).toFixed(2),
+            level3: ((disgust3.length / 3) * 100).toFixed(2),
+            level4: ((disgust4.length / 3) * 100).toFixed(2),
+        },
+        sad: {
+            level1: ((sad1.length / 3) * 100).toFixed(2),
+            level2: ((sad2.length / 3) * 100).toFixed(2),
+            level3: ((sad3.length / 3) * 100).toFixed(2),
+            level4: ((sad4.length / 3) * 100).toFixed(2),
+        },
+        surprise: {
+            level1: ((surprise1.length / 3) * 100).toFixed(2),
+            level2: ((surprise2.length / 3) * 100).toFixed(2),
+            level3: ((surprise3.length / 3) * 100).toFixed(2),
+            level4: ((surprise4.length / 3) * 100).toFixed(2),
+        },
+
+    }
+
+    let params = {
+        beginTime: startTime1.value,
+        orgName: userInfo.userInfo.orgName,
+        orgNo: userInfo.userInfo.orgNo,
+        planId: planId.value,
+        planName: planName.value,
+        taskFlag: flag.value,
+        taskName: flagName.value,
+        // testRecord: JSON.stringify(productData()),
+        testRecord: JSON.stringify(resultData.value),
+        testResult: JSON.stringify(testResult),
+        type: '1',
+        userName: userInfo.userInfo.userName,
+        userNo: userInfo.userInfo.userNo,
+    }
+    let res: any = await saveETBApi(params)
+    if (res.code == 200) {
+        let paramsCu = {
+            planId: planId.value,
+            userNo: userInfo.userInfo.userNo
+        }
+
+        let temp: any = await userPlanDetailApi(paramsCu)
+        let listT = temp.data;
+        let listP = []
+        listP = listT.filter((item: any) => {
+            return item.isCompleted == '0' && item.contentType == '1'
+        })
+
+        //等--认知任务如果有未测试的话--需要跳转到测试计划页面
+        //否则--跳转到测试计划页面
+        if (listP.length > 0) {
+            router.push({ name: 'plan' })
+        } else {
+            //当测试完了以后--需要弹出确认的弹出框
+            //把弹出框的内容   及用户信息 进行处理 进行发布
+            //这是测试完了--测试完成后调用测试记录
+
+            cpdmMe.value.open()
+            planNumGet()
+            getUnread()
+            // this.$router.push({ name: 'testRecord' })
+        }
+        //判断后边还有其他认知任务吗,如果有---则跳转到测试计划页面
+    } else {
+        //如果没有则调转到输入信息地方
+        ElMessage({
+            type: 'error',
+            message: res.msg
+        })
+    }
+
+
+
+    // let params = {
+    //     userId: userId.value,
+    //     planId: planId.value,
+    //     data: resultData.value,
+    //     result: {
+    //         totalScore: ((correctNum.length / 72) * 100).toFixed(2),
+    //         happy: {
+    //             level1: ((happy1.length / 3) * 100).toFixed(2),
+    //             level2: ((happy2.length / 3) * 100).toFixed(2),
+    //             level3: ((happy3.length / 3) * 100).toFixed(2),
+    //             level4: ((happy4.length / 3) * 100).toFixed(2),
+    //         },
+    //         fear: {
+    //             level1: ((fear1.length / 3) * 100).toFixed(2),
+    //             level2: ((fear2.length / 3) * 100).toFixed(2),
+    //             level3: ((fear3.length / 3) * 100).toFixed(2),
+    //             level4: ((fear4.length / 3) * 100).toFixed(2),
+    //         },
+    //         angry: {
+    //             level1: ((angry1.length / 3) * 100).toFixed(2),
+    //             level2: ((angry2.length / 3) * 100).toFixed(2),
+    //             level3: ((angry3.length / 3) * 100).toFixed(2),
+    //             level4: ((angry4.length / 3) * 100).toFixed(2),
+    //         },
+    //         disgust: {
+    //             level1: ((disgust1.length / 3) * 100).toFixed(2),
+    //             level2: ((disgust2.length / 3) * 100).toFixed(2),
+    //             level3: ((disgust3.length / 3) * 100).toFixed(2),
+    //             level4: ((disgust4.length / 3) * 100).toFixed(2),
+    //         },
+    //         sad: {
+    //             level1: ((sad1.length / 3) * 100).toFixed(2),
+    //             level2: ((sad2.length / 3) * 100).toFixed(2),
+    //             level3: ((sad3.length / 3) * 100).toFixed(2),
+    //             level4: ((sad4.length / 3) * 100).toFixed(2),
+    //         },
+    //         surprise: {
+    //             level1: ((surprise1.length / 3) * 100).toFixed(2),
+    //             level2: ((surprise2.length / 3) * 100).toFixed(2),
+    //             level3: ((surprise3.length / 3) * 100).toFixed(2),
+    //             level4: ((surprise4.length / 3) * 100).toFixed(2),
+    //         },
+    //     },
+    // }
+
+};
+const getStartTime = async () => {
+    let res: any = await getCurrentTimeApi();
+    // let date = new Date()
+    startTime1.value = res.data;
+    // startTime.value = format(date, "yyyy-MM-dd HH:mm:ss");
+}
+const startTest = () => {
+    if (testMode.value === 0) {
+        showGuider.value = true;
+    }
+    imgListSerialize();
+};
+
+onUnmounted(() => {
+    clearInterval(timingFlag.value);
+    clearInterval(flagTime.value);
+    clearTimeout(timingOne.value);
+    clearTimeout(timingTwo.value);
+    clearTimeout(timingThree.value);
+});
+</script>
+<style scoped>
+.butt {
+    width: 100px;
+    text-align: center;
+    border: 1px solid rgb(87, 172, 187);
+    opacity: 1;
+    border-radius: 10px;
+}
+
+.bgAdd {
+    width: 150px;
+    height: 400px;
+    background: url("../assets/cognize/whiteFlag-new.png") no-repeat center;
+    position: absolute;
+    top: 25%;
+    left: 50%;
+    margin-left: -75px;
+}
+
+.activeTask {
+    width: 100%;
+    height: 100%;
+    background: url("../assets/cognize/rememberAbilityTask.png") no-repeat center;
+    background-size: cover;
+    position: fixed;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+}
+
+.timingBox {
+    font-size: 50px;
+    font-weight: 700;
+    position: absolute;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%, -50%);
+    color: black;
+    font-size: 70px;
+    text-align: center;
+    line-height: 100px;
+    margin: 0 auto;
+    z-index: 10;
+}
+
+/* .active-img {
+  position: absolute;
+  width: 450px;
+  height: 450px;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+  z-index: 10;
+} */
+.btn-content {
+    position: absolute;
+    width: 60%;
+    left: 50%;
+    bottom: 10%;
+    transform: translate(-50%, 0);
+    text-align: center;
+    z-index: 1000;
+}
+
+.scaleName {
+    margin-top: 70px;
+    background-size: cover;
+}
+
+.scaleButton {
+    margin-top: 20px;
+    margin-bottom: 20px;
+    background-size: cover;
+    background: rgb(87, 172, 187);
+    border: 2px solid rgb(255, 255, 255);
+    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
+    opacity: 1;
+    border-radius: 39px;
+    color: #ffffff;
+}
+
+.steering {
+    width: 50%;
+    position: absolute;
+    bottom: 20%;
+    left: 50%;
+    transform: translateX(-50%);
+    display: flex;
+    justify-content: space-between;
+}
+
+.steering .left {
+    width: 60px;
+    height: 60px;
+    background: url(../../assets/left.png) no-repeat center;
+}
+
+.steering .right {
+    width: 60px;
+    height: 60px;
+    background: url(../../assets/right.png) no-repeat center;
+    margin-left: 15px;
+}
+
+.guider {
+    position: absolute;
+    top: 0;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    z-index: 999;
+    background: rgba(0, 0, 0, 0.75);
+}
+
+.addImg {
+    width: 50%;
+    height: auto;
+    z-index: 1000;
+}
+
+.shape_glass {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    width: 50%;
+    height: auto;
+    margin: 5vh auto 0;
+}
+
+.active {
+    position: relative;
+}
+
+.active:after {
+    background-color: #2ea598;
+}
+
+/* 设置动画后颜色 */
+.active:before {
+    background-color: rgba(0, 168, 253, 0.2);
+}
+
+/* 设置动画 */
+.active:before,
+.active:after {
+    content: "";
+    width: 80px;
+    height: 40px;
+    position: absolute;
+    left: 50%;
+    top: 50%;
+    margin-left: -40px;
+    margin-top: -20px;
+    border-radius: 10%;
+    animation: warn 1.5s ease-out 0s infinite;
+}
+
+@keyframes warn {
+    0% {
+        transform: scale(0.5);
+        opacity: 1;
+    }
+
+    30% {
+        opacity: 1;
+    }
+
+    100% {
+        transform: scale(1.4);
+        opacity: 0;
+    }
+}
+
+.txt {
+    width: 300px;
+    font-weight: PingFang-SC-Medium;
+    margin: 0 auto;
+    font-size: 16px;
+    color: #ffffff;
+    position: absolute;
+    left: 50%;
+    top: 70%;
+    transform: translateX(-50%);
+    z-index: 1000;
+}
+
+.explain {
+    padding: 6px 8px;
+    border: 2px solid #0abdc4;
+    border-radius: 5px;
+}
+
+.main_progress {
+    padding-top: 40px;
+    padding-left: 40px;
+
+}
+</style>

+ 3 - 1
src/views/Plan.vue

@@ -75,6 +75,7 @@ const startPlan = async (val: any) => {
             if (val.taskList[i].isCompleted !== '1') {
                 nextFlag = val.taskList[i].flag;
                 type = val.taskList[i].contentType;
+                break
             }
         }
     } else {
@@ -156,6 +157,7 @@ const planNumGet = async () => {
             let temp: any = await userPlanDetailApi(params)
             planList.value[i].list = temp.data
         }
+
         //-------------处理SCL90的完成状态----------------
         for (let i = 0; i < planList.value.length; i++) {
             //
@@ -182,7 +184,7 @@ const planNumGet = async () => {
                 for (let j = 0; j < planList.value[i].list.length; j++) {
                     //不需要展示--但是必做--且含有未完成的
                     if (flag) {
-                        if (planList.value[i].list[j].flag == "20210617140713" && planList.value[i].list[j].isCompleted == "1") {
+                        if (planList.value[i].list[j].flag == "20210713155333" && planList.value[i].list[j].isCompleted == "1") {
                             //如果满足以上条件则scl90的状态切换为2  --也是未完成--但是预示着后边还有需要做的
                             planList.value[i].list[j].isCompleted = '2'
                         }

+ 0 - 2
src/views/Register.vue

@@ -222,8 +222,6 @@ const userGroupFun = async () => {
     //先判断返回的是否有数据
     if (res.data.length > 0) {
         //判断当前是  教师还是学生
-        console.log('组织架构信息')
-        console.log(res.data)
 
         let list = roleTypeFilter(res.data)
 

+ 28 - 28
src/views/Scale.vue

@@ -79,13 +79,13 @@ const topicIndex = ref<number>(1)
 //有三个储存数组分别储存
 
 //抑郁自评量表
-//抑郁自评量表flag是"20210617020516"
+//抑郁自评量表flag是"20210617000138"
 const listDepressed = ref<any>([])
 //知觉压力问卷
-//知觉压力量表flag是"20210913093250"
+//知觉压力量表flag是"20210617121646"
 const listStress = ref<any>([])
 //焦虑自评量表
-//焦虑自评量表flag是"20210617000853"
+//焦虑自评量表flag是"20220515221429"
 const listAnxiety = ref<any>([])
 
 
@@ -108,56 +108,56 @@ const nextTopic = () => {
     //已经选择的话---需要拿到当前对象---判断flag是另外三个的flag吗
     //如果是--则判断是否在数组里边--如果不在则存储
     //将抑郁自评量表的数据存储进数组
-    if (scaleList.value[topicIndex.value - 1].flag == '20210617020516' && !listDepressed.value.includes(scaleList.value[topicIndex.value - 1].id)) {
+    if (scaleList.value[topicIndex.value - 1].flag == '20210617000138' && !listDepressed.value.includes(scaleList.value[topicIndex.value - 1].id)) {
         listDepressed.value.push(scaleList.value[topicIndex.value - 1].id)
         //判断抑郁压力数组的长度是20 调用保存接口
         //循环到数组 当前中所有flag 等于抑郁自评量表的数组--然后传输给保存方法
         //判断此数组长度是多少
-        if (listDepressed.value.length == 20) {
+        if (listDepressed.value.length == 14) {
             let list = []
             for (let i = 0; i < scaleList.value.length; i++) {
-                if (scaleList.value[i].flag == '20210617020516') {
+                if (scaleList.value[i].flag == '20210617000138') {
                     list.push(scaleList.value[i])
                 }
             }
             let listTm = JSON.parse(JSON.stringify(list))
-            subScaleData(listTm, "20210617020516")
+            subScaleData(listTm, "20210617000138")
         }
 
 
     }
     //将知觉压力问卷的数据存储进数组
 
-    if (scaleList.value[topicIndex.value - 1].flag == '20210913093250' && !listStress.value.includes(scaleList.value[topicIndex.value - 1].id)) {
+    if (scaleList.value[topicIndex.value - 1].flag == '20210617121646' && !listStress.value.includes(scaleList.value[topicIndex.value - 1].id)) {
         listStress.value.push(scaleList.value[topicIndex.value - 1].id)
         //调用知觉压力数据保存接口
         //如果长度达到指定数目
-        if (listStress.value.length == 30) {
+        if (listStress.value.length == 21) {
             let list = []
             for (let i = 0; i < scaleList.value.length; i++) {
-                if (scaleList.value[i].flag == '20210913093250') {
+                if (scaleList.value[i].flag == '20210617121646') {
                     list.push(scaleList.value[i])
                 }
             }
             let listTm = JSON.parse(JSON.stringify(list))
 
-            subScaleData(listTm, "20210913093250")
+            subScaleData(listTm, "20210617121646")
         }
 
     }
     //将焦虑自评量的数据存储进数组
-    if (scaleList.value[topicIndex.value - 1].flag == '20210617000853' && !listAnxiety.value.includes(scaleList.value[topicIndex.value - 1].id)) {
+    if (scaleList.value[topicIndex.value - 1].flag == '20220515221429' && !listAnxiety.value.includes(scaleList.value[topicIndex.value - 1].id)) {
         listAnxiety.value.push(scaleList.value[topicIndex.value - 1].id)
         //调用焦虑
-        if (listAnxiety.value.length == 20) {
+        if (listAnxiety.value.length == 14) {
             let list = []
             for (let i = 0; i < scaleList.value.length; i++) {
-                if (scaleList.value[i].flag == '20210617000853') {
+                if (scaleList.value[i].flag == '20220515221429') {
                     list.push(scaleList.value[i])
                 }
             }
             let listTm = JSON.parse(JSON.stringify(list))
-            subScaleData(listTm, "20210617000853")
+            subScaleData(listTm, "20220515221429")
         }
 
     }
@@ -167,11 +167,11 @@ const nextTopic = () => {
     if (topicIndex.value == scaleList.value.length) {
         // 最后一题就进行提交了
         //判断不是这三个的话
-        if (scaleList.value[topicIndex.value - 1].flag != '20210617020516' && scaleList.value[topicIndex.value - 1].flag != '20210913093250' && scaleList.value[topicIndex.value - 1].flag != '20210617000853') {
+        if (scaleList.value[topicIndex.value - 1].flag != '20210617000138' && scaleList.value[topicIndex.value - 1].flag != '20210617121646' && scaleList.value[topicIndex.value - 1].flag != '20220515221429') {
             let listTm = JSON.parse(JSON.stringify(scaleList.value))
             subScaleData(listTm, flag.value)
         }
-        // subScaleData(listTm, "20210617000853")
+        // subScaleData(listTm, "20220515221429")
         return
     }
     topicIndex.value++
@@ -221,7 +221,7 @@ const subScaleData = async (data: any, flag: string) => {
 
     //判断当前 flag 是可选的三个吗
     //如果是的话---
-    if (flag == '20210617020516' || flag == '20210913093250' || flag == '20210617000853') {
+    if (flag == '20210617000138' || flag == '20210617121646' || flag == '20220515221429') {
         //判断是否是做完了
         if (topicIndex.value == scaleList.value.length) {
             //这时是全部的都做完了
@@ -233,11 +233,11 @@ const subScaleData = async (data: any, flag: string) => {
             router.push({ name: 'plan' })
         }
     }
-    if (flag == '20210617140713') {
+    if (flag == '20210713155333') {
 
         queryNeedScale()
         //如果是排除是其他两个则直接返回
-    } else if (flag != '20210617020516' && flag != '20210913093250' && flag != '20210617000853') {
+    } else if (flag != '20210617000138' && flag != '20210617121646' && flag != '20220515221429') {
         //此时做完需要跳转到计划页面
         ElMessage({
             message: '提交完成',
@@ -298,7 +298,7 @@ const sclIsCom = async () => {
 
         for (let i = 0; i < planObj.value.list.length; i++) {
             //先判断类型--在判断必做且不显示的---将这个写存储在数组
-            if (planObj.value.list[i].flag == '20210617140713') {
+            if (planObj.value.list[i].flag == '20210713155333') {
                 if (planObj.value.list[i].isCompleted == '1') {
                     isComplate.value = '2';
                 }
@@ -521,7 +521,7 @@ onMounted(async () => {
     isComplate.value = route.params.isComplate as string
     //进到界面开始轮询
     // 判断是否SCL90
-    if (flag.value == '20210617140713') {
+    if (flag.value == '20210713155333') {
         //在这里判断scl90是否是已完成
 
         await sclIsCom()
@@ -581,8 +581,8 @@ onUnmounted(() => {
             <CpmdHeader />
             <div class="report_top">
                 <div class="report_jt">
-                    <span v-if="!(flag == '20210617140713' && isComplate == '2')">{{ flagName }}</span>
-                    <span v-if="flag == '20210617140713' && isComplate == '2'"> 心理健康测评基础量表(附加题)</span>
+                    <span v-if="!(flag == '20210713155333' && isComplate == '2')">{{ flagName }}</span>
+                    <span v-if="flag == '20210713155333' && isComplate == '2'"> 抑郁-焦虑-压力量表(附加题)</span>
                     <span v-show="!isCompleted" class="des">请根据您的表现回答下列问题,每道题请选择最符合您的情况的选项。</span>
                 </div>
                 <img v-show="!isCompleted" class="xlts_img" src="../assets/scale/scale.png" />
@@ -592,19 +592,19 @@ onUnmounted(() => {
         <div class="kply">
             <div class="kply_inner" :style="{ border: isCompleted ? '8px solid #ffffff' : '8px solid #B2F2D2' }">
                 <div style="padding :10px 100px">
-                    <el-progress v-if="!(flag == '20210617140713' && isComplate == '2')" :text-inside="true"
+                    <el-progress v-if="!(flag == '20210713155333' && isComplate == '2')" :text-inside="true"
                         :stroke-width="20" :percentage="(topicIndex / scaleList.length) * 100" color="#48D68E">
                         <span style="color:#000000">{{ topicIndex }}/{{ scaleList.length }}</span>
                     </el-progress>
-                    <el-progress v-if="flag == '20210617140713' && isComplate == '2'" :text-inside="true"
+                    <el-progress v-if="flag == '20210713155333' && isComplate == '2'" :text-inside="true"
                         :stroke-width="20" :percentage="((topicIndex + planIsComplateNum) / planAllNum) * 100"
                         color="#48D68E">
                         <span style="color:#000000">{{ topicIndex + planIsComplateNum }}/{{ planAllNum }}</span>
                     </el-progress>
                     <div v-if="scaleList.length > 0">
-                        <div class="scale_title" v-if="!(flag == '20210617140713' && isComplate == '2')">{{ topicIndex
+                        <div class="scale_title" v-if="!(flag == '20210713155333' && isComplate == '2')">{{ topicIndex
                             }}:{{ scaleList[topicIndex - 1].content }}</div>
-                        <div class="scale_title" v-if="flag == '20210617140713' && isComplate == '2'">{{ topicIndex +
+                        <div class="scale_title" v-if="flag == '20210713155333' && isComplate == '2'">{{ topicIndex +
                             planIsComplateNum }}:{{ scaleList[topicIndex - 1].content }}</div>
                         <el-radio-group v-model="scaleList[topicIndex - 1].isCheck" class="scale_radio_group">
                             <el-radio-button

+ 47 - 0
src/views/ScaleDetail.vue

@@ -99,6 +99,53 @@ const sclStatus = async () => {
         //得到list
 
 
+    } else if (flag.value == "20210713155333") {
+        //
+        //
+        let userNo = ''
+        //登录的话
+        //判断当前是否有后台管理
+        userNo = userInfo.userInfo.userNo
+        //调用根据用户查询计划的API
+        let res: any = await userPlanApi(userNo)
+        for (let i = 0; i < res.data.length; i++) {
+            if (res.data[i].id = planId.value) {
+                planObj.value = res.data[i]
+            }
+
+        }
+        //将list赋值进去
+        planObj.value.list = [];
+        let params = {
+            planId: planObj.value.id,
+            userNo: userInfo.userInfo.userNo
+        }
+        //调用详细的API
+        let temp: any = await userPlanDetailApi(params)
+        planObj.value.list = temp.data
+        //循环list 查询到量表的状态
+        for (let i = 0; i < planObj.value.list.length; i++) {
+            if (planObj.value.list[i].flag == '20210713155333') {
+                if (planObj.value.list[i].isCompleted == '0') {
+                    isComplate.value = planObj.value.list[i].isCompleted
+                } else if (planObj.value.list[i].isCompleted == '1') {
+                    //此时应该判断--他后边还有需要做的吗  必做--不显示的量表--如果有状态改为2 --如果没有状态改为1
+                    let listTmp = []
+                    for (let j = 0; j < planObj.value.list.length; j++) {
+
+                        if (planObj.value.list[j].isDisplayed == '0' && planObj.value.list[j].isAvailable == '1' && planObj.value.list[j].isCompleted == '0') {
+                            listTmp.push('1')
+                        }
+                    }
+                    if (listTmp.length > 0) {
+                        isComplate.value = '2'
+                    } else {
+                        isComplate.value = '1'
+                    }
+                }
+            }
+        }
+
     }
     //如果是1的状态 需要
 

+ 4 - 1
src/views/TestRecord.vue

@@ -87,11 +87,14 @@ const initData = async () => {
                     userNo: userInfo.userInfo.userNo
                 }
                 let temp: any = await userPlanDetailApi(params)
+
                 //在这里循环//且类型等于0 量表的  得到量表的列表
                 let scaleList = []
                 for (let j = 0; j < temp.data.length; j++) {
                     if (temp.data[j].isDisplayed == '1' && temp.data[j].contentType == '0') {
-                        scaleList.push(temp.data[j])
+                        if (temp.data[j].flag != '20210617140713') {
+                            scaleList.push(temp.data[j])
+                        }
                     }
                 }
                 listInit[i].scaleList = scaleList;