Explorar o código

fix: 修改部分交互

lvkun996 hai 7 meses
pai
achega
50d5b72779
Modificáronse 3 ficheiros con 25 adicións e 76 borrados
  1. 8 4
      src/layout/components/Sidebar/index.vue
  2. 5 4
      src/pages/card/preview.vue
  3. 12 68
      src/router/index.ts

+ 8 - 4
src/layout/components/Sidebar/index.vue

@@ -72,15 +72,19 @@ const getStageList = async () => {
     const { data } = await StageController.getStageList()
     sliderList.value = data || []
     openKeys.value = data.map(item => (item.id))
-    // openKeys.value = data.map(item => {
-    //   const oneId = item.id
-    //   return [oneId, item.child.map(_ => _.id)]
-    // }).flat(Infinity)
     console.log(data)
   } catch (error) {
     console.error('Failed to fetch stage list:', error)
   }
 }
+
+watch(
+  () => openKeys.value,
+  (newKeys) => {
+    console.log('selectedKeys:', newKeys)
+  }
+)
+
 onMounted(() => {
   getStageList()
 })

+ 5 - 4
src/pages/card/preview.vue

@@ -2,10 +2,10 @@
   <div class="preview-page">
     <a-row :gutter="[24, 16]" justify="flex-start" style="margin-top: 24px;">
       <a-col
-        :xs="3"
-        :sm="3"
-        :md="3"
-        :lg="3"
+        :xs="12"
+        :sm="8"
+        :md="8"
+        :lg="6"
         :xl="3"
         v-for="card in cardList"
         :key="card.id"
@@ -26,6 +26,7 @@
       <a-empty v-if="cardList.length === 0" style="margin: 0 auto;position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);scale: 1.2;"  description="请选择题卡"  />
     </a-row>
   </div>
+
 </template>
 <script lang='ts'  setup >
 import { onMounted, ref, watch } from 'vue'

+ 12 - 68
src/router/index.ts

@@ -1,62 +1,6 @@
 import { useIsMicro } from '@/hooks/effect'
 import { createRouter, createWebHashHistory, RouterView } from 'vue-router'
 
-const knowledge = {
-  path: '/knowledge',
-  name: '知识库',
-  meta: {
-    title: 'knowledge'
-  },
-  component: () => import('@/pages/knowledge/index.vue')
-}
-
-const chatList = {
-  path: '/chat/ist',
-  name: '聊天',
-  meta: {
-    title: 'chat'
-  },
-  component: () => import('@/pages/chat/list.vue')
-}
-
-const chat = {
-  path: '/chat',
-  name: 'chat',
-  meta: {
-    hidden: true,
-    title: 'chat'
-  },
-  component: () => import('@/pages/chat/index.vue')
-}
-
-const search = {
-  path: '/search',
-  name: '搜索',
-  meta: {
-    title: 'search'
-  },
-  component: () => import('@/pages/search/index.vue')
-}
-
-const flow = {
-  path: '/flow',
-  name: '工作流',
-  meta: {
-    title: 'flow'
-  },
-  component: () => import('@/pages/flow/index.vue')
-}
-
-const logo = {
-  path: '/login',
-  name: '登录',
-  meta: {
-    hidden: true,
-    title: 'flow'
-  },
-  component: () => import('@/pages/login/index.vue')
-}
-
 const board = {
   path: '/board',
   name: '登录',
@@ -87,17 +31,6 @@ const card = {
   component: () => import('@/pages/card/index.vue')
 }
 
-const APP = {
-  path: '/',
-  name: 'app',
-  meta: {
-    title: 'app'
-  },
-  component: () => import('@/layout/layout.vue'),
-  redirect: '/card-preview',
-  children: [board, cardPreview]
-}
-
 const CARD = {
   path: '/card',
   name: 'card',
@@ -109,7 +42,18 @@ const CARD = {
   children: [card]
 }
 
-const _routes = [APP, CARD] as any
+const APP = {
+  path: '/',
+  name: 'app',
+  meta: {
+    title: 'app'
+  },
+  component: () => import('@/layout/layout.vue'),
+  redirect: '/card-preview',
+  children: [board, cardPreview, CARD]
+}
+
+const _routes = [APP] as any
 
 if (_routes[0].link) {
   window.open(_routes[0].path)