优化界面显示;预部署;

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,7 +1,7 @@
VITE_BASE=/ VITE_BASE=/
# 接口地址 # 接口地址
VITE_GLOB_API_URL=https://171.212.101.199/api VITE_GLOB_API_URL=https://171.212.101.199:8089/api
# 是否开启压缩,可以设置为 none, brotli, gzip # 是否开启压缩,可以设置为 none, brotli, gzip
VITE_COMPRESS=none VITE_COMPRESS=none
+31 -35
View File
@@ -4,9 +4,7 @@ import type { NotificationItem } from '@vben/layouts';
import { computed, ref, watch } from 'vue'; import { computed, ref, watch } from 'vue';
import { AuthenticationLoginExpiredModal } from '@vben/common-ui'; import { AuthenticationLoginExpiredModal } from '@vben/common-ui';
import { VBEN_DOC_URL, VBEN_GITHUB_URL } from '@vben/constants';
import { useWatermark } from '@vben/hooks'; import { useWatermark } from '@vben/hooks';
import { BookOpenText, CircleHelp, MdiGithub } from '@vben/icons';
import { import {
BasicLayout, BasicLayout,
LockScreen, LockScreen,
@@ -15,9 +13,7 @@ import {
} from '@vben/layouts'; } from '@vben/layouts';
import { preferences } from '@vben/preferences'; import { preferences } from '@vben/preferences';
import { useAccessStore, useUserStore } from '@vben/stores'; import { useAccessStore, useUserStore } from '@vben/stores';
import { openWindow } from '@vben/utils';
import { $t } from '#/locales';
import { useAuthStore } from '#/store'; import { useAuthStore } from '#/store';
import LoginForm from '#/views/_core/authentication/login.vue'; import LoginForm from '#/views/_core/authentication/login.vue';
@@ -60,35 +56,35 @@ const showDot = computed(() =>
notifications.value.some((item) => !item.isRead), notifications.value.some((item) => !item.isRead),
); );
const menus = computed(() => [ // const menus = computed(() => [
{ // {
handler: () => { // handler: () => {
openWindow(VBEN_DOC_URL, { // openWindow(VBEN_DOC_URL, {
target: '_blank', // target: '_blank',
}); // });
}, // },
icon: BookOpenText, // icon: BookOpenText,
text: $t('ui.widgets.document'), // text: $t('ui.widgets.document'),
}, // },
{ // {
handler: () => { // handler: () => {
openWindow(VBEN_GITHUB_URL, { // openWindow(VBEN_GITHUB_URL, {
target: '_blank', // target: '_blank',
}); // });
}, // },
icon: MdiGithub, // icon: MdiGithub,
text: 'GitHub', // text: 'GitHub',
}, // },
{ // {
handler: () => { // handler: () => {
openWindow(`${VBEN_GITHUB_URL}/issues`, { // openWindow(`${VBEN_GITHUB_URL}/issues`, {
target: '_blank', // target: '_blank',
}); // });
}, // },
icon: CircleHelp, // icon: CircleHelp,
text: $t('ui.widgets.qa'), // text: $t('ui.widgets.qa'),
}, // },
]); // ]);
const avatar = computed(() => { const avatar = computed(() => {
return userStore.userInfo?.avatar ?? preferences.app.defaultAvatar; return userStore.userInfo?.avatar ?? preferences.app.defaultAvatar;
@@ -128,8 +124,8 @@ watch(
<UserDropdown <UserDropdown
:avatar :avatar
:menus :menus
:text="userStore.userInfo?.realName" :text="userStore.userInfo?.username"
description="ann.vben@gmail.com" description="暂无描述"
tag-text="Pro" tag-text="Pro"
@logout="handleLogout" @logout="handleLogout"
/> />
@@ -1,5 +1,5 @@
{ {
"title": "人工智能", "title": "人工智能",
"intelligence_video_analysis": "视频智能分析", "intelligence_video_analysis": "视频智能分析",
"young_silkworm_analysis": "小蚕智能分析" "young_silkworm_analysis": "催青阶段分析"
} }
+5 -1
View File
@@ -10,6 +10,8 @@ export const overridesPreferences = defineOverridesPreferences({
app: { app: {
name: import.meta.env.VITE_APP_TITLE, name: import.meta.env.VITE_APP_TITLE,
layout: 'header-sidebar-nav', layout: 'header-sidebar-nav',
defaultHomePath: '/workspace',
enablePreferences: false,
}, },
theme: { theme: {
mode: 'light', mode: 'light',
@@ -17,7 +19,7 @@ export const overridesPreferences = defineOverridesPreferences({
}, },
breadcrumb: { breadcrumb: {
hideOnlyOne: true, hideOnlyOne: true,
styleType: 'background', styleType: 'normal',
}, },
copyright: { copyright: {
enable: false, enable: false,
@@ -28,6 +30,7 @@ export const overridesPreferences = defineOverridesPreferences({
sidebar: { sidebar: {
collapsed: false, collapsed: false,
fixedButton: true, fixedButton: true,
width: 170,
}, },
transition: { transition: {
name: 'fade-up', name: 'fade-up',
@@ -35,6 +38,7 @@ export const overridesPreferences = defineOverridesPreferences({
widget: { widget: {
lockScreen: false, lockScreen: false,
notification: false, notification: false,
languageToggle: false,
}, },
navigation: { navigation: {
accordion: false, accordion: false,
@@ -12,16 +12,16 @@ const routes: RouteRecordRaw[] = [
name: 'Dashboard', name: 'Dashboard',
path: '/dashboard', path: '/dashboard',
children: [ children: [
{ // {
name: 'Analytics', // name: 'Analytics',
path: '/analytics', // path: '/analytics',
component: () => import('#/views/dashboard/analytics/index.vue'), // component: () => import('#/views/dashboard/analytics/index.vue'),
meta: { // meta: {
affixTab: true, // affixTab: true,
icon: 'lucide:area-chart', // icon: 'lucide:area-chart',
title: $t('page.dashboard.analytics'), // title: $t('page.dashboard.analytics'),
}, // },
}, // },
{ {
name: 'Workspace', name: 'Workspace',
path: '/workspace', path: '/workspace',
+1 -1
View File
@@ -1,5 +1,5 @@
<template> <template>
<div> <div>
<h1>小蚕分析页面</h1> <h1>正在开发中敬请期待</h1>
</div> </div>
</template> </template>
+1 -1
View File
@@ -1,5 +1,5 @@
<template> <template>
<div> <div>
<h1>小蚕分析页面</h1> <h1>正在开发中敬请期待</h1>
</div> </div>
</template> </template>
@@ -9,20 +9,11 @@ import type {
import { ref } from 'vue'; import { ref } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { import { WorkbenchHeader } from '@vben/common-ui';
AnalysisChartCard,
WorkbenchHeader,
WorkbenchProject,
WorkbenchQuickNav,
WorkbenchTodo,
WorkbenchTrends,
} from '@vben/common-ui';
import { preferences } from '@vben/preferences'; import { preferences } from '@vben/preferences';
import { useUserStore } from '@vben/stores'; import { useUserStore } from '@vben/stores';
import { openWindow } from '@vben/utils'; import { openWindow } from '@vben/utils';
import AnalyticsVisitsSource from '../analytics/analytics-visits-source.vue';
const userStore = useUserStore(); const userStore = useUserStore();
// 这是一个示例数据,实际项目中需要根据实际情况进行调整 // 这是一个示例数据,实际项目中需要根据实际情况进行调整
@@ -231,6 +222,13 @@ function navTo(nav: WorkbenchProjectItem | WorkbenchQuickNavItem) {
console.warn(`Unknown URL for navigation item: ${nav.title} -> ${nav.url}`); 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> </script>
<template> <template>
@@ -239,28 +237,10 @@ function navTo(nav: WorkbenchProjectItem | WorkbenchQuickNavItem) {
:avatar="userStore.userInfo?.avatar || preferences.app.defaultAvatar" :avatar="userStore.userInfo?.avatar || preferences.app.defaultAvatar"
> >
<template #title> <template #title>
早安, {{ userStore.userInfo?.username }}, 开始您一天的工作吧 {{ getGreeting() }}, {{ userStore.userInfo?.username }},
开始您一天的工作吧
</template> </template>
<template #description> 今日晴20 - 32 </template> <template #description> 欢迎使用智能控制中心 </template>
</WorkbenchHeader> </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> </div>
</template> </template>
+25 -24
View File
@@ -47,7 +47,7 @@ const gridOptions: VxeGridProps<RowType> = {
gt: 0, gt: 0,
}, },
// showOverflow: true, // 超出隐藏 // showOverflow: true, // 超出隐藏
height: 'auto', height: '500px',
// keepSource: true, // keepSource: true,
stripe: true, // 条纹 stripe: true, // 条纹
proxyConfig: { proxyConfig: {
@@ -67,33 +67,34 @@ const gridOptions: VxeGridProps<RowType> = {
}, },
}; };
const formOptions: VbenFormProps = { // 筛选表单
// 默认展开 // const formOptions: VbenFormProps = {
collapsed: true, // // 默认展开
schema: [ // collapsed: true,
{ // schema: [
component: 'Input', // {
componentProps: { // component: 'Input',
placeholder: '输入设备名', // componentProps: {
}, // placeholder: '输入设备名',
fieldName: 'deviceName', // },
label: '筛选', // fieldName: 'deviceName',
width: 300, // label: '筛选',
}, // width: 300,
], // },
// 控制表单是否显示折叠按钮 // ],
showCollapseButton: false, // // 控制表单是否显示折叠按钮
submitButtonOptions: { // showCollapseButton: false,
content: '查询', // submitButtonOptions: {
}, // content: '查询',
// },
submitOnChange: true, // 是否在字段值改变时提交表单 // submitOnChange: true, // 是否在字段值改变时提交表单
submitOnEnter: true, // 按下回车时是否提交表单 // submitOnEnter: true, // 按下回车时是否提交表单
}; // };
const [Grid] = useVbenVxeGrid({ const [Grid] = useVbenVxeGrid({
formOptions, // formOptions,
gridOptions, gridOptions,
separator: false, separator: false,
}); });
@@ -27,7 +27,7 @@ withDefaults(defineProps<Props>(), {
<slot name="description"></slot> <slot name="description"></slot>
</span> </span>
</div> </div>
<div class="mt-4 flex flex-1 justify-end md:mt-0"> <!-- <div class="mt-4 flex flex-1 justify-end md:mt-0">
<div class="flex flex-col justify-center text-right"> <div class="flex flex-col justify-center text-right">
<span class="text-foreground/80"> 待办 </span> <span class="text-foreground/80"> 待办 </span>
<span class="text-2xl">2/10</span> <span class="text-2xl">2/10</span>
@@ -41,6 +41,6 @@ withDefaults(defineProps<Props>(), {
<span class="text-foreground/80"> 团队 </span> <span class="text-foreground/80"> 团队 </span>
<span class="text-2xl">300</span> <span class="text-2xl">300</span>
</div> </div>
</div> </div> -->
</div> </div>
</template> </template>