初始化

This commit is contained in:
2025-10-03 22:30:54 +08:00
commit c4b3ed5e97
20 changed files with 4321 additions and 0 deletions

74
hldrCenter.code-workspace Normal file
View File

@@ -0,0 +1,74 @@
{
"folders": [
{
"name": "server",
"path": "./server" // 使用相对路径,避免绝对路径在不同系统失效
},
{
"name": "management",
"path": "./management"
},
{
"name": "web",
"path": "./web"
}
],
"settings": {
// 通用设置(跨系统一致)
"editor.tabSize": 2,
"files.eol": "\n", // 强制使用Unix换行符避免Git提交时的换行符冲突
"files.autoSave": "onFocusChange", // 跨系统统一自动保存时机
// Go配置兼容Windows和macOS的路径处理
"[go]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
}
},
"go.gopath": "${workspaceFolder}/server", // 使用变量自动适配系统路径格式
"go.toolsManagement.goPath": "${workspaceFolder}/server",
"go.buildOnSave": "workspace", // 跨系统统一构建行为
// Vue配置跨系统一致的格式化规则
"[vue]": {
"editor.formatOnSave": true
},
"[javascript]": {
"editor.formatOnSave": true
},
"[typescript]": {
"editor.formatOnSave": true
},
"vetur.format.defaultFormatter.html": "prettier",
"vetur.format.defaultFormatter.css": "prettier",
"vetur.format.defaultFormatter.js": "prettier",
"prettier.singleQuote": true,
"prettier.semi": false,
"prettier.endOfLine": "lf", // 强制Prettier使用LF换行符
// 解决Windows和macOS文件大小写敏感性差异
"filesystem.watcher.ignored": [
"**/.git/objects/**",
"**/.git/subtree-cache/**"
],
"search.followSymlinks": false // 避免符号链接在不同系统的处理差异
},
"extensions": {
"recommendations": [
// Go相关扩展
"golang.go",
"zxh404.vscode-proto3", // 若有protobuf文件跨系统通用
// Vue相关扩展
"octref.vetur",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"Vue.volar", // 现代Vue开发推荐兼容Vetur
// 跨系统工具链
"editorconfig.editorconfig", // 强制统一编辑器行为
"eamodio.gitlens" // Git工具跨系统一致
]
}
}

24
management/.gitignore vendored Normal file
View File

@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

3
management/.vscode/extensions.json vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"recommendations": ["Vue.volar"]
}

5
management/README.md Normal file
View File

@@ -0,0 +1,5 @@
# Vue 3 + TypeScript + Vite
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
Learn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup).

13
management/index.html Normal file
View File

@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>hldrmanagement</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>

3805
management/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

29
management/package.json Normal file
View File

@@ -0,0 +1,29 @@
{
"name": "hldrmanagement",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vue-tsc -b && vite build",
"preview": "vite preview"
},
"dependencies": {
"element-plus": "^2.11.4",
"pinia": "^3.0.3",
"vue": "^3.5.22",
"vue-router": "^4.5.1"
},
"devDependencies": {
"@types/node": "^24.6.0",
"@vitejs/plugin-vue": "^6.0.1",
"@vue/tsconfig": "^0.8.1",
"sass-embedded": "^1.93.2",
"typescript": "~5.9.3",
"vite": "npm:rolldown-vite@7.1.14",
"vue-tsc": "^3.1.0"
},
"overrides": {
"vite": "npm:rolldown-vite@7.1.14"
}
}

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

244
management/src/App.vue Normal file
View File

@@ -0,0 +1,244 @@
<template>
<!-- 外层容器 - 固定定位占满全屏 -->
<div style="position: fixed; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden;">
<el-container style="height: 100%; min-height: 100%; overflow: hidden;">
<!-- 侧边栏区域 -->
<el-aside
:width="isCollapse ? '64px' : '200px'"
style="border-right: 1px solid #eee; transition: width 0.3s ease; background-color: #f5f7fa;"
>
<el-menu
default-active="2"
class="el-menu-vertical-demo"
:collapse="isCollapse"
@open="handleOpen"
@close="handleClose"
background-color="#f5f7fa"
text-color="#333"
active-text-color="#409eff"
:collapse-transition="false"
style="border-right: none; margin-top: 20px;"
>
<el-sub-menu index="1">
<template #title>
<el-icon><Location /></el-icon>
<span>Navigator One</span>
</template>
<el-menu-item-group>
<template #title><span>Group One</span></template>
<el-menu-item index="1-1">item one</el-menu-item>
<el-menu-item index="1-2">item two</el-menu-item>
</el-menu-item-group>
<el-menu-item-group title="Group Two">
<el-menu-item index="1-3">item three</el-menu-item>
</el-menu-item-group>
<el-sub-menu index="1-4">
<template #title><span>item four</span></template>
<el-menu-item index="1-4-1">item one</el-menu-item>
</el-sub-menu>
</el-sub-menu>
<el-menu-item index="2">
<el-icon><IconMenu /></el-icon>
<template #title>Navigator Two</template>
</el-menu-item>
<el-menu-item index="3" disabled>
<el-icon><Document /></el-icon>
<template #title>Navigator Three</template>
</el-menu-item>
<el-menu-item index="4">
<el-icon><Setting /></el-icon>
<template #title>Navigator Four</template>
</el-menu-item>
</el-menu>
</el-aside>
<!-- 右侧主内容容器 -->
<el-container direction="vertical" style="height: 100%; overflow: hidden;">
<!-- 顶部导航栏 - 固定高度 -->
<el-header style="height: 60px; border-bottom: 1px solid #eee; display: flex; align-items: center; justify-content: space-between; padding: 0 20px;">
<div class="header-left">
<!-- 替换为单个切换按钮 -->
<el-button
@click="isCollapse = !isCollapse"
size="small"
style="margin-right: 20px;"
type="primary"
>
<!-- 根据折叠状态显示不同箭头 -->
{{ isCollapse ? '->' : '<-' }}
</el-button>
<el-breadcrumb separator="/" style="line-height: 60px;">
<el-breadcrumb-item
v-for="(item, index) in breadcrumbItems"
:key="index"
:to="item.path"
>
{{ item.meta.title }}
</el-breadcrumb-item>
</el-breadcrumb>
</div>
<div class="header-user-area">
<!-- 通知图标按钮 -->
<el-button
size="small"
circle
style="margin-right: 12px; background: transparent; border: none; width: 36px; height: 36px;"
>
<el-icon style="font-size: 18px;"><Bell /></el-icon>
</el-button>
<!-- 消息图标按钮 -->
<el-button
size="small"
circle
style="margin-right: 12px; background: transparent; border: none; width: 36px; height: 36px;"
>
<el-icon style="font-size: 18px;"><Message /></el-icon>
</el-button>
<!-- 用户下拉菜单 -->
<el-dropdown trigger="click" placement="bottom-end">
<div class="user-info" style="cursor: pointer; display: flex; align-items: center;">
<!-- 调整头像尺寸和样式 -->
<img
src="https://picsum.photos/id/1005/40/40"
alt="用户头像"
class="user-avatar"
style="width: 36px; height: 36px; border-radius: 50%; object-fit: cover;"
>
<span class="user-name" style="margin-left: 8px; font-size: 14px;">用户名</span>
<el-icon style="margin-left: 6px; font-size: 16px;"><ChevronDown /></el-icon>
</div>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item>个人中心</el-dropdown-item>
<el-dropdown-item>设置</el-dropdown-item>
<el-dropdown-item>退出登录</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</el-header>
<!-- 主显示区域 -->
<el-main style="transition: all 0.3s ease; padding: 20px; margin: 0; overflow-y: auto; flex: 1; box-sizing: border-box;">
<router-view />
</el-main>
</el-container>
</el-container>
</div>
</template>
<script lang="ts" setup>
import { ref, watch } from 'vue'
import {
Document,
Menu as IconMenu,
Location,
Setting,
Bell,
Message
} from '@element-plus/icons-vue'
import { useRoute } from 'vue-router'
const isCollapse = ref(true)
const handleOpen = (key: string, keyPath: string[]) => {
console.log(key, keyPath)
}
const handleClose = (key: string, keyPath: string[]) => {
console.log(key, keyPath)
}
const route = useRoute()
const breadcrumbItems = ref(route.matched)
// 监听路由变化,更新面包屑
watch(
() => route.matched,
(newMatched) => {
breadcrumbItems.value = newMatched
},
{ immediate: true }
)
</script>
<style scoped>
/* 禁止水平滚动 */
::v-deep html, ::v-deep body {
height: 100%;
overflow: hidden;
}
/* 清除所有默认边距和滚动 */
::v-deep * {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* 菜单样式 */
.el-menu-vertical-demo {
border-right: none;
}
/* 顶部栏样式 */
.header-left {
display: flex;
align-items: center;
}
.user-info {
display: flex;
align-items: center;
gap: 8px;
}
.user-avatar {
width: 36px;
height: 36px;
border-radius: 50%;
object-fit: cover;
}
.user-name {
font-size: 14px;
}
/* 主内容样式 */
.main-content {
width: 100%;
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
}
/* 组件样式穿透 */
::v-deep .el-container,
::v-deep .el-aside,
::v-deep .el-header,
::v-deep .el-main {
padding: 0;
margin: 0;
border: none;
overflow-x: hidden;
}
::v-deep .el-header {
background-color: #fff;
}
::v-deep .el-main {
background-color: #fff;
}
::v-deep .el-menu--horizontal {
border-bottom: none;
}
</style>

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>

After

Width:  |  Height:  |  Size: 496 B

View File

@@ -0,0 +1,8 @@
<script setup lang="ts">
</script>
<template>
</template>
<style scoped>
</style>

7
management/src/main.ts Normal file
View File

@@ -0,0 +1,7 @@
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
createApp(App).use(router).use(ElementPlus).mount('#app')

View File

@@ -0,0 +1,42 @@
import { createRouter, createWebHistory } from 'vue-router'
// 关键修复:使用 import type 导入类型
import type { RouteRecordRaw } from 'vue-router'
// 懒加载组件
const HomeView = () => import('../views/HomeView.vue')
const AboutView = () => import('../views/AboutView.vue')
// 定义路由规则(现在 RouteRecordRaw 导入正确)
const routes: RouteRecordRaw[] = [
{
path: '/',
name: 'Home',
component: HomeView,
meta: {
title: '首页',
requiresAuth: false
}
},
{
path: '/about',
name: 'About',
component: AboutView,
meta: {
title: '关于我们'
}
}
]
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes
})
// 导航守卫:自动更新页面标题
router.beforeEach((to) => {
if (to.meta.title) {
document.title = to.meta.title as string
}
})
export default router

0
management/src/style.css Normal file
View File

View File

@@ -0,0 +1,5 @@
<template>
<h1>About 页面</h1>
<a>about</a> <!-- 具体内容 -->
</template>

View File

@@ -0,0 +1,4 @@
<template>
123
</template>

View File

@@ -0,0 +1,16 @@
{
"extends": "@vue/tsconfig/tsconfig.dom.json",
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"types": ["vite/client"],
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"erasableSyntaxOnly": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
},
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"]
}

7
management/tsconfig.json Normal file
View File

@@ -0,0 +1,7 @@
{
"files": [],
"references": [
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.node.json" }
]
}

View File

@@ -0,0 +1,26 @@
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
"target": "ES2023",
"lib": ["ES2023"],
"module": "ESNext",
"types": ["node"],
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"moduleDetection": "force",
"noEmit": true,
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"erasableSyntaxOnly": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
},
"include": ["vite.config.ts"]
}

View File

@@ -0,0 +1,7 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vite.dev/config/
export default defineConfig({
plugins: [vue()],
})