优化界面显示;预部署;

This commit is contained in:
BBIT-Kai
2025-05-12 11:29:53 +08:00
parent f6f2a71d09
commit 369980293e
10 changed files with 88 additions and 107 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
<template>
<div>
<h1>小蚕分析页面</h1>
<h1>正在开发中敬请期待</h1>
</div>
</template>
+1 -1
View File
@@ -1,5 +1,5 @@
<template>
<div>
<h1>小蚕分析页面</h1>
<h1>正在开发中敬请期待</h1>
</div>
</template>
@@ -9,20 +9,11 @@ import type {
import { ref } from 'vue';
import { useRouter } from 'vue-router';
import {
AnalysisChartCard,
WorkbenchHeader,
WorkbenchProject,
WorkbenchQuickNav,
WorkbenchTodo,
WorkbenchTrends,
} from '@vben/common-ui';
import { WorkbenchHeader } from '@vben/common-ui';
import { preferences } from '@vben/preferences';
import { useUserStore } from '@vben/stores';
import { openWindow } from '@vben/utils';
import AnalyticsVisitsSource from '../analytics/analytics-visits-source.vue';
const userStore = useUserStore();
// 这是一个示例数据,实际项目中需要根据实际情况进行调整
@@ -231,6 +222,13 @@ function navTo(nav: WorkbenchProjectItem | WorkbenchQuickNavItem) {
console.warn(`Unknown URL for navigation item: ${nav.title} -> ${nav.url}`);
}
}
function getGreeting() {
const hour = new Date().getHours();
if (hour < 6) return '凌晨好';
if (hour < 12) return '早安';
if (hour < 18) return '下午好';
return '晚上好';
}
</script>
<template>
@@ -239,28 +237,10 @@ function navTo(nav: WorkbenchProjectItem | WorkbenchQuickNavItem) {
:avatar="userStore.userInfo?.avatar || preferences.app.defaultAvatar"
>
<template #title>
早安, {{ userStore.userInfo?.username }}, 开始您一天的工作吧
{{ getGreeting() }}, {{ userStore.userInfo?.username }},
开始您一天的工作吧
</template>
<template #description> 今日晴20 - 32 </template>
<template #description> 欢迎使用智能控制中心 </template>
</WorkbenchHeader>
<div class="mt-5 flex flex-col lg:flex-row">
<div class="mr-4 w-full lg:w-3/5">
<WorkbenchProject :items="projectItems" title="项目" @click="navTo" />
<WorkbenchTrends :items="trendItems" class="mt-5" title="最新动态" />
</div>
<div class="w-full lg:w-2/5">
<WorkbenchQuickNav
:items="quickNavItems"
class="mt-5 lg:mt-0"
title="快捷导航"
@click="navTo"
/>
<WorkbenchTodo :items="todoItems" class="mt-5" title="待办事项" />
<AnalysisChartCard class="mt-5" title="访问来源">
<AnalyticsVisitsSource />
</AnalysisChartCard>
</div>
</div>
</div>
</template>
+25 -24
View File
@@ -47,7 +47,7 @@ const gridOptions: VxeGridProps<RowType> = {
gt: 0,
},
// showOverflow: true, // 超出隐藏
height: 'auto',
height: '500px',
// keepSource: true,
stripe: true, // 条纹
proxyConfig: {
@@ -67,33 +67,34 @@ const gridOptions: VxeGridProps<RowType> = {
},
};
const formOptions: VbenFormProps = {
// 默认展开
collapsed: true,
schema: [
{
component: 'Input',
componentProps: {
placeholder: '输入设备名',
},
fieldName: 'deviceName',
label: '筛选',
width: 300,
},
],
// 控制表单是否显示折叠按钮
showCollapseButton: false,
submitButtonOptions: {
content: '查询',
},
// 筛选表单
// const formOptions: VbenFormProps = {
// // 默认展开
// collapsed: true,
// schema: [
// {
// component: 'Input',
// componentProps: {
// placeholder: '输入设备名',
// },
// fieldName: 'deviceName',
// label: '筛选',
// width: 300,
// },
// ],
// // 控制表单是否显示折叠按钮
// showCollapseButton: false,
// submitButtonOptions: {
// content: '查询',
// },
submitOnChange: true, // 是否在字段值改变时提交表单
// submitOnChange: true, // 是否在字段值改变时提交表单
submitOnEnter: true, // 按下回车时是否提交表单
};
// submitOnEnter: true, // 按下回车时是否提交表单
// };
const [Grid] = useVbenVxeGrid({
formOptions,
// formOptions,
gridOptions,
separator: false,
});