From 23e8fae9ab9d229fdf43c80d862a5ec4032a54f7 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期三, 23 十月 2024 17:01:04 +0800
Subject: [PATCH] 18443

---
 src/views/train/data-list/index.vue |   54 +++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 37 insertions(+), 17 deletions(-)

diff --git a/src/views/train/data-list/index.vue b/src/views/train/data-list/index.vue
index 4c75fa9..977a7bc 100644
--- a/src/views/train/data-list/index.vue
+++ b/src/views/train/data-list/index.vue
@@ -4,10 +4,14 @@
       <div class="list-content w-full overflow-x-hidden">
         <el-row :gutter="20">
           <el-col :span="6" v-for="item in props.dataList" class="mb-5">
-            <el-card shadow="hover" class="list-card cursor-pointer" :body-style="{ padding: 0 }"
-              @click="itemClick(item)">
+            <el-card
+              shadow="hover"
+              class="list-card cursor-pointer"
+              :body-style="{ padding: 0 }"
+              @click="itemClick(item)"
+            >
               <div class="img-container w-full">
-                <img src="@/assets/image/list-card-bg.jpg" class="w-full">
+                <img src="@/assets/image/list-card-bg.jpg" class="w-full" />
               </div>
               <div class="item-info p-3">
                 <div class="info-title font-bold">{{ item.meetName }}</div>
@@ -28,30 +32,46 @@
           </el-col>
         </el-row>
       </div>
-
     </el-scrollbar>
   </div>
 </template>
 
 <script setup>
-import { ref } from 'vue';
-import { Timer } from '@element-plus/icons-vue';
-import { useRouter } from 'vue-router';
+import { storeToRefs } from "pinia";
+import { useRouter } from "vue-router";
+import { useUserStore } from "@/store/index.js";
+import { classMeet } from "@/api/modules/meet.js";
+
+const userStore = useUserStore();
+const { userInfo } = storeToRefs(userStore);
 const router = useRouter();
 const props = defineProps({
   dataList: {
     type: Array,
-    default: () => []
-  }
+    default: () => [],
+  },
 });
-
-
+const userId = JSON.parse(localStorage.getItem('user')).userInfo.id
 const itemClick = (item) => {
-  if (window.electron) {
-    window.electron.openNewWindow(JSON.stringify(item));
-  }
-}
-
+  classMeet(item.id)
+    .then((res) => {
+      if (window.webBridge) {
+        window.webBridge.openNewWindow(JSON.stringify(item));
+      } else {
+        let path = router.resolve({
+          path: "/meet",
+          query: {
+            meetName: item.meetName,
+            id: item.id,
+            userName: userInfo.value?.realName + "_" + userId || "",
+            userCode: userInfo.value?.phone + "_" + userId || "",
+          },
+        });
+        window.open(path.href, "_blank");
+      }
+    })
+    .catch((err) => {});
+};
 </script>
 
 <style lang="scss" scoped>
@@ -75,4 +95,4 @@
 .list-card {
   border-radius: 10px;
 }
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.8.0