# @fleetbase/customer-portal-engine 中文文档

规范地址：https://npmcn.com/package/%40fleetbase/customer-portal-engine/

版本：0\.0\.16
npm 元数据更新时间：2026-10-14T07:36:24.369Z
中文译文更新时间：2026-11-14T22:45:42.470Z
软件包许可：AGPL-3\.0-or-later

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40fleetbase/customer-portal-engine
原文对照：https://npmcn.com/package/%40fleetbase/customer-portal-engine/?lang=original
项目主页：https://github.com/fleetbase/customer-portal#readme
源码仓库：https://github.com/fleetbase/customer-portal

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：761 kB，365 个文件
- TypeScript 类型：未声明
- Node.js 要求：\>= 22
- 运行依赖：19 个
- peer 依赖：ember-engines ^0\.9\.0
- 首次发布：2024-10-02T10:25:46.300Z
- 最新版本发布：2026-10-14T07:36:24.055Z
- 近 30 天下载量：2412（2026-10-15 至 2026-11-13，npm 官方下载统计）
- 已发布版本数：16（近 12 个月 8 个）

## 中文简介

车队基地可扩展客户门户

## 安装

```sh
npm install @fleetbase/customer-portal-engine
```

也可以使用：`pnpm add @fleetbase/customer-portal-engine`、`yarn add @fleetbase/customer-portal-engine`、`bun add @fleetbase/customer-portal-engine`

## README

# 车队基地客户门户

车队基地可扩展的客户工作空间,有自助服务订单、账单、文件、支助、账户设置和仪表板部件.

[![License](https://img.shields.io/badge/license-AGPL--3.0--or--later-blue.svg)](https://github.com/fleetbase/customer-portal/blob/main/LICENSE.md) [![npm package](https://img.shields.io/npm/v/@fleetbase/customer-portal-engine.svg)](https://www.npmjs.com/package/@fleetbase/customer-portal-engine) [![Packagist package](https://img.shields.io/packagist/v/fleetbase/customer-portal-api.svg)](https://packagist.org/packages/fleetbase/customer-portal-api) ![Node.js >= 22](https://img.shields.io/badge/node-%3E%3D22-339933.svg) ![Ember 5.4](https://img.shields.io/badge/ember-5.4-E04E39.svg) ![PHP ^8.0](https://img.shields.io/badge/php-%5E8.0-777BB4.svg)

![Fleetbase Customer Portal](https://www.fleetbase.io/images/screenshots/customer-portal/customer-portal-dashboard.webp)

## 概览

Fleetbase客户端门户(Fleetbase Conservation Portal)是一等兵的Fleetbase扩展站,为客户提供连接Fleetbase Console,FleetOps,和Ledger的安全,自助工作空间. 它作为前端的Ember引擎和后端API的Laravel包船.

门户网站是为客户的物流工作流程设计的:客户可以签入,跟踪订单,放出新订单,查看发票,管理文件,打开支持票,更新账户首选,并使用适合其账户的仪表板部件.

## 特征

-   **客户认证** - 客户登录,两要素验证,密码恢复,客户会话加载,以及客户访问URL的自动重定向.
-   **工作空间** - 客户仪表板登记,包括正在订购的部件、已完成的订单、未付款的发票、开具的赡养票、最近的订单和待处理的行动.
-   **订单管理** - 命令列表、命令细节、命令创建、路线预览、地点查询、有效载荷/实体、自定义字段、注释、文档、取消、重新安排和文件附件.
-   **引用和付款** - 初步服务报价查询、门户范围采购率、可选的 " 条纹 " 结账、付款状况检查和Ledger发票核对.
-   **计费** - 客户发票清单、发票细节和发票摘要,在安装和提供时由Ledger支持.
-   **支助** - 由FleetOps Issues支持的客户支持票,包括发行、摘要、评论、答复、编辑和删除.
-   **文件和通讯簿** - 客户可见的订单文件加上账户范围的地方搜索、查询、创建、更新和删除.
-   **账户设置** - 账户概况数据、自助密码更改、供应商转换流程、人事管理和通知偏好.
-   **管理员配置** - 用于门户配置的控制台设置面板、访问 URL 验证、启用命令配置、启用服务费率和支付设置.
-   **延长点** - 边栏和登录登记、仪表板/仪表板登记、虚拟路线和菜单集成,以便从其他Fleet基地包中扩展门户.

## 建筑

此寄存器包含扩展名的两侧 :

```text
addon/      Ember engine source: routes, templates, components, services, widgets, and extension registration
app/        Re-exports that make addon modules available to the consuming Fleetbase Console app
server/     Laravel package source: routes, controllers, services, providers, notifications, and observers
tests/      Ember/QUnit tests and dummy app support
```

### 前端软件包

```bash
@fleetbase/customer-portal-engine
```

Ember引擎在舰队基地路线上挂载,配置于 `package.json`数字 :

```json
{
    "fleetbase": {
        "route": "customer-portal",
        "mount": "root"
    }
}
```

引擎注册客户门户路由,用于认证,仪表板,订单,计费,支持,文件,地址簿,通知,设置,账户管理,以及虚拟扩展页.

### 后端软件包

```bash
fleetbase/customer-portal-api
```

Laravel 包在可配置前缀下注册门户 API :

```text
customer-portal/int/v1
```

后端控制器和服务范围数据到认证客户账户,与FleetOps订单和问题集成,与Ledger发票和交易集成,并曝光Console管理员的门户配置.

## 安装

在 Fleetbase API 中安装后端软件包 :

```bash
composer require fleetbase/customer-portal-api
```

在舰队基地控制台安装 Ember 引擎 :

```bash
pnpm install @fleetbase/customer-portal-engine
```

软件包还依赖于Fleetbase共享的前端软件包和先行后端软件包,包括Core API,FleetOps,和Ledger.

## 开发设置

对于本地的Fleetbase扩展开发,使用Fleetbase的软件包链接器,因此Console和API解决了这次取出,而不是发布软件包版本. 见官员 [舰队基地开发设置指南](https://www.fleetbase.io/docs/platform/quickstart/development-setup) 整个工作流程.

具有子模块的克隆人舰队基地:

```bash
git clone https://github.com/fleetbase/fleetbase.git
cd fleetbase
git submodule update --init --recursive
```

从 Fleetbase 仓库根安装一次软件包链接器 :

```bash
npm link
flb-package-linker --help
```

启用客户门户软件包 :

```bash
flb-package-linker enable customer-portal
flb-package-linker install customer-portal
```

您可以让链接器立即运行安装命令 :

```bash
flb-package-linker enable customer-portal --install
```

对于 Docker 的后端软件包工作, 将本地源码挂入应用程序容器 :

```yaml
services:
  application:
    environment:
      ENVIRONMENT: "development"
      APP_DEBUG: "true"
    volumes:
      - ./api:/fleetbase/api
      - ./packages:/fleetbase/packages
```

更改 Docker 挂载后重新启动堆栈 :

```bash
docker compose up -d
```

Fleetbase运行Laravel Octane,因此在PHP更改后重新装入应用程序工人:

```bash
docker compose exec application php artisan octane:reload
```

对于前端工作,在当地或多克运行Fleetbase Console开发服务器. 本地路径通常最快:

```bash
docker compose stop console
cd console
pnpm install
pnpm start:dev
```

控制台将在 :

```text
http://localhost:4200
```

## 配置

后端配置存在 `server/config/customer-portal.php`数字 :

```php
return [
    'api' => [
        'version' => '0.0.1',
        'routing' => [
            'prefix' => 'customer-portal',
            'internal_prefix' => 'int',
        ],
    ],
];
```

门户网站管理员可以配置来自Fleetbase Console设置的客户门户网站行为. 软件包包括API支持:

-   门户配置装入并保存
-   客户访问 URL sult 验证
-   启用顺序配置
-   启用服务费率
-   支付可用性和条纹支持的取出配置

## 质量检查

安装此软件包的依赖性 :

```bash
pnpm install
composer install
```

运行前端检查 :

```bash
pnpm lint
pnpm test
```

运行后端检查 :

```bash
composer test
```

有用的焦点命令 :

```bash
pnpm start
pnpm build
pnpm test:ember
pnpm test:ember-compatibility
composer test:lint
composer test:types
composer test:unit
```

## 捐款

欢迎捐款。 保持更改范围,包括行为变化的测试,当一个特性跨越前端/后端边界时,验证Ember引擎和Laravel包路径.

在舰队基地内部开发时,宁可 `flb-package-linker` 超过手动 `package.json`, (中文(简体) ), `composer.json`,或工作空间编辑,使本地开发链接仍然可逆.

## 许可证

Fleetbase客户端门户在GNU Affero通用公共许可证v3.0或后期发布. 见 [利比里亚](https://npmcn.com/package/%40fleetbase/customer-portal-engine/LICENSE.md) 详细情况.

## 常见问题

### @fleetbase/customer-portal-engine 是什么？

车队基地可扩展客户门户

### 如何安装 @fleetbase/customer-portal-engine？

在项目目录运行 npm install @fleetbase/customer-portal-engine，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：ember-engines（^0\.9\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @fleetbase/customer-portal-engine 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/fleetbase\_\_customer-portal-engine 是否存在。

### @fleetbase/customer-portal-engine 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>= 22。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @fleetbase/customer-portal-engine 可以商用吗？

@fleetbase/customer-portal-engine 使用 AGPL-3\.0-or-later 许可。最严格的 Copyleft：除分发外，通过网络向用户提供基于它的服务也需要开源对应源码。闭源 SaaS 使用前务必评估。以上为概括，不构成法律意见，请以许可原文为准。

### @fleetbase/customer-portal-engine 的下载量有多少？

根据 npm 官方下载统计，@fleetbase/customer-portal-engine 在 2026/10/15 – 2026/11/13 这 30 天内被下载 2,412 次，日均约 80 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @fleetbase/customer-portal-engine 还在维护吗？

最新版本 0\.0\.16 发布于 2026/10/14（1 个月前）；至今共发布 16 个版本，其中过去 12 个月发布了 8 个；首次发布于 2024/10/02。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

