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
+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,
},
},
},
})