linxuxiang 6 hónapja
szülő
commit
3484926992

+ 11 - 8
src/components/ChooseStudent/index.vue

@@ -12,14 +12,14 @@
         <div class="content">
           <div class="searchBox">
             <el-select class="select" v-model="optionForm.grade" :popper-append-to-body="false" placeholder="年级"
-              clearable>
+              @change="changeGrade" clearable>
               <el-option v-for="item in gradeLists" :key="item.value" :label="item.label" :value="item.value" />
             </el-select>
             <el-select class="select" v-model="optionForm.class" :popper-append-to-body="false" placeholder="班级"
-              clearable>
+              @change="getSearchStudent" @clear="getSearchStudent" clearable>
               <el-option v-for="item in classData" :key="item.value" :label="item.name" :value="item.id" />
             </el-select>
-            <el-input class="input" v-model="optionForm.name" placeholder="请输入学生姓名" clearable />
+            <el-input class="input" v-model="optionForm.name" placeholder="请输入学生姓名" clearable @clear="getSearchStudent"/>
             <el-button class="button" type="primary" @click="getSearchStudent">搜索</el-button>
           </div>
           <div class="tableBox">
@@ -40,7 +40,7 @@
           </div>
           <div class="page">
             <el-pagination layout="prev, pager, next" :total="page.total" :page-size="page.size"
-              :page-sizes="[20, 60, 120]" :current-page="page.page" @size-change="handleSizeChange"
+              :page-sizes="[20, 60, 120]" :current-page="page.current" @size-change="handleSizeChange"
               @current-change="handleCurrentChange" />
           </div>
           <div class="multipleList" v-if="props.selectType == 'multiple'">
@@ -87,10 +87,7 @@ const classData = computed(() => {
 });
 
 const data = reactive<any>({
-  optionForm: {
-    gesture: true,
-    hasHB: false,
-  },
+  optionForm: {},
   optionWindow: {
     show: false,
     time: "",
@@ -182,6 +179,12 @@ const getStudent = () => {
   });
 };
 
+//变更年级
+const changeGrade = () => {
+  optionForm.value.class = '';
+  getSearchStudent();
+};
+
 //搜索
 const getSearchStudent = () => {
   page.value.current = 1;

+ 19 - 11
src/components/MultipleItem/index.vue

@@ -11,7 +11,8 @@
           </div>
         </Transition>
         <div class="name" :class="{ 'name2': faceCheckStu.student_id }">
-          {{ faceCheckStu.student_id ? faceCheckStu.name : area && ![0].includes(examState) ? "虚位以待":area && [0].includes(examState)?"离线" : "未启用" }}
+          {{ faceCheckStu.student_id ? faceCheckStu.name : area && ![0].includes(examState) ? "虚位以待" : area &&
+            [0].includes(examState) ? "离线" : "未启用" }}
         </div>
         <div class="ctrlBox" v-if="props.examState == 43 && examState == 43 && handcontroller && ctrl == area">
           <img src="@/assets/images/test/jushou.png" />
@@ -26,18 +27,15 @@
         || 0 }}
     </div>
     <!-- <div>当前状态:({{ examState == 3 ? "初始化完成" : examState == 40 ? "创建测试" : examState == 41 ? "正在人脸识别" :examState == 43 ? "停止人脸识别" : examState == 42 ? "正在测试" : "离线状态" }})</div> -->
-    <ChooseStudent ref="chooseStudentRef" @returnData="returnStudent" />
   </div>
 </template>
 
 <script setup lang="ts">
-import { initSpeech, speckText, playMusic, controlMusic, speckCancel, chineseNumber } from '@/utils/speech'
 import { openOneTest, startFace, stopFace, faceConfirmOnly, startOneTest, finishOneTest, closeOneTest, suspendFaceRecognitionChannels, resumeFaceRecognitionChannels } from '@/utils/ws'
 import dataDictionary from "@/utils/dataDictionary"
 const route = useRoute();
 const { proxy } = getCurrentInstance() as any;
-const chooseStudentRef = ref();
-const emit = defineEmits(['returnData']);
+const emit = defineEmits(['returnData', 'getChooseStudent']);
 
 //父值
 const props = defineProps({
@@ -288,37 +286,46 @@ const getChooseStudent = () => {
   }
   console.log("examState.value", examState.value)
   if (examState.value == 0) {
-    proxy?.$modal.msgWarning(`当前状态:${examState.value}`);
+    proxy?.$modal.msgWarning(`【${area}】当前状态:${examState.value}`);
     return false;
   }
   if (props.examState == 3 && (examState.value == 3 || examState.value == 40)) {
     if (props.needStart) {
-      proxy?.$modal.msgWarning(`请点击右下角的【开始识别】,当前状态:${examState.value}`);
+      proxy?.$modal.msgWarning(`请点击右下角的【开始识别】,【${area}】当前状态:${examState.value}`);
     } else {
-      proxy?.$modal.msgWarning(`当前状态:${examState.value}`);
+      proxy?.$modal.msgWarning(`【${area}】当前状态:${examState.value}`);
     }
     return false;
   }
   if (props.examState == 41 && (examState.value == 3 || examState.value == 40)) {
-    proxy?.$modal.msgWarning(`当前状态:${examState.value}`);
+    proxy?.$modal.msgWarning(`【${area}】当前状态:${examState.value}`);
     return false;
   }
   if (examState.value == 41) {
-    chooseStudentRef.value.open();
+    chooseStudent();
   }
   if (examState.value == 43) {
     getRetestFace();
   }
   if (props.examState == 42) {
-    proxy?.$modal.msgWarning(`【${area}】正在测试请结束后再操作:${examState.value}`);
+    proxy?.$modal.msgWarning(`【${area}】正在测试请结束后再操作,当前状态:${examState.value}`);
     return false;
   }
 };
 
+/**
+ * 选择学生
+*/
+const chooseStudent = () => {
+  // chooseStudentRef.value.open();
+  emit('getChooseStudent', { area: area });
+};
+
 /**
  * 返回被选学生
 */
 const returnStudent = (data: any) => {
+  console.log("11111", data)
   faceCheckStu.value = data;
   getStopFace();
 };
@@ -498,6 +505,7 @@ defineExpose({
   getStartOneTest,
   getAgain,
   getAllRetestFace,
+  returnStudent
 })
 </script>
 

+ 0 - 1
src/components/ReportList/index.vue

@@ -35,7 +35,6 @@ import dataDictionary from "@/utils/dataDictionary"
 const dic: any = dataDictionary;
 const { proxy } = getCurrentInstance() as any;
 const router = useRouter();
-const route = useRoute();
 const reportWindowRef = ref();
 const reportScrollRef = ref();
 

+ 38 - 6
src/components/ReportWindow/index.vue

@@ -23,7 +23,8 @@
           <div class="left-bottom">
             <div class="left-bottom-title">
               <div>测试结果</div>
-              <div class="time">{{ proxy?.$utils.getDate(faceCheckStu.ctime || faceCheckStu.finish_time) }}</div>
+              <div class="time">{{ proxy?.$utils.timestampFormat(reportDetails.ctime || reportDetails.finish_time) }}
+              </div>
             </div>
             <div class="left-bottom-content">
               <div class="achievement">
@@ -120,7 +121,7 @@
             <div class="column column2">
               <div class="title2">数据查看</div>
               <div class="erweima">
-                <img :src="erweima" />
+                <img :src="erweima" @click="getMobile" />
               </div>
             </div>
           </div>
@@ -140,6 +141,7 @@ import 'swiper/scss/pagination';
 import dataDictionary from "@/utils/dataDictionary"
 const { proxy } = getCurrentInstance() as any;
 const emit = defineEmits(['returnData']);
+const router = useRouter();
 const echartsRef = ref(null);
 const data = reactive<any>({
   reportWindow: {
@@ -149,7 +151,7 @@ const data = reactive<any>({
   faceCheckStu: {},
   reportDetails: {},
   currentTab: 2,
-  erweima:""
+  erweima: ""
 });
 
 const { reportWindow, type, faceCheckStu, reportDetails, currentTab, erweima } = toRefs(data);
@@ -185,14 +187,45 @@ const getChoose = (data: any) => {
  * 获取二维码
 */
 const getErweima = () => {
+  //测试详情 exam_name、stu_key、test_key
+  //上课详情 exam_name、student_id、result_ids
+  let url = ''
+  if (reportDetails.value.test_key) {
+    url = `${location.origin}/#/analysis/detail?exam_name=${type.value}&stu_key=${reportDetails.value.stu_key}&test_key=${reportDetails.value.test_key}`
+  } else {
+    url = `${location.origin}/#/analysis/detail?exam_name=${type.value}&student_id=${reportDetails.value.student_id}&result_ids=${reportDetails.value.result_id}`
+  }
+  console.log("url", url)
   QRCode.toDataURL(
-    `${location.origin}/#/analysis/detail?exam_name=${type.value}&stu_key=${faceCheckStu.value.student_id}`
+    url
   )
     .then((res: any) => {
       erweima.value = res;
     })
 }
 
+/**
+ * 跳转手机
+*/
+const getMobile = () => {
+  let params = {}
+  if (reportDetails.value.test_key) {
+    params = {
+      exam_name: type.value,
+      stu_key: reportDetails.value.stu_key,
+      test_key: reportDetails.value.test_key
+    }
+  } else {
+    params = {
+      exam_name: type.value,
+      student_id: reportDetails.value.student_id,
+      result_ids: reportDetails.value.result_id,
+    }
+  }
+  let routeUrl: any = router.resolve({ path: '/analysis/detail', query: params });
+  window.open(routeUrl.href, '_blank');
+}
+
 //打开
 const open = async (typeData: any, data: any) => {
   console.log("data", data)
@@ -509,8 +542,7 @@ defineExpose({
           }
         }
 
-        .close {
-        }
+        .close {}
       }
 
       .content {

+ 10 - 1
src/utils/index.ts

@@ -78,7 +78,16 @@ let utils = {
 
   // 时间戳转为日期
   timestampFormat: (data: any) => {
-    return dayjs(data).format('YYYY-MM-DD HH:mm:ss');
+    console.log("111", data)
+    if(data){
+      if(data.length == 10){
+        return dayjs(data * 1000).format('YYYY-MM-DD HH:mm:ss')
+      }else{
+        return dayjs(data).format('YYYY-MM-DD HH:mm:ss')
+      }
+    }else{
+      return '';
+    }
   },
 
   /**

+ 2 - 2
src/views/analysis/detail.vue

@@ -240,9 +240,9 @@ const { query, details, gradeType } = toRefs(data);
 */
 const getTestExamDetails = () => {
   let params = {
-    test_key: query.value.test_key,
+    exam_name: query.value.exam_name,
     stu_key: query.value.stu_key,
-    exam_name: query.value.exam_name
+    test_key: query.value.test_key
   };
   proxy?.$http.analysis.testExamDetails(params)
     .then((res: any) => {

+ 7 - 10
src/views/train/index.vue

@@ -120,22 +120,13 @@ $waiPadding: 6.51rem;
     justify-content: center;
     align-items: center;
     cursor: pointer;
-
-    .name {
-      width: 100%;
-      font-size: 2.48rem;
-      color: #1A293A;
-      padding: 0.5rem 0;
-      text-align: center;
-    }
-
     .pic {
       width: 11.36vw;
       height: 11.36vw;
       border-radius: 50%;
       background: radial-gradient(78% 78% at 53% 50%, #07121A 0%, #2A4256 49%, #5180A9 100%);
       box-shadow: 0px 0px 2px 2px #FFFFFF;
-      margin-bottom: 2vh;
+      margin-bottom: 2.5vh;
       overflow: hidden;
       display: flex;
       align-items: center;
@@ -148,6 +139,12 @@ $waiPadding: 6.51rem;
         transition: all 1s;
       }
     }
+    .name {
+      width: 100%;
+      font-size: 2.48rem;
+      color: #1A293A;
+      text-align: center;
+    }
 
     &:hover {
       img {

+ 27 - 2
src/views/train/multiple.vue

@@ -14,7 +14,7 @@
           :class="{ 'overlap': (examState == 43 && time.ready) || [42].includes(examState) || (showTestAgain && ![41].includes(examState)), 'ready': [41].includes(examState), 'hands': parameter.gesture }"
           v-for="(items, indexs) in testListArr " :key="indexs">
           <MultipleItem :ref="(el: any) => { multipleItemRef(el, item.itemNumber, item.area) }"
-            v-for="(item, index) in items" :query="parameter" :area="item.area" :key="index" @returnData="returnData"
+            v-for="(item, index) in items" :query="parameter" :area="item.area" :key="index" @returnData="returnData"  @getChooseStudent="getChooseStudent"
             :examState="examState" :needStart="needStart" :styleType="styleType" />
         </div>
       </div>
@@ -62,6 +62,7 @@
       </Transition>
     </div>
     <!--倒计时结束-->
+    <ChooseStudent ref="chooseStudentRef" @returnData="returnStudent" />
   </div>
 </template>
 
@@ -73,6 +74,7 @@ const { proxy } = getCurrentInstance() as any;
 const router = useRouter();
 const route = useRoute();
 const reportListRef = ref();
+const chooseStudentRef = ref();
 const data = reactive<any>({
   timerManager: {},//计时器管理
   parameter: {},//参数
@@ -93,8 +95,9 @@ const data = reactive<any>({
   exit: 0,//退出响应次数
   sid: null,//WS的id
   listenWs: false,//是否监听手势
+  chooseStudentArea:'',//弹出手动选择对应的区号
 });
-const { timerManager, parameter, time, userInfo, examState, needStart, showTestAgain, testList, multipleItemRefList, styleType, showReportList, exit, sid, listenWs } = toRefs(data);
+const { timerManager, parameter, time, userInfo, examState, needStart, showTestAgain, testList, multipleItemRefList, styleType, showReportList, exit, sid, listenWs, chooseStudentArea } = toRefs(data);
 
 /**
  * 创建组件实例
@@ -310,6 +313,28 @@ const getCounting = (type: string) => {
   }, 1000);
 };
 
+/**
+ * 子组件选择学生
+*/
+const getChooseStudent = (data: any) => {
+  console.log("data",data)
+  chooseStudentArea.value = data;
+  chooseStudentRef.value.open();
+}
+
+/**
+ * 返回被选学生
+*/
+const returnStudent = (data: any) => {
+  console.log("data",data)
+  let area = chooseStudentArea.value.area;
+  let index = testList.value.findIndex((item: any) => {
+      return area == item.area;
+    })
+  console.log("index",index)
+  multipleItemRefList.value[index]?.returnStudent(data);
+};
+
 /**
  * 子组件返回数据
 */