0
点赞
收藏
分享

微信扫一扫

Thingsboard二次开发---2. 增加新实体前端开发步骤

前言

Thingsboard的前端是使用angular11开发的,官方代码里面已经抽象了很多通用的功能,只需参照其他实体的前端代码,即可完成相应实体前端的功能。

前端实体操作功能开发步骤

一下文件都是相对于UI-NGX的目录

序号步骤文件/说明
1增加routing module在目录\src\app\modules\home\pages\下执行ng g module defect --routing
2增加component在目录\src\app\modules\home\pages\defect下执行ng g component defect --flat --skip-tests
3增加tab component在目录\src\app\modules\home\pages\defect下执行ng g component defect-tabs --flat --skip-tests
4增加实体类型src\app\shared\models\entity-type.models.ts
5增加模型src\app\shared\models\defect.models
6增加id模型src\app\shared\models\id\defect-id
7增加helplinksrc/app/shared/models/entity-type.models.ts
8增加实体get的方法entity.service.ts
9增加http接口\src\app\core\http\defect.service.ts
10添加获取实体类型的函数接口,否则添加实体只显示*src\app\shared\components\entity\entity-subtype-autocomplete.component.ts
11添加获取实体类型接口,否则选择类型下拉控件无法使用src\app\shared\components\entity\entity-subtype-select.component.ts
12修改此文件,entity list可以显示实体src\app\core\http\entity.service.ts
13增加实体 autocompletesrc\app\shared\components\entity\entity-autocomplete.component.ts
14在资源文件中增加国际化翻译src\assets\locale\locale.constant-zh_CN.json
15增加左侧菜单链接src\app\core\services\menu.service.ts

配合上篇文章后端功能,可以通过页面操作相关实体。

举报

相关推荐

0 条评论