imm-element-ui 0.6.5 → 0.6.7
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/esm2022/lib/am/am.component.mjs +40 -1
- package/esm2022/lib/form/form-field/field-utils.mjs +9 -1
- package/esm2022/lib/form/form-type/datepicker.type.mjs +10 -9
- package/fesm2022/imm-element-ui.mjs +56 -8
- package/fesm2022/imm-element-ui.mjs.map +1 -1
- package/lib/am/am.component.d.ts +4 -0
- package/lib/crumb-action/crumb-action.component.d.ts +1 -1
- package/package.json +1 -1
|
@@ -558,6 +558,45 @@ class AmComponent {
|
|
|
558
558
|
'';
|
|
559
559
|
}
|
|
560
560
|
}
|
|
561
|
+
//自处理逻辑
|
|
562
|
+
dealQuery(prm) {
|
|
563
|
+
if (prm) {
|
|
564
|
+
this.webDealQuery(prm).subscribe();
|
|
565
|
+
}
|
|
566
|
+
else {
|
|
567
|
+
this.webDealQuery(this.dealPrm).subscribe();
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
webDealQuery(param) {
|
|
571
|
+
this.isLoading.set(true);
|
|
572
|
+
return this.http.post(apiPath + "dealQuery", param)
|
|
573
|
+
.pipe(map((response) => {
|
|
574
|
+
this.dealPrm = { data: response, ...this.dealPrm };
|
|
575
|
+
return response;
|
|
576
|
+
}), finalize(() => {
|
|
577
|
+
// 无论请求成功与否,都将加载中状态设置为 false
|
|
578
|
+
this.isLoading.set(false);
|
|
579
|
+
}));
|
|
580
|
+
}
|
|
581
|
+
dealCustom(prm) {
|
|
582
|
+
if (prm) {
|
|
583
|
+
this.webDealCustom(prm).subscribe();
|
|
584
|
+
}
|
|
585
|
+
else {
|
|
586
|
+
this.webDealCustom(this.dealPrm).subscribe();
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
webDealCustom(param) {
|
|
590
|
+
this.isLoading.set(true);
|
|
591
|
+
return this.http.post(apiPath + "dealCustom", param)
|
|
592
|
+
.pipe(map((response) => {
|
|
593
|
+
this.dealPrm = { data: response, ...this.dealPrm };
|
|
594
|
+
return response;
|
|
595
|
+
}), finalize(() => {
|
|
596
|
+
// 无论请求成功与否,都将加载中状态设置为 false
|
|
597
|
+
this.isLoading.set(false);
|
|
598
|
+
}));
|
|
599
|
+
}
|
|
561
600
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AmComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
562
601
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AmComponent, isStandalone: true, selector: "app-am", providers: [MessageService], ngImport: i0, template: '', isInline: true }); }
|
|
563
602
|
}
|
|
@@ -1074,6 +1113,9 @@ const _fieldUtils = {
|
|
|
1074
1113
|
if (field.type == 'upload') {
|
|
1075
1114
|
return _fieldUtils.fromUploadValue(field, target);
|
|
1076
1115
|
}
|
|
1116
|
+
if (field.type == 'datepicker') {
|
|
1117
|
+
return _fieldUtils.fromDatePickerValue(field, target, datePipe);
|
|
1118
|
+
}
|
|
1077
1119
|
return target;
|
|
1078
1120
|
},
|
|
1079
1121
|
fromTreeSelectValue: (field, target) => {
|
|
@@ -1094,6 +1136,10 @@ const _fieldUtils = {
|
|
|
1094
1136
|
fromUploadValue: (field, target) => {
|
|
1095
1137
|
return target.join(';');
|
|
1096
1138
|
},
|
|
1139
|
+
fromDatePickerValue: (field, target, datePipe) => {
|
|
1140
|
+
const dateFormat = field?.datePickerProps?.showTime ? 'yyyy-MM-dd HH:mm:ss' : 'yyyy-MM-dd';
|
|
1141
|
+
return datePipe.transform(target, dateFormat) || target;
|
|
1142
|
+
},
|
|
1097
1143
|
toFieldValue: (field, raw, datePipe) => {
|
|
1098
1144
|
if (field.type == 'treeselect') {
|
|
1099
1145
|
return _fieldUtils.toTreeSelectValue(field, raw);
|
|
@@ -1194,6 +1240,7 @@ const _fieldUtils = {
|
|
|
1194
1240
|
// 触发valueChanges会影响日志保存的准确性,故此方法仅是为了防止组件内部意外触发的变动
|
|
1195
1241
|
isFakedChange(newValue, oldValue, field) {
|
|
1196
1242
|
const changeTypes = ['inputtext', 'inputnumber', 'select', 'treeselect', 'datepicker', 'autocomplete', 'multiselect', 'radio'];
|
|
1243
|
+
console.log('oldValue----', oldValue, newValue);
|
|
1197
1244
|
if (changeTypes.includes(field.type)) {
|
|
1198
1245
|
return (oldValue || '') == (newValue || '');
|
|
1199
1246
|
}
|
|
@@ -1785,8 +1832,6 @@ class DatePickerComponent {
|
|
|
1785
1832
|
effect(() => {
|
|
1786
1833
|
if (this.field()) {
|
|
1787
1834
|
this.props = this.field().datePickerProps;
|
|
1788
|
-
this.handleDisabled();
|
|
1789
|
-
this.handleModelChange();
|
|
1790
1835
|
}
|
|
1791
1836
|
});
|
|
1792
1837
|
effect(() => {
|
|
@@ -1831,17 +1876,20 @@ class DatePickerComponent {
|
|
|
1831
1876
|
});
|
|
1832
1877
|
}
|
|
1833
1878
|
onClose(event) {
|
|
1834
|
-
this.field()?.fieldControl
|
|
1835
|
-
this.
|
|
1879
|
+
// console.log('field----value---',this.field()?.fieldControl!.value)
|
|
1880
|
+
// this.field()?.fieldControl?.setValue(this.dateFormat(this.field()?.fieldControl!.value), { emitEvent: true });
|
|
1881
|
+
// this.props.onSelect?.(this.field()!, event);
|
|
1836
1882
|
}
|
|
1837
1883
|
dateFormat(target) {
|
|
1838
1884
|
const dateFormat = this.field()?.datePickerProps?.showTime ? 'yyyy-MM-dd HH:mm:ss' : 'yyyy-MM-dd';
|
|
1839
1885
|
return this.datePipe.transform(target, dateFormat) || target;
|
|
1840
1886
|
}
|
|
1841
1887
|
resetTime(event) {
|
|
1842
|
-
|
|
1888
|
+
if (!this.field().fieldControl.value)
|
|
1889
|
+
return;
|
|
1890
|
+
const currentDate = new Date(this.field().fieldControl.value);
|
|
1843
1891
|
currentDate.setHours(0, 0, 0, 0);
|
|
1844
|
-
this.
|
|
1892
|
+
this.field()?.fieldControl?.setValue(currentDate, { emitEvent: true });
|
|
1845
1893
|
}
|
|
1846
1894
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DatePickerComponent, deps: [{ token: ActionService }, { token: i0.Renderer2 }, { token: i1$1.DatePipe }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1847
1895
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: DatePickerComponent, isStandalone: true, selector: "form-datepicker", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: false, transformFunction: null } }, providers: [DatePipe], viewQueries: [{ propertyName: "datePicker", first: true, predicate: DatePicker, descendants: true }, { propertyName: "datePickerRef", first: true, predicate: DatePicker, descendants: true, read: ElementRef }], ngImport: i0, template: `<p-datepicker
|
|
@@ -1922,7 +1970,7 @@ class DatePickerComponent {
|
|
|
1922
1970
|
(onClickOutside)="props.onClickOutside?.(field()!, $event)"
|
|
1923
1971
|
(onShow)="props.onShow?.(field()!, $event)"
|
|
1924
1972
|
[class]="props.class"
|
|
1925
|
-
[formControl]="
|
|
1973
|
+
[formControl]="field()!.fieldControl!">
|
|
1926
1974
|
<ng-template #footer>
|
|
1927
1975
|
@if (!!props.showTime) {
|
|
1928
1976
|
<div class="flex flex-row-reverse text-[12px] text-[var(--p-primary-color)] cursor-pointer">
|
|
@@ -2012,7 +2060,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
2012
2060
|
(onClickOutside)="props.onClickOutside?.(field()!, $event)"
|
|
2013
2061
|
(onShow)="props.onShow?.(field()!, $event)"
|
|
2014
2062
|
[class]="props.class"
|
|
2015
|
-
[formControl]="
|
|
2063
|
+
[formControl]="field()!.fieldControl!">
|
|
2016
2064
|
<ng-template #footer>
|
|
2017
2065
|
@if (!!props.showTime) {
|
|
2018
2066
|
<div class="flex flex-row-reverse text-[12px] text-[var(--p-primary-color)] cursor-pointer">
|