@ebuilding/runtime 2.7.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 (162) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +3 -0
  3. package/comm/default/index.d.ts +1 -0
  4. package/comm/default/src/default/index.d.ts +54 -0
  5. package/comm/default/src/default-list/index.d.ts +17 -0
  6. package/comm/default/src/default-report/index.d.ts +17 -0
  7. package/comm/default/src/default-single/index.d.ts +17 -0
  8. package/comm/default/src/default-tab/index.d.ts +17 -0
  9. package/comm/default/src/index.module.d.ts +13 -0
  10. package/comm/default/src/layout/index.d.ts +25 -0
  11. package/comm/default/src/layout-comm/index.d.ts +19 -0
  12. package/comm/default/src/public_api.d.ts +8 -0
  13. package/comm/form/index.d.ts +1 -0
  14. package/comm/form/src/components/children/index.component.d.ts +30 -0
  15. package/comm/form/src/components/multiple/index.component.d.ts +28 -0
  16. package/comm/form/src/components/single/index.component.d.ts +37 -0
  17. package/comm/form/src/default/index.component.d.ts +47 -0
  18. package/comm/form/src/empinfo/index.component.d.ts +51 -0
  19. package/comm/form/src/index.module.d.ts +13 -0
  20. package/comm/form/src/onlyone/index.component.d.ts +32 -0
  21. package/comm/form/src/public_api.d.ts +8 -0
  22. package/comm/form/src/service/defaultService.d.ts +96 -0
  23. package/comm/form/src/service/empCommService.d.ts +14 -0
  24. package/comm/form/src/service/empGroupService.d.ts +68 -0
  25. package/comm/form/src/service/onlyOneService.d.ts +52 -0
  26. package/comm/form/src/step/index.component.d.ts +46 -0
  27. package/comm/index.d.ts +5 -0
  28. package/comm/list/index.d.ts +1 -0
  29. package/comm/list/src/default/index.component.d.ts +69 -0
  30. package/comm/list/src/index.module.d.ts +7 -0
  31. package/comm/list/src/public_api.d.ts +2 -0
  32. package/comm/list/src/service/listService.d.ts +39 -0
  33. package/comm/page/index.d.ts +1 -0
  34. package/comm/page/src/default/index.component.d.ts +50 -0
  35. package/comm/page/src/index.module.d.ts +9 -0
  36. package/comm/page/src/page-layout/index.component.d.ts +55 -0
  37. package/comm/page/src/page-layout-detail/index.component.d.ts +55 -0
  38. package/comm/page/src/public_api.d.ts +4 -0
  39. package/comm/tree/index.d.ts +1 -0
  40. package/comm/tree/src/components/form-left/index.component.d.ts +21 -0
  41. package/comm/tree/src/components/form-right/index.component.d.ts +43 -0
  42. package/comm/tree/src/components/list-left/index.component.d.ts +21 -0
  43. package/comm/tree/src/components/list-right/index.component.d.ts +36 -0
  44. package/comm/tree/src/index.module.d.ts +12 -0
  45. package/comm/tree/src/public_api.d.ts +7 -0
  46. package/comm/tree/src/service/treeFormService.d.ts +57 -0
  47. package/comm/tree/src/service/treeListService.d.ts +56 -0
  48. package/comm/tree/src/treeForm/index.component.d.ts +25 -0
  49. package/comm/tree/src/treeList/index.component.d.ts +38 -0
  50. package/dynamic/dynamic.module.d.ts +7 -0
  51. package/dynamic/dynamic.view.module.d.ts +7 -0
  52. package/dynamic/index.d.ts +2 -0
  53. package/e-web/deep.module.d.ts +7 -0
  54. package/e-web/extend/index-routing.module.d.ts +7 -0
  55. package/e-web/extend/index.module.d.ts +9 -0
  56. package/e-web/extend/report/index.component.d.ts +16 -0
  57. package/e-web/extend/single/index.component.d.ts +22 -0
  58. package/e-web/form/deep/index.module.d.ts +7 -0
  59. package/e-web/form/deep/main/index.d.ts +34 -0
  60. package/e-web/form/default/index.module.d.ts +7 -0
  61. package/e-web/form/default/main/index.d.ts +32 -0
  62. package/e-web/form/index.module.d.ts +7 -0
  63. package/e-web/index.d.ts +1 -0
  64. package/e-web/index.module.d.ts +7 -0
  65. package/e-web/list/deep/index.module.d.ts +7 -0
  66. package/e-web/list/deep/main/index.d.ts +18 -0
  67. package/e-web/list/default/index.module.d.ts +7 -0
  68. package/e-web/list/default/main/index.d.ts +31 -0
  69. package/e-web/list/index.module.d.ts +7 -0
  70. package/e-web/list/new/index.module.d.ts +7 -0
  71. package/e-web/list/new/main/index.d.ts +16 -0
  72. package/e-web/report/deep/index.module.d.ts +7 -0
  73. package/e-web/report/deep/main/index.d.ts +18 -0
  74. package/e-web/report/default/index.module.d.ts +7 -0
  75. package/e-web/report/default/main/index.d.ts +17 -0
  76. package/e-web/report/index.module.d.ts +7 -0
  77. package/e-web/report/new/index.module.d.ts +7 -0
  78. package/e-web/report/new/main/index.d.ts +16 -0
  79. package/e-web/single/deep/index.module.d.ts +7 -0
  80. package/e-web/single/deep/main/index.d.ts +18 -0
  81. package/e-web/single/default/index.module.d.ts +7 -0
  82. package/e-web/single/default/main/index.d.ts +16 -0
  83. package/e-web/single/index.module.d.ts +7 -0
  84. package/e-web/single/new/index.module.d.ts +7 -0
  85. package/e-web/single/new/main/index.d.ts +16 -0
  86. package/e-web/tab/detail/index.component.d.ts +32 -0
  87. package/e-web/tab/index-routing.module.d.ts +7 -0
  88. package/e-web/tab/index.module.d.ts +9 -0
  89. package/e-web/tab/main/index.component.d.ts +34 -0
  90. package/e-web/tree/index-routing.module.d.ts +7 -0
  91. package/e-web/tree/index.module.d.ts +9 -0
  92. package/e-web/tree/tree-form/index.component.d.ts +31 -0
  93. package/e-web/tree/tree-list/index.component.d.ts +31 -0
  94. package/external/external-routing.module.d.ts +7 -0
  95. package/external/external.module.d.ts +8 -0
  96. package/external/index.d.ts +4 -0
  97. package/external/main/index.d.ts +12 -0
  98. package/external/safeUrl.d.ts +10 -0
  99. package/fesm2022/comm.default.mjs +487 -0
  100. package/fesm2022/comm.default.mjs.map +1 -0
  101. package/fesm2022/comm.form.mjs +1685 -0
  102. package/fesm2022/comm.form.mjs.map +1 -0
  103. package/fesm2022/comm.list.mjs +605 -0
  104. package/fesm2022/comm.list.mjs.map +1 -0
  105. package/fesm2022/comm.mjs +10 -0
  106. package/fesm2022/comm.mjs.map +1 -0
  107. package/fesm2022/comm.page.mjs +354 -0
  108. package/fesm2022/comm.page.mjs.map +1 -0
  109. package/fesm2022/comm.tree.mjs +841 -0
  110. package/fesm2022/comm.tree.mjs.map +1 -0
  111. package/fesm2022/dynamic.mjs +49 -0
  112. package/fesm2022/dynamic.mjs.map +1 -0
  113. package/fesm2022/e-web-deep.module-CbGhHXVH.mjs +34 -0
  114. package/fesm2022/e-web-deep.module-CbGhHXVH.mjs.map +1 -0
  115. package/fesm2022/e-web-index.module-B_Jd2-0M.mjs +30 -0
  116. package/fesm2022/e-web-index.module-B_Jd2-0M.mjs.map +1 -0
  117. package/fesm2022/e-web-index.module-Bfxv6KPY.mjs +263 -0
  118. package/fesm2022/e-web-index.module-Bfxv6KPY.mjs.map +1 -0
  119. package/fesm2022/e-web-index.module-C0vAaHfh.mjs +84 -0
  120. package/fesm2022/e-web-index.module-C0vAaHfh.mjs.map +1 -0
  121. package/fesm2022/e-web-index.module-C7-Zm8xS.mjs +94 -0
  122. package/fesm2022/e-web-index.module-C7-Zm8xS.mjs.map +1 -0
  123. package/fesm2022/e-web-index.module-CYZiqC3a.mjs +110 -0
  124. package/fesm2022/e-web-index.module-CYZiqC3a.mjs.map +1 -0
  125. package/fesm2022/e-web-index.module-CfC5tqAw.mjs +85 -0
  126. package/fesm2022/e-web-index.module-CfC5tqAw.mjs.map +1 -0
  127. package/fesm2022/e-web-index.module-CjF6piLu.mjs +81 -0
  128. package/fesm2022/e-web-index.module-CjF6piLu.mjs.map +1 -0
  129. package/fesm2022/e-web-index.module-CuEiH_fT.mjs +180 -0
  130. package/fesm2022/e-web-index.module-CuEiH_fT.mjs.map +1 -0
  131. package/fesm2022/e-web-index.module-D43xvefy.mjs +101 -0
  132. package/fesm2022/e-web-index.module-D43xvefy.mjs.map +1 -0
  133. package/fesm2022/e-web-index.module-DQmv68kB.mjs +84 -0
  134. package/fesm2022/e-web-index.module-DQmv68kB.mjs.map +1 -0
  135. package/fesm2022/e-web-index.module-DVJ8MkSd.mjs +86 -0
  136. package/fesm2022/e-web-index.module-DVJ8MkSd.mjs.map +1 -0
  137. package/fesm2022/e-web-index.module-DqW1Wt0J.mjs +157 -0
  138. package/fesm2022/e-web-index.module-DqW1Wt0J.mjs.map +1 -0
  139. package/fesm2022/e-web-index.module-Ds5GBsXm.mjs +106 -0
  140. package/fesm2022/e-web-index.module-Ds5GBsXm.mjs.map +1 -0
  141. package/fesm2022/e-web-index.module-H56VTQVA.mjs +46 -0
  142. package/fesm2022/e-web-index.module-H56VTQVA.mjs.map +1 -0
  143. package/fesm2022/e-web-index.module-cGZ2yMVA.mjs +93 -0
  144. package/fesm2022/e-web-index.module-cGZ2yMVA.mjs.map +1 -0
  145. package/fesm2022/e-web-index.module-cKHBIc7d.mjs +30 -0
  146. package/fesm2022/e-web-index.module-cKHBIc7d.mjs.map +1 -0
  147. package/fesm2022/e-web-index.module-mKAgb87G.mjs +104 -0
  148. package/fesm2022/e-web-index.module-mKAgb87G.mjs.map +1 -0
  149. package/fesm2022/e-web-index.module-qHmobPhQ.mjs +30 -0
  150. package/fesm2022/e-web-index.module-qHmobPhQ.mjs.map +1 -0
  151. package/fesm2022/e-web.mjs +54 -0
  152. package/fesm2022/e-web.mjs.map +1 -0
  153. package/fesm2022/ebuilding-runtime.mjs +8 -0
  154. package/fesm2022/ebuilding-runtime.mjs.map +1 -0
  155. package/fesm2022/external.mjs +86 -0
  156. package/fesm2022/external.mjs.map +1 -0
  157. package/fesm2022/shared-imports.mjs +358 -0
  158. package/fesm2022/shared-imports.mjs.map +1 -0
  159. package/index.d.ts +1 -0
  160. package/package.json +64 -0
  161. package/shared-imports/form-submit-touch.directive.d.ts +9 -0
  162. package/shared-imports/index.d.ts +63 -0
@@ -0,0 +1,1685 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, Output, Input, Directive, Component, SimpleChange, Injectable, HostListener, NgModule } from '@angular/core';
3
+ import * as i5 from '@ebuilding/base/shared.srv/global.event';
4
+ import { GramGlobalService } from '@ebuilding/base/shared.srv/global.event';
5
+ import * as i7 from '@ebuilding/base/shared.srv/commApi.service';
6
+ import { CommAPIService } from '@ebuilding/base/shared.srv/commApi.service';
7
+ import * as _ from 'lodash';
8
+ import * as i8 from '@angular/forms';
9
+ import { FormGroup } from '@angular/forms';
10
+ import { ModuleAPI, ArgType } from '@ebuilding/base/shared.var/shared.constant';
11
+ import { Subject, of, zip } from 'rxjs';
12
+ import * as i1 from '@delon/theme';
13
+ import * as i2 from '@ebuilding/base/shared.srv/deon.util';
14
+ import * as i4 from '@ebuilding-form/core';
15
+ import { FormlyModule } from '@ebuilding-form/core';
16
+ import * as i6 from 'ng-zorro-antd/message';
17
+ import * as i3 from '@ebuilding/base/shared.srv/deon2.util';
18
+ import * as i9$1 from '@ebuilding/runtime/shared-imports';
19
+ import { RuntimeSharedImportsModule } from '@ebuilding/runtime/shared-imports';
20
+ import * as i17 from '@ebuilding/biz-comm/other/card';
21
+ import { CardContentModule } from '@ebuilding/biz-comm/other/card';
22
+ import { GramDeonAntdModule } from '@ebuilding/biz-comm/type';
23
+ import * as i9 from '@angular/common';
24
+ import * as i10 from 'ng-zorro-antd/button';
25
+ import * as i11 from 'ng-zorro-antd/core/transition-patch';
26
+ import * as i12 from 'ng-zorro-antd/core/wave';
27
+ import * as i13 from 'ng-zorro-antd/icon';
28
+ import * as i14 from 'ng-zorro-antd/spin';
29
+ import * as i16 from 'ng-zorro-antd/empty';
30
+ import * as i1$1 from '@angular/router';
31
+ import * as i3$1 from 'ng-zorro-antd/modal';
32
+ import * as i16$1 from 'ng-zorro-antd/tabs';
33
+
34
+ class FormDefaultService {
35
+ http;
36
+ utilService;
37
+ deonFormBuilder;
38
+ globalSrv;
39
+ msg;
40
+ commAPISrv;
41
+ resetService;
42
+ _config = null;
43
+ pageConfig = null;
44
+ loading = true;
45
+ headerLoading = true;
46
+ form = new FormGroup({});
47
+ model = {};
48
+ options = {};
49
+ fields = [];
50
+ /**
51
+ * 表单设计数据
52
+ */
53
+ designBasic = null;
54
+ /**
55
+ * 配置参数
56
+ */
57
+ argList = [];
58
+ /**
59
+ * 销毁
60
+ */
61
+ onDestroy$ = new Subject();
62
+ /**
63
+ * 数据ID
64
+ */
65
+ dataId = null;
66
+ /**
67
+ * 表单设计ID
68
+ */
69
+ formId = null;
70
+ throwField = {};
71
+ throwData = {};
72
+ set config(value) { }
73
+ get config() {
74
+ return null;
75
+ }
76
+ /**
77
+ * 是否有数据提交前按钮事件
78
+ */
79
+ preEventRule = false;
80
+ /**
81
+ * 值发生变化调用抛出
82
+ */
83
+ modelThrowEvent = new EventEmitter();
84
+ /**
85
+ * 加载后抛出事件
86
+ */
87
+ modelLoadEvent = new EventEmitter();
88
+ /**
89
+ * 保存后抛出事件
90
+ */
91
+ bttonSaveEvent = new EventEmitter();
92
+ constructor(http, utilService, deonFormBuilder, globalSrv, msg, commAPISrv, resetService) {
93
+ this.http = http;
94
+ this.utilService = utilService;
95
+ this.deonFormBuilder = deonFormBuilder;
96
+ this.globalSrv = globalSrv;
97
+ this.msg = msg;
98
+ this.commAPISrv = commAPISrv;
99
+ this.resetService = resetService;
100
+ this.globalSrv.subscribe('deon-field-repeat', (res) => {
101
+ if (res != undefined && res.field != undefined && res.data != undefined && res.type != undefined) {
102
+ if (res.type == 'delete') {
103
+ this.fields = [...this.fields];
104
+ }
105
+ }
106
+ });
107
+ }
108
+ ngOnDestroy() {
109
+ this.onDestroy$.next();
110
+ this.onDestroy$.complete();
111
+ }
112
+ /*
113
+ 获取设计
114
+ */
115
+ getDesign() {
116
+ let apiName = this.commAPISrv.getFormDesign(this.pageConfig.moduleCode, this.pageConfig.formId);
117
+ return this.http.post(`${apiName}`);
118
+ }
119
+ /*
120
+ 获取角色
121
+ */
122
+ getRole() {
123
+ let params = {
124
+ formId: this.pageConfig.formId,
125
+ type: this.pageConfig.type,
126
+ };
127
+ let apiName = this.commAPISrv.getFormRole(this.pageConfig.moduleCode);
128
+ return this.http.post(`${apiName}`, params);
129
+ }
130
+ /*
131
+ 获取配置-下拉选项
132
+ */
133
+ getDropDown() {
134
+ let apiName = this.commAPISrv.getFormDropDown(this.pageConfig.moduleCode, this.pageConfig.formId);
135
+ return this.http.post(`${apiName}`);
136
+ }
137
+ /*
138
+ 获取配置-表单数据
139
+ */
140
+ getFromModel() {
141
+ let params = {
142
+ formId: this.pageConfig.formId,
143
+ id: this.pageConfig.id,
144
+ };
145
+ if (this.pageConfig.relationId) {
146
+ params['id'] = this.pageConfig.relationId;
147
+ }
148
+ if (this.pageConfig.type != 'ADD' && (this.pageConfig.id || this.pageConfig.relationId)) {
149
+ let apiName = null;
150
+ if (this.pageConfig.api && this.pageConfig.api.modelAPI) {
151
+ apiName = this.pageConfig.api.modelAPI;
152
+ }
153
+ else {
154
+ apiName = this.commAPISrv.getFormModel(this.pageConfig.moduleCode);
155
+ }
156
+ return this.http.post(`${apiName}`, params);
157
+ }
158
+ else {
159
+ return of(null);
160
+ }
161
+ }
162
+ /*
163
+ 获取配置-表单默认值
164
+ */
165
+ getFromDefaultModel() {
166
+ if (this.pageConfig.type == 'ADD' && this.pageConfig.formId) {
167
+ let apiName = null;
168
+ if (this.pageConfig.api && this.pageConfig.api.modelDefaultAPI) {
169
+ apiName = this.pageConfig.api.modelDefaultAPI;
170
+ }
171
+ else {
172
+ apiName = this.commAPISrv.getFormDefaultModel(this.pageConfig.moduleCode);
173
+ }
174
+ return this.http.post(`${apiName}/${this.pageConfig.formId}`);
175
+ }
176
+ else {
177
+ return of(null);
178
+ }
179
+ }
180
+ /**
181
+ * 获取配置-表单规则
182
+ * @returns
183
+ */
184
+ getFromRuleData() {
185
+ if (this.config.formId) {
186
+ return this.http.post(`${ModuleAPI.rule}/rule/form/listByForm/${this.config.formId}`);
187
+ }
188
+ else {
189
+ return of(null);
190
+ }
191
+ }
192
+ /**
193
+ * 获取默认参数
194
+ */
195
+ getFromArgInfo() {
196
+ if (this.argList && Array.isArray(this.argList) && this.argList.length > 0) {
197
+ this.argList.forEach((item) => {
198
+ switch (item.argType) {
199
+ case ArgType.arg1:
200
+ if (this.pageConfig?.argInfo && item.argFieldId && item.argName && this.pageConfig.argInfo[item.argName]) {
201
+ this.model[item.argFieldId] = this.pageConfig?.argInfo[item.argName];
202
+ }
203
+ break;
204
+ case ArgType.arg2:
205
+ if (item.argFieldId) {
206
+ this.throwField[item.argFieldId] = item.argName;
207
+ }
208
+ break;
209
+ }
210
+ });
211
+ }
212
+ }
213
+ /**
214
+ * 组装配置
215
+ */
216
+ getPageConfig() {
217
+ new Promise((resolve) => {
218
+ zip(this.getDesign(), this.getRole(), this.getDropDown(), this.getFromModel(), this.getFromDefaultModel(), this.getFromRuleData()).subscribe(([design, role, drop, d, m, r]) => {
219
+ this.model = {};
220
+ //传入的值
221
+ if (this.pageConfig.model != undefined && this.pageConfig.model != null) {
222
+ this.model = Object.assign(this.model, this.pageConfig.model);
223
+ }
224
+ if (design.success && design.result) {
225
+ this.designBasic = design.result?.basic;
226
+ }
227
+ if (this.designBasic && _.get(this.designBasic, 'json')) {
228
+ /**
229
+ * 配置参数
230
+ */
231
+ if (_.get(design, 'result.listArg') && Array.isArray(_.get(design, 'result.listArg'))) {
232
+ this.argList = _.get(design, 'result.listArg');
233
+ }
234
+ this.getFromArgInfo();
235
+ /**
236
+ * 判断是否有提交前事件
237
+ */
238
+ if (_.get(design, 'result.preEventRule') == true) {
239
+ this.preEventRule = true;
240
+ }
241
+ /**
242
+ * 表单JSON
243
+ */
244
+ let fieldConfigs = JSON.parse(_.get(design, 'result.basic.json'));
245
+ let fieldRole = {};
246
+ let fieldOptions = {};
247
+ let fieldRule = null;
248
+ //字段权限
249
+ if (role.success == true && role.result) {
250
+ fieldRole = role.result;
251
+ }
252
+ //字段Options
253
+ if (drop.success == true && drop.result) {
254
+ fieldOptions = drop.result;
255
+ }
256
+ //填充值
257
+ if (d && d.success == true && d.result) {
258
+ this.model = Object.assign(this.model, d.result);
259
+ }
260
+ //权重值
261
+ if (this.pageConfig.weightModel != undefined && this.pageConfig.weightModel != null) {
262
+ this.model = Object.assign(this.model, this.pageConfig.weightModel);
263
+ }
264
+ //获取的表单值
265
+ if (m && m.success == true && m.result) {
266
+ this.model = Object.assign(this.model, m.result);
267
+ }
268
+ if (r && r.success == true && r.result) {
269
+ fieldRule = r.result;
270
+ }
271
+ let defaultRole = null;
272
+ if (this.config && this.config.isView != undefined && this.config.isView != null && this.config.isView == true) {
273
+ defaultRole = {
274
+ read: true,
275
+ };
276
+ }
277
+ this.utilService.initConfig(fieldConfigs, fieldRole, fieldOptions, this.model, fieldRule, null, this, (e, field) => {
278
+ this.getPageRuleData(field, e);
279
+ });
280
+ this.fields = fieldConfigs;
281
+ setTimeout(() => {
282
+ if (this.options != undefined && this.options != null && this.options?.resetModel) {
283
+ this.options?.resetModel();
284
+ }
285
+ }, 0);
286
+ }
287
+ this.formDataLoadAfter();
288
+ this.loading = false;
289
+ }, () => {
290
+ this.loading = false;
291
+ }, () => {
292
+ this.loading = false;
293
+ resolve();
294
+ });
295
+ });
296
+ }
297
+ getPageRuleData(field, value) {
298
+ this.loading = true;
299
+ let postData = {};
300
+ let props = field.props;
301
+ if (props) {
302
+ if (field.props?.["callBackFields"] && Array.isArray(field.props?.["callBackFields"])) {
303
+ field.props?.["callBackFields"].forEach((a) => {
304
+ if (this.model && this.model[a] != undefined) {
305
+ postData[a] = {
306
+ key: a,
307
+ value: this.model[a]
308
+ };
309
+ }
310
+ });
311
+ }
312
+ if (props["arrKey"]) {
313
+ /**
314
+ * 数组内部组件触发
315
+ */
316
+ let findModel = this.model[props.arrKey];
317
+ let createModel = [];
318
+ if (findModel && Array.isArray(findModel)) {
319
+ findModel.forEach((a) => {
320
+ if (a) {
321
+ let tmp = {};
322
+ Object.keys(a).forEach((b) => {
323
+ tmp[b] = {
324
+ key: b,
325
+ value: a[b]
326
+ };
327
+ });
328
+ createModel.push(tmp);
329
+ }
330
+ });
331
+ }
332
+ postData[props.arrKey] = {
333
+ key: props.arrKey,
334
+ value: createModel
335
+ };
336
+ }
337
+ else {
338
+ /**
339
+ * 非数组内部触发
340
+ */
341
+ postData[field.key] = {
342
+ key: field.key,
343
+ value: value
344
+ };
345
+ }
346
+ this.http.post(`${ModuleAPI.rule}/rule/run/formRule`, {
347
+ ruleId: field.props?.["callBackRule"],
348
+ modelJson: postData
349
+ }).subscribe((res) => {
350
+ if (res && res?.success && res?.result) {
351
+ this.resetService.resetConfig(this.fields, this.model, res.result);
352
+ //(<any>this.options)._buildForm(true);
353
+ }
354
+ this.loading = false;
355
+ }, (res) => {
356
+ this.loading = false;
357
+ });
358
+ }
359
+ }
360
+ formModelChange(e, field) {
361
+ if (this.model && field.key) {
362
+ let key = field.key;
363
+ if (this.throwField && this.throwField.hasOwnProperty(key)) {
364
+ /**
365
+ * 触发表单外部
366
+ */
367
+ let value = this.throwField[key];
368
+ if (value != undefined && value != null) {
369
+ this.throwData = {};
370
+ Object.keys(this.throwField).forEach((k) => {
371
+ this.throwData[value] = this.model[k];
372
+ });
373
+ }
374
+ this.modelThrowDataBefore();
375
+ /**
376
+ * 事件抛出
377
+ */
378
+ this.modelThrowEvent.emit(this.throwField);
379
+ }
380
+ else {
381
+ /**
382
+ * 常规触发
383
+ */
384
+ }
385
+ }
386
+ }
387
+ save() {
388
+ if (!this.form.valid) {
389
+ return;
390
+ }
391
+ this.loading = true;
392
+ let apiName = null;
393
+ if (this.pageConfig.type == 'ADD') {
394
+ if (this.pageConfig.api && this.pageConfig.api.addAPI) {
395
+ apiName = this.pageConfig.api.addAPI;
396
+ }
397
+ else {
398
+ apiName = this.commAPISrv.getFormAdd(this.pageConfig.moduleCode);
399
+ }
400
+ }
401
+ else if (this.pageConfig.type == 'EDIT') {
402
+ if (this.pageConfig.api && this.pageConfig.api.editAPI) {
403
+ apiName = this.pageConfig.api.editAPI;
404
+ }
405
+ else {
406
+ apiName = this.commAPISrv.getFormUpdate(this.pageConfig.moduleCode);
407
+ }
408
+ }
409
+ this.http
410
+ .post(`${apiName}`, {
411
+ id: this.pageConfig.id,
412
+ formId: this.pageConfig.formId,
413
+ modelJson: this.model,
414
+ })
415
+ .subscribe((res) => {
416
+ this.loading = false;
417
+ if (res && res.success == true) {
418
+ this.msg.success('保存成功!');
419
+ if (this.pageConfig.type == 'ADD') {
420
+ this.pageConfig.type = 'EDIT';
421
+ this.pageConfig.id = res.result;
422
+ }
423
+ this.bttonSaveEvent.emit(res.result);
424
+ }
425
+ }, () => {
426
+ this.loading = false;
427
+ });
428
+ }
429
+ btnClose() {
430
+ if (this.options != undefined && this.options != null && this.options?.resetModel) {
431
+ this.options?.resetModel();
432
+ }
433
+ }
434
+ formDataLoadAfter() { }
435
+ modelThrowDataBefore() { }
436
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FormDefaultService, deps: [{ token: i1._HttpClient }, { token: i2.DeonFormUtilService }, { token: i4.FormlyFormBuilder }, { token: i5.GramGlobalService }, { token: i6.NzMessageService }, { token: i7.CommAPIService }, { token: i3.DeonFormResetService }], target: i0.ɵɵFactoryTarget.Directive });
437
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: FormDefaultService, isStandalone: true, inputs: { config: "config" }, outputs: { modelThrowEvent: "modelThrowEvent", modelLoadEvent: "modelLoadEvent", bttonSaveEvent: "bttonSaveEvent" }, ngImport: i0 });
438
+ }
439
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FormDefaultService, decorators: [{
440
+ type: Directive
441
+ }], ctorParameters: () => [{ type: i1._HttpClient }, { type: i2.DeonFormUtilService }, { type: i4.FormlyFormBuilder }, { type: i5.GramGlobalService }, { type: i6.NzMessageService }, { type: i7.CommAPIService }, { type: i3.DeonFormResetService }], propDecorators: { config: [{
442
+ type: Input
443
+ }], modelThrowEvent: [{
444
+ type: Output
445
+ }], modelLoadEvent: [{
446
+ type: Output
447
+ }], bttonSaveEvent: [{
448
+ type: Output
449
+ }] } });
450
+
451
+ /**
452
+ * 常规表单 - 新增、编辑、查�? */
453
+ class CommFormMainComponent extends FormDefaultService {
454
+ http;
455
+ utilService;
456
+ resetService;
457
+ deonFormBuilder;
458
+ globalSrv;
459
+ msg;
460
+ commAPISrv;
461
+ _config = null;
462
+ /**
463
+ * 默认配置
464
+ */
465
+ headerDefaultConfig = null;
466
+ /**
467
+ * 动态配�? */
468
+ headerDynamicConfig = null;
469
+ /**
470
+ * formId
471
+ * formType
472
+ * moduleCode
473
+ */
474
+ set config(value) {
475
+ this._config = value;
476
+ if (value && value.id) {
477
+ this.dataId = value.id;
478
+ }
479
+ if (value && value.formId) {
480
+ this.formId = value.formId;
481
+ }
482
+ this.getPageData();
483
+ }
484
+ get config() {
485
+ return this._config;
486
+ }
487
+ setpInfo = null;
488
+ constructor(http, utilService, resetService, deonFormBuilder, globalSrv, msg, commAPISrv) {
489
+ super(http, utilService, deonFormBuilder, globalSrv, msg, commAPISrv, resetService);
490
+ this.http = http;
491
+ this.utilService = utilService;
492
+ this.resetService = resetService;
493
+ this.deonFormBuilder = deonFormBuilder;
494
+ this.globalSrv = globalSrv;
495
+ this.msg = msg;
496
+ this.commAPISrv = commAPISrv;
497
+ }
498
+ ngOnInit() { }
499
+ ngOnChanges(changes) { }
500
+ ngOnDestroy() { }
501
+ getPageData() {
502
+ this.pageConfig = {
503
+ type: this.config.formType,
504
+ id: this.dataId,
505
+ formId: this.formId,
506
+ moduleCode: this.config.moduleCode,
507
+ api: this.config?.api,
508
+ argInfo: null,
509
+ model: this.config?.model,
510
+ weightModel: this.config?.weightModel,
511
+ hideButton: this.config?.hideButton == true ? true : false
512
+ };
513
+ if (this.config.argInfo) {
514
+ this.pageConfig.argInfo = _.cloneDeep(this.config.argInfo);
515
+ }
516
+ this.getPageConfig();
517
+ }
518
+ headerDataLoadAfter(e) {
519
+ this.headerLoading = false;
520
+ }
521
+ formDataLoadAfter() {
522
+ this.headerDefaultConfig = null;
523
+ if (this.designBasic && this.designBasic?.izHeader == true) {
524
+ this.headerDefaultConfig = {
525
+ headerId: this.designBasic.headerId,
526
+ id: this.config.id,
527
+ rd: Math.random(),
528
+ };
529
+ }
530
+ else {
531
+ this.headerLoading = false;
532
+ }
533
+ this.modelLoadEvent.emit(this.model);
534
+ }
535
+ modelThrowDataBefore() {
536
+ this.headerDynamicConfig = null;
537
+ if (this.throwData) {
538
+ let exist = false;
539
+ Object.keys(this.throwData).forEach((key) => {
540
+ if (this.throwData[key] != undefined && this.throwData[key] != null) {
541
+ exist = true;
542
+ }
543
+ });
544
+ if (exist) {
545
+ if (this.designBasic?.izHeader == true) {
546
+ this.headerDynamicConfig = { headerId: this.designBasic.headerId, model: this.throwData, rd: Math.random() };
547
+ }
548
+ else {
549
+ this.headerLoading = false;
550
+ }
551
+ }
552
+ }
553
+ }
554
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CommFormMainComponent, deps: [{ token: i1._HttpClient }, { token: i2.DeonFormUtilService }, { token: i3.DeonFormResetService }, { token: i4.FormlyFormBuilder }, { token: i5.GramGlobalService }, { token: i6.NzMessageService }, { token: i7.CommAPIService }], target: i0.ɵɵFactoryTarget.Component });
555
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: CommFormMainComponent, isStandalone: true, selector: "comm-form", inputs: { config: "config", setpInfo: "setpInfo" }, providers: [GramGlobalService, CommAPIService], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<nz-spin [nzSpinning]=\"loading == true || headerLoading == true\" nzTip=\"\u62FC\u547D\u52A0\u8F7D\u4E2D...\" class=\"deon-list-spin\">\n <ng-container *ngIf=\"pageConfig!!\">\n <div class=\"form-header\"\n *ngIf=\"designBasic!! && designBasic?.izHeader == true && (headerDefaultConfig!! || headerDynamicConfig!!)\">\n <card-main [defaultConfig]=\"headerDefaultConfig\" [dynamicConfig]=\"headerDynamicConfig\"\n (pageLoadAfter)=\"headerDataLoadAfter($event)\"></card-main>\n </div>\n <div class=\"form-info\">\n <form [formGroup]=\"form\" (ngSubmit)=\"save()\" #defaultForm>\n <div class=\"deon-from\">\n <ng-container *ngIf=\"fields && fields.length > 0; else emptyPage\">\n <formly-form [model]=\"model\" [fields]=\"fields\" [options]=\"options\" [form]=\"form\"> </formly-form>\n </ng-container>\n <ng-template #emptyPage>\n <nz-empty *ngIf=\"loading !== true\"></nz-empty>\n </ng-template>\n </div>\n <ng-content select=\"[name=deon-content]\"></ng-content>\n <div class=\"deon-button\" *ngIf=\"pageConfig.hideButton!=true\">\n <div class=\"bottom-left\">\n <ng-content></ng-content>\n </div>\n <ng-content select=\"[name=bottom-left]\"></ng-content>\n <div class=\"bottom-right\" *ngIf=\"pageConfig.type != 'VIEW' && pageConfig.type != 'PREVIEW'\">\n <button nz-button nzType=\"default\" (click)=\"btnClose()\" type=\"button\"><i nz-icon\n nzType=\"reload\"></i>\u91CD\u7F6E</button>\n <!-- <button nz-button nzType=\"primary\" id=\"DRAFT\" *ngIf=\"draft == true\"><i nz-icon\n nzType=\"hourglass\"></i>\u6682\u5B58</button> -->\n <button nz-button nzType=\"primary\" id=\"SAVE\"><i nz-icon nzType=\"save\"></i>\u4FDD\u5B58</button>\n </div>\n <ng-content select=\"[name=bottom-right]\"></ng-content>\n </div>\n </form>\n </div>\n </ng-container>\n</nz-spin>", styles: [":host ::ng-deep{display:flex;flex:1;flex-direction:column;width:100%;height:100%}:host ::ng-deep .form-info{display:flex;flex:1}:host ::ng-deep form{display:flex;flex:1;flex-direction:column;height:100%;overflow:hidden}:host ::ng-deep form .deon-button{display:flex;height:55px;padding:0 15px}:host ::ng-deep form .deon-button .bottom-left{flex:1;text-align:left}\n"], dependencies: [{ kind: "ngmodule", type: RuntimeSharedImportsModule }, { kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i8.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i8.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i9$1.FormSubmitTouchDirective, selector: "form[formGroup]" }, { kind: "component", type: i10.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i11.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i12.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }, { kind: "directive", type: i13.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "component", type: i14.NzSpinComponent, selector: "nz-spin", inputs: ["nzIndicator", "nzSize", "nzTip", "nzDelay", "nzSimple", "nzSpinning"], exportAs: ["nzSpin"] }, { kind: "component", type: i16.NzEmptyComponent, selector: "nz-empty", inputs: ["nzNotFoundImage", "nzNotFoundContent", "nzNotFoundFooter"], exportAs: ["nzEmpty"] }, { kind: "ngmodule", type: FormlyModule }, { kind: "component", type: i4.LegacyFormlyForm, selector: "formly-form" }, { kind: "ngmodule", type: GramDeonAntdModule }, { kind: "ngmodule", type: CardContentModule }, { kind: "component", type: i17.CardMainComponent, selector: "card-main", inputs: ["dynamicConfig", "defaultConfig", "defaultData"], outputs: ["pageLoadAfter"] }] });
556
+ }
557
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CommFormMainComponent, decorators: [{
558
+ type: Component,
559
+ args: [{ selector: 'comm-form', providers: [GramGlobalService, CommAPIService], imports: [
560
+ RuntimeSharedImportsModule,
561
+ FormlyModule,
562
+ GramDeonAntdModule,
563
+ CardContentModule
564
+ ], template: "<nz-spin [nzSpinning]=\"loading == true || headerLoading == true\" nzTip=\"\u62FC\u547D\u52A0\u8F7D\u4E2D...\" class=\"deon-list-spin\">\n <ng-container *ngIf=\"pageConfig!!\">\n <div class=\"form-header\"\n *ngIf=\"designBasic!! && designBasic?.izHeader == true && (headerDefaultConfig!! || headerDynamicConfig!!)\">\n <card-main [defaultConfig]=\"headerDefaultConfig\" [dynamicConfig]=\"headerDynamicConfig\"\n (pageLoadAfter)=\"headerDataLoadAfter($event)\"></card-main>\n </div>\n <div class=\"form-info\">\n <form [formGroup]=\"form\" (ngSubmit)=\"save()\" #defaultForm>\n <div class=\"deon-from\">\n <ng-container *ngIf=\"fields && fields.length > 0; else emptyPage\">\n <formly-form [model]=\"model\" [fields]=\"fields\" [options]=\"options\" [form]=\"form\"> </formly-form>\n </ng-container>\n <ng-template #emptyPage>\n <nz-empty *ngIf=\"loading !== true\"></nz-empty>\n </ng-template>\n </div>\n <ng-content select=\"[name=deon-content]\"></ng-content>\n <div class=\"deon-button\" *ngIf=\"pageConfig.hideButton!=true\">\n <div class=\"bottom-left\">\n <ng-content></ng-content>\n </div>\n <ng-content select=\"[name=bottom-left]\"></ng-content>\n <div class=\"bottom-right\" *ngIf=\"pageConfig.type != 'VIEW' && pageConfig.type != 'PREVIEW'\">\n <button nz-button nzType=\"default\" (click)=\"btnClose()\" type=\"button\"><i nz-icon\n nzType=\"reload\"></i>\u91CD\u7F6E</button>\n <!-- <button nz-button nzType=\"primary\" id=\"DRAFT\" *ngIf=\"draft == true\"><i nz-icon\n nzType=\"hourglass\"></i>\u6682\u5B58</button> -->\n <button nz-button nzType=\"primary\" id=\"SAVE\"><i nz-icon nzType=\"save\"></i>\u4FDD\u5B58</button>\n </div>\n <ng-content select=\"[name=bottom-right]\"></ng-content>\n </div>\n </form>\n </div>\n </ng-container>\n</nz-spin>", styles: [":host ::ng-deep{display:flex;flex:1;flex-direction:column;width:100%;height:100%}:host ::ng-deep .form-info{display:flex;flex:1}:host ::ng-deep form{display:flex;flex:1;flex-direction:column;height:100%;overflow:hidden}:host ::ng-deep form .deon-button{display:flex;height:55px;padding:0 15px}:host ::ng-deep form .deon-button .bottom-left{flex:1;text-align:left}\n"] }]
565
+ }], ctorParameters: () => [{ type: i1._HttpClient }, { type: i2.DeonFormUtilService }, { type: i3.DeonFormResetService }, { type: i4.FormlyFormBuilder }, { type: i5.GramGlobalService }, { type: i6.NzMessageService }, { type: i7.CommAPIService }], propDecorators: { config: [{
566
+ type: Input
567
+ }], setpInfo: [{
568
+ type: Input
569
+ }] } });
570
+
571
+ class OnlyOneService {
572
+ router;
573
+ http;
574
+ modal;
575
+ msg;
576
+ utilService;
577
+ commApiSrv;
578
+ _config = null;
579
+ loading = true;
580
+ form = new FormGroup({});
581
+ //model: any = {};
582
+ options = {};
583
+ fields = [];
584
+ set config(value) {
585
+ if (value) {
586
+ if (value.model == undefined || value.model == null) {
587
+ value.model = {};
588
+ }
589
+ this._config = value;
590
+ this.getPageConfig();
591
+ }
592
+ }
593
+ get config() {
594
+ return this._config;
595
+ }
596
+ setpInfo = null;
597
+ /**
598
+ * 值发生变化调用抛出
599
+ */
600
+ modelThrowEvent = new EventEmitter();
601
+ pageLoadAfter = new EventEmitter();
602
+ constructor(router, http, modal, msg, utilService, commApiSrv) {
603
+ this.router = router;
604
+ this.http = http;
605
+ this.modal = modal;
606
+ this.msg = msg;
607
+ this.utilService = utilService;
608
+ this.commApiSrv = commApiSrv;
609
+ }
610
+ ngOnChanges(changes) {
611
+ if (SimpleChange['formData']) {
612
+ }
613
+ }
614
+ /**
615
+ * 重新加载
616
+ */
617
+ btnReload() {
618
+ this.options?.resetModel();
619
+ this.config.model = {};
620
+ this.form = new FormGroup({});
621
+ this.getPageConfig();
622
+ }
623
+ /*
624
+ 获取设计
625
+ */
626
+ getDesign() {
627
+ return of(this.config.formInfo.json);
628
+ }
629
+ /*
630
+ 获取角色
631
+ */
632
+ getRole() {
633
+ let params = {
634
+ formId: this.config.formInfo.id,
635
+ type: this.config.formType,
636
+ };
637
+ let apiName = this.commApiSrv.getFormRole(this.config.moduleType);
638
+ return this.http.post(`${apiName}`, params);
639
+ }
640
+ /*
641
+ 获取配置-下拉选项
642
+ */
643
+ getDropDown() {
644
+ let apiName = this.commApiSrv.getFormDropDown(this.config.moduleType, this.config.formInfo.id);
645
+ return this.http.post(`${apiName}`);
646
+ }
647
+ /*
648
+ 获取配置-表单数据
649
+ */
650
+ getFromModel() {
651
+ let apiName = this.commApiSrv.getFormModelByForm(this.config.moduleType);
652
+ return this.http.post(`${apiName}/${this.config.formInfo.id}`);
653
+ }
654
+ /*
655
+ 获取配置-表单默认值
656
+ */
657
+ getFromDefaultModel() {
658
+ if (this.config.formType == 'ADD' && this.config.formInfo.id) {
659
+ let apiName = this.commApiSrv.getFormDefaultModel(this.config.moduleType);
660
+ return this.http.post(`${apiName}/${this.config.formInfo.id}`);
661
+ }
662
+ else {
663
+ return of(null);
664
+ }
665
+ }
666
+ /**
667
+ * 组装配置
668
+ */
669
+ getPageConfig() {
670
+ this.loading = true;
671
+ new Promise((resolve) => {
672
+ zip(this.getDesign(), this.getRole(), this.getDropDown(), this.getFromDefaultModel(), this.getFromModel()).subscribe(([design, role, drop, d, m]) => {
673
+ let fieldConfigs = design;
674
+ let fieldRole = {};
675
+ let fieldOptions = {};
676
+ //字段权限
677
+ if (role?.success == true && role?.result) {
678
+ fieldRole = role.result;
679
+ }
680
+ //字段Options
681
+ if (drop.success == true && drop.result) {
682
+ fieldOptions = drop.result;
683
+ }
684
+ if (this.config?.formInfo?.izMultiple == true) {
685
+ //获取的表单值
686
+ if (m && m.success == true && m.result) {
687
+ this.config.model = Object.assign(this.config.model, {
688
+ multiple_key: m.result,
689
+ });
690
+ }
691
+ }
692
+ else {
693
+ //默认值
694
+ if (d && d.success == true && d.result) {
695
+ this.config.model = Object.assign(this.config.model, d.result);
696
+ }
697
+ //获取的表单值
698
+ if (m && m.success == true && m.result) {
699
+ this.config.model = Object.assign(this.config.model, m.result);
700
+ }
701
+ }
702
+ // this.utilService.initFormFieldConfig(fieldConfigs, fieldRole, fieldOptions, this.config.model, this, (e: any, field: any) => {
703
+ // this.modelThrowEvent.emit(this.config.model);
704
+ // });
705
+ this.fields = fieldConfigs;
706
+ setTimeout(() => {
707
+ if (this.options != undefined && this.options != null && this.options?.resetModel) {
708
+ this.options?.resetModel();
709
+ }
710
+ }, 0);
711
+ this.getDataLoadAfter();
712
+ this.loading = false;
713
+ }, () => {
714
+ this.loading = false;
715
+ }, () => {
716
+ this.loading = false;
717
+ resolve();
718
+ });
719
+ });
720
+ }
721
+ /**
722
+ * 表单数据加载完
723
+ */
724
+ getDataLoadAfter() {
725
+ this.pageLoadAfter.emit(this.config.model);
726
+ }
727
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: OnlyOneService, deps: [{ token: i1$1.Router }, { token: i1._HttpClient }, { token: i3$1.NzModalService }, { token: i6.NzMessageService }, { token: i2.DeonFormUtilService }, { token: i7.CommAPIService }], target: i0.ɵɵFactoryTarget.Component });
728
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: OnlyOneService, isStandalone: true, selector: "ng-component", inputs: { config: "config", setpInfo: "setpInfo" }, outputs: { modelThrowEvent: "modelThrowEvent", pageLoadAfter: "pageLoadAfter" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true });
729
+ }
730
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: OnlyOneService, decorators: [{
731
+ type: Component,
732
+ args: [{
733
+ template: ''
734
+ }]
735
+ }], ctorParameters: () => [{ type: i1$1.Router }, { type: i1._HttpClient }, { type: i3$1.NzModalService }, { type: i6.NzMessageService }, { type: i2.DeonFormUtilService }, { type: i7.CommAPIService }], propDecorators: { config: [{
736
+ type: Input
737
+ }], setpInfo: [{
738
+ type: Input
739
+ }], modelThrowEvent: [{
740
+ type: Output
741
+ }], pageLoadAfter: [{
742
+ type: Output
743
+ }] } });
744
+
745
+ class FormSingleComponent extends OnlyOneService {
746
+ router;
747
+ http;
748
+ modal;
749
+ msg;
750
+ commApiSrv3;
751
+ utilService;
752
+ constructor(router, http, modal, msg, commApiSrv3, utilService) {
753
+ super(router, http, modal, msg, utilService, commApiSrv3);
754
+ this.router = router;
755
+ this.http = http;
756
+ this.modal = modal;
757
+ this.msg = msg;
758
+ this.commApiSrv3 = commApiSrv3;
759
+ this.utilService = utilService;
760
+ }
761
+ ngOnInit() { }
762
+ ngOnDestroy() { }
763
+ /*
764
+ 获取设计
765
+ */
766
+ getDesign() {
767
+ let newField = JSON.parse(this.config.formInfo.json);
768
+ return of(newField);
769
+ }
770
+ /**
771
+ * 上一�? */
772
+ btnLeft() { }
773
+ /**
774
+ * 下一�? */
775
+ btnRight() { }
776
+ /**
777
+ * 保存按钮
778
+ * @returns
779
+ */
780
+ btnSave() {
781
+ if (!this.form.valid) {
782
+ return;
783
+ }
784
+ this.loading = true;
785
+ let apiName = this.commApiSrv.getFormSave(this.config.moduleType, false);
786
+ this.http
787
+ .post(`${apiName}`, {
788
+ formId: this.config.formInfo.id,
789
+ modelJson: this.config.model,
790
+ })
791
+ .subscribe((res) => {
792
+ this.loading = false;
793
+ if (res && res.success == true) {
794
+ this.msg.success('保存成功!');
795
+ this.getPageConfig();
796
+ }
797
+ }, () => {
798
+ this.loading = false;
799
+ });
800
+ }
801
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FormSingleComponent, deps: [{ token: i1$1.Router }, { token: i1._HttpClient }, { token: i3$1.NzModalService }, { token: i6.NzMessageService }, { token: i7.CommAPIService }, { token: i2.DeonFormUtilService }], target: i0.ɵɵFactoryTarget.Component });
802
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: FormSingleComponent, isStandalone: true, selector: "form-single", usesInheritance: true, ngImport: i0, template: "<nz-spin [nzSpinning]=\"loading\" nzTip=\"\u62FC\u547D\u52A0\u8F7D\u4E2D...\" class=\"deon-list-spin\">\n <form [formGroup]=\"form\" (ngSubmit)=\"btnSave()\">\n <div class=\"deon-from\">\n <ng-container *ngIf=\"fields && fields.length > 0\">\n <formly-form [model]=\"config.model\" [fields]=\"fields\" [options]=\"options\" [form]=\"form\"> </formly-form>\n </ng-container>\n </div>\n <div class=\"deon-bottom\">\n <div class=\"bottom-left\">\n <ng-content></ng-content>\n </div>\n <div class=\"bottom-right\">\n <button nz-button nzType=\"default\" (click)=\"btnReload()\" type=\"button\"><i nz-icon\n nzType=\"reload\"></i>\u91CD\u65B0\u52A0\u8F7D</button>\n <button nz-button nzType=\"primary\"><i nz-icon nzType=\"save\"></i>\u4FDD\u5B58</button>\n </div>\n </div>\n </form>\n</nz-spin>", styles: [":host ::ng-deep{display:flex;flex:1;flex-direction:column;width:100%;height:100%;padding:0}:host ::ng-deep form{overflow:hidden}:host ::ng-deep .deon-from{padding:20px}:host ::ng-deep .deon-from .repeat-table{border:0!important}:host ::ng-deep .deon-from .field-panel-box{padding:0!important}:host ::ng-deep .deon-from deon-nz-field-repeat{margin-bottom:0!important}:host ::ng-deep .deon-from .fieldbox-children{margin-top:3px;border:1px solid #eaeaea}:host ::ng-deep .deon-from .fieldbox-children .repeat-label{padding:0 5px;border-bottom:1px solid #eaeaea}:host ::ng-deep .deon-from .repeat-label{display:inline}:host ::ng-deep .deon-bottom{display:flex;height:auto;padding:8px 12px;border-top:1px solid #eaeaea}:host ::ng-deep .deon-bottom .bottom-left{flex:1}\n"], dependencies: [{ kind: "ngmodule", type: RuntimeSharedImportsModule }, { kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i8.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i8.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i9$1.FormSubmitTouchDirective, selector: "form[formGroup]" }, { kind: "component", type: i10.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i11.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i12.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }, { kind: "directive", type: i13.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "component", type: i14.NzSpinComponent, selector: "nz-spin", inputs: ["nzIndicator", "nzSize", "nzTip", "nzDelay", "nzSimple", "nzSpinning"], exportAs: ["nzSpin"] }, { kind: "ngmodule", type: FormlyModule }, { kind: "component", type: i4.LegacyFormlyForm, selector: "formly-form" }, { kind: "ngmodule", type: GramDeonAntdModule }] });
803
+ }
804
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FormSingleComponent, decorators: [{
805
+ type: Component,
806
+ args: [{ selector: 'form-single', imports: [
807
+ RuntimeSharedImportsModule,
808
+ FormlyModule,
809
+ GramDeonAntdModule
810
+ ], template: "<nz-spin [nzSpinning]=\"loading\" nzTip=\"\u62FC\u547D\u52A0\u8F7D\u4E2D...\" class=\"deon-list-spin\">\n <form [formGroup]=\"form\" (ngSubmit)=\"btnSave()\">\n <div class=\"deon-from\">\n <ng-container *ngIf=\"fields && fields.length > 0\">\n <formly-form [model]=\"config.model\" [fields]=\"fields\" [options]=\"options\" [form]=\"form\"> </formly-form>\n </ng-container>\n </div>\n <div class=\"deon-bottom\">\n <div class=\"bottom-left\">\n <ng-content></ng-content>\n </div>\n <div class=\"bottom-right\">\n <button nz-button nzType=\"default\" (click)=\"btnReload()\" type=\"button\"><i nz-icon\n nzType=\"reload\"></i>\u91CD\u65B0\u52A0\u8F7D</button>\n <button nz-button nzType=\"primary\"><i nz-icon nzType=\"save\"></i>\u4FDD\u5B58</button>\n </div>\n </div>\n </form>\n</nz-spin>", styles: [":host ::ng-deep{display:flex;flex:1;flex-direction:column;width:100%;height:100%;padding:0}:host ::ng-deep form{overflow:hidden}:host ::ng-deep .deon-from{padding:20px}:host ::ng-deep .deon-from .repeat-table{border:0!important}:host ::ng-deep .deon-from .field-panel-box{padding:0!important}:host ::ng-deep .deon-from deon-nz-field-repeat{margin-bottom:0!important}:host ::ng-deep .deon-from .fieldbox-children{margin-top:3px;border:1px solid #eaeaea}:host ::ng-deep .deon-from .fieldbox-children .repeat-label{padding:0 5px;border-bottom:1px solid #eaeaea}:host ::ng-deep .deon-from .repeat-label{display:inline}:host ::ng-deep .deon-bottom{display:flex;height:auto;padding:8px 12px;border-top:1px solid #eaeaea}:host ::ng-deep .deon-bottom .bottom-left{flex:1}\n"] }]
811
+ }], ctorParameters: () => [{ type: i1$1.Router }, { type: i1._HttpClient }, { type: i3$1.NzModalService }, { type: i6.NzMessageService }, { type: i7.CommAPIService }, { type: i2.DeonFormUtilService }] });
812
+
813
+ class FormMultipleComponent extends OnlyOneService {
814
+ router;
815
+ http;
816
+ modal;
817
+ msg;
818
+ commApiSrv3;
819
+ utilService;
820
+ constructor(router, http, modal, msg, commApiSrv3, utilService) {
821
+ super(router, http, modal, msg, utilService, commApiSrv3);
822
+ this.router = router;
823
+ this.http = http;
824
+ this.modal = modal;
825
+ this.msg = msg;
826
+ this.commApiSrv3 = commApiSrv3;
827
+ this.utilService = utilService;
828
+ }
829
+ ngOnInit() { }
830
+ ngOnDestroy() { }
831
+ /*
832
+ 获取设计
833
+ */
834
+ getDesign() {
835
+ let newField = [
836
+ {
837
+ key: 'multiple_key',
838
+ type: 'repeat',
839
+ fieldArray: {
840
+ fieldGroup: JSON.parse(this.config.formInfo.json),
841
+ },
842
+ },
843
+ ];
844
+ return of(newField);
845
+ }
846
+ /*
847
+ 获取配置-表单数据
848
+ */
849
+ getFromModel() {
850
+ let apiName = this.commApiSrv.getFormModelByForm(this.config.moduleType);
851
+ return this.http.post(`${apiName}/${this.config.formInfo.id}`);
852
+ }
853
+ btnSave() {
854
+ if (!this.form.valid) {
855
+ return;
856
+ }
857
+ this.loading = true;
858
+ let apiName = this.commApiSrv.getFormSave(this.config.moduleType, true);
859
+ this.http
860
+ .post(`${apiName}`, {
861
+ formId: this.config.formInfo.id,
862
+ modelJson: this.config.model['multiple_key'],
863
+ })
864
+ .subscribe((res) => {
865
+ this.loading = false;
866
+ if (res && res.success == true) {
867
+ this.msg.success('保存成功!');
868
+ this.getPageConfig();
869
+ }
870
+ }, () => {
871
+ this.loading = false;
872
+ });
873
+ }
874
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FormMultipleComponent, deps: [{ token: i1$1.Router }, { token: i1._HttpClient }, { token: i3$1.NzModalService }, { token: i6.NzMessageService }, { token: i7.CommAPIService }, { token: i2.DeonFormUtilService }], target: i0.ɵɵFactoryTarget.Component });
875
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: FormMultipleComponent, isStandalone: true, selector: "form-multiple", usesInheritance: true, ngImport: i0, template: "<nz-spin [nzSpinning]=\"loading\" nzTip=\"\u62FC\u547D\u52A0\u8F7D\u4E2D...\" class=\"deon-list-spin\">\n <form [formGroup]=\"form\" (ngSubmit)=\"btnSave()\">\n <div class=\"deon-head\">\n <div class=\"left\"></div>\n <div class=\"right\">\n <button nz-button nzType=\"default\" (click)=\"btnReload()\" type=\"button\"><i nz-icon\n nzType=\"reload\"></i>\u91CD\u65B0\u52A0\u8F7D</button>\n <button nz-button nzType=\"primary\"><i nz-icon nzType=\"save\"></i>\u4FDD\u5B58</button>\n </div>\n </div>\n <div class=\"deon-from\">\n <ng-container *ngIf=\"fields && fields.length > 0\">\n <formly-form [model]=\"config.model\" [fields]=\"fields\" [options]=\"options\" [form]=\"form\"> </formly-form>\n </ng-container>\n </div>\n </form>\n</nz-spin>", styles: [":host ::ng-deep{display:flex;flex:1;flex-direction:column;width:100%;height:100%;padding:0}:host ::ng-deep form{display:inline-flex;flex-direction:column;overflow:hidden}:host ::ng-deep .deon-head{display:flex;height:auto;padding:8px 12px;border-bottom:1px solid #eaeaea}:host ::ng-deep .deon-head .left{flex:1}:host ::ng-deep .deon-head .left ul{display:flex;align-items:center;height:100%;margin:0;padding:0;list-style:none}:host ::ng-deep .deon-head .left ul li{padding:0 25px 0 0}:host ::ng-deep .deon-from{padding:20px}:host ::ng-deep .deon-from .repeat-table{border:0!important}:host ::ng-deep .deon-from .field-panel-box{padding:0!important}:host ::ng-deep .deon-from deon-nz-field-repeat{margin-bottom:0!important}:host ::ng-deep .deon-from .fieldbox-children{margin-top:3px;border:1px solid #eaeaea}:host ::ng-deep .deon-from .fieldbox-children .repeat-label{padding:0 5px;border-bottom:1px solid #eaeaea}:host ::ng-deep .deon-from .repeat-label{display:inline}\n"], dependencies: [{ kind: "ngmodule", type: RuntimeSharedImportsModule }, { kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i8.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i8.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i9$1.FormSubmitTouchDirective, selector: "form[formGroup]" }, { kind: "component", type: i10.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i11.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i12.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }, { kind: "directive", type: i13.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "component", type: i14.NzSpinComponent, selector: "nz-spin", inputs: ["nzIndicator", "nzSize", "nzTip", "nzDelay", "nzSimple", "nzSpinning"], exportAs: ["nzSpin"] }, { kind: "ngmodule", type: FormlyModule }, { kind: "component", type: i4.LegacyFormlyForm, selector: "formly-form" }, { kind: "ngmodule", type: GramDeonAntdModule }] });
876
+ }
877
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FormMultipleComponent, decorators: [{
878
+ type: Component,
879
+ args: [{ selector: 'form-multiple', imports: [
880
+ RuntimeSharedImportsModule,
881
+ FormlyModule,
882
+ GramDeonAntdModule
883
+ ], template: "<nz-spin [nzSpinning]=\"loading\" nzTip=\"\u62FC\u547D\u52A0\u8F7D\u4E2D...\" class=\"deon-list-spin\">\n <form [formGroup]=\"form\" (ngSubmit)=\"btnSave()\">\n <div class=\"deon-head\">\n <div class=\"left\"></div>\n <div class=\"right\">\n <button nz-button nzType=\"default\" (click)=\"btnReload()\" type=\"button\"><i nz-icon\n nzType=\"reload\"></i>\u91CD\u65B0\u52A0\u8F7D</button>\n <button nz-button nzType=\"primary\"><i nz-icon nzType=\"save\"></i>\u4FDD\u5B58</button>\n </div>\n </div>\n <div class=\"deon-from\">\n <ng-container *ngIf=\"fields && fields.length > 0\">\n <formly-form [model]=\"config.model\" [fields]=\"fields\" [options]=\"options\" [form]=\"form\"> </formly-form>\n </ng-container>\n </div>\n </form>\n</nz-spin>", styles: [":host ::ng-deep{display:flex;flex:1;flex-direction:column;width:100%;height:100%;padding:0}:host ::ng-deep form{display:inline-flex;flex-direction:column;overflow:hidden}:host ::ng-deep .deon-head{display:flex;height:auto;padding:8px 12px;border-bottom:1px solid #eaeaea}:host ::ng-deep .deon-head .left{flex:1}:host ::ng-deep .deon-head .left ul{display:flex;align-items:center;height:100%;margin:0;padding:0;list-style:none}:host ::ng-deep .deon-head .left ul li{padding:0 25px 0 0}:host ::ng-deep .deon-from{padding:20px}:host ::ng-deep .deon-from .repeat-table{border:0!important}:host ::ng-deep .deon-from .field-panel-box{padding:0!important}:host ::ng-deep .deon-from deon-nz-field-repeat{margin-bottom:0!important}:host ::ng-deep .deon-from .fieldbox-children{margin-top:3px;border:1px solid #eaeaea}:host ::ng-deep .deon-from .fieldbox-children .repeat-label{padding:0 5px;border-bottom:1px solid #eaeaea}:host ::ng-deep .deon-from .repeat-label{display:inline}\n"] }]
884
+ }], ctorParameters: () => [{ type: i1$1.Router }, { type: i1._HttpClient }, { type: i3$1.NzModalService }, { type: i6.NzMessageService }, { type: i7.CommAPIService }, { type: i2.DeonFormUtilService }] });
885
+
886
+ /**
887
+ * 表单只有保存【单行数�?或�?多行数据�? 没有新增和编�? */
888
+ class CommFormOnlyOneComponent {
889
+ http;
890
+ commAPISrv;
891
+ _config = null;
892
+ loading = true;
893
+ pageConfig = null;
894
+ /**
895
+ * formId
896
+ * formType
897
+ * moduleCode
898
+ */
899
+ config = null;
900
+ setpInfo = null;
901
+ /**
902
+ * 值发生变化调用抛�? */
903
+ modelThrowEvent = new EventEmitter();
904
+ constructor(http, commAPISrv) {
905
+ this.http = http;
906
+ this.commAPISrv = commAPISrv;
907
+ }
908
+ ngOnInit() { }
909
+ ngOnChanges(changes) {
910
+ if (changes['config']) {
911
+ if (this.config) {
912
+ this.getFormDesign();
913
+ }
914
+ }
915
+ }
916
+ ngOnDestroy() { }
917
+ formDataLoadAfter(e) { }
918
+ formDataChange(e) {
919
+ this.modelThrowEvent.emit(e);
920
+ }
921
+ /*
922
+ 获取设计
923
+ */
924
+ getFormDesign() {
925
+ this.pageConfig = null;
926
+ if (this.config && this.config.formId && this.config.moduleCode) {
927
+ let apiName = this.commAPISrv.getFormDesign(this.config.moduleCode, this.config.formId);
928
+ this.http.post(`${apiName}`).subscribe((res) => {
929
+ if (res.success) {
930
+ this.config.moduleType = this.config.moduleCode;
931
+ this.config.formType = this.config.formType;
932
+ this.config.formInfo = _.get(res, 'result.basic');
933
+ }
934
+ this.loading = false;
935
+ });
936
+ }
937
+ else {
938
+ this.loading = false;
939
+ }
940
+ }
941
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CommFormOnlyOneComponent, deps: [{ token: i1._HttpClient }, { token: i7.CommAPIService }], target: i0.ɵɵFactoryTarget.Component });
942
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: CommFormOnlyOneComponent, isStandalone: true, selector: "comm-form-onlyone", inputs: { config: "config", setpInfo: "setpInfo" }, outputs: { modelThrowEvent: "modelThrowEvent" }, providers: [GramGlobalService, CommAPIService], usesOnChanges: true, ngImport: i0, template: "<nz-spin [nzSpinning]=\"loading\" nzTip=\"\u62FC\u547D\u52A0\u8F7D\u4E2D...\" class=\"deon-list-spin\">\n <ng-container *ngIf=\"config!! && config.formInfo!!\">\n <div class=\"form-info\">\n <ng-container *ngIf=\"config?.formInfo?.izMultiple == true; else tmpSingle\">\n <form-multiple [config]=\"config\" [setpInfo]=\"setpInfo\"></form-multiple>\n </ng-container>\n <ng-template #tmpSingle>\n <form-single\n [config]=\"config\"\n [setpInfo]=\"setpInfo\"\n (modelThrowEvent)=\"formDataChange($event)\"\n (pageLoadAfter)=\"formDataLoadAfter($event)\"\n >\n <ng-content></ng-content>\n </form-single>\n </ng-template>\n </div>\n </ng-container>\n</nz-spin>\n", styles: [":host ::ng-deep{display:flex;flex:1;flex-direction:column;width:100%;height:100%}:host ::ng-deep .form-info{display:flex;flex:1}:host ::ng-deep form{display:flex;flex-direction:column;height:100%;overflow:hidden}\n"], dependencies: [{ kind: "ngmodule", type: RuntimeSharedImportsModule }, { kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i14.NzSpinComponent, selector: "nz-spin", inputs: ["nzIndicator", "nzSize", "nzTip", "nzDelay", "nzSimple", "nzSpinning"], exportAs: ["nzSpin"] }, { kind: "component", type: FormSingleComponent, selector: "form-single" }, { kind: "component", type: FormMultipleComponent, selector: "form-multiple" }] });
943
+ }
944
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CommFormOnlyOneComponent, decorators: [{
945
+ type: Component,
946
+ args: [{ selector: 'comm-form-onlyone', providers: [GramGlobalService, CommAPIService], imports: [
947
+ RuntimeSharedImportsModule,
948
+ FormSingleComponent,
949
+ FormMultipleComponent
950
+ ], template: "<nz-spin [nzSpinning]=\"loading\" nzTip=\"\u62FC\u547D\u52A0\u8F7D\u4E2D...\" class=\"deon-list-spin\">\n <ng-container *ngIf=\"config!! && config.formInfo!!\">\n <div class=\"form-info\">\n <ng-container *ngIf=\"config?.formInfo?.izMultiple == true; else tmpSingle\">\n <form-multiple [config]=\"config\" [setpInfo]=\"setpInfo\"></form-multiple>\n </ng-container>\n <ng-template #tmpSingle>\n <form-single\n [config]=\"config\"\n [setpInfo]=\"setpInfo\"\n (modelThrowEvent)=\"formDataChange($event)\"\n (pageLoadAfter)=\"formDataLoadAfter($event)\"\n >\n <ng-content></ng-content>\n </form-single>\n </ng-template>\n </div>\n </ng-container>\n</nz-spin>\n", styles: [":host ::ng-deep{display:flex;flex:1;flex-direction:column;width:100%;height:100%}:host ::ng-deep .form-info{display:flex;flex:1}:host ::ng-deep form{display:flex;flex-direction:column;height:100%;overflow:hidden}\n"] }]
951
+ }], ctorParameters: () => [{ type: i1._HttpClient }, { type: i7.CommAPIService }], propDecorators: { config: [{
952
+ type: Input
953
+ }], setpInfo: [{
954
+ type: Input
955
+ }], modelThrowEvent: [{
956
+ type: Output
957
+ }] } });
958
+
959
+ class EmpCommmService {
960
+ /**
961
+ * 外部传入的配置
962
+ */
963
+ sourceConfig = null;
964
+ /**
965
+ * 头部配置 */
966
+ headerConfig = null;
967
+ groupForm = null;
968
+ groupData = null;
969
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EmpCommmService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
970
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EmpCommmService });
971
+ }
972
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EmpCommmService, decorators: [{
973
+ type: Injectable
974
+ }] });
975
+
976
+ class EmpGroupService {
977
+ http;
978
+ utilService;
979
+ resetService;
980
+ deonFormBuilder;
981
+ globalSrv;
982
+ msg;
983
+ commAPISrv;
984
+ pageConfig = null;
985
+ loading = true;
986
+ form = new FormGroup({});
987
+ model = {};
988
+ options = {};
989
+ fields = [];
990
+ /**
991
+ * 配置参数
992
+ */
993
+ argList = [];
994
+ /**
995
+ * 销毁
996
+ */
997
+ onDestroy$ = new Subject();
998
+ throwField = {};
999
+ throwData = {};
1000
+ /**
1001
+ * 值发生变化调用抛出
1002
+ */
1003
+ modelThrowEvent = new EventEmitter();
1004
+ constructor(http, utilService, resetService, deonFormBuilder, globalSrv, msg, commAPISrv) {
1005
+ this.http = http;
1006
+ this.utilService = utilService;
1007
+ this.resetService = resetService;
1008
+ this.deonFormBuilder = deonFormBuilder;
1009
+ this.globalSrv = globalSrv;
1010
+ this.msg = msg;
1011
+ this.commAPISrv = commAPISrv;
1012
+ this.globalSrv.subscribe('deon-field-repeat', (res) => {
1013
+ if (res != undefined && res.field != undefined && res.data != undefined && res.type != undefined) {
1014
+ if (res.type == 'delete') {
1015
+ this.fields = [...this.fields];
1016
+ }
1017
+ }
1018
+ });
1019
+ }
1020
+ ngOnDestroy() {
1021
+ this.onDestroy$.next();
1022
+ this.onDestroy$.complete();
1023
+ }
1024
+ /*
1025
+ 获取设计
1026
+ */
1027
+ getDesign() {
1028
+ let apiName = this.commAPISrv.getFormDesign(this.pageConfig.moduleCode, this.pageConfig.formId);
1029
+ return this.http.post(`${apiName}`);
1030
+ }
1031
+ /*
1032
+ 获取角色
1033
+ */
1034
+ getRole() {
1035
+ let params = {
1036
+ formId: this.pageConfig.formId,
1037
+ type: this.pageConfig.type,
1038
+ };
1039
+ let apiName = this.commAPISrv.getFormRole(this.pageConfig.moduleCode);
1040
+ return this.http.post(`${apiName}`, params);
1041
+ }
1042
+ /*
1043
+ 获取配置-下拉选项
1044
+ */
1045
+ getDropDown() {
1046
+ let apiName = this.commAPISrv.getFormDropDown(this.pageConfig.moduleCode, this.pageConfig.formId);
1047
+ return this.http.post(`${apiName}`);
1048
+ }
1049
+ /*
1050
+ 获取配置-表单数据
1051
+ */
1052
+ getFromModel() {
1053
+ let params = {
1054
+ formId: this.pageConfig.formId,
1055
+ id: this.pageConfig.id,
1056
+ };
1057
+ if (this.pageConfig.type != 'ADD' && this.pageConfig.id) {
1058
+ let apiName = null;
1059
+ if (this.pageConfig.api && this.pageConfig.api.modelAPI) {
1060
+ apiName = this.pageConfig.api.modelAPI;
1061
+ }
1062
+ else {
1063
+ apiName = this.commAPISrv.getFormModel(this.pageConfig.moduleCode);
1064
+ }
1065
+ return this.http.post(`${apiName}`, params);
1066
+ }
1067
+ else {
1068
+ return of(null);
1069
+ }
1070
+ }
1071
+ /*
1072
+ 获取配置-表单默认值
1073
+ */
1074
+ getFromDefaultModel() {
1075
+ if (this.pageConfig.type == 'ADD' && this.pageConfig.formId) {
1076
+ let apiName = null;
1077
+ if (this.pageConfig.api && this.pageConfig.api.modelDefaultAPI) {
1078
+ apiName = this.pageConfig.api.modelDefaultAPI;
1079
+ }
1080
+ else {
1081
+ apiName = this.commAPISrv.getFormDefaultModel(this.pageConfig.moduleCode);
1082
+ }
1083
+ return this.http.post(`${apiName}/${this.pageConfig.formId}`);
1084
+ }
1085
+ else {
1086
+ return of(null);
1087
+ }
1088
+ }
1089
+ /**
1090
+ * 获取配置-表单规则
1091
+ * @returns
1092
+ */
1093
+ getFromRuleData() {
1094
+ if (this.pageConfig.formId) {
1095
+ return this.http.post(`${ModuleAPI.rule}/rule/form/listByForm/${this.pageConfig.formId}`);
1096
+ }
1097
+ else {
1098
+ return of(null);
1099
+ }
1100
+ }
1101
+ /**
1102
+ * 获取默认参数
1103
+ */
1104
+ getFromArgInfo() {
1105
+ if (this.pageConfig?.argInfo && this.argList && Array.isArray(this.argList) && this.argList.length > 0) {
1106
+ this.argList.forEach((item) => {
1107
+ if (item.argFieldId && item.argName && this.pageConfig.argInfo[item.argName]) {
1108
+ this.model[item.argFieldId] = this.pageConfig?.argInfo[item.argName];
1109
+ }
1110
+ });
1111
+ }
1112
+ }
1113
+ /**
1114
+ * 组装配置
1115
+ */
1116
+ getPageConfig() {
1117
+ new Promise((resolve) => {
1118
+ zip(this.getDesign(), this.getRole(), this.getDropDown(), this.getFromModel(), this.getFromDefaultModel(), this.getFromRuleData()).subscribe(([design, role, drop, d, m, r]) => {
1119
+ this.model = {};
1120
+ //传入的值
1121
+ if (this.pageConfig.model != undefined && this.pageConfig.model != null) {
1122
+ this.model = Object.assign(this.model, this.pageConfig.model);
1123
+ }
1124
+ if (design.success == true && _.get(design, 'result.basic.json')) {
1125
+ /**
1126
+ * 配置参数
1127
+ */
1128
+ if (_.get(design, 'result.listArg') && Array.isArray(_.get(design, 'result.listArg'))) {
1129
+ this.argList = _.get(design, 'result.listArg');
1130
+ }
1131
+ this.getFromArgInfo();
1132
+ /**
1133
+ * 表单JSON
1134
+ */
1135
+ let fieldConfigs = JSON.parse(_.get(design, 'result.basic.json'));
1136
+ let fieldRole = {};
1137
+ let fieldOptions = {};
1138
+ let fieldRule = null;
1139
+ //字段权限
1140
+ if (role.success == true && role.result) {
1141
+ fieldRole = role.result;
1142
+ }
1143
+ //字段Options
1144
+ if (drop.success == true && drop.result) {
1145
+ fieldOptions = drop.result;
1146
+ }
1147
+ //默认值
1148
+ if (d && d.success == true && d.result) {
1149
+ this.model = Object.assign(this.model, d.result);
1150
+ }
1151
+ //获取的表单值
1152
+ if (m && m.success == true && m.result) {
1153
+ this.model = Object.assign(this.model, m.result);
1154
+ }
1155
+ if (r && r.success == true && r.result) {
1156
+ fieldRule = r.result;
1157
+ }
1158
+ //this.utilService.initFieldCallBack(fieldConfigs, this.throwField);
1159
+ this.utilService.initConfig(fieldConfigs, fieldRole, fieldOptions, this.model, fieldRule, null, this, (e, field) => {
1160
+ this.getPageRuleData(field, e);
1161
+ });
1162
+ this.fields = fieldConfigs;
1163
+ setTimeout(() => {
1164
+ if (this.options != undefined && this.options != null && this.options?.resetModel) {
1165
+ this.options?.resetModel();
1166
+ }
1167
+ }, 0);
1168
+ this.formDataLoadAfter();
1169
+ }
1170
+ this.loading = false;
1171
+ }, () => {
1172
+ this.loading = false;
1173
+ }, () => {
1174
+ this.loading = false;
1175
+ resolve();
1176
+ });
1177
+ });
1178
+ }
1179
+ getPageRuleData(field, value) {
1180
+ this.loading = true;
1181
+ let postData = {};
1182
+ postData[field.key] = {
1183
+ key: field.key,
1184
+ value: value
1185
+ };
1186
+ if (field?.props && field.props?.["callBackFields"] && field.props?.["callBackFields"]?.length > 0) {
1187
+ field.props?.["callBackFields"].forEach((item) => {
1188
+ if (this.model[item] != undefined) {
1189
+ postData[item] = {
1190
+ key: item,
1191
+ value: this.model[item]
1192
+ };
1193
+ }
1194
+ });
1195
+ }
1196
+ this.http.post(`${ModuleAPI.rule}/rule/run/formRule`, {
1197
+ ruleId: field.props?.["callBackRule"],
1198
+ modelJson: postData
1199
+ }).subscribe((res) => {
1200
+ if (res && res.success && res.result) {
1201
+ this.resetService.resetConfig(this.fields, this.model, res.result);
1202
+ this.fields = [...this.fields];
1203
+ }
1204
+ this.loading = false;
1205
+ }, (res) => {
1206
+ this.loading = false;
1207
+ });
1208
+ }
1209
+ formModelChange(e, field) {
1210
+ if (this.model && field.key) {
1211
+ let key = field.key;
1212
+ if (this.throwField && this.throwField.hasOwnProperty(key)) {
1213
+ /**
1214
+ * 触发表单外部
1215
+ */
1216
+ let value = this.throwField[key];
1217
+ if (value != undefined && value != null) {
1218
+ this.throwData = {};
1219
+ Object.keys(this.throwField).forEach((k) => {
1220
+ this.throwData[value] = this.model[k];
1221
+ });
1222
+ }
1223
+ this.modelThrowDataBefore();
1224
+ /**
1225
+ * 事件抛出
1226
+ */
1227
+ this.modelThrowEvent.emit(this.throwField);
1228
+ }
1229
+ else {
1230
+ /**
1231
+ * 常规触发
1232
+ */
1233
+ }
1234
+ }
1235
+ }
1236
+ save(i) {
1237
+ if (!this.form.valid) {
1238
+ return;
1239
+ }
1240
+ this.loading = true;
1241
+ let apiName = null;
1242
+ if (this.pageConfig.type == 'ADD') {
1243
+ if (this.pageConfig.api && this.pageConfig.api.addAPI) {
1244
+ apiName = this.pageConfig.api.addAPI;
1245
+ }
1246
+ else {
1247
+ apiName = this.commAPISrv.getFormAdd(this.pageConfig.moduleCode);
1248
+ }
1249
+ }
1250
+ else if (this.pageConfig.type == 'EDIT') {
1251
+ if (this.pageConfig.api && this.pageConfig.api.editAPI) {
1252
+ apiName = this.pageConfig.api.editAPI;
1253
+ }
1254
+ else {
1255
+ apiName = this.commAPISrv.getFormUpdate(this.pageConfig.moduleCode);
1256
+ }
1257
+ if (i == 0) {
1258
+ apiName = `${ModuleAPI.personnel}/personnel/employee/update`;
1259
+ }
1260
+ }
1261
+ this.http
1262
+ .post(`${apiName}`, {
1263
+ id: this.pageConfig.id,
1264
+ formId: this.pageConfig.formId,
1265
+ modelJson: this.model,
1266
+ })
1267
+ .subscribe((res) => {
1268
+ this.loading = false;
1269
+ if (res && res.success == true) {
1270
+ this.msg.success('保存成功!');
1271
+ }
1272
+ }, () => {
1273
+ this.loading = false;
1274
+ });
1275
+ }
1276
+ btnClose() {
1277
+ this.getPageConfig();
1278
+ }
1279
+ formDataLoadAfter() { }
1280
+ modelThrowDataBefore() { }
1281
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EmpGroupService, deps: [{ token: i1._HttpClient }, { token: i2.DeonFormUtilService }, { token: i3.DeonFormResetService }, { token: i4.FormlyFormBuilder }, { token: i5.GramGlobalService }, { token: i6.NzMessageService }, { token: i7.CommAPIService }], target: i0.ɵɵFactoryTarget.Directive });
1282
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: EmpGroupService, isStandalone: true, outputs: { modelThrowEvent: "modelThrowEvent" }, ngImport: i0 });
1283
+ }
1284
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EmpGroupService, decorators: [{
1285
+ type: Directive
1286
+ }], ctorParameters: () => [{ type: i1._HttpClient }, { type: i2.DeonFormUtilService }, { type: i3.DeonFormResetService }, { type: i4.FormlyFormBuilder }, { type: i5.GramGlobalService }, { type: i6.NzMessageService }, { type: i7.CommAPIService }], propDecorators: { modelThrowEvent: [{
1287
+ type: Output
1288
+ }] } });
1289
+
1290
+ class EmpChildrenComponent extends EmpGroupService {
1291
+ http;
1292
+ utilService;
1293
+ resetService;
1294
+ deonFormBuilder;
1295
+ globalSrv;
1296
+ msg;
1297
+ commAPISrv;
1298
+ empCommSrv;
1299
+ formInfo = null;
1300
+ height = 0;
1301
+ constructor(http, utilService, resetService, deonFormBuilder, globalSrv, msg, commAPISrv, empCommSrv) {
1302
+ super(http, utilService, resetService, deonFormBuilder, globalSrv, msg, commAPISrv);
1303
+ this.http = http;
1304
+ this.utilService = utilService;
1305
+ this.resetService = resetService;
1306
+ this.deonFormBuilder = deonFormBuilder;
1307
+ this.globalSrv = globalSrv;
1308
+ this.msg = msg;
1309
+ this.commAPISrv = commAPISrv;
1310
+ this.empCommSrv = empCommSrv;
1311
+ }
1312
+ ngOnInit() { }
1313
+ ngOnChanges(changes) {
1314
+ if (changes['formInfo']) {
1315
+ if (this.formInfo) {
1316
+ this.pageConfig = {
1317
+ type: this.empCommSrv.sourceConfig.type,
1318
+ id: null,
1319
+ formId: this.formInfo.id,
1320
+ moduleCode: this.empCommSrv.sourceConfig.moduleCode, //buttonConfig.moduleCode,
1321
+ api: this.empCommSrv.sourceConfig.api,
1322
+ argInfo: this.empCommSrv.sourceConfig.argInfo,
1323
+ };
1324
+ this.getPageConfig();
1325
+ }
1326
+ }
1327
+ }
1328
+ /*
1329
+ 获取配置-表单数据
1330
+ */
1331
+ getFromModel() {
1332
+ let params = {
1333
+ formId: this.pageConfig.formId,
1334
+ id: this.empCommSrv.sourceConfig.id,
1335
+ };
1336
+ let apiName = this.commAPISrv.getFormModelChildren(this.pageConfig.moduleCode);
1337
+ return this.http.post(`${apiName}`, params);
1338
+ }
1339
+ save() {
1340
+ if (!this.form.valid) {
1341
+ return;
1342
+ }
1343
+ this.loading = true;
1344
+ let apiName = this.commAPISrv.getFormSaveChildren(this.pageConfig.moduleCode);
1345
+ this.http
1346
+ .post(`${apiName}`, {
1347
+ id: this.empCommSrv.sourceConfig.id,
1348
+ formId: this.pageConfig.formId,
1349
+ modelJson: this.model,
1350
+ })
1351
+ .subscribe((res) => {
1352
+ this.loading = false;
1353
+ if (res && res.success == true) {
1354
+ this.msg.success('保存成功!');
1355
+ }
1356
+ }, () => {
1357
+ this.loading = false;
1358
+ });
1359
+ }
1360
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EmpChildrenComponent, deps: [{ token: i1._HttpClient }, { token: i2.DeonFormUtilService }, { token: i3.DeonFormResetService }, { token: i4.FormlyFormBuilder }, { token: i5.GramGlobalService }, { token: i6.NzMessageService }, { token: i7.CommAPIService }, { token: EmpCommmService }], target: i0.ɵɵFactoryTarget.Component });
1361
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: EmpChildrenComponent, isStandalone: true, selector: "emp-children", inputs: { formInfo: "formInfo", height: "height" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<nz-spin [nzSpinning]=\"loading\" nzTip=\"\u62FC\u547D\u52A0\u8F7D\u4E2D...\" class=\"deon-list-spin\">\n <ng-container *ngIf=\"pageConfig!!\">\n <form [formGroup]=\"form\" (ngSubmit)=\"save()\" #defaultForm>\n <div class=\"deon-from\" [ngStyle]=\"{ height: height - 68 + 'px' }\">\n <ng-container *ngIf=\"fields && fields.length > 0; else emptyPage\">\n <formly-form [model]=\"model\" [fields]=\"fields\" [options]=\"options\" [form]=\"form\"> </formly-form>\n </ng-container>\n <ng-template #emptyPage>\n <nz-empty *ngIf=\"loading !== true\"></nz-empty>\n </ng-template>\n </div>\n <div class=\"deon-button\" *ngIf=\"pageConfig.type != 'VIEW' && pageConfig.type != 'PREVIEW'\">\n <button nz-button nzType=\"default\" (click)=\"btnClose()\" type=\"button\"><i nz-icon nzType=\"reload\"></i>\u91CD\u7F6E</button>\n <!-- <button nz-button nzType=\"primary\" id=\"DRAFT\" *ngIf=\"draft == true\"><i nz-icon\n nzType=\"hourglass\"></i>\u6682\u5B58</button> -->\n <button nz-button nzType=\"primary\" id=\"SAVE\"><i nz-icon nzType=\"save\"></i>\u4FDD\u5B58</button>\n </div>\n </form>\n </ng-container>\n</nz-spin>", styles: [":host ::ng-deep{display:flex;flex:1;flex-direction:column;width:100%;height:100%;padding:15px 5px}\n"], dependencies: [{ kind: "ngmodule", type: RuntimeSharedImportsModule }, { kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i9.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i8.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i8.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i9$1.FormSubmitTouchDirective, selector: "form[formGroup]" }, { kind: "component", type: i10.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i11.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i12.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }, { kind: "directive", type: i13.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "component", type: i14.NzSpinComponent, selector: "nz-spin", inputs: ["nzIndicator", "nzSize", "nzTip", "nzDelay", "nzSimple", "nzSpinning"], exportAs: ["nzSpin"] }, { kind: "component", type: i16.NzEmptyComponent, selector: "nz-empty", inputs: ["nzNotFoundImage", "nzNotFoundContent", "nzNotFoundFooter"], exportAs: ["nzEmpty"] }, { kind: "ngmodule", type: FormlyModule }, { kind: "component", type: i4.LegacyFormlyForm, selector: "formly-form" }, { kind: "ngmodule", type: GramDeonAntdModule }] });
1362
+ }
1363
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EmpChildrenComponent, decorators: [{
1364
+ type: Component,
1365
+ args: [{ selector: 'emp-children', imports: [
1366
+ RuntimeSharedImportsModule,
1367
+ FormlyModule,
1368
+ GramDeonAntdModule
1369
+ ], template: "<nz-spin [nzSpinning]=\"loading\" nzTip=\"\u62FC\u547D\u52A0\u8F7D\u4E2D...\" class=\"deon-list-spin\">\n <ng-container *ngIf=\"pageConfig!!\">\n <form [formGroup]=\"form\" (ngSubmit)=\"save()\" #defaultForm>\n <div class=\"deon-from\" [ngStyle]=\"{ height: height - 68 + 'px' }\">\n <ng-container *ngIf=\"fields && fields.length > 0; else emptyPage\">\n <formly-form [model]=\"model\" [fields]=\"fields\" [options]=\"options\" [form]=\"form\"> </formly-form>\n </ng-container>\n <ng-template #emptyPage>\n <nz-empty *ngIf=\"loading !== true\"></nz-empty>\n </ng-template>\n </div>\n <div class=\"deon-button\" *ngIf=\"pageConfig.type != 'VIEW' && pageConfig.type != 'PREVIEW'\">\n <button nz-button nzType=\"default\" (click)=\"btnClose()\" type=\"button\"><i nz-icon nzType=\"reload\"></i>\u91CD\u7F6E</button>\n <!-- <button nz-button nzType=\"primary\" id=\"DRAFT\" *ngIf=\"draft == true\"><i nz-icon\n nzType=\"hourglass\"></i>\u6682\u5B58</button> -->\n <button nz-button nzType=\"primary\" id=\"SAVE\"><i nz-icon nzType=\"save\"></i>\u4FDD\u5B58</button>\n </div>\n </form>\n </ng-container>\n</nz-spin>", styles: [":host ::ng-deep{display:flex;flex:1;flex-direction:column;width:100%;height:100%;padding:15px 5px}\n"] }]
1370
+ }], ctorParameters: () => [{ type: i1._HttpClient }, { type: i2.DeonFormUtilService }, { type: i3.DeonFormResetService }, { type: i4.FormlyFormBuilder }, { type: i5.GramGlobalService }, { type: i6.NzMessageService }, { type: i7.CommAPIService }, { type: EmpCommmService }], propDecorators: { formInfo: [{
1371
+ type: Input
1372
+ }], height: [{
1373
+ type: Input
1374
+ }] } });
1375
+
1376
+ /**
1377
+ * 人员基本信息表单-有多页签
1378
+ */
1379
+ class CommFormEmpMainComponent extends EmpGroupService {
1380
+ http;
1381
+ elementRef;
1382
+ renderer;
1383
+ utilService;
1384
+ resetService;
1385
+ deonFormBuilder;
1386
+ globalSrv;
1387
+ msg;
1388
+ commAPISrv;
1389
+ empCommSrv;
1390
+ _config = null;
1391
+ cardLoading = true;
1392
+ set config(value) {
1393
+ this._config = value;
1394
+ if (value) {
1395
+ this.getPageData();
1396
+ }
1397
+ }
1398
+ get config() {
1399
+ return this._config;
1400
+ }
1401
+ height = 0;
1402
+ headerDefaultConfig = null;
1403
+ constructor(http, elementRef, renderer, utilService, resetService, deonFormBuilder, globalSrv, msg, commAPISrv, empCommSrv) {
1404
+ super(http, utilService, resetService, deonFormBuilder, globalSrv, msg, commAPISrv);
1405
+ this.http = http;
1406
+ this.elementRef = elementRef;
1407
+ this.renderer = renderer;
1408
+ this.utilService = utilService;
1409
+ this.resetService = resetService;
1410
+ this.deonFormBuilder = deonFormBuilder;
1411
+ this.globalSrv = globalSrv;
1412
+ this.msg = msg;
1413
+ this.commAPISrv = commAPISrv;
1414
+ this.empCommSrv = empCommSrv;
1415
+ }
1416
+ ngOnInit() { }
1417
+ ngOnChanges(changes) { }
1418
+ getPageData() {
1419
+ this.loading = true;
1420
+ this.empCommSrv.groupData = null;
1421
+ let apiName = this.commAPISrv.getFormDesign(this.config.moduleCode, this.config.formId);
1422
+ this.http.post(`${apiName}`).subscribe((res) => {
1423
+ this.empCommSrv.sourceConfig = _.cloneDeep(this.config);
1424
+ if (res.success) {
1425
+ this.empCommSrv.groupData = res.result;
1426
+ }
1427
+ if (this.empCommSrv.groupData &&
1428
+ this.empCommSrv.groupData.listChildren &&
1429
+ Array.isArray(this.empCommSrv.groupData.listChildren) &&
1430
+ this.empCommSrv.groupData.listChildren.length > 0) {
1431
+ /**
1432
+ * 获取第一个表�?为基础表单
1433
+ */
1434
+ let firstData = this.empCommSrv.groupData.listChildren[0];
1435
+ /**
1436
+ * 如果不需要Header 则取消loading
1437
+ */
1438
+ if (this.empCommSrv.groupData.basic?.izHeader != true) {
1439
+ this.cardLoading = false;
1440
+ }
1441
+ this.pageConfig = {
1442
+ type: this.empCommSrv.sourceConfig.type,
1443
+ id: this.empCommSrv.sourceConfig.id,
1444
+ formId: firstData.formInfo.id,
1445
+ moduleCode: this.empCommSrv.sourceConfig.moduleCode,
1446
+ api: this.empCommSrv.sourceConfig.api,
1447
+ argInfo: this.empCommSrv.sourceConfig.argInfo,
1448
+ };
1449
+ this.getPageConfig();
1450
+ }
1451
+ else {
1452
+ this.cardLoading = false;
1453
+ this.loading = false;
1454
+ }
1455
+ });
1456
+ }
1457
+ /**
1458
+ * 卡片数据加载完毕回调
1459
+ */
1460
+ cardDataLoadAfter() {
1461
+ this.cardLoading = false;
1462
+ this.resizeTable();
1463
+ }
1464
+ /**
1465
+ * 表单数据加载完毕回调
1466
+ */
1467
+ formDataLoadAfter() {
1468
+ if (this.headerDefaultConfig == null) {
1469
+ if (this.empCommSrv.groupData && this.empCommSrv.groupData.basic && this.empCommSrv.groupData.basic.izHeader == true) {
1470
+ this.headerDefaultConfig = {
1471
+ headerId: this.empCommSrv.groupData.basic.headerId,
1472
+ id: this.empCommSrv.sourceConfig.id,
1473
+ rd: Math.random(),
1474
+ };
1475
+ }
1476
+ else {
1477
+ this.headerDefaultConfig = null;
1478
+ }
1479
+ }
1480
+ setTimeout(() => {
1481
+ this.resizeTable();
1482
+ }, 0);
1483
+ }
1484
+ /**
1485
+ *抛出事件�? */
1486
+ modelThrowDataBefore() { }
1487
+ resize() {
1488
+ this.resizeTable();
1489
+ }
1490
+ resizeTable() {
1491
+ let totalHeight = this.elementRef.nativeElement.clientHeight;
1492
+ let cardHeight = 0;
1493
+ let tabHeight = 70; //tab页签高度45,底部边�?6;上边距8
1494
+ if (this.elementRef.nativeElement.querySelector('.basic-info')) {
1495
+ cardHeight = this.elementRef.nativeElement.querySelector('.basic-info').clientHeight;
1496
+ }
1497
+ this.height = totalHeight - cardHeight - tabHeight;
1498
+ }
1499
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CommFormEmpMainComponent, deps: [{ token: i1._HttpClient }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i2.DeonFormUtilService }, { token: i3.DeonFormResetService }, { token: i4.FormlyFormBuilder }, { token: i5.GramGlobalService }, { token: i6.NzMessageService }, { token: i7.CommAPIService }, { token: EmpCommmService }], target: i0.ɵɵFactoryTarget.Component });
1500
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: CommFormEmpMainComponent, isStandalone: true, selector: "comm-form-emp", inputs: { config: "config" }, host: { listeners: { "window:resize": "resize($event)" } }, providers: [CommAPIService, EmpCommmService], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<nz-spin [nzSpinning]=\"loading\" class=\"deon-list-spin\">\n <div class=\"basic\" *ngIf=\"empCommSrv.groupData!! && empCommSrv.groupData.basic!!\">\n <!-- <ng-container *ngIf=\"empCommSrv.groupData.basic?.izHeader == true && headerDefaultConfig!!\">\n <div class=\"basic-info\">\n <card-main [defaultConfig]=\"headerDefaultConfig\" (pageLoadAfter)=\"cardDataLoadAfter()\"></card-main>\n </div>\n </ng-container> -->\n <div class=\"basic-tabset\" *ngIf=\"cardLoading == false\">\n <nz-tabset>\n <ng-container *ngFor=\"let item of empCommSrv.groupData.listChildren; let i = index\">\n <nz-tab [nzTitle]=\"item.formInfo.name\">\n <ng-template nz-tab>\n <ng-container *ngIf=\"i == 0\">\n <div class=\"basic-form\">\n <form [formGroup]=\"form\" (ngSubmit)=\"save(i)\" #defaultForm>\n <div class=\"deon-from\">\n <ng-container *ngIf=\"fields && fields.length > 0; else emptyPage\">\n <formly-form [model]=\"model\" [fields]=\"fields\" [options]=\"options\" [form]=\"form\"> </formly-form>\n </ng-container>\n <ng-template #emptyPage>\n <nz-empty *ngIf=\"loading !== true\"></nz-empty>\n </ng-template>\n </div>\n <div class=\"deon-button\" *ngIf=\"pageConfig.type != 'VIEW' && pageConfig.type != 'PREVIEW'\">\n <button nz-button bottom=\"default\" (click)=\"btnClose()\" type=\"button\"><i nz-icon\n nzType=\"reload\"></i>\u91CD\u7F6E</button>\n <!-- <button nz-button nzType=\"primary\" id=\"DRAFT\" *ngIf=\"draft == true\"><i nz-icon\n nzType=\"hourglass\"></i>\u6682\u5B58</button> -->\n <button nz-button nzType=\"primary\" id=\"SAVE\"><i nz-icon nzType=\"save\"></i>\u4FDD\u5B58</button>\n </div>\n </form>\n </div>\n </ng-container>\n <ng-container *ngIf=\"i > 0 && height > 0\">\n <emp-children [formInfo]=\"item.formInfo\" [height]=\"height\"></emp-children>\n </ng-container>\n </ng-template>\n </nz-tab>\n </ng-container>\n </nz-tabset>\n </div>\n </div>\n</nz-spin>", styles: [":host ::ng-deep{display:flex;flex:1;flex-direction:column;width:100%;height:100%}:host ::ng-deep .basic{display:flex;flex:1;flex-direction:column;width:100%;height:100%}:host ::ng-deep .basic-info{display:inline-block;display:flex;align-items:center;width:100%}:host ::ng-deep .basic-info ul{display:flex;flex-direction:row;align-items:center;margin:0;padding:0 20px;list-style:none}:host ::ng-deep .basic-info ul li{margin:0;padding:0 20px 0 0}:host ::ng-deep .basic-info ul li:nth-last-child(1){padding:0 0 0 130px}:host ::ng-deep .basic-info ul .name{height:35px;color:#262626;font-weight:600;font-size:20px;line-height:28px}:host ::ng-deep .basic-info ul .position{color:#262626;font-weight:400;font-size:14px;line-height:20px}:host ::ng-deep .basic-info ul .org,:host ::ng-deep .basic-info ul .code{color:#262626;font-weight:400;font-size:14px;line-height:20px;line-height:35px}:host ::ng-deep .basic-info ul .org i,:host ::ng-deep .basic-info ul .code i{margin-right:3px;color:#8c8c8c}:host ::ng-deep .basic-tabset{display:flex;flex:1;padding:8px 8px 0;overflow:auto}:host ::ng-deep .basic-tabset nz-tabset{width:100%}:host ::ng-deep .basic-tabset nz-tabset nz-tabs-nav{padding:0 12px}:host ::ng-deep .basic-tabset .basic-form{display:flex;flex:1;height:100%;padding-top:15px;overflow:auto}:host ::ng-deep .basic-tabset form{display:flex;flex:1;flex-direction:column}:host ::ng-deep .basic-tabset form .deon-from{flex:1;padding:0;overflow:auto}:host ::ng-deep .basic-tabset form .deon-button{height:auto;padding:10px 12px;line-height:auto;text-align:inherit}:host ::ng-deep formly-form{display:inline-block;width:100%;padding:0 5px}\n"], dependencies: [{ kind: "ngmodule", type: RuntimeSharedImportsModule }, { kind: "directive", type: i9.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i8.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i8.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i9$1.FormSubmitTouchDirective, selector: "form[formGroup]" }, { kind: "component", type: i10.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i11.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i12.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }, { kind: "directive", type: i13.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "component", type: i16$1.NzTabSetComponent, selector: "nz-tabset", inputs: ["nzSelectedIndex", "nzTabPosition", "nzTabBarExtraContent", "nzCanDeactivate", "nzAddIcon", "nzTabBarStyle", "nzType", "nzSize", "nzAnimated", "nzTabBarGutter", "nzHideAdd", "nzCentered", "nzHideAll", "nzLinkRouter", "nzLinkExact", "nzDestroyInactiveTabPane"], outputs: ["nzSelectChange", "nzSelectedIndexChange", "nzTabListScroll", "nzClose", "nzAdd"], exportAs: ["nzTabset"] }, { kind: "component", type: i16$1.NzTabComponent, selector: "nz-tab", inputs: ["nzTitle", "nzClosable", "nzCloseIcon", "nzDisabled", "nzForceRender"], outputs: ["nzSelect", "nzDeselect", "nzClick", "nzContextmenu"], exportAs: ["nzTab"] }, { kind: "directive", type: i16$1.NzTabDirective, selector: "[nz-tab]", exportAs: ["nzTab"] }, { kind: "component", type: i14.NzSpinComponent, selector: "nz-spin", inputs: ["nzIndicator", "nzSize", "nzTip", "nzDelay", "nzSimple", "nzSpinning"], exportAs: ["nzSpin"] }, { kind: "component", type: i16.NzEmptyComponent, selector: "nz-empty", inputs: ["nzNotFoundImage", "nzNotFoundContent", "nzNotFoundFooter"], exportAs: ["nzEmpty"] }, { kind: "ngmodule", type: FormlyModule }, { kind: "component", type: i4.LegacyFormlyForm, selector: "formly-form" }, { kind: "ngmodule", type: GramDeonAntdModule }, { kind: "ngmodule", type: CardContentModule }, { kind: "component", type: EmpChildrenComponent, selector: "emp-children", inputs: ["formInfo", "height"] }] });
1501
+ }
1502
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CommFormEmpMainComponent, decorators: [{
1503
+ type: Component,
1504
+ args: [{ selector: 'comm-form-emp', providers: [CommAPIService, EmpCommmService], imports: [
1505
+ RuntimeSharedImportsModule,
1506
+ FormlyModule,
1507
+ GramDeonAntdModule,
1508
+ CardContentModule,
1509
+ EmpChildrenComponent
1510
+ ], template: "<nz-spin [nzSpinning]=\"loading\" class=\"deon-list-spin\">\n <div class=\"basic\" *ngIf=\"empCommSrv.groupData!! && empCommSrv.groupData.basic!!\">\n <!-- <ng-container *ngIf=\"empCommSrv.groupData.basic?.izHeader == true && headerDefaultConfig!!\">\n <div class=\"basic-info\">\n <card-main [defaultConfig]=\"headerDefaultConfig\" (pageLoadAfter)=\"cardDataLoadAfter()\"></card-main>\n </div>\n </ng-container> -->\n <div class=\"basic-tabset\" *ngIf=\"cardLoading == false\">\n <nz-tabset>\n <ng-container *ngFor=\"let item of empCommSrv.groupData.listChildren; let i = index\">\n <nz-tab [nzTitle]=\"item.formInfo.name\">\n <ng-template nz-tab>\n <ng-container *ngIf=\"i == 0\">\n <div class=\"basic-form\">\n <form [formGroup]=\"form\" (ngSubmit)=\"save(i)\" #defaultForm>\n <div class=\"deon-from\">\n <ng-container *ngIf=\"fields && fields.length > 0; else emptyPage\">\n <formly-form [model]=\"model\" [fields]=\"fields\" [options]=\"options\" [form]=\"form\"> </formly-form>\n </ng-container>\n <ng-template #emptyPage>\n <nz-empty *ngIf=\"loading !== true\"></nz-empty>\n </ng-template>\n </div>\n <div class=\"deon-button\" *ngIf=\"pageConfig.type != 'VIEW' && pageConfig.type != 'PREVIEW'\">\n <button nz-button bottom=\"default\" (click)=\"btnClose()\" type=\"button\"><i nz-icon\n nzType=\"reload\"></i>\u91CD\u7F6E</button>\n <!-- <button nz-button nzType=\"primary\" id=\"DRAFT\" *ngIf=\"draft == true\"><i nz-icon\n nzType=\"hourglass\"></i>\u6682\u5B58</button> -->\n <button nz-button nzType=\"primary\" id=\"SAVE\"><i nz-icon nzType=\"save\"></i>\u4FDD\u5B58</button>\n </div>\n </form>\n </div>\n </ng-container>\n <ng-container *ngIf=\"i > 0 && height > 0\">\n <emp-children [formInfo]=\"item.formInfo\" [height]=\"height\"></emp-children>\n </ng-container>\n </ng-template>\n </nz-tab>\n </ng-container>\n </nz-tabset>\n </div>\n </div>\n</nz-spin>", styles: [":host ::ng-deep{display:flex;flex:1;flex-direction:column;width:100%;height:100%}:host ::ng-deep .basic{display:flex;flex:1;flex-direction:column;width:100%;height:100%}:host ::ng-deep .basic-info{display:inline-block;display:flex;align-items:center;width:100%}:host ::ng-deep .basic-info ul{display:flex;flex-direction:row;align-items:center;margin:0;padding:0 20px;list-style:none}:host ::ng-deep .basic-info ul li{margin:0;padding:0 20px 0 0}:host ::ng-deep .basic-info ul li:nth-last-child(1){padding:0 0 0 130px}:host ::ng-deep .basic-info ul .name{height:35px;color:#262626;font-weight:600;font-size:20px;line-height:28px}:host ::ng-deep .basic-info ul .position{color:#262626;font-weight:400;font-size:14px;line-height:20px}:host ::ng-deep .basic-info ul .org,:host ::ng-deep .basic-info ul .code{color:#262626;font-weight:400;font-size:14px;line-height:20px;line-height:35px}:host ::ng-deep .basic-info ul .org i,:host ::ng-deep .basic-info ul .code i{margin-right:3px;color:#8c8c8c}:host ::ng-deep .basic-tabset{display:flex;flex:1;padding:8px 8px 0;overflow:auto}:host ::ng-deep .basic-tabset nz-tabset{width:100%}:host ::ng-deep .basic-tabset nz-tabset nz-tabs-nav{padding:0 12px}:host ::ng-deep .basic-tabset .basic-form{display:flex;flex:1;height:100%;padding-top:15px;overflow:auto}:host ::ng-deep .basic-tabset form{display:flex;flex:1;flex-direction:column}:host ::ng-deep .basic-tabset form .deon-from{flex:1;padding:0;overflow:auto}:host ::ng-deep .basic-tabset form .deon-button{height:auto;padding:10px 12px;line-height:auto;text-align:inherit}:host ::ng-deep formly-form{display:inline-block;width:100%;padding:0 5px}\n"] }]
1511
+ }], ctorParameters: () => [{ type: i1._HttpClient }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i2.DeonFormUtilService }, { type: i3.DeonFormResetService }, { type: i4.FormlyFormBuilder }, { type: i5.GramGlobalService }, { type: i6.NzMessageService }, { type: i7.CommAPIService }, { type: EmpCommmService }], propDecorators: { config: [{
1512
+ type: Input
1513
+ }], resize: [{
1514
+ type: HostListener,
1515
+ args: ['window:resize', ['$event']]
1516
+ }] } });
1517
+
1518
+ /**
1519
+ * 步骤表单 - 新增、编辑、查�? */
1520
+ class CommFormStepComponent extends FormDefaultService {
1521
+ http;
1522
+ utilService;
1523
+ deonFormBuilder;
1524
+ globalSrv;
1525
+ msg;
1526
+ commAPISrv;
1527
+ resetService;
1528
+ /**
1529
+ * 默认配置
1530
+ */
1531
+ headerDefaultConfig = null;
1532
+ /**
1533
+ * 动态配�? */
1534
+ headerDynamicConfig = null;
1535
+ /**
1536
+ * formId
1537
+ * formType
1538
+ * moduleCode
1539
+ */
1540
+ set config(value) {
1541
+ this._config = value;
1542
+ if (value && value.id) {
1543
+ this.dataId = value.id;
1544
+ }
1545
+ if (value && value.formId) {
1546
+ this.formId = value.formId;
1547
+ }
1548
+ this.getPageData();
1549
+ }
1550
+ get config() {
1551
+ return this._config;
1552
+ }
1553
+ setpInfo = null;
1554
+ constructor(http, utilService, deonFormBuilder, globalSrv, msg, commAPISrv, resetService) {
1555
+ super(http, utilService, deonFormBuilder, globalSrv, msg, commAPISrv, resetService);
1556
+ this.http = http;
1557
+ this.utilService = utilService;
1558
+ this.deonFormBuilder = deonFormBuilder;
1559
+ this.globalSrv = globalSrv;
1560
+ this.msg = msg;
1561
+ this.commAPISrv = commAPISrv;
1562
+ this.resetService = resetService;
1563
+ }
1564
+ ngOnInit() { }
1565
+ ngOnChanges(changes) { }
1566
+ getPageData() {
1567
+ this.pageConfig = {
1568
+ type: this.config.formType,
1569
+ id: this.dataId,
1570
+ formId: this.formId,
1571
+ moduleCode: this.config.moduleCode,
1572
+ api: this.config?.api,
1573
+ argInfo: null,
1574
+ };
1575
+ if (this.config.relationId) {
1576
+ this.pageConfig['relationId'] = this.config.relationId;
1577
+ }
1578
+ if (this.config.argInfo) {
1579
+ this.pageConfig.argInfo = _.cloneDeep(this.config.argInfo);
1580
+ }
1581
+ this.getPageConfig();
1582
+ }
1583
+ headerDataLoadAfter(e) {
1584
+ this.headerLoading = false;
1585
+ }
1586
+ formDataLoadAfter() {
1587
+ this.headerDefaultConfig = null;
1588
+ if (this.designBasic && this.designBasic?.izHeader == true) {
1589
+ this.headerDefaultConfig = {
1590
+ headerId: this.designBasic.headerId,
1591
+ id: this.config.id,
1592
+ rd: Math.random(),
1593
+ };
1594
+ }
1595
+ else {
1596
+ this.headerLoading = false;
1597
+ }
1598
+ }
1599
+ modelThrowDataBefore() {
1600
+ this.headerDynamicConfig = null;
1601
+ if (this.throwData) {
1602
+ let exist = false;
1603
+ Object.keys(this.throwData).forEach((key) => {
1604
+ if (this.throwData[key] != undefined && this.throwData[key] != null) {
1605
+ exist = true;
1606
+ }
1607
+ });
1608
+ if (exist) {
1609
+ if (this.designBasic?.izHeader == true) {
1610
+ this.headerDynamicConfig = { headerId: this.designBasic.headerId, model: this.throwData, rd: Math.random() };
1611
+ }
1612
+ else {
1613
+ this.headerLoading = false;
1614
+ }
1615
+ }
1616
+ }
1617
+ }
1618
+ saveData() {
1619
+ if (this.config.formType == 'ADD') {
1620
+ this.save();
1621
+ }
1622
+ else {
1623
+ if (!this.form.valid) {
1624
+ return;
1625
+ }
1626
+ this.bttonSaveEvent.emit(this.model);
1627
+ }
1628
+ }
1629
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CommFormStepComponent, deps: [{ token: i1._HttpClient }, { token: i2.DeonFormUtilService }, { token: i4.FormlyFormBuilder }, { token: i5.GramGlobalService }, { token: i6.NzMessageService }, { token: i7.CommAPIService }, { token: i3.DeonFormResetService }], target: i0.ɵɵFactoryTarget.Component });
1630
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: CommFormStepComponent, isStandalone: true, selector: "comm-form-step", inputs: { config: "config", setpInfo: "setpInfo" }, providers: [GramGlobalService, CommAPIService], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<nz-spin [nzSpinning]=\"loading == true || headerLoading == true\" nzTip=\"\u62FC\u547D\u52A0\u8F7D\u4E2D...\" class=\"deon-list-spin\">\n <ng-container *ngIf=\"pageConfig!!\">\n <div class=\"form-header\"\n *ngIf=\"designBasic!! && designBasic?.izHeader == true && (headerDefaultConfig!! || headerDynamicConfig!!)\">\n <card-main [defaultConfig]=\"headerDefaultConfig\" [dynamicConfig]=\"headerDynamicConfig\"\n (pageLoadAfter)=\"headerDataLoadAfter($event)\"></card-main>\n </div>\n <div class=\"form-info\">\n <form [formGroup]=\"form\" (ngSubmit)=\"saveData()\" #defaultForm>\n <div class=\"deon-from\">\n <ng-container *ngIf=\"fields && fields.length > 0; else emptyPage\">\n <formly-form [model]=\"model\" [fields]=\"fields\" [options]=\"options\" [form]=\"form\"> </formly-form>\n </ng-container>\n <ng-template #emptyPage>\n <nz-empty *ngIf=\"loading !== true\"></nz-empty>\n </ng-template>\n </div>\n <div class=\"deon-button\">\n <div class=\"bottom-left\">\n <ng-content select=\"[name=button-left]\"></ng-content>\n </div>\n <div class=\"bottom-right\">\n <ng-content select=\"[name=button-right]\"></ng-content>\n <ng-container\n *ngIf=\"pageConfig.type != 'VIEW' && (config.effectStatus == null || config.effectStatus == 'DRAFT')\">\n <button nz-button nzType=\"default\" (click)=\"btnClose()\" type=\"button\"><i nz-icon\n nzType=\"reload\"></i>\u91CD\u7F6E</button>\n <ng-container *ngIf=\"config.formType == 'ADD'\">\n <button nz-button nzType=\"primary\" id=\"SAVE\"><i nz-icon nzType=\"hourglass\"></i>\u6682\u5B58</button>\n </ng-container>\n <ng-container *ngIf=\"config.formType == 'EDIT'\">\n <button nz-button nzType=\"primary\" id=\"SAVE\"><i nz-icon nzType=\"save\"></i>\u63D0\u4EA4</button>\n </ng-container>\n </ng-container>\n </div>\n </div>\n </form>\n </div>\n </ng-container>\n</nz-spin>", styles: [":host ::ng-deep{display:flex;flex:1;flex-direction:column;width:100%;height:100%}:host ::ng-deep .form-info{display:flex;flex:1}:host ::ng-deep form{display:flex;flex:1;flex-direction:column;height:100%;overflow:hidden}:host ::ng-deep form .deon-button{display:flex;height:55px;padding:0 15px}:host ::ng-deep form .deon-button .bottom-left{flex:1;text-align:left}:host ::ng-deep form .deon-button .bottom-right{display:flex}:host ::ng-deep form .deon-button .bottom-right div[name=button-right]{padding:0 8px 0 0}\n"], dependencies: [{ kind: "ngmodule", type: RuntimeSharedImportsModule }, { kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i8.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i8.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i9$1.FormSubmitTouchDirective, selector: "form[formGroup]" }, { kind: "component", type: i10.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i11.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i12.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }, { kind: "directive", type: i13.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "component", type: i14.NzSpinComponent, selector: "nz-spin", inputs: ["nzIndicator", "nzSize", "nzTip", "nzDelay", "nzSimple", "nzSpinning"], exportAs: ["nzSpin"] }, { kind: "component", type: i16.NzEmptyComponent, selector: "nz-empty", inputs: ["nzNotFoundImage", "nzNotFoundContent", "nzNotFoundFooter"], exportAs: ["nzEmpty"] }, { kind: "ngmodule", type: FormlyModule }, { kind: "component", type: i4.LegacyFormlyForm, selector: "formly-form" }, { kind: "ngmodule", type: GramDeonAntdModule }, { kind: "ngmodule", type: CardContentModule }, { kind: "component", type: i17.CardMainComponent, selector: "card-main", inputs: ["dynamicConfig", "defaultConfig", "defaultData"], outputs: ["pageLoadAfter"] }] });
1631
+ }
1632
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CommFormStepComponent, decorators: [{
1633
+ type: Component,
1634
+ args: [{ selector: 'comm-form-step', providers: [GramGlobalService, CommAPIService], imports: [
1635
+ RuntimeSharedImportsModule,
1636
+ FormlyModule,
1637
+ GramDeonAntdModule,
1638
+ CardContentModule
1639
+ ], template: "<nz-spin [nzSpinning]=\"loading == true || headerLoading == true\" nzTip=\"\u62FC\u547D\u52A0\u8F7D\u4E2D...\" class=\"deon-list-spin\">\n <ng-container *ngIf=\"pageConfig!!\">\n <div class=\"form-header\"\n *ngIf=\"designBasic!! && designBasic?.izHeader == true && (headerDefaultConfig!! || headerDynamicConfig!!)\">\n <card-main [defaultConfig]=\"headerDefaultConfig\" [dynamicConfig]=\"headerDynamicConfig\"\n (pageLoadAfter)=\"headerDataLoadAfter($event)\"></card-main>\n </div>\n <div class=\"form-info\">\n <form [formGroup]=\"form\" (ngSubmit)=\"saveData()\" #defaultForm>\n <div class=\"deon-from\">\n <ng-container *ngIf=\"fields && fields.length > 0; else emptyPage\">\n <formly-form [model]=\"model\" [fields]=\"fields\" [options]=\"options\" [form]=\"form\"> </formly-form>\n </ng-container>\n <ng-template #emptyPage>\n <nz-empty *ngIf=\"loading !== true\"></nz-empty>\n </ng-template>\n </div>\n <div class=\"deon-button\">\n <div class=\"bottom-left\">\n <ng-content select=\"[name=button-left]\"></ng-content>\n </div>\n <div class=\"bottom-right\">\n <ng-content select=\"[name=button-right]\"></ng-content>\n <ng-container\n *ngIf=\"pageConfig.type != 'VIEW' && (config.effectStatus == null || config.effectStatus == 'DRAFT')\">\n <button nz-button nzType=\"default\" (click)=\"btnClose()\" type=\"button\"><i nz-icon\n nzType=\"reload\"></i>\u91CD\u7F6E</button>\n <ng-container *ngIf=\"config.formType == 'ADD'\">\n <button nz-button nzType=\"primary\" id=\"SAVE\"><i nz-icon nzType=\"hourglass\"></i>\u6682\u5B58</button>\n </ng-container>\n <ng-container *ngIf=\"config.formType == 'EDIT'\">\n <button nz-button nzType=\"primary\" id=\"SAVE\"><i nz-icon nzType=\"save\"></i>\u63D0\u4EA4</button>\n </ng-container>\n </ng-container>\n </div>\n </div>\n </form>\n </div>\n </ng-container>\n</nz-spin>", styles: [":host ::ng-deep{display:flex;flex:1;flex-direction:column;width:100%;height:100%}:host ::ng-deep .form-info{display:flex;flex:1}:host ::ng-deep form{display:flex;flex:1;flex-direction:column;height:100%;overflow:hidden}:host ::ng-deep form .deon-button{display:flex;height:55px;padding:0 15px}:host ::ng-deep form .deon-button .bottom-left{flex:1;text-align:left}:host ::ng-deep form .deon-button .bottom-right{display:flex}:host ::ng-deep form .deon-button .bottom-right div[name=button-right]{padding:0 8px 0 0}\n"] }]
1640
+ }], ctorParameters: () => [{ type: i1._HttpClient }, { type: i2.DeonFormUtilService }, { type: i4.FormlyFormBuilder }, { type: i5.GramGlobalService }, { type: i6.NzMessageService }, { type: i7.CommAPIService }, { type: i3.DeonFormResetService }], propDecorators: { config: [{
1641
+ type: Input
1642
+ }], setpInfo: [{
1643
+ type: Input
1644
+ }] } });
1645
+
1646
+ const COMPONENTS = [
1647
+ CommFormMainComponent,
1648
+ CommFormEmpMainComponent,
1649
+ CommFormOnlyOneComponent,
1650
+ FormSingleComponent,
1651
+ FormMultipleComponent,
1652
+ EmpChildrenComponent,
1653
+ CommFormStepComponent,
1654
+ ];
1655
+ class CommFormModule {
1656
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CommFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1657
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: CommFormModule, imports: [CommFormMainComponent,
1658
+ CommFormEmpMainComponent,
1659
+ CommFormOnlyOneComponent,
1660
+ FormSingleComponent,
1661
+ FormMultipleComponent,
1662
+ EmpChildrenComponent,
1663
+ CommFormStepComponent], exports: [CommFormMainComponent,
1664
+ CommFormEmpMainComponent,
1665
+ CommFormOnlyOneComponent,
1666
+ FormSingleComponent,
1667
+ FormMultipleComponent,
1668
+ EmpChildrenComponent,
1669
+ CommFormStepComponent] });
1670
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CommFormModule, imports: [COMPONENTS] });
1671
+ }
1672
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CommFormModule, decorators: [{
1673
+ type: NgModule,
1674
+ args: [{
1675
+ imports: [...COMPONENTS],
1676
+ exports: [...COMPONENTS],
1677
+ }]
1678
+ }] });
1679
+
1680
+ /**
1681
+ * Generated bundle index. Do not edit.
1682
+ */
1683
+
1684
+ export { CommFormEmpMainComponent, CommFormMainComponent, CommFormModule, CommFormOnlyOneComponent, CommFormStepComponent, EmpChildrenComponent, FormMultipleComponent, FormSingleComponent };
1685
+ //# sourceMappingURL=comm.form.mjs.map