Pārlūkot izejas kodu

Merge branch 'master' of http://101.43.129.26:10880/psychological_camera/cpdm_pc

root 2 mēneši atpakaļ
vecāks
revīzija
08b84a1780

+ 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}`
+    })
+}
+
+

+ 1 - 0
src/components/CpmdQuestionnaire.vue

@@ -101,6 +101,7 @@ const saveQuesQuestion = async () => {
     let res: any = await sqveQuesQuestionApi(questionList.value)
     if (res.code == 200) {
         //跳转到测试计划
+        dialogVisible.value = false
         router.push({ name: 'plan' })
     }
 }

+ 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;
+                    }
                 }
             }
 

+ 41 - 76
src/views/Plan.vue

@@ -1,14 +1,18 @@
 <script setup lang="ts">
 import CpmdHeader from '@/components/CpmdHeader.vue';
+import CpmdQuestionnaire from '@/components/CpmdQuestionnaire.vue'
 import { onMounted, onUnmounted, ref } from 'vue'
 import { useRouter } from 'vue-router'
 import { format } from 'date-fns/format';
 const router = useRouter()
 
+//调用子组件的ref
+const question = ref<any>()
+
 //持久化设置 菜单状态
 import { menuStatusStore, userInfoStore } from '@/stores'
 import { isHaveManage } from '@/utils/test';
-import { userPlanApi, userPlanDetailApi } from '@/api/home';
+import { queryIsQuestionApi, userPlanApi, userPlanDetailApi } from '@/api/home';
 import { ElMessage } from 'element-plus';
 const userInfo = userInfoStore();
 const menuStatus = menuStatusStore();
@@ -29,7 +33,19 @@ const planList = ref<any>([
 //     return hour + ':时'
 // }
 //点击了开始测试--跳转到测试页面
-const startPlan = (val: any) => {
+const startPlan = async (val: any) => {
+    debugger;
+    //先判断
+    //是否做了问卷
+    //如果未做问卷需要弹出问卷的弹出框
+    //做完以后开始测试
+    let res: any = await queryIsQuestionApi()
+    if (res.data != null) {
+        //此时是问卷未做
+        //调用问卷组件打开
+        question.value.open(res.data)
+        return
+    }
     let nextFlag = '';
     let type = '';
     if (val.scaleList.length > 0) {
@@ -88,8 +104,16 @@ const startPlan = (val: any) => {
             }
         })
 
-    } else {
+    } else if (type == '1') {
         //跳转到认知任务中间页
+        router.push({
+            name: 'cognize', params: {
+                planId: val.id,
+                planName: val.planName,
+                flag: nextFlag,
+                type: type
+            }
+        })
     }
     //如果是1的话,需要跳转到认知任务中间页面
 
@@ -98,80 +122,16 @@ const startPlan = (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 () => {
@@ -199,7 +159,7 @@ const planNumGet = async () => {
             let temp: any = await userPlanDetailApi(params)
             planList.value[i].list = temp.data
         }
-
+        debugger;
         //-------------处理SCL90的完成状态----------------
         for (let i = 0; i < planList.value.length; i++) {
             //
@@ -317,6 +277,10 @@ onUnmounted(() => {
                                                 <div class="task_content">
                                                     <div class="title">{{ subItem.name }}</div>
                                                     <div class="des">预计用时{{ subItem.expectTime }}</div>
+                                                    <div
+                                                        :style="{ color: subItem.isCompleted == '1' ? 'green' : 'red' }">
+                                                        {{
+                                                            subItem.isCompleted == '1' ? '已完成' : '未完成' }}</div>
                                                 </div>
                                             </div>
                                         </div>
@@ -456,6 +420,7 @@ onUnmounted(() => {
                 </div>
             </div>
         </div>
+        <CpmdQuestionnaire ref="question" />
     </div>
 </template>
 <style lang="scss" scoped>

+ 6 - 2
src/views/Scale.vue

@@ -2,6 +2,7 @@
 import { format } from 'date-fns/format';
 
 import CpmdHeader from '@/components/CpmdHeader.vue';
+
 import { onMounted, onUnmounted, ref } from 'vue'
 import { Check } from '@element-plus/icons-vue'
 import { number } from 'echarts';
@@ -9,6 +10,7 @@ import { ElMessage } from 'element-plus';
 import { useRouter, useRoute } from 'vue-router';
 import { getScaleApi, queryScaleDetailApi, saveScaleApi } from '@/api/plan';
 import { userInfoStore } from '@/stores'
+//调用子组件的ref
 
 // 加一个锁表示不能重复点击
 const isLock = ref<boolean>(false)
@@ -496,8 +498,10 @@ onUnmounted(() => {
                         <span style="color:#000000">{{ topicIndex + planIsComplateNum }}/{{ planAllNum }}</span>
                     </el-progress>
                     <div v-if="scaleList.length > 0">
-                        <div class="scale_title">{{ topicIndex }}:{{ scaleList[topicIndex - 1].content }}</div>
-
+                        <div class="scale_title" v-if="!(flag == '20210617140713' && isComplate == '2')">{{ topicIndex
+                            }}:{{ scaleList[topicIndex - 1].content }}</div>
+                        <div class="scale_title" v-if="flag == '20210617140713' && 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
                                 v-for="item in scaleList[topicIndex - 1].checkItems.split(';').sort(() => { return Math.random() - 0.5 })  "

+ 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;
                     }
                 }
             }