Merge remote-tracking branch 'origin/ai-hub' into ai-hub
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
export type LayoutType = 'vertical';
|
||||
export type LayoutType = | 'vertical' | 'blankPage';
|
||||
|
||||
// 仿豆包折叠逻辑
|
||||
export type CollapseType =
|
||||
| 'alwaysCollapsed' // 始终折叠
|
||||
| 'followSystem' // 跟随系统视口宽度
|
||||
| 'alwaysExpanded' // 始终打开
|
||||
| 'narrowExpandWideCollapse'; // 系统视口 宽小则张,宽大则收
|
||||
export type CollapseType
|
||||
= | 'alwaysCollapsed' // 始终折叠
|
||||
| 'followSystem' // 跟随系统视口宽度
|
||||
| 'alwaysExpanded' // 始终打开
|
||||
| 'narrowExpandWideCollapse'; // 系统视口 宽小则张,宽大则收
|
||||
|
||||
export interface DesignConfigState {
|
||||
// 系统主题
|
||||
|
||||
9
Yi.Ai.Vue3/src/layouts/LayoutBlankPage/index.vue
Normal file
9
Yi.Ai.Vue3/src/layouts/LayoutBlankPage/index.vue
Normal file
@@ -0,0 +1,9 @@
|
||||
<!-- LayoutBlankPage/index.vue -->
|
||||
<template>
|
||||
<!-- 完全空白,不包裹任何容器 -->
|
||||
<router-view />
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
/* 无样式 */
|
||||
</style>
|
||||
@@ -1,6 +1,7 @@
|
||||
<!-- 主布局 -->
|
||||
<script setup lang="ts">
|
||||
import type { LayoutType } from '@/config/design';
|
||||
import LayoutBlankPage from '@/layouts/LayoutBlankPage/index.vue';
|
||||
// import { useScreenStore } from '@/hooks/useScreen';
|
||||
import LayoutVertical from '@/layouts/LayoutVertical/index.vue';
|
||||
import { useDesignStore } from '@/stores';
|
||||
@@ -8,6 +9,7 @@ import { useDesignStore } from '@/stores';
|
||||
// 这里添加布局类型
|
||||
const LayoutComponent: Record<LayoutType, Component> = {
|
||||
vertical: LayoutVertical,
|
||||
blankPage: LayoutBlankPage,
|
||||
};
|
||||
|
||||
const designStore = useDesignStore();
|
||||
|
||||
@@ -21,6 +21,6 @@ app.use(ElementPlusX);
|
||||
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
||||
app.component(key, component);
|
||||
}
|
||||
app.use(store);
|
||||
|
||||
app.use(store);
|
||||
app.mount('#app');
|
||||
|
||||
@@ -3,7 +3,13 @@ import type { Product } from '@/api/products/products';
|
||||
import { ArrowDown, CircleCheck } from '@element-plus/icons-vue';
|
||||
import { computed, ref } from 'vue';
|
||||
import { products } from '@/data/products';
|
||||
import { useDesignStore } from '@/stores';
|
||||
|
||||
const designStore = useDesignStore();
|
||||
|
||||
onMounted(() => {
|
||||
designStore._setLayout('blankPage');
|
||||
});
|
||||
const productsSection = ref<HTMLElement | null>(null);
|
||||
|
||||
function scrollToProducts() {
|
||||
@@ -174,6 +180,8 @@ const comparisonData = computed(() => {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.products-page {
|
||||
height: 100vh;
|
||||
overflow: auto;
|
||||
color: #333;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import { useNProgress } from '@vueuse/integrations/useNProgress';
|
||||
import { createRouter, createWebHistory } from 'vue-router';
|
||||
import { ROUTER_WHITE_LIST } from '@/config';
|
||||
import { errorRouter, layoutRouter, staticRouter } from '@/routers/modules/staticRouter';
|
||||
import { useUserStore } from '@/stores';
|
||||
import { useDesignStore, useUserStore } from '@/stores';
|
||||
|
||||
const { start, done } = useNProgress(0, {
|
||||
showSpinner: false,
|
||||
@@ -28,6 +28,8 @@ router.beforeEach(
|
||||
next: NavigationGuardNext,
|
||||
) => {
|
||||
const userStore = useUserStore();
|
||||
const designStore = useDesignStore(); // 必须在守卫内部调用
|
||||
designStore._setLayout(to.meta?.layout || 'vertical');
|
||||
|
||||
// 1、NProgress 开始
|
||||
start();
|
||||
|
||||
@@ -39,6 +39,7 @@ export const layoutRouter: RouteRecordRaw[] = [
|
||||
title: '产品页面',
|
||||
keepAlive: true, // 如果需要缓存
|
||||
isDefaultChat: false, // 根据实际情况设置
|
||||
layout: 'blankPage', // 如果需要自定义布局
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -32,9 +32,10 @@ export const useDesignStore = defineStore(
|
||||
const layout = ref<LayoutType>(reLayout);
|
||||
|
||||
// 当前只有一个布局,暂时不将这个方法暴露出去
|
||||
// const _setLayout = (layoutType: 'vertical') => {
|
||||
// layout.value = layoutType;
|
||||
// };
|
||||
// const _setLayout = (layoutType: LayoutType) => {
|
||||
const _setLayout = (layoutType: any) => {
|
||||
layout.value = layoutType;
|
||||
};
|
||||
|
||||
// 折叠状态
|
||||
const collapseType = ref<CollapseType>(reCollapseType);
|
||||
@@ -94,6 +95,7 @@ export const useDesignStore = defineStore(
|
||||
isSafeAreaHover,
|
||||
setSafeAreaHover,
|
||||
hasActivatedHover,
|
||||
_setLayout,
|
||||
};
|
||||
},
|
||||
{
|
||||
|
||||
2
Yi.Ai.Vue3/types/import_meta.d.ts
vendored
2
Yi.Ai.Vue3/types/import_meta.d.ts
vendored
@@ -6,8 +6,6 @@ interface ImportMetaEnv {
|
||||
readonly VITE_WEB_ENV: string;
|
||||
readonly VITE_WEB_BASE_API: string;
|
||||
readonly VITE_API_URL: string;
|
||||
readonly SSO_SEVER_URL: string;
|
||||
readonly SSO_CLIENT_ID: string;
|
||||
}
|
||||
|
||||
declare interface ImportMeta {
|
||||
|
||||
Reference in New Issue
Block a user