0.1.7 • Published 5 years ago

tongchang-lib v0.1.7

Weekly downloads
61
License
-
Repository
-
Last release
5 years ago

TongchangLib

This library was generated with Angular CLI version 7.2.0.

通昶小分队 Angular 项目公共库

  • 请在业务根模块中使用 forRoot 方法导入库模块, 传入配置项
  • 其他模块请直接导入库模块

Code scaffolding

Run ng generate component component-name --project tongchang-lib to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project tongchang-lib.

Note: Don't forget to add --project tongchang-lib or else it will be added to the default project in your angular.json file.

Build

Run ng build tongchang-lib to build the project. The build artifacts will be stored in the dist/ directory.

Publishing

After building your library with ng build tongchang-lib, go to the dist folder cd dist/tongchang-lib and run npm publish.

Running unit tests

Run ng test tongchang-lib to execute the unit tests via Karma.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.

组件

组件类标签说明
ImageUploadComponentlib-image-upload图片上传表单控件
ImagePreviewComponentlib-image-preview图片预览组件
UniversalComponent通用组件抽象类
UniversalForm通用表单组件

指令

指令类标签说明
ClientRectDirectivelibClientRect窗口缩放emit当前元素高度
ClickOutsideDirectivelibClickOutside点击事件发生在指令所在元素外

通用服务抽象类

方法名说明
onForceReload刷新当前页数据
onItemAdd新增数据modal
onItemEdit编辑数据modal
onItemRemove删除数据modal
setter: gridConf设置数据请求参数
prop: pageParamCh$pageSize Change 事件
oneSelect读取一行选中数据
multiSelect读取多行选中数据

工具服务

方法名说明
getFileUrl由文件ObjectID 获取文件下载地址
getFullUrl获取带查询参数请求地址
picPreview图片预览
imageUploadCheck图片上传格式检查
submitConfirm提交确认modal
listLazyLoad获取 select 懒加载配置
listServerSearch获取 select ServerSearch 配置
formControlError表单控件错误信息显示控制
fileSelect文件选择
fileDownLoad文件下载
debounce防抖函数
reqMsgShow请求 massage 提示信息
reqErrMsgShow仅显示请求错误信息
compareWithId对比两条数据 id 是否一致

HTTP 服务

方法名说明
getGET
postPOST
putPUT
deleteDELETE
fileUpload文件上传
fileUploadWithJsonOrBlobRes文件上传(带上传结果下载)
request

表单验证器

导出名称说明
PassValidator密码验证: /^[A-Za-z]{1}([A-Za-z0-9] | [._]){5,19}$/
PhoneValidator手机号验证(精确)
SimpPhoneValidator手机号验证 (简单)
EmailValidator邮件验证: /.+\@.+\..+/
IDNoValidator身份证号验证器 (18 位)
0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago