Browse Source

修改测试计划报告

plg 6 months ago
parent
commit
599cdc8e1a
2 changed files with 269 additions and 9 deletions
  1. 266 8
      src/views/TestRecord.vue
  2. 3 1
      src/views/shapeIntuition_random.vue

+ 266 - 8
src/views/TestRecord.vue

@@ -7,6 +7,7 @@ import { menuStatusStore, userInfoStore } from '@/stores'
 // import router from '@/router';
 import { useRouter } from 'vue-router';
 import { getDataApi } from '@/api/plan';
+import { userPlanDetailApi } from '@/api/home';
 const router = useRouter()
 const menuStatus = menuStatusStore();
 menuStatus.saveActiveIndex('5')
@@ -70,9 +71,54 @@ const initData = async () => {
     }
     let res: any = await getDataApi(params)
     if (res.code == 200) {
+        //在这里需要将已经测试完成的测试计划下的---的题目都标记出来
+        //
+
+
+
+
         // list.value.push(...res.data)
         if (res.data.content.length > 0) {
-            list.value.push(...res.data.content)
+            let listInit = []
+            listInit.push(...res.data.content)
+            // list.value.push(...res.data.content)
+
+
+            //在这里进行循环--将需要显示的报告查询出来放入数组
+            console.log(listInit.length)
+            for (let i = 0; i < listInit.length; i++) {
+
+                // list.value[i].listLin = []
+
+                console.log(JSON.stringify(listInit))
+                let params = {
+                    planId: listInit[i].id,
+                    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])
+                    }
+                }
+                listInit[i].scaleList = scaleList;
+                //在这里循环 //且类型为等于1的量表  得到量表列表
+                let taskList = []
+                for (let j = 0; j < temp.data.length; j++) {
+                    if (temp.data[j].isDisplayed == '1' && temp.data[j].contentType == '0') {
+                        taskList.push(temp.data[j])
+                    }
+                }
+                listInit[i].taskList = taskList;
+                // list.value[i].list = temp.data
+                // list.value[i].listLin = []
+            }
+            console.log("listInit")
+            console.log(listInit)
+            list.value.push(...listInit)
+
             totol.value = res.data.totalElements
         } else {
             list.value = []
@@ -134,19 +180,76 @@ onUnmounted(() => {
                             </div>
                             <div class="test_time">
                                 <span>测试时间:{{ item.taskStartTime }}~{{ item.taskEndTime }}</span>
-                                <div @click="viewReport(item.id)">查看报告</div>
+                                <!-- <div @click="viewReport(item.id)">查看报告</div> -->
+                            </div>
+                            <div class="content_out">
+                                <div class="content_inner">
+                                    <div class="task_out">
+                                        <div class="content_title">1.问答测试</div>
+                                        <div class="task_inner">
+
+                                            <div class="task_inner_single" v-for="subItem in item.scaleList"
+                                                :key="subItem.id">
+                                                <div class="task_inner_one">
+                                                    <img style="width: 80px;height: 80px"
+                                                        src="../assets/kepu/xlwht_active.png" alt="">
+                                                    <div class="task_content">
+                                                        <div class="title">{{ subItem.name }}</div>
+                                                        <!-- <div class="des" v-show="subItem.isCompleted != '1'">预计用时:{{
+                                                            subItem.expectTime }}</div> -->
+                                                        <div class="des" v-show="subItem.isCompleted == '1'">实际用时:{{
+                                                            subItem.useTime }}</div>
+                                                        <!-- <div class="noCompleted" v-show="subItem.isCompleted != '1'">
+                                                            <div class='noCompleted_status'> 未完成</div>
+                                                        </div> -->
+                                                        <div class="isCompleted" v-show="subItem.isCompleted == '1'">
+                                                            <div class='isCompleted_status'> 查看报告</div>
+                                                        </div>
+                                                    </div>
+                                                </div>
+                                            </div>
+
+                                        </div>
+                                    </div>
+                                    <div class="task_out">
+                                        <div class="content_title">2.认知评估</div>
+                                        <div class="task_inner">
+                                            <div class="task_inner_single" v-for="subItem in item.taskList">
+                                                <div class="task_inner_one">
+                                                    <img style="width: 80px;height: 80px"
+                                                        src="../assets/kepu/xlwht_active.png" alt="">
+                                                    <div class="task_content">
+                                                        <div class="title">{{ subItem.name }}</div>
+                                                        <!-- <div class="des" v-show="subItem.isCompleted != '1'">预计用时:{{
+                                                            subItem.expectTime }}</div> -->
+                                                        <div class="des" v-show="subItem.isCompleted == '1'">实际用时:{{
+                                                            subItem.useTime }}</div>
+                                                        <!-- <div class="noCompleted" v-show="subItem.isCompleted != '1'">
+                                                            <div class='noCompleted_status'> 未完成</div>
+                                                        </div> -->
+                                                        <div class="isCompleted" v-show="subItem.isCompleted == '1'">
+                                                            <div class='isCompleted_status'> 查看报告</div>
+                                                        </div>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                </div>
+
+                                <div></div>
                             </div>
-                            <div class="record_out">
+                            <!-- <div class="record_out">
                                 <div class="record_score">
                                     <span>得&nbsp;&nbsp;&nbsp;&nbsp;分:</span>
                                     <span>{{ item.score }}</span>
                                 </div>
                                 <div class="record_result">
                                     <span>结&nbsp;&nbsp;&nbsp;&nbsp;论:</span>
-                                    <span>{{ item.briefingList[0].dimensionConclusion
-                                        }},{{ item.briefingList[0].dimensionAnalysis }}</span>
                                 </div>
-                            </div>
+                            </div> -->
+
+
                         </div>
                         <div style="text-align: center;margin-top:20px" v-show="isLoading">努力加载中...</div>
                         <div style="text-align: center;;margin-top:20px" v-show="noMore">没有更多了</div>
@@ -273,6 +376,7 @@ onUnmounted(() => {
                 }
 
                 .test_time {
+                    margin-bottom: 10px;
                     display: flex;
                     flex-direction: row;
                     justify-content: space-between;
@@ -322,10 +426,164 @@ onUnmounted(() => {
 
                     }
                 }
-            }
 
-            // margin-bottom: 60px;
+                .content_out {
+                    display: flex;
+                    flex-direction: column;
+                    width: 100%;
+                    // height: 200px;
+                    background-color: #F7F7F7;
+                    border-radius: 40px;
+
+                    .content_inner {
+                        padding: 20px 40px;
+
+                        .content_title {
+                            margin-bottom: 0px;
+                            font-weight: 700;
+                            font-size: 18px;
+                        }
+
+                        .content_one {
+                            border-radius: 20px;
+
+                            // padding: 10px 20px;
+                            display: flex;
+                            background-color: #ffffff;
+                            width: 45%;
+                            align-items: center;
+
+                            .content_single {
+                                border-radius: 20px;
+
+                                padding: 10px 20px;
+                                display: flex;
+                                background-color: #ffffff;
+                                width: 45%;
+                                align-items: center;
 
+                                .content_detail {
+                                    display: flex;
+                                    margin-left: 15px;
+                                    justify-content: start;
+                                    height: 80px;
+                                    flex-direction: column;
+
+                                    .title {
+                                        font-weight: 700;
+                                        font-size: 18px;
+                                    }
+
+                                    .des {
+                                        color: #999999;
+                                        font-size: 14px;
+                                    }
+                                }
+                            }
+
+
+                        }
+
+                        .task_out {
+                            margin-top: 20px;
+                            display: flex;
+                            flex-direction: column;
+
+                            .task_inner {
+                                display: flex;
+                                flex-direction: row;
+
+                                justify-content: space-between;
+                                flex-wrap: wrap;
+
+                                .task_inner_single {
+                                    margin-top: 20px;
+                                    height: 100px;
+                                    border-radius: 20px;
+                                    width: 45%;
+                                    display: flex;
+                                    flex-direction: row;
+                                    background-color: #ffffff;
+                                    align-items: center;
+
+                                    .task_inner_one {
+                                        padding: 10px 20px;
+                                        border-radius: 20px;
+                                        width: 100%;
+                                        display: flex;
+                                        flex-direction: row;
+                                        background-color: #ffffff;
+                                        align-items: center;
+
+                                        .task_content {
+                                            height: 80px;
+                                            margin-left: 10px;
+                                            display: flex;
+                                            flex-direction: column;
+                                            width: 100%;
+
+                                            .title {
+                                                font-weight: 700;
+                                                font-size: 18px;
+                                                width: 100%;
+                                                letter-spacing: 2px;
+                                            }
+
+                                            .des {
+
+                                                color: #999999;
+                                                font-size: 14px;
+                                                line-height: 24px;
+                                                letter-spacing: 2px;
+                                            }
+
+                                            .noCompleted {
+                                                width: 100%;
+                                                color: #ffffff;
+                                                display: flex;
+                                                justify-content: end;
+
+                                                .noCompleted_status {
+                                                    line-height: 24px;
+                                                    font-size: 14px;
+                                                    border-radius: 20px;
+                                                    text-align: center;
+                                                    right: 0px;
+                                                    width: 70px;
+                                                    background-color: red;
+                                                }
+                                            }
+
+                                            .isCompleted {
+                                                width: 100%;
+                                                color: #ffffff;
+                                                display: flex;
+                                                justify-content: end;
+
+                                                .isCompleted_status {
+                                                    padding-left: 10px;
+                                                    padding-right: 10px;
+                                                    line-height: 30px;
+                                                    font-size: 14px;
+                                                    border-radius: 4px;
+                                                    text-align: center;
+                                                    right: 0px;
+                                                    width: 70px;
+                                                    border-radius: 12px;
+                                                    border: 3px solid #48D68E;
+                                                    color: #ffffff;
+                                                    background-color: #000000;
+                                                    cursor: pointer
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
         }
     }
 

+ 3 - 1
src/views/shapeIntuition_random.vue

@@ -264,8 +264,10 @@ export default {
             type: "success",
           });
           //调用接口---查看此计划后边是不是还有--需要测试的认知任务---如果有的话
-          //跳转到---
+          //跳转到--- 计划页
           this.$router.push({ name: 'plan' })
+
+          //如果后边没有--则测试跳转到报告页
           //需要跳转到
           this.saveFalg = false;
         }