优化界面显示;预部署;
This commit is contained in:
@@ -4,9 +4,7 @@ import type { NotificationItem } from '@vben/layouts';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
|
||||
import { AuthenticationLoginExpiredModal } from '@vben/common-ui';
|
||||
import { VBEN_DOC_URL, VBEN_GITHUB_URL } from '@vben/constants';
|
||||
import { useWatermark } from '@vben/hooks';
|
||||
import { BookOpenText, CircleHelp, MdiGithub } from '@vben/icons';
|
||||
import {
|
||||
BasicLayout,
|
||||
LockScreen,
|
||||
@@ -15,9 +13,7 @@ import {
|
||||
} from '@vben/layouts';
|
||||
import { preferences } from '@vben/preferences';
|
||||
import { useAccessStore, useUserStore } from '@vben/stores';
|
||||
import { openWindow } from '@vben/utils';
|
||||
|
||||
import { $t } from '#/locales';
|
||||
import { useAuthStore } from '#/store';
|
||||
import LoginForm from '#/views/_core/authentication/login.vue';
|
||||
|
||||
@@ -60,35 +56,35 @@ const showDot = computed(() =>
|
||||
notifications.value.some((item) => !item.isRead),
|
||||
);
|
||||
|
||||
const menus = computed(() => [
|
||||
{
|
||||
handler: () => {
|
||||
openWindow(VBEN_DOC_URL, {
|
||||
target: '_blank',
|
||||
});
|
||||
},
|
||||
icon: BookOpenText,
|
||||
text: $t('ui.widgets.document'),
|
||||
},
|
||||
{
|
||||
handler: () => {
|
||||
openWindow(VBEN_GITHUB_URL, {
|
||||
target: '_blank',
|
||||
});
|
||||
},
|
||||
icon: MdiGithub,
|
||||
text: 'GitHub',
|
||||
},
|
||||
{
|
||||
handler: () => {
|
||||
openWindow(`${VBEN_GITHUB_URL}/issues`, {
|
||||
target: '_blank',
|
||||
});
|
||||
},
|
||||
icon: CircleHelp,
|
||||
text: $t('ui.widgets.qa'),
|
||||
},
|
||||
]);
|
||||
// const menus = computed(() => [
|
||||
// {
|
||||
// handler: () => {
|
||||
// openWindow(VBEN_DOC_URL, {
|
||||
// target: '_blank',
|
||||
// });
|
||||
// },
|
||||
// icon: BookOpenText,
|
||||
// text: $t('ui.widgets.document'),
|
||||
// },
|
||||
// {
|
||||
// handler: () => {
|
||||
// openWindow(VBEN_GITHUB_URL, {
|
||||
// target: '_blank',
|
||||
// });
|
||||
// },
|
||||
// icon: MdiGithub,
|
||||
// text: 'GitHub',
|
||||
// },
|
||||
// {
|
||||
// handler: () => {
|
||||
// openWindow(`${VBEN_GITHUB_URL}/issues`, {
|
||||
// target: '_blank',
|
||||
// });
|
||||
// },
|
||||
// icon: CircleHelp,
|
||||
// text: $t('ui.widgets.qa'),
|
||||
// },
|
||||
// ]);
|
||||
|
||||
const avatar = computed(() => {
|
||||
return userStore.userInfo?.avatar ?? preferences.app.defaultAvatar;
|
||||
@@ -128,8 +124,8 @@ watch(
|
||||
<UserDropdown
|
||||
:avatar
|
||||
:menus
|
||||
:text="userStore.userInfo?.realName"
|
||||
description="ann.vben@gmail.com"
|
||||
:text="userStore.userInfo?.username"
|
||||
description="暂无描述"
|
||||
tag-text="Pro"
|
||||
@logout="handleLogout"
|
||||
/>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"title": "人工智能",
|
||||
"intelligence_video_analysis": "视频智能分析",
|
||||
"young_silkworm_analysis": "小蚕智能分析"
|
||||
"young_silkworm_analysis": "催青阶段分析"
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ export const overridesPreferences = defineOverridesPreferences({
|
||||
app: {
|
||||
name: import.meta.env.VITE_APP_TITLE,
|
||||
layout: 'header-sidebar-nav',
|
||||
defaultHomePath: '/workspace',
|
||||
enablePreferences: false,
|
||||
},
|
||||
theme: {
|
||||
mode: 'light',
|
||||
@@ -17,7 +19,7 @@ export const overridesPreferences = defineOverridesPreferences({
|
||||
},
|
||||
breadcrumb: {
|
||||
hideOnlyOne: true,
|
||||
styleType: 'background',
|
||||
styleType: 'normal',
|
||||
},
|
||||
copyright: {
|
||||
enable: false,
|
||||
@@ -28,6 +30,7 @@ export const overridesPreferences = defineOverridesPreferences({
|
||||
sidebar: {
|
||||
collapsed: false,
|
||||
fixedButton: true,
|
||||
width: 170,
|
||||
},
|
||||
transition: {
|
||||
name: 'fade-up',
|
||||
@@ -35,6 +38,7 @@ export const overridesPreferences = defineOverridesPreferences({
|
||||
widget: {
|
||||
lockScreen: false,
|
||||
notification: false,
|
||||
languageToggle: false,
|
||||
},
|
||||
navigation: {
|
||||
accordion: false,
|
||||
|
||||
@@ -12,16 +12,16 @@ const routes: RouteRecordRaw[] = [
|
||||
name: 'Dashboard',
|
||||
path: '/dashboard',
|
||||
children: [
|
||||
{
|
||||
name: 'Analytics',
|
||||
path: '/analytics',
|
||||
component: () => import('#/views/dashboard/analytics/index.vue'),
|
||||
meta: {
|
||||
affixTab: true,
|
||||
icon: 'lucide:area-chart',
|
||||
title: $t('page.dashboard.analytics'),
|
||||
},
|
||||
},
|
||||
// {
|
||||
// name: 'Analytics',
|
||||
// path: '/analytics',
|
||||
// component: () => import('#/views/dashboard/analytics/index.vue'),
|
||||
// meta: {
|
||||
// affixTab: true,
|
||||
// icon: 'lucide:area-chart',
|
||||
// title: $t('page.dashboard.analytics'),
|
||||
// },
|
||||
// },
|
||||
{
|
||||
name: 'Workspace',
|
||||
path: '/workspace',
|
||||
|
||||
@@ -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