|
|
1 hafta önce | |
|---|---|---|
| public | 1 hafta önce | |
| src | 1 hafta önce | |
| .env | 1 hafta önce | |
| .env.dev | 1 hafta önce | |
| .env.pro | 1 hafta önce | |
| .gitignore | 1 hafta önce | |
| README.md | 1 hafta önce | |
| env.config.js | 1 hafta önce | |
| index.html | 1 hafta önce | |
| jsconfig.json | 1 hafta önce | |
| package.json | 1 hafta önce | |
| vite.config.js | 1 hafta önce |
飞鸟后台数据平台前端脚手架(基于 feiniao-farm-h5 精简抽取)。
src/common/ol_common.js)npm install
npm run dev
| 命令 | 说明 |
|---|---|
npm run dev |
开发环境(Vite) |
npm run local |
本地环境 |
npm run pro |
生产接口联调 |
npm run build |
生产构建 |
npm run preview |
预览构建产物 |
src/
├── layout/ # 后台框架(侧栏 + 顶栏)
│ ├── index.vue
│ ├── menu.js # 左侧菜单配置
│ └── MenuIcon.vue
├── api/
│ ├── config.js
│ └── modules/
├── router/
│ ├── helper.js
│ ├── routes.js # Layout + children 业务路由
│ └── index.js
├── views/
│ ├── device/ # 设备管理
│ ├── planting/ # 种植方案
│ └── personnel/ # 人员管理
└── ...
src/views/xxx/index.vuesrc/router/routes.js 的 children 中追加:createPage({
path: "xxx",
name: "Xxx",
component: () => import("@/views/xxx/index.vue"),
title: "页面标题",
}),
src/layout/menu.js 追加菜单项(图标可选):{ path: "/xxx", title: "页面标题", icon: "device" }
在 src/api/modules/ 新建文件,例如 farm.js:
const config = require("../config");
module.exports = {
list: {
url: config.base_dev_url + "v2/farm/list",
type: "get",
},
};
页面调用:this.VE_API.farm.list(params) 或 proxy.VE_API.farm.list(params)。
环境配置在 env.config.js,由 Vite define 注入为 VE_ENV:
SERVER → base_dev_urlPYSERVER → base_py_urlNEW_SERVER → base_new_url