This commit is contained in:
xiaojibeier
2026-07-18 23:13:11 +08:00
parent b49c30a081
commit 87bfc7b54e
17 changed files with 1871 additions and 0 deletions
Vendored
BIN
View File
Binary file not shown.
+46
View File
@@ -0,0 +1,46 @@
# macOS
.DS_Store
.AppleDouble
.LSOverride
# IDE
.idea/
.vscode/*
!.vscode/extensions.json
*.swp
*.swo
# 环境变量 / 密钥(勿提交)
.env
.env.*
!.env.example
# 前端 client
client/node_modules/
client/dist/
client/dist-ssr/
client/*.local
client/npm-debug.log*
client/yarn-error.log*
client/pnpm-debug.log*
# 根目录若误装依赖
node_modules/
# Go server
server/bin/
server/tmp/
server/*.exe
server/*.exe~
server/*.test
server/*.out
server/vendor/
# 日志 / 临时
*.log
logs/
tmp/
temp/
# 编辑器 / 系统
Thumbs.db
+12
View File
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>威海 ERP 项目管理</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
+9
View File
@@ -0,0 +1,9 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
},
"exclude": ["node_modules", "dist"]
}
+1587
View File
File diff suppressed because it is too large Load Diff
+22
View File
@@ -0,0 +1,22 @@
{
"name": "weihai_pm",
"version": "0.0.1",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"@element-plus/icons-vue": "^2.3.1",
"element-plus": "^2.9.4",
"pinia": "^2.3.1",
"vue": "^3.5.13",
"vue-router": "^4.5.0"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.2.1",
"vite": "^6.0.11"
}
}
+6
View File
@@ -0,0 +1,6 @@
<template>
<router-view />
</template>
<script setup>
</script>
+19
View File
@@ -0,0 +1,19 @@
*,
*::before,
*::after {
box-sizing: border-box;
}
html,
body,
#app {
margin: 0;
min-height: 100%;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
color: #303133;
background: #fff;
}
+16
View File
@@ -0,0 +1,16 @@
import '@/assets/styles/base.css'
import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import App from './App.vue'
import router from './router'
import { setupStore } from './store'
const app = createApp(App)
app.use(ElementPlus, { locale: zhCn })
setupStore(app)
app.use(router)
app.mount('#app')
+14
View File
@@ -0,0 +1,14 @@
import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{
path: '/',
name: 'home',
component: () => import('@/views/Home.vue'),
},
],
})
export default router
+9
View File
@@ -0,0 +1,9 @@
import { createPinia } from 'pinia'
const pinia = createPinia()
export function setupStore(app) {
app.use(pinia)
}
export default pinia
+15
View File
@@ -0,0 +1,15 @@
import { defineStore } from 'pinia'
import { ref } from 'vue'
export const useAppStore = defineStore('app', () => {
const title = ref('威海 ERP 项目管理')
function setTitle(value) {
title.value = String(value || '').trim() || '威海 ERP 项目管理'
}
return {
title,
setTitle,
}
})
+60
View File
@@ -0,0 +1,60 @@
<template>
<div class="pm-home">
<el-card shadow="never" class="pm-home-card">
<template #header>
<div class="pm-home-head">
<span class="pm-home-title">{{ appStore.title }}</span>
<el-tag type="success" effect="plain">Vue 3 + Vite + Element Plus + Pinia</el-tag>
</div>
</template>
<p class="pm-home-desc">需求池 / 缺陷池看板将在这里搭建。</p>
<el-button type="primary" @click="onReady">开始</el-button>
</el-card>
</div>
</template>
<script setup>
import { ElMessage } from 'element-plus'
import { useAppStore } from '@/store/modules/app'
const appStore = useAppStore()
function onReady() {
ElMessage.success('前端脚手架已就绪')
}
</script>
<style scoped>
.pm-home {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 24px;
background: #f5f7fa;
box-sizing: border-box;
}
.pm-home-card {
width: min(560px, 100%);
}
.pm-home-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
}
.pm-home-title {
font-size: 18px;
font-weight: 600;
color: #303133;
}
.pm-home-desc {
margin: 0 0 16px;
color: #606266;
line-height: 1.6;
}
</style>
+24
View File
@@ -0,0 +1,24 @@
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
server: {
host: '0.0.0.0',
port: 5173,
/** 启动 dev 时自动打开浏览器 */
open: true,
proxy: {
'/api': {
target: 'http://127.0.0.1:8080',
changeOrigin: true,
},
},
},
})
+10
View File
@@ -0,0 +1,10 @@
{
"name": "weihai_pm",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "npm run dev --prefix client",
"build": "npm run build --prefix client",
"preview": "npm run preview --prefix client"
}
}
+19
View File
@@ -0,0 +1,19 @@
package main
import (
"fmt"
"log"
"net/http"
)
func main() {
mux := http.NewServeMux()
mux.HandleFunc("/api/health", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json; charset=utf-8")
_, _ = w.Write([]byte(`{"ok":true,"service":"weihai_pm"}`))
})
addr := ":8080"
fmt.Printf("weihai_pm server listening on %s\n", addr)
log.Fatal(http.ListenAndServe(addr, mux))
}
+3
View File
@@ -0,0 +1,3 @@
module weihai.pm/server
go 1.22