@airpower/web 0.1.3 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/README.md +12 -9
  2. package/dist/base/AbstractService.d.ts +30 -0
  3. package/dist/base/IEntity.d.ts +11 -0
  4. package/dist/base/RootEntity.d.ts +24 -0
  5. package/dist/base/RootModel.d.ts +8 -0
  6. package/dist/base/index.d.ts +4 -0
  7. package/dist/components/button/Button.vue.d.ts +114 -0
  8. package/dist/components/button/index.d.ts +3 -0
  9. package/dist/components/button/type.d.ts +1 -0
  10. package/dist/components/copy/Copy.vue.d.ts +49 -0
  11. package/dist/components/copy/index.d.ts +2 -0
  12. package/dist/components/datetime/DateTime.vue.d.ts +68 -0
  13. package/dist/components/datetime/index.d.ts +2 -0
  14. package/dist/components/desensitize/Desensitize.vue.d.ts +84 -0
  15. package/dist/components/desensitize/index.d.ts +2 -0
  16. package/dist/components/dialog/Dialog.vue.d.ts +342 -0
  17. package/dist/components/dialog/DialogProps.d.ts +191 -0
  18. package/dist/components/dialog/DialogUtil.d.ts +48 -0
  19. package/dist/components/dialog/index.d.ts +3 -0
  20. package/dist/components/empty/Empty.vue.d.ts +18 -0
  21. package/dist/components/empty/index.d.ts +2 -0
  22. package/dist/components/form/FormField.vue.d.ts +54 -0
  23. package/dist/components/form/index.d.ts +2 -0
  24. package/dist/components/frame/Frame.vue.d.ts +32 -0
  25. package/dist/components/frame/index.d.ts +2 -0
  26. package/dist/components/group/Group.vue.d.ts +144 -0
  27. package/dist/components/group/index.d.ts +2 -0
  28. package/dist/components/image/Image.vue.d.ts +48 -0
  29. package/dist/components/image/index.d.ts +2 -0
  30. package/dist/components/index.d.ts +24 -2
  31. package/dist/components/input/DateTimeType.d.ts +27 -0
  32. package/dist/components/input/Input.vue.d.ts +50 -0
  33. package/dist/components/input/index.d.ts +2 -0
  34. package/dist/components/menu/ChildMenu.vue.d.ts +17 -0
  35. package/dist/components/menu/IMenu.d.ts +24 -0
  36. package/dist/components/menu/Menu.vue.d.ts +20 -0
  37. package/dist/components/menu/index.d.ts +3 -0
  38. package/dist/components/money/Money.vue.d.ts +71 -0
  39. package/dist/components/money/index.d.ts +3 -0
  40. package/dist/components/money/type.d.ts +1 -0
  41. package/dist/components/page/Page.vue.d.ts +18 -0
  42. package/dist/components/page/index.d.ts +2 -0
  43. package/dist/components/panel/Panel.vue.d.ts +115 -0
  44. package/dist/components/panel/index.d.ts +2 -0
  45. package/dist/components/payload/IPayload.d.ts +11 -0
  46. package/dist/components/payload/Payload.vue.d.ts +35 -0
  47. package/dist/components/payload/index.d.ts +3 -0
  48. package/dist/components/phone/Call.vue.d.ts +56 -0
  49. package/dist/components/phone/Phone.vue.d.ts +69 -0
  50. package/dist/components/phone/index.d.ts +3 -0
  51. package/dist/components/qrcode/Qrcode.vue.d.ts +34 -0
  52. package/dist/components/qrcode/index.d.ts +2 -0
  53. package/dist/components/select/Select.vue.d.ts +47 -0
  54. package/dist/components/select/Selector.vue.d.ts +107 -0
  55. package/dist/components/select/index.d.ts +3 -0
  56. package/dist/components/tab/Tab.vue.d.ts +35 -0
  57. package/dist/components/tab/Tabs.vue.d.ts +17 -0
  58. package/dist/components/tab/index.d.ts +3 -0
  59. package/dist/components/table/Table.vue.d.ts +157 -0
  60. package/dist/components/table/component/ColumnSelector.vue.d.ts +20 -0
  61. package/dist/components/table/component/CopyColumn.vue.d.ts +18 -0
  62. package/dist/components/table/component/EnumColumn.vue.d.ts +20 -0
  63. package/dist/components/table/component/Export.vue.d.ts +44 -0
  64. package/dist/components/table/component/index.d.ts +5 -0
  65. package/dist/components/table/index.d.ts +2 -0
  66. package/dist/components/table/useTableButton.d.ts +74 -0
  67. package/dist/components/table/useTableColumn.d.ts +36 -0
  68. package/dist/components/table/useTableSelect.d.ts +24 -0
  69. package/dist/components/tree/TreeBox.vue.d.ts +43 -0
  70. package/dist/components/tree/index.d.ts +2 -0
  71. package/dist/components/upload/IUploadProps.d.ts +62 -0
  72. package/dist/components/upload/Upload.vue.d.ts +47 -0
  73. package/dist/components/upload/index.d.ts +3 -0
  74. package/dist/components/user/IUser.d.ts +14 -0
  75. package/dist/components/user/User.vue.d.ts +67 -0
  76. package/dist/components/user/index.d.ts +3 -0
  77. package/dist/config/WebConfig.d.ts +306 -0
  78. package/dist/config/index.d.ts +1 -0
  79. package/dist/curd/AbstractCurdService.d.ts +138 -0
  80. package/dist/curd/index.d.ts +2 -0
  81. package/dist/curd/type.d.ts +8 -0
  82. package/dist/decorator/@Field/Field.d.ts +28 -0
  83. package/dist/decorator/@Field/IFieldConfig.d.ts +18 -0
  84. package/dist/decorator/@Field/index.d.ts +2 -0
  85. package/dist/decorator/@Form/Form.d.ts +24 -0
  86. package/dist/decorator/@Form/FormTrim.d.ts +19 -0
  87. package/dist/decorator/@Form/IFormField.d.ts +224 -0
  88. package/dist/decorator/@Form/index.d.ts +3 -0
  89. package/dist/decorator/@Model/IModelConfig.d.ts +69 -0
  90. package/dist/decorator/@Model/Model.d.ts +12 -0
  91. package/dist/decorator/@Model/index.d.ts +2 -0
  92. package/dist/decorator/@Search/ISearchField.d.ts +29 -0
  93. package/dist/decorator/@Search/Search.d.ts +24 -0
  94. package/dist/decorator/@Search/index.d.ts +2 -0
  95. package/dist/decorator/{@table → @Table}/IElementTableColumn.d.ts +1 -1
  96. package/dist/decorator/@Table/ITableColumn.d.ts +63 -0
  97. package/dist/decorator/{@table → @Table}/Table.d.ts +5 -5
  98. package/dist/decorator/{@table → @Table}/index.d.ts +1 -1
  99. package/dist/decorator/common/IBaseField.d.ts +12 -0
  100. package/dist/decorator/common/index.d.ts +1 -0
  101. package/dist/decorator/index.d.ts +6 -1
  102. package/dist/enum/DisableEnum.d.ts +10 -0
  103. package/dist/enum/IWebEnum.d.ts +13 -0
  104. package/dist/enum/WebColor.d.ts +23 -0
  105. package/dist/enum/WebEnum.d.ts +20 -0
  106. package/dist/enum/index.d.ts +5 -0
  107. package/dist/enum/type.d.ts +8 -0
  108. package/dist/{controller/interface/IDetailControllerOption.d.ts → hooks/detail/IDetailOption.d.ts} +3 -4
  109. package/dist/hooks/detail/IDetailResult.d.ts +30 -0
  110. package/dist/hooks/detail/index.d.ts +3 -0
  111. package/dist/hooks/detail/useDetail.d.ts +13 -0
  112. package/dist/{controller/interface/IUseEditorOption.d.ts → hooks/editor/IEditorOption.d.ts} +13 -5
  113. package/dist/hooks/editor/IEditorResult.d.ts +29 -0
  114. package/dist/hooks/editor/index.d.ts +3 -0
  115. package/dist/hooks/editor/useEditor.d.ts +13 -0
  116. package/dist/hooks/index.d.ts +3 -0
  117. package/dist/{controller/interface/ITableControllerOption.d.ts → hooks/table/base/IBaseTableOption.d.ts} +5 -5
  118. package/dist/hooks/table/base/IBaseTableResult.d.ts +81 -0
  119. package/dist/hooks/table/base/index.d.ts +3 -0
  120. package/dist/hooks/table/base/useBaseTable.d.ts +11 -0
  121. package/dist/hooks/table/index.d.ts +4 -0
  122. package/dist/hooks/table/list/ITableOption.d.ts +8 -0
  123. package/dist/hooks/table/list/ITableResult.d.ts +33 -0
  124. package/dist/hooks/table/list/index.d.ts +3 -0
  125. package/dist/hooks/table/list/useTable.d.ts +11 -0
  126. package/dist/hooks/table/selector/ISelectorOption.d.ts +8 -0
  127. package/dist/hooks/table/selector/ISelectorResult.d.ts +19 -0
  128. package/dist/hooks/table/selector/index.d.ts +3 -0
  129. package/dist/hooks/table/selector/useSelector.d.ts +13 -0
  130. package/dist/{controller/interface/ITableTreeControllerOption.d.ts → hooks/table/tree/ITableTreeOption.d.ts} +5 -5
  131. package/dist/hooks/table/tree/ITableTreeResult.d.ts +13 -0
  132. package/dist/hooks/table/tree/index.d.ts +3 -0
  133. package/dist/hooks/table/tree/useTableTree.d.ts +12 -0
  134. package/dist/i18n/WebI18n.d.ts +52 -3
  135. package/dist/index.d.ts +7 -4
  136. package/dist/main.js +9229 -0
  137. package/dist/model/export/ExportModel.d.ts +24 -0
  138. package/dist/model/export/index.d.ts +1 -0
  139. package/dist/model/index.d.ts +3 -0
  140. package/dist/model/query/QueryPage.d.ts +15 -0
  141. package/dist/model/query/QueryRequest.d.ts +27 -0
  142. package/dist/model/query/QueryRequestPage.d.ts +13 -0
  143. package/dist/model/query/QueryResponsePage.d.ts +30 -0
  144. package/dist/model/query/QuerySort.d.ts +26 -0
  145. package/dist/model/query/index.d.ts +6 -0
  146. package/dist/model/query/type.d.ts +4 -0
  147. package/dist/model/tree/ITree.d.ts +21 -0
  148. package/dist/model/tree/index.d.ts +1 -0
  149. package/dist/type/index.d.ts +1 -0
  150. package/dist/util/feedback/FeedbackUtil.d.ts +97 -0
  151. package/dist/util/feedback/index.d.ts +2 -0
  152. package/dist/util/feedback/type.d.ts +1 -0
  153. package/dist/util/file/IFile.d.ts +10 -0
  154. package/dist/util/file/WebFileUtil.d.ts +11 -0
  155. package/dist/util/file/index.d.ts +1 -0
  156. package/dist/util/http/Http.d.ts +121 -0
  157. package/dist/util/http/HttpResponse.d.ts +19 -0
  158. package/dist/util/http/enum/HttpContentType.d.ts +27 -0
  159. package/dist/util/http/enum/HttpHeader.d.ts +15 -0
  160. package/dist/util/http/enum/HttpMethod.d.ts +12 -0
  161. package/dist/util/http/enum/HttpStatus.d.ts +31 -0
  162. package/dist/util/http/enum/index.d.ts +4 -0
  163. package/dist/util/http/index.d.ts +4 -0
  164. package/dist/util/http/type.d.ts +13 -0
  165. package/dist/util/index.d.ts +5 -1
  166. package/dist/util/permission/PermissionAction.d.ts +42 -0
  167. package/dist/util/permission/PermissionUtil.d.ts +50 -0
  168. package/dist/util/permission/index.d.ts +2 -0
  169. package/dist/util/validator/WebValidator.d.ts +198 -0
  170. package/dist/util/validator/index.d.ts +2 -0
  171. package/dist/util/validator/type.d.ts +24 -0
  172. package/dist/web.css +1531 -0
  173. package/package.json +15 -12
  174. package/dist/airpower.web.js +0 -490
  175. package/dist/components/WebTable.vue.d.ts +0 -22
  176. package/dist/controller/DetailController.d.ts +0 -29
  177. package/dist/controller/EditorController.d.ts +0 -11
  178. package/dist/controller/index.d.ts +0 -4
  179. package/dist/controller/interface/index.d.ts +0 -4
  180. package/dist/controller/table/BaseTableController.d.ts +0 -68
  181. package/dist/controller/table/TableController.d.ts +0 -36
  182. package/dist/controller/table/TableTreeController.d.ts +0 -16
  183. package/dist/controller/table/index.d.ts +0 -3
  184. package/dist/decorator/@table/ITableFieldConfig.d.ts +0 -23
  185. package/dist/http/WebHttp.d.ts +0 -18
  186. package/dist/http/index.d.ts +0 -1
  187. package/dist/service/AbstractWebService.d.ts +0 -27
  188. package/dist/service/index.d.ts +0 -1
  189. package/dist/shared/index.d.ts +0 -1
  190. package/dist/util/WebAccessTokenUtil.d.ts +0 -20
  191. /package/dist/decorator/{@table → @Table}/TableType.d.ts +0 -0
@@ -0,0 +1,138 @@
1
+ import { ITransformerConstructor } from '@airpower/transformer';
2
+ import { RootEntity, AbstractService } from '../base';
3
+ import { QueryRequest, QueryResponsePage } from '../model';
4
+ import { WebValidateRule } from '../util';
5
+ /**
6
+ * # 实体 `API` 服务超类
7
+ * 包含了常用的增删改查等方法
8
+ *
9
+ * @param E 泛型实体类
10
+ * @author Hamm.cn
11
+ */
12
+ export declare abstract class AbstractCurdService<E extends RootEntity> extends AbstractService {
13
+ /**
14
+ * ### 为基类提供当前的实体类
15
+ * 请求时会通过这个类进行数据转换
16
+ */
17
+ abstract entityClass: ITransformerConstructor<E>;
18
+ /**
19
+ * ### 分页查询默认 `URL`
20
+ */
21
+ protected urlGetPage: string;
22
+ /**
23
+ * ### 不分页查询默认 `URL`
24
+ */
25
+ protected urlGetList: string;
26
+ /**
27
+ * ### 不分页树查询默认 `URL`
28
+ */
29
+ protected urlGetTreeList: string;
30
+ /**
31
+ * ### 查询详情默认 `URL`
32
+ */
33
+ protected urlGetDetail: string;
34
+ /**
35
+ * ### 添加默认 `URL`
36
+ */
37
+ protected urlAdd: string;
38
+ /**
39
+ * ### 启用默认 `URL`
40
+ */
41
+ protected urlEnable: string;
42
+ /**
43
+ * ### 禁用默认 `URL`
44
+ */
45
+ protected urlDisable: string;
46
+ /**
47
+ * ### 修改默认 `URL`
48
+ */
49
+ protected urlUpdate: string;
50
+ /**
51
+ * ### 删除默认 `URL`
52
+ */
53
+ protected urlDelete: string;
54
+ /**
55
+ * ### 创建验证器
56
+ * @param form 表单对象
57
+ * @param moreRule `可选` 更多的验证规则
58
+ */
59
+ static createValidator<E extends RootEntity>(form: E, moreRule?: WebValidateRule<E>): WebValidateRule<E>;
60
+ /**
61
+ * ### 查询分页数据列表
62
+ * @param request 请求对象
63
+ * @param apiUrl `可选` 自定义请求URL
64
+ */
65
+ getPage(request: QueryRequest<E>, apiUrl?: string): Promise<QueryResponsePage<E>>;
66
+ /**
67
+ * ### 查询不分页数据列表
68
+ * @param request 请求对象
69
+ * @param apiUrl `可选` 自定义请求URL
70
+ */
71
+ getList(request: QueryRequest<E>, apiUrl?: string): Promise<E[]>;
72
+ /**
73
+ * ### 查询树结构数据数组
74
+ * @param request 请求对象
75
+ * @param apiUrl `可选` 自定义请求URL
76
+ */
77
+ getTreeList(request: QueryRequest<E>, apiUrl?: string): Promise<E[]>;
78
+ /**
79
+ * ### 根据 `ID` 获取详情对象
80
+ * @param id ID
81
+ * @param apiUrl `可选` 自定义请求URL
82
+ */
83
+ getDetail(id: number, apiUrl?: string): Promise<E>;
84
+ /**
85
+ * ### 添加一条新的数据
86
+ * @param data 保存的数据
87
+ * @param message `可选` 添加成功的消息提示内容
88
+ * @param apiUrl `可选` 自定义请求URL
89
+ */
90
+ add(data: E, message?: string, apiUrl?: string): Promise<number>;
91
+ /**
92
+ * ### 修改一条数据
93
+ * @param data 修改的数据实体
94
+ * @param message `可选` 修改成功的消息提示内容
95
+ * @param apiUrl `可选` 自定义请求URL
96
+ */
97
+ update(data: E, message?: string, apiUrl?: string): Promise<void>;
98
+ /**
99
+ * ### 保存一条数据并返回主键 `ID`
100
+ *
101
+ * 如包含 `ID` 则更新 如不包含 则创建
102
+ * @param data 保存的数据实体
103
+ * @param message `可选` 保存成功的消息提示内容
104
+ */
105
+ save(data: E, message?: string): Promise<number>;
106
+ /**
107
+ * ### 根据 `ID` 删除一条数据
108
+ * @param id 删除的数据 `ID`
109
+ * @param message `可选` 删除成功的消息提示内容
110
+ * @param apiUrl `可选` 自定义请求URL
111
+ */
112
+ delete(id: number, message?: string, apiUrl?: string): Promise<void>;
113
+ /**
114
+ * ### 根据 `ID` 禁用一条数据
115
+ * @param id 禁用的数据 `ID`
116
+ * @param message `可选` 禁用成功的消息提示内容
117
+ * @param apiUrl `可选` 自定义请求URL
118
+ */
119
+ disable(id: number, message?: string, apiUrl?: string): Promise<void>;
120
+ /**
121
+ * ### 根据 `ID` 启用一条数据
122
+ * @param id 启用的数据 `ID`
123
+ * @param message `可选` 启用成功的消息提示内容
124
+ * @param apiUrl `可选` 自定义请求URL
125
+ */
126
+ enable(id: number, message?: string, apiUrl?: string): Promise<void>;
127
+ /**
128
+ * ### 创建验证器
129
+ * @param form 表单对象
130
+ * @param moreRule `可选` 更多的验证规则
131
+ */
132
+ createValidator<E extends RootEntity>(form: E, moreRule?: WebValidateRule<E>): WebValidateRule<E>;
133
+ /**
134
+ * ### 创建一个实体的实例
135
+ * @param id `可选` `ID`
136
+ */
137
+ protected newEntityInstance(id?: number): E;
138
+ }
@@ -0,0 +1,2 @@
1
+ export * from './AbstractCurdService';
2
+ export * from './type';
@@ -0,0 +1,8 @@
1
+ import { RootEntity } from '../base';
2
+ import { AbstractCurdService } from './AbstractCurdService';
3
+ /**
4
+ * ### 服务构造器类型
5
+ */
6
+ export type CurdServiceConstructor<E extends RootEntity, S extends AbstractCurdService<E>> = new () => S & {
7
+ entityClass: (new () => E);
8
+ };
@@ -0,0 +1,28 @@
1
+ import { EnumKey } from '@airpower/enum/dist/enum/type';
2
+ import { DecoratorTarget } from '@airpower/transformer';
3
+ import { WebEnum, WebEnumConstructor } from '../../enum';
4
+ import { IFieldConfig } from './IFieldConfig';
5
+ /**
6
+ * ### 为属性标记配置
7
+ * @param config 配置项
8
+ */
9
+ export declare function Field<K extends EnumKey = EnumKey, E extends WebEnum<K> = WebEnum<K>>(config?: IFieldConfig<K, E>): (target: DecoratorTarget, key: string) => void;
10
+ /**
11
+ * ### 获取属性的配置
12
+ * @returns 配置对象
13
+ * @param target 目标类
14
+ * @param key 属性名
15
+ */
16
+ export declare function getFieldConfig<K extends EnumKey = EnumKey, E extends WebEnum<K> = WebEnum<K>>(target: DecoratorTarget, key: string): IFieldConfig<K, E>;
17
+ /**
18
+ * ### 获取属性的枚举字典
19
+ * @param target 目标类
20
+ * @param key 属性名
21
+ */
22
+ export declare function getDictionary<K extends EnumKey = EnumKey, E extends WebEnum<K> = WebEnum<K>>(target: DecoratorTarget, key: string): WebEnumConstructor<K, E> | undefined;
23
+ /**
24
+ * ### 获取属性的标题
25
+ * @param target 目标类
26
+ * @param key string 属性名
27
+ */
28
+ export declare function getFieldLabel(target: DecoratorTarget, key: string): string;
@@ -0,0 +1,18 @@
1
+ import { EnumKey } from '@airpower/enum/dist/enum/type';
2
+ import { WebEnum, WebEnumConstructor } from '../../enum';
3
+ import { IBaseField } from '../common';
4
+ /**
5
+ * # 字段配置
6
+ *
7
+ * @author Hamm.cn
8
+ */
9
+ export interface IFieldConfig<K extends EnumKey = EnumKey, E extends WebEnum<K> = WebEnum<K>> extends IBaseField {
10
+ /**
11
+ * ### 字段标题
12
+ */
13
+ label?: string;
14
+ /**
15
+ * ### 配置字典
16
+ */
17
+ dictionary?: WebEnumConstructor<K, E>;
18
+ }
@@ -0,0 +1,2 @@
1
+ export * from './Field';
2
+ export * from './IFieldConfig';
@@ -0,0 +1,24 @@
1
+ import { DecoratorTarget } from '@airpower/transformer';
2
+ import { IFormField } from './IFormField';
3
+ /**
4
+ * ### 标记该字段可用于表单配置
5
+ * @param config 配置项
6
+ */
7
+ export declare function Form(config?: IFormField): (target: DecoratorTarget, key: string) => void;
8
+ /**
9
+ * ### 获取对象某个字段标记的表单配置项
10
+ * @param target 目标类或对象
11
+ * @param key 属性名
12
+ */
13
+ export declare function getFormConfig(target: DecoratorTarget, key: string): IFormField;
14
+ /**
15
+ * ### 获取标记了表单配置的字段列表
16
+ * @param target 目标对象
17
+ */
18
+ export declare function getFormFieldList(target: DecoratorTarget): string[];
19
+ /**
20
+ * ### 获取指定类的表单字段配置项列表
21
+ * @param target 目标类或对象
22
+ * @param keyList 选择字段列表
23
+ */
24
+ export declare function getFormConfigList(target: DecoratorTarget, keyList?: string[]): IFormField[];
@@ -0,0 +1,19 @@
1
+ /**
2
+ * # 表单字段自动去除空格
3
+ *
4
+ * @author Hamm.cn
5
+ */
6
+ export declare enum FormTrim {
7
+ /**
8
+ * ### 全部空格
9
+ */
10
+ ALL = 0,
11
+ /**
12
+ * ### 结尾空格
13
+ */
14
+ END = 1,
15
+ /**
16
+ * ### 开头空格
17
+ */
18
+ START = 2
19
+ }
@@ -0,0 +1,224 @@
1
+ import { DateTimeFormatter } from '@airpower/util';
2
+ import { DateTimeType } from '../../components/input/DateTimeType';
3
+ import { IBaseField } from '../common';
4
+ import { FormTrim } from './FormTrim';
5
+ /**
6
+ * # 表单的字段配置接口
7
+ * @author Hamm.cn
8
+ */
9
+ export interface IFormField extends IBaseField {
10
+ /**
11
+ * ### 输入提示
12
+ */
13
+ placeholder?: string;
14
+ /**
15
+ * ### 默认值
16
+ */
17
+ defaultValue?: string | number | boolean;
18
+ /**
19
+ * ### 去除空格
20
+ */
21
+ trim?: FormTrim;
22
+ /**
23
+ * ### 小数精度位数
24
+ */
25
+ precision?: number;
26
+ /**
27
+ * ### 前置图标名称
28
+ * 只支持 [Element Plus内置的图标](https://url.hamm.cn/5yc2d)
29
+ */
30
+ prefixIcon?: string;
31
+ /**
32
+ * ### 后置图标名称
33
+ * 只支持 [Element Plus内置的图标](https://url.hamm.cn/5yc2d)
34
+ */
35
+ suffixIcon?: string;
36
+ /**
37
+ * ### 最大数字
38
+ * 默认配置 `WebConfig.maxNumber` 仅在 `number` 时有效
39
+ */
40
+ max?: number;
41
+ /**
42
+ * ### 最小数字
43
+ */
44
+ min?: number;
45
+ /**
46
+ * ### 最大允许输入的长度
47
+ * 手动指定后, `WebConfig.maxTextAreaLength` 和 `WebConfig.maxTextLength` 将失效
48
+ */
49
+ maxLength?: number;
50
+ /**
51
+ * ### 最小长度
52
+ */
53
+ minLength?: number;
54
+ /**
55
+ * ### 排序 越大越靠上
56
+ */
57
+ order?: number;
58
+ /**
59
+ * ### 数字输入
60
+ */
61
+ number?: boolean;
62
+ /**
63
+ * ### 是否是密码
64
+ */
65
+ password?: boolean;
66
+ /**
67
+ * ### 是否是文本域
68
+ */
69
+ textarea?: boolean;
70
+ /**
71
+ * ### 是否显示字数限制
72
+ */
73
+ showLimit?: boolean;
74
+ /**
75
+ * ### 是否是纯中文
76
+ * 支持传入 `boolean` 和 `string`
77
+ * - 如传入 `有效字符串` 则认为需要校验, 内容即是校验失败的报错信息
78
+ * - 如传入 `true` 则认为需要校验且自动生成校验失败的报错信息
79
+ */
80
+ chinese?: boolean | string;
81
+ /**
82
+ * ### 是否是手机号
83
+ * 支持传入 `boolean` 和 `string`
84
+ * - 如传入 `有效字符串` 则认为需要校验, 内容即是校验失败的报错信息
85
+ * - 如传入 `true` 则认为需要校验且自动生成校验失败的报错信息
86
+ */
87
+ mobilePhone?: boolean | string;
88
+ /**
89
+ * ### 是否是座机电话
90
+ * 支持传入 `boolean` 和 `string`
91
+ * - 如传入 `有效字符串` 则认为需要校验, 内容即是校验失败的报错信息
92
+ * - 如传入 `true` 则认为需要校验且自动生成校验失败的报错信息
93
+ */
94
+ telPhone?: boolean | string;
95
+ /**
96
+ * ### 是否是电子邮箱
97
+ * 支持传入 `boolean` 和 `string`
98
+ * - 如传入 `有效字符串` 则认为需要校验, 内容即是校验失败的报错信息
99
+ * - 如传入 `true` 则认为需要校验且自动生成校验失败的报错信息
100
+ */
101
+ email?: boolean | string;
102
+ /**
103
+ * ### 是否是座机电话或手机
104
+ * 支持传入 `boolean` 和 `string`
105
+ * - 如传入 `有效字符串` 则认为需要校验, 内容即是校验失败的报错信息
106
+ * - 如传入 `true` 则认为需要校验且自动生成校验失败的报错信息
107
+ */
108
+ phone?: boolean | string;
109
+ /**
110
+ * ### 是否必填(字符串类型)
111
+ * 支持传入 `boolean` 和 `string`
112
+ * - 如传入 `有效字符串` 则认为需要校验, 内容即是校验失败的报错信息
113
+ * - 如传入 `true` 则认为需要校验且自动生成校验失败的报错信息
114
+ */
115
+ requiredString?: boolean | string;
116
+ /**
117
+ * ### 是否必填(数字类型)
118
+ * 支持传入 `boolean` 和 `string`
119
+ * - 如传入 `有效字符串` 则认为需要校验, 内容即是校验失败的报错信息
120
+ * - 如传入 `true` 则认为需要校验且自动生成校验失败的报错信息
121
+ */
122
+ requiredNumber?: boolean | string;
123
+ /**
124
+ * ### 是否必填(挂载对象)
125
+ * 支持传入 `boolean` 和 `string`
126
+ * - 如传入 `有效字符串` 则认为需要校验, 内容即是校验失败的报错信息
127
+ * - 如传入 `true` 则认为需要校验且自动生成校验失败的报错信息
128
+ */
129
+ requiredPayload?: boolean | string;
130
+ /**
131
+ * ### 正则表达式对象
132
+ */
133
+ regExp?: RegExp;
134
+ /**
135
+ * ### 是否隐藏表单字段
136
+ * 如配置`true` 则`getFormFieldConfigList`将无法拿到这个属性
137
+ */
138
+ hide?: boolean;
139
+ /**
140
+ * ### 日期类型
141
+ */
142
+ dateType?: DateTimeType;
143
+ /**
144
+ * ### 日期显示格式化
145
+ */
146
+ dateShowFormatter?: DateTimeFormatter;
147
+ /**
148
+ * ### 日期格式化
149
+ */
150
+ dateFormatter?: DateTimeFormatter;
151
+ /**
152
+ * ### 是否可清除
153
+ */
154
+ clearable?: boolean;
155
+ /**
156
+ * ### 后置文字
157
+ * 优先级低于 `AInput` 的 `append` 插槽
158
+ */
159
+ suffixText?: string;
160
+ /**
161
+ * ### 可多选
162
+ */
163
+ multiple?: boolean;
164
+ /**
165
+ * ### 收起多选标签
166
+ */
167
+ collapseTags?: boolean;
168
+ /**
169
+ * ### 可筛选
170
+ * 如同时为 `AInput` 传入了 `onSearch` 回调方法, 则进行自定义的筛选
171
+ */
172
+ filterable?: boolean;
173
+ /**
174
+ * ### 限制最多选择多少个
175
+ * 配置 0 不限制, 默认不限制
176
+ */
177
+ multipleLimit?: number;
178
+ /**
179
+ * ### 父子关联
180
+ */
181
+ checkStrictly?: boolean;
182
+ /**
183
+ * ### 是否显示枚举字典的颜色灯
184
+ * 如果显示 请确保传入的 `dictionary` 配置了 `color`
185
+ */
186
+ color?: boolean;
187
+ /**
188
+ * ### 返回全路径的值
189
+ */
190
+ emitPath?: boolean;
191
+ /**
192
+ * ### 显示全路径
193
+ */
194
+ showAllLevels?: boolean;
195
+ /**
196
+ * ### TextArea是否自适应
197
+ * `AInput`如配置了 `textarea:true` 此项生效, 默认为`true`
198
+ * 如配置为 `false`, 可手动配置 `minRow` `maxRow` 等参数
199
+ */
200
+ autoSize?: boolean;
201
+ /**
202
+ * ### 最小行数
203
+ * 如配置了 `autoSize`, 则此项配置无效
204
+ */
205
+ minRows?: number;
206
+ /**
207
+ * ### 最大行数
208
+ * 如配置了 `autoSize`, 则此项配置无效
209
+ */
210
+ maxRows?: number;
211
+ /**
212
+ * ### 使用 `Switch` 控件
213
+ */
214
+ switch?: boolean;
215
+ /**
216
+ * ### 使用 `Radio` 控件
217
+ */
218
+ radio?: boolean;
219
+ /**
220
+ * ### 使用 `Radio` 控件时用按钮的样式
221
+ * `@Form` 的 `radio` 配置为 `true` 时生效
222
+ */
223
+ radioButton?: boolean;
224
+ }
@@ -0,0 +1,3 @@
1
+ export * from './Form';
2
+ export * from './FormTrim';
3
+ export * from './IFormField';
@@ -0,0 +1,69 @@
1
+ /**
2
+ * # 模型配置
3
+ * @author Hamm.cn
4
+ */
5
+ export interface IModelConfig {
6
+ /**
7
+ * ### 模型名称
8
+ */
9
+ label?: string;
10
+ /**
11
+ * ### 是否显示搜索框
12
+ * 优先级: 组件传入 > `Model` 配置
13
+ */
14
+ showSearch?: boolean;
15
+ /**
16
+ * ### 添加按钮的标题
17
+ * 优先级: 组件传入 > 自动生成
18
+ */
19
+ addTitle?: string;
20
+ /**
21
+ * ### 添加权限标识
22
+ */
23
+ addPermission?: string;
24
+ /**
25
+ * ### 导出权限标识
26
+ */
27
+ exportPermission?: string;
28
+ /**
29
+ * ### 导入权限标识
30
+ */
31
+ importPermission?: string;
32
+ /**
33
+ * ### 表格的没有数据时的提示文本
34
+ */
35
+ tableEmptyText?: string;
36
+ /**
37
+ * ### 编辑权限标识
38
+ */
39
+ editPermission?: string;
40
+ /**
41
+ * ### 详情权限标识
42
+ */
43
+ detailPermission?: string;
44
+ /**
45
+ * ### 删除权限标识
46
+ */
47
+ deletePermission?: string;
48
+ /**
49
+ * ### 添加子项目权限标识
50
+ */
51
+ addChildPermission?: string;
52
+ /**
53
+ * ### 禁用权限标识
54
+ */
55
+ disablePermission?: string;
56
+ /**
57
+ * ### 启用权限标识
58
+ */
59
+ enablePermission?: string;
60
+ /**
61
+ * ### 权限标识前缀
62
+ */
63
+ permissionPrefix?: string;
64
+ /**
65
+ * ### 全局隐藏字段列选择器
66
+ * 如设置 `true`, 则 `ATable` 传入的 `hideFieldSelector` 失效
67
+ */
68
+ hideFieldSelector?: boolean;
69
+ }
@@ -0,0 +1,12 @@
1
+ import { DecoratorTarget } from '@airpower/transformer';
2
+ import { IModelConfig } from './IModelConfig';
3
+ /**
4
+ * ### 为模型类标记配置项
5
+ * @param config 配置项
6
+ */
7
+ export declare function Model<T extends IModelConfig = IModelConfig>(config?: T): (target: DecoratorTarget) => void;
8
+ /**
9
+ * ### 获取模型类配置项
10
+ * @param target 目标类
11
+ */
12
+ export declare function getModelConfig<T extends IModelConfig = IModelConfig>(target: DecoratorTarget): T;
@@ -0,0 +1,2 @@
1
+ export * from './IModelConfig';
2
+ export * from './Model';
@@ -0,0 +1,29 @@
1
+ import { IBaseField } from '../common';
2
+ /**
3
+ * # 表单的字段配置接口
4
+ * @author Hamm.cn
5
+ */
6
+ export interface ISearchField extends IBaseField {
7
+ /**
8
+ * ### 隐藏搜索
9
+ */
10
+ hide?: boolean;
11
+ /**
12
+ * ### 排序
13
+ * `越大越靠左边`
14
+ */
15
+ order?: number;
16
+ /**
17
+ * ### 可筛选
18
+ * 仅枚举字典下拉选择时有效
19
+ */
20
+ filterable?: boolean;
21
+ /**
22
+ * ### 可清除
23
+ */
24
+ clearable?: boolean;
25
+ /**
26
+ * ### 宽度
27
+ */
28
+ width?: number;
29
+ }
@@ -0,0 +1,24 @@
1
+ import { DecoratorTarget } from '@airpower/transformer';
2
+ import { ISearchField } from './ISearchField';
3
+ /**
4
+ * ### 标记该字段可用于表单配置
5
+ * @param config 配置项
6
+ */
7
+ export declare function Search(config?: ISearchField): (target: DecoratorTarget, key: string) => void;
8
+ /**
9
+ * ### 获取对象某个字段标记的搜索配置项
10
+ * @param target 目标类或对象
11
+ * @param key 属性名
12
+ */
13
+ export declare function getSearchConfig(target: DecoratorTarget, key: string): ISearchField;
14
+ /**
15
+ * ### 获取标记了搜索配置的字段列表
16
+ * @param target 目标对象
17
+ */
18
+ export declare function getSearchFieldList(target: DecoratorTarget): string[];
19
+ /**
20
+ * ### 获取指定类的搜索字段配置项列表
21
+ * @param target 目标类或对象
22
+ * @param keyList 选择字段列表
23
+ */
24
+ export declare function getSearchConfigList(target: DecoratorTarget, keyList?: string[]): ISearchField[];
@@ -0,0 +1,2 @@
1
+ export * from './ISearchField';
2
+ export * from './Search';
@@ -21,7 +21,7 @@ export interface IElementTableColumn {
21
21
  /**
22
22
  * ### 列宽度
23
23
  */
24
- width?: string;
24
+ width?: string | number;
25
25
  /**
26
26
  * ### 最小宽度
27
27
  */