Просмотр исходного кода

修改认知任务测试计划

plg 1 месяц назад
Родитель
Сommit
86d4fea413
5 измененных файлов с 185 добавлено и 122 удалено
  1. 11 0
      src/api/plan.ts
  2. 3 3
      src/router/index.ts
  3. 126 33
      src/views/Cognize.vue
  4. 18 73
      src/views/Plan.vue
  5. 27 13
      src/views/ScaleDetail.vue

+ 11 - 0
src/api/plan.ts

@@ -22,6 +22,8 @@ const queryMsgUrl = '/comment/findAllByPage'
 
 //查询量表详情
 const queryScaleDetailUrl = '/subject/findByFlag'
+//查询认知任务详情
+const queryCognizeDetailUrl = '/cognitive/findByFlag'
 //首页API
 export const homeApi = (val: any) => {
     return http<any>(
@@ -131,3 +133,12 @@ export const queryScaleDetailApi = (val: string) => {
     })
 }
 
+//根据flag查询 认知任务详细信息
+export const queryCognizeDetailApi = (val: string) => {
+    return http<any>({
+        method: 'get',
+        url: `${queryCognizeDetailUrl}?flag=${val}`
+    })
+}
+
+

+ 3 - 3
src/router/index.ts

@@ -97,7 +97,7 @@ const routes = [
     },
     //认知任务
     {
-      path: 'cognize/:planId/:planName/:flag/:flagName/:num',
+      path: 'cognize/:planId/:planName/:flag/:type',
       name: 'cognize',
       component: () => import('@/views/Cognize.vue')
 
@@ -115,8 +115,8 @@ const routes = [
     name: 'cognizeFaceDot',
     component: () => import('@/views/CognizeFaceDot.vue')
 
-  },{
-    path: '/shapeIntuition_random',
+  }, {
+    path: '/shapeIntuition_random/:planId/:planName/:flag/:flagName',
     name: 'ShapeIntuitionRandom',
     component: () => import('@/views/shapeIntuition_random.vue')
   }

+ 126 - 33
src/views/Cognize.vue

@@ -7,16 +7,18 @@ import pdf3 from '../assets/cognize/goNogo.pdf'
 import pdf4 from '../assets/cognize/dtc.pdf'
 
 import { useRoute, useRouter } from 'vue-router';
+import { queryCognizeDetailApi } from '@/api/plan';
 const router = useRouter()
 const route = useRoute()
 
 
 
 const flag = ref<string>('')
-const flagName = ref<string>('')
-const planId = ref<string>('')
 const planName = ref<string>('')
-const num = ref<string>('')
+const planId = ref<string>('')
+const type = ref<string>('')
+
+const cognizeDetail = ref<any>({})
 
 // 查看PDF
 //刚进入页面就将高度设置为页面需要的
@@ -29,12 +31,30 @@ onMounted(() => {
     flag.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
+    type.value = route.params.type as string
+
+    //根据flag 查询认知任务详情
 
     //进到界面开始轮询
+    if (type.value == '1') {
+        queryScaleDetail()
+    }
 })
-
+const queryScaleDetail = async () => {
+    //根据flag查询量表详情
+    let res: any = await queryCognizeDetailApi(flag.value)
+    console.log(res)
+    cognizeDetail.value = res.data
+    debugger;
+
+    // scaleName.value = res.data.name;
+    // detail.value = res.data.description;
+    // theory.value = res.data.theory;
+    // //参考文献
+    // console.log(res.data.reference)
+    // reference.value = res.data.reference.split('//');
+    // console.log(reference.value)
+}
 const centerDialogVisible = ref<boolean>(false)
 const viewPDF = () => {
     centerDialogVisible.value = true
@@ -47,11 +67,11 @@ const requireImg = (name: string) => {
 }
 
 const startCog = (val: number) => {
-    if (num.value == '3') {
-        router.push({ name: 'cognizeGoNoGo', params: { currentType: val } })
-    } else if (num.value == '4') {
-        router.push({ name: 'cognizeFaceDot', params: { currentType: val } })
-    }
+    // if (num.value == '3') {
+    //     router.push({ name: 'cognizeGoNoGo', params: { currentType: val } })
+    // } else if (num.value == '4') {
+    //     router.push({ name: 'cognizeFaceDot', params: { currentType: val } })
+    // }
 
 }
 
@@ -84,32 +104,33 @@ onUnmounted(() => {
             <div class="kply_inner">
                 <div style="padding :20px 40px">
                     <div class="cognize_title">
-                        {{ flagName }}
+                        {{ cognizeDetail.name }}
                     </div>
                     <div class="cognize_img_out">
-                        <img src="../assets/cognize/c1.png" v-show="num == '3'" width=" 100px"
-                            style="margin-right: 20px;" />
-                        <img src="../assets/cognize/c2.png" v-show="num == '4'" width="100px"
-                            style="margin-right: 20px;" />
+                        <!-- <img src="../assets/kepu/czscz_default.png" width=" 100px" style="margin-right: 20px;" /> -->
+                        <!-- <img src="../assets/cognize/c2.png" v-show="num == '4'" width="100px"
+                            style="margin-right: 20px;" /> -->
                         <div class="cognize_des">
-                            测评介绍:对于患有抑郁症的人群并不在少数,
-                            每一个人或多或少都会有纠结的时候,
-                            所以为了预防和及时了解自己的情况,
-                            医学界给出来很多测量方式,像最常见的自我测量答题表,
-                            专业的他测量表,以及日常行为的观察,就变得极其普遍和有效。(示例)
+                            <span class="cpjs">测评介绍:</span>
+                            <span class="cpjs_detail">{{ cognizeDetail.testExplain }}</span>
                         </div>
 
                     </div>
-                    <div class="cognize_title2"> {{ flagName }}演示视频:</div>
-                    <div class="cognize_video" v-show="num == '3'">
-                        <!-- poster="../assets/cognize/bg_ty.png" -->
-                        <video width="60%" height="100%" controls style="border-radius: 20px;">
-                            <source src="../assets/cognize/goNogo.mp4" type="video/mp4">
-                            <!-- <source src="movie.ogg" type="video/ogg"> -->
-                            您的浏览器不支持 video 标签。
-                        </video>
+                    <div class="cpll">
+                        <span class="cpll_title">理论:</span>
+                        <span class="cpll_detail">{{ cognizeDetail.theory }}</span>
                     </div>
-                    <div class="cognize_video" v-show="num == '4'">
+                    <div class="czsm">
+                        <span class="czsm_title">操作说明:</span>
+                        <span class="czsm_detail">
+                            {{ cognizeDetail.description }}
+                            {{ cognizeDetail.testDescription }}
+                        </span>
+                    </div>
+
+                    <div class="cognize_title2"> {{ cognizeDetail.name }}演示视频:</div>
+
+                    <div class="cognize_video">
                         <!-- poster="../assets/cognize/bg_ty.png" -->
                         <video width="60%" height="100%" controls style="border-radius: 40px;">
                             <source src="../assets/cognize/dtc.mp4" type="video/mp4">
@@ -131,6 +152,14 @@ onUnmounted(() => {
                             <div @click="viewPDF" class="view">预览</div>
                         </div>
                     </div>
+                    <div class="reference_cla" v-if="cognizeDetail.reference">
+                        <div class="reference_title">参考文献:</div>
+                        <div class="reference_detail" v-for="item, index in cognizeDetail.reference.split('//')"
+                            :key="item">
+                            <div>[{{ index + 1 }}] </div>
+                            <div> {{ item }}</div>
+                        </div>
+                    </div>
 
                     <div class="scale_button">
                         <el-row>
@@ -153,11 +182,10 @@ onUnmounted(() => {
                 <!-- <embed width="100%" height=500px v-show="num == '3'" src='../assets/cognize/goNogo.pdf'>
 
                 </embed> -->
-                <embed width="100%" height=600px v-show="num == '3'" :src="requireImg('goNogo')">
-                </embed>
+
                 <!-- <embed width="100%" height=500px v-show="num == '3'" :src="pdf3">
                 </embed> -->
-                <embed width="100%" height=600px v-show="num == '4'" :src="requireImg('dtc')">
+                <embed width="100%" height=600px :src="requireImg('dtc')">
                 </embed>
                 <!-- <embed width="100%" height=500px v-show="num == '4'" :src="pdf4">
                 </embed> -->
@@ -217,6 +245,58 @@ onUnmounted(() => {
             background-color: #ffffff;
             border-radius: 40px;
 
+            .reference_cla {
+                margin-top: 10px;
+
+                .reference_title {
+                    font-size: 14px;
+                    color: #a9a9a9;
+                    line-height: 24px;
+                }
+
+                .reference_detail {
+                    font-size: 14px;
+                    color: #a9a9a9;
+                    line-height: 24px;
+                    letter-spacing: 3px;
+                    display: flex;
+
+                }
+            }
+
+            .cpll {
+                margin-top: 10px;
+
+                .cpll_title {
+                    font-size: 14px;
+                    color: #48D68E;
+                    font-weight: 700;
+                }
+
+                .cpll_detail {
+                    font-size: 14px;
+                    letter-spacing: 3px;
+                    line-height: 24px;
+                }
+            }
+
+            .czsm {
+                margin-top: 10px;
+
+                .czsm_title {
+                    color: #48D68E;
+                    font-weight: 700;
+                    line-height: 24px;
+                    font-size: 14px;
+                }
+
+                .czsm_detail {
+                    line-height: 24px;
+                    font-size: 14px;
+                    letter-spacing: 3px;
+                }
+            }
+
             .cognize_title {
 
                 font-size: 20px;
@@ -241,6 +321,19 @@ onUnmounted(() => {
                     letter-spacing: 2px;
                     line-height: 20px;
                     font-size: 16px;
+
+                    .cpjs {
+                        color: #48D68E;
+                        font-weight: 700;
+                        font-size: 14px;
+                        line-height: 24px;
+                    }
+
+                    .cpjs_detail {
+                        line-height: 24px;
+                        letter-spacing: 3px;
+                        font-size: 14px;
+                    }
                 }
             }
 

+ 18 - 73
src/views/Plan.vue

@@ -34,6 +34,7 @@ const planList = ref<any>([
 // }
 //点击了开始测试--跳转到测试页面
 const startPlan = async (val: any) => {
+    debugger;
     //先判断
     //是否做了问卷
     //如果未做问卷需要弹出问卷的弹出框
@@ -103,8 +104,16 @@ const startPlan = async (val: any) => {
             }
         })
 
-    } else {
+    } else if (type == '1') {
         //跳转到认知任务中间页
+        router.push({
+            name: 'cognize', params: {
+                planId: val.id,
+                planName: val.planName,
+                flag: nextFlag,
+                type: type
+            }
+        })
     }
     //如果是1的话,需要跳转到认知任务中间页面
 
@@ -113,80 +122,16 @@ const startPlan = async (val: any) => {
     //如果量表接口都完成了
     //则开始循环认知任务接口
     debugger;
-    let a = true
-    if (a) {
-        ElMessage({
-            message: '内容开发维护中',
-            type: 'warning'
-        })
-        return
-    }
 
     //判断是否登录了
-    console.log(userInfo.token == '')
-    if (userInfo.token == '') {
-        ElMessage({
-            message: '请先登录',
-            type: 'error'
-        })
-        return
-    }
-
-    let flag = ''
-    let num = 1
-    let flagName = ''
-    for (let i = 0; i < val.list.length; i++) {
-        //判断是该做第一个了
-        if (val.list[i].isCompleted == '0') {
-            flag = val.list[i].flag
-            flagName = val.list[i].name
-            num = i + 1
-            break
-        }
-    }
-    if (flag == '') {
-        //该测试计划已做完
-        return
-    } else {
-        if (num == 2 || num == 1) {
-            router.push({
-                name: 'scale', params: {
-                    planId: val.id,
-                    planName: val.planName,
-                    flag: flag,
-                    flagName: flagName,
-                    num: num
-
-                }
-            })
-        }
-        //当标志是3时应该跳转到认知任务gonogo页面
-        if (num == 3) {
-            router.push({
-                name: 'cognize', params: {
-                    planId: val.id,
-                    planName: val.planName,
-                    flag: flag,
-                    flagName: flagName,
-
-                    num: num
-
-                }
-            })
-        }
-        if (num == 4) {
-            router.push({
-                name: 'cognize', params: {
-                    planId: val.id,
-                    planName: val.planName,
-                    flag: flag,
-                    flagName: flagName,
-
-                    num: num
-                }
-            })
-        }
-    }
+    // console.log(userInfo.token == '')
+    // if (userInfo.token == '') {
+    //     ElMessage({
+    //         message: '请先登录',
+    //         type: 'error'
+    //     })
+    //     return
+    // }
 }
 
 const planNumGet = async () => {

+ 27 - 13
src/views/ScaleDetail.vue

@@ -156,14 +156,20 @@ const startText = () => {
                         {{ scaleName }}
                     </div>
                     <div class="cognize_img_out">
-                        <img src="../assets/cognize/c1.png" v-show="true" width=" 100px" height="100px"
-                            style="margin-right: 20px;" />
+                        <!-- <img src="../assets/cognize/c1.png" v-show="true" width=" 100px" height="100px"
+                            style="margin-right: 20px;" /> -->
+                        <!-- <img src="../assets/kepu/czscz_default.png" width=" 100px" style="margin-right: 20px;" /> -->
+                        <!-- <img src="../assets/kepu/czscz_active.png" v-show="true" width=" 100px" height="100px"
+                            style="margin-right: 20px;" /> -->
                         <div class="cognize_des">
-                            <span class="cpjs">测评介绍:</span>{{ detail }}
+                            <span class="cpjs">测评介绍:</span>
+                            <span class="cpjs_detail">{{ detail }}</span>
                         </div>
 
                     </div>
-                    <div class="yl_out"><span class="yl">原理:</span><span class="yl_detail">{{ theory }}</span>
+                    <div class="yl_out">
+                        <span class="yl">原理:</span>
+                        <span class="yl_detail">{{ theory }}</span>
                     </div>
                     <div class="ckwx">
                         <div class="reference_title">参考文献:</div>
@@ -238,11 +244,14 @@ const startText = () => {
                 .yl {
                     color: #48D68E;
                     font-weight: 700;
+                    font-size: 14px;
+                    line-height: 24px;
                 }
 
                 .yl_detail {
-                    letter-spacing: 2px;
-                    line-height: 25px;
+                    font-size: 14px;
+                    letter-spacing: 3px;
+                    line-height: 24px;
                 }
             }
 
@@ -251,7 +260,7 @@ const startText = () => {
 
                 .reference_title {
                     color: #a9a9a9;
-                    font-size: 16px;
+                    font-size: 14px;
                 }
 
                 .reference_cal {
@@ -259,8 +268,8 @@ const startText = () => {
                     width: 100%;
                     color: #a9a9a9;
                     font-size: 14px;
-                    letter-spacing: 2px;
-                    line-height: 30px;
+                    letter-spacing: 3px;
+                    line-height: 24px;
                 }
             }
 
@@ -287,14 +296,19 @@ const startText = () => {
                 align-items: center;
 
                 .cognize_des {
-                    letter-spacing: 2px;
-                    line-height: 20px;
-                    font-size: 16px;
-                    line-height: 25px;
+
+
 
                     .cpjs {
                         color: #48D68E;
                         font-weight: 700;
+                        font-size: 14px;
+                    }
+
+                    .cpjs_detail {
+                        font-size: 14px;
+                        letter-spacing: 3px;
+                        line-height: 24px;
                     }
                 }
             }