|
|
4 天前 | |
|---|---|---|
| .. | ||
| node_modules | 4 天前 | |
| public | 4 天前 | |
| src | 4 天前 | |
| .eslintrc.cjs | 4 天前 | |
| .gitignore | 4 天前 | |
| .prettierrc | 4 天前 | |
| README.md | 4 天前 | |
| index.html | 5 天前 | |
| package-lock.json | 4 天前 | |
| package.json | 4 天前 | |
| tsconfig.json | 4 天前 | |
| tsconfig.node.json | 4 天前 | |
| vite.config.ts | 4 天前 | |
基于 Vue3 + TypeScript + Element Plus + Vite 构建的智慧供水管理系统前端项目。
src/
├── api/ # API 接口
│ ├── auth.ts # 认证相关 API
│ ├── system.ts # 系统管理 API
│ ├── user.ts # 用户相关 API
│ ├── dashboard.ts # 仪表盘 API
│ └── wxhall.ts # 微信网厅 API
├── assets/ # 静态资源
│ └── style.scss # 全局样式
├── components/ # 公共组件
│ ├── layout/ # 布局组件
│ │ └── MainLayout.vue
│ └── charts/ # 图表组件
│ ├── BaseChart.vue
│ └── ECharts.vue
├── router/ # 路由配置
│ └── index.ts
├── store/ # 状态管理
├── utils/ # 工具函数
│ └── request.ts # Axios 封装
├── views/ # 页面组件
│ ├── login/ # 登录相关页面
│ │ ├── LoginView.vue
│ │ ├── RegisterView.vue
│ │ └── ForgotPasswordView.vue
│ ├── dashboard/ # 仪表盘页面
│ │ ├── DashboardView.vue
│ │ ├── OperationDashboard.vue
│ │ └── WaterSupplySpecialScreen.vue
│ ├── system/ # 系统管理页面
│ │ ├── user/UserList.vue
│ │ ├── role/RoleList.vue
│ │ └── menu/MenuList.vue
│ ├── profile/ # 个人中心页面
│ │ └── ProfileView.vue
│ └── ... # 其他页面
├── App.vue # 根组件
└── main.ts # 入口文件
npm install
npm run dev
项目将在 http://localhost:3000 启动。
npm run build
构建产物位于 dist 目录。
# 检查代码规范
npm run lint
# 自动修复代码规范
npm run lint:fix
# TypeScript 类型检查
npm run type-check
组件命名
文件结构
代码风格
Props 定义
事件定义
Slot 定义
请求封装
接口设计
# 开发环境
NODE_ENV=development
# 生产环境
NODE_ENV=production
FROM node:16-alpine as builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
FROM nginx:alpine
COPY --from=builder /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
检查 Node.js 版本和依赖安装情况。
检查 Vite 配置和开发服务器配置。
检查 CSS 预处理器配置和样式导入路径。
MIT License