@dhccmobile/vue3-lo-form 0.1.0

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 (160) hide show
  1. package/.eslintrc.js +29 -0
  2. package/README.md +62 -0
  3. package/babel.config.js +3 -0
  4. package/dist/demo.html +10 -0
  5. package/dist/vue3-lo-form.common.js +119725 -0
  6. package/dist/vue3-lo-form.common.js.map +1 -0
  7. package/dist/vue3-lo-form.css +1 -0
  8. package/dist/vue3-lo-form.umd.js +119735 -0
  9. package/dist/vue3-lo-form.umd.js.map +1 -0
  10. package/dist/vue3-lo-form.umd.min.js +38 -0
  11. package/dist/vue3-lo-form.umd.min.js.map +1 -0
  12. package/package.json +61 -0
  13. package/public/favicon.ico +0 -0
  14. package/public/index.html +17 -0
  15. package/src/App.vue +715 -0
  16. package/src/components/form/DvForm.vue +586 -0
  17. package/src/components/form/DvFormLayout.vue +1568 -0
  18. package/src/components/form/StretchText.vue +77 -0
  19. package/src/components/index.ts +3 -0
  20. package/src/constants/config/form-template.config.ts +32 -0
  21. package/src/constants/config/form.config.ts +4 -0
  22. package/src/constants/config/storage.config.ts +4 -0
  23. package/src/constants/encode-assets/icons.ts +0 -0
  24. package/src/constants/encode-assets/svg.ts +9 -0
  25. package/src/constants/enum/builtIn-label.enum.ts +5 -0
  26. package/src/constants/enum/cache-type.enum.ts +7 -0
  27. package/src/constants/enum/control-format-type.enum.ts +9 -0
  28. package/src/constants/enum/dynamic-option-type.enum.ts +6 -0
  29. package/src/constants/enum/form-bus-attr.enum.ts +8 -0
  30. package/src/constants/enum/form-field-class.enum.ts +7 -0
  31. package/src/constants/enum/form-field-type.enum.ts +25 -0
  32. package/src/constants/enum/form-type.enum.ts +5 -0
  33. package/src/constants/enum/index.ts +19 -0
  34. package/src/constants/enum/lateral-arrangement.enum.ts +9 -0
  35. package/src/constants/enum/money-unit.enum.ts +6 -0
  36. package/src/constants/enum/option-type.enum.ts +5 -0
  37. package/src/constants/enum/submitted-type.enum.ts +12 -0
  38. package/src/constants/enum/support-upload-type.enum.ts +5 -0
  39. package/src/constants/enum/switch.enum.ts +5 -0
  40. package/src/constants/enum/upload-type.enum.ts +17 -0
  41. package/src/constants/enum/validate-rules.enum.ts +25 -0
  42. package/src/constants/enum/validate-status.enum.ts +8 -0
  43. package/src/constants/enum/vertical-arrangement.enum.ts +7 -0
  44. package/src/constants/enum/zoom-type.ts +6 -0
  45. package/src/constants/index.ts +3 -0
  46. package/src/core/FormApi.ts +865 -0
  47. package/src/core/index.ts +1 -0
  48. package/src/domain/AbstractControl.ts +6 -0
  49. package/src/domain/Control.ts +14 -0
  50. package/src/domain/CustomFormat.ts +6 -0
  51. package/src/domain/DesForm.ts +48 -0
  52. package/src/domain/DesFormControl.ts +223 -0
  53. package/src/domain/DesFormLayout.ts +51 -0
  54. package/src/domain/FieldChangeHistory.ts +9 -0
  55. package/src/domain/FormConfig.ts +12 -0
  56. package/src/domain/FormControl.ts +125 -0
  57. package/src/domain/FormEnum.ts +9 -0
  58. package/src/domain/FormGroup.ts +42 -0
  59. package/src/domain/FormRestfulResponse.ts +6 -0
  60. package/src/domain/ProvideInjectData.ts +9 -0
  61. package/src/domain/SysDictDetail.ts +25 -0
  62. package/src/domain/SysDictInfo.ts +31 -0
  63. package/src/domain/SysDictTreeDetail.ts +43 -0
  64. package/src/domain/index.ts +12 -0
  65. package/src/filtres/amount-capitalization.filter.ts +136 -0
  66. package/src/filtres/extract-options.filter.ts +53 -0
  67. package/src/filtres/generate-grid-column-end.filter.ts +22 -0
  68. package/src/filtres/generate-grid-template-columns.filter.ts +24 -0
  69. package/src/filtres/switch-enum-convert.filter.ts +18 -0
  70. package/src/filtres/zoom-multiple.filter.ts +32 -0
  71. package/src/index.ts +67 -0
  72. package/src/main.ts +17 -0
  73. package/src/services/api.service.ts +73 -0
  74. package/src/services/clean-local-forage.service.ts +58 -0
  75. package/src/services/dict-local-forage.service.ts +58 -0
  76. package/src/services/form-bean-utils.service.ts +41 -0
  77. package/src/services/form-local-forage.service.ts +59 -0
  78. package/src/services/form-tools.service.ts +497 -0
  79. package/src/services/form-tree-node-convert.service.ts +216 -0
  80. package/src/services/form-validate.service.ts +103 -0
  81. package/src/services/index.ts +9 -0
  82. package/src/services/router.service.ts +96 -0
  83. package/src/services/validate-generator.service.ts +710 -0
  84. package/src/shims-vue.d.ts +6 -0
  85. package/src/store/dict.store.ts +63 -0
  86. package/src/store/form.store.ts +32 -0
  87. package/src/store/index.ts +2 -0
  88. package/src/styles/index.scss +167 -0
  89. package/src/types/vfForm.ts +11 -0
  90. package/tsconfig.json +40 -0
  91. package/types/components/index.d.ts +3 -0
  92. package/types/constants/config/form-template.config.d.ts +30 -0
  93. package/types/constants/config/form.config.d.ts +4 -0
  94. package/types/constants/config/storage.config.d.ts +4 -0
  95. package/types/constants/encode-assets/icons.d.ts +0 -0
  96. package/types/constants/encode-assets/svg.d.ts +5 -0
  97. package/types/constants/enum/builtIn-label.enum.d.ts +7 -0
  98. package/types/constants/enum/cache-type.enum.d.ts +15 -0
  99. package/types/constants/enum/control-format-type.enum.d.ts +23 -0
  100. package/types/constants/enum/dynamic-option-type.enum.d.ts +11 -0
  101. package/types/constants/enum/form-bus-attr.enum.d.ts +19 -0
  102. package/types/constants/enum/form-field-class.enum.d.ts +18 -0
  103. package/types/constants/enum/form-field-type.enum.d.ts +111 -0
  104. package/types/constants/enum/form-type.enum.d.ts +11 -0
  105. package/types/constants/enum/index.d.ts +19 -0
  106. package/types/constants/enum/lateral-arrangement.enum.d.ts +23 -0
  107. package/types/constants/enum/money-unit.enum.d.ts +15 -0
  108. package/types/constants/enum/option-type.enum.d.ts +11 -0
  109. package/types/constants/enum/submitted-type.enum.d.ts +35 -0
  110. package/types/constants/enum/support-upload-type.enum.d.ts +11 -0
  111. package/types/constants/enum/switch.enum.d.ts +11 -0
  112. package/types/constants/enum/upload-type.enum.d.ts +59 -0
  113. package/types/constants/enum/validate-rules.enum.d.ts +2 -0
  114. package/types/constants/enum/validate-status.enum.d.ts +2 -0
  115. package/types/constants/enum/vertical-arrangement.enum.d.ts +21 -0
  116. package/types/constants/enum/zoom-type.d.ts +15 -0
  117. package/types/constants/index.d.ts +3 -0
  118. package/types/core/FormApi.d.ts +326 -0
  119. package/types/core/index.d.ts +1 -0
  120. package/types/domain/AbstractControl.d.ts +5 -0
  121. package/types/domain/Control.d.ts +13 -0
  122. package/types/domain/CustomFormat.d.ts +5 -0
  123. package/types/domain/DesForm.d.ts +32 -0
  124. package/types/domain/DesFormControl.d.ts +148 -0
  125. package/types/domain/DesFormLayout.d.ts +33 -0
  126. package/types/domain/FieldChangeHistory.d.ts +9 -0
  127. package/types/domain/FormConfig.d.ts +12 -0
  128. package/types/domain/FormControl.d.ts +60 -0
  129. package/types/domain/FormEnum.d.ts +10 -0
  130. package/types/domain/FormGroup.d.ts +27 -0
  131. package/types/domain/FormRestfulResponse.d.ts +6 -0
  132. package/types/domain/ProvideInjectData.d.ts +9 -0
  133. package/types/domain/SysDictDetail.d.ts +16 -0
  134. package/types/domain/SysDictInfo.d.ts +20 -0
  135. package/types/domain/SysDictTreeDetail.d.ts +28 -0
  136. package/types/domain/index.d.ts +12 -0
  137. package/types/filtres/amount-capitalization.filter.d.ts +7 -0
  138. package/types/filtres/extract-options.filter.d.ts +13 -0
  139. package/types/filtres/generate-grid-column-end.filter.d.ts +11 -0
  140. package/types/filtres/generate-grid-template-columns.filter.d.ts +11 -0
  141. package/types/filtres/switch-enum-convert.filter.d.ts +2 -0
  142. package/types/filtres/zoom-multiple.filter.d.ts +3 -0
  143. package/types/index.d.ts +12 -0
  144. package/types/main.d.ts +2 -0
  145. package/types/services/api.service.d.ts +25 -0
  146. package/types/services/clean-local-forage.service.d.ts +28 -0
  147. package/types/services/dict-local-forage.service.d.ts +28 -0
  148. package/types/services/form-bean-utils.service.d.ts +23 -0
  149. package/types/services/form-local-forage.service.d.ts +28 -0
  150. package/types/services/form-tools.service.d.ts +109 -0
  151. package/types/services/form-tree-node-convert.service.d.ts +94 -0
  152. package/types/services/form-validate.service.d.ts +32 -0
  153. package/types/services/index.d.ts +9 -0
  154. package/types/services/router.service.d.ts +40 -0
  155. package/types/services/validate-generator.service.d.ts +154 -0
  156. package/types/store/dict.store.d.ts +29 -0
  157. package/types/store/form.store.d.ts +17 -0
  158. package/types/store/index.d.ts +2 -0
  159. package/types/types/vfForm.d.ts +10 -0
  160. package/vue.config.js +29 -0
@@ -0,0 +1,109 @@
1
+ import { FormConfig } from "../domain/FormConfig";
2
+ import { FormRestfulResponse } from "../domain/FormRestfulResponse";
3
+ import { DesForm } from "../domain/DesForm";
4
+ import { MapNodeOptions, NzTreeNodeOptions } from "./form-tree-node-convert.service";
5
+ import { SysDictInfo } from "../domain/SysDictInfo";
6
+ import { FormApi } from "../core/FormApi";
7
+ interface DictionaryFormatCollection {
8
+ sysDictDetailOptions?: NzTreeNodeOptions[];
9
+ sysDictTreeDetailOptions?: NzTreeNodeOptions[];
10
+ mapSysDictDetailOptions?: MapNodeOptions;
11
+ mapSysDictTreeDetailOptions?: MapNodeOptions;
12
+ }
13
+ declare class FormToolsService {
14
+ private static readonly LOAD_SUCCESS;
15
+ private static readonly LOAD_FAIL;
16
+ private static IS_FIRST_LOADED;
17
+ private nodeContrast;
18
+ private dictDetailsContrast;
19
+ private nzDictDetailsContrastContrast;
20
+ private dictTreeDetailsContrast;
21
+ private nzDictTreeDetailsContrastContrast;
22
+ private desForms;
23
+ sysDictDetailOptions: NzTreeNodeOptions[];
24
+ sysDictTreeDetailOptions: NzTreeNodeOptions[];
25
+ mapSysDictDetailOptions: MapNodeOptions | undefined;
26
+ mapSysDictTreeDetailOptions: MapNodeOptions | undefined;
27
+ constructor();
28
+ get formConfig(): Partial<FormConfig>;
29
+ /**
30
+ * @description: 检查是否经过首次初始化并初始化
31
+ * @author ChenRui
32
+ * @date 2021/1/5 23:04
33
+ */
34
+ checkFirstLoadAndInitDesign(): Promise<FormRestfulResponse>;
35
+ /**
36
+ * @description: 初始化
37
+ * @author ChenRui
38
+ * @date 2021/3/12 11:02
39
+ */
40
+ init(): Promise<FormRestfulResponse>;
41
+ /**
42
+ * @description: 初始化表单设计
43
+ * @author ChenRui
44
+ * @date 2020/11/20 10:55
45
+ */
46
+ initDesign(): Promise<FormRestfulResponse>;
47
+ /**
48
+ * @description: 加载远程表单配置
49
+ * @author ChenRui
50
+ * @date 2020/11/20 17:30
51
+ */
52
+ private loadDesign;
53
+ /**
54
+ * @description: 初始化字典
55
+ * @author ChenRui
56
+ * @date 2021/3/11 14:32
57
+ */
58
+ initDict(): Promise<FormRestfulResponse>;
59
+ /**
60
+ * @description: 加载远程字典配置
61
+ * @author ChenRui
62
+ * @date 2020/11/20 17:30
63
+ */
64
+ private loadDict;
65
+ /**
66
+ * @description: 初始化字典可选项
67
+ * @author ChenRui
68
+ * @date 2020/11/10 20:38
69
+ */
70
+ inidDictOptions(sysDictInfos: SysDictInfo[]): DictionaryFormatCollection;
71
+ /**
72
+ * @description: 格式化表单
73
+ * @author ChenRui
74
+ * @date 2020/11/30 15:48
75
+ */
76
+ formatDesForm(sourceDesForm: DesForm): DesForm | undefined;
77
+ /**
78
+ * @description: 递归格式化
79
+ * @author ChenRui
80
+ * @date 2020/11/17 10:16
81
+ */
82
+ private recursionFormatForm;
83
+ /**
84
+ * @description: 控件排序
85
+ * @author ChenRui
86
+ * @date 2020/11/17 11:59
87
+ */
88
+ private sortControls;
89
+ /**
90
+ * @description: 加载资源
91
+ * @author ChenRui
92
+ * @date 2020/11/23 11:00
93
+ */
94
+ loadResource(formId: string): DesForm;
95
+ /**
96
+ * @description: rest客户端
97
+ * @author ChenRui
98
+ * @date 2020/11/19 21:02
99
+ */
100
+ private fetch;
101
+ /**
102
+ * @description: 校验提示
103
+ * @author ChenRui
104
+ * @date 2021/8/18 17:14
105
+ */
106
+ validateTips(formApis: FormApi | FormApi[], scrollView?: any): boolean;
107
+ }
108
+ declare const formToolsService: FormToolsService;
109
+ export { formToolsService, FormToolsService, DictionaryFormatCollection };
@@ -0,0 +1,94 @@
1
+ interface NodeContrast {
2
+ id: string;
3
+ parentId: string;
4
+ children: string;
5
+ }
6
+ interface NzNodeContrast {
7
+ title: string;
8
+ key: string;
9
+ icon?: string;
10
+ isLeaf?: string;
11
+ checked?: string;
12
+ selected?: string;
13
+ selectable?: string;
14
+ disabled?: string;
15
+ disableCheckbox?: string;
16
+ expanded?: string;
17
+ children: string;
18
+ [key: string]: any;
19
+ }
20
+ interface NzCascaderOptionContrast {
21
+ value: string;
22
+ label: string;
23
+ title?: string;
24
+ disabled?: string;
25
+ loading?: string;
26
+ isLeaf?: string;
27
+ parent?: string;
28
+ children: string;
29
+ [key: string]: any;
30
+ }
31
+ interface NzTreeNodeOptions {
32
+ title: string;
33
+ key: string;
34
+ icon?: string;
35
+ isLeaf?: boolean;
36
+ checked?: boolean;
37
+ selected?: boolean;
38
+ selectable?: boolean;
39
+ disabled?: boolean;
40
+ disableCheckbox?: boolean;
41
+ expanded?: boolean;
42
+ children?: NzTreeNodeOptions[];
43
+ [key: string]: any;
44
+ }
45
+ interface MapNodeItem {
46
+ key?: string;
47
+ title?: string;
48
+ value?: string;
49
+ children?: MapNodeOptions;
50
+ }
51
+ interface MapNodeOptions {
52
+ [key: string]: MapNodeItem;
53
+ }
54
+ declare class FormTreeNodeConvertService {
55
+ constructor();
56
+ /**
57
+ * @description: 数组转换为树形结构
58
+ * @author ChenRui
59
+ * @date 2020/10/30 10:18
60
+ */
61
+ arrayConvertToTreeNode(data: any[], nodeContrast: NodeContrast, parentId?: string): any[];
62
+ /**
63
+ * @description: 树形结构转换为Nz树形结构
64
+ * @author ChenRui
65
+ * @date 2020/10/30 10:21
66
+ */
67
+ treeNodeConvertToNzTreeNode(data: any[], nzNodeContrast: NzNodeContrast, isDisabledLeaf?: boolean): any[];
68
+ /**
69
+ * @description: 数组转换为Nz树形结构
70
+ * @author ChenRui
71
+ * @date 2020/10/30 10:41
72
+ */
73
+ arrayConvertToNzTreeNode(data: any[], nodeContrast: NodeContrast, nzNodeContrast: NzNodeContrast, isDisabledLeaf?: boolean): any[];
74
+ /**
75
+ * @description: 树形结构转换为Nz树形结构
76
+ * @author ChenRui
77
+ * @date 2020/10/30 10:21
78
+ */
79
+ treeNodeConvertToCascaderOption(data: any[], nzCascaderOptionContrast: NzCascaderOptionContrast, isDisabledLeaf?: boolean): any[];
80
+ /**
81
+ * @description: 插件树结构转map
82
+ * @author ChenRui
83
+ * @date 2022/1/18 19:19
84
+ */
85
+ nzTreeNodeConvertToMap(data: NzTreeNodeOptions[]): MapNodeOptions | undefined;
86
+ /**
87
+ * @description: 数组转换为Nz树形结构
88
+ * @author ChenRui
89
+ * @date 2020/10/30 10:41
90
+ */
91
+ arrayConvertToCascaderOption(data: any[], nodeContrast: NodeContrast, nzCascaderOptionContrast: NzCascaderOptionContrast, isDisabledLeaf?: boolean): any[];
92
+ }
93
+ declare const formTreeNodeConvertService: FormTreeNodeConvertService;
94
+ export { NodeContrast, NzNodeContrast, NzCascaderOptionContrast, NzTreeNodeOptions, MapNodeItem, MapNodeOptions, formTreeNodeConvertService };
@@ -0,0 +1,32 @@
1
+ import { FormApi } from "../core/FormApi";
2
+ import { ValidateReport } from "../domain/FormControl";
3
+ /**
4
+ * @description: 表单校验窗口提示
5
+ * @author ChenRui
6
+ * @date 2021/8/19 12:58
7
+ */
8
+ declare class FormValidateService {
9
+ /**
10
+ * @description: 校验并进行窗口提示
11
+ * @author ChenRui
12
+ * @date 2021/8/19 12:58
13
+ */
14
+ validateTips(formApis: FormApi | FormApi[], scrollView?: any): boolean;
15
+ /**
16
+ * @Description: 滚动到错误位置-闪烁提示
17
+ * @author LiuBo
18
+ * @date 2021/2/25
19
+ * @time 21:35
20
+ */
21
+ showErrorModal(formApis: FormApi[], allError: ValidateReport[], scrollView?: any): void;
22
+ /**
23
+ * @Description: 闪烁显示校验不通过的输入框
24
+ * @author LiuBo
25
+ * @date 2019/6/3
26
+ * @time 22:01
27
+ * @param el 出错的输入框html对象
28
+ */
29
+ private showErrInput;
30
+ }
31
+ declare const formValidateService: FormValidateService;
32
+ export { formValidateService };
@@ -0,0 +1,9 @@
1
+ export * from "./api.service";
2
+ export * from "./clean-local-forage.service";
3
+ export * from "./dict-local-forage.service";
4
+ export * from "./form-bean-utils.service";
5
+ export * from "./form-local-forage.service";
6
+ export * from "./form-tools.service";
7
+ export * from "./form-tree-node-convert.service";
8
+ export * from "./form-validate.service";
9
+ export * from "./validate-generator.service";
@@ -0,0 +1,40 @@
1
+ interface Params {
2
+ [key: string]: any;
3
+ }
4
+ export declare class RouterService {
5
+ constructor();
6
+ /**
7
+ * @description: 跨应用跳转
8
+ * @author ChenRui
9
+ * @date 2020/9/28 14:23
10
+ */
11
+ push(subapp: string): void;
12
+ /**
13
+ * @description: 获取纯路劲
14
+ * @author ChenRui
15
+ * @date 2020/10/12 21:06
16
+ */
17
+ getPathFromUrl(url: string): string;
18
+ /**
19
+ * @description: 获取请求参数
20
+ * @author ChenRui
21
+ * @date 2020/10/12 21:06
22
+ */
23
+ getParamsFromUrl(url: string): Params | undefined;
24
+ /**
25
+ * @description: url地址参数转换成路由参数对象
26
+ * @author ChenRui
27
+ * @date 2020/10/12 21:07
28
+ */
29
+ urlParameterToParams(parameter: string): Params | undefined;
30
+ /**
31
+ * @description: 地址参数拼接
32
+ * @author ChenRui
33
+ * @date 2021/2/19 11:40
34
+ */
35
+ getParameterOfUrl(url: string, parameter?: {
36
+ [key: string]: any;
37
+ }): string;
38
+ }
39
+ declare const routerService: RouterService;
40
+ export { routerService, Params };
@@ -0,0 +1,154 @@
1
+ import { DesFormControl, FormControl, Validate } from "../domain";
2
+ interface Rule {
3
+ ruleType?: any;
4
+ ruleContent?: any;
5
+ describe?: any;
6
+ }
7
+ declare class ValidateGeneratorService {
8
+ /**
9
+ * @description: 填充校验规则
10
+ * @author ChenRui
11
+ * @date 2021/1/27 15:07
12
+ */
13
+ fillCheckRule(formControl: FormControl, controlAttr: DesFormControl): void;
14
+ /**
15
+ * @description: 获取校验规则
16
+ * @author ChenRui
17
+ * @date 2021/7/19 17:55
18
+ */
19
+ getBuiltInValidationRules(item: Rule, controlAttr: DesFormControl): Validate | undefined;
20
+ /**
21
+ * @description: 相同的值
22
+ * @author ChenRui
23
+ * @date 2021/1/27 15:12
24
+ */
25
+ genSameValue(item: Rule): Validate;
26
+ /**
27
+ * @description: 电子邮箱
28
+ * @author ChenRui
29
+ * @date 2021/1/27 15:15
30
+ */
31
+ genMailBox(item: Rule): Validate;
32
+ /**
33
+ * @description: 正则匹配
34
+ * @author ChenRui
35
+ * @date 2021/1/27 15:17
36
+ */
37
+ genRegEx(item: Rule): Validate;
38
+ /**
39
+ * @description: 最小文本长度
40
+ * @author ChenRui
41
+ * @date 2021/1/27 15:18
42
+ */
43
+ genMinTextLength(item: Rule): Validate;
44
+ /**
45
+ * @description: 最大文本长度
46
+ * @author ChenRui
47
+ * @date 2021/1/27 15:21
48
+ */
49
+ genMaxTextLength(item: Rule): Validate;
50
+ /**
51
+ * @description: 最小值
52
+ * @author ChenRui
53
+ * @date 2021/1/27 15:24
54
+ */
55
+ genMinValue(item: Rule): Validate;
56
+ /**
57
+ * @description: 最大值
58
+ * @author ChenRui
59
+ * @date 2021/1/27 15:25
60
+ */
61
+ genMaxValue(item: Rule): Validate;
62
+ /**
63
+ * @description: 指定的值
64
+ * @author ChenRui
65
+ * @date 2021/1/27 15:27
66
+ */
67
+ genSpecifiedValue(item: Rule): Validate;
68
+ /**
69
+ * @description: 指定位数数字
70
+ * @author ChenRui
71
+ * @date 2021/1/27 15:31
72
+ */
73
+ genSpecifiedDigitsNumber(item: Rule): Validate;
74
+ /**
75
+ * @description: 自动补位
76
+ * @author ChenRui
77
+ * @date 2021/1/27 15:59
78
+ */
79
+ roundNumber(number: any, decimals: any): any;
80
+ /**
81
+ * @description: 日期不早于
82
+ * @author ChenRui
83
+ * @date 2021/1/27 16:06
84
+ */
85
+ genDateNotEarlierThan(item: Rule): Validate;
86
+ /**
87
+ * @description: 日期不晚于
88
+ * @author ChenRui
89
+ * @date 2021/1/27 16:08
90
+ */
91
+ genDateNoLaterThan(item: Rule): Validate;
92
+ /**
93
+ * @description: 指定范围的数字
94
+ * @author ChenRui
95
+ * @date 2021/1/27 16:35
96
+ */
97
+ genSpecifiedRangeNumber(item: Rule): Validate;
98
+ /**
99
+ * @description: 手机号
100
+ * @author ChenRui
101
+ * @date 2021/1/27 16:55
102
+ */
103
+ genPhoneNumber(item: Rule): Validate;
104
+ /**
105
+ * @description: 必填
106
+ * @author ChenRui
107
+ * @date 2021/1/27 15:28
108
+ */
109
+ genRequired(item: Rule, controlType: string): Validate;
110
+ /**
111
+ * @description: 唯一行
112
+ * @author ChenRui
113
+ * @date 2021/1/27 17:16
114
+ */
115
+ genLineUnique(item: Rule): Validate;
116
+ /**
117
+ * @description: 仅包含字母空格
118
+ * @author ChenRui
119
+ * @date 2021/1/27 17:21
120
+ */
121
+ genLetterSpace(item: Rule): Validate;
122
+ /**
123
+ * @description: 数字字母下划线
124
+ * @author ChenRui
125
+ * @date 2021/1/27 17:28
126
+ */
127
+ genAlphanumericUnderline(item: Rule): Validate;
128
+ /**
129
+ * @description: 字母数字
130
+ * @author ChenRui
131
+ * @date 2021/1/27 17:32
132
+ */
133
+ genAlphanumeric(item: Rule): Validate;
134
+ /**
135
+ * @description: JS方法校验
136
+ * @author ChenRui
137
+ * @date 2021/1/27 17:42
138
+ */
139
+ genJsMethodVerification(item: Rule): Validate;
140
+ /**
141
+ * @description: 后端校验
142
+ * @author ChenRui
143
+ * @date 2021/1/27 17:43
144
+ */
145
+ genBackEndVerification(item: Rule): Validate;
146
+ /**
147
+ * @description: 座机号校验
148
+ * @author ChenRui
149
+ * @date 2021/4/14 11:40
150
+ */
151
+ genLandlineNumber(item: Rule): Validate;
152
+ }
153
+ declare const validateGeneratorService: ValidateGeneratorService;
154
+ export { Rule, validateGeneratorService };
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @description: 表单版本管理
3
+ * @author ChenRui
4
+ * @date 2020/12/30 11:17
5
+ */
6
+ declare class DictStore {
7
+ private static readonly DICTS;
8
+ private static readonly TREE_DICTS;
9
+ private static readonly MAP_DICTS;
10
+ private static readonly MAP_TREE_DICTS;
11
+ private static readonly VERSION;
12
+ constructor();
13
+ /**常规字典存储*/
14
+ setDicts(nzTreeNodeOptions: any[]): void;
15
+ getDicts(): Promise<any[]>;
16
+ /**树形字典存储*/
17
+ setTreeDicts(nzTreeNodeOptions: any[]): void;
18
+ getTreeDicts(): Promise<any[]>;
19
+ /**map型常规字典存储*/
20
+ setMapDicts(nzTreeNodeOptions: any): void;
21
+ getMapDicts(): Promise<any>;
22
+ /**map型树形字典存储*/
23
+ setMapTreeDicts(nzTreeNodeOptions: any): void;
24
+ getMapTreeDicts(): Promise<any>;
25
+ setVersion(value: string): void;
26
+ getVersion(): Promise<any>;
27
+ }
28
+ declare const dictStore: DictStore;
29
+ export { dictStore };
@@ -0,0 +1,17 @@
1
+ import { DesForm } from "../domain/DesForm";
2
+ /**
3
+ * @description: 表单存储服务
4
+ * @author ChenRui
5
+ * @date 2020/12/30 11:17
6
+ */
7
+ declare class FormStore {
8
+ private static readonly FORMS;
9
+ private static readonly VERSION;
10
+ constructor();
11
+ setForms(desForm: DesForm[]): void;
12
+ getForms(): Promise<DesForm[]>;
13
+ setVersion(value: string): void;
14
+ getVersion(): Promise<any>;
15
+ }
16
+ declare const formStore: FormStore;
17
+ export { formStore };
@@ -0,0 +1,2 @@
1
+ export * from "./form.store";
2
+ export * from "./dict.store";
@@ -0,0 +1,10 @@
1
+ import { FormConfig } from "@/domain";
2
+ import { FormToolsService } from "@/services";
3
+ import { MathJsStatic } from "mathjs";
4
+ declare module "@vue/runtime-core" {
5
+ interface ComponentCustomProperties {
6
+ $qlForm: FormConfig;
7
+ $formToolsService: FormToolsService;
8
+ $mathjs: Partial<MathJsStatic>;
9
+ }
10
+ }
package/vue.config.js ADDED
@@ -0,0 +1,29 @@
1
+ // const path = require("path");
2
+ const webpack = require("webpack");
3
+ // function resolve(dir) {
4
+ // // path.join()方法用于连接路径
5
+ // return path.join(__dirname, dir);
6
+ // }
7
+ // vue.config.js
8
+ module.exports = {
9
+ configureWebpack: {
10
+ plugins: [
11
+ // 忽略 moment.js的所有本地文件
12
+ new webpack.IgnorePlugin(/\.\/locale/, /moment/),
13
+ ],
14
+ resolve: {
15
+ alias: {
16
+ // "@ant-design/icons/lib/dist$": resolve("./src/constants/encode-assets/icons.ts"),
17
+ },
18
+ },
19
+ },
20
+ css: {
21
+ loaderOptions: {
22
+ less: {
23
+ lessOptions: {
24
+ javascriptEnabled: true,
25
+ },
26
+ },
27
+ },
28
+ },
29
+ };