浏览代码

日常开发

林旭祥 7 月之前
父节点
当前提交
0ca98e6926
共有 3 个文件被更改,包括 11 次插入7 次删除
  1. 11 3
      src/views/gesture/index.vue
  2. 0 2
      src/views/train/multiple.vue
  3. 0 2
      src/views/train/test.vue

+ 11 - 3
src/views/gesture/index.vue

@@ -78,11 +78,15 @@ const getOption = (data: any) => {
  * 获取项目
 */
 const getExam = async () => {
+  let examList = device_info.value?.project_list.map((item: any) => {
+    return item.exam_name;
+  })
   await proxy?.$http.train.projectList().then((res: any) => {
     projectList.value = proxy?.$utils.getProject(res.exams).filter((item: any) => {
       //只显示能开的
-      return item.area.length > 0;
+      return item.area.length > 0 && examList.includes(item.key);
     });
+    console.log("projectList.value", projectList.value)
   });
 };
 
@@ -113,7 +117,7 @@ const slideNext = () => {
 const confirm = () => {
   let project = projectList.value[mySwiper.value.realIndex];
   console.log("project", project)
-  let obj = device_info.value.project_list.find((item) => {
+  let obj = device_info.value.project_list.find((item: any) => {
     return item.exam_name == project.key;
   })
   if (obj == undefined) {
@@ -222,10 +226,10 @@ onBeforeMount(() => {
     if (e?.device_info) {
       console.log("e.device_info", e.device_info)
       device_info.value = e.device_info
+      getInitExam();
       getHandWs();
     }
   });
-  getInitExam();
 })
 onMounted(() => {
 
@@ -299,6 +303,10 @@ $waiPadding: 6.51rem;
     }
   }
 
+  .swiper {
+    width: 100%;
+  }
+
   .swiper-slide {
     transform: scale(0.8);
     transition: all 0.3s ease-in-out;

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

@@ -488,8 +488,6 @@ const initHand = () => {
       let handcontroller_id = parameter.value.handcontroller;
       if (handcontroller_id) {
         startHand(handcontroller_id)
-      } else {
-        proxy?.$modal.msgError("请配置手势ID");
       }
     }
     //左滑动

+ 0 - 2
src/views/train/test.vue

@@ -699,8 +699,6 @@ const initHand = () => {
       let handcontroller_id = parameter.value.handcontroller;
       if (handcontroller_id) {
         startHand(handcontroller_id)
-      } else {
-        proxy?.$modal.msgError("请配置手势ID");
       }
     }
     //左滑动