Merge remote-tracking branch 'origin/ai-hub' into ai-hub

This commit is contained in:
ccnetcore
2025-06-26 00:38:53 +08:00
9 changed files with 35 additions and 13 deletions

View File

@@ -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 {
// 系统主题

View File

@@ -0,0 +1,9 @@
<!-- LayoutBlankPage/index.vue -->
<template>
<!-- 完全空白不包裹任何容器 -->
<router-view />
</template>
<style scoped>
/* 无样式 */
</style>

View File

@@ -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();

View File

@@ -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');

View File

@@ -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;
}

View File

@@ -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();

View File

@@ -39,6 +39,7 @@ export const layoutRouter: RouteRecordRaw[] = [
title: '产品页面',
keepAlive: true, // 如果需要缓存
isDefaultChat: false, // 根据实际情况设置
layout: 'blankPage', // 如果需要自定义布局
},
},
],

View File

@@ -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,
};
},
{

View File

@@ -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 {