ngx-axis-appforge 1.0.5 → 1.0.6
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/fesm2022/ngx-axis-appforge-axis-components-loop-task-design.mjs +123 -0
- package/fesm2022/ngx-axis-appforge-axis-components-loop-task-design.mjs.map +1 -0
- package/fesm2022/ngx-axis-appforge-axis-components-loop-task.mjs +85 -0
- package/fesm2022/ngx-axis-appforge-axis-components-loop-task.mjs.map +1 -0
- package/fesm2022/ngx-axis-appforge-axis-components-table-helper.mjs +10 -10
- package/fesm2022/ngx-axis-appforge-axis-components-table-helper.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components.mjs +18 -0
- package/fesm2022/ngx-axis-appforge-axis-components.mjs.map +1 -1
- package/package.json +9 -1
- package/types/ngx-axis-appforge-axis-components-loop-task-design.d.ts +5 -0
- package/types/ngx-axis-appforge-axis-components-loop-task.d.ts +26 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { FunFieldValueBase, FormValidators, baseFbConfig, baseFunField, BaseDesignSetting, FunField, InputTrigger, DynamicDirective, OptionsNode, SimpleMenu } from 'ngx-axis-appforge/core';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { ChangeDetectionStrategy, Component, inject, forwardRef } from '@angular/core';
|
|
4
|
+
import * as i1 from '@angular/forms';
|
|
5
|
+
import { FormsModule, ReactiveFormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
6
|
+
import * as i4 from 'ng-zorro-antd/collapse';
|
|
7
|
+
import { NzCollapseModule } from 'ng-zorro-antd/collapse';
|
|
8
|
+
import * as i3 from 'ng-zorro-antd/form';
|
|
9
|
+
import { NzFormModule } from 'ng-zorro-antd/form';
|
|
10
|
+
import * as i5 from 'ng-zorro-antd/input';
|
|
11
|
+
import { NzInputModule } from 'ng-zorro-antd/input';
|
|
12
|
+
import * as i6 from 'ng-zorro-antd/switch';
|
|
13
|
+
import { NzSwitchModule } from 'ng-zorro-antd/switch';
|
|
14
|
+
import * as i2 from 'ng-zorro-antd/grid';
|
|
15
|
+
|
|
16
|
+
class Setting extends FunFieldValueBase {
|
|
17
|
+
fg = this.fb.group({
|
|
18
|
+
...baseFbConfig,
|
|
19
|
+
showProgress: [undefined, FormValidators.requiredFun],
|
|
20
|
+
progressTip: [],
|
|
21
|
+
userBreak: [undefined, FormValidators.requiredFun],
|
|
22
|
+
});
|
|
23
|
+
funFields = {
|
|
24
|
+
...baseFunField,
|
|
25
|
+
showProgress: {
|
|
26
|
+
defaultValue: true
|
|
27
|
+
},
|
|
28
|
+
progressTip: {
|
|
29
|
+
defaultValue: "执行中"
|
|
30
|
+
},
|
|
31
|
+
userBreak: {
|
|
32
|
+
defaultValue: true
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: Setting, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
36
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: Setting, isStandalone: true, selector: "axis-design-loop-task-setting", usesInheritance: true, ngImport: i0, template: "<form [formGroup]=\"fg\" nz-form>\n <nz-collapse [nzBordered]=\"false\">\n <nz-collapse-panel nzHeader=\"\u57FA\u672C\u8BBE\u7F6E\" nzActive>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u663E\u793A\u8FDB\u5EA6\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"showProgress\">\n <nz-switch ngModel [ngModelOptions]=\"{standalone:true}\"></nz-switch>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n @if (formValue().showProgress?.funMode || formValue()?.showProgress?.originValue) {\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n \u8FDB\u5EA6\u63D0\u793A\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"progressTip\">\n <input nz-input ngModel [ngModelOptions]=\"{standalone:true}\" />\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u7528\u6237\u4E2D\u65AD\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"userBreak\">\n <nz-switch ngModel [ngModelOptions]=\"{standalone:true}\"></nz-switch>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n }\n </nz-collapse-panel>\n <axis-base-design-setting [fg]=\"fg\"></axis-base-design-setting>\n <axis-input-trigger formControlName=\"triggeEvents\"\n [eventDesc]=\"[{name:'taskLoop',title:'\u4EFB\u52A1\u5FAA\u73AF',ds:{loopIndex:0,loopItem:'\u793A\u4F8B\u6570\u636E'}},{name:'loopTaskEnd',title:'\u5FAA\u73AF\u4EFB\u52A1\u7ED3\u675F',ds:{completedCount:0,totalCount:0}}]\"></axis-input-trigger>\n </nz-collapse>\n</form>", styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzFormModule }, { kind: "directive", type: i2.NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }, { kind: "directive", type: i2.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: i3.NzFormDirective, selector: "[nz-form]", inputs: ["nzLayout", "nzNoColon", "nzAutoTips", "nzDisableAutoTips", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap", "nzSize", "nzVariant", "nzRequiredMark"], exportAs: ["nzForm"] }, { kind: "component", type: i3.NzFormItemComponent, selector: "nz-form-item", exportAs: ["nzFormItem"] }, { kind: "component", type: i3.NzFormLabelComponent, selector: "nz-form-label", inputs: ["nzFor", "nzRequired", "nzNoColon", "nzTooltipTitle", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzFormLabel"] }, { kind: "component", type: i3.NzFormControlComponent, selector: "nz-form-control", inputs: ["nzSuccessTip", "nzWarningTip", "nzErrorTip", "nzValidatingTip", "nzExtra", "nzAutoTips", "nzDisableAutoTips", "nzHasFeedback", "nzValidateStatus"], exportAs: ["nzFormControl"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: NzCollapseModule }, { kind: "component", type: i4.NzCollapsePanelComponent, selector: "nz-collapse-panel", inputs: ["nzActive", "nzDisabled", "nzShowArrow", "nzExtra", "nzHeader", "nzExpandedIcon", "nzCollapsible"], outputs: ["nzActiveChange"], exportAs: ["nzCollapsePanel"] }, { kind: "component", type: i4.NzCollapseComponent, selector: "nz-collapse", inputs: ["nzAccordion", "nzBordered", "nzGhost", "nzExpandIconPosition", "nzSize"], exportAs: ["nzCollapse"] }, { kind: "component", type: BaseDesignSetting, selector: "axis-base-design-setting", inputs: ["scopeId", "exclude", "fg"] }, { kind: "ngmodule", type: NzInputModule }, { kind: "directive", type: i5.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzVariant", "nzSize", "nzStepperless", "nzStatus", "disabled", "readonly"], exportAs: ["nzInput"] }, { kind: "ngmodule", type: NzSwitchModule }, { kind: "component", type: i6.NzSwitchComponent, selector: "nz-switch", inputs: ["nzLoading", "nzDisabled", "nzControl", "nzCheckedChildren", "nzUnCheckedChildren", "nzSize", "nzId"], exportAs: ["nzSwitch"] }, { kind: "component", type: FunField, selector: "axis-fun-field", inputs: ["scopes", "exclude", "scopeId", "onlyFun", "noListen", "disabled", "editTip", "value", "open", "showCreateListenModal", "createListenDataSourceName"], outputs: ["valueChange", "openChange", "showCreateListenModalChange", "createListenDataSourceNameChange"] }, { kind: "component", type: InputTrigger, selector: "axis-input-trigger", inputs: ["internalTriggers", "optionsNodeId", "value", "eventDesc", "isVisibleHandlerModal", "editEventHandler"], outputs: ["valueChange", "isVisibleHandlerModalChange", "editEventHandlerChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
37
|
+
}
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: Setting, decorators: [{
|
|
39
|
+
type: Component,
|
|
40
|
+
args: [{ selector: 'axis-design-loop-task-setting', imports: [FormsModule, NzFormModule, ReactiveFormsModule, NzCollapseModule, BaseDesignSetting, NzInputModule, NzSwitchModule, FunField, InputTrigger], changeDetection: ChangeDetectionStrategy.OnPush, template: "<form [formGroup]=\"fg\" nz-form>\n <nz-collapse [nzBordered]=\"false\">\n <nz-collapse-panel nzHeader=\"\u57FA\u672C\u8BBE\u7F6E\" nzActive>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u663E\u793A\u8FDB\u5EA6\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"showProgress\">\n <nz-switch ngModel [ngModelOptions]=\"{standalone:true}\"></nz-switch>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n @if (formValue().showProgress?.funMode || formValue()?.showProgress?.originValue) {\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n \u8FDB\u5EA6\u63D0\u793A\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"progressTip\">\n <input nz-input ngModel [ngModelOptions]=\"{standalone:true}\" />\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u7528\u6237\u4E2D\u65AD\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"userBreak\">\n <nz-switch ngModel [ngModelOptions]=\"{standalone:true}\"></nz-switch>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n }\n </nz-collapse-panel>\n <axis-base-design-setting [fg]=\"fg\"></axis-base-design-setting>\n <axis-input-trigger formControlName=\"triggeEvents\"\n [eventDesc]=\"[{name:'taskLoop',title:'\u4EFB\u52A1\u5FAA\u73AF',ds:{loopIndex:0,loopItem:'\u793A\u4F8B\u6570\u636E'}},{name:'loopTaskEnd',title:'\u5FAA\u73AF\u4EFB\u52A1\u7ED3\u675F',ds:{completedCount:0,totalCount:0}}]\"></axis-input-trigger>\n </nz-collapse>\n</form>" }]
|
|
41
|
+
}] });
|
|
42
|
+
|
|
43
|
+
class StartTaskLoopHandler extends FunFieldValueBase {
|
|
44
|
+
noListen = inject(InputTrigger).noListen;
|
|
45
|
+
sendInitValue = true;
|
|
46
|
+
fg = this.fb.group({
|
|
47
|
+
loopTarget: [undefined, FormValidators.requiredFun],
|
|
48
|
+
});
|
|
49
|
+
funFields = {
|
|
50
|
+
loopTarget: {
|
|
51
|
+
defaultValue: [],
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: StartTaskLoopHandler, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
55
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.12", type: StartTaskLoopHandler, isStandalone: true, selector: "axis-modal-design-start-task-loop-handler", providers: [
|
|
56
|
+
{
|
|
57
|
+
provide: NG_VALUE_ACCESSOR,
|
|
58
|
+
useExisting: forwardRef(() => StartTaskLoopHandler),
|
|
59
|
+
multi: true
|
|
60
|
+
}
|
|
61
|
+
], usesInheritance: true, ngImport: i0, template: "<form nz-form [formGroup]=\"fg\">\n <nz-form-item>\n <nz-form-label [nzSpan]=\"6\" nzRequired>\n \u5FAA\u73AF\u76EE\u6807\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"loopTarget\" [noListen]=\"noListen()\">\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\" [standalone]=\"true\"\n ngModel [ngModelOptions]=\"{standalone: true}\"></ng-container>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n</form>", styles: [""], dependencies: [{ kind: "ngmodule", type: NzFormModule }, { kind: "directive", type: i2.NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }, { kind: "directive", type: i2.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: i3.NzFormDirective, selector: "[nz-form]", inputs: ["nzLayout", "nzNoColon", "nzAutoTips", "nzDisableAutoTips", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap", "nzSize", "nzVariant", "nzRequiredMark"], exportAs: ["nzForm"] }, { kind: "component", type: i3.NzFormItemComponent, selector: "nz-form-item", exportAs: ["nzFormItem"] }, { kind: "component", type: i3.NzFormLabelComponent, selector: "nz-form-label", inputs: ["nzFor", "nzRequired", "nzNoColon", "nzTooltipTitle", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzFormLabel"] }, { kind: "component", type: i3.NzFormControlComponent, selector: "nz-form-control", inputs: ["nzSuccessTip", "nzWarningTip", "nzErrorTip", "nzValidatingTip", "nzExtra", "nzAutoTips", "nzDisableAutoTips", "nzHasFeedback", "nzValidateStatus"], exportAs: ["nzFormControl"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FunField, selector: "axis-fun-field", inputs: ["scopes", "exclude", "scopeId", "onlyFun", "noListen", "disabled", "editTip", "value", "open", "showCreateListenModal", "createListenDataSourceName"], outputs: ["valueChange", "openChange", "showCreateListenModalChange", "createListenDataSourceNameChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: DynamicDirective, selector: "[axisDynamic]", inputs: ["axisDynamic", "standalone", "isDesign", "forceRenderOnChange"], outputs: ["onRegisteValueAccess"], exportAs: ["axisDynamic"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
62
|
+
}
|
|
63
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: StartTaskLoopHandler, decorators: [{
|
|
64
|
+
type: Component,
|
|
65
|
+
args: [{ selector: 'axis-modal-design-start-task-loop-handler', imports: [NzFormModule, ReactiveFormsModule, FunField, FormsModule, DynamicDirective], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
66
|
+
{
|
|
67
|
+
provide: NG_VALUE_ACCESSOR,
|
|
68
|
+
useExisting: forwardRef(() => StartTaskLoopHandler),
|
|
69
|
+
multi: true
|
|
70
|
+
}
|
|
71
|
+
], template: "<form nz-form [formGroup]=\"fg\">\n <nz-form-item>\n <nz-form-label [nzSpan]=\"6\" nzRequired>\n \u5FAA\u73AF\u76EE\u6807\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"loopTarget\" [noListen]=\"noListen()\">\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\" [standalone]=\"true\"\n ngModel [ngModelOptions]=\"{standalone: true}\"></ng-container>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n</form>" }]
|
|
72
|
+
}] });
|
|
73
|
+
|
|
74
|
+
const Config = {
|
|
75
|
+
componentName: "循环任务",
|
|
76
|
+
eventHandlerDescs: {
|
|
77
|
+
startLoopTask: {
|
|
78
|
+
name: "startLoopTask",
|
|
79
|
+
title: "开始循环任务",
|
|
80
|
+
dataComponent: StartTaskLoopHandler,
|
|
81
|
+
icon: "sync",
|
|
82
|
+
target: "component",
|
|
83
|
+
targetComponent: "axis-components/loop-task",
|
|
84
|
+
},
|
|
85
|
+
breakLoopTask: {
|
|
86
|
+
name: "breakLoopTask",
|
|
87
|
+
title: "中断循环任务",
|
|
88
|
+
icon: "stop",
|
|
89
|
+
target: "component",
|
|
90
|
+
targetComponent: "axis-components/loop-task",
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
buildOptionsNodes(nextInfo) {
|
|
94
|
+
return {
|
|
95
|
+
treeNode: new OptionsNode({
|
|
96
|
+
parentId: nextInfo.parentId,
|
|
97
|
+
scopeId: nextInfo.scopeId,
|
|
98
|
+
name: "循环任务",
|
|
99
|
+
canSetting: true,
|
|
100
|
+
canDrag: true,
|
|
101
|
+
dragType: "component",
|
|
102
|
+
parentObj: nextInfo.parentObject,
|
|
103
|
+
indexOfParentObj: nextInfo.indexOfParent,
|
|
104
|
+
rootOptions: nextInfo.currentObject,
|
|
105
|
+
settingType: Setting,
|
|
106
|
+
contextMenu: SimpleMenu,
|
|
107
|
+
icon: "loading-3-quarters"
|
|
108
|
+
})
|
|
109
|
+
};
|
|
110
|
+
},
|
|
111
|
+
bindElementsOptionsNode(element, options) {
|
|
112
|
+
return {
|
|
113
|
+
[options.id]: { element }
|
|
114
|
+
};
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Generated bundle index. Do not edit.
|
|
120
|
+
*/
|
|
121
|
+
|
|
122
|
+
export { Config };
|
|
123
|
+
//# sourceMappingURL=ngx-axis-appforge-axis-components-loop-task-design.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-axis-appforge-axis-components-loop-task-design.mjs","sources":["../../../axis-components/loop-task/design/setting/setting.ts","../../../axis-components/loop-task/design/setting/setting.html","../../../axis-components/loop-task/design/start-task-loop-handler/start-task-loop-handler.ts","../../../axis-components/loop-task/design/start-task-loop-handler/start-task-loop-handler.html","../../../axis-components/loop-task/design/config.ts","../../../axis-components/loop-task/design/ngx-axis-appforge-axis-components-loop-task-design.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule, UntypedFormGroup } from '@angular/forms';\nimport { NzCollapseModule } from 'ng-zorro-antd/collapse';\nimport { NzFormModule } from 'ng-zorro-antd/form';\nimport { NzInputModule } from 'ng-zorro-antd/input';\nimport { BaseDesignSetting, baseFbConfig, baseFunField, FormValidators, FunField, FunFieldOptions, FunFieldValueBase, InputTrigger } from 'ngx-axis-appforge/core';\nimport { NzSwitchModule } from 'ng-zorro-antd/switch';\n\n@Component({\n selector: 'axis-design-loop-task-setting',\n imports: [FormsModule, NzFormModule, ReactiveFormsModule, NzCollapseModule, BaseDesignSetting, NzInputModule, NzSwitchModule, FunField, InputTrigger],\n templateUrl: './setting.html',\n styleUrl: './setting.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Setting extends FunFieldValueBase {\n\n override fg: UntypedFormGroup = this.fb.group({\n ...baseFbConfig,\n showProgress: [undefined, FormValidators.requiredFun],\n progressTip: [],\n userBreak: [undefined, FormValidators.requiredFun],\n });\n\n protected override funFields: FunFieldOptions = {\n ...baseFunField,\n showProgress: {\n defaultValue: true\n },\n progressTip: {\n defaultValue: \"执行中\"\n },\n userBreak: {\n defaultValue: true\n },\n };\n}\n","<form [formGroup]=\"fg\" nz-form>\n <nz-collapse [nzBordered]=\"false\">\n <nz-collapse-panel nzHeader=\"基本设置\" nzActive>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n 显示进度\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"showProgress\">\n <nz-switch ngModel [ngModelOptions]=\"{standalone:true}\"></nz-switch>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n @if (formValue().showProgress?.funMode || formValue()?.showProgress?.originValue) {\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n 进度提示\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"progressTip\">\n <input nz-input ngModel [ngModelOptions]=\"{standalone:true}\" />\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n 用户中断\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"userBreak\">\n <nz-switch ngModel [ngModelOptions]=\"{standalone:true}\"></nz-switch>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n }\n </nz-collapse-panel>\n <axis-base-design-setting [fg]=\"fg\"></axis-base-design-setting>\n <axis-input-trigger formControlName=\"triggeEvents\"\n [eventDesc]=\"[{name:'taskLoop',title:'任务循环',ds:{loopIndex:0,loopItem:'示例数据'}},{name:'loopTaskEnd',title:'循环任务结束',ds:{completedCount:0,totalCount:0}}]\"></axis-input-trigger>\n </nz-collapse>\n</form>","import { ChangeDetectionStrategy, Component, forwardRef, inject } from '@angular/core';\nimport { FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule, UntypedFormGroup } from '@angular/forms';\nimport { NzFormModule } from 'ng-zorro-antd/form';\nimport { NzRadioModule } from 'ng-zorro-antd/radio';\nimport { DynamicDirective, FormValidators, FunField, FunFieldOptions, FunFieldValueBase, InputTrigger } from 'ngx-axis-appforge/core';\n\n@Component({\n selector: 'axis-modal-design-start-task-loop-handler',\n imports: [NzFormModule, ReactiveFormsModule, FunField, FormsModule, DynamicDirective],\n templateUrl: './start-task-loop-handler.html',\n styleUrl: './start-task-loop-handler.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => StartTaskLoopHandler),\n multi: true\n }\n ]\n})\nexport class StartTaskLoopHandler extends FunFieldValueBase {\n readonly noListen = inject(InputTrigger).noListen;\n protected override sendInitValue: boolean = true;\n override fg: UntypedFormGroup = this.fb.group({\n loopTarget: [undefined, FormValidators.requiredFun],\n });\n\n protected override funFields: FunFieldOptions = {\n loopTarget: {\n defaultValue: [],\n },\n };\n\n}\n","<form nz-form [formGroup]=\"fg\">\n <nz-form-item>\n <nz-form-label [nzSpan]=\"6\" nzRequired>\n 循环目标\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"loopTarget\" [noListen]=\"noListen()\">\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\" [standalone]=\"true\"\n ngModel [ngModelOptions]=\"{standalone: true}\"></ng-container>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n</form>","import { NextInfo, DesignBuildResult, DesignBindElementsResult, DesignConfig, OptionsNode, nameCode, SimpleMenu } from \"ngx-axis-appforge/core\";\nimport { Setting } from \"./setting/setting\";\nimport { StartTaskLoopHandler } from \"./start-task-loop-handler/start-task-loop-handler\";\n\nexport const Config: DesignConfig = {\n\n componentName: \"循环任务\",\n eventHandlerDescs: {\n startLoopTask: {\n name: \"startLoopTask\",\n title: \"开始循环任务\",\n dataComponent: StartTaskLoopHandler,\n icon: \"sync\",\n target: \"component\",\n targetComponent: \"axis-components/loop-task\",\n },\n breakLoopTask: {\n name: \"breakLoopTask\",\n title: \"中断循环任务\",\n icon: \"stop\",\n target: \"component\",\n targetComponent: \"axis-components/loop-task\",\n },\n },\n buildOptionsNodes(nextInfo: NextInfo): DesignBuildResult {\n return {\n treeNode: new OptionsNode({\n parentId: nextInfo.parentId,\n scopeId: nextInfo.scopeId,\n name: \"循环任务\",\n canSetting: true,\n canDrag: true,\n dragType: \"component\",\n parentObj: nextInfo.parentObject,\n indexOfParentObj: nextInfo.indexOfParent,\n rootOptions: nextInfo.currentObject,\n settingType: Setting,\n contextMenu: SimpleMenu,\n icon: \"loading-3-quarters\"\n })\n };\n },\n bindElementsOptionsNode(element: HTMLElement, options: any): DesignBindElementsResult {\n return {\n [options.id]: { element }\n }\n },\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './config';\n"],"names":["i1","i2","i3"],"mappings":";;;;;;;;;;;;;;;AAeM,MAAO,OAAQ,SAAQ,iBAAiB,CAAA;AAEnC,IAAA,EAAE,GAAqB,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC;AAC5C,QAAA,GAAG,YAAY;AACf,QAAA,YAAY,EAAE,CAAC,SAAS,EAAE,cAAc,CAA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as i0 from '@angular/core';
|
|
2
|
+
import { signal, inject, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { DataOptions, Base } from 'ngx-axis-appforge/core';
|
|
4
|
+
import * as i1 from 'ng-zorro-antd/progress';
|
|
5
|
+
import { NzProgressModule } from 'ng-zorro-antd/progress';
|
|
6
|
+
import * as i4 from 'ng-zorro-antd/icon';
|
|
7
|
+
import { NzIconModule } from 'ng-zorro-antd/icon';
|
|
8
|
+
import * as i2 from 'ng-zorro-antd/button';
|
|
9
|
+
import { NzButtonModule } from 'ng-zorro-antd/button';
|
|
10
|
+
import { of, concatMap, tap, finalize } from 'rxjs';
|
|
11
|
+
import { NzMessageService } from 'ng-zorro-antd/message';
|
|
12
|
+
import * as i3 from 'ng-zorro-antd/core/transition-patch';
|
|
13
|
+
|
|
14
|
+
class LoopTaskOptions extends DataOptions {
|
|
15
|
+
showProgress = signal(true, ...(ngDevMode ? [{ debugName: "showProgress" }] : /* istanbul ignore next */ []));
|
|
16
|
+
progressTip = signal("执行中", ...(ngDevMode ? [{ debugName: "progressTip" }] : /* istanbul ignore next */ []));
|
|
17
|
+
userBreak = signal(true, ...(ngDevMode ? [{ debugName: "userBreak" }] : /* istanbul ignore next */ []));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
class LoopTask extends Base {
|
|
21
|
+
options = new LoopTaskOptions();
|
|
22
|
+
inProgress = signal(false, ...(ngDevMode ? [{ debugName: "inProgress" }] : /* istanbul ignore next */ []));
|
|
23
|
+
msg = inject(NzMessageService);
|
|
24
|
+
completed = signal(0, ...(ngDevMode ? [{ debugName: "completed" }] : /* istanbul ignore next */ []));
|
|
25
|
+
target = signal([], ...(ngDevMode ? [{ debugName: "target" }] : /* istanbul ignore next */ []));
|
|
26
|
+
progress = computed(() => {
|
|
27
|
+
if (this.target().length === 0) {
|
|
28
|
+
return 0;
|
|
29
|
+
}
|
|
30
|
+
return Math.ceil((this.completed() * 100 / this.target().length));
|
|
31
|
+
}, ...(ngDevMode ? [{ debugName: "progress" }] : /* istanbul ignore next */ []));
|
|
32
|
+
onEvents(e) {
|
|
33
|
+
const obs = super.onEvents?.(e);
|
|
34
|
+
if (obs) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
switch (e.name) {
|
|
38
|
+
case "startLoopTask":
|
|
39
|
+
if (this.inProgress()) {
|
|
40
|
+
this.msg.error("请勿重复操作");
|
|
41
|
+
return of(false);
|
|
42
|
+
}
|
|
43
|
+
if (!Array.isArray(e.data?.loopTarget)) {
|
|
44
|
+
return of(false);
|
|
45
|
+
}
|
|
46
|
+
this.startLoopTask(e.data?.loopTarget);
|
|
47
|
+
return of(true);
|
|
48
|
+
case "breakLoopTask":
|
|
49
|
+
this.breakLoop();
|
|
50
|
+
return of(true);
|
|
51
|
+
}
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
startLoopTask(target) {
|
|
55
|
+
this.inProgress.set(true);
|
|
56
|
+
this.target.set(target);
|
|
57
|
+
this.completed.set(0);
|
|
58
|
+
this.addSubscribe(of(...target).pipe(concatMap((item, index) => {
|
|
59
|
+
return this.triggeEvents("taskLoop", { loopIndex: index, loopItem: item }).pipe(tap(() => {
|
|
60
|
+
this.completed.set(index + 1);
|
|
61
|
+
}));
|
|
62
|
+
}), finalize(() => {
|
|
63
|
+
this.inProgress.set(false);
|
|
64
|
+
this.triggeEvents("loopTaskEnd", { completedCount: this.completed(), totalCount: this.target().length }).subscribe();
|
|
65
|
+
})).subscribe(), "task_loop");
|
|
66
|
+
}
|
|
67
|
+
breakLoop() {
|
|
68
|
+
this.unsubscribe(["task_loop"]);
|
|
69
|
+
}
|
|
70
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: LoopTask, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
71
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: LoopTask, isStandalone: true, selector: "axis-loop-task-component", host: { properties: { "style.display": "options.showProgress()&&inProgress()?\"flex\":\"none\"" } }, usesInheritance: true, ngImport: i0, template: "@if(options.showProgress()){\n<div class=\"progress-box\">\n @if(options.userBreak()){\n <button style=\"position: absolute;right: 0;top: 0;\" nz-button nzSize=\"small\" nzType=\"text\" nzShape=\"circle\"\n (click)=\"breakLoop()\">\n <nz-icon nzType=\"close\"></nz-icon></button>\n }\n <nz-progress [nzPercent]=\"progress()\" [nzWidth]=\"60\" nzType=\"circle\"></nz-progress>\n @if (options.progressTip()) {\n <div>{{options.progressTip()}}</div>\n }\n</div>\n}", styles: [":host{display:none;width:100%;height:100%;position:absolute;left:0;top:0;justify-content:center;align-items:center;background-color:#0000001f;z-index:9999}.progress-box{width:100px;height:100px;display:flex;flex-direction:column;justify-content:space-evenly;align-items:center;padding:0 10px;border-radius:6px;font-size:12px;text-align:center;background-color:#fff;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: NzProgressModule }, { kind: "component", type: i1.NzProgressComponent, selector: "nz-progress", inputs: ["nzShowInfo", "nzWidth", "nzStrokeColor", "nzSize", "nzFormat", "nzSuccessPercent", "nzPercent", "nzStrokeWidth", "nzGapDegree", "nzStatus", "nzType", "nzGapPosition", "nzStrokeLinecap", "nzSteps"], exportAs: ["nzProgress"] }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i2.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i4.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
72
|
+
}
|
|
73
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: LoopTask, decorators: [{
|
|
74
|
+
type: Component,
|
|
75
|
+
args: [{ selector: 'axis-loop-task-component', imports: [NzProgressModule, NzButtonModule, NzIconModule], host: {
|
|
76
|
+
'[style.display]': 'options.showProgress()&&inProgress()?"flex":"none"'
|
|
77
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if(options.showProgress()){\n<div class=\"progress-box\">\n @if(options.userBreak()){\n <button style=\"position: absolute;right: 0;top: 0;\" nz-button nzSize=\"small\" nzType=\"text\" nzShape=\"circle\"\n (click)=\"breakLoop()\">\n <nz-icon nzType=\"close\"></nz-icon></button>\n }\n <nz-progress [nzPercent]=\"progress()\" [nzWidth]=\"60\" nzType=\"circle\"></nz-progress>\n @if (options.progressTip()) {\n <div>{{options.progressTip()}}</div>\n }\n</div>\n}", styles: [":host{display:none;width:100%;height:100%;position:absolute;left:0;top:0;justify-content:center;align-items:center;background-color:#0000001f;z-index:9999}.progress-box{width:100px;height:100px;display:flex;flex-direction:column;justify-content:space-evenly;align-items:center;padding:0 10px;border-radius:6px;font-size:12px;text-align:center;background-color:#fff;position:relative}\n"] }]
|
|
78
|
+
}] });
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Generated bundle index. Do not edit.
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
export { LoopTask };
|
|
85
|
+
//# sourceMappingURL=ngx-axis-appforge-axis-components-loop-task.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-axis-appforge-axis-components-loop-task.mjs","sources":["../../../axis-components/loop-task/loop-task.options.ts","../../../axis-components/loop-task/loop-task.ts","../../../axis-components/loop-task/loop-task.html","../../../axis-components/loop-task/ngx-axis-appforge-axis-components-loop-task.ts"],"sourcesContent":["import { signal } from \"@angular/core\";\nimport { DataOptions } from \"ngx-axis-appforge/core\";\n\nexport class LoopTaskOptions extends DataOptions {\n readonly showProgress = signal(true);\n readonly progressTip = signal(\"执行中\");\n readonly userBreak = signal(true);\n}","import { ChangeDetectionStrategy, Component, computed, inject, signal } from '@angular/core';\nimport { Base, EventHandlerOptions } from 'ngx-axis-appforge/core';\nimport { LoopTaskOptions } from './loop-task.options';\nimport { NzProgressModule } from 'ng-zorro-antd/progress';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\nimport { NzButtonModule } from 'ng-zorro-antd/button';\nimport { concatMap, finalize, Observable, of, tap } from 'rxjs';\nimport { NzMessageService } from 'ng-zorro-antd/message';\n\n@Component({\n selector: 'axis-loop-task-component',\n imports: [NzProgressModule, NzButtonModule, NzIconModule],\n templateUrl: './loop-task.html',\n styleUrl: './loop-task.css',\n host: {\n '[style.display]': 'options.showProgress()&&inProgress()?\"flex\":\"none\"'\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class LoopTask extends Base<LoopTaskOptions> {\n\n override options: LoopTaskOptions = new LoopTaskOptions();\n\n readonly inProgress = signal(false);\n readonly msg = inject(NzMessageService);\n private readonly completed = signal(0);\n private readonly target = signal<any[]>([]);\n readonly progress = computed(() => {\n if (this.target().length === 0) {\n return 0;\n }\n return Math.ceil((this.completed() * 100 / this.target().length))\n });\n\n override onEvents(e: EventHandlerOptions<any>): Observable<boolean> | undefined {\n const obs = super.onEvents?.(e);\n if (obs) {\n return;\n }\n switch (e.name) {\n case \"startLoopTask\":\n if (this.inProgress()) {\n this.msg.error(\"请勿重复操作\");\n return of(false);\n }\n if (!Array.isArray(e.data?.loopTarget)) {\n return of(false);\n }\n this.startLoopTask(e.data?.loopTarget);\n return of(true);\n case \"breakLoopTask\":\n this.breakLoop();\n return of(true);\n }\n return undefined;\n }\n\n private startLoopTask(target: any[]) {\n this.inProgress.set(true);\n this.target.set(target);\n this.completed.set(0);\n this.addSubscribe(of(...target).pipe(concatMap((item, index) => {\n return this.triggeEvents(\"taskLoop\", { loopIndex: index, loopItem: item }).pipe(tap(() => {\n this.completed.set(index + 1)\n }));\n }), finalize(() => {\n this.inProgress.set(false);\n this.triggeEvents(\"loopTaskEnd\", { completedCount: this.completed(), totalCount: this.target().length }).subscribe();\n })).subscribe(), \"task_loop\");\n }\n\n breakLoop() {\n this.unsubscribe([\"task_loop\"]);\n }\n\n}\n","@if(options.showProgress()){\n<div class=\"progress-box\">\n @if(options.userBreak()){\n <button style=\"position: absolute;right: 0;top: 0;\" nz-button nzSize=\"small\" nzType=\"text\" nzShape=\"circle\"\n (click)=\"breakLoop()\">\n <nz-icon nzType=\"close\"></nz-icon></button>\n }\n <nz-progress [nzPercent]=\"progress()\" [nzWidth]=\"60\" nzType=\"circle\"></nz-progress>\n @if (options.progressTip()) {\n <div>{{options.progressTip()}}</div>\n }\n</div>\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './loop-task';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAGM,MAAO,eAAgB,SAAQ,WAAW,CAAA;AACnC,IAAA,YAAY,GAAG,MAAM,CAAC,IAAI,mFAAC;AAC3B,IAAA,WAAW,GAAG,MAAM,CAAC,KAAK,kFAAC;AAC3B,IAAA,SAAS,GAAG,MAAM,CAAC,IAAI,gFAAC;AACpC;;ACYK,MAAO,QAAS,SAAQ,IAAqB,CAAA;AAExC,IAAA,OAAO,GAAoB,IAAI,eAAe,EAAE;AAEhD,IAAA,UAAU,GAAG,MAAM,CAAC,KAAK,iFAAC;AAC1B,IAAA,GAAG,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACtB,IAAA,SAAS,GAAG,MAAM,CAAC,CAAC,gFAAC;AACrB,IAAA,MAAM,GAAG,MAAM,CAAQ,EAAE,6EAAC;AAClC,IAAA,QAAQ,GAAG,QAAQ,CAAC,MAAK;QAChC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,MAAM,KAAK,CAAC,EA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AAA,kBAAA,EAAA,WAAA,EAAA,eAAA,EAAA,aAAA,EAAA,UAAA,EAAA,QAAA,EAAA,eAAA,EAAA,iBAAA,EAAA,SAAA,CAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,cAAc,4eAAE,YAAY,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,CAAA,QAAA,EAAA,UAAA,EAAA,QAAA,EAAA,SAAA,EAAA,gBAAA,EAAA,YAAA,CAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAQ7C,QAAQ,EAAA,UAAA,EAAA,CAAA;kBAVpB,SAAS;+BACE,0BAA0B,EAAA,OAAA,EAC3B,CAAC,gBAAgB,EAAE,cAAc,EAAE,YAAY,CAAC,EAAA,IAAA,EAGnD;AACJ,wBAAA,iBAAiB,EAAE;qBACpB,EAAA,eAAA,EACgB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,kfAAA,EAAA,MAAA,EAAA,CAAA,mYAAA,CAAA,EAAA;;;AEjBjD;;AAEG;;;;"}
|
|
@@ -620,19 +620,21 @@ class SelectService {
|
|
|
620
620
|
this.keyField = opts.keyField;
|
|
621
621
|
this.data = opts.data;
|
|
622
622
|
this.close();
|
|
623
|
-
if (this.rows?.length) {
|
|
624
|
-
const setOfCheckedId = new Set();
|
|
625
|
-
for (const item of this.options.checkedKeys() ?? []) {
|
|
626
|
-
setOfCheckedId.add(item);
|
|
627
|
-
}
|
|
628
|
-
this.setOfCheckedId.set(setOfCheckedId);
|
|
629
|
-
untracked(() => this.refreshCheckedStatus(ChangeScene.refreshHeader));
|
|
630
|
-
}
|
|
631
623
|
if (opts.onSelectedChange) {
|
|
632
624
|
this.subs.push(this.changeSubject.subscribe(_ => {
|
|
633
625
|
opts.onSelectedChange(this.setOfCheckedId());
|
|
634
626
|
}));
|
|
635
627
|
}
|
|
628
|
+
const setOfCheckedId = untracked(this.setOfCheckedId);
|
|
629
|
+
if (this.rows?.length || setOfCheckedId.size > 0) {
|
|
630
|
+
untracked(() => {
|
|
631
|
+
for (const item of this.options.checkedKeys() ?? []) {
|
|
632
|
+
setOfCheckedId.add(item);
|
|
633
|
+
}
|
|
634
|
+
this.setOfCheckedId.set(setOfCheckedId);
|
|
635
|
+
this.refreshCheckedStatus();
|
|
636
|
+
});
|
|
637
|
+
}
|
|
636
638
|
this.parent = opts.parent;
|
|
637
639
|
if (opts.scope) {
|
|
638
640
|
this.scope = opts.scope;
|
|
@@ -717,9 +719,7 @@ class SelectService {
|
|
|
717
719
|
this.setOfCheckedId().clear();
|
|
718
720
|
this.setOfIndeterminateId().clear();
|
|
719
721
|
rows.forEach(row => this.updateCheckedSet(row[this.keyField], true));
|
|
720
|
-
console.log("setOfCheckedId", this.setOfCheckedId().size);
|
|
721
722
|
this.refreshCheckedStatus(scene);
|
|
722
|
-
console.log("setOfCheckedId", this.setOfCheckedId().size);
|
|
723
723
|
}
|
|
724
724
|
updateCheckedSet(key, checked, indeterminate = false) {
|
|
725
725
|
if (checked && this.options.singleCheck()) {
|