优化界面显示;预部署;
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div>
|
||||
<h1>小蚕分析页面</h1>
|
||||
<h1>正在开发中,敬请期待</h1>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user