This commit is contained in:
张成
2026-04-29 13:34:39 +08:00
commit dee3a336ce
89 changed files with 33683 additions and 0 deletions

28
README.md Normal file
View File

@@ -0,0 +1,28 @@
# 前后端项目模板
基于 **admin-framework**(管理端 Vue2 + ViewUI**node-core-framework**Koa2 + Sequelize的最小可运行骨架已去掉原 WMS 业务,仅保留一条演示业务链与系统接口。
## 结构
- `framework/`node-core-framework 核心(勿与业务混写)
- `admin/src/framework/`admin-framework UMD
- `api/controller_admin/`:管理端业务控制器(模板保留 `tpl_demo``sys_file``sys_parameter``sys_tenant`
- `api/model/`:业务模型(模板保留 `tpl_demo``sys_tenant`
- `config/``config.js` 白名单、`framework.config.js` 框架项、环境库表连接
## 本地运行
1. 安装依赖:项目根目录 `npm install``admin` 目录 `npm install`
2. 在 MySQL 中创建库,导入 node-core 自带的系统表;再执行 `sql/tpl_demo.sql` 创建演示表
3. 修改 `config/config.development.js` 中的数据库账号等
4. 根目录 `npm run api` 启动后端(默认端口见 `config/config.js`
5. `npm run dev` 启动管理端,浏览器访问 webpack 提示的端口
## 菜单与演示页
`sys_menu` 中增加一条菜单:`component`**`demo/tpl_demo`**(与 `admin/src/router/component-map.js` 一致),分配权限后即可打开「演示数据」列表页。
## 从模板扩展
- 后端:在 `api/model` 增加模型、在 `api/controller_admin` 增加控制器导出 `GET/POST /xxx/...`;若有关联,写在 `config/model.associations.js`
- 前端:在 `admin/src/views` 增加页面,并在 `component-map.js` 注册;列表可参考 `views/demo/tpl_demo.vue` + `tableMixin`