@ebuilding/biz-design 2.0.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 (96) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +0 -0
  3. package/default/index.d.ts +1 -0
  4. package/default/src/components/dialog.field/index.d.ts +20 -0
  5. package/default/src/components/empty/empty.field.d.ts +5 -0
  6. package/default/src/components/empty/empty.setting.d.ts +5 -0
  7. package/default/src/components/field.name/index.d.ts +8 -0
  8. package/default/src/components/field.setting/setting.checkbox.d.ts +14 -0
  9. package/default/src/components/field.setting/setting.children.d.ts +15 -0
  10. package/default/src/components/field.setting/setting.common.d.ts +17 -0
  11. package/default/src/components/field.setting/setting.d.ts +31 -0
  12. package/default/src/components/field.setting/setting.desc.d.ts +10 -0
  13. package/default/src/components/field.setting/setting.grid.d.ts +21 -0
  14. package/default/src/components/field.setting/setting.label.d.ts +12 -0
  15. package/default/src/components/field.setting/setting.line.d.ts +12 -0
  16. package/default/src/components/field.setting/setting.lookup.d.ts +22 -0
  17. package/default/src/components/field.setting/setting.number.d.ts +14 -0
  18. package/default/src/components/field.setting/setting.radio.d.ts +14 -0
  19. package/default/src/components/field.setting/setting.reform.d.ts +15 -0
  20. package/default/src/components/field.setting/setting.repeat.d.ts +23 -0
  21. package/default/src/components/field.setting/setting.service.d.ts +7 -0
  22. package/default/src/components/field.setting/setting.tabs.d.ts +17 -0
  23. package/default/src/components/field.setting/setting.teplate.d.ts +29 -0
  24. package/default/src/components/field.setting/setting.upload.d.ts +14 -0
  25. package/default/src/components/field.type/basic.d.ts +8 -0
  26. package/default/src/components/field.type/checkbox.type.d.ts +6 -0
  27. package/default/src/components/field.type/checkboxgroup.type.d.ts +6 -0
  28. package/default/src/components/field.type/children.type.d.ts +6 -0
  29. package/default/src/components/field.type/color.type.d.ts +6 -0
  30. package/default/src/components/field.type/datetime.type.d.ts +8 -0
  31. package/default/src/components/field.type/default/index.d.ts +6 -0
  32. package/default/src/components/field.type/desc.type.d.ts +6 -0
  33. package/default/src/components/field.type/icon.type.d.ts +6 -0
  34. package/default/src/components/field.type/indicator/index.d.ts +7 -0
  35. package/default/src/components/field.type/label.type.d.ts +6 -0
  36. package/default/src/components/field.type/line.type.d.ts +6 -0
  37. package/default/src/components/field.type/lookup.type.d.ts +6 -0
  38. package/default/src/components/field.type/number.type.d.ts +6 -0
  39. package/default/src/components/field.type/radio.type.d.ts +6 -0
  40. package/default/src/components/field.type/radiogroup.type.d.ts +6 -0
  41. package/default/src/components/field.type/repeat.type.d.ts +6 -0
  42. package/default/src/components/field.type/richtext.type.d.ts +6 -0
  43. package/default/src/components/field.type/select.type.d.ts +6 -0
  44. package/default/src/components/field.type/teplate.type.d.ts +18 -0
  45. package/default/src/components/field.type/text.type.d.ts +6 -0
  46. package/default/src/components/field.type/textarea.type.d.ts +6 -0
  47. package/default/src/components/field.type/textcode.type.d.ts +6 -0
  48. package/default/src/components/field.type/tree.type.d.ts +6 -0
  49. package/default/src/components/field.type/upload.type.d.ts +6 -0
  50. package/default/src/components/label.d.ts +12 -0
  51. package/default/src/components/type.basic/index.component.d.ts +13 -0
  52. package/default/src/components/type.basic2/index.component.d.ts +13 -0
  53. package/default/src/components/type.source/index.component.d.ts +11 -0
  54. package/default/src/components/type.source2/index.component.d.ts +10 -0
  55. package/default/src/content/index.component.d.ts +13 -0
  56. package/default/src/content/table.component.d.ts +10 -0
  57. package/default/src/kpi/index.component.d.ts +90 -0
  58. package/default/src/main/index.component.d.ts +87 -0
  59. package/default/src/pipe/safehtml.pipe.d.ts +10 -0
  60. package/default/src/public_api.d.ts +3 -0
  61. package/default/src/services/field-dialog.service.d.ts +36 -0
  62. package/default/src/services/field-source.service.d.ts +67 -0
  63. package/default/src/services/field-type.service.d.ts +19 -0
  64. package/default/src/services/field.service.d.ts +43 -0
  65. package/default/src/simple.module.d.ts +59 -0
  66. package/fesm2022/default.mjs +5604 -0
  67. package/fesm2022/default.mjs.map +1 -0
  68. package/fesm2022/ebuilding-biz-design.mjs +5604 -0
  69. package/fesm2022/ebuilding-biz-design.mjs.map +1 -0
  70. package/fesm2022/survey.mjs +2290 -0
  71. package/fesm2022/survey.mjs.map +1 -0
  72. package/index.d.ts +1 -0
  73. package/package.json +28 -0
  74. package/survey/index.d.ts +1 -0
  75. package/survey/src/components/empty.field.d.ts +5 -0
  76. package/survey/src/components/empty.setting.d.ts +5 -0
  77. package/survey/src/components/field.setting/radiogroup.d.ts +17 -0
  78. package/survey/src/components/field.setting/setting.basic.d.ts +31 -0
  79. package/survey/src/components/field.setting/setting.common.d.ts +13 -0
  80. package/survey/src/components/field.setting/setting.service.d.ts +7 -0
  81. package/survey/src/components/field.setting/setting.teplate.d.ts +29 -0
  82. package/survey/src/components/field.type/radiogroup.d.ts +6 -0
  83. package/survey/src/components/field.type/type.basic.d.ts +8 -0
  84. package/survey/src/components/field.type/type.default/index.d.ts +10 -0
  85. package/survey/src/components/field.type/type.teplate.d.ts +18 -0
  86. package/survey/src/components/inline.d.ts +35 -0
  87. package/survey/src/components/label.d.ts +12 -0
  88. package/survey/src/components/type.basic/index.d.ts +11 -0
  89. package/survey/src/content/index.d.ts +13 -0
  90. package/survey/src/main/index.component.d.ts +60 -0
  91. package/survey/src/pipe/safehtml.pipe.d.ts +10 -0
  92. package/survey/src/public_api.d.ts +2 -0
  93. package/survey/src/services/field-source.service.d.ts +67 -0
  94. package/survey/src/services/field-type.service.d.ts +20 -0
  95. package/survey/src/services/field.service.d.ts +43 -0
  96. package/survey/src/simple.module.d.ts +19 -0
@@ -0,0 +1,2290 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, Output, Input, Component, Injectable, ChangeDetectionStrategy, ViewContainerRef, ViewChild, Inject, Directive, Pipe, forwardRef, ViewChildren, NgModule } from '@angular/core';
3
+ import moment from 'moment';
4
+ import * as i1 from 'ng-zorro-antd/message';
5
+ import * as i2$1 from '@angular/cdk/drag-drop';
6
+ import { DragDropModule, moveItemInArray, CdkDropList } from '@angular/cdk/drag-drop';
7
+ import * as i1$1 from '@angular/common';
8
+ import { CommonModule } from '@angular/common';
9
+ import * as i2 from '@angular/forms';
10
+ import { FormsModule, ReactiveFormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
11
+ import * as i5 from 'ng-zorro-antd/input';
12
+ import { NzInputModule } from 'ng-zorro-antd/input';
13
+ import * as i6 from 'ng-zorro-antd/input-number';
14
+ import { NzInputNumberModule } from 'ng-zorro-antd/input-number';
15
+ import * as i7 from 'ng-zorro-antd/checkbox';
16
+ import { NzCheckboxModule } from 'ng-zorro-antd/checkbox';
17
+ import * as i3 from 'ng-zorro-antd/radio';
18
+ import { NzRadioModule } from 'ng-zorro-antd/radio';
19
+ import { NzSelectModule } from 'ng-zorro-antd/select';
20
+ import * as i8 from 'ng-zorro-antd/icon';
21
+ import { NzIconModule } from 'ng-zorro-antd/icon';
22
+ import { IndicatorType, EvalType } from '@ebuilding/base/shared.util/comm.kpi';
23
+ import { Guid } from '@ebuilding/base/shared.util/guid';
24
+ import * as i1$2 from '@angular/platform-browser';
25
+ import * as i2$2 from '@kre-form/core';
26
+ import { FormlyModule } from '@kre-form/core';
27
+ import { OverlayModule } from '@angular/cdk/overlay';
28
+ import * as i7$1 from 'ng-zorro-antd/tabs';
29
+ import { NzTabsModule } from 'ng-zorro-antd/tabs';
30
+ import { NzGridModule } from 'ng-zorro-antd/grid';
31
+ import { NzTableModule } from 'ng-zorro-antd/table';
32
+ import { NzPopoverModule } from 'ng-zorro-antd/popover';
33
+ import { asapScheduler } from 'rxjs';
34
+ import _ from 'lodash';
35
+ import * as i1$3 from 'ng-zorro-antd/modal';
36
+ import * as i4 from '@ebuilding/base/shared.srv/deon.util';
37
+
38
+ class SettingBasic {
39
+ message;
40
+ sourceField = {
41
+ key: '',
42
+ type: '',
43
+ editor: true,
44
+ show: true,
45
+ props: {
46
+ type: null,
47
+ label: '', //Title
48
+ hideLabel: false, //隐藏Title
49
+ placeholder: null,
50
+ required: false, //必填
51
+ minLength: null, //最小长度
52
+ maxLength: null, //最大长度
53
+ min: null, //最小值
54
+ max: null, //最大值
55
+ precision: null, //精度
56
+ pattern: null, //
57
+ options: [],
58
+ rows: null,
59
+ cols: 24,
60
+ className: '',
61
+ isButintin: false,
62
+ more: false,
63
+ labelPosition: null,
64
+ hideJson: null,
65
+ sysType: null, //系统字段类型
66
+ izSysName: false, //系统字段名称显示
67
+ },
68
+ fieldGroup: [],
69
+ };
70
+ minLength = null;
71
+ maxLength = null;
72
+ min = null;
73
+ max = null;
74
+ dialogPageData = null;
75
+ dialogFormData = [];
76
+ sourceType = null;
77
+ set field(value) {
78
+ if (value != null && value != undefined) {
79
+ this.sourceField = value;
80
+ if (this.sourceField.props && this.sourceField.props.minLength) {
81
+ this.minLength = this.sourceField.props.minLength;
82
+ }
83
+ if (this.sourceField.props && this.sourceField.props.maxLength) {
84
+ this.maxLength = this.sourceField.props.maxLength;
85
+ }
86
+ }
87
+ }
88
+ deleteButton(i, value) {
89
+ if (i < 1) {
90
+ return false;
91
+ }
92
+ let result = true;
93
+ if (value &&
94
+ value !== null &&
95
+ value.props &&
96
+ value.props !== null &&
97
+ value.props.isButintin &&
98
+ value.props.isButintin !== null) {
99
+ result = value.props.isButintin;
100
+ }
101
+ return result;
102
+ }
103
+ fieldSetUpAction = new EventEmitter();
104
+ typeChangeAction = new EventEmitter();
105
+ repeatAction = new EventEmitter();
106
+ constructor(message) {
107
+ this.message = message;
108
+ }
109
+ ngOnChanges(e) { }
110
+ maxLengthChange() {
111
+ let msg = '最大长度必须大于最小长度!';
112
+ if (this.sourceField.type == 'repeat') {
113
+ msg = '最大条数必须大于最小条数!';
114
+ }
115
+ if (this.minLength == null) {
116
+ this.sourceField.props.maxLength = this.maxLength;
117
+ }
118
+ else if (this.maxLength <= this.minLength) {
119
+ this.message.warning(msg);
120
+ return;
121
+ }
122
+ else {
123
+ this.sourceField.props.maxLength = this.maxLength;
124
+ }
125
+ this.valueChange();
126
+ }
127
+ minLengthChange() {
128
+ let msg = '最小长度必须大于最大长度!';
129
+ if (this.sourceField.type == 'repeat') {
130
+ msg = '最小条数必须大于最大条数!';
131
+ }
132
+ if (this.maxLength == null) {
133
+ this.sourceField.props.minLength = this.minLength;
134
+ }
135
+ else if (this.maxLength <= this.minLength) {
136
+ this.message.warning(msg);
137
+ return;
138
+ }
139
+ else {
140
+ this.sourceField.props.minLength = this.minLength;
141
+ }
142
+ this.valueChange();
143
+ }
144
+ maxChange() {
145
+ let msg = '最大长度必须大于最小长度!';
146
+ if (this.min == null) {
147
+ this.sourceField.props.max = this.max;
148
+ }
149
+ else if (this.max <= this.min) {
150
+ this.message.warning(msg);
151
+ return;
152
+ }
153
+ else {
154
+ this.sourceField.props.max = this.max;
155
+ }
156
+ this.valueChange();
157
+ }
158
+ minChange() {
159
+ let msg = '最小长度必须大于最大长度!';
160
+ if (this.max == null) {
161
+ this.sourceField.props.min = this.min;
162
+ }
163
+ else if (this.max <= this.min) {
164
+ this.message.warning(msg);
165
+ return;
166
+ }
167
+ else {
168
+ this.sourceField.props.min = this.min;
169
+ }
170
+ this.valueChange();
171
+ }
172
+ valueChange() {
173
+ this.fieldSetUpAction.emit(this.sourceField);
174
+ }
175
+ fieldTypeChange() {
176
+ this.typeChangeAction.emit(this.sourceField);
177
+ }
178
+ datetimeString() {
179
+ return `${moment().format('YYYYMMDDHHmmssSSS')}`;
180
+ }
181
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SettingBasic, deps: [{ token: i1.NzMessageService }], target: i0.ɵɵFactoryTarget.Component });
182
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: SettingBasic, isStandalone: true, selector: "ng-component", inputs: { dialogPageData: "dialogPageData", dialogFormData: "dialogFormData", sourceType: "sourceType", field: "field" }, outputs: { fieldSetUpAction: "fieldSetUpAction", typeChangeAction: "typeChangeAction", repeatAction: "repeatAction" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true });
183
+ }
184
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SettingBasic, decorators: [{
185
+ type: Component,
186
+ args: [{
187
+ template: '',
188
+ }]
189
+ }], ctorParameters: () => [{ type: i1.NzMessageService }], propDecorators: { dialogPageData: [{
190
+ type: Input
191
+ }], dialogFormData: [{
192
+ type: Input
193
+ }], sourceType: [{
194
+ type: Input
195
+ }], field: [{
196
+ type: Input
197
+ }], fieldSetUpAction: [{
198
+ type: Output
199
+ }], typeChangeAction: [{
200
+ type: Output
201
+ }], repeatAction: [{
202
+ type: Output
203
+ }] } });
204
+
205
+ class SettingService {
206
+ tableField = null;
207
+ isEditor = true;
208
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SettingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
209
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SettingService });
210
+ }
211
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SettingService, decorators: [{
212
+ type: Injectable
213
+ }] });
214
+
215
+ class SettingCommon extends SettingBasic {
216
+ message;
217
+ settingSrv;
218
+ constructor(message, settingSrv) {
219
+ super(message);
220
+ this.message = message;
221
+ this.settingSrv = settingSrv;
222
+ }
223
+ ngOnInit() { }
224
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SettingCommon, deps: [{ token: i1.NzMessageService }, { token: SettingService }], target: i0.ɵɵFactoryTarget.Component });
225
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: SettingCommon, isStandalone: true, selector: "setting-common", usesInheritance: true, ngImport: i0, template: `
226
+
227
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: DragDropModule }, { kind: "ngmodule", type: NzInputModule }, { kind: "ngmodule", type: NzInputNumberModule }, { kind: "ngmodule", type: NzCheckboxModule }, { kind: "ngmodule", type: NzRadioModule }, { kind: "ngmodule", type: NzSelectModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
228
+ }
229
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SettingCommon, decorators: [{
230
+ type: Component,
231
+ args: [{
232
+ selector: 'setting-common',
233
+ template: `
234
+
235
+ `,
236
+ changeDetection: ChangeDetectionStrategy.OnPush,
237
+ imports: [
238
+ CommonModule,
239
+ FormsModule,
240
+ ReactiveFormsModule,
241
+ DragDropModule,
242
+ NzInputModule,
243
+ NzInputNumberModule,
244
+ NzCheckboxModule,
245
+ NzRadioModule,
246
+ NzSelectModule
247
+ ]
248
+ }]
249
+ }], ctorParameters: () => [{ type: i1.NzMessageService }, { type: SettingService }] });
250
+
251
+ class SettingRadioGroup extends SettingBasic {
252
+ message;
253
+ settingSrv;
254
+ constructor(message, settingSrv) {
255
+ super(message);
256
+ this.message = message;
257
+ this.settingSrv = settingSrv;
258
+ }
259
+ ngOnInit() { }
260
+ btnUp(i) {
261
+ if (i != 0) {
262
+ moveItemInArray(this.sourceField.props.options, i, i - 1);
263
+ }
264
+ }
265
+ btnDown(i) {
266
+ if (i != this.sourceField.props.options.length - 1) {
267
+ moveItemInArray(this.sourceField.props.options, i, i + 1);
268
+ }
269
+ }
270
+ btnDel(i) {
271
+ this.sourceField.props.options = this.sourceField.props.options.filter((item, index) => { return index != i; });
272
+ }
273
+ btnAddItem() {
274
+ if (this.sourceField.props?.options == undefined || this.sourceField.props?.options == null) {
275
+ this.sourceField.props["options"] = [];
276
+ }
277
+ this.sourceField.props["options"].push({
278
+ label: "选项",
279
+ score: 0
280
+ });
281
+ }
282
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SettingRadioGroup, deps: [{ token: i1.NzMessageService }, { token: SettingService }], target: i0.ɵɵFactoryTarget.Component });
283
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: SettingRadioGroup, isStandalone: true, selector: "setting-radiogroup", usesInheritance: true, ngImport: i0, template: `
284
+ <div class="paragraph">
285
+ <label>标题</label>
286
+ <input
287
+ nz-input
288
+ [disabled]="settingSrv?.isEditor == false"
289
+ [(ngModel)]="sourceField.props.label"
290
+ maxLength="80"
291
+ placeholder="请输入标题"
292
+ (blur)="valueChange()"
293
+ />
294
+ </div>
295
+
296
+ <div class="paragraph">
297
+ <label
298
+ nz-checkbox
299
+ [nzDisabled]="settingSrv?.isEditor == false"
300
+ [(ngModel)]="sourceField.props.required"
301
+ (ngModelChange)="valueChange()">
302
+ 必填
303
+ </label>
304
+ </div>
305
+
306
+ <div class="paragraph paragraph-options">
307
+ <ul>
308
+ <li>选项</li>
309
+ <li>分数</li>
310
+ <li>操作</li>
311
+ </ul>
312
+ <ul *ngFor="let item of sourceField.props.options;let index=index">
313
+ <li>
314
+ <input nz-input [(ngModel)]="item.label" maxLength="80" placeholder="请输入选项" (blur)="valueChange()" />
315
+ </li>
316
+ <li>
317
+ <nz-input-number [(ngModel)]="item.score" [nzStep]="1"></nz-input-number>
318
+ </li>
319
+ <li>
320
+ <a (click)="btnUp(index)"><i nz-icon nzType="arrow-up"></i></a>
321
+ <a (click)="btnDown(index)"><i nz-icon nzType="arrow-down"></i></a>
322
+ <a (click)="btnDel(index)"><i nz-icon nzType="close-circle"></i></a>
323
+ </li>
324
+ </ul>
325
+ <div class="add-item"><a (click)="btnAddItem()">添加选项</a></div>
326
+ </div>
327
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: DragDropModule }, { kind: "ngmodule", type: NzInputModule }, { kind: "directive", type: i5.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzSize", "nzStepperless", "nzStatus", "disabled"], exportAs: ["nzInput"] }, { kind: "ngmodule", type: NzInputNumberModule }, { kind: "component", type: i6.NzInputNumberComponent, selector: "nz-input-number", inputs: ["nzId", "nzSize", "nzPlaceHolder", "nzStatus", "nzStep", "nzMin", "nzMax", "nzPrecision", "nzParser", "nzFormatter", "nzDisabled", "nzReadOnly", "nzAutoFocus", "nzBordered", "nzKeyboard", "nzControls"], outputs: ["nzBlur", "nzFocus", "nzOnStep"], exportAs: ["nzInputNumber"] }, { kind: "ngmodule", type: NzRadioModule }, { kind: "ngmodule", type: NzSelectModule }, { kind: "ngmodule", type: NzCheckboxModule }, { kind: "component", type: i7.NzCheckboxComponent, selector: "[nz-checkbox]", inputs: ["nzValue", "nzAutoFocus", "nzDisabled", "nzIndeterminate", "nzChecked", "nzId", "nzName"], outputs: ["nzCheckedChange"], exportAs: ["nzCheckbox"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i8.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
328
+ }
329
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SettingRadioGroup, decorators: [{
330
+ type: Component,
331
+ args: [{
332
+ selector: 'setting-radiogroup',
333
+ template: `
334
+ <div class="paragraph">
335
+ <label>标题</label>
336
+ <input
337
+ nz-input
338
+ [disabled]="settingSrv?.isEditor == false"
339
+ [(ngModel)]="sourceField.props.label"
340
+ maxLength="80"
341
+ placeholder="请输入标题"
342
+ (blur)="valueChange()"
343
+ />
344
+ </div>
345
+
346
+ <div class="paragraph">
347
+ <label
348
+ nz-checkbox
349
+ [nzDisabled]="settingSrv?.isEditor == false"
350
+ [(ngModel)]="sourceField.props.required"
351
+ (ngModelChange)="valueChange()">
352
+ 必填
353
+ </label>
354
+ </div>
355
+
356
+ <div class="paragraph paragraph-options">
357
+ <ul>
358
+ <li>选项</li>
359
+ <li>分数</li>
360
+ <li>操作</li>
361
+ </ul>
362
+ <ul *ngFor="let item of sourceField.props.options;let index=index">
363
+ <li>
364
+ <input nz-input [(ngModel)]="item.label" maxLength="80" placeholder="请输入选项" (blur)="valueChange()" />
365
+ </li>
366
+ <li>
367
+ <nz-input-number [(ngModel)]="item.score" [nzStep]="1"></nz-input-number>
368
+ </li>
369
+ <li>
370
+ <a (click)="btnUp(index)"><i nz-icon nzType="arrow-up"></i></a>
371
+ <a (click)="btnDown(index)"><i nz-icon nzType="arrow-down"></i></a>
372
+ <a (click)="btnDel(index)"><i nz-icon nzType="close-circle"></i></a>
373
+ </li>
374
+ </ul>
375
+ <div class="add-item"><a (click)="btnAddItem()">添加选项</a></div>
376
+ </div>
377
+ `,
378
+ changeDetection: ChangeDetectionStrategy.OnPush,
379
+ imports: [
380
+ CommonModule,
381
+ FormsModule,
382
+ ReactiveFormsModule,
383
+ DragDropModule,
384
+ NzInputModule,
385
+ NzInputNumberModule,
386
+ NzRadioModule,
387
+ NzSelectModule,
388
+ NzCheckboxModule,
389
+ NzIconModule
390
+ ]
391
+ }]
392
+ }], ctorParameters: () => [{ type: i1.NzMessageService }, { type: SettingService }] });
393
+
394
+ class SettingTemplate {
395
+ componentFactoryResolver;
396
+ changeDetectorRef;
397
+ settingSrv;
398
+ _tableField = null;
399
+ dynamicComponents = {
400
+ radiogroup: SettingRadioGroup,
401
+ };
402
+ component;
403
+ componentHost;
404
+ questionField = {
405
+ key: '',
406
+ type: 'text',
407
+ props: {
408
+ label: '',
409
+ description: '',
410
+ maxLength: 500,
411
+ minLength: 0,
412
+ max: 0,
413
+ min: 0,
414
+ precision: 0,
415
+ placeholder: '',
416
+ required: false,
417
+ pattern: '',
418
+ options: [],
419
+ hideJson: null,
420
+ },
421
+ };
422
+ dialogPageData = null;
423
+ dialogFormData = [];
424
+ sourceType = {};
425
+ set tableField(value) {
426
+ this.settingSrv.tableField = value;
427
+ }
428
+ set isEditor(value) {
429
+ if (value == null) {
430
+ this.settingSrv.isEditor = true;
431
+ }
432
+ else {
433
+ this.settingSrv.isEditor = value;
434
+ }
435
+ }
436
+ set field(value) {
437
+ if (value != null && value != undefined) {
438
+ this.questionField = value;
439
+ }
440
+ if (this.componentHost) {
441
+ this.componentHost.clear();
442
+ if (this.questionField != undefined &&
443
+ this.questionField != null &&
444
+ this.questionField.type != undefined &&
445
+ this.questionField.type != null &&
446
+ this.questionField.type != 'list') {
447
+ const compFactory = this.componentFactoryResolver.resolveComponentFactory(this.dynamicComponents[this.questionField.type]);
448
+ this.component = this.componentHost.createComponent(compFactory);
449
+ this.component.instance.dialogPageData = this.dialogPageData;
450
+ this.component.instance.dialogFormData = this.dialogFormData;
451
+ this.component.instance.sourceType = this.sourceType;
452
+ this.component.instance.field = this.questionField;
453
+ this.component.instance.fieldSetUpAction.subscribe((res) => {
454
+ this.fieldChange.emit(res);
455
+ });
456
+ this.component.instance.typeChangeAction.subscribe((res) => {
457
+ this.fieldTypeChange.emit(res);
458
+ });
459
+ this.component.instance.repeatAction.subscribe((res) => {
460
+ this.repeatChange.emit(res);
461
+ });
462
+ this.component.instance?.delGridCell?.subscribe((res) => {
463
+ this.delGridCell.emit(res);
464
+ });
465
+ }
466
+ else {
467
+ const compFactory = this.componentFactoryResolver.resolveComponentFactory(this.dynamicComponents['empty']);
468
+ this.component = this.componentHost.createComponent(compFactory);
469
+ }
470
+ }
471
+ }
472
+ fieldChange = new EventEmitter();
473
+ fieldTypeChange = new EventEmitter();
474
+ repeatChange = new EventEmitter();
475
+ delGridCell = new EventEmitter();
476
+ constructor(componentFactoryResolver, changeDetectorRef, settingSrv) {
477
+ this.componentFactoryResolver = componentFactoryResolver;
478
+ this.changeDetectorRef = changeDetectorRef;
479
+ this.settingSrv = settingSrv;
480
+ }
481
+ ngOnInit() { }
482
+ ngOnChanges(changes) { }
483
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SettingTemplate, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.ChangeDetectorRef }, { token: SettingService }], target: i0.ɵɵFactoryTarget.Component });
484
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: SettingTemplate, isStandalone: true, selector: "setting-template", inputs: { dialogPageData: "dialogPageData", dialogFormData: "dialogFormData", sourceType: "sourceType", tableField: "tableField", isEditor: "isEditor", field: "field" }, outputs: { fieldChange: "fieldChange", fieldTypeChange: "fieldTypeChange", repeatChange: "repeatChange", delGridCell: "delGridCell" }, providers: [SettingService], viewQueries: [{ propertyName: "componentHost", first: true, predicate: ["componentHost"], descendants: true, read: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, template: ` <ng-container #componentHost></ng-container> `, isInline: true });
485
+ }
486
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SettingTemplate, decorators: [{
487
+ type: Component,
488
+ args: [{
489
+ selector: 'setting-template',
490
+ template: ` <ng-container #componentHost></ng-container> `,
491
+ providers: [SettingService],
492
+ }]
493
+ }], ctorParameters: () => [{ type: i0.ComponentFactoryResolver }, { type: i0.ChangeDetectorRef }, { type: SettingService }], propDecorators: { componentHost: [{
494
+ type: ViewChild,
495
+ args: ['componentHost', { read: ViewContainerRef, static: true }]
496
+ }], dialogPageData: [{
497
+ type: Input
498
+ }], dialogFormData: [{
499
+ type: Input
500
+ }], sourceType: [{
501
+ type: Input
502
+ }], tableField: [{
503
+ type: Input
504
+ }], isEditor: [{
505
+ type: Input
506
+ }], field: [{
507
+ type: Input
508
+ }], fieldChange: [{
509
+ type: Output
510
+ }], fieldTypeChange: [{
511
+ type: Output
512
+ }], repeatChange: [{
513
+ type: Output
514
+ }], delGridCell: [{
515
+ type: Output
516
+ }] } });
517
+
518
+ class FieldTypeBasic {
519
+ typeList = [
520
+ {
521
+ "type": "radiogroup",
522
+ "label": "单 选 题"
523
+ },
524
+ {
525
+ "type": "checkbox",
526
+ "label": "多 选 题"
527
+ },
528
+ {
529
+ "type": "radio",
530
+ "label": "文字投票"
531
+ },
532
+ {
533
+ "type": "dropdown",
534
+ "label": "下 拉 题"
535
+ },
536
+ {
537
+ "type": "cascader",
538
+ "label": "级 联 题"
539
+ },
540
+ {
541
+ "type": "scaler",
542
+ "label": "量 表 题"
543
+ },
544
+ {
545
+ "type": "input",
546
+ "label": "填 空 题"
547
+ },
548
+ {
549
+ "type": "input_group",
550
+ "label": "多项填空"
551
+ },
552
+ {
553
+ "type": "input",
554
+ "label": "多行文本"
555
+ },
556
+ {
557
+ "type": "score",
558
+ "label": "打 分 题"
559
+ },
560
+ {
561
+ "type": "evaluation",
562
+ "label": "评 价 题"
563
+ },
564
+ {
565
+ "type": "nps",
566
+ "label": "NPS 题"
567
+ },
568
+ {
569
+ "type": "proportion",
570
+ "label": "比 重 题"
571
+ },
572
+ {
573
+ "type": "line",
574
+ "label": "分 割 线"
575
+ },
576
+ {
577
+ "type": "remark",
578
+ "label": "备注说明"
579
+ },
580
+ {
581
+ "type": "other_upload",
582
+ "label": "文件上传"
583
+ },
584
+ {
585
+ "type": "input",
586
+ "label": "姓 名"
587
+ },
588
+ {
589
+ "type": "input",
590
+ "label": "手 机"
591
+ },
592
+ {
593
+ "type": "input",
594
+ "label": "邮 箱"
595
+ },
596
+ {
597
+ "type": "radio",
598
+ "label": "性 别"
599
+ },
600
+ {
601
+ "type": "date",
602
+ "label": "日 期"
603
+ },
604
+ {
605
+ "type": "time",
606
+ "label": "时 间"
607
+ },
608
+ {
609
+ "type": "radio",
610
+ "label": "年 龄"
611
+ },
612
+ {
613
+ "type": "radio",
614
+ "label": "学 历"
615
+ },
616
+ {
617
+ "type": "cascader",
618
+ "label": "专 业"
619
+ },
620
+ {
621
+ "type": "cascader",
622
+ "label": "院 校"
623
+ },
624
+ {
625
+ "type": "cascader",
626
+ "label": "行 业"
627
+ },
628
+ {
629
+ "type": "radio",
630
+ "label": "职 业"
631
+ },
632
+ {
633
+ "type": "emp_address",
634
+ "label": "城市地址"
635
+ },
636
+ {
637
+ "type": "emp_geography",
638
+ "label": "地理位置"
639
+ },
640
+ {
641
+ "type": "matrix_radio",
642
+ "label": "矩阵单选"
643
+ },
644
+ {
645
+ "type": "matrix_checkbox",
646
+ "label": "矩阵多选"
647
+ },
648
+ {
649
+ "type": "matrix_score",
650
+ "label": "矩阵打分"
651
+ },
652
+ {
653
+ "type": "matrix_input",
654
+ "label": "矩阵填空"
655
+ },
656
+ {
657
+ "type": "matrix_scale",
658
+ "label": "矩阵量表"
659
+ }
660
+ ];
661
+ list = [
662
+ {
663
+ label: "选择题",
664
+ child: [
665
+ {
666
+ type: "radio",
667
+ label: "单 选 题",
668
+ tag: "default",
669
+ isUse: true
670
+ },
671
+ {
672
+ type: "checkbox",
673
+ label: "多 选 题",
674
+ isUse: false
675
+ },
676
+ {
677
+ type: "radio",
678
+ label: "文字投票",
679
+ tag: "votefont",
680
+ isUse: false
681
+ },
682
+ {
683
+ type: "dropdown",
684
+ label: "下 拉 题",
685
+ isUse: false
686
+ },
687
+ {
688
+ type: "cascader",
689
+ label: "级 联 题",
690
+ tag: "default",
691
+ isUse: false
692
+ },
693
+ {
694
+ type: "scaler",
695
+ label: "量 表 题",
696
+ tag: "default"
697
+ },
698
+ ]
699
+ },
700
+ {
701
+ label: "填空题",
702
+ child: [
703
+ {
704
+ type: "input",
705
+ label: "填 空 题",
706
+ tag: "default",
707
+ isUse: false
708
+ },
709
+ {
710
+ type: "input_group",
711
+ label: "多项填空",
712
+ isUse: false
713
+ },
714
+ {
715
+ type: "input",
716
+ label: "多行文本",
717
+ tag: "remark",
718
+ isUse: false
719
+ }
720
+ ]
721
+ },
722
+ {
723
+ label: "打分排序",
724
+ child: [
725
+ {
726
+ type: "score",
727
+ label: "打 分 题",
728
+ isUse: false
729
+ },
730
+ {
731
+ type: "evaluation",
732
+ label: "评 价 题",
733
+ isUse: false
734
+ },
735
+ {
736
+ type: "nps",
737
+ label: "NPS 题",
738
+ isUse: false
739
+ },
740
+ {
741
+ type: "proportion",
742
+ label: "比 重 题",
743
+ isUse: false
744
+ }
745
+ ]
746
+ },
747
+ {
748
+ label: "备注说明",
749
+ child: [
750
+ {
751
+ type: "line",
752
+ label: "分 割 线",
753
+ isUse: false
754
+ },
755
+ {
756
+ type: "remark",
757
+ label: "备注说明",
758
+ isUse: false
759
+ },
760
+ {
761
+ type: "other_upload",
762
+ label: "文件上传",
763
+ isUse: false
764
+ }
765
+ ]
766
+ },
767
+ {
768
+ label: "个人信息",
769
+ child: [
770
+ {
771
+ type: "input",
772
+ label: "姓 名",
773
+ tag: "name",
774
+ isUse: false
775
+ },
776
+ {
777
+ type: "input",
778
+ label: "手 机",
779
+ tag: "mobile",
780
+ isUse: false
781
+ },
782
+ {
783
+ type: "input",
784
+ label: "邮 箱",
785
+ tag: "email",
786
+ isUse: false
787
+ },
788
+ {
789
+ type: "radio",
790
+ label: "性 别",
791
+ tag: "gender",
792
+ isUse: false
793
+ },
794
+ {
795
+ type: "date",
796
+ label: "日 期",
797
+ isUse: false
798
+ },
799
+ {
800
+ type: "time",
801
+ label: "时 间",
802
+ isUse: false
803
+ },
804
+ {
805
+ type: "radio",
806
+ label: "年 龄",
807
+ tag: "age",
808
+ isUse: false
809
+ },
810
+ {
811
+ type: "radio",
812
+ label: "学 历",
813
+ tag: "education",
814
+ isUse: false
815
+ },
816
+ {
817
+ type: "cascader",
818
+ label: "专 业",
819
+ tag: "major",
820
+ isUse: false
821
+ },
822
+ {
823
+ type: "cascader",
824
+ label: "院 校",
825
+ tag: "university",
826
+ isUse: false
827
+ },
828
+ {
829
+ type: "cascader",
830
+ label: "行 业",
831
+ tag: "industry",
832
+ isUse: false
833
+ },
834
+ {
835
+ type: "radio",
836
+ label: "职 业",
837
+ tag: "occupation",
838
+ isUse: false
839
+ },
840
+ {
841
+ type: "emp_address",
842
+ label: "城市地址",
843
+ isUse: false
844
+ },
845
+ {
846
+ type: "emp_geography",
847
+ label: "地理位置",
848
+ isUse: false
849
+ }
850
+ ]
851
+ },
852
+ {
853
+ label: "其他题型",
854
+ child: [
855
+ {
856
+ type: "matrix_radio",
857
+ label: "矩阵单选",
858
+ isUse: false
859
+ },
860
+ {
861
+ type: "matrix_checkbox",
862
+ label: "矩阵多选",
863
+ isUse: false
864
+ },
865
+ {
866
+ type: "matrix_score",
867
+ label: "矩阵打分",
868
+ isUse: false
869
+ },
870
+ {
871
+ type: "matrix_input",
872
+ label: "矩阵填空",
873
+ isUse: false
874
+ },
875
+ {
876
+ type: "matrix_scale",
877
+ label: "矩阵量表",
878
+ isUse: false
879
+ }
880
+ ]
881
+ }
882
+ ];
883
+ dls;
884
+ constructor() {
885
+ let arr = [];
886
+ this.list.forEach((item) => {
887
+ item.child.forEach((data) => {
888
+ arr.push({
889
+ type: data.type,
890
+ label: data.label,
891
+ });
892
+ });
893
+ });
894
+ }
895
+ ngOnInit() { }
896
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FieldTypeBasic, deps: [], target: i0.ɵɵFactoryTarget.Component });
897
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: FieldTypeBasic, isStandalone: true, selector: "field-type-basic", inputs: { dls: "dls" }, ngImport: i0, template: "<div cdkDropList [cdkDropListData]=\"{ type_base: typeList }\" cdkDropListSortingDisabled [cdkDropListConnectedTo]=\"dls\">\n <ul class=\"list\">\n <ng-container *ngFor=\"let item of list\">\n <li class=\"title\">\n <label>{{item.label}}</label>\n </li>\n <ng-container *ngFor=\"let data of item?.child\">\n <li class=\"field\" [ngClass]=\"{'field-disable':!data.isUse}\" [cdkDragDisabled]=\"!data.isUse\" cdkDrag>\n <label>{{ data.label }}</label>\n </li>\n </ng-container>\n </ng-container>\n\n </ul>\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }] });
898
+ }
899
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FieldTypeBasic, decorators: [{
900
+ type: Component,
901
+ args: [{ selector: 'field-type-basic', imports: [
902
+ CommonModule,
903
+ FormsModule,
904
+ ReactiveFormsModule,
905
+ DragDropModule
906
+ ], template: "<div cdkDropList [cdkDropListData]=\"{ type_base: typeList }\" cdkDropListSortingDisabled [cdkDropListConnectedTo]=\"dls\">\n <ul class=\"list\">\n <ng-container *ngFor=\"let item of list\">\n <li class=\"title\">\n <label>{{item.label}}</label>\n </li>\n <ng-container *ngFor=\"let data of item?.child\">\n <li class=\"field\" [ngClass]=\"{'field-disable':!data.isUse}\" [cdkDragDisabled]=\"!data.isUse\" cdkDrag>\n <label>{{ data.label }}</label>\n </li>\n </ng-container>\n </ng-container>\n\n </ul>\n</div>" }]
907
+ }], ctorParameters: () => [], propDecorators: { dls: [{
908
+ type: Input
909
+ }] } });
910
+
911
+ class DeonDesignSimpleLabel {
912
+ field;
913
+ get to() {
914
+ return this.field.props || {};
915
+ }
916
+ ngOnInit() { }
917
+ ngAfterViewInit() { }
918
+ ngOnDestroy() { }
919
+ ngOnChanges(e) { }
920
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonDesignSimpleLabel, deps: [], target: i0.ɵɵFactoryTarget.Component });
921
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: DeonDesignSimpleLabel, isStandalone: true, selector: "deon-design-simple-label", inputs: { field: "field" }, host: { properties: { "class": "to.required==true?'required':''" } }, usesOnChanges: true, ngImport: i0, template: ` <ng-content></ng-content> `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
922
+ }
923
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonDesignSimpleLabel, decorators: [{
924
+ type: Component,
925
+ args: [{
926
+ selector: 'deon-design-simple-label',
927
+ template: ` <ng-content></ng-content> `,
928
+ host: {
929
+ '[class]': "to.required==true?'required':''",
930
+ },
931
+ changeDetection: ChangeDetectionStrategy.OnPush,
932
+ imports: [
933
+ CommonModule,
934
+ FormsModule,
935
+ ReactiveFormsModule
936
+ ]
937
+ }]
938
+ }], propDecorators: { field: [{
939
+ type: Input
940
+ }] } });
941
+
942
+ class FieldTypeService {
943
+ /**
944
+ * 获取默认字段
945
+ * @param type
946
+ * @returns
947
+ */
948
+ fieldBasicType(type) {
949
+ let field = {};
950
+ switch (type) {
951
+ case 'radiogroup':
952
+ field = this.radiogGroup();
953
+ break;
954
+ case 'label':
955
+ field = this.label();
956
+ break;
957
+ case 'desc':
958
+ field = this.desc();
959
+ break;
960
+ case 'line':
961
+ field = this.line();
962
+ break;
963
+ case 'grid':
964
+ field = this.grid();
965
+ break;
966
+ case 'children':
967
+ field = this.children();
968
+ break;
969
+ case 'reform':
970
+ field = this.reform();
971
+ break;
972
+ case 'tabs':
973
+ field = this.tabs();
974
+ break;
975
+ default:
976
+ break;
977
+ }
978
+ return field;
979
+ }
980
+ datetimeString(type) {
981
+ if (type !== undefined && type !== null) {
982
+ return `${type}_${moment().format('YYMMDDHHmmssSSS')}`;
983
+ }
984
+ else {
985
+ return `${moment().format('YYMMDDHHmmssSSS')}`;
986
+ }
987
+ }
988
+ radiogGroup() {
989
+ let config = {
990
+ type: 'radiogroup',
991
+ key: this.datetimeString('rg'),
992
+ defaultValue: null,
993
+ props: {
994
+ label: '请选择一个选项',
995
+ options: [{
996
+ label: "选项1",
997
+ value: "1",
998
+ score: 0
999
+ },
1000
+ {
1001
+ label: "选项2",
1002
+ value: "2",
1003
+ score: 0
1004
+ }]
1005
+ },
1006
+ };
1007
+ return config;
1008
+ }
1009
+ label() {
1010
+ let config = {
1011
+ type: 'label',
1012
+ key: this.datetimeString('label'),
1013
+ defaultValue: null,
1014
+ props: {
1015
+ label: '标签',
1016
+ },
1017
+ };
1018
+ return config;
1019
+ }
1020
+ desc() {
1021
+ let config = {
1022
+ type: 'desc',
1023
+ key: this.datetimeString('label'),
1024
+ defaultValue: null,
1025
+ props: {
1026
+ label: '文本描述',
1027
+ },
1028
+ };
1029
+ return config;
1030
+ }
1031
+ line() {
1032
+ let config = {
1033
+ type: 'line',
1034
+ key: this.datetimeString('line'),
1035
+ props: {
1036
+ label: '分割线',
1037
+ type: 'horizontal',
1038
+ hideLabel: true,
1039
+ line: 'dotted',
1040
+ orientation: 'left',
1041
+ },
1042
+ };
1043
+ return config;
1044
+ }
1045
+ grid() {
1046
+ let config = {
1047
+ type: 'grid',
1048
+ props: {
1049
+ hideLabel: true,
1050
+ },
1051
+ fieldGroup: [
1052
+ {
1053
+ type: 'list',
1054
+ props: {
1055
+ hideLabel: true,
1056
+ cols: 8,
1057
+ },
1058
+ fieldGroup: [],
1059
+ },
1060
+ {
1061
+ type: 'list',
1062
+ props: {
1063
+ hideLabel: true,
1064
+ cols: 8,
1065
+ },
1066
+ fieldGroup: [],
1067
+ },
1068
+ {
1069
+ type: 'list',
1070
+ props: {
1071
+ hideLabel: true,
1072
+ cols: 8,
1073
+ },
1074
+ fieldGroup: [],
1075
+ },
1076
+ ],
1077
+ };
1078
+ return config;
1079
+ }
1080
+ children() {
1081
+ let config = {
1082
+ type: 'children',
1083
+ key: this.datetimeString('children'),
1084
+ props: {
1085
+ label: '子表单',
1086
+ },
1087
+ fieldArray: {
1088
+ fieldGroup: [],
1089
+ },
1090
+ };
1091
+ return config;
1092
+ }
1093
+ reform() {
1094
+ let config = {
1095
+ type: 'reform',
1096
+ props: {
1097
+ label: '引用表单',
1098
+ },
1099
+ fieldGroup: [],
1100
+ };
1101
+ return config;
1102
+ }
1103
+ tabs() {
1104
+ let config = {
1105
+ type: 'tabs',
1106
+ props: {
1107
+ label: '多页签',
1108
+ },
1109
+ fieldGroup: [],
1110
+ };
1111
+ return config;
1112
+ }
1113
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FieldTypeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1114
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FieldTypeService });
1115
+ }
1116
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FieldTypeService, decorators: [{
1117
+ type: Injectable
1118
+ }] });
1119
+
1120
+ class FieldSourceService {
1121
+ /**
1122
+ * 获取默认字段
1123
+ * @param type
1124
+ * @returns
1125
+ */
1126
+ fieldSourceType(source) {
1127
+ let field = {};
1128
+ switch (source.type) {
1129
+ case 'TEXT':
1130
+ field = this.text(source);
1131
+ break;
1132
+ case 'COLOR':
1133
+ field = this.color(source);
1134
+ break;
1135
+ case 'ICON':
1136
+ field = this.icon(source);
1137
+ break;
1138
+ case 'TEXTAREA':
1139
+ field = this.textArea(source);
1140
+ break;
1141
+ case 'INT':
1142
+ field = this.number(source, 0);
1143
+ break;
1144
+ case 'FLOAT':
1145
+ field = this.number(source, source.precision);
1146
+ break;
1147
+ case 'DATETIME':
1148
+ field = this.datetime(source);
1149
+ break;
1150
+ case 'BOOLEAN':
1151
+ field = this.fieldBoolean(source);
1152
+ break;
1153
+ case 'ITEM':
1154
+ field = this.select(source);
1155
+ break;
1156
+ case 'MULTIPLE':
1157
+ field = this.repeat(source);
1158
+ break;
1159
+ case 'TREE':
1160
+ field = this.tree(source);
1161
+ break;
1162
+ case 'REF':
1163
+ field = this.lookup(source);
1164
+ break;
1165
+ case 'ONETOMANY':
1166
+ field = this.lookupMany(source);
1167
+ break;
1168
+ case 'ATTACHMENT':
1169
+ field = this.upload(source);
1170
+ break;
1171
+ case 'INDICATOR':
1172
+ field = this.indicator(source);
1173
+ break;
1174
+ default:
1175
+ break;
1176
+ }
1177
+ return field;
1178
+ }
1179
+ /**
1180
+ * 单行文本
1181
+ * @param field
1182
+ * @returns
1183
+ */
1184
+ text(field) {
1185
+ let sysType = null;
1186
+ if (field.code == 'create_user' || field.code == 'modify_user') {
1187
+ sysType = field.code.toUpperCase();
1188
+ }
1189
+ let config = {
1190
+ type: 'text',
1191
+ key: field.id,
1192
+ defaultValue: null,
1193
+ props: {
1194
+ type: null,
1195
+ sysType: sysType,
1196
+ izSysName: false,
1197
+ label: field.name,
1198
+ required: field?.required == true ? true : false,
1199
+ maxLength: field.maxLength,
1200
+ minLength: null,
1201
+ placeholder: `请输入${field.name}`,
1202
+ layout: 'default',
1203
+ },
1204
+ };
1205
+ if (field.izCodeRule && field.codeRuleId) {
1206
+ config = {
1207
+ type: 'textcode',
1208
+ key: field.id,
1209
+ defaultValue: null,
1210
+ props: {
1211
+ label: field.name,
1212
+ required: field?.required == true ? true : false,
1213
+ maxLength: field.maxLength,
1214
+ minLength: null,
1215
+ placeholder: `请输入${field.name}`,
1216
+ layout: 'default',
1217
+ },
1218
+ };
1219
+ }
1220
+ return config;
1221
+ }
1222
+ color(field) {
1223
+ let config = {
1224
+ type: 'color',
1225
+ key: field.id,
1226
+ defaultValue: null,
1227
+ props: {
1228
+ label: field.name,
1229
+ required: field?.required == true ? true : false,
1230
+ layout: 'default',
1231
+ },
1232
+ };
1233
+ return config;
1234
+ }
1235
+ icon(field) {
1236
+ let config = {
1237
+ type: 'icon',
1238
+ key: field.id,
1239
+ defaultValue: null,
1240
+ props: {
1241
+ label: field.name,
1242
+ required: field?.required == true ? true : false,
1243
+ layout: 'default',
1244
+ },
1245
+ };
1246
+ return config;
1247
+ }
1248
+ /**
1249
+ * 多行文本
1250
+ * @param field
1251
+ * @returns
1252
+ */
1253
+ textArea(field) {
1254
+ let config = {
1255
+ type: 'textarea',
1256
+ key: field.id,
1257
+ defaultValue: null,
1258
+ props: {
1259
+ label: field.name,
1260
+ required: field?.required == true ? true : false,
1261
+ maxLength: field.maxLength,
1262
+ minLength: field.minLength,
1263
+ placeholder: `请输入${field.name}`,
1264
+ rows: 3,
1265
+ layout: 'default',
1266
+ },
1267
+ };
1268
+ return config;
1269
+ }
1270
+ /**
1271
+ * 整数、小数 类型
1272
+ * @param field
1273
+ * @param precision
1274
+ * @returns
1275
+ */
1276
+ number(field, precision) {
1277
+ let config = {
1278
+ type: 'number',
1279
+ key: field.id,
1280
+ defaultValue: null,
1281
+ props: {
1282
+ label: field.name,
1283
+ required: field?.required == true ? true : false,
1284
+ max: field.max,
1285
+ min: field.min,
1286
+ placeholder: `请输入${field.name}`,
1287
+ precision: precision,
1288
+ layout: 'default',
1289
+ },
1290
+ };
1291
+ return config;
1292
+ }
1293
+ /**
1294
+ * 日期型
1295
+ * @param field
1296
+ * @returns
1297
+ */
1298
+ datetime(field) {
1299
+ let config = {
1300
+ type: 'datetime',
1301
+ key: field.id,
1302
+ defaultValue: null,
1303
+ props: {
1304
+ type: 'datetime',
1305
+ label: field.name,
1306
+ required: field?.required == true ? true : false,
1307
+ layout: 'default',
1308
+ },
1309
+ };
1310
+ return config;
1311
+ }
1312
+ /**
1313
+ * 布尔值
1314
+ * @param field
1315
+ * @returns
1316
+ */
1317
+ fieldBoolean(field) {
1318
+ let config = {
1319
+ type: 'radiogroup',
1320
+ key: field.id,
1321
+ defaultValue: true,
1322
+ props: {
1323
+ type: 'default',
1324
+ label: field.name,
1325
+ options: [
1326
+ { label: '是', value: true },
1327
+ { label: '否', value: false },
1328
+ ],
1329
+ required: field?.required == true ? true : false,
1330
+ layout: 'default',
1331
+ sourceType: 'boolean',
1332
+ },
1333
+ };
1334
+ return config;
1335
+ }
1336
+ /**
1337
+ * 选择
1338
+ * @param field
1339
+ * @returns
1340
+ */
1341
+ select(field) {
1342
+ let config = {
1343
+ type: 'select',
1344
+ key: field.id,
1345
+ defaultValue: null,
1346
+ props: {
1347
+ label: field.name,
1348
+ required: field?.required == true ? true : false,
1349
+ options: [],
1350
+ placeholder: `请选择${field.name}`,
1351
+ layout: 'default',
1352
+ selectType: field?.multiple == true ? 'multiple' : 'single',
1353
+ },
1354
+ };
1355
+ return config;
1356
+ }
1357
+ /**
1358
+ * 子表单
1359
+ * @param field
1360
+ * @returns
1361
+ */
1362
+ repeat(field) {
1363
+ let config = {
1364
+ type: 'repeat',
1365
+ key: field.id,
1366
+ props: {
1367
+ type: 'default',
1368
+ label: field.name,
1369
+ },
1370
+ fieldArray: {
1371
+ fieldGroup: [],
1372
+ },
1373
+ };
1374
+ return config;
1375
+ }
1376
+ tree(field) {
1377
+ let config = {
1378
+ type: 'tree',
1379
+ key: field.id,
1380
+ defaultValue: null,
1381
+ props: {
1382
+ label: field.name,
1383
+ treeId: field.refId,
1384
+ required: field?.required == true ? true : false,
1385
+ placeholder: `请选择${field.name}`,
1386
+ layout: 'default',
1387
+ selectType: field?.multiple == true ? 'multiple' : 'single',
1388
+ },
1389
+ };
1390
+ return config;
1391
+ }
1392
+ lookup(field) {
1393
+ let config = {
1394
+ type: 'lookup',
1395
+ key: field.id,
1396
+ defaultValue: null,
1397
+ props: {
1398
+ label: field.name,
1399
+ required: field?.required == true ? true : false,
1400
+ placeholder: `请选择${field.name}`,
1401
+ layout: 'default',
1402
+ selectType: field?.multiple == true ? 'multiple' : 'single',
1403
+ },
1404
+ };
1405
+ return config;
1406
+ }
1407
+ lookupMany(field) {
1408
+ let config = {
1409
+ type: 'one2many',
1410
+ key: field.id,
1411
+ defaultValue: null,
1412
+ props: {
1413
+ label: field.name,
1414
+ required: field?.required == true ? true : false,
1415
+ placeholder: `请选择${field.name}`,
1416
+ layout: 'default',
1417
+ selectType: 'multiple',
1418
+ },
1419
+ };
1420
+ return config;
1421
+ }
1422
+ /**
1423
+ * 附件 类型
1424
+ * @param field
1425
+ * @param precision
1426
+ * @returns
1427
+ */
1428
+ upload(field) {
1429
+ let config = {
1430
+ type: 'upload',
1431
+ key: field.id,
1432
+ defaultValue: null,
1433
+ props: {
1434
+ label: field.name,
1435
+ required: field?.required == true ? true : false,
1436
+ placeholder: `请上传${field.name}`,
1437
+ layout: 'default',
1438
+ },
1439
+ };
1440
+ if (field?.max != undefined && field?.max != null && field?.max > 0) {
1441
+ config.props['max'] = field.max;
1442
+ }
1443
+ return config;
1444
+ }
1445
+ indicator(field) {
1446
+ let indTypeValue = 'KPI';
1447
+ let evalTypeValue = 'SCORE';
1448
+ if (field?.indType) {
1449
+ indTypeValue = field.indType;
1450
+ }
1451
+ if (field?.evalType) {
1452
+ evalTypeValue = field.evalType;
1453
+ }
1454
+ let group = [
1455
+ {
1456
+ key: `name`,
1457
+ type: 'text',
1458
+ props: {
1459
+ label: '指标名称',
1460
+ placeholder: `请输入指标名称`,
1461
+ required: true,
1462
+ minLength: 0,
1463
+ maxLength: 500,
1464
+ layout: 'default',
1465
+ },
1466
+ className: 'full-row',
1467
+ defaultValue: field?.name,
1468
+ },
1469
+ {
1470
+ key: `indType`,
1471
+ type: 'select',
1472
+ props: {
1473
+ label: '指标类型',
1474
+ placeholder: `请选择指标类型`,
1475
+ required: false,
1476
+ layout: 'default',
1477
+ options: IndicatorType(),
1478
+ },
1479
+ editor: false,
1480
+ defaultValue: indTypeValue,
1481
+ },
1482
+ {
1483
+ key: `evalType`,
1484
+ type: 'select',
1485
+ props: {
1486
+ label: '评估方式',
1487
+ placeholder: `请选择评估方式`,
1488
+ required: false,
1489
+ layout: 'default',
1490
+ options: EvalType(),
1491
+ },
1492
+ editor: false,
1493
+ defaultValue: evalTypeValue,
1494
+ },
1495
+ ];
1496
+ if (field?.listItem && Array.isArray(field?.listItem)) {
1497
+ field.listItem.forEach((item) => {
1498
+ item.id = `item_${item.id}`;
1499
+ let newItem = this.fieldSourceType(item);
1500
+ if (newItem) {
1501
+ group.push(newItem);
1502
+ }
1503
+ });
1504
+ }
1505
+ if (field?.indType == 'KPI') {
1506
+ group.push({
1507
+ key: `weight`,
1508
+ type: 'number',
1509
+ props: {
1510
+ label: '指标权重',
1511
+ placeholder: `请输入指标权重`,
1512
+ required: true,
1513
+ min: -100,
1514
+ max: 300,
1515
+ layout: 'default',
1516
+ unit: '%',
1517
+ },
1518
+ defaultValue: 0,
1519
+ });
1520
+ }
1521
+ group.push({
1522
+ key: `desc`,
1523
+ type: 'textarea',
1524
+ props: {
1525
+ label: '指标描述',
1526
+ placeholder: `请输入指标描述`,
1527
+ required: false,
1528
+ minLength: 0,
1529
+ maxLength: 800,
1530
+ rows: 3,
1531
+ layout: 'default',
1532
+ },
1533
+ defaultValue: field?.description,
1534
+ });
1535
+ let indKey = Guid.createId();
1536
+ let config = {
1537
+ type: 'indicator',
1538
+ key: `ind_${indKey}`,
1539
+ defaultValue: null,
1540
+ props: {
1541
+ indConfig: {
1542
+ indType: indTypeValue,
1543
+ sourceId: field.id,
1544
+ sourceType: 'LIBRARY',
1545
+ izAllowDel: true,
1546
+ izEditName: true,
1547
+ izEditDesc: true,
1548
+ izEditWeight: true,
1549
+ },
1550
+ },
1551
+ fieldGroup: group,
1552
+ };
1553
+ return config;
1554
+ }
1555
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FieldSourceService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1556
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FieldSourceService });
1557
+ }
1558
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FieldSourceService, decorators: [{
1559
+ type: Injectable
1560
+ }] });
1561
+
1562
+ class FieldService {
1563
+ fieldTypeSrv;
1564
+ fieldSourceSrv;
1565
+ constructor(fieldTypeSrv, fieldSourceSrv) {
1566
+ this.fieldTypeSrv = fieldTypeSrv;
1567
+ this.fieldSourceSrv = fieldSourceSrv;
1568
+ }
1569
+ /**
1570
+ * 默认字段
1571
+ * @param currentData
1572
+ * @param currentIndex
1573
+ * @param previousData
1574
+ * @param previousIndex
1575
+ * @returns
1576
+ */
1577
+ transferBasicType(currentData, currentIndex, previousData, previousIndex) {
1578
+ let previous = previousData[previousIndex];
1579
+ let formField = this.fieldTypeSrv.fieldBasicType(previous.type);
1580
+ currentData.splice(currentIndex, 0, formField);
1581
+ }
1582
+ /**
1583
+ * 表单对象
1584
+ * @param currentData
1585
+ * @param currentIndex
1586
+ * @param previousData
1587
+ * @param previousIndex
1588
+ * @returns
1589
+ */
1590
+ transferSourceType(currentData, currentIndex, previousData, previousIndex) {
1591
+ let previous = previousData[previousIndex];
1592
+ if (previous) {
1593
+ let formField = this.fieldSourceSrv.fieldSourceType(previous);
1594
+ currentData.splice(currentIndex, 0, formField);
1595
+ }
1596
+ }
1597
+ /**
1598
+ * 根据设计更改表字段状态
1599
+ * @param fields
1600
+ * @param tableInfo
1601
+ */
1602
+ tableFieldState(fields, tableInfo) {
1603
+ if (tableInfo && tableInfo.single && tableInfo.single.length > 0) {
1604
+ let source = [];
1605
+ this.getFieldListBySource(fields, source);
1606
+ tableInfo.single.forEach((table) => {
1607
+ if (table.listField && table.listField.length > 0) {
1608
+ table.listField.forEach((item) => {
1609
+ if (source.some((v) => {
1610
+ return v.key == item.id;
1611
+ })) {
1612
+ item.ref = true;
1613
+ }
1614
+ else {
1615
+ item.ref = false;
1616
+ }
1617
+ });
1618
+ }
1619
+ });
1620
+ if (tableInfo.multiple && tableInfo.multiple.length > 0) {
1621
+ tableInfo.multiple.forEach((table) => {
1622
+ if (source.some((v) => {
1623
+ return v.key == table.id;
1624
+ })) {
1625
+ table.ref = true;
1626
+ }
1627
+ else {
1628
+ table.ref = false;
1629
+ }
1630
+ });
1631
+ }
1632
+ }
1633
+ }
1634
+ /**
1635
+ * 根据Key 获取表字段
1636
+ * @param key
1637
+ * @param tableInfo
1638
+ * @returns
1639
+ */
1640
+ tableFieldByKey(key, tableInfo) {
1641
+ let result = null;
1642
+ if (tableInfo && tableInfo.single && tableInfo.single.length > 0) {
1643
+ tableInfo.single.forEach((table) => {
1644
+ if (table.listField && table.listField.length > 0) {
1645
+ table.listField.forEach((item) => {
1646
+ if (key == item.id) {
1647
+ result = item;
1648
+ }
1649
+ });
1650
+ }
1651
+ });
1652
+ }
1653
+ if (tableInfo && tableInfo.multiple && tableInfo.multiple.length > 0) {
1654
+ tableInfo.multiple.forEach((table) => {
1655
+ if (key == table.id) {
1656
+ result = table;
1657
+ }
1658
+ });
1659
+ }
1660
+ return result;
1661
+ }
1662
+ getFieldListBySource(fields, source) {
1663
+ if (fields && fields.length > 0) {
1664
+ fields.forEach((field) => {
1665
+ if (field.type == 'grid') {
1666
+ this.getFieldListBySource(field.fieldGroup, source);
1667
+ }
1668
+ else if (field.type == 'list') {
1669
+ this.getFieldListBySource(field.fieldGroup, source);
1670
+ }
1671
+ else if (field.type == 'repeat') {
1672
+ if (field.key) {
1673
+ source.push(field);
1674
+ }
1675
+ }
1676
+ else {
1677
+ if (field.key) {
1678
+ source.push(field);
1679
+ }
1680
+ }
1681
+ });
1682
+ }
1683
+ }
1684
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FieldService, deps: [{ token: FieldTypeService }, { token: FieldSourceService }], target: i0.ɵɵFactoryTarget.Injectable });
1685
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FieldService });
1686
+ }
1687
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FieldService, decorators: [{
1688
+ type: Injectable
1689
+ }], ctorParameters: () => [{ type: FieldTypeService, decorators: [{
1690
+ type: Inject,
1691
+ args: [FieldTypeService]
1692
+ }] }, { type: FieldSourceService, decorators: [{
1693
+ type: Inject,
1694
+ args: [FieldSourceService]
1695
+ }] }] });
1696
+
1697
+ class EmptyFieldComponent {
1698
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EmptyFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1699
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: EmptyFieldComponent, isStandalone: true, selector: "empty-field", ngImport: i0, template: ` <div class="image"><img src="assets/images/default/empty9.png" /></div>
1700
+ <div class="desc">
1701
+ <span>暂无数据</span>
1702
+ </div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] });
1703
+ }
1704
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EmptyFieldComponent, decorators: [{
1705
+ type: Component,
1706
+ args: [{
1707
+ selector: 'empty-field',
1708
+ template: ` <div class="image"><img src="assets/images/default/empty9.png" /></div>
1709
+ <div class="desc">
1710
+ <span>暂无数据</span>
1711
+ </div>`,
1712
+ imports: [
1713
+ CommonModule
1714
+ ]
1715
+ }]
1716
+ }] });
1717
+
1718
+ class EmptySettingComponent {
1719
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EmptySettingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1720
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: EmptySettingComponent, isStandalone: true, selector: "empty-setting", ngImport: i0, template: `
1721
+ <div class="image"><img src="assets/images/default/empty2.png" /></div>
1722
+ <div class="desc">
1723
+ <span>请选中字段</span>
1724
+ </div>
1725
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] });
1726
+ }
1727
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EmptySettingComponent, decorators: [{
1728
+ type: Component,
1729
+ args: [{
1730
+ selector: 'empty-setting',
1731
+ template: `
1732
+ <div class="image"><img src="assets/images/default/empty2.png" /></div>
1733
+ <div class="desc">
1734
+ <span>请选中字段</span>
1735
+ </div>
1736
+ `,
1737
+ imports: [
1738
+ CommonModule
1739
+ ]
1740
+ }]
1741
+ }] });
1742
+
1743
+ class FieldBasic {
1744
+ field = {};
1745
+ get to() {
1746
+ return this.field.props || {};
1747
+ }
1748
+ get placeholder() {
1749
+ return this.to.placeholder || '';
1750
+ }
1751
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FieldBasic, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1752
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: FieldBasic, isStandalone: true, inputs: { field: "field" }, ngImport: i0 });
1753
+ }
1754
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FieldBasic, decorators: [{
1755
+ type: Directive
1756
+ }], propDecorators: { field: [{
1757
+ type: Input
1758
+ }] } });
1759
+
1760
+ class SafeHtmlPipe {
1761
+ sanitized;
1762
+ constructor(sanitized) {
1763
+ this.sanitized = sanitized;
1764
+ }
1765
+ transform(value) {
1766
+ return this.sanitized.bypassSecurityTrustHtml(value);
1767
+ }
1768
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SafeHtmlPipe, deps: [{ token: i1$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
1769
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: SafeHtmlPipe, isStandalone: true, name: "safeHtml" });
1770
+ }
1771
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SafeHtmlPipe, decorators: [{
1772
+ type: Pipe,
1773
+ args: [{ name: 'safeHtml' }]
1774
+ }], ctorParameters: () => [{ type: i1$2.DomSanitizer }] });
1775
+
1776
+ const EDITOR_VALUE_ACCESSOR = {
1777
+ provide: NG_VALUE_ACCESSOR,
1778
+ useExisting: forwardRef(() => InlineEditorComponent),
1779
+ multi: true,
1780
+ };
1781
+ class InlineEditorComponent {
1782
+ _value = "";
1783
+ _classList = {};
1784
+ debounce = '100';
1785
+ placeholder = '';
1786
+ className = 'inline_editor';
1787
+ brMode = true;
1788
+ blur = new EventEmitter();
1789
+ focus = new EventEmitter();
1790
+ disabled = false;
1791
+ data = "";
1792
+ active = false;
1793
+ constructor() { }
1794
+ ngOnInit() {
1795
+ }
1796
+ handleFocus(evt) {
1797
+ this.focus.emit(evt);
1798
+ }
1799
+ handleBlur(evt) {
1800
+ this.active = false;
1801
+ this.blur.emit(evt);
1802
+ }
1803
+ get value() {
1804
+ return this._value;
1805
+ }
1806
+ set value(v) {
1807
+ if (v !== this._value) {
1808
+ this._value = v;
1809
+ this.onChange(v);
1810
+ }
1811
+ }
1812
+ onContenteditableModelChange(evt) {
1813
+ this.onTouched();
1814
+ this.onChange(evt);
1815
+ }
1816
+ /**
1817
+ * Implements ControlValueAccessor
1818
+ */
1819
+ writeValue(value) {
1820
+ this._value = value;
1821
+ }
1822
+ onChange(_) { }
1823
+ onTouched() { }
1824
+ registerOnChange(fn) {
1825
+ this.onChange = fn;
1826
+ }
1827
+ registerOnTouched(fn) {
1828
+ this.onTouched = fn;
1829
+ }
1830
+ inlineClick() {
1831
+ this.active = true;
1832
+ }
1833
+ onBlur() {
1834
+ this.active = false;
1835
+ }
1836
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: InlineEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1837
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: InlineEditorComponent, isStandalone: true, selector: "inline-editor", inputs: { debounce: "debounce", placeholder: "placeholder", className: "className", brMode: "brMode", disabled: "disabled", data: "data", active: "active", value: "value" }, outputs: { blur: "blur", focus: "focus" }, providers: [EDITOR_VALUE_ACCESSOR], ngImport: i0, template: `
1838
+ <input *ngIf="active==true" nz-input [(ngModel)]="value"/>
1839
+ <div *ngIf="active==false"
1840
+ class="inline_editor_show"
1841
+ [innerHTML]="value | safeHtml" (click)="inlineClick()">
1842
+ </div>
1843
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: NzInputModule }, { kind: "directive", type: i5.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzSize", "nzStepperless", "nzStatus", "disabled"], exportAs: ["nzInput"] }, { kind: "pipe", type: SafeHtmlPipe, name: "safeHtml" }] });
1844
+ }
1845
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: InlineEditorComponent, decorators: [{
1846
+ type: Component,
1847
+ args: [{
1848
+ selector: 'inline-editor',
1849
+ providers: [EDITOR_VALUE_ACCESSOR],
1850
+ template: `
1851
+ <input *ngIf="active==true" nz-input [(ngModel)]="value"/>
1852
+ <div *ngIf="active==false"
1853
+ class="inline_editor_show"
1854
+ [innerHTML]="value | safeHtml" (click)="inlineClick()">
1855
+ </div>
1856
+ `,
1857
+ imports: [
1858
+ CommonModule,
1859
+ FormsModule,
1860
+ ReactiveFormsModule,
1861
+ NzInputModule,
1862
+ SafeHtmlPipe
1863
+ ]
1864
+ }]
1865
+ }], ctorParameters: () => [], propDecorators: { debounce: [{
1866
+ type: Input
1867
+ }], placeholder: [{
1868
+ type: Input
1869
+ }], className: [{
1870
+ type: Input
1871
+ }], brMode: [{
1872
+ type: Input
1873
+ }], blur: [{
1874
+ type: Output
1875
+ }], focus: [{
1876
+ type: Output
1877
+ }], disabled: [{
1878
+ type: Input
1879
+ }], data: [{
1880
+ type: Input
1881
+ }], active: [{
1882
+ type: Input
1883
+ }], value: [{
1884
+ type: Input
1885
+ }] } });
1886
+
1887
+ class FieldRadioGroup extends FieldBasic {
1888
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FieldRadioGroup, deps: null, target: i0.ɵɵFactoryTarget.Component });
1889
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: FieldRadioGroup, isStandalone: true, selector: "deon-field-radiogroup", usesInheritance: true, ngImport: i0, template: `
1890
+ <div class="radiogroup-box">
1891
+ <ng-container *ngFor="let option of to.options">
1892
+ <div class="item-box">
1893
+ <label nz-radio nzDisabled="true"></label>
1894
+ <inline-editor [(ngModel)]="option.label" ></inline-editor>
1895
+ </div>
1896
+ </ng-container>
1897
+ </div>
1898
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: NzRadioModule }, { kind: "component", type: i3.NzRadioComponent, selector: "[nz-radio],[nz-radio-button]", inputs: ["nzValue", "nzDisabled", "nzAutoFocus", "nz-radio-button"], exportAs: ["nzRadio"] }, { kind: "component", type: InlineEditorComponent, selector: "inline-editor", inputs: ["debounce", "placeholder", "className", "brMode", "disabled", "data", "active", "value"], outputs: ["blur", "focus"] }] });
1899
+ }
1900
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FieldRadioGroup, decorators: [{
1901
+ type: Component,
1902
+ args: [{
1903
+ selector: 'deon-field-radiogroup',
1904
+ template: `
1905
+ <div class="radiogroup-box">
1906
+ <ng-container *ngFor="let option of to.options">
1907
+ <div class="item-box">
1908
+ <label nz-radio nzDisabled="true"></label>
1909
+ <inline-editor [(ngModel)]="option.label" ></inline-editor>
1910
+ </div>
1911
+ </ng-container>
1912
+ </div>
1913
+ `,
1914
+ imports: [
1915
+ CommonModule,
1916
+ FormsModule,
1917
+ ReactiveFormsModule,
1918
+ NzRadioModule,
1919
+ InlineEditorComponent
1920
+ ]
1921
+ }]
1922
+ }] });
1923
+
1924
+ class FieldTemplate {
1925
+ componentFactoryResolver;
1926
+ changeDetectorRef;
1927
+ dynamicComponents = {
1928
+ radiogroup: FieldRadioGroup
1929
+ };
1930
+ component;
1931
+ componentHost;
1932
+ _field = {};
1933
+ set field(value) {
1934
+ if (value != null && value != undefined) {
1935
+ this._field = value;
1936
+ }
1937
+ if (this.componentHost) {
1938
+ this.componentHost.clear();
1939
+ if (this._field != undefined &&
1940
+ this._field != null &&
1941
+ this._field.type != undefined &&
1942
+ this._field.type != null &&
1943
+ this._field.type != 'list') {
1944
+ const compFactory = this.componentFactoryResolver.resolveComponentFactory(this.dynamicComponents[this._field.type]);
1945
+ this.component = this.componentHost.createComponent(compFactory);
1946
+ this.component.instance.field = this._field;
1947
+ }
1948
+ }
1949
+ }
1950
+ fieldChange = new EventEmitter();
1951
+ constructor(componentFactoryResolver, changeDetectorRef) {
1952
+ this.componentFactoryResolver = componentFactoryResolver;
1953
+ this.changeDetectorRef = changeDetectorRef;
1954
+ }
1955
+ ngOnInit() { }
1956
+ ngOnChanges(changes) { }
1957
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FieldTemplate, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1958
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: FieldTemplate, isStandalone: true, selector: "field-template", inputs: { field: "field" }, outputs: { fieldChange: "fieldChange" }, viewQueries: [{ propertyName: "componentHost", first: true, predicate: ["componentHost"], descendants: true, read: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, template: ` <ng-container #componentHost></ng-container> `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] });
1959
+ }
1960
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FieldTemplate, decorators: [{
1961
+ type: Component,
1962
+ args: [{
1963
+ selector: 'field-template',
1964
+ template: ` <ng-container #componentHost></ng-container> `,
1965
+ imports: [
1966
+ CommonModule
1967
+ ]
1968
+ }]
1969
+ }], ctorParameters: () => [{ type: i0.ComponentFactoryResolver }, { type: i0.ChangeDetectorRef }], propDecorators: { componentHost: [{
1970
+ type: ViewChild,
1971
+ args: ['componentHost', { read: ViewContainerRef, static: true }]
1972
+ }], field: [{
1973
+ type: Input
1974
+ }], fieldChange: [{
1975
+ type: Output
1976
+ }] } });
1977
+
1978
+ class FieldDefault {
1979
+ sn = 1;
1980
+ field = {
1981
+ props: {
1982
+ label: null,
1983
+ },
1984
+ };
1985
+ addItem = new EventEmitter();
1986
+ btnAddItem() {
1987
+ this.addItem.emit();
1988
+ }
1989
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FieldDefault, deps: [], target: i0.ɵɵFactoryTarget.Component });
1990
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: FieldDefault, isStandalone: true, selector: "field-default", inputs: { sn: "sn", field: "field" }, outputs: { addItem: "addItem" }, ngImport: i0, template: "<deon-design-simple-label [field]=\"field\">\n <div class=\"question-sn\">{{sn}}</div>\n <div class=\"question-title\">\n <inline-editor [(ngModel)]=\"field.props.label\"></inline-editor>\n </div>\n</deon-design-simple-label>\n\n<field-template [field]=\"field\"></field-template>\n\n<div class=\"field-op\" *ngIf=\"field.active==true\">\n <a (click)=\"btnAddItem()\">\u6DFB\u52A0\u5355\u4E2A\u9009\u9879</a>\n</div>", styles: [":host ::ng-deep{position:relative;width:100%;background-color:#fdf6ed4d}:host ::ng-deep deon-design-simple-label{display:flex;flex-direction:row;align-items:center;padding:0 0 12px}:host ::ng-deep deon-design-simple-label .question-sn{margin-right:5px}:host ::ng-deep deon-design-simple-label .question-title{flex:1}:host ::ng-deep inline-editor .ant-input{border:0;background:#ececec;color:#000000a6}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: FormlyModule }, { kind: "ngmodule", type: NzIconModule }, { kind: "ngmodule", type: NzInputModule }, { kind: "component", type: FieldTemplate, selector: "field-template", inputs: ["field"], outputs: ["fieldChange"] }, { kind: "component", type: DeonDesignSimpleLabel, selector: "deon-design-simple-label", inputs: ["field"] }, { kind: "component", type: InlineEditorComponent, selector: "inline-editor", inputs: ["debounce", "placeholder", "className", "brMode", "disabled", "data", "active", "value"], outputs: ["blur", "focus"] }] });
1991
+ }
1992
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FieldDefault, decorators: [{
1993
+ type: Component,
1994
+ args: [{ selector: 'field-default', imports: [
1995
+ CommonModule,
1996
+ FormsModule,
1997
+ ReactiveFormsModule,
1998
+ FormlyModule,
1999
+ NzIconModule,
2000
+ NzInputModule,
2001
+ FieldTemplate,
2002
+ DeonDesignSimpleLabel,
2003
+ InlineEditorComponent
2004
+ ], template: "<deon-design-simple-label [field]=\"field\">\n <div class=\"question-sn\">{{sn}}</div>\n <div class=\"question-title\">\n <inline-editor [(ngModel)]=\"field.props.label\"></inline-editor>\n </div>\n</deon-design-simple-label>\n\n<field-template [field]=\"field\"></field-template>\n\n<div class=\"field-op\" *ngIf=\"field.active==true\">\n <a (click)=\"btnAddItem()\">\u6DFB\u52A0\u5355\u4E2A\u9009\u9879</a>\n</div>", styles: [":host ::ng-deep{position:relative;width:100%;background-color:#fdf6ed4d}:host ::ng-deep deon-design-simple-label{display:flex;flex-direction:row;align-items:center;padding:0 0 12px}:host ::ng-deep deon-design-simple-label .question-sn{margin-right:5px}:host ::ng-deep deon-design-simple-label .question-title{flex:1}:host ::ng-deep inline-editor .ant-input{border:0;background:#ececec;color:#000000a6}\n"] }]
2005
+ }], propDecorators: { sn: [{
2006
+ type: Input
2007
+ }], field: [{
2008
+ type: Input
2009
+ }], addItem: [{
2010
+ type: Output
2011
+ }] } });
2012
+
2013
+ class ContentComponent {
2014
+ state = 'view';
2015
+ field = null;
2016
+ isOperation = true;
2017
+ fieldDelEvent = new EventEmitter();
2018
+ constructor() { }
2019
+ ngOnInit() { }
2020
+ fieldDelete(e) {
2021
+ this.fieldDelEvent.emit(e);
2022
+ }
2023
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2024
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: ContentComponent, isStandalone: true, selector: "content", inputs: { state: "state", field: "field", isOperation: "isOperation" }, outputs: { fieldDelEvent: "fieldDelEvent" }, ngImport: i0, template: "<div class=\"el-item\" [ngClass]=\"{\n 'item-active': field?.active == true,\n 'layout-default': field.props?.layout == 'default',\n 'layout-upDown': field.props?.layout == 'upDown'\n }\">\n <ng-content></ng-content>\n <ng-container *ngIf=\"field?.active == true && isOperation == true\">\n <div class=\"widget-drag\" cdkDragHandle><span nz-icon nzType=\"drag\"></span></div>\n <div class=\"widget-delete\" (click)=\"fieldDelete($event)\"><span nz-icon nzType=\"delete\"></span></div>\n </ng-container>\n <div cdkDragHandle style=\"display: none\"></div>\n\n <div class=\"example-custom-placeholder\" *cdkDragPlaceholder></div>\n</div>", styles: [":host ::ng-deep{position:relative}:host ::ng-deep .el-item{position:relative;display:inline-block;width:100%;min-height:64px;padding:18px 30px}:host ::ng-deep .item-active{border:2px solid #1177fb;padding:18px 30px 10px}:host ::ng-deep .field-op{display:flex;padding:15px 0 0}:host ::ng-deep .widget-drag{position:absolute;top:-2px;bottom:-18px;left:-2px;z-index:9;width:26px;height:28px;color:#fff;line-height:28px;text-align:center;background:#1177fb;cursor:move}:host ::ng-deep .widget-delete{position:absolute;right:0;bottom:0;z-index:9;width:26px;height:28px;color:#fff;line-height:28px;text-align:center;background:#1177fb;cursor:pointer}:host ::ng-deep .example-custom-placeholder{background:#ccc;border:dotted 3px #999;transition:transform .25s cubic-bezier(0,0,.2,1)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2$1.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "directive", type: i2$1.CdkDragPlaceholder, selector: "ng-template[cdkDragPlaceholder]", inputs: ["data"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i8.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }] });
2025
+ }
2026
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ContentComponent, decorators: [{
2027
+ type: Component,
2028
+ args: [{ selector: 'content', imports: [
2029
+ CommonModule,
2030
+ FormsModule,
2031
+ ReactiveFormsModule,
2032
+ DragDropModule,
2033
+ NzIconModule
2034
+ ], template: "<div class=\"el-item\" [ngClass]=\"{\n 'item-active': field?.active == true,\n 'layout-default': field.props?.layout == 'default',\n 'layout-upDown': field.props?.layout == 'upDown'\n }\">\n <ng-content></ng-content>\n <ng-container *ngIf=\"field?.active == true && isOperation == true\">\n <div class=\"widget-drag\" cdkDragHandle><span nz-icon nzType=\"drag\"></span></div>\n <div class=\"widget-delete\" (click)=\"fieldDelete($event)\"><span nz-icon nzType=\"delete\"></span></div>\n </ng-container>\n <div cdkDragHandle style=\"display: none\"></div>\n\n <div class=\"example-custom-placeholder\" *cdkDragPlaceholder></div>\n</div>", styles: [":host ::ng-deep{position:relative}:host ::ng-deep .el-item{position:relative;display:inline-block;width:100%;min-height:64px;padding:18px 30px}:host ::ng-deep .item-active{border:2px solid #1177fb;padding:18px 30px 10px}:host ::ng-deep .field-op{display:flex;padding:15px 0 0}:host ::ng-deep .widget-drag{position:absolute;top:-2px;bottom:-18px;left:-2px;z-index:9;width:26px;height:28px;color:#fff;line-height:28px;text-align:center;background:#1177fb;cursor:move}:host ::ng-deep .widget-delete{position:absolute;right:0;bottom:0;z-index:9;width:26px;height:28px;color:#fff;line-height:28px;text-align:center;background:#1177fb;cursor:pointer}:host ::ng-deep .example-custom-placeholder{background:#ccc;border:dotted 3px #999;transition:transform .25s cubic-bezier(0,0,.2,1)}\n"] }]
2035
+ }], ctorParameters: () => [], propDecorators: { state: [{
2036
+ type: Input
2037
+ }], field: [{
2038
+ type: Input
2039
+ }], isOperation: [{
2040
+ type: Input
2041
+ }], fieldDelEvent: [{
2042
+ type: Output
2043
+ }] } });
2044
+
2045
+ class SurveyDesignComponent {
2046
+ modal;
2047
+ deonFormBuilder;
2048
+ fieldSrv;
2049
+ formUtilService;
2050
+ /**
2051
+ * 当前选择字段
2052
+ */
2053
+ activeField = null;
2054
+ sourceField = null;
2055
+ dlq;
2056
+ dls = [];
2057
+ _listPage = [];
2058
+ set listPage(value) {
2059
+ this._listPage = value;
2060
+ }
2061
+ get listPage() {
2062
+ return this._listPage;
2063
+ }
2064
+ pageSelectedIndex = 0;
2065
+ state = 'view';
2066
+ actionEvent = new EventEmitter();
2067
+ constructor(modal, deonFormBuilder, fieldSrv, formUtilService) {
2068
+ this.modal = modal;
2069
+ this.deonFormBuilder = deonFormBuilder;
2070
+ this.fieldSrv = fieldSrv;
2071
+ this.formUtilService = formUtilService;
2072
+ }
2073
+ ngOnInit() { }
2074
+ ngAfterViewInit() {
2075
+ this.dlq.changes.subscribe(() => {
2076
+ let ldls = [];
2077
+ this.dlq.forEach((dl) => {
2078
+ ldls.push(dl);
2079
+ });
2080
+ ldls = ldls.reverse();
2081
+ asapScheduler.schedule(() => {
2082
+ this.dls = ldls;
2083
+ const siblings = this.dls.map((dl) => dl?._dropListRef);
2084
+ this.dlq.forEach((dl) => {
2085
+ dl._dropListRef._getSiblingContainerFromPosition = (item, x, y) => siblings.find((sibling) => sibling._canReceive(item, x, y));
2086
+ });
2087
+ });
2088
+ });
2089
+ }
2090
+ pageSelectedClick(e) { }
2091
+ btnPageDelete(e) {
2092
+ this.modal.confirm({
2093
+ nzTitle: '提示',
2094
+ nzContent: '删除页,相关的题目也会被删除,您是否继续删除?',
2095
+ nzOnOk: () => {
2096
+ this.listPage = this.listPage.filter((page, index) => {
2097
+ return e != index;
2098
+ });
2099
+ this.formInfoEmit();
2100
+ }
2101
+ });
2102
+ }
2103
+ drop(event) {
2104
+ if (_.get(event, 'previousContainer.data.type_base')) {
2105
+ this.fieldSrv.transferBasicType(event.container.data, event.currentIndex, event.previousContainer.data['type_base'], event.previousIndex);
2106
+ }
2107
+ else {
2108
+ moveItemInArray(event.container.data, event.previousIndex, event.currentIndex);
2109
+ }
2110
+ this.formInfoEmit();
2111
+ }
2112
+ ngOnChanges(changes) {
2113
+ }
2114
+ ngOnDestroy() { }
2115
+ /**
2116
+ * 抛出事件
2117
+ */
2118
+ formInfoEmit() {
2119
+ this.actionEvent.emit(_.cloneDeep(this.listPage));
2120
+ }
2121
+ /**
2122
+ * 获取题目序号
2123
+ * @param pageIndex
2124
+ * @param questionIndex
2125
+ * @returns
2126
+ */
2127
+ getQuestionSn(pageIndex, questionIndex) {
2128
+ let num = 0;
2129
+ for (let i = 0; i < pageIndex; i++) {
2130
+ num = num + this.listPage[i].listField.length;
2131
+ }
2132
+ num = num + questionIndex + 1;
2133
+ return num;
2134
+ }
2135
+ activeFieldChange(e) {
2136
+ this.activeField;
2137
+ this.formInfoEmit();
2138
+ }
2139
+ deleteFieldIndex(pageIndex, fieldIndex, event) {
2140
+ event.stopPropagation();
2141
+ this.modal.confirm({
2142
+ nzTitle: '提示',
2143
+ nzContent: '您确定需要删除该题目吗',
2144
+ nzOnOk: () => {
2145
+ this.listPage.forEach((page, i) => {
2146
+ if (i == pageIndex) {
2147
+ let fieldNews = page.listField.filter((item, j) => {
2148
+ return fieldIndex != j;
2149
+ });
2150
+ page.listField = fieldNews;
2151
+ }
2152
+ });
2153
+ this.activeField = null;
2154
+ this.formInfoEmit();
2155
+ }
2156
+ });
2157
+ }
2158
+ /**
2159
+ * 初始化字段
2160
+ */
2161
+ initActive() {
2162
+ this.activeField = null;
2163
+ this.listPage.forEach((page) => {
2164
+ if (page?.listField) {
2165
+ page.listField.forEach((item) => {
2166
+ item["active"] = false;
2167
+ });
2168
+ }
2169
+ });
2170
+ }
2171
+ /**
2172
+ * 点击选中字段
2173
+ * @param e
2174
+ * @param event
2175
+ */
2176
+ fieldActive(e, event, source) {
2177
+ event.stopPropagation();
2178
+ this.activeField = e;
2179
+ this.listPage.forEach((page) => {
2180
+ if (page?.listField) {
2181
+ page.listField.forEach((field) => {
2182
+ if (field == e) {
2183
+ field.active = true;
2184
+ }
2185
+ else {
2186
+ field.active = false;
2187
+ }
2188
+ });
2189
+ }
2190
+ });
2191
+ }
2192
+ //添加选项
2193
+ btnAddFieldItem(e) {
2194
+ e.props.options.push({
2195
+ label: "选项",
2196
+ value: "1",
2197
+ score: 0
2198
+ });
2199
+ }
2200
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SurveyDesignComponent, deps: [{ token: i1$3.NzModalService }, { token: i2$2.FormlyFormBuilder }, { token: FieldService }, { token: i4.DeonFormUtilService }], target: i0.ɵɵFactoryTarget.Component });
2201
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: SurveyDesignComponent, isStandalone: true, selector: "suvey-design", inputs: { listPage: "listPage", state: "state" }, outputs: { actionEvent: "actionEvent" }, viewQueries: [{ propertyName: "dlq", predicate: CdkDropList, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"survey-design-simple\" cdkDropListGroup>\n <div class=\"box-west\">\n <field-type-basic [dls]=\"dls\"></field-type-basic>\n </div>\n <div class=\"box-content\">\n <nz-tabset [nzType]=\"'card'\" [nzSelectedIndex]=\"pageSelectedIndex\"\n (nzSelectedIndexChange)=\"pageSelectedClick($event)\">\n <ng-container *ngFor=\"let page of listPage; let pageIndex = index\">\n <nz-tab [nzTitle]=\"titleTemplate\">\n <ng-template #titleTemplate>\n <div>\n \u7B2C{{pageIndex+1}}\u9875\n <i *ngIf=\"pageIndex > 0\" nz-icon nzType=\"close\" (click)=\"btnPageDelete(pageIndex)\"\n class=\"ant-tabs-close-x\"></i>\n </div>\n </ng-template>\n <ng-template nz-tab>\n <div class=\"box-center\">\n <ng-content select=\"[name=content-info]\"></ng-content>\n <div cdkDropList [cdkDropListData]=\"page.listField\" class=\"field-list\" (cdkDropListDropped)=\"drop($event)\"\n [cdkDropListConnectedTo]=\"dls\">\n <ng-container *ngFor=\"let field of page.listField; let fieldIndex = index\">\n <div class=\"field-box\" cdkDrag>\n <content [field]=\"field\" [state]=\"state\" (click)=\"fieldActive(field, $event)\"\n (fieldDelEvent)=\"deleteFieldIndex(pageIndex,fieldIndex, $event)\">\n <field-default [field]=\"field\" [sn]=\"getQuestionSn(pageIndex,fieldIndex)\"\n (addItem)=\"btnAddFieldItem(field)\"></field-default>\n </content>\n </div>\n </ng-container>\n <div class=\"field-box test\" cdkDrag></div>\n </div>\n </div>\n </ng-template>\n </nz-tab>\n </ng-container>\n </nz-tabset>\n </div>\n <div class=\"box-east\">\n <ng-container *ngIf=\"activeField!!; else tmpSetting\">\n <setting-template [field]=\"activeField\" (fieldChange)=\"activeFieldChange($event)\">\n </setting-template>\n </ng-container>\n <ng-template #tmpSetting>\n <empty-setting></empty-setting>\n </ng-template>\n </div>\n</div>", styles: [".example-container{display:inline-block;width:400px;max-width:100%;margin:0 25px 25px 0;vertical-align:top}.example-list{display:block;min-height:60px;overflow:hidden;background:#fff;border:solid 1px #ccc;border-radius:4px}.example-box{display:flex;flex-direction:row;align-items:center;justify-content:space-between;box-sizing:border-box;padding:20px 10px;color:#000000de;font-size:14px;background:#fff;border-bottom:solid 1px #ccc;cursor:move}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:none}.field-list.cdk-drop-list-dragging .field-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}:host ::ng-deep{display:flex;flex:1;width:100%;height:100%}:host ::ng-deep .field-list{padding:0}:host ::ng-deep .field-box{width:100%;margin:0 0 15px;background:#fff;border-radius:4px;font-size:13px;color:#000000a6}:host ::ng-deep .field-box .required:before{color:red;content:\"*\";padding:0 8px 0 0}:host ::ng-deep field-default{display:flex;flex-direction:column;background:none}:host ::ng-deep field-default .radiogroup-box{display:flex;flex-direction:column}:host ::ng-deep field-default .radiogroup-box .item-box{display:flex;flex-direction:row;align-items:center}:host ::ng-deep field-default .radiogroup-box .ant-radio-inner{height:18px;width:18px}:host ::ng-deep field-default .radiogroup-box .item-box+.item-box{margin-top:10px}:host ::ng-deep .field-empty{height:300px;text-align:center}:host ::ng-deep empty-field{display:inline-block;width:150px;margin:150px 80px;text-align:center}:host ::ng-deep empty-field img{width:100%;margin:auto;text-align:center}:host ::ng-deep empty-setting{display:inline-block;width:auto;margin:100px 80px;text-align:center}:host ::ng-deep empty-setting img{width:100%;margin:auto;text-align:center}:host ::ng-deep .survey-design-simple{display:flex;flex-direction:row;flex:1;width:100%;height:100%;border-radius:4px;--ck-color-base-text: rgba(0, 0, 0, .85);--ck-color-text: rgba(0, 0, 0, .85);--ck-color-base-border: #e0e0e0;--ck-color-toolbar-border: #e0e0e0;--ck-font-size-base: 12px;--ck-line-height-base: 1.6;--ck-icon-size: 12px}:host ::ng-deep .survey-design-simple .ngx-codemirror{border:1px solid #ccc}:host ::ng-deep .survey-design-simple .box-west{width:245px;padding:5px 3px 0 15px;background-color:#fff;border-right:1px solid #eaeaea;overflow:auto}:host ::ng-deep .survey-design-simple .box-west .field-disable{pointer-events:none;opacity:.65;cursor:not-allowed;position:relative}:host ::ng-deep .survey-design-simple .box-west .field-disable:after{content:\"\\1f6ab\";position:absolute;top:12px;right:-1px;transform:translateY(-50%);font-size:1.2em}:host ::ng-deep .survey-design-simple .box-west field-type-basic ul{display:flex;flex-wrap:wrap;margin:0 0 10px;padding:0;list-style:none}:host ::ng-deep .survey-design-simple .box-west field-type-basic ul li{width:100px}:host ::ng-deep .survey-design-simple .box-west field-type-basic ul .title{display:inline-block;width:100%;margin-top:8px;color:#9b9b9b;font-size:12px}:host ::ng-deep .survey-design-simple .box-west field-type-basic ul .title:nth-last-child(1){margin:0}:host ::ng-deep .survey-design-simple .box-west field-type-basic ul .field{flex:0 1 auto;width:95px;height:32px;margin:5px 0;padding:0 5px;line-height:33px;text-align:center;border:1px solid #eaeaea;border-radius:4px;cursor:move}:host ::ng-deep .survey-design-simple .box-west field-type-basic ul .title+.field,:host ::ng-deep .survey-design-simple .box-west field-type-basic ul .field+.field,:host ::ng-deep .survey-design-simple .box-west field-type-basic ul .example-custom-placeholder+.field{margin-right:10px}:host ::ng-deep .survey-design-simple .box-content{display:flex;flex-direction:row;flex:1;overflow:auto;background:#f8f8fd;padding:12px 12px 0!important}:host ::ng-deep .survey-design-simple .box-content .ant-tabs-tabpane{overflow:auto}:host ::ng-deep .survey-design-simple .box-east{width:300px;padding:0 5px 0 12px;background-color:#fff;border-left:1px solid #eaeaea}:host ::ng-deep .survey-design-simple .box-east .paragraph-box{position:relative;margin-bottom:12px;padding:8px 8px 0;border:2px dashed #c4c4c4;border-radius:6px}:host ::ng-deep .survey-design-simple .box-east .paragraph-box .tab-delete{position:absolute;top:-8px;right:0;width:20px;text-align:center;background:#c4c4c4;border-radius:50px;cursor:pointer}:host ::ng-deep .survey-design-simple .box-east .paragraph:nth-child(1){margin-top:15px}:host ::ng-deep .survey-design-simple .box-east .paragraph{width:100%;margin:0 0 12px}:host ::ng-deep .survey-design-simple .box-east .paragraph label{display:inline-flex;margin-bottom:8px}:host ::ng-deep .survey-design-simple .box-east .paragraph nz-select,:host ::ng-deep .survey-design-simple .box-east .paragraph nz-input-number,:host ::ng-deep .survey-design-simple .box-east .paragraph nz-radio-group{width:100%}:host ::ng-deep .survey-design-simple .box-east .paragraph a{color:#1177fb}:host ::ng-deep .survey-design-simple .box-east .paragraph .ant-checkbox-wrapper{min-width:90px}:host ::ng-deep .survey-design-simple .box-east .paragraph .range{display:flex;flex-direction:row;align-items:center;width:100%;margin:0;padding:0;list-style:none}:host ::ng-deep .survey-design-simple .box-east .paragraph .range li{margin:0}:host ::ng-deep .survey-design-simple .box-east .paragraph .range li:nth-child(2){padding:0 8px}:host ::ng-deep .survey-design-simple .box-east .paragraph .rows{display:flex;flex-direction:row;align-items:center;margin-bottom:10px}:host ::ng-deep .survey-design-simple .box-east .paragraph .rows .anticon-minus-circle{margin:0 12px 0 10px;color:red;font-size:20px;cursor:pointer}:host ::ng-deep .survey-design-simple .box-east .paragraph .list{padding:0 10px 0 0}:host ::ng-deep .survey-design-simple .box-east .paragraph .list .rows{display:flex;flex-direction:row;padding:8px 6px;font-size:14px;border:1px dashed hsla(0,0%,67%,.7);border-radius:2px}:host ::ng-deep .survey-design-simple .box-east .paragraph .list .rows .anticon-minus-circle{font-size:16px}:host ::ng-deep .survey-design-simple .box-east .paragraph .list .rows .anticon-drag{margin-right:6px;font-size:14px;cursor:move}:host ::ng-deep .survey-design-simple .box-east .paragraph .list .rows .title{flex:1}:host ::ng-deep .survey-design-simple .box-east .empty-box{padding:80px 0 0;text-align:center}:host ::ng-deep .survey-design-simple .box-east .empty-box label{display:inline-block;width:100%;margin-top:15px}:host ::ng-deep .survey-design-simple .box-east .paragraph-options{display:flex;flex-direction:column}:host ::ng-deep .survey-design-simple .box-east .paragraph-options ul{display:flex;flex-direction:row;margin:0;padding:0;border-left:1px solid #eaeaea;border-bottom:1px solid #eaeaea}:host ::ng-deep .survey-design-simple .box-east .paragraph-options ul li{border-right:1px solid #eaeaea}:host ::ng-deep .survey-design-simple .box-east .paragraph-options ul li .ant-input,:host ::ng-deep .survey-design-simple .box-east .paragraph-options ul li .ant-input-number{border:0}:host ::ng-deep .survey-design-simple .box-east .paragraph-options ul li:nth-child(1){display:flex;flex:1}:host ::ng-deep .survey-design-simple .box-east .paragraph-options ul li:nth-child(2){display:flex;width:80px}:host ::ng-deep .survey-design-simple .box-east .paragraph-options ul li:nth-child(3){display:flex;width:80px;align-items:center;justify-content:center}:host ::ng-deep .survey-design-simple .box-east .paragraph-options ul li:nth-child(3) a+a{margin-left:8px}:host ::ng-deep .survey-design-simple .box-east .paragraph-options ul:nth-child(1){border-top:1px solid #eaeaea}:host ::ng-deep .survey-design-simple .box-east .paragraph-options ul:nth-child(1) li{display:flex;align-items:center;line-height:32px;justify-content:center;font-size:12px;font-weight:600}:host ::ng-deep .survey-design-simple .box-east .paragraph-options .add-item{padding:8px 10px;border:1px solid #eaeaea;border-top:0}:host ::ng-deep .survey-design-simple .example-custom-placeholder{width:100%;height:6px;background:#1177fb;transition:transform .25s cubic-bezier(0,0,.2,1)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: OverlayModule }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2$1.CdkDropListGroup, selector: "[cdkDropListGroup]", inputs: ["cdkDropListGroupDisabled"], exportAs: ["cdkDropListGroup"] }, { kind: "directive", type: i2$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "ngmodule", type: NzTabsModule }, { kind: "component", type: i7$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: i7$1.NzTabComponent, selector: "nz-tab", inputs: ["nzTitle", "nzClosable", "nzCloseIcon", "nzDisabled", "nzForceRender"], outputs: ["nzSelect", "nzDeselect", "nzClick", "nzContextmenu"], exportAs: ["nzTab"] }, { kind: "directive", type: i7$1.NzTabDirective, selector: "[nz-tab]", exportAs: ["nzTab"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i8.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzGridModule }, { kind: "ngmodule", type: NzTableModule }, { kind: "ngmodule", type: NzPopoverModule }, { kind: "component", type: FieldTypeBasic, selector: "field-type-basic", inputs: ["dls"] }, { kind: "component", type: FieldDefault, selector: "field-default", inputs: ["sn", "field"], outputs: ["addItem"] }, { kind: "component", type: SettingTemplate, selector: "setting-template", inputs: ["dialogPageData", "dialogFormData", "sourceType", "tableField", "isEditor", "field"], outputs: ["fieldChange", "fieldTypeChange", "repeatChange", "delGridCell"] }, { kind: "component", type: ContentComponent, selector: "content", inputs: ["state", "field", "isOperation"], outputs: ["fieldDelEvent"] }, { kind: "component", type: EmptySettingComponent, selector: "empty-setting" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2202
+ }
2203
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SurveyDesignComponent, decorators: [{
2204
+ type: Component,
2205
+ args: [{ selector: 'suvey-design', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
2206
+ CommonModule,
2207
+ FormsModule, ReactiveFormsModule, OverlayModule, DragDropModule,
2208
+ NzTabsModule,
2209
+ NzIconModule,
2210
+ NzGridModule,
2211
+ NzTableModule,
2212
+ NzPopoverModule,
2213
+ FieldTypeBasic,
2214
+ FieldDefault,
2215
+ SettingTemplate,
2216
+ ContentComponent,
2217
+ EmptySettingComponent,
2218
+ ], template: "<div class=\"survey-design-simple\" cdkDropListGroup>\n <div class=\"box-west\">\n <field-type-basic [dls]=\"dls\"></field-type-basic>\n </div>\n <div class=\"box-content\">\n <nz-tabset [nzType]=\"'card'\" [nzSelectedIndex]=\"pageSelectedIndex\"\n (nzSelectedIndexChange)=\"pageSelectedClick($event)\">\n <ng-container *ngFor=\"let page of listPage; let pageIndex = index\">\n <nz-tab [nzTitle]=\"titleTemplate\">\n <ng-template #titleTemplate>\n <div>\n \u7B2C{{pageIndex+1}}\u9875\n <i *ngIf=\"pageIndex > 0\" nz-icon nzType=\"close\" (click)=\"btnPageDelete(pageIndex)\"\n class=\"ant-tabs-close-x\"></i>\n </div>\n </ng-template>\n <ng-template nz-tab>\n <div class=\"box-center\">\n <ng-content select=\"[name=content-info]\"></ng-content>\n <div cdkDropList [cdkDropListData]=\"page.listField\" class=\"field-list\" (cdkDropListDropped)=\"drop($event)\"\n [cdkDropListConnectedTo]=\"dls\">\n <ng-container *ngFor=\"let field of page.listField; let fieldIndex = index\">\n <div class=\"field-box\" cdkDrag>\n <content [field]=\"field\" [state]=\"state\" (click)=\"fieldActive(field, $event)\"\n (fieldDelEvent)=\"deleteFieldIndex(pageIndex,fieldIndex, $event)\">\n <field-default [field]=\"field\" [sn]=\"getQuestionSn(pageIndex,fieldIndex)\"\n (addItem)=\"btnAddFieldItem(field)\"></field-default>\n </content>\n </div>\n </ng-container>\n <div class=\"field-box test\" cdkDrag></div>\n </div>\n </div>\n </ng-template>\n </nz-tab>\n </ng-container>\n </nz-tabset>\n </div>\n <div class=\"box-east\">\n <ng-container *ngIf=\"activeField!!; else tmpSetting\">\n <setting-template [field]=\"activeField\" (fieldChange)=\"activeFieldChange($event)\">\n </setting-template>\n </ng-container>\n <ng-template #tmpSetting>\n <empty-setting></empty-setting>\n </ng-template>\n </div>\n</div>", styles: [".example-container{display:inline-block;width:400px;max-width:100%;margin:0 25px 25px 0;vertical-align:top}.example-list{display:block;min-height:60px;overflow:hidden;background:#fff;border:solid 1px #ccc;border-radius:4px}.example-box{display:flex;flex-direction:row;align-items:center;justify-content:space-between;box-sizing:border-box;padding:20px 10px;color:#000000de;font-size:14px;background:#fff;border-bottom:solid 1px #ccc;cursor:move}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:none}.field-list.cdk-drop-list-dragging .field-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}:host ::ng-deep{display:flex;flex:1;width:100%;height:100%}:host ::ng-deep .field-list{padding:0}:host ::ng-deep .field-box{width:100%;margin:0 0 15px;background:#fff;border-radius:4px;font-size:13px;color:#000000a6}:host ::ng-deep .field-box .required:before{color:red;content:\"*\";padding:0 8px 0 0}:host ::ng-deep field-default{display:flex;flex-direction:column;background:none}:host ::ng-deep field-default .radiogroup-box{display:flex;flex-direction:column}:host ::ng-deep field-default .radiogroup-box .item-box{display:flex;flex-direction:row;align-items:center}:host ::ng-deep field-default .radiogroup-box .ant-radio-inner{height:18px;width:18px}:host ::ng-deep field-default .radiogroup-box .item-box+.item-box{margin-top:10px}:host ::ng-deep .field-empty{height:300px;text-align:center}:host ::ng-deep empty-field{display:inline-block;width:150px;margin:150px 80px;text-align:center}:host ::ng-deep empty-field img{width:100%;margin:auto;text-align:center}:host ::ng-deep empty-setting{display:inline-block;width:auto;margin:100px 80px;text-align:center}:host ::ng-deep empty-setting img{width:100%;margin:auto;text-align:center}:host ::ng-deep .survey-design-simple{display:flex;flex-direction:row;flex:1;width:100%;height:100%;border-radius:4px;--ck-color-base-text: rgba(0, 0, 0, .85);--ck-color-text: rgba(0, 0, 0, .85);--ck-color-base-border: #e0e0e0;--ck-color-toolbar-border: #e0e0e0;--ck-font-size-base: 12px;--ck-line-height-base: 1.6;--ck-icon-size: 12px}:host ::ng-deep .survey-design-simple .ngx-codemirror{border:1px solid #ccc}:host ::ng-deep .survey-design-simple .box-west{width:245px;padding:5px 3px 0 15px;background-color:#fff;border-right:1px solid #eaeaea;overflow:auto}:host ::ng-deep .survey-design-simple .box-west .field-disable{pointer-events:none;opacity:.65;cursor:not-allowed;position:relative}:host ::ng-deep .survey-design-simple .box-west .field-disable:after{content:\"\\1f6ab\";position:absolute;top:12px;right:-1px;transform:translateY(-50%);font-size:1.2em}:host ::ng-deep .survey-design-simple .box-west field-type-basic ul{display:flex;flex-wrap:wrap;margin:0 0 10px;padding:0;list-style:none}:host ::ng-deep .survey-design-simple .box-west field-type-basic ul li{width:100px}:host ::ng-deep .survey-design-simple .box-west field-type-basic ul .title{display:inline-block;width:100%;margin-top:8px;color:#9b9b9b;font-size:12px}:host ::ng-deep .survey-design-simple .box-west field-type-basic ul .title:nth-last-child(1){margin:0}:host ::ng-deep .survey-design-simple .box-west field-type-basic ul .field{flex:0 1 auto;width:95px;height:32px;margin:5px 0;padding:0 5px;line-height:33px;text-align:center;border:1px solid #eaeaea;border-radius:4px;cursor:move}:host ::ng-deep .survey-design-simple .box-west field-type-basic ul .title+.field,:host ::ng-deep .survey-design-simple .box-west field-type-basic ul .field+.field,:host ::ng-deep .survey-design-simple .box-west field-type-basic ul .example-custom-placeholder+.field{margin-right:10px}:host ::ng-deep .survey-design-simple .box-content{display:flex;flex-direction:row;flex:1;overflow:auto;background:#f8f8fd;padding:12px 12px 0!important}:host ::ng-deep .survey-design-simple .box-content .ant-tabs-tabpane{overflow:auto}:host ::ng-deep .survey-design-simple .box-east{width:300px;padding:0 5px 0 12px;background-color:#fff;border-left:1px solid #eaeaea}:host ::ng-deep .survey-design-simple .box-east .paragraph-box{position:relative;margin-bottom:12px;padding:8px 8px 0;border:2px dashed #c4c4c4;border-radius:6px}:host ::ng-deep .survey-design-simple .box-east .paragraph-box .tab-delete{position:absolute;top:-8px;right:0;width:20px;text-align:center;background:#c4c4c4;border-radius:50px;cursor:pointer}:host ::ng-deep .survey-design-simple .box-east .paragraph:nth-child(1){margin-top:15px}:host ::ng-deep .survey-design-simple .box-east .paragraph{width:100%;margin:0 0 12px}:host ::ng-deep .survey-design-simple .box-east .paragraph label{display:inline-flex;margin-bottom:8px}:host ::ng-deep .survey-design-simple .box-east .paragraph nz-select,:host ::ng-deep .survey-design-simple .box-east .paragraph nz-input-number,:host ::ng-deep .survey-design-simple .box-east .paragraph nz-radio-group{width:100%}:host ::ng-deep .survey-design-simple .box-east .paragraph a{color:#1177fb}:host ::ng-deep .survey-design-simple .box-east .paragraph .ant-checkbox-wrapper{min-width:90px}:host ::ng-deep .survey-design-simple .box-east .paragraph .range{display:flex;flex-direction:row;align-items:center;width:100%;margin:0;padding:0;list-style:none}:host ::ng-deep .survey-design-simple .box-east .paragraph .range li{margin:0}:host ::ng-deep .survey-design-simple .box-east .paragraph .range li:nth-child(2){padding:0 8px}:host ::ng-deep .survey-design-simple .box-east .paragraph .rows{display:flex;flex-direction:row;align-items:center;margin-bottom:10px}:host ::ng-deep .survey-design-simple .box-east .paragraph .rows .anticon-minus-circle{margin:0 12px 0 10px;color:red;font-size:20px;cursor:pointer}:host ::ng-deep .survey-design-simple .box-east .paragraph .list{padding:0 10px 0 0}:host ::ng-deep .survey-design-simple .box-east .paragraph .list .rows{display:flex;flex-direction:row;padding:8px 6px;font-size:14px;border:1px dashed hsla(0,0%,67%,.7);border-radius:2px}:host ::ng-deep .survey-design-simple .box-east .paragraph .list .rows .anticon-minus-circle{font-size:16px}:host ::ng-deep .survey-design-simple .box-east .paragraph .list .rows .anticon-drag{margin-right:6px;font-size:14px;cursor:move}:host ::ng-deep .survey-design-simple .box-east .paragraph .list .rows .title{flex:1}:host ::ng-deep .survey-design-simple .box-east .empty-box{padding:80px 0 0;text-align:center}:host ::ng-deep .survey-design-simple .box-east .empty-box label{display:inline-block;width:100%;margin-top:15px}:host ::ng-deep .survey-design-simple .box-east .paragraph-options{display:flex;flex-direction:column}:host ::ng-deep .survey-design-simple .box-east .paragraph-options ul{display:flex;flex-direction:row;margin:0;padding:0;border-left:1px solid #eaeaea;border-bottom:1px solid #eaeaea}:host ::ng-deep .survey-design-simple .box-east .paragraph-options ul li{border-right:1px solid #eaeaea}:host ::ng-deep .survey-design-simple .box-east .paragraph-options ul li .ant-input,:host ::ng-deep .survey-design-simple .box-east .paragraph-options ul li .ant-input-number{border:0}:host ::ng-deep .survey-design-simple .box-east .paragraph-options ul li:nth-child(1){display:flex;flex:1}:host ::ng-deep .survey-design-simple .box-east .paragraph-options ul li:nth-child(2){display:flex;width:80px}:host ::ng-deep .survey-design-simple .box-east .paragraph-options ul li:nth-child(3){display:flex;width:80px;align-items:center;justify-content:center}:host ::ng-deep .survey-design-simple .box-east .paragraph-options ul li:nth-child(3) a+a{margin-left:8px}:host ::ng-deep .survey-design-simple .box-east .paragraph-options ul:nth-child(1){border-top:1px solid #eaeaea}:host ::ng-deep .survey-design-simple .box-east .paragraph-options ul:nth-child(1) li{display:flex;align-items:center;line-height:32px;justify-content:center;font-size:12px;font-weight:600}:host ::ng-deep .survey-design-simple .box-east .paragraph-options .add-item{padding:8px 10px;border:1px solid #eaeaea;border-top:0}:host ::ng-deep .survey-design-simple .example-custom-placeholder{width:100%;height:6px;background:#1177fb;transition:transform .25s cubic-bezier(0,0,.2,1)}\n"] }]
2219
+ }], ctorParameters: () => [{ type: i1$3.NzModalService }, { type: i2$2.FormlyFormBuilder }, { type: FieldService }, { type: i4.DeonFormUtilService }], propDecorators: { dlq: [{
2220
+ type: ViewChildren,
2221
+ args: [CdkDropList]
2222
+ }], listPage: [{
2223
+ type: Input
2224
+ }], state: [{
2225
+ type: Input
2226
+ }], actionEvent: [{
2227
+ type: Output
2228
+ }] } });
2229
+
2230
+ const services = [FieldService, FieldTypeService, FieldSourceService];
2231
+ // 私有的--其他
2232
+ const privateOtherComponent = [
2233
+ FieldTypeBasic,
2234
+ DeonDesignSimpleLabel,
2235
+ ];
2236
+ // 私有的--字段设置
2237
+ const privateSettingComponent = [
2238
+ SettingBasic,
2239
+ SettingCommon,
2240
+ SettingTemplate,
2241
+ SettingRadioGroup,
2242
+ ];
2243
+ // 私有的--字段
2244
+ const privateFieldComponent = [
2245
+ FieldTemplate,
2246
+ FieldRadioGroup,
2247
+ FieldDefault,
2248
+ EmptyFieldComponent,
2249
+ EmptySettingComponent
2250
+ ];
2251
+ // 公开的
2252
+ const publicComponent = [FieldTemplate];
2253
+ class SurveyDesignModule {
2254
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SurveyDesignModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2255
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: SurveyDesignModule, imports: [SurveyDesignComponent,
2256
+ ContentComponent, FieldTypeBasic,
2257
+ DeonDesignSimpleLabel, FieldTemplate,
2258
+ FieldRadioGroup,
2259
+ FieldDefault,
2260
+ EmptyFieldComponent,
2261
+ EmptySettingComponent, SettingBasic,
2262
+ SettingCommon,
2263
+ SettingTemplate,
2264
+ SettingRadioGroup, FieldTemplate], exports: [SurveyDesignComponent] });
2265
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SurveyDesignModule, providers: [...services], imports: [SurveyDesignComponent,
2266
+ ContentComponent, privateOtherComponent, privateFieldComponent, SettingCommon,
2267
+ SettingRadioGroup, publicComponent] });
2268
+ }
2269
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SurveyDesignModule, decorators: [{
2270
+ type: NgModule,
2271
+ args: [{
2272
+ imports: [
2273
+ SurveyDesignComponent,
2274
+ ContentComponent,
2275
+ ...privateOtherComponent,
2276
+ ...privateFieldComponent,
2277
+ ...privateSettingComponent,
2278
+ ...publicComponent,
2279
+ ],
2280
+ exports: [SurveyDesignComponent],
2281
+ providers: [...services],
2282
+ }]
2283
+ }] });
2284
+
2285
+ /**
2286
+ * Generated bundle index. Do not edit.
2287
+ */
2288
+
2289
+ export { SurveyDesignComponent, SurveyDesignModule };
2290
+ //# sourceMappingURL=survey.mjs.map