fantasy-ngzorro 2.1.7 → 2.1.9
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.
- package/bundles/fantasy-ngzorro.umd.js +215 -101
- package/bundles/fantasy-ngzorro.umd.js.map +1 -1
- package/bundles/fantasy-ngzorro.umd.min.js +1 -1
- package/bundles/fantasy-ngzorro.umd.min.js.map +1 -1
- package/esm2015/hd-form/hd-form.component.js +110 -47
- package/esm2015/hd-form/hd-form.service.js +6 -8
- package/esm2015/hd-form-lines/hd-form-lines.component.js +91 -46
- package/esm2015/hd-form-lines/hd-form-lines.service.js +14 -15
- package/esm5/hd-form/hd-form.component.js +112 -43
- package/esm5/hd-form/hd-form.service.js +5 -6
- package/esm5/hd-form-lines/hd-form-lines.component.js +97 -50
- package/esm5/hd-form-lines/hd-form-lines.service.js +14 -15
- package/fantasy-ngzorro.metadata.json +1 -1
- package/fesm2015/fantasy-ngzorro.js +208 -103
- package/fesm2015/fantasy-ngzorro.js.map +1 -1
- package/fesm5/fantasy-ngzorro.js +215 -101
- package/fesm5/fantasy-ngzorro.js.map +1 -1
- package/hd-form/hd-form.component.d.ts +3 -3
- package/hd-form/hd-form.service.d.ts +2 -2
- package/hd-form-lines/hd-form-lines.service.d.ts +2 -2
- package/package.json +1 -1
|
@@ -2415,24 +2415,23 @@
|
|
|
2415
2415
|
}
|
|
2416
2416
|
/** @enum {string} */
|
|
2417
2417
|
var FormLineType = {
|
|
2418
|
-
Input:
|
|
2419
|
-
Select:
|
|
2420
|
-
Date:
|
|
2421
|
-
DateRange:
|
|
2422
|
-
TextArea:
|
|
2423
|
-
InputNumber:
|
|
2424
|
-
MultipleSelect:
|
|
2425
|
-
ViewDom:
|
|
2426
|
-
Switch:
|
|
2427
|
-
Time:
|
|
2428
|
-
,
|
|
2418
|
+
Input: "Input",
|
|
2419
|
+
Select: "Select",
|
|
2420
|
+
Date: "Date",
|
|
2421
|
+
DateRange: "DateRange",
|
|
2422
|
+
TextArea: "TextArea",
|
|
2423
|
+
InputNumber: "InputNumber",
|
|
2424
|
+
MultipleSelect: "MultipleSelect",
|
|
2425
|
+
ViewDom: "ViewDom",
|
|
2426
|
+
Switch: "Switch",
|
|
2427
|
+
Time: "Time",
|
|
2429
2428
|
};
|
|
2430
2429
|
var HdFormLinesService = /** @class */ (function () {
|
|
2431
2430
|
function HdFormLinesService() {
|
|
2432
2431
|
}
|
|
2433
2432
|
HdFormLinesService.decorators = [
|
|
2434
2433
|
{ type: core.Injectable, args: [{
|
|
2435
|
-
providedIn:
|
|
2434
|
+
providedIn: "root",
|
|
2436
2435
|
},] }
|
|
2437
2436
|
];
|
|
2438
2437
|
/** @nocollapse */
|
|
@@ -2684,11 +2683,12 @@
|
|
|
2684
2683
|
var _this = this;
|
|
2685
2684
|
/** @type {?} */
|
|
2686
2685
|
var pageLines = this.getCurrentPageLines();
|
|
2687
|
-
return pageLines.length > 0 &&
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2686
|
+
return (pageLines.length > 0 &&
|
|
2687
|
+
pageLines.every((/**
|
|
2688
|
+
* @param {?} line
|
|
2689
|
+
* @return {?}
|
|
2690
|
+
*/
|
|
2691
|
+
function (line) { return _this.isLineChecked(line); })));
|
|
2692
2692
|
};
|
|
2693
2693
|
/**
|
|
2694
2694
|
* @return {?}
|
|
@@ -2705,7 +2705,9 @@
|
|
|
2705
2705
|
* @param {?} line
|
|
2706
2706
|
* @return {?}
|
|
2707
2707
|
*/
|
|
2708
|
-
function (line) {
|
|
2708
|
+
function (line) {
|
|
2709
|
+
return _this.isLineChecked(line);
|
|
2710
|
+
})).length;
|
|
2709
2711
|
return checkedCount > 0 && checkedCount < pageLines.length;
|
|
2710
2712
|
};
|
|
2711
2713
|
/**
|
|
@@ -2865,7 +2867,9 @@
|
|
|
2865
2867
|
var empty = control.value === null ||
|
|
2866
2868
|
control.value === undefined ||
|
|
2867
2869
|
control.value === "";
|
|
2868
|
-
if ((control.dirty || control.touched) &&
|
|
2870
|
+
if ((control.dirty || control.touched) &&
|
|
2871
|
+
empty &&
|
|
2872
|
+
control.hasError("required")) {
|
|
2869
2873
|
return "error";
|
|
2870
2874
|
}
|
|
2871
2875
|
return "";
|
|
@@ -2970,7 +2974,8 @@
|
|
|
2970
2974
|
* @param {?} item
|
|
2971
2975
|
* @return {?}
|
|
2972
2976
|
*/
|
|
2973
|
-
function (item) { return item && item._hdRowId === id; })) &&
|
|
2977
|
+
function (item) { return item && item._hdRowId === id; })) &&
|
|
2978
|
+
mountedById.has(id)) {
|
|
2974
2979
|
result.push(mountedById.get(id));
|
|
2975
2980
|
}
|
|
2976
2981
|
}));
|
|
@@ -3847,24 +3852,29 @@
|
|
|
3847
3852
|
if (!fn) {
|
|
3848
3853
|
return;
|
|
3849
3854
|
}
|
|
3850
|
-
// 父组件未配置时默认 500ms 防抖
|
|
3851
3855
|
/** @type {?} */
|
|
3852
|
-
var debounceMs = onSearchEventDebounceTime != null ? onSearchEventDebounceTime :
|
|
3853
|
-
|
|
3854
|
-
if (
|
|
3855
|
-
this.
|
|
3856
|
+
var debounceMs = onSearchEventDebounceTime != null ? onSearchEventDebounceTime : 0;
|
|
3857
|
+
// 未配置或为 0:同步触发,不走 debounceTime(避免异步)
|
|
3858
|
+
if (!debounceMs) {
|
|
3859
|
+
this.triggerEvent(fn, event, line);
|
|
3860
|
+
}
|
|
3861
|
+
else {
|
|
3862
|
+
this.debounceTimeout = debounceMs;
|
|
3863
|
+
if (this.searchSubscription) {
|
|
3864
|
+
this.searchSubscription.unsubscribe();
|
|
3865
|
+
}
|
|
3866
|
+
this.searchSubscription = this.searchSubject
|
|
3867
|
+
.pipe(operators.debounceTime(this.debounceTimeout))
|
|
3868
|
+
.subscribe((/**
|
|
3869
|
+
* @param {?} __0
|
|
3870
|
+
* @return {?}
|
|
3871
|
+
*/
|
|
3872
|
+
function (_a) {
|
|
3873
|
+
var fn = _a.fn, event = _a.event, line = _a.line;
|
|
3874
|
+
return _this.triggerEvent(fn, event, line);
|
|
3875
|
+
}));
|
|
3876
|
+
this.searchSubject.next({ fn: fn, event: event, line: line });
|
|
3856
3877
|
}
|
|
3857
|
-
this.searchSubscription = this.searchSubject
|
|
3858
|
-
.pipe(operators.debounceTime(this.debounceTimeout))
|
|
3859
|
-
.subscribe((/**
|
|
3860
|
-
* @param {?} __0
|
|
3861
|
-
* @return {?}
|
|
3862
|
-
*/
|
|
3863
|
-
function (_a) {
|
|
3864
|
-
var fn = _a.fn, event = _a.event, line = _a.line;
|
|
3865
|
-
return _this.triggerEvent(fn, event, line);
|
|
3866
|
-
}));
|
|
3867
|
-
this.searchSubject.next({ fn: fn, event: event, line: line });
|
|
3868
3878
|
setTimeout((/**
|
|
3869
3879
|
* @return {?}
|
|
3870
3880
|
*/
|
|
@@ -3891,9 +3901,17 @@
|
|
|
3891
3901
|
if (!fn) {
|
|
3892
3902
|
return;
|
|
3893
3903
|
}
|
|
3894
|
-
// 父组件未配置时默认 500ms 防抖
|
|
3895
3904
|
/** @type {?} */
|
|
3896
|
-
var debounceMs = onOpenChangeEventDebounceTime != null
|
|
3905
|
+
var debounceMs = onOpenChangeEventDebounceTime != null
|
|
3906
|
+
? onOpenChangeEventDebounceTime
|
|
3907
|
+
: 0;
|
|
3908
|
+
// 未配置或为 0:同步触发,不走 debounceTime(避免异步)
|
|
3909
|
+
if (!debounceMs) {
|
|
3910
|
+
if (open) {
|
|
3911
|
+
this.triggerEvent(fn, open, line);
|
|
3912
|
+
}
|
|
3913
|
+
return;
|
|
3914
|
+
}
|
|
3897
3915
|
this.openChangeDebounceTimeout = debounceMs;
|
|
3898
3916
|
if (this.openChangeSubscription) {
|
|
3899
3917
|
this.openChangeSubscription.unsubscribe();
|
|
@@ -3981,19 +3999,33 @@
|
|
|
3981
3999
|
*/
|
|
3982
4000
|
function (item) {
|
|
3983
4001
|
if (item.onChangeEvent) {
|
|
3984
|
-
// 父组件未配置时默认 500ms 防抖
|
|
3985
4002
|
/** @type {?} */
|
|
3986
|
-
var debounceMs = item.onChangeEventDebounceTime != null
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
4003
|
+
var debounceMs = item.onChangeEventDebounceTime != null
|
|
4004
|
+
? item.onChangeEventDebounceTime
|
|
4005
|
+
: 0;
|
|
4006
|
+
/** @type {?} */
|
|
4007
|
+
var control = formGroupTmp.get(item.name);
|
|
4008
|
+
// 未配置或为 0:同步订阅,不走 debounceTime
|
|
4009
|
+
if (debounceMs > 0) {
|
|
4010
|
+
control.valueChanges
|
|
4011
|
+
.pipe(operators.debounceTime(debounceMs))
|
|
4012
|
+
.subscribe((/**
|
|
4013
|
+
* @param {?} value
|
|
4014
|
+
* @return {?}
|
|
4015
|
+
*/
|
|
4016
|
+
function (value) {
|
|
4017
|
+
_this.triggerEvent(item.onChangeEvent, value, formGroupTmp);
|
|
4018
|
+
}));
|
|
4019
|
+
}
|
|
4020
|
+
else {
|
|
4021
|
+
control.valueChanges.subscribe((/**
|
|
4022
|
+
* @param {?} value
|
|
4023
|
+
* @return {?}
|
|
4024
|
+
*/
|
|
4025
|
+
function (value) {
|
|
4026
|
+
_this.triggerEvent(item.onChangeEvent, value, formGroupTmp);
|
|
4027
|
+
}));
|
|
4028
|
+
}
|
|
3997
4029
|
}
|
|
3998
4030
|
}));
|
|
3999
4031
|
((/** @type {?} */ (tmpValidateHdFormLines.get("lines")))).insert(((/** @type {?} */ (tmpValidateHdFormLines.get("lines")))).controls.length, formGroupTmp);
|
|
@@ -4317,11 +4349,15 @@
|
|
|
4317
4349
|
: item.value,
|
|
4318
4350
|
disabled: item.disabled,
|
|
4319
4351
|
}, isEmptyLine
|
|
4320
|
-
?
|
|
4321
|
-
|
|
4352
|
+
? item.require && !item.hide
|
|
4353
|
+
? [forms.Validators.required]
|
|
4354
|
+
: []
|
|
4355
|
+
: item.require
|
|
4356
|
+
? [forms.Validators.required]
|
|
4357
|
+
: []);
|
|
4322
4358
|
if (item.selectOption && item.selectOption.label) {
|
|
4323
4359
|
formGroupObj[item.selectOption.label] = _this.fb.control(formLinesDataItem != null
|
|
4324
|
-
?
|
|
4360
|
+
? formLinesDataItem[item.selectOption.label] || null
|
|
4325
4361
|
: null, []);
|
|
4326
4362
|
}
|
|
4327
4363
|
}));
|
|
@@ -4362,11 +4398,13 @@
|
|
|
4362
4398
|
function (item) {
|
|
4363
4399
|
if (item.onChangeEvent) {
|
|
4364
4400
|
/** @type {?} */
|
|
4365
|
-
var debounceMs = item.onChangeEventDebounceTime != null
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4401
|
+
var debounceMs = item.onChangeEventDebounceTime != null
|
|
4402
|
+
? item.onChangeEventDebounceTime
|
|
4403
|
+
: 0;
|
|
4404
|
+
/** @type {?} */
|
|
4405
|
+
var control = formGroupSubmit.get(item.name);
|
|
4406
|
+
/** @type {?} */
|
|
4407
|
+
var handleChange = (/**
|
|
4370
4408
|
* @param {?} value
|
|
4371
4409
|
* @return {?}
|
|
4372
4410
|
*/
|
|
@@ -4375,7 +4413,16 @@
|
|
|
4375
4413
|
_this.delayJumpToNextInput();
|
|
4376
4414
|
}
|
|
4377
4415
|
_this.triggerEvent(item.onChangeEvent, value, formGroupSubmit);
|
|
4378
|
-
})
|
|
4416
|
+
});
|
|
4417
|
+
// 未配置或为 0:同步订阅,不走 debounceTime
|
|
4418
|
+
if (debounceMs > 0) {
|
|
4419
|
+
control.valueChanges
|
|
4420
|
+
.pipe(operators.debounceTime(debounceMs))
|
|
4421
|
+
.subscribe(handleChange);
|
|
4422
|
+
}
|
|
4423
|
+
else {
|
|
4424
|
+
control.valueChanges.subscribe(handleChange);
|
|
4425
|
+
}
|
|
4379
4426
|
}
|
|
4380
4427
|
}));
|
|
4381
4428
|
return formGroupSubmit;
|
|
@@ -4589,8 +4636,7 @@
|
|
|
4589
4636
|
* @return {?}
|
|
4590
4637
|
*/
|
|
4591
4638
|
function (globalIndex) {
|
|
4592
|
-
return (globalIndex -
|
|
4593
|
-
(this.paginationPageIndex - 1) * this.paginationPageSize);
|
|
4639
|
+
return (globalIndex - (this.paginationPageIndex - 1) * this.paginationPageSize);
|
|
4594
4640
|
};
|
|
4595
4641
|
/**
|
|
4596
4642
|
* @param {?} event
|
|
@@ -5304,8 +5350,7 @@
|
|
|
5304
5350
|
Time: 9,
|
|
5305
5351
|
Cascader: 10,
|
|
5306
5352
|
Radio: 11,
|
|
5307
|
-
Checkbox: 12
|
|
5308
|
-
,
|
|
5353
|
+
Checkbox: 12,
|
|
5309
5354
|
};
|
|
5310
5355
|
FormListType[FormListType.Input] = 'Input';
|
|
5311
5356
|
FormListType[FormListType.Select] = 'Select';
|
|
@@ -5325,7 +5370,7 @@
|
|
|
5325
5370
|
}
|
|
5326
5371
|
HdFormService.decorators = [
|
|
5327
5372
|
{ type: core.Injectable, args: [{
|
|
5328
|
-
providedIn:
|
|
5373
|
+
providedIn: "root",
|
|
5329
5374
|
},] }
|
|
5330
5375
|
];
|
|
5331
5376
|
/** @nocollapse */
|
|
@@ -5358,7 +5403,9 @@
|
|
|
5358
5403
|
* @return {?}
|
|
5359
5404
|
*/
|
|
5360
5405
|
function (value) { return value; });
|
|
5361
|
-
this.searchSubscription = this.searchSubject
|
|
5406
|
+
this.searchSubscription = this.searchSubject
|
|
5407
|
+
.pipe(operators.debounceTime(this.debounceTimeout))
|
|
5408
|
+
.subscribe((/**
|
|
5362
5409
|
* @param {?} __0
|
|
5363
5410
|
* @return {?}
|
|
5364
5411
|
*/
|
|
@@ -5366,7 +5413,9 @@
|
|
|
5366
5413
|
var fn = _a.fn, event = _a.event;
|
|
5367
5414
|
return _this.triggerEvent(fn, event);
|
|
5368
5415
|
}));
|
|
5369
|
-
this.openChangeSubscription = this.openChangeSubject
|
|
5416
|
+
this.openChangeSubscription = this.openChangeSubject
|
|
5417
|
+
.pipe(operators.debounceTime(this.openChangeDebounceTimeout))
|
|
5418
|
+
.subscribe((/**
|
|
5370
5419
|
* @param {?} __0
|
|
5371
5420
|
* @return {?}
|
|
5372
5421
|
*/
|
|
@@ -5399,7 +5448,9 @@
|
|
|
5399
5448
|
* @return {?}
|
|
5400
5449
|
*/
|
|
5401
5450
|
function (changes) {
|
|
5402
|
-
if (changes[
|
|
5451
|
+
if (changes["formList"] &&
|
|
5452
|
+
JSON.stringify(changes["formList"].currentValue) !==
|
|
5453
|
+
JSON.stringify(changes["formList"].previousValue)) {
|
|
5403
5454
|
if (!this.formList || this.formList.length === 0) {
|
|
5404
5455
|
return;
|
|
5405
5456
|
}
|
|
@@ -5423,14 +5474,20 @@
|
|
|
5423
5474
|
if (!fn) {
|
|
5424
5475
|
return;
|
|
5425
5476
|
}
|
|
5426
|
-
// 父组件未配置时默认 500ms 防抖
|
|
5427
5477
|
/** @type {?} */
|
|
5428
|
-
var debounceMs = onSearchEventDebounceTime != null ? onSearchEventDebounceTime :
|
|
5478
|
+
var debounceMs = onSearchEventDebounceTime != null ? onSearchEventDebounceTime : 0;
|
|
5479
|
+
// 未配置或为 0:同步触发,不走 debounceTime(避免异步)
|
|
5480
|
+
if (!debounceMs) {
|
|
5481
|
+
this.triggerEvent(fn, event);
|
|
5482
|
+
return;
|
|
5483
|
+
}
|
|
5429
5484
|
this.debounceTimeout = debounceMs;
|
|
5430
5485
|
if (this.searchSubscription) {
|
|
5431
5486
|
this.searchSubscription.unsubscribe();
|
|
5432
5487
|
}
|
|
5433
|
-
this.searchSubscription = this.searchSubject
|
|
5488
|
+
this.searchSubscription = this.searchSubject
|
|
5489
|
+
.pipe(operators.debounceTime(this.debounceTimeout))
|
|
5490
|
+
.subscribe((/**
|
|
5434
5491
|
* @param {?} __0
|
|
5435
5492
|
* @return {?}
|
|
5436
5493
|
*/
|
|
@@ -5457,14 +5514,24 @@
|
|
|
5457
5514
|
if (!fn) {
|
|
5458
5515
|
return;
|
|
5459
5516
|
}
|
|
5460
|
-
// 父组件未配置时默认 500ms 防抖
|
|
5461
5517
|
/** @type {?} */
|
|
5462
|
-
var debounceMs = onOpenChangeEventDebounceTime != null
|
|
5518
|
+
var debounceMs = onOpenChangeEventDebounceTime != null
|
|
5519
|
+
? onOpenChangeEventDebounceTime
|
|
5520
|
+
: 0;
|
|
5521
|
+
// 未配置或为 0:同步触发,不走 debounceTime(避免异步)
|
|
5522
|
+
if (!debounceMs) {
|
|
5523
|
+
if (open) {
|
|
5524
|
+
this.triggerEvent(fn, open);
|
|
5525
|
+
}
|
|
5526
|
+
return;
|
|
5527
|
+
}
|
|
5463
5528
|
this.openChangeDebounceTimeout = debounceMs;
|
|
5464
5529
|
if (this.openChangeSubscription) {
|
|
5465
5530
|
this.openChangeSubscription.unsubscribe();
|
|
5466
5531
|
}
|
|
5467
|
-
this.openChangeSubscription = this.openChangeSubject
|
|
5532
|
+
this.openChangeSubscription = this.openChangeSubject
|
|
5533
|
+
.pipe(operators.debounceTime(this.openChangeDebounceTimeout))
|
|
5534
|
+
.subscribe((/**
|
|
5468
5535
|
* @param {?} __0
|
|
5469
5536
|
* @return {?}
|
|
5470
5537
|
*/
|
|
@@ -5503,7 +5570,7 @@
|
|
|
5503
5570
|
var _this = this;
|
|
5504
5571
|
// 异常捕获
|
|
5505
5572
|
if (!this.checkList(this.formList)) {
|
|
5506
|
-
throw
|
|
5573
|
+
throw "form组件数据格式不规范";
|
|
5507
5574
|
}
|
|
5508
5575
|
// 对表单数据做初始化,用row隔离每行数据item
|
|
5509
5576
|
this.dealRow();
|
|
@@ -5518,17 +5585,26 @@
|
|
|
5518
5585
|
function (item, index) {
|
|
5519
5586
|
// 日期相关的控件做特殊处理
|
|
5520
5587
|
if (item.type === 2 && item.value) {
|
|
5521
|
-
var _a = __read(item.value
|
|
5588
|
+
var _a = __read(item.value
|
|
5589
|
+
.toString()
|
|
5590
|
+
.split("-")
|
|
5591
|
+
.map((/**
|
|
5522
5592
|
* @param {?} str
|
|
5523
5593
|
* @return {?}
|
|
5524
5594
|
*/
|
|
5525
5595
|
function (str) { return parseInt(str); })), 3), year = _a[0], month = _a[1], day = _a[2];
|
|
5526
5596
|
/** @type {?} */
|
|
5527
5597
|
var newDateStr = new Date(year, month - 1, day)
|
|
5528
|
-
.toLocaleDateString(
|
|
5529
|
-
|
|
5598
|
+
.toLocaleDateString("zh-Hans-CN", {
|
|
5599
|
+
year: "numeric",
|
|
5600
|
+
month: "2-digit",
|
|
5601
|
+
day: "2-digit",
|
|
5602
|
+
})
|
|
5603
|
+
.replace(/\//g, "-");
|
|
5530
5604
|
if (item.validator) {
|
|
5531
|
-
formGroupList[item.name] = _this.fb.control({ value: new Date(newDateStr), disabled: item.disabled }, item.require && !item.hide
|
|
5605
|
+
formGroupList[item.name] = _this.fb.control({ value: new Date(newDateStr), disabled: item.disabled }, item.require && !item.hide
|
|
5606
|
+
? [forms.Validators.required, item.validator]
|
|
5607
|
+
: []);
|
|
5532
5608
|
}
|
|
5533
5609
|
else {
|
|
5534
5610
|
formGroupList[item.name] = _this.fb.control({ value: new Date(newDateStr), disabled: item.disabled }, item.require && !item.hide ? [forms.Validators.required] : []);
|
|
@@ -5543,33 +5619,43 @@
|
|
|
5543
5619
|
* @return {?}
|
|
5544
5620
|
*/
|
|
5545
5621
|
function (item) {
|
|
5546
|
-
var _a = __read(item
|
|
5622
|
+
var _a = __read(item
|
|
5623
|
+
.split("-")
|
|
5624
|
+
.map((/**
|
|
5547
5625
|
* @param {?} str
|
|
5548
5626
|
* @return {?}
|
|
5549
5627
|
*/
|
|
5550
5628
|
function (str) { return parseInt(str); })), 3), year = _a[0], month = _a[1], day = _a[2];
|
|
5551
5629
|
/** @type {?} */
|
|
5552
5630
|
var newDateStr = new Date(year, month - 1, day)
|
|
5553
|
-
.toLocaleDateString(
|
|
5554
|
-
|
|
5631
|
+
.toLocaleDateString("zh-Hans-CN", {
|
|
5632
|
+
year: "numeric",
|
|
5633
|
+
month: "2-digit",
|
|
5634
|
+
day: "2-digit",
|
|
5635
|
+
})
|
|
5636
|
+
.replace(/\//g, "-");
|
|
5555
5637
|
item = new Date(newDateStr);
|
|
5556
5638
|
}));
|
|
5557
5639
|
if (item.validator) {
|
|
5558
|
-
formGroupList[item.name] = _this.fb.control({ value: formItemDate, disabled: item.disabled }, item.require && !item.hide
|
|
5640
|
+
formGroupList[item.name] = _this.fb.control({ value: formItemDate, disabled: item.disabled }, item.require && !item.hide
|
|
5641
|
+
? [forms.Validators.required, item.validator]
|
|
5642
|
+
: []);
|
|
5559
5643
|
}
|
|
5560
5644
|
else {
|
|
5561
5645
|
formGroupList[item.name] = _this.fb.control({ value: formItemDate, disabled: item.disabled }, item.require && !item.hide ? [forms.Validators.required] : []);
|
|
5562
5646
|
}
|
|
5563
5647
|
}
|
|
5564
5648
|
else {
|
|
5565
|
-
throw
|
|
5649
|
+
throw "form组件中DateRange控件value值格式不规范,正确示例['2020-01-22', '2020-01-23']";
|
|
5566
5650
|
}
|
|
5567
5651
|
}
|
|
5568
5652
|
else if (item.type === FormListType.Checkbox && item.checkboxOption) {
|
|
5569
5653
|
/** @type {?} */
|
|
5570
5654
|
var checkboxValue = Array.isArray(item.value) ? item.value : [];
|
|
5571
5655
|
if (item.validator) {
|
|
5572
|
-
formGroupList[item.name] = _this.fb.control({ value: checkboxValue, disabled: item.disabled }, item.require && !item.hide
|
|
5656
|
+
formGroupList[item.name] = _this.fb.control({ value: checkboxValue, disabled: item.disabled }, item.require && !item.hide
|
|
5657
|
+
? [forms.Validators.required, item.validator]
|
|
5658
|
+
: []);
|
|
5573
5659
|
}
|
|
5574
5660
|
else {
|
|
5575
5661
|
formGroupList[item.name] = _this.fb.control({ value: checkboxValue, disabled: item.disabled }, item.require && !item.hide ? [forms.Validators.required] : []);
|
|
@@ -5579,7 +5665,9 @@
|
|
|
5579
5665
|
/** @type {?} */
|
|
5580
5666
|
var checkboxValue = item.value != null ? item.value : false;
|
|
5581
5667
|
if (item.validator) {
|
|
5582
|
-
formGroupList[item.name] = _this.fb.control({ value: checkboxValue, disabled: item.disabled }, item.require && !item.hide
|
|
5668
|
+
formGroupList[item.name] = _this.fb.control({ value: checkboxValue, disabled: item.disabled }, item.require && !item.hide
|
|
5669
|
+
? [forms.Validators.required, item.validator]
|
|
5670
|
+
: []);
|
|
5583
5671
|
}
|
|
5584
5672
|
else {
|
|
5585
5673
|
formGroupList[item.name] = _this.fb.control({ value: checkboxValue, disabled: item.disabled }, item.require && !item.hide ? [forms.Validators.required] : []);
|
|
@@ -5587,7 +5675,9 @@
|
|
|
5587
5675
|
}
|
|
5588
5676
|
else {
|
|
5589
5677
|
if (item.validator) {
|
|
5590
|
-
formGroupList[item.name] = _this.fb.control({ value: item.value, disabled: item.disabled }, item.require && !item.hide
|
|
5678
|
+
formGroupList[item.name] = _this.fb.control({ value: item.value, disabled: item.disabled }, item.require && !item.hide
|
|
5679
|
+
? [forms.Validators.required, item.validator]
|
|
5680
|
+
: []);
|
|
5591
5681
|
}
|
|
5592
5682
|
else {
|
|
5593
5683
|
formGroupList[item.name] = _this.fb.control({ value: item.value, disabled: item.disabled }, item.require && !item.hide ? [forms.Validators.required] : []);
|
|
@@ -5601,23 +5691,42 @@
|
|
|
5601
5691
|
*/
|
|
5602
5692
|
function (item) {
|
|
5603
5693
|
if (item.onChangeEvent) {
|
|
5604
|
-
// 父组件未配置时默认 500ms 防抖
|
|
5605
5694
|
/** @type {?} */
|
|
5606
|
-
var debounceMs = item.onChangeEventDebounceTime != null
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
|
|
5695
|
+
var debounceMs = item.onChangeEventDebounceTime != null
|
|
5696
|
+
? item.onChangeEventDebounceTime
|
|
5697
|
+
: 0;
|
|
5698
|
+
/** @type {?} */
|
|
5699
|
+
var control = _this.validateHdForm.get(item.name);
|
|
5700
|
+
// 未配置或为 0:同步订阅,不走 debounceTime(避免异步破坏 patchValue 联动回显)
|
|
5701
|
+
if (debounceMs > 0) {
|
|
5702
|
+
control.valueChanges
|
|
5703
|
+
.pipe(operators.debounceTime(debounceMs))
|
|
5704
|
+
.subscribe((/**
|
|
5705
|
+
* @param {?} value
|
|
5706
|
+
* @return {?}
|
|
5707
|
+
*/
|
|
5708
|
+
function (value) {
|
|
5709
|
+
return _this.triggerEvent(item.onChangeEvent, value);
|
|
5710
|
+
}));
|
|
5711
|
+
}
|
|
5712
|
+
else {
|
|
5713
|
+
control.valueChanges.subscribe((/**
|
|
5714
|
+
* @param {?} value
|
|
5715
|
+
* @return {?}
|
|
5716
|
+
*/
|
|
5717
|
+
function (value) {
|
|
5718
|
+
return _this.triggerEvent(item.onChangeEvent, value);
|
|
5719
|
+
}));
|
|
5720
|
+
}
|
|
5614
5721
|
}
|
|
5615
5722
|
}));
|
|
5616
5723
|
this.validateHdForm.valueChanges.subscribe((/**
|
|
5617
5724
|
* @param {?} data
|
|
5618
5725
|
* @return {?}
|
|
5619
5726
|
*/
|
|
5620
|
-
function (data) {
|
|
5727
|
+
function (data) {
|
|
5728
|
+
return _this.onHdFormValueChanged(data);
|
|
5729
|
+
}));
|
|
5621
5730
|
this.onHdFormValueChanged();
|
|
5622
5731
|
};
|
|
5623
5732
|
/**
|
|
@@ -5645,8 +5754,11 @@
|
|
|
5645
5754
|
// 去找到前一个非hide的控件
|
|
5646
5755
|
for (var j = i - 1; j >= 0; j--) {
|
|
5647
5756
|
if (this.formList[j].totalWidth) {
|
|
5648
|
-
this.formList[i].totalWidth =
|
|
5649
|
-
|
|
5757
|
+
this.formList[i].totalWidth =
|
|
5758
|
+
this.formList[j].totalWidth + (this.formList[i].width || 1);
|
|
5759
|
+
if (this.formList[j].totalWidth + (this.formList[i].width || 1) >
|
|
5760
|
+
step &&
|
|
5761
|
+
this.formList[j].totalWidth <= step) {
|
|
5650
5762
|
step = step + 4;
|
|
5651
5763
|
this.formList[i].isRowFirst = 1;
|
|
5652
5764
|
}
|
|
@@ -5669,7 +5781,9 @@
|
|
|
5669
5781
|
if (space === 4 || this.formList[m + n].isRowFirst === 1) {
|
|
5670
5782
|
break;
|
|
5671
5783
|
}
|
|
5672
|
-
if (!this.formList[m + n].hide &&
|
|
5784
|
+
if (!this.formList[m + n].hide &&
|
|
5785
|
+
this.formList[m + n] &&
|
|
5786
|
+
this.formList[m + n].isRowFirst === 0) {
|
|
5673
5787
|
this.formList[m].columnItems.push(this.formList[m + n]);
|
|
5674
5788
|
space++;
|
|
5675
5789
|
}
|
|
@@ -5719,7 +5833,7 @@
|
|
|
5719
5833
|
}));
|
|
5720
5834
|
// 校验name是否重复
|
|
5721
5835
|
if (__spread(new Set(nameList)).length !== list.length) {
|
|
5722
|
-
throw
|
|
5836
|
+
throw "form组件数据格式不规范,存在重复name值!";
|
|
5723
5837
|
}
|
|
5724
5838
|
// ...more check
|
|
5725
5839
|
return true;
|
|
@@ -5824,7 +5938,7 @@
|
|
|
5824
5938
|
};
|
|
5825
5939
|
HdFormComponent.decorators = [
|
|
5826
5940
|
{ type: core.Component, args: [{
|
|
5827
|
-
selector:
|
|
5941
|
+
selector: "hd-form",
|
|
5828
5942
|
template: "<form nz-form [formGroup]=\"validateHdForm\" class=\"ant-advanced-search-form hd-formItem-container\">\n <!-- \u6574\u4F53\u7ED3\u6784 -->\n <div nz-row [nzGutter]=\"24\">\n <!-- \u5BF9\u7EC4\u4EF6\u5217\u8868\u5FAA\u73AF\u5904\u7406 -->\n <ng-container *ngFor=\"let formItem of formList;index as i\">\n <div nz-row *ngIf=\"formItem.isRowFirst && formItem.isRowFirst === 1\">\n <div nz-col *ngIf=\"!formItem.hide\" [nzSpan]=\"formItem.width? formItem.width * 6 : 6\">\n <nz-form-item nzFlex>\n <nz-form-label class=\"hd-formItem-label\" [nzNoColon]=\"true\">\n <div class=\"hd-formItem-label-flex\">\n <span>\n <span class=\"hd-formItem-label-require\" *ngIf=\"formItem.require\">*</span>\n <span [ngStyle]=\"{'color': formItem?.labelColor ? formItem.labelColor : null}\">{{ formItem.label\n }}</span>\n </span>\n <ng-container *ngIf=\"formItem.explain\">\n <span class=\"hd-formItem-label-explain\">{{ formItem.explain }}</span>\n </ng-container>\n </div>\n </nz-form-label>\n <nz-form-control class=\"hd-formItem-control\" [nzErrorTip]=\"formItemErrorTpl\">\n <ng-template #formItemErrorTpl let-control>\n <ng-container *ngFor=\"let validatorKey of formItem.validatorKeys;index as i\">\n <ng-container *ngIf=\"control.hasError(validatorKey.key)\">\n {{ validatorKey.label }}\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"control.hasError('required')\">\n {{ formItem.label + '\u4E0D\u80FD\u4E3A\u7A7A' }}\n </ng-container>\n </ng-template>\n <ng-container [ngSwitch]=\"formItem.type\">\n <ng-container *ngSwitchCase=\"0\">\n <nz-input-group [nzSuffix]=\"inputCleanTemplate\"\n [nzPrefix]=\"formItem.prefixIcon ? inputPrefixIconTemplate : formItem.prefix\">\n <input nz-input [ngStyle]=\"{'color': formItem?.color ? formItem.color : null}\"\n [maxlength]=\"formItem.maxLength || null\"\n [placeholder]=\"formItem.placeholder ? formItem.placeholder : '\u8BF7\u8F93\u5165' + formItem.label\"\n [formControlName]=\"formItem.name\" />\n </nz-input-group>\n <ng-template #inputPrefixIconTemplate><i nz-icon [nzType]=\"formItem.prefixIcon\"></i></ng-template>\n <ng-template #inputCleanTemplate><i nz-icon nz-tooltip class=\"ant-input-clear-icon\" nzTheme=\"fill\"\n nzType=\"close-circle\"\n *ngIf=\"validateHdForm.get(formItem.name).value && !formItem.disabled && !validateHdForm.get(formItem.name).disabled\"\n (click)=\"inputClean(formItem)\"></i></ng-template>\n </ng-container>\n <ng-container *ngSwitchCase=\"1\">\n <nz-select\n [nzShowSearch]=\"formItem.selectOption.hdShowSearch != null ? formItem.selectOption.hdShowSearch : true\"\n [nzAllowClear]=\"formItem.selectOption.hdAllowClear != null ? formItem.selectOption.hdAllowClear : true\"\n [nzServerSearch]=\"formItem.selectOption.hdServerSearch || false\"\n [nzDropdownMatchSelectWidth]=\"formItem.selectOption.hdDropdownMatchSelectWidth ? formItem.selectOption.hdDropdownMatchSelectWidth : false\"\n [nzPlaceHolder]=\"formItem.placeholder ? formItem.placeholder : '\u8BF7\u9009\u62E9' + formItem.label\"\n [formControlName]=\"formItem.name\"\n (nzOpenChange)=\"onOpenChangeEvent(formItem.onOpenChangeEvent || null, $event, formItem.onOpenChangeEventDebounceTime)\"\n (nzOnSearch)=\"onSearchEvent(formItem.onSearchEvent || null, $event, formItem.onSearchEventEventDebounceTime)\">\n <nz-option *ngFor=\"let selectItem of formItem.selectOption.selectList\"\n [nzValue]=\"selectItem[formItem.selectOption.value]\" [nzLabel]=\"formItem.selectOption.showLabelAndValue ? '['+ selectItem[formItem.selectOption.value] +']' +\n selectItem[formItem.selectOption.label] : selectItem[formItem.selectOption.label]\"></nz-option>\n <nz-option *ngIf=\"formItem.defaultLabel\" [nzLabel]=\"formItem.defaultLabel\"\n [nzValue]=\"formItem.value\" nzHide></nz-option>\n <nz-option\n *ngIf=\"formItem.selectOption.label && validateHdForm.get(formItem.name) && validateHdForm.get(formItem.selectOption.label)?.value && validateHdForm.get(formItem.selectOption.value)?.value\"\n [nzLabel]=\"(formItem.selectOption.showLabelAndValue || formItem.selectOption.hdShowItemCode) ? ('['+ validateHdForm.get(formItem.selectOption.value).value + ']' + validateHdForm.get(formItem.selectOption.label).value) : validateHdForm.get(formItem.selectOption.label).value\"\n [nzValue]=\"validateHdForm.get(formItem.selectOption.value).value\" nzHide></nz-option>\n </nz-select>\n </ng-container>\n <ng-container *ngSwitchCase=\"2\">\n <nz-date-picker *ngIf=\"!formItem.showTime\" [nzDisabledDate]=\"formItem.hdDisabledDate\"\n [nzShowToday]=\"formItem.hdShowToday !== false\"\n [nzPlaceHolder]=\"formItem.placeholder ? formItem.placeholder : '\u8BF7\u9009\u62E9' + formItem.label\"\n [formControlName]=\"formItem.name\">\n </nz-date-picker>\n <nz-date-picker *ngIf=\"formItem.showTime\" [nzDisabledDate]=\"formItem.hdDisabledDate\"\n [nzShowToday]=\"formItem.hdShowToday !== false\"\n [nzPlaceHolder]=\"formItem.placeholder ? formItem.placeholder : '\u8BF7\u9009\u62E9' + formItem.label\"\n [formControlName]=\"formItem.name\" nzShowTime nzFormat=\"yyyy-MM-dd HH:mm:ss\">\n </nz-date-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"3\">\n <nz-range-picker [nzPlaceHolder]=\"formItem.showTime ? ['\u5F00\u59CB\u65F6\u95F4','\u7ED3\u675F\u65F6\u95F4'] : ['\u5F00\u59CB\u65E5\u671F','\u7ED3\u675F\u65E5\u671F']\"\n [nzDisabledDate]=\"formItem.hdDisabledDate\" [formControlName]=\"formItem.name\"\n [nzShowTime]=\"formItem.showTime ? true : false\">\n </nz-range-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"4\">\n <textarea [ngStyle]=\"{'color': formItem?.color ? formItem.color : null}\"\n [rows]=\"formItem.textAreaRows ? formItem.textAreaRows : 1\"\n [placeholder]=\"formItem.placeholder ? formItem.placeholder : '\u8BF7\u8F93\u5165' + formItem.label\" rows=\"1\"\n nz-input [maxlength]=\"formItem.maxLength || null\" [formControlName]=\"formItem.name\"></textarea>\n </ng-container>\n <ng-container *ngSwitchCase=\"5\">\n <nz-input-number [ngStyle]=\"{'color': formItem?.color ? formItem.color : null}\"\n [formControlName]=\"formItem.name\" [nzMin]=\"formItem?.inputNumber?.min || 0\"\n [nzMax]=\"formItem?.inputNumber?.max || 99999999\" [nzStep]=\"formItem?.inputNumber?.step || 1\"\n [nzPlaceHolder]=\"'\u8BF7\u8F93\u5165' + formItem.label\"\n [nzFormatter]=\"formItem?.inputNumber?.nzFormatter || inputNumberDefaultFormatter\"\n [nzParser]=\"formItem?.inputNumber?.nzParser || inputNumberDefaultParser\"\n [nzPrecision]=\"formItem?.inputNumber?.precision != null ? formItem.inputNumber.precision : 4\">\n </nz-input-number>\n </ng-container>\n <!-- \u591A\u9879\u9009\u62E9\u5668 -->\n <ng-container *ngSwitchCase=\"6\">\n <nz-select [nzServerSearch]=\"formItem.selectOption.hdServerSearch || false\"\n [nzDropdownMatchSelectWidth]=\"formItem.selectOption.hdDropdownMatchSelectWidth ? formItem.selectOption.hdDropdownMatchSelectWidth : false\"\n nzMode=\"multiple\"\n [nzShowSearch]=\"formItem.selectOption.hdShowSearch != null ? formItem.selectOption.hdShowSearch : true\"\n [nzAllowClear]=\"formItem.selectOption.hdAllowClear != null ? formItem.selectOption.hdAllowClear : true\"\n [nzPlaceHolder]=\"formItem.placeholder ? formItem.placeholder : '\u8BF7\u9009\u62E9' + formItem.label\"\n [formControlName]=\"formItem.name\"\n (nzOpenChange)=\"onOpenChangeEvent(formItem.onOpenChangeEvent || null, $event, formItem.onOpenChangeEventDebounceTime)\"\n (nzOnSearch)=\"onSearchEvent(formItem.onSearchEvent || null, $event, formItem.onSearchEventEventDebounceTime)\">\n <nz-option *ngFor=\"let selectItem of formItem.selectOption.selectList\"\n [nzValue]=\"selectItem[formItem.selectOption.value]\" [nzLabel]=\"formItem.selectOption.showLabelAndValue ? '['+ selectItem[formItem.selectOption.value] +']' +\n selectItem[formItem.selectOption.label] : selectItem[formItem.selectOption.label]\"></nz-option>\n <ng-container *ngIf=\"formItem.defaultLabel\">\n <nz-option *ngFor=\"let option of formItem.defaultLabel;index as i\" [nzLabel]=\"option\"\n [nzValue]=\"formItem.value[i]\" nzHide></nz-option>\n </ng-container>\n <ng-container\n *ngIf=\"formItem.selectOption.label && validateHdForm.get(formItem.name) && validateHdForm.get(formItem.selectOption.label)?.value && validateHdForm.get(formItem.selectOption.value)?.value\">\n <nz-option *ngFor=\"let option of validateHdForm.get(formItem.selectOption.value).value;index as i\"\n [nzLabel]=\"validateHdForm.get(formItem.selectOption.label).value[i]\" [nzValue]=\"option\" nzHide>\n </nz-option>\n </ng-container>\n </nz-select>\n </ng-container>\n <ng-container *ngSwitchCase=\"7\">\n <span>{{ formItem.value || validateHdForm.get(formItem.name).value }}</span>\n </ng-container>\n <ng-container *ngSwitchCase=\"8\">\n <nz-switch [formControlName]=\"formItem.name\"></nz-switch>\n </ng-container>\n <ng-container *ngSwitchCase=\"9\">\n <nz-time-picker [formControlName]=\"formItem.name\" [nzFormat]=\"formItem.format\"\n [nzAllowEmpty]=\"!formItem.disabled\"></nz-time-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"10\">\n <nz-cascader [nzOptions]=\"formItem.cascaderOption.options\" [formControlName]=\"formItem.name\"\n [nzPlaceHolder]=\"formItem.placeholder ? formItem.placeholder : '\u8BF7\u9009\u62E9' + formItem.label\">\n </nz-cascader>\n </ng-container>\n <ng-container *ngSwitchCase=\"11\">\n <nz-radio-group [formControlName]=\"formItem.name\">\n <label nz-radio *ngFor=\"let radioItem of formItem.radioOption.optionList\"\n [nzValue]=\"radioItem[formItem.radioOption.value]\">\n {{ formItem.radioOption.showLabelAndValue ? '[' + radioItem[formItem.radioOption.value] + ']' +\n radioItem[formItem.radioOption.label] : radioItem[formItem.radioOption.label] }}\n </label>\n </nz-radio-group>\n </ng-container>\n <ng-container *ngSwitchCase=\"12\">\n <ng-container *ngIf=\"formItem.checkboxOption; else singleCheckboxTpl\">\n <label nz-checkbox\n *ngFor=\"let checkboxItem of formItem.checkboxOption.optionList\"\n [nzDisabled]=\"formItem.disabled || validateHdForm.get(formItem.name).disabled\"\n [ngModel]=\"isCheckboxChecked(formItem.name, checkboxItem[formItem.checkboxOption.value])\"\n (ngModelChange)=\"onCheckboxItemChange(formItem.name, checkboxItem[formItem.checkboxOption.value], $event)\"\n [ngModelOptions]=\"{standalone: true}\">\n {{ formItem.checkboxOption.showLabelAndValue\n ? '[' + checkboxItem[formItem.checkboxOption.value] + ']' + checkboxItem[formItem.checkboxOption.label]\n : checkboxItem[formItem.checkboxOption.label] }}\n </label>\n </ng-container>\n <ng-template #singleCheckboxTpl>\n <label nz-checkbox [formControlName]=\"formItem.name\"></label>\n </ng-template>\n </ng-container>\n </ng-container>\n </nz-form-control>\n </nz-form-item>\n </div>\n <!-- \u5FAA\u73AF\u6700\u591A\u56DB\u6B21 -->\n <ng-container *ngFor=\"let columnItem of formItem.columnItems;index as columnItemIndex\">\n <div nz-col *ngIf=\"!columnItem.hide\" [nzSpan]=\"columnItem.width? columnItem.width * 6 : 6\">\n <nz-form-item nzFlex>\n <nz-form-label class=\"hd-formItem-label\" [nzNoColon]=\"true\">\n <div class=\"hd-formItem-label-flex\">\n <span>\n <span class=\"hd-formItem-label-require\" *ngIf=\"columnItem.require\">*</span>\n <span [ngStyle]=\"{'color': columnItem?.labelColor ? columnItem.labelColor : null}\">{{\n columnItem.label }}</span>\n </span>\n <ng-container *ngIf=\"columnItem.explain\">\n <span class=\"hd-formItem-label-explain\">{{ columnItem.explain }}</span>\n </ng-container>\n </div>\n </nz-form-label>\n <nz-form-control class=\"hd-formItem-control\" [nzErrorTip]=\"columnItemErrorTpl\">\n <ng-template #columnItemErrorTpl let-control>\n <ng-container *ngFor=\"let validatorKey of columnItem.validatorKeys;index as i\">\n <ng-container *ngIf=\"control.hasError(validatorKey.key)\">\n {{ validatorKey.label }}\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"control.hasError('required')\">\n {{ columnItem.label + '\u4E0D\u80FD\u4E3A\u7A7A' }}\n </ng-container>\n </ng-template>\n <ng-container [ngSwitch]=\"columnItem.type\">\n <ng-container *ngSwitchCase=\"0\">\n <nz-input-group [nzSuffix]=\"inputCleanTemplate\"\n [nzPrefix]=\"columnItem.prefixIcon ? inputPrefixIconTemplate : columnItem.prefix\">\n <input *ngIf=\"columnItem.disabled === true;else inputTemplate\" nz-input\n [ngStyle]=\"{'color': columnItem?.color ? columnItem.color : null}\" [disabled]=\"true\"\n [attr.disabled]=\"true\" [maxlength]=\"columnItem.maxLength || null\"\n [placeholder]=\"columnItem.placeholder ? columnItem.placeholder : '\u8BF7\u8F93\u5165' + columnItem.label\"\n [formControlName]=\"columnItem.name\" />\n <ng-template #inputTemplate>\n <input nz-input [ngStyle]=\"{'color': columnItem?.color ? formItem.color : null}\"\n [maxlength]=\"columnItem.maxLength || null\"\n [placeholder]=\"columnItem.placeholder ? columnItem.placeholder : '\u8BF7\u8F93\u5165' + columnItem.label\"\n [formControlName]=\"columnItem.name\" />\n </ng-template>\n </nz-input-group>\n <ng-template #inputPrefixIconTemplate><i nz-icon [nzType]=\"columnItem.prefixIcon\"></i></ng-template>\n <ng-template #inputCleanTemplate><i nz-icon nz-tooltip class=\"ant-input-clear-icon\" nzTheme=\"fill\"\n nzType=\"close-circle\"\n *ngIf=\"validateHdForm.get(columnItem.name).value && !columnItem.disabled && !validateHdForm.get(formItem.name).disabled\"\n (click)=\"inputClean(columnItem)\"></i></ng-template>\n </ng-container>\n <ng-container *ngSwitchCase=\"1\">\n <nz-select [nzServerSearch]=\"columnItem.selectOption.hdServerSearch || false\"\n [nzDropdownMatchSelectWidth]=\"columnItem.selectOption.hdDropdownMatchSelectWidth ? columnItem.selectOption.hdDropdownMatchSelectWidth : false\"\n [nzShowSearch]=\"columnItem.selectOption.hdShowSearch != null ? columnItem.selectOption.hdShowSearch : true\"\n [nzAllowClear]=\"columnItem.selectOption.hdAllowClear != null ? columnItem.selectOption.hdAllowClear : true\"\n [nzPlaceHolder]=\"columnItem.placeholder ? columnItem.placeholder : '\u8BF7\u9009\u62E9' + columnItem.label\"\n [formControlName]=\"columnItem.name\"\n (nzOpenChange)=\"onOpenChangeEvent(columnItem.onOpenChangeEvent || null, $event, columnItem.onOpenChangeEventDebounceTime)\"\n (nzOnSearch)=\"onSearchEvent(columnItem.onSearchEvent || null, $event, columnItem.onSearchEventEventDebounceTime)\">\n <nz-option *ngFor=\"let selectItem of columnItem.selectOption.selectList\"\n [nzValue]=\"selectItem[columnItem.selectOption.value]\" [nzLabel]=\"columnItem.selectOption.showLabelAndValue ? '['+ selectItem[columnItem.selectOption.value] +']' +\n selectItem[columnItem.selectOption.label] : selectItem[columnItem.selectOption.label]\">\n </nz-option>\n <nz-option\n *ngIf=\"columnItem.selectOption.label && validateHdForm.get(columnItem.name) && validateHdForm.get(columnItem.selectOption.label)?.value && validateHdForm.get(columnItem.selectOption.value)?.value\"\n [nzLabel]=\"(columnItem.selectOption.showLabelAndValue || columnItem.selectOption.hdShowItemCode) ? ('['+ validateHdForm.get(columnItem.selectOption.value).value + ']' + validateHdForm.get(columnItem.selectOption.label).value) : validateHdForm.get(columnItem.selectOption.label).value\"\n [nzValue]=\"validateHdForm.get(columnItem.selectOption.value).value\" nzHide></nz-option>\n </nz-select>\n </ng-container>\n <ng-container *ngSwitchCase=\"2\">\n <nz-date-picker *ngIf=\"columnItem.showTime\" [nzDisabledDate]=\"columnItem.hdDisabledDate\"\n [nzShowToday]=\"columnItem.hdShowToday !== false\"\n [nzPlaceHolder]=\"columnItem.placeholder ? columnItem.placeholder : '\u8BF7\u9009\u62E9' + columnItem.label\"\n [formControlName]=\"columnItem.name\" nzShowTime nzFormat=\"yyyy-MM-dd HH:mm:ss\">\n </nz-date-picker>\n <nz-date-picker *ngIf=\"!columnItem.showTime\" [nzDisabledDate]=\"columnItem.hdDisabledDate\"\n [nzShowToday]=\"columnItem.hdShowToday !== false\"\n [nzPlaceHolder]=\"columnItem.placeholder ? columnItem.placeholder : '\u8BF7\u9009\u62E9' + columnItem.label\"\n [formControlName]=\"columnItem.name\">\n </nz-date-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"3\">\n <nz-range-picker [nzPlaceHolder]=\"columnItem.showTime ? ['\u5F00\u59CB\u65F6\u95F4','\u7ED3\u675F\u65F6\u95F4'] : ['\u5F00\u59CB\u65E5\u671F','\u7ED3\u675F\u65E5\u671F']\"\n [nzDisabledDate]=\"columnItem.hdDisabledDate\" [formControlName]=\"columnItem.name\"\n [nzShowTime]=\"columnItem.showTime ? true : false\">\n </nz-range-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"4\">\n <textarea [ngStyle]=\"{'color': columnItem?.color ? columnItem.color : null}\"\n [rows]=\"columnItem.textAreaRows ? columnItem.textAreaRows : 1\" rows=\"1\" nz-input\n [placeholder]=\"columnItem.placeholder ? columnItem.placeholder : '\u8BF7\u8F93\u5165' + columnItem.label\"\n [maxlength]=\"columnItem.maxLength || null\" [formControlName]=\"columnItem.name\"></textarea>\n </ng-container>\n <ng-container *ngSwitchCase=\"5\">\n <nz-input-number [ngStyle]=\"{'color': columnItem?.color ? columnItem.color : null}\"\n [formControlName]=\"columnItem.name\" [nzMin]=\"columnItem?.inputNumber?.min || 0\"\n [nzMax]=\"columnItem?.inputNumber?.max || 99999999\" [nzStep]=\"columnItem?.inputNumber?.step || 1\"\n [nzFormatter]=\"columnItem?.inputNumber?.nzFormatter || inputNumberDefaultFormatter\"\n [nzParser]=\"columnItem?.inputNumber?.nzParser || inputNumberDefaultParser\"\n [nzPlaceHolder]=\"columnItem.placeholder ? columnItem.placeholder : '\u8BF7\u8F93\u5165' + columnItem.label\"\n [nzPrecision]=\"columnItem?.inputNumber?.precision != null ? columnItem.inputNumber.precision : 4\">\n </nz-input-number>\n </ng-container>\n <!-- \u591A\u9879\u9009\u62E9\u5668 -->\n <ng-container *ngSwitchCase=\"6\">\n <nz-select [nzServerSearch]=\"columnItem.selectOption.hdServerSearch || false\"\n [nzDropdownMatchSelectWidth]=\"columnItem.selectOption.hdDropdownMatchSelectWidth ? columnItem.selectOption.hdDropdownMatchSelectWidth : false\"\n nzMode=\"multiple\"\n [nzShowSearch]=\"columnItem.selectOption.hdShowSearch != null ? columnItem.selectOption.hdShowSearch : true\"\n [nzAllowClear]=\"columnItem.selectOption.hdAllowClear != null ? columnItem.selectOption.hdAllowClear : true\"\n [nzPlaceHolder]=\"columnItem.placeholder ? columnItem.placeholder : '\u8BF7\u9009\u62E9' + columnItem.label\"\n [formControlName]=\"columnItem.name\"\n (nzOpenChange)=\"onOpenChangeEvent(columnItem.onOpenChangeEvent || null, $event, columnItem.onOpenChangeEventDebounceTime)\"\n (nzOnSearch)=\"onSearchEvent(columnItem.onSearchEvent || null, $event, columnItem.onSearchEventEventDebounceTime)\">\n <nz-option *ngFor=\"let selectItem of columnItem.selectOption.selectList\"\n [nzValue]=\"selectItem[columnItem.selectOption.value]\" [nzLabel]=\"columnItem.selectOption.showLabelAndValue ? '['+ selectItem[columnItem.selectOption.value] +']' +\n selectItem[columnItem.selectOption.label] : selectItem[columnItem.selectOption.label]\">\n </nz-option>\n <ng-container *ngIf=\"columnItem.defaultLabel\">\n <nz-option *ngFor=\"let option of columnItem.defaultLabel;index as i\" [nzLabel]=\"option\"\n [nzValue]=\"columnItem.value[i]\" nzHide></nz-option>\n </ng-container>\n <ng-container\n *ngIf=\"columnItem.selectOption.label && validateHdForm.get(columnItem.name) && validateHdForm.get(columnItem.selectOption.label)?.value && validateHdForm.get(columnItem.selectOption.value)?.value\">\n <nz-option\n *ngFor=\"let option of validateHdForm.get(columnItem.selectOption.value).value;index as i\"\n [nzLabel]=\"validateHdForm.get(columnItem.selectOption.label).value[i]\" [nzValue]=\"option\"\n nzHide>\n </nz-option>\n </ng-container>\n </nz-select>\n </ng-container>\n <ng-container *ngSwitchCase=\"7\">\n <span>{{ columnItem.value || validateHdForm.get(columnItem.name).value }}</span>\n </ng-container>\n <ng-container *ngSwitchCase=\"8\">\n <nz-switch [formControlName]=\"columnItem.name\"></nz-switch>\n </ng-container>\n <ng-container *ngSwitchCase=\"9\">\n <nz-time-picker [formControlName]=\"columnItem.name\" [nzFormat]=\"columnItem.format\"\n [nzAllowEmpty]=\"!columnItem.disabled\"></nz-time-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"10\">\n <nz-cascader [nzOptions]=\"columnItem.cascaderOption.options\" [formControlName]=\"columnItem.name\"\n [nzPlaceHolder]=\"columnItem.placeholder ? columnItem.placeholder : '\u8BF7\u9009\u62E9' + columnItem.label\">\n </nz-cascader>\n </ng-container>\n <ng-container *ngSwitchCase=\"11\">\n <nz-radio-group [formControlName]=\"columnItem.name\">\n <label nz-radio *ngFor=\"let radioItem of columnItem.radioOption.optionList\"\n [nzValue]=\"radioItem[columnItem.radioOption.value]\">\n {{ columnItem.radioOption.showLabelAndValue ? '[' + radioItem[columnItem.radioOption.value] + ']' +\n radioItem[columnItem.radioOption.label] : radioItem[columnItem.radioOption.label] }}\n </label>\n </nz-radio-group>\n </ng-container>\n <ng-container *ngSwitchCase=\"12\">\n <ng-container *ngIf=\"columnItem.checkboxOption; else singleColumnCheckboxTpl\">\n <label nz-checkbox\n *ngFor=\"let checkboxItem of columnItem.checkboxOption.optionList\"\n [nzDisabled]=\"columnItem.disabled || validateHdForm.get(columnItem.name).disabled\"\n [ngModel]=\"isCheckboxChecked(columnItem.name, checkboxItem[columnItem.checkboxOption.value])\"\n (ngModelChange)=\"onCheckboxItemChange(columnItem.name, checkboxItem[columnItem.checkboxOption.value], $event)\"\n [ngModelOptions]=\"{standalone: true}\">\n {{ columnItem.checkboxOption.showLabelAndValue\n ? '[' + checkboxItem[columnItem.checkboxOption.value] + ']' + checkboxItem[columnItem.checkboxOption.label]\n : checkboxItem[columnItem.checkboxOption.label] }}\n </label>\n </ng-container>\n <ng-template #singleColumnCheckboxTpl>\n <label nz-checkbox [formControlName]=\"columnItem.name\"></label>\n </ng-template>\n </ng-container>\n </ng-container>\n </nz-form-control>\n </nz-form-item>\n </div>\n </ng-container>\n </div>\n </ng-container>\n </div>\n</form>\n",
|
|
5829
5943
|
styles: ["::ng-deep .common-btn-group>a{font-size:14px;font-weight:400;color:#20b95d!important;white-space:nowrap}::ng-deep .common-btn-group .common-danger-btn:hover{color:#f05b24!important}::ng-deep .common-btn-group>a:hover{color:#20bd62!important}::ng-deep .common-btn-group>a:not(:last-child)::after{content:'';margin:0 2px}::ng-deep .common-billNumber>a{color:#3b77e3}button{box-shadow:unset;text-shadow:unset}::ng-deep .ant-form-item-label>label{color:#4b504e;font-size:14px}::ng-deep .ant-input-number-input{height:32px}::ng-deep .ant-input-number{height:32px}textarea.ant-input{height:auto;min-height:32px}::ng-deep .ant-select-selection--multiple{min-height:32px}::ng-deep .ant-select-selection__rendered>ul>li{height:26px!important;margin-top:3px!important;line-height:26px!important}::ng-deep .ant-advanced-search-form .ant-form-item{margin-bottom:0!important}::ng-deep .ant-select-selection--single{height:32px!important}::ng-deep .ant-input{height:32px}::ng-deep .ant-input[disabled]:hover{border-color:#d9d9d9!important}::ng-deep .ant-select-selection__rendered{line-height:32px!important}::ng-deep .ant-calendar-range-picker-input{text-align:left!important}::ng-deep .ant-calendar-picker{width:100%!important}::ng-deep .ant-row{margin-right:0!important;margin-left:0!important}::ng-deep .ant-col-6{padding-left:12px;padding-right:12px}::ng-deep .ant-col-12{padding-left:12px;padding-right:12px}::ng-deep .ant-col-18{padding-left:12px;padding-right:12px}::ng-deep .ant-col-24{padding-left:12px;padding-right:12px}::ng-deep .ant-alert-info{background-color:#f5f8f6;border:1px solid #cfe3d4}:host ::ng-deep th{background:#f5f8f6!important;font-weight:700!important;white-space:nowrap;font-size:14px;font-family:PingFangSC-Medium,PingFang SC;color:#2a3634;padding:8px!important;box-sizing:border-box}:host ::ng-deep td{font-weight:400;font-style:normal;font-size:14px;color:#2a3634;text-align:left;white-space:nowrap;padding:8px!important;box-sizing:border-box}::ng-deep .ant-pagination-options{display:inline-flex;align-items:center}::ng-deep .ant-time-picker{width:100%}.ant-input-number-disabled,.ant-input[disabled],.ant-select-disabled{color:#4b504e}.hd-formItem-container .hd-formItem-label{width:124px;word-break:break-all;text-align:right}.hd-formItem-container .hd-formItem-control{width:calc(100% - 124px)}.hd-formItem-container .ant-input-number{width:100%}.hd-formItem-container .hd-formItem-label-flex{display:inline-flex;flex-direction:column}.hd-formItem-container .hd-formItem-label-flex span{display:inline-block}.hd-formItem-container .hd-formItem-label-flex .hd-formItem-label-require{margin-right:4px;color:#f5222d;font-size:14px;font-family:SimSun,sans-serif}.hd-formItem-container .hd-formItem-label-flex .hd-formItem-label-explain{margin-top:-13px;color:#f5222d}.hd-formItem-container textarea{margin-top:8px}.hd-formItem-container ::ng-deep label[nz-checkbox]{margin-right:12px;line-height:32px}"]
|
|
5830
5944
|
}] }
|