fantasy-ngzorro 2.2.3 → 2.2.4

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.
@@ -1,4 +1,4 @@
1
- import { Component, ContentChild, NgModule, Injectable, ɵɵdefineInjectable, EventEmitter, Input, Output, ChangeDetectorRef, ViewChild, NO_ERRORS_SCHEMA, ElementRef, ViewChildren, ɵɵinject, Pipe, ChangeDetectionStrategy, Optional } from '@angular/core';
1
+ import { Component, ContentChild, NgModule, Injectable, ɵɵdefineInjectable, EventEmitter, Input, Output, ChangeDetectorRef, ViewChild, NO_ERRORS_SCHEMA, InjectionToken, Optional, Inject, ElementRef, ViewChildren, ɵɵinject, Pipe, ChangeDetectionStrategy } from '@angular/core';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { FormsModule, ReactiveFormsModule, FormBuilder, Validators } from '@angular/forms';
4
4
  import { NgZorroAntdModule, InputBoolean, NzInputNumberComponent, NzSelectComponent, NzDatePickerComponent, NzRangePickerComponent, NzTimePickerComponent, NzModalService } from 'ng-zorro-antd';
@@ -2842,6 +2842,98 @@ HdDetailTipModule.decorators = [
2842
2842
  },] }
2843
2843
  ];
2844
2844
 
2845
+ /**
2846
+ * @fileoverview added by tsickle
2847
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2848
+ */
2849
+ // 控件列表
2850
+ class Filter {
2851
+ constructor() {
2852
+ // 输入框提示文案
2853
+ this.value = null; // 值 不传默认为null
2854
+ // 控件为Select时,选项列表
2855
+ this.inputNumber = new InputNumber(); // number组件的min、max、step
2856
+ // date-picker组件不可选择的日期
2857
+ this.showTime = false; // 日期选择器是否包含时间
2858
+ // 日期选择器是否包含时间
2859
+ this.require = false; // 是否必填
2860
+ }
2861
+ }
2862
+ if (false) {
2863
+ /** @type {?} */
2864
+ Filter.prototype.type;
2865
+ /** @type {?} */
2866
+ Filter.prototype.label;
2867
+ /** @type {?} */
2868
+ Filter.prototype.name;
2869
+ /** @type {?} */
2870
+ Filter.prototype.placeholder;
2871
+ /** @type {?} */
2872
+ Filter.prototype.value;
2873
+ /** @type {?} */
2874
+ Filter.prototype.show;
2875
+ /** @type {?} */
2876
+ Filter.prototype.selectOption;
2877
+ /** @type {?} */
2878
+ Filter.prototype.inputNumber;
2879
+ /** @type {?} */
2880
+ Filter.prototype.onSearchEvent;
2881
+ /** @type {?} */
2882
+ Filter.prototype.onChangeEvent;
2883
+ /** @type {?} */
2884
+ Filter.prototype.onBlurEvent;
2885
+ /** @type {?} */
2886
+ Filter.prototype.hdDisabledDate;
2887
+ /** @type {?} */
2888
+ Filter.prototype.showTime;
2889
+ /** @type {?} */
2890
+ Filter.prototype.require;
2891
+ /**
2892
+ * 是否允许清空当前筛选项(Input 清空按钮、Select/Date/Cascader 等清空图标)。
2893
+ * 不传默认 true;Select 未配此项时仍可回退到 selectOption.hdAllowClear
2894
+ * @type {?}
2895
+ */
2896
+ Filter.prototype.hdAllowClear;
2897
+ /** @type {?} */
2898
+ Filter.prototype.cascaderOption;
2899
+ /** @type {?} */
2900
+ Filter.prototype.onChangeEventDebounceTime;
2901
+ /** @type {?} */
2902
+ Filter.prototype.onSearchEventEventDebounceTime;
2903
+ }
2904
+ /** @enum {number} */
2905
+ const FilterListType = {
2906
+ Input: 0,
2907
+ Select: 1,
2908
+ Date: 2,
2909
+ DateRange: 3,
2910
+ MultipleSelect: 4,
2911
+ Cascader: 5,
2912
+ Month: 6,
2913
+ InputNumber: 7 // 数字输入
2914
+ ,
2915
+ };
2916
+ FilterListType[FilterListType.Input] = 'Input';
2917
+ FilterListType[FilterListType.Select] = 'Select';
2918
+ FilterListType[FilterListType.Date] = 'Date';
2919
+ FilterListType[FilterListType.DateRange] = 'DateRange';
2920
+ FilterListType[FilterListType.MultipleSelect] = 'MultipleSelect';
2921
+ FilterListType[FilterListType.Cascader] = 'Cascader';
2922
+ FilterListType[FilterListType.Month] = 'Month';
2923
+ FilterListType[FilterListType.InputNumber] = 'InputNumber';
2924
+ class HdFilterService {
2925
+ constructor() {
2926
+ }
2927
+ }
2928
+ HdFilterService.decorators = [
2929
+ { type: Injectable, args: [{
2930
+ providedIn: 'root'
2931
+ },] }
2932
+ ];
2933
+ /** @nocollapse */
2934
+ HdFilterService.ctorParameters = () => [];
2935
+ /** @nocollapse */ HdFilterService.ngInjectableDef = ɵɵdefineInjectable({ factory: function HdFilterService_Factory() { return new HdFilterService(); }, token: HdFilterService, providedIn: "root" });
2936
+
2845
2937
  /**
2846
2938
  * @fileoverview added by tsickle
2847
2939
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -2955,6 +3047,62 @@ function getCascaderMenuStyle(cascaderOption) {
2955
3047
  return Object.keys(style).length ? style : null;
2956
3048
  }
2957
3049
 
3050
+ /**
3051
+ * @fileoverview added by tsickle
3052
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3053
+ */
3054
+ /**
3055
+ * 用户筛选条件模版(与 auth UserFilterScheme 对齐)
3056
+ */
3057
+ class HdFilterScheme {
3058
+ }
3059
+ if (false) {
3060
+ /** @type {?} */
3061
+ HdFilterScheme.prototype.uuid;
3062
+ /** @type {?} */
3063
+ HdFilterScheme.prototype.userCode;
3064
+ /** @type {?} */
3065
+ HdFilterScheme.prototype.filterKey;
3066
+ /** @type {?} */
3067
+ HdFilterScheme.prototype.templateName;
3068
+ /** @type {?} */
3069
+ HdFilterScheme.prototype.filterValue;
3070
+ }
3071
+ /**
3072
+ * 内置默认模版名
3073
+ * @type {?}
3074
+ */
3075
+ const HD_FILTER_DEFAULT_SCHEME_NAME = '默认条件';
3076
+ /**
3077
+ * 业务仓实现并 provide,hd-filter 在 enableFilterScheme 时注入使用。
3078
+ * 不提供则开启开关也不会调接口。
3079
+ * @abstract
3080
+ */
3081
+ class HdFilterSchemeStore {
3082
+ }
3083
+ if (false) {
3084
+ /**
3085
+ * @abstract
3086
+ * @param {?} filterKey
3087
+ * @return {?}
3088
+ */
3089
+ HdFilterSchemeStore.prototype.queryByFilterKey = function (filterKey) { };
3090
+ /**
3091
+ * @abstract
3092
+ * @param {?} scheme
3093
+ * @return {?}
3094
+ */
3095
+ HdFilterSchemeStore.prototype.save = function (scheme) { };
3096
+ /**
3097
+ * @abstract
3098
+ * @param {?} uuid
3099
+ * @return {?}
3100
+ */
3101
+ HdFilterSchemeStore.prototype.delete = function (uuid) { };
3102
+ }
3103
+ /** @type {?} */
3104
+ const HD_FILTER_SCHEME_STORE = new InjectionToken('HD_FILTER_SCHEME_STORE');
3105
+
2958
3106
  /**
2959
3107
  * @fileoverview added by tsickle
2960
3108
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -2962,16 +3110,37 @@ function getCascaderMenuStyle(cascaderOption) {
2962
3110
  class HdFilterComponent {
2963
3111
  /**
2964
3112
  * @param {?} fb
3113
+ * @param {?} schemeStore
2965
3114
  */
2966
- constructor(fb) {
3115
+ constructor(fb, schemeStore) {
2967
3116
  this.fb = fb;
3117
+ this.schemeStore = schemeStore;
3118
+ /**
3119
+ * 是否启用筛选组(默认关闭)
3120
+ */
3121
+ this.enableFilterScheme = false;
2968
3122
  this.searchEvent = new EventEmitter();
2969
3123
  this.resetEvent = new EventEmitter();
2970
3124
  this.isShowMore = true;
2971
- // 对filterList取模运算
2972
3125
  this.filterListModular = 0;
2973
3126
  this.searchSubject = new Subject();
2974
- this.debounceTimeout = 0; // 默认防抖时间
3127
+ this.debounceTimeout = 0;
3128
+ /**
3129
+ * 页面配置的初始值(虚拟「默认条件」)
3130
+ */
3131
+ this.defaultFilterValues = {};
3132
+ this.defaultValuesCaptured = false;
3133
+ this.schemeList = [];
3134
+ this.currentScheme = null;
3135
+ this.currentSchemeName = HD_FILTER_DEFAULT_SCHEME_NAME;
3136
+ this.schemeLoading = false;
3137
+ this.schemeSaving = false;
3138
+ this.switchModalVisible = false;
3139
+ this.switchKeyword = '';
3140
+ this.switchSelectedUuid = null;
3141
+ this.saveAsModalVisible = false;
3142
+ this.saveAsName = '';
3143
+ this.defaultSchemeName = HD_FILTER_DEFAULT_SCHEME_NAME;
2975
3144
  this.getCascaderShowSearch = getCascaderShowSearch;
2976
3145
  this.getCascaderMenuClassName = getCascaderMenuClassName;
2977
3146
  this.getCascaderMenuStyle = getCascaderMenuStyle;
@@ -2986,12 +3155,56 @@ class HdFilterComponent {
2986
3155
  */
2987
3156
  ngOnInit() {
2988
3157
  this.init();
3158
+ this.tryLoadSchemes(true);
2989
3159
  }
2990
3160
  /**
3161
+ * @param {?} changes
2991
3162
  * @return {?}
2992
3163
  */
2993
- ngOnChanges() {
2994
- this.init();
3164
+ ngOnChanges(changes) {
3165
+ if (changes['filterList']) {
3166
+ this.init();
3167
+ }
3168
+ if (changes['enableFilterScheme'] || changes['filterSchemeKey']) {
3169
+ this.tryLoadSchemes(true);
3170
+ }
3171
+ }
3172
+ /**
3173
+ * @return {?}
3174
+ */
3175
+ ngOnDestroy() {
3176
+ if (this.searchSubscription) {
3177
+ this.searchSubscription.unsubscribe();
3178
+ }
3179
+ if (this.schemeLoadSub) {
3180
+ this.schemeLoadSub.unsubscribe();
3181
+ }
3182
+ if (this.schemeActionSub) {
3183
+ this.schemeActionSub.unsubscribe();
3184
+ }
3185
+ }
3186
+ /**
3187
+ * @return {?}
3188
+ */
3189
+ get canUseScheme() {
3190
+ return !!(this.enableFilterScheme && this.filterSchemeKey && this.schemeStore);
3191
+ }
3192
+ /**
3193
+ * @return {?}
3194
+ */
3195
+ get filteredSwitchList() {
3196
+ /** @type {?} */
3197
+ const list = this.getDisplaySchemeList();
3198
+ /** @type {?} */
3199
+ const kw = (this.switchKeyword || '').trim();
3200
+ if (!kw) {
3201
+ return list;
3202
+ }
3203
+ return list.filter((/**
3204
+ * @param {?} item
3205
+ * @return {?}
3206
+ */
3207
+ item => (item.templateName || '').indexOf(kw) >= 0));
2995
3208
  }
2996
3209
  /**
2997
3210
  * @private
@@ -2999,14 +3212,15 @@ class HdFilterComponent {
2999
3212
  */
3000
3213
  init() {
3001
3214
  this.isShowMore = true;
3002
- // 异常捕获
3003
3215
  if (!this.checkList(this.filterList)) {
3004
3216
  throw 'filter组件数据格式不规范';
3005
3217
  }
3218
+ if (!this.filterList) {
3219
+ this.filterList = [];
3220
+ }
3006
3221
  this.filterListModular = this.filterList.length % 4;
3007
- // 首先根据定义的组件数组 去初始化表单
3008
3222
  /** @type {?} */
3009
- let formGroupList = {};
3223
+ const formGroupList = {};
3010
3224
  this.filterList.forEach((/**
3011
3225
  * @param {?} item
3012
3226
  * @param {?} index
@@ -3014,10 +3228,13 @@ class HdFilterComponent {
3014
3228
  */
3015
3229
  (item, index) => {
3016
3230
  formGroupList[item.name] = this.fb.control(item.value, []);
3017
- // 初始化控件显影
3018
3231
  item.show = index < 7;
3019
3232
  }));
3020
3233
  this.validateFilterForm = this.fb.group(formGroupList);
3234
+ if (!this.defaultValuesCaptured) {
3235
+ this.defaultFilterValues = this.clonePlain(this.getFilterData());
3236
+ this.defaultValuesCaptured = true;
3237
+ }
3021
3238
  this.filterList.forEach((/**
3022
3239
  * @param {?} item
3023
3240
  * @return {?}
@@ -3052,19 +3269,15 @@ class HdFilterComponent {
3052
3269
  */
3053
3270
  onSearchEvent(fn, event, onSearchEventDebounceTime, selectOption) {
3054
3271
  if (onSearchEventDebounceTime) {
3055
- // 更新防抖时间
3056
3272
  this.debounceTimeout = onSearchEventDebounceTime;
3057
- // 取消之前的订阅
3058
3273
  if (this.searchSubscription) {
3059
3274
  this.searchSubscription.unsubscribe();
3060
3275
  }
3061
- // 创建新的订阅
3062
3276
  this.searchSubscription = this.searchSubject.pipe(debounceTime(this.debounceTimeout)).subscribe((/**
3063
3277
  * @param {?} __0
3064
3278
  * @return {?}
3065
3279
  */
3066
3280
  ({ fn, event, selectOption }) => this.triggerEvent(fn, event, selectOption)));
3067
- // 发送事件
3068
3281
  this.searchSubject.next({ fn, event, selectOption });
3069
3282
  }
3070
3283
  else {
@@ -3091,147 +3304,651 @@ class HdFilterComponent {
3091
3304
  /**
3092
3305
  * @return {?}
3093
3306
  */
3094
- computeOffset() {
3095
- // 特殊处理下等于4个选项的情况
3096
- if (this.filterList.length === 4) {
3097
- return 18;
3307
+ computeOffset() {
3308
+ if (this.filterList.length === 4) {
3309
+ return 18;
3310
+ }
3311
+ return this.isShowMore ? ((this.filterListModular === 0 || this.filterList.length > 7) ? 0 : (3 - this.filterListModular) * 6) : (this.filterListModular === 0 ? 18 : (3 - this.filterListModular) * 6);
3312
+ }
3313
+ /**
3314
+ * @private
3315
+ * @param {?} list
3316
+ * @return {?}
3317
+ */
3318
+ checkList(list) {
3319
+ if (!list || (list && list.length === 0)) {
3320
+ return true;
3321
+ }
3322
+ /** @type {?} */
3323
+ const nameList = [];
3324
+ list.forEach((/**
3325
+ * @param {?} item
3326
+ * @return {?}
3327
+ */
3328
+ (item) => {
3329
+ nameList.push(item.name);
3330
+ }));
3331
+ if ([...new Set(nameList)].length !== list.length) {
3332
+ throw 'filter组件数据格式不规范,存在重复name值!';
3333
+ }
3334
+ return true;
3335
+ }
3336
+ /**
3337
+ * @return {?}
3338
+ */
3339
+ submitForm() {
3340
+ this.searchEvent.emit(this.validateFilterForm.getRawValue());
3341
+ }
3342
+ /**
3343
+ * @return {?}
3344
+ */
3345
+ resetForm() {
3346
+ this.resetFilterFormWithValue();
3347
+ if (this.resetEvent.observers.length > 0) {
3348
+ this.resetEvent.emit(this.validateFilterForm.getRawValue());
3349
+ }
3350
+ else {
3351
+ this.searchEvent.emit(this.validateFilterForm.getRawValue());
3352
+ }
3353
+ }
3354
+ /**
3355
+ * @return {?}
3356
+ */
3357
+ resetFilterFormWithValue() {
3358
+ /** @type {?} */
3359
+ const resetValue = {};
3360
+ this.filterList.forEach((/**
3361
+ * @param {?} item
3362
+ * @return {?}
3363
+ */
3364
+ (item) => {
3365
+ resetValue[item.name] = item.value;
3366
+ }));
3367
+ this.validateFilterForm.patchValue(resetValue);
3368
+ }
3369
+ /**
3370
+ * @return {?}
3371
+ */
3372
+ getFilterData() {
3373
+ return this.validateFilterForm.getRawValue();
3374
+ }
3375
+ /**
3376
+ * @return {?}
3377
+ */
3378
+ showMore() {
3379
+ this.isShowMore = !this.isShowMore;
3380
+ this.filterList.forEach((/**
3381
+ * @param {?} item
3382
+ * @param {?} index
3383
+ * @return {?}
3384
+ */
3385
+ (item, index) => {
3386
+ item.show = this.isShowMore ? index < 7 : true;
3387
+ }));
3388
+ }
3389
+ /**
3390
+ * @param {?} filter
3391
+ * @return {?}
3392
+ */
3393
+ inputClean(filter) {
3394
+ /** @type {?} */
3395
+ const patchObject = {};
3396
+ patchObject[filter.name] = null;
3397
+ this.validateFilterForm.patchValue(patchObject);
3398
+ }
3399
+ /**
3400
+ * @param {?} item
3401
+ * @return {?}
3402
+ */
3403
+ isAllowClear(item) {
3404
+ if (!item) {
3405
+ return true;
3406
+ }
3407
+ if (item.hdAllowClear != null) {
3408
+ return !!item.hdAllowClear;
3409
+ }
3410
+ if (item.selectOption && item.selectOption.hdAllowClear != null) {
3411
+ return !!item.selectOption.hdAllowClear;
3412
+ }
3413
+ return true;
3414
+ }
3415
+ // ---------- 筛选组 ----------
3416
+ /**
3417
+ * @private
3418
+ * @param {?} applyDefault
3419
+ * @return {?}
3420
+ */
3421
+ tryLoadSchemes(applyDefault) {
3422
+ if (!this.canUseScheme) {
3423
+ this.schemeList = [];
3424
+ this.currentScheme = null;
3425
+ this.currentSchemeName = HD_FILTER_DEFAULT_SCHEME_NAME;
3426
+ return;
3427
+ }
3428
+ this.schemeLoading = true;
3429
+ if (this.schemeLoadSub) {
3430
+ this.schemeLoadSub.unsubscribe();
3431
+ }
3432
+ this.schemeLoadSub = this.schemeStore.queryByFilterKey(this.filterSchemeKey).subscribe((/**
3433
+ * @param {?} list
3434
+ * @return {?}
3435
+ */
3436
+ (list) => {
3437
+ this.schemeLoading = false;
3438
+ this.schemeList = list || [];
3439
+ if (applyDefault) {
3440
+ this.applySchemeByName(HD_FILTER_DEFAULT_SCHEME_NAME, true);
3441
+ }
3442
+ else if (this.currentScheme && this.currentScheme.uuid) {
3443
+ /** @type {?} */
3444
+ const found = this.schemeList.find((/**
3445
+ * @param {?} s
3446
+ * @return {?}
3447
+ */
3448
+ s => s.uuid === this.currentScheme.uuid));
3449
+ this.currentScheme = found || null;
3450
+ this.currentSchemeName = found ? found.templateName : HD_FILTER_DEFAULT_SCHEME_NAME;
3451
+ }
3452
+ }), (/**
3453
+ * @param {?} err
3454
+ * @return {?}
3455
+ */
3456
+ (err) => {
3457
+ this.schemeLoading = false;
3458
+ this.showError('加载筛选模版失败:' + (err || ''));
3459
+ if (applyDefault) {
3460
+ this.applySchemeByName(HD_FILTER_DEFAULT_SCHEME_NAME, true);
3461
+ }
3462
+ }));
3463
+ }
3464
+ /**
3465
+ * 展示用列表:保证有「默认条件」
3466
+ * @return {?}
3467
+ */
3468
+ getDisplaySchemeList() {
3469
+ /** @type {?} */
3470
+ const result = [];
3471
+ /** @type {?} */
3472
+ const fromDb = this.schemeList.find((/**
3473
+ * @param {?} s
3474
+ * @return {?}
3475
+ */
3476
+ s => s.templateName === HD_FILTER_DEFAULT_SCHEME_NAME));
3477
+ if (fromDb) {
3478
+ result.push(fromDb);
3479
+ }
3480
+ else {
3481
+ result.push({
3482
+ filterKey: this.filterSchemeKey,
3483
+ templateName: HD_FILTER_DEFAULT_SCHEME_NAME,
3484
+ filterValue: JSON.stringify(this.defaultFilterValues || {})
3485
+ });
3486
+ }
3487
+ (this.schemeList || []).forEach((/**
3488
+ * @param {?} s
3489
+ * @return {?}
3490
+ */
3491
+ s => {
3492
+ if (s.templateName !== HD_FILTER_DEFAULT_SCHEME_NAME) {
3493
+ result.push(s);
3494
+ }
3495
+ }));
3496
+ return result;
3497
+ }
3498
+ /**
3499
+ * @return {?}
3500
+ */
3501
+ openSwitchModal() {
3502
+ if (!this.canUseScheme) {
3503
+ return;
3504
+ }
3505
+ this.switchKeyword = '';
3506
+ this.switchSelectedUuid = this.currentScheme && this.currentScheme.uuid
3507
+ ? this.currentScheme.uuid
3508
+ : null;
3509
+ // 虚拟默认条件:uuid 为空时用空串标记
3510
+ if (!this.currentScheme || !this.currentScheme.uuid) {
3511
+ if (this.currentSchemeName === HD_FILTER_DEFAULT_SCHEME_NAME) {
3512
+ this.switchSelectedUuid = '';
3513
+ }
3514
+ }
3515
+ this.switchModalVisible = true;
3516
+ }
3517
+ /**
3518
+ * @return {?}
3519
+ */
3520
+ closeSwitchModal() {
3521
+ this.switchModalVisible = false;
3522
+ }
3523
+ /**
3524
+ * @param {?} item
3525
+ * @return {?}
3526
+ */
3527
+ selectSwitchItem(item) {
3528
+ this.switchSelectedUuid = item.uuid ? item.uuid : '';
3529
+ }
3530
+ /**
3531
+ * @return {?}
3532
+ */
3533
+ confirmSwitch() {
3534
+ /** @type {?} */
3535
+ const list = this.getDisplaySchemeList();
3536
+ /** @type {?} */
3537
+ let target = null;
3538
+ if (this.switchSelectedUuid === '' || this.switchSelectedUuid == null) {
3539
+ target = list.find((/**
3540
+ * @param {?} s
3541
+ * @return {?}
3542
+ */
3543
+ s => s.templateName === HD_FILTER_DEFAULT_SCHEME_NAME && !s.uuid))
3544
+ || list.find((/**
3545
+ * @param {?} s
3546
+ * @return {?}
3547
+ */
3548
+ s => s.templateName === HD_FILTER_DEFAULT_SCHEME_NAME));
3549
+ }
3550
+ else {
3551
+ target = list.find((/**
3552
+ * @param {?} s
3553
+ * @return {?}
3554
+ */
3555
+ s => s.uuid === this.switchSelectedUuid));
3556
+ }
3557
+ if (!target) {
3558
+ this.showError('请选择筛选模版');
3559
+ return;
3560
+ }
3561
+ this.applyScheme(target, true);
3562
+ this.switchModalVisible = false;
3563
+ }
3564
+ /**
3565
+ * @param {?} item
3566
+ * @return {?}
3567
+ */
3568
+ isDefaultScheme(item) {
3569
+ return !!(item && item.templateName === HD_FILTER_DEFAULT_SCHEME_NAME);
3570
+ }
3571
+ /**
3572
+ * @return {?}
3573
+ */
3574
+ canDeleteCurrent() {
3575
+ return !!(this.currentScheme && this.currentScheme.uuid
3576
+ && this.currentScheme.templateName !== HD_FILTER_DEFAULT_SCHEME_NAME);
3577
+ }
3578
+ /**
3579
+ * @return {?}
3580
+ */
3581
+ saveCurrentScheme() {
3582
+ if (!this.canUseScheme) {
3583
+ return;
3584
+ }
3585
+ /** @type {?} */
3586
+ const name = this.currentSchemeName || HD_FILTER_DEFAULT_SCHEME_NAME;
3587
+ /** @type {?} */
3588
+ const body = {
3589
+ uuid: this.currentScheme && this.currentScheme.uuid ? this.currentScheme.uuid : null,
3590
+ filterKey: this.filterSchemeKey,
3591
+ templateName: name,
3592
+ filterValue: this.serializeFilterValue()
3593
+ };
3594
+ this.schemeSaving = true;
3595
+ if (this.schemeActionSub) {
3596
+ this.schemeActionSub.unsubscribe();
3597
+ }
3598
+ this.schemeActionSub = this.schemeStore.save(body).subscribe((/**
3599
+ * @param {?} saved
3600
+ * @return {?}
3601
+ */
3602
+ (saved) => {
3603
+ this.schemeSaving = false;
3604
+ this.showSuccess('保存成功');
3605
+ this.currentScheme = saved;
3606
+ this.currentSchemeName = saved.templateName;
3607
+ this.refreshSchemeListKeepCurrent();
3608
+ }), (/**
3609
+ * @param {?} err
3610
+ * @return {?}
3611
+ */
3612
+ (err) => {
3613
+ this.schemeSaving = false;
3614
+ this.showError('保存失败:' + (err || ''));
3615
+ }));
3616
+ }
3617
+ /**
3618
+ * @return {?}
3619
+ */
3620
+ openSaveAsModal() {
3621
+ this.saveAsName = '';
3622
+ this.saveAsModalVisible = true;
3623
+ }
3624
+ /**
3625
+ * @return {?}
3626
+ */
3627
+ closeSaveAsModal() {
3628
+ this.saveAsModalVisible = false;
3629
+ }
3630
+ /**
3631
+ * @return {?}
3632
+ */
3633
+ confirmSaveAs() {
3634
+ /** @type {?} */
3635
+ const name = (this.saveAsName || '').trim();
3636
+ if (!name) {
3637
+ this.showError('请输入模版名称');
3638
+ return;
3639
+ }
3640
+ if (name === HD_FILTER_DEFAULT_SCHEME_NAME) {
3641
+ this.showError('不能使用「默认条件」作为模版名称,请使用「保存为当前」覆盖默认条件');
3642
+ return;
3643
+ }
3644
+ /** @type {?} */
3645
+ const exists = (this.schemeList || []).some((/**
3646
+ * @param {?} s
3647
+ * @return {?}
3648
+ */
3649
+ s => s.templateName === name));
3650
+ if (exists) {
3651
+ this.showError('模版名称已存在');
3652
+ return;
3653
+ }
3654
+ /** @type {?} */
3655
+ const body = {
3656
+ filterKey: this.filterSchemeKey,
3657
+ templateName: name,
3658
+ filterValue: this.serializeFilterValue()
3659
+ };
3660
+ this.schemeSaving = true;
3661
+ if (this.schemeActionSub) {
3662
+ this.schemeActionSub.unsubscribe();
3663
+ }
3664
+ this.schemeActionSub = this.schemeStore.save(body).subscribe((/**
3665
+ * @param {?} saved
3666
+ * @return {?}
3667
+ */
3668
+ (saved) => {
3669
+ this.schemeSaving = false;
3670
+ this.saveAsModalVisible = false;
3671
+ this.showSuccess('另存为成功');
3672
+ this.currentScheme = saved;
3673
+ this.currentSchemeName = saved.templateName;
3674
+ this.refreshSchemeListKeepCurrent();
3675
+ }), (/**
3676
+ * @param {?} err
3677
+ * @return {?}
3678
+ */
3679
+ (err) => {
3680
+ this.schemeSaving = false;
3681
+ this.showError('另存为失败:' + (err || ''));
3682
+ }));
3683
+ }
3684
+ /**
3685
+ * @return {?}
3686
+ */
3687
+ deleteCurrentScheme() {
3688
+ if (!this.canDeleteCurrent()) {
3689
+ return;
3690
+ }
3691
+ /** @type {?} */
3692
+ const uuid = this.currentScheme.uuid;
3693
+ this.schemeSaving = true;
3694
+ if (this.schemeActionSub) {
3695
+ this.schemeActionSub.unsubscribe();
3696
+ }
3697
+ this.schemeActionSub = this.schemeStore.delete(uuid).subscribe((/**
3698
+ * @return {?}
3699
+ */
3700
+ () => {
3701
+ this.schemeSaving = false;
3702
+ this.showSuccess('删除成功');
3703
+ this.schemeList = (this.schemeList || []).filter((/**
3704
+ * @param {?} s
3705
+ * @return {?}
3706
+ */
3707
+ s => s.uuid !== uuid));
3708
+ this.applySchemeByName(HD_FILTER_DEFAULT_SCHEME_NAME, true);
3709
+ }), (/**
3710
+ * @param {?} err
3711
+ * @return {?}
3712
+ */
3713
+ (err) => {
3714
+ this.schemeSaving = false;
3715
+ this.showError('删除失败:' + (err || ''));
3716
+ }));
3717
+ }
3718
+ /**
3719
+ * @private
3720
+ * @return {?}
3721
+ */
3722
+ refreshSchemeListKeepCurrent() {
3723
+ if (!this.canUseScheme) {
3724
+ return;
3098
3725
  }
3099
- return this.isShowMore ? ((this.filterListModular === 0 || this.filterList.length > 7) ? 0 : (3 - this.filterListModular) * 6) : (this.filterListModular === 0 ? 18 : (3 - this.filterListModular) * 6);
3726
+ this.schemeStore.queryByFilterKey(this.filterSchemeKey).subscribe((/**
3727
+ * @param {?} list
3728
+ * @return {?}
3729
+ */
3730
+ (list) => {
3731
+ this.schemeList = list || [];
3732
+ if (this.currentScheme && this.currentScheme.uuid) {
3733
+ /** @type {?} */
3734
+ const found = this.schemeList.find((/**
3735
+ * @param {?} s
3736
+ * @return {?}
3737
+ */
3738
+ s => s.uuid === this.currentScheme.uuid));
3739
+ if (found) {
3740
+ this.currentScheme = found;
3741
+ this.currentSchemeName = found.templateName;
3742
+ }
3743
+ }
3744
+ }), (/**
3745
+ * @return {?}
3746
+ */
3747
+ () => { }));
3100
3748
  }
3101
3749
  /**
3102
3750
  * @private
3103
- * @param {?} list
3751
+ * @param {?} name
3752
+ * @param {?} emitSearch
3104
3753
  * @return {?}
3105
3754
  */
3106
- checkList(list) {
3107
- if (!list || (list && list.length === 0)) {
3108
- return true;
3109
- }
3755
+ applySchemeByName(name, emitSearch) {
3110
3756
  /** @type {?} */
3111
- let nameList = [];
3112
- list.forEach((/**
3113
- * @param {?} item
3757
+ const list = this.getDisplaySchemeList();
3758
+ /** @type {?} */
3759
+ const target = list.find((/**
3760
+ * @param {?} s
3114
3761
  * @return {?}
3115
3762
  */
3116
- (item) => {
3117
- // 校验单项选择器
3118
- // if (item.type === FilterListType.Select && (!item.selectOption.selectList || (item.selectOption.selectList && item.selectOption.selectList.length === 0))) {
3119
- // throw 'filter组件数据格式不规范,存在单项选择器没有传入选项!'
3120
- // }
3121
- nameList.push(item.name);
3122
- }));
3123
- // 校验name是否重复
3124
- if ([...new Set(nameList)].length !== list.length) {
3125
- throw 'filter组件数据格式不规范,存在重复name值!';
3763
+ s => s.templateName === name));
3764
+ if (target) {
3765
+ this.applyScheme(target, emitSearch);
3126
3766
  }
3127
- // ...more check
3128
- return true;
3129
3767
  }
3130
3768
  /**
3769
+ * @private
3770
+ * @param {?} scheme
3771
+ * @param {?} emitSearch
3131
3772
  * @return {?}
3132
3773
  */
3133
- submitForm() {
3134
- this.searchEvent.emit(this.validateFilterForm.getRawValue());
3774
+ applyScheme(scheme, emitSearch) {
3775
+ this.currentScheme = scheme && scheme.uuid ? scheme : {
3776
+ filterKey: this.filterSchemeKey,
3777
+ templateName: scheme ? scheme.templateName : HD_FILTER_DEFAULT_SCHEME_NAME,
3778
+ filterValue: scheme ? scheme.filterValue : JSON.stringify(this.defaultFilterValues || {})
3779
+ };
3780
+ this.currentSchemeName = this.currentScheme.templateName || HD_FILTER_DEFAULT_SCHEME_NAME;
3781
+ /** @type {?} */
3782
+ let values = {};
3783
+ if (this.currentSchemeName === HD_FILTER_DEFAULT_SCHEME_NAME && !(scheme && scheme.uuid)) {
3784
+ values = this.clonePlain(this.defaultFilterValues || {});
3785
+ }
3786
+ else {
3787
+ try {
3788
+ values = JSON.parse(scheme.filterValue || '{}');
3789
+ }
3790
+ catch (e) {
3791
+ values = {};
3792
+ }
3793
+ if (this.currentSchemeName === HD_FILTER_DEFAULT_SCHEME_NAME) {
3794
+ // 库中默认条件覆盖初始值:以默认值为底,再叠加库值
3795
+ values = Object.assign({}, this.defaultFilterValues || {}, values || {});
3796
+ }
3797
+ }
3798
+ this.patchFilterValues(values);
3799
+ if (emitSearch) {
3800
+ this.submitForm();
3801
+ }
3135
3802
  }
3136
3803
  /**
3804
+ * @private
3137
3805
  * @return {?}
3138
3806
  */
3139
- resetForm() {
3140
- this.resetFilterFormWithValue();
3141
- // this.validateFilterForm.reset();
3142
- if (this.resetEvent.observers.length > 0) {
3143
- // 如果有父组件绑定了 resetEvent 的处理器
3144
- this.resetEvent.emit(this.validateFilterForm.getRawValue());
3145
- }
3146
- else {
3147
- // 如果没有绑定处理器,则触发 searchEvent
3148
- this.searchEvent.emit(this.validateFilterForm.getRawValue());
3149
- }
3807
+ serializeFilterValue() {
3808
+ return JSON.stringify(this.getFilterData() || {});
3150
3809
  }
3151
3810
  /**
3152
- * 带初始值重置表单
3811
+ * @private
3812
+ * @param {?} values
3153
3813
  * @return {?}
3154
3814
  */
3155
- resetFilterFormWithValue() {
3815
+ patchFilterValues(values) {
3816
+ if (!this.validateFilterForm || !this.filterList) {
3817
+ return;
3818
+ }
3156
3819
  /** @type {?} */
3157
- const resetValue = {};
3820
+ const patch = {};
3158
3821
  this.filterList.forEach((/**
3159
3822
  * @param {?} item
3160
3823
  * @return {?}
3161
3824
  */
3162
- (item) => {
3163
- resetValue[item.name] = item.value;
3825
+ item => {
3826
+ if (values && Object.prototype.hasOwnProperty.call(values, item.name)) {
3827
+ patch[item.name] = this.reviveFilterValue(item, values[item.name]);
3828
+ }
3164
3829
  }));
3165
- // 重置表单值(会触发valueChanges事件)
3166
- this.validateFilterForm.patchValue(resetValue);
3830
+ this.validateFilterForm.patchValue(patch);
3167
3831
  }
3168
3832
  /**
3833
+ * @private
3834
+ * @param {?} filter
3835
+ * @param {?} value
3169
3836
  * @return {?}
3170
3837
  */
3171
- getFilterData() {
3172
- return this.validateFilterForm.getRawValue();
3838
+ reviveFilterValue(filter, value) {
3839
+ if (value == null) {
3840
+ return value;
3841
+ }
3842
+ if (filter.type === FilterListType.DateRange) {
3843
+ if (Array.isArray(value)) {
3844
+ return value.map((/**
3845
+ * @param {?} v
3846
+ * @return {?}
3847
+ */
3848
+ v => this.parseDateLike(v)));
3849
+ }
3850
+ return value;
3851
+ }
3852
+ if (filter.type === FilterListType.Date || filter.type === FilterListType.Month) {
3853
+ return this.parseDateLike(value);
3854
+ }
3855
+ return value;
3173
3856
  }
3174
3857
  /**
3858
+ * @private
3859
+ * @param {?} value
3175
3860
  * @return {?}
3176
3861
  */
3177
- showMore() {
3178
- this.isShowMore = !this.isShowMore;
3179
- this.filterList.forEach((/**
3180
- * @param {?} item
3181
- * @param {?} index
3182
- * @return {?}
3183
- */
3184
- (item, index) => {
3185
- item.show = this.isShowMore ? index < 7 : true;
3186
- }));
3862
+ parseDateLike(value) {
3863
+ if (value == null || value instanceof Date) {
3864
+ return value;
3865
+ }
3866
+ if (typeof value === 'string' && /^\d{4}-\d{2}-\d{2}/.test(value)) {
3867
+ /** @type {?} */
3868
+ const d = new Date(value);
3869
+ return isNaN(d.getTime()) ? value : d;
3870
+ }
3871
+ if (typeof value === 'number') {
3872
+ /** @type {?} */
3873
+ const d = new Date(value);
3874
+ return isNaN(d.getTime()) ? value : d;
3875
+ }
3876
+ return value;
3187
3877
  }
3188
3878
  /**
3189
- * @param {?} filter
3879
+ * @private
3880
+ * @param {?} obj
3190
3881
  * @return {?}
3191
3882
  */
3192
- inputClean(filter) {
3193
- /** @type {?} */
3194
- const patchObject = {};
3195
- patchObject[filter.name] = null;
3196
- this.validateFilterForm.patchValue(patchObject);
3883
+ clonePlain(obj) {
3884
+ try {
3885
+ return JSON.parse(JSON.stringify(obj == null ? {} : obj));
3886
+ }
3887
+ catch (e) {
3888
+ return {};
3889
+ }
3197
3890
  }
3198
3891
  /**
3199
- * 是否允许清空:优先 Filter.hdAllowClear,其次 selectOption.hdAllowClear,默认 true
3200
- * @param {?} item
3892
+ * @private
3893
+ * @param {?} msg
3201
3894
  * @return {?}
3202
3895
  */
3203
- isAllowClear(item) {
3204
- if (!item) {
3205
- return true;
3896
+ showSuccess(msg) {
3897
+ if (typeof window !== 'undefined' && ((/** @type {?} */ (window))).hdMessageService) {
3898
+ ((/** @type {?} */ (window))).hdMessageService.prototype.success(msg);
3206
3899
  }
3207
- if (item.hdAllowClear != null) {
3208
- return !!item.hdAllowClear;
3900
+ }
3901
+ /**
3902
+ * @private
3903
+ * @param {?} msg
3904
+ * @return {?}
3905
+ */
3906
+ showError(msg) {
3907
+ if (typeof window !== 'undefined' && ((/** @type {?} */ (window))).hdMessageService) {
3908
+ ((/** @type {?} */ (window))).hdMessageService.prototype.error(msg);
3209
3909
  }
3210
- if (item.selectOption && item.selectOption.hdAllowClear != null) {
3211
- return !!item.selectOption.hdAllowClear;
3910
+ else {
3911
+ // eslint-disable-next-line no-console
3912
+ console.error(msg);
3212
3913
  }
3213
- return true;
3214
3914
  }
3215
3915
  }
3216
3916
  HdFilterComponent.decorators = [
3217
3917
  { type: Component, args: [{
3218
3918
  selector: 'hd-filter',
3219
- template: "<form nz-form [formGroup]=\"validateFilterForm\" class=\"ant-advanced-search-form hd-filter-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 filter of filterList\">\n <div nz-col [nzSpan]=\"6\" [hidden]=\"!filter.show\">\n <nz-form-item nzFlex>\n <nz-form-label class=\"hd-filter-label\" [nzNoColon]=\"true\"><span class=\"hd-red\" *ngIf=\"filter.require\">*</span>{{ filter.label }}\n </nz-form-label>\n <nz-form-control class=\"hd-filter-control\">\n <ng-container [ngSwitch]=\"filter.type\">\n <!-- \u8FD9\u91CC\u6570\u5B57\u5BF9\u5E94\u679A\u4E3E\u7C7B\u578B\uFF0C\u53EF\u5728hd-filter.service.ts\u6587\u4EF6\u4E2D\u67E5\u770B\u5BF9\u5E94\u5173\u7CFB -->\n <ng-container *ngSwitchCase=\"0\">\n <nz-input-group [nzSuffix]=\"inputCleanTemplate\">\n <input nz-input [placeholder]=\"filter.placeholder ? filter.placeholder : '\u8BF7\u8F93\u5165' + filter.label\"\n [formControlName]=\"filter.name\"\n (blur)=\"triggerEvent(filter.onBlurEvent || null, validateFilterForm.get(filter.name).value)\"/>\n </nz-input-group>\n <ng-template #inputCleanTemplate><i nz-icon nz-tooltip class=\"ant-input-clear-icon\" nzTheme=\"fill\"\n nzType=\"close-circle\" *ngIf=\"isAllowClear(filter) && validateFilterForm.get(filter.name).value\"\n (click)=\"inputClean(filter)\"></i></ng-template>\n </ng-container>\n <ng-container *ngSwitchCase=\"1\">\n <nz-select\n [nzShowSearch]=\"filter.selectOption.hdShowSearch != null ? filter.selectOption.hdShowSearch : true\"\n [nzAllowClear]=\"isAllowClear(filter)\"\n [nzServerSearch]=\"filter.selectOption.hdServerSearch || false\"\n [nzDropdownMatchSelectWidth]=\"filter.selectOption.hdDropdownMatchSelectWidth ? filter.selectOption.hdDropdownMatchSelectWidth : false\"\n (nzOnSearch)=\"onSearchEvent(filter.onSearchEvent || null, $event, filter.onSearchEventEventDebounceTime, filter.selectOption)\"\n [nzPlaceHolder]=\"filter.placeholder ? filter.placeholder : '\u8BF7\u9009\u62E9' + filter.label\"\n [formControlName]=\"filter.name\">\n <nz-option *ngFor=\"let selectItem of filter.selectOption.selectList\"\n [nzValue]=\"selectItem[filter.selectOption.value]\" [nzLabel]=\"filter.selectOption.showLabelAndValue ? '['+ selectItem[filter.selectOption.value] +']' +\n selectItem[filter.selectOption.label] : selectItem[filter.selectOption.label]\"></nz-option>\n </nz-select>\n </ng-container>\n <ng-container *ngSwitchCase=\"2\">\n <nz-date-picker *ngIf=\"filter.showTime\"\n [nzPlaceHolder]=\"filter.placeholder ? filter.placeholder : '\u8BF7\u9009\u62E9' + filter.label\"\n [formControlName]=\"filter.name\" [nzDisabledDate]=\"filter.hdDisabledDate\"\n [nzAllowClear]=\"isAllowClear(filter)\"\n nzShowTime nzFormat=\"yyyy-MM-dd HH:mm:ss\">\n </nz-date-picker>\n <nz-date-picker *ngIf=\"!filter.showTime\"\n [nzPlaceHolder]=\"filter.placeholder ? filter.placeholder : '\u8BF7\u9009\u62E9' + filter.label\"\n [formControlName]=\"filter.name\" [nzDisabledDate]=\"filter.hdDisabledDate\"\n [nzAllowClear]=\"isAllowClear(filter)\">\n </nz-date-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"3\">\n <nz-range-picker [nzPlaceHolder]=\"['\u5F00\u59CB\u65E5\u671F','\u7ED3\u675F\u65E5\u671F']\" [nzDisabledDate]=\"filter.hdDisabledDate\"\n [nzAllowClear]=\"isAllowClear(filter)\" [formControlName]=\"filter.name\">\n </nz-range-picker>\n </ng-container>\n <!-- \u591A\u9879\u9009\u62E9\u5668 -->\n <ng-container *ngSwitchCase=\"4\">\n <nz-select\n [nzDropdownMatchSelectWidth]=\"filter.selectOption.hdDropdownMatchSelectWidth ? filter.selectOption.hdDropdownMatchSelectWidth : false\"\n nzMode=\"multiple\"\n [nzShowSearch]=\"filter.selectOption.hdShowSearch != null ? filter.selectOption.hdShowSearch : true\"\n [nzAllowClear]=\"isAllowClear(filter)\"\n [nzPlaceHolder]=\"filter.placeholder ? filter.placeholder : '\u8BF7\u9009\u62E9' + filter.label\"\n [formControlName]=\"filter.name\" [nzServerSearch]=\"filter.selectOption.hdServerSearch || false\"\n (nzOnSearch)=\"onSearchEvent(filter.onSearchEvent || null, $event, filter.onSearchEventEventDebounceTime, filter.selectOption)\">\n <nz-option *ngFor=\"let selectItem of filter.selectOption.selectList\"\n [nzValue]=\"selectItem[filter.selectOption.value]\" [nzLabel]=\"filter.selectOption.showLabelAndValue ? '['+ selectItem[filter.selectOption.value] +']' +\n selectItem[filter.selectOption.label] : selectItem[filter.selectOption.label]\"></nz-option>\n </nz-select>\n </ng-container>\n <ng-container *ngSwitchCase=\"5\">\n <nz-cascader [nzOptions]=\"filter.cascaderOption.options\" [formControlName]=\"filter.name\"\n [nzAllowClear]=\"isAllowClear(filter)\"\n [nzShowSearch]=\"getCascaderShowSearch(filter.cascaderOption)\"\n [nzMenuClassName]=\"getCascaderMenuClassName(filter.cascaderOption)\"\n [nzMenuStyle]=\"getCascaderMenuStyle(filter.cascaderOption)\"\n [nzPlaceHolder]=\"filter.placeholder ? filter.placeholder : '\u8BF7\u9009\u62E9' + filter.label\">\n </nz-cascader>\n </ng-container>\n <ng-container *ngSwitchCase=\"6\">\n <nz-month-picker [formControlName]=\"filter.name\"\n [nzAllowClear]=\"isAllowClear(filter)\"\n [nzPlaceHolder]=\"filter.placeholder ? filter.placeholder : '\u8BF7\u9009\u62E9' + filter.label\"></nz-month-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"7\">\n <nz-input-number [formControlName]=\"filter.name\" [nzMin]=\"filter?.inputNumber?.min || 0\"\n [nzMax]=\"filter?.inputNumber?.max || 99999999\" [nzStep]=\"filter?.inputNumber?.step || 1\"\n [nzPlaceHolder]=\"'\u8BF7\u8F93\u5165' + filter.label\"\n [nzPrecision]=\"filter?.inputNumber?.precision != null ? filter.inputNumber.precision : 4\"\n (nzBlur)=\"triggerEvent(filter.onBlurEvent || null, validateFilterForm.get(filter.name).value)\">\n </nz-input-number>\n </ng-container>\n </ng-container>\n </nz-form-control>\n </nz-form-item>\n </div>\n </ng-container>\n\n <div class=\"hd-filter-btn\" nz-col [nzSpan]=\"6\" [nzOffset]=\"computeOffset()\">\n <a *ngIf=\"filterList.length > 7\" class=\"hd-filter-more\" (click)=\"showMore()\">\n {{ isShowMore ? '\u5C55\u5F00' : '\u6536\u8D77' }}\n <i nz-icon [nzType]=\"isShowMore ? 'down' : 'up'\"></i>\n </a>\n <hd-button type=\"primary\" (click)=\"submitForm()\">\u67E5\u8BE2</hd-button>\n <hd-button type=\"reset\" (click)=\"resetForm()\">\u91CD\u7F6E</hd-button>\n </div>\n </div>\n</form>\n",
3220
- 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}::ng-deep .hd-table-container .ant-table-td-left-sticky,::ng-deep .hd-table-container .ant-table-td-right-sticky,::ng-deep .hd-table-container .ant-table-th-left-sticky,::ng-deep .hd-table-container .ant-table-th-right-sticky{z-index:2;transform:translateZ(0)}::ng-deep .hd-table-container .ant-table-thead>tr>th.ant-table-th-left-sticky,::ng-deep .hd-table-container .ant-table-thead>tr>th.ant-table-th-right-sticky{background:#f5f8f6!important}::ng-deep .hd-table-container .ant-table-tbody>tr>td.ant-table-td-left-sticky,::ng-deep .hd-table-container .ant-table-tbody>tr>td.ant-table-td-right-sticky{background:#fff}::ng-deep .hd-table-container .ant-table-tbody>tr.ant-table-row-hover>td.ant-table-td-left-sticky,::ng-deep .hd-table-container .ant-table-tbody>tr.ant-table-row-hover>td.ant-table-td-right-sticky,::ng-deep .hd-table-container .ant-table-tbody>tr:hover>td.ant-table-td-left-sticky,::ng-deep .hd-table-container .ant-table-tbody>tr:hover>td.ant-table-td-right-sticky{background:#ecf8f1!important}::ng-deep .hd-table-container .ant-table-scroll-position-left .ant-table-td-right-sticky,::ng-deep .hd-table-container .ant-table-scroll-position-left .ant-table-th-right-sticky,::ng-deep .hd-table-container .ant-table-scroll-position-middle .ant-table-td-right-sticky,::ng-deep .hd-table-container .ant-table-scroll-position-middle .ant-table-th-right-sticky,::ng-deep .hd-table-container .ant-table-scroll-position-right .ant-table-td-right-sticky,::ng-deep .hd-table-container .ant-table-scroll-position-right .ant-table-th-right-sticky{box-shadow:none!important}::ng-deep .hd-table-container .ant-table-fixed-right{right:0!important}: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-pagination-options .ant-select,::ng-deep .ant-pagination-options .ant-select-selection--single{min-width:100px}::ng-deep .ant-pagination-options-size-changer.ant-select{min-width:100px}::ng-deep .ant-time-picker{width:100%}::ng-deep .cdk-overlay-pane .hd-cascader-menus.ant-cascader-menus>.ant-cascader-menu:only-child{width:-webkit-max-content!important;width:-moz-max-content!important;width:max-content!important;min-width:var(--hd-cascader-menu-min-width,auto);max-width:560px}::ng-deep .cdk-overlay-pane .hd-cascader-menus.ant-cascader-menus>.ant-cascader-menu:only-child .ant-cascader-menu-item{white-space:nowrap}.ant-input-number-disabled,.ant-input[disabled],.ant-select-disabled{color:#4b504e}.hd-filter-container{padding:20px 23px;background:#fff;border-radius:4px;margin-bottom:8px!important;font-size:14px}.hd-filter-container .ant-row{display:flex;flex-wrap:wrap;align-items:flex-start;row-gap:4px;margin-right:0!important;margin-left:0!important}.hd-filter-container .ant-row::after,.hd-filter-container .ant-row::before{display:none}.hd-filter-container .ant-col-6{float:none;padding-left:0!important;padding-right:0!important}.hd-filter-container .hd-filter-label{width:124px;word-break:break-all;font-size:14px}.hd-filter-container .hd-filter-label ::ng-deep label{font-size:14px}.hd-filter-container .hd-filter-control{width:calc(100% - 124px)}.hd-filter-container ::ng-deep .ant-calendar-picker{width:100%}.hd-filter-container .hd-filter-more{color:#20b95d}.hd-filter-container .hd-filter-btn{height:40px;display:inline-flex;align-items:center;justify-content:flex-end}.hd-filter-container hd-button{margin-left:12px}.hd-filter-container ::ng-deep .ant-advanced-search-form .ant-form-item{margin-bottom:0!important}.hd-filter-container ::ng-deep .ant-select-selection--single{height:32px!important}.hd-filter-container ::ng-deep .ant-input{height:32px!important}.hd-filter-container ::ng-deep .ant-calendar-range-picker-input{text-align:left!important}.hd-filter-container .ant-input-number{width:100%}.hd-filter-container .hd-red{color:#f5222d}"]
3919
+ template: "<form nz-form [formGroup]=\"validateFilterForm\" class=\"ant-advanced-search-form hd-filter-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 filter of filterList\">\n <div nz-col [nzSpan]=\"6\" [hidden]=\"!filter.show\">\n <nz-form-item nzFlex>\n <nz-form-label class=\"hd-filter-label\" [nzNoColon]=\"true\"><span class=\"hd-red\" *ngIf=\"filter.require\">*</span>{{ filter.label }}\n </nz-form-label>\n <nz-form-control class=\"hd-filter-control\">\n <ng-container [ngSwitch]=\"filter.type\">\n <!-- \u8FD9\u91CC\u6570\u5B57\u5BF9\u5E94\u679A\u4E3E\u7C7B\u578B\uFF0C\u53EF\u5728hd-filter.service.ts\u6587\u4EF6\u4E2D\u67E5\u770B\u5BF9\u5E94\u5173\u7CFB -->\n <ng-container *ngSwitchCase=\"0\">\n <nz-input-group [nzSuffix]=\"inputCleanTemplate\">\n <input nz-input [placeholder]=\"filter.placeholder ? filter.placeholder : '\u8BF7\u8F93\u5165' + filter.label\"\n [formControlName]=\"filter.name\"\n (blur)=\"triggerEvent(filter.onBlurEvent || null, validateFilterForm.get(filter.name).value)\"/>\n </nz-input-group>\n <ng-template #inputCleanTemplate><i nz-icon nz-tooltip class=\"ant-input-clear-icon\" nzTheme=\"fill\"\n nzType=\"close-circle\" *ngIf=\"isAllowClear(filter) && validateFilterForm.get(filter.name).value\"\n (click)=\"inputClean(filter)\"></i></ng-template>\n </ng-container>\n <ng-container *ngSwitchCase=\"1\">\n <nz-select\n [nzShowSearch]=\"filter.selectOption.hdShowSearch != null ? filter.selectOption.hdShowSearch : true\"\n [nzAllowClear]=\"isAllowClear(filter)\"\n [nzServerSearch]=\"filter.selectOption.hdServerSearch || false\"\n [nzDropdownMatchSelectWidth]=\"filter.selectOption.hdDropdownMatchSelectWidth ? filter.selectOption.hdDropdownMatchSelectWidth : false\"\n (nzOnSearch)=\"onSearchEvent(filter.onSearchEvent || null, $event, filter.onSearchEventEventDebounceTime, filter.selectOption)\"\n [nzPlaceHolder]=\"filter.placeholder ? filter.placeholder : '\u8BF7\u9009\u62E9' + filter.label\"\n [formControlName]=\"filter.name\">\n <nz-option *ngFor=\"let selectItem of filter.selectOption.selectList\"\n [nzValue]=\"selectItem[filter.selectOption.value]\" [nzLabel]=\"filter.selectOption.showLabelAndValue ? '['+ selectItem[filter.selectOption.value] +']' +\n selectItem[filter.selectOption.label] : selectItem[filter.selectOption.label]\"></nz-option>\n </nz-select>\n </ng-container>\n <ng-container *ngSwitchCase=\"2\">\n <nz-date-picker *ngIf=\"filter.showTime\"\n [nzPlaceHolder]=\"filter.placeholder ? filter.placeholder : '\u8BF7\u9009\u62E9' + filter.label\"\n [formControlName]=\"filter.name\" [nzDisabledDate]=\"filter.hdDisabledDate\"\n [nzAllowClear]=\"isAllowClear(filter)\"\n nzShowTime nzFormat=\"yyyy-MM-dd HH:mm:ss\">\n </nz-date-picker>\n <nz-date-picker *ngIf=\"!filter.showTime\"\n [nzPlaceHolder]=\"filter.placeholder ? filter.placeholder : '\u8BF7\u9009\u62E9' + filter.label\"\n [formControlName]=\"filter.name\" [nzDisabledDate]=\"filter.hdDisabledDate\"\n [nzAllowClear]=\"isAllowClear(filter)\">\n </nz-date-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"3\">\n <nz-range-picker [nzPlaceHolder]=\"['\u5F00\u59CB\u65E5\u671F','\u7ED3\u675F\u65E5\u671F']\" [nzDisabledDate]=\"filter.hdDisabledDate\"\n [nzAllowClear]=\"isAllowClear(filter)\" [formControlName]=\"filter.name\">\n </nz-range-picker>\n </ng-container>\n <!-- \u591A\u9879\u9009\u62E9\u5668 -->\n <ng-container *ngSwitchCase=\"4\">\n <nz-select\n [nzDropdownMatchSelectWidth]=\"filter.selectOption.hdDropdownMatchSelectWidth ? filter.selectOption.hdDropdownMatchSelectWidth : false\"\n nzMode=\"multiple\"\n [nzShowSearch]=\"filter.selectOption.hdShowSearch != null ? filter.selectOption.hdShowSearch : true\"\n [nzAllowClear]=\"isAllowClear(filter)\"\n [nzPlaceHolder]=\"filter.placeholder ? filter.placeholder : '\u8BF7\u9009\u62E9' + filter.label\"\n [formControlName]=\"filter.name\" [nzServerSearch]=\"filter.selectOption.hdServerSearch || false\"\n (nzOnSearch)=\"onSearchEvent(filter.onSearchEvent || null, $event, filter.onSearchEventEventDebounceTime, filter.selectOption)\">\n <nz-option *ngFor=\"let selectItem of filter.selectOption.selectList\"\n [nzValue]=\"selectItem[filter.selectOption.value]\" [nzLabel]=\"filter.selectOption.showLabelAndValue ? '['+ selectItem[filter.selectOption.value] +']' +\n selectItem[filter.selectOption.label] : selectItem[filter.selectOption.label]\"></nz-option>\n </nz-select>\n </ng-container>\n <ng-container *ngSwitchCase=\"5\">\n <nz-cascader [nzOptions]=\"filter.cascaderOption.options\" [formControlName]=\"filter.name\"\n [nzAllowClear]=\"isAllowClear(filter)\"\n [nzShowSearch]=\"getCascaderShowSearch(filter.cascaderOption)\"\n [nzMenuClassName]=\"getCascaderMenuClassName(filter.cascaderOption)\"\n [nzMenuStyle]=\"getCascaderMenuStyle(filter.cascaderOption)\"\n [nzPlaceHolder]=\"filter.placeholder ? filter.placeholder : '\u8BF7\u9009\u62E9' + filter.label\">\n </nz-cascader>\n </ng-container>\n <ng-container *ngSwitchCase=\"6\">\n <nz-month-picker [formControlName]=\"filter.name\"\n [nzAllowClear]=\"isAllowClear(filter)\"\n [nzPlaceHolder]=\"filter.placeholder ? filter.placeholder : '\u8BF7\u9009\u62E9' + filter.label\"></nz-month-picker>\n </ng-container>\n <ng-container *ngSwitchCase=\"7\">\n <nz-input-number [formControlName]=\"filter.name\" [nzMin]=\"filter?.inputNumber?.min || 0\"\n [nzMax]=\"filter?.inputNumber?.max || 99999999\" [nzStep]=\"filter?.inputNumber?.step || 1\"\n [nzPlaceHolder]=\"'\u8BF7\u8F93\u5165' + filter.label\"\n [nzPrecision]=\"filter?.inputNumber?.precision != null ? filter.inputNumber.precision : 4\"\n (nzBlur)=\"triggerEvent(filter.onBlurEvent || null, validateFilterForm.get(filter.name).value)\">\n </nz-input-number>\n </ng-container>\n </ng-container>\n </nz-form-control>\n </nz-form-item>\n </div>\n </ng-container>\n\n <div class=\"hd-filter-btn\" nz-col [nzSpan]=\"6\" [nzOffset]=\"computeOffset()\">\n <a *ngIf=\"filterList.length > 7\" class=\"hd-filter-more\" (click)=\"showMore()\">\n {{ isShowMore ? '\u5C55\u5F00' : '\u6536\u8D77' }}\n <i nz-icon [nzType]=\"isShowMore ? 'down' : 'up'\"></i>\n </a>\n <ng-container *ngIf=\"canUseScheme\">\n <a class=\"hd-filter-scheme-name\" (click)=\"openSwitchModal()\" nz-tooltip [nzTitle]=\"'\u5207\u6362\u7B5B\u9009\u7EC4'\">\n {{ currentSchemeName }}\n <i nz-icon nzType=\"down\"></i>\n </a>\n <a class=\"hd-filter-scheme-op\" nz-dropdown [nzDropdownMenu]=\"schemeOpMenu\" nzTrigger=\"click\">\n \u64CD\u4F5C\n <i nz-icon nzType=\"down\"></i>\n </a>\n <nz-dropdown-menu #schemeOpMenu=\"nzDropdownMenu\">\n <ul nz-menu>\n <li nz-menu-item (click)=\"saveCurrentScheme()\">\u4FDD\u5B58\u4E3A\u5F53\u524D</li>\n <li nz-menu-item (click)=\"openSaveAsModal()\">\u53E6\u5B58\u4E3A</li>\n <li nz-menu-item *ngIf=\"canDeleteCurrent()\"\n nz-popconfirm\n nzTitle=\"\u786E\u5B9A\u5220\u9664\u5F53\u524D\u7B5B\u9009\u7EC4\u5417\uFF1F\"\n nzPopconfirmPlacement=\"bottomRight\"\n (nzOnConfirm)=\"deleteCurrentScheme()\">\u5220\u9664</li>\n </ul>\n </nz-dropdown-menu>\n </ng-container>\n <hd-button type=\"primary\" (click)=\"submitForm()\">\u67E5\u8BE2</hd-button>\n <hd-button type=\"reset\" (click)=\"resetForm()\">\u91CD\u7F6E</hd-button>\n </div>\n </div>\n</form>\n\n<!-- \u5207\u6362\u7B5B\u9009\u7EC4 -->\n<nz-modal\n [(nzVisible)]=\"switchModalVisible\"\n nzTitle=\"\u5207\u6362\u7B5B\u9009\u7EC4\"\n nzWidth=\"480px\"\n [nzOkLoading]=\"schemeLoading\"\n (nzOnCancel)=\"closeSwitchModal()\"\n (nzOnOk)=\"confirmSwitch()\">\n <div class=\"hd-filter-scheme-switch\">\n <input nz-input placeholder=\"\u641C\u7D22\u6A21\u7248\u540D\u79F0\" [(ngModel)]=\"switchKeyword\" />\n <div class=\"hd-filter-scheme-switch-list\">\n <div\n class=\"hd-filter-scheme-switch-item\"\n *ngFor=\"let item of filteredSwitchList\"\n [class.active]=\"(item.uuid && item.uuid === switchSelectedUuid) || (!item.uuid && switchSelectedUuid === '')\"\n (click)=\"selectSwitchItem(item)\">\n <span>{{ item.templateName }}</span>\n <span class=\"hd-filter-scheme-tag\" *ngIf=\"isDefaultScheme(item)\">\u9ED8\u8BA4</span>\n </div>\n <div class=\"hd-filter-scheme-empty\" *ngIf=\"!filteredSwitchList.length\">\u6682\u65E0\u5339\u914D\u6A21\u7248</div>\n </div>\n </div>\n</nz-modal>\n\n<!-- \u53E6\u5B58\u4E3A -->\n<nz-modal\n [(nzVisible)]=\"saveAsModalVisible\"\n nzTitle=\"\u53E6\u5B58\u4E3A\u7B5B\u9009\u7EC4\"\n nzWidth=\"420px\"\n [nzOkLoading]=\"schemeSaving\"\n (nzOnCancel)=\"closeSaveAsModal()\"\n (nzOnOk)=\"confirmSaveAs()\">\n <div class=\"hd-filter-scheme-save-as\">\n <nz-form-item nzFlex>\n <nz-form-label [nzNoColon]=\"true\" [nzRequired]=\"true\">\u6A21\u7248\u540D\u79F0</nz-form-label>\n <nz-form-control>\n <input nz-input maxlength=\"100\" placeholder=\"\u8BF7\u8F93\u5165\u6A21\u7248\u540D\u79F0\" [(ngModel)]=\"saveAsName\" />\n </nz-form-control>\n </nz-form-item>\n </div>\n</nz-modal>\n",
3920
+ 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}::ng-deep .hd-table-container .ant-table-td-left-sticky,::ng-deep .hd-table-container .ant-table-td-right-sticky,::ng-deep .hd-table-container .ant-table-th-left-sticky,::ng-deep .hd-table-container .ant-table-th-right-sticky{z-index:2;transform:translateZ(0)}::ng-deep .hd-table-container .ant-table-thead>tr>th.ant-table-th-left-sticky,::ng-deep .hd-table-container .ant-table-thead>tr>th.ant-table-th-right-sticky{background:#f5f8f6!important}::ng-deep .hd-table-container .ant-table-tbody>tr>td.ant-table-td-left-sticky,::ng-deep .hd-table-container .ant-table-tbody>tr>td.ant-table-td-right-sticky{background:#fff}::ng-deep .hd-table-container .ant-table-tbody>tr.ant-table-row-hover>td.ant-table-td-left-sticky,::ng-deep .hd-table-container .ant-table-tbody>tr.ant-table-row-hover>td.ant-table-td-right-sticky,::ng-deep .hd-table-container .ant-table-tbody>tr:hover>td.ant-table-td-left-sticky,::ng-deep .hd-table-container .ant-table-tbody>tr:hover>td.ant-table-td-right-sticky{background:#ecf8f1!important}::ng-deep .hd-table-container .ant-table-scroll-position-left .ant-table-td-right-sticky,::ng-deep .hd-table-container .ant-table-scroll-position-left .ant-table-th-right-sticky,::ng-deep .hd-table-container .ant-table-scroll-position-middle .ant-table-td-right-sticky,::ng-deep .hd-table-container .ant-table-scroll-position-middle .ant-table-th-right-sticky,::ng-deep .hd-table-container .ant-table-scroll-position-right .ant-table-td-right-sticky,::ng-deep .hd-table-container .ant-table-scroll-position-right .ant-table-th-right-sticky{box-shadow:none!important}::ng-deep .hd-table-container .ant-table-fixed-right{right:0!important}: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-pagination-options .ant-select,::ng-deep .ant-pagination-options .ant-select-selection--single{min-width:100px}::ng-deep .ant-pagination-options-size-changer.ant-select{min-width:100px}::ng-deep .ant-time-picker{width:100%}::ng-deep .cdk-overlay-pane .hd-cascader-menus.ant-cascader-menus>.ant-cascader-menu:only-child{width:-webkit-max-content!important;width:-moz-max-content!important;width:max-content!important;min-width:var(--hd-cascader-menu-min-width,auto);max-width:560px}::ng-deep .cdk-overlay-pane .hd-cascader-menus.ant-cascader-menus>.ant-cascader-menu:only-child .ant-cascader-menu-item{white-space:nowrap}.ant-input-number-disabled,.ant-input[disabled],.ant-select-disabled{color:#4b504e}.hd-filter-container{padding:20px 23px;background:#fff;border-radius:4px;margin-bottom:8px!important;font-size:14px}.hd-filter-container .ant-row{display:flex;flex-wrap:wrap;align-items:flex-start;row-gap:4px;margin-right:0!important;margin-left:0!important}.hd-filter-container .ant-row::after,.hd-filter-container .ant-row::before{display:none}.hd-filter-container .ant-col-6{float:none;padding-left:0!important;padding-right:0!important}.hd-filter-container .hd-filter-label{width:124px;word-break:break-all;font-size:14px}.hd-filter-container .hd-filter-label ::ng-deep label{font-size:14px}.hd-filter-container .hd-filter-control{width:calc(100% - 124px)}.hd-filter-container ::ng-deep .ant-calendar-picker{width:100%}.hd-filter-container .hd-filter-more{color:#20b95d}.hd-filter-container .hd-filter-btn{height:40px;display:inline-flex;align-items:center;justify-content:flex-end}.hd-filter-container hd-button{margin-left:12px}.hd-filter-container ::ng-deep .ant-advanced-search-form .ant-form-item{margin-bottom:0!important}.hd-filter-container ::ng-deep .ant-select-selection--single{height:32px!important}.hd-filter-container ::ng-deep .ant-input{height:32px!important}.hd-filter-container ::ng-deep .ant-calendar-range-picker-input{text-align:left!important}.hd-filter-container .ant-input-number{width:100%}.hd-filter-container .hd-red{color:#f5222d}.hd-filter-container .hd-filter-scheme-name,.hd-filter-container .hd-filter-scheme-op{color:#20b95d;margin-left:12px;white-space:nowrap}.hd-filter-scheme-switch input{margin-bottom:12px}.hd-filter-scheme-switch .hd-filter-scheme-switch-list{max-height:320px;overflow:auto;border:1px solid #e8e8e8;border-radius:4px}.hd-filter-scheme-switch .hd-filter-scheme-switch-item{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;cursor:pointer;border-bottom:1px solid #f0f0f0}.hd-filter-scheme-switch .hd-filter-scheme-switch-item:last-child{border-bottom:none}.hd-filter-scheme-switch .hd-filter-scheme-switch-item.active,.hd-filter-scheme-switch .hd-filter-scheme-switch-item:hover{background:#e6f7ff}.hd-filter-scheme-switch .hd-filter-scheme-tag{color:#20b95d;font-size:12px}.hd-filter-scheme-switch .hd-filter-scheme-empty{padding:24px;text-align:center;color:rgba(0,0,0,.45)}.hd-filter-scheme-save-as .ant-form-item{margin-bottom:0}"]
3221
3921
  }] }
3222
3922
  ];
3223
3923
  /** @nocollapse */
3224
3924
  HdFilterComponent.ctorParameters = () => [
3225
- { type: FormBuilder }
3925
+ { type: FormBuilder },
3926
+ { type: HdFilterSchemeStore, decorators: [{ type: Optional }, { type: Inject, args: [HD_FILTER_SCHEME_STORE,] }] }
3226
3927
  ];
3227
3928
  HdFilterComponent.propDecorators = {
3228
3929
  filterList: [{ type: Input }],
3930
+ enableFilterScheme: [{ type: Input }],
3931
+ filterSchemeKey: [{ type: Input }],
3229
3932
  searchEvent: [{ type: Output }],
3230
3933
  resetEvent: [{ type: Output }]
3231
3934
  };
3935
+ __decorate([
3936
+ InputBoolean(),
3937
+ __metadata("design:type", Object)
3938
+ ], HdFilterComponent.prototype, "enableFilterScheme", void 0);
3232
3939
  if (false) {
3233
3940
  /** @type {?} */
3234
3941
  HdFilterComponent.prototype.filterList;
3942
+ /**
3943
+ * 是否启用筛选组(默认关闭)
3944
+ * @type {?}
3945
+ */
3946
+ HdFilterComponent.prototype.enableFilterScheme;
3947
+ /**
3948
+ * 筛选器标识,开启筛选组时必传
3949
+ * @type {?}
3950
+ */
3951
+ HdFilterComponent.prototype.filterSchemeKey;
3235
3952
  /** @type {?} */
3236
3953
  HdFilterComponent.prototype.searchEvent;
3237
3954
  /** @type {?} */
@@ -3257,6 +3974,49 @@ if (false) {
3257
3974
  * @private
3258
3975
  */
3259
3976
  HdFilterComponent.prototype.searchSubscription;
3977
+ /**
3978
+ * @type {?}
3979
+ * @private
3980
+ */
3981
+ HdFilterComponent.prototype.schemeLoadSub;
3982
+ /**
3983
+ * @type {?}
3984
+ * @private
3985
+ */
3986
+ HdFilterComponent.prototype.schemeActionSub;
3987
+ /**
3988
+ * 页面配置的初始值(虚拟「默认条件」)
3989
+ * @type {?}
3990
+ * @private
3991
+ */
3992
+ HdFilterComponent.prototype.defaultFilterValues;
3993
+ /**
3994
+ * @type {?}
3995
+ * @private
3996
+ */
3997
+ HdFilterComponent.prototype.defaultValuesCaptured;
3998
+ /** @type {?} */
3999
+ HdFilterComponent.prototype.schemeList;
4000
+ /** @type {?} */
4001
+ HdFilterComponent.prototype.currentScheme;
4002
+ /** @type {?} */
4003
+ HdFilterComponent.prototype.currentSchemeName;
4004
+ /** @type {?} */
4005
+ HdFilterComponent.prototype.schemeLoading;
4006
+ /** @type {?} */
4007
+ HdFilterComponent.prototype.schemeSaving;
4008
+ /** @type {?} */
4009
+ HdFilterComponent.prototype.switchModalVisible;
4010
+ /** @type {?} */
4011
+ HdFilterComponent.prototype.switchKeyword;
4012
+ /** @type {?} */
4013
+ HdFilterComponent.prototype.switchSelectedUuid;
4014
+ /** @type {?} */
4015
+ HdFilterComponent.prototype.saveAsModalVisible;
4016
+ /** @type {?} */
4017
+ HdFilterComponent.prototype.saveAsName;
4018
+ /** @type {?} */
4019
+ HdFilterComponent.prototype.defaultSchemeName;
3260
4020
  /** @type {?} */
3261
4021
  HdFilterComponent.prototype.getCascaderShowSearch;
3262
4022
  /** @type {?} */
@@ -3268,6 +4028,11 @@ if (false) {
3268
4028
  * @private
3269
4029
  */
3270
4030
  HdFilterComponent.prototype.fb;
4031
+ /**
4032
+ * @type {?}
4033
+ * @private
4034
+ */
4035
+ HdFilterComponent.prototype.schemeStore;
3271
4036
  }
3272
4037
 
3273
4038
  /**
@@ -10499,98 +11264,6 @@ if (false) {
10499
11264
  TotalOption.prototype.isHide;
10500
11265
  }
10501
11266
 
10502
- /**
10503
- * @fileoverview added by tsickle
10504
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
10505
- */
10506
- // 控件列表
10507
- class Filter {
10508
- constructor() {
10509
- // 输入框提示文案
10510
- this.value = null; // 值 不传默认为null
10511
- // 控件为Select时,选项列表
10512
- this.inputNumber = new InputNumber(); // number组件的min、max、step
10513
- // date-picker组件不可选择的日期
10514
- this.showTime = false; // 日期选择器是否包含时间
10515
- // 日期选择器是否包含时间
10516
- this.require = false; // 是否必填
10517
- }
10518
- }
10519
- if (false) {
10520
- /** @type {?} */
10521
- Filter.prototype.type;
10522
- /** @type {?} */
10523
- Filter.prototype.label;
10524
- /** @type {?} */
10525
- Filter.prototype.name;
10526
- /** @type {?} */
10527
- Filter.prototype.placeholder;
10528
- /** @type {?} */
10529
- Filter.prototype.value;
10530
- /** @type {?} */
10531
- Filter.prototype.show;
10532
- /** @type {?} */
10533
- Filter.prototype.selectOption;
10534
- /** @type {?} */
10535
- Filter.prototype.inputNumber;
10536
- /** @type {?} */
10537
- Filter.prototype.onSearchEvent;
10538
- /** @type {?} */
10539
- Filter.prototype.onChangeEvent;
10540
- /** @type {?} */
10541
- Filter.prototype.onBlurEvent;
10542
- /** @type {?} */
10543
- Filter.prototype.hdDisabledDate;
10544
- /** @type {?} */
10545
- Filter.prototype.showTime;
10546
- /** @type {?} */
10547
- Filter.prototype.require;
10548
- /**
10549
- * 是否允许清空当前筛选项(Input 清空按钮、Select/Date/Cascader 等清空图标)。
10550
- * 不传默认 true;Select 未配此项时仍可回退到 selectOption.hdAllowClear
10551
- * @type {?}
10552
- */
10553
- Filter.prototype.hdAllowClear;
10554
- /** @type {?} */
10555
- Filter.prototype.cascaderOption;
10556
- /** @type {?} */
10557
- Filter.prototype.onChangeEventDebounceTime;
10558
- /** @type {?} */
10559
- Filter.prototype.onSearchEventEventDebounceTime;
10560
- }
10561
- /** @enum {number} */
10562
- const FilterListType = {
10563
- Input: 0,
10564
- Select: 1,
10565
- Date: 2,
10566
- DateRange: 3,
10567
- MultipleSelect: 4,
10568
- Cascader: 5,
10569
- Month: 6,
10570
- InputNumber: 7 // 数字输入
10571
- ,
10572
- };
10573
- FilterListType[FilterListType.Input] = 'Input';
10574
- FilterListType[FilterListType.Select] = 'Select';
10575
- FilterListType[FilterListType.Date] = 'Date';
10576
- FilterListType[FilterListType.DateRange] = 'DateRange';
10577
- FilterListType[FilterListType.MultipleSelect] = 'MultipleSelect';
10578
- FilterListType[FilterListType.Cascader] = 'Cascader';
10579
- FilterListType[FilterListType.Month] = 'Month';
10580
- FilterListType[FilterListType.InputNumber] = 'InputNumber';
10581
- class HdFilterService {
10582
- constructor() {
10583
- }
10584
- }
10585
- HdFilterService.decorators = [
10586
- { type: Injectable, args: [{
10587
- providedIn: 'root'
10588
- },] }
10589
- ];
10590
- /** @nocollapse */
10591
- HdFilterService.ctorParameters = () => [];
10592
- /** @nocollapse */ HdFilterService.ngInjectableDef = ɵɵdefineInjectable({ factory: function HdFilterService_Factory() { return new HdFilterService(); }, token: HdFilterService, providedIn: "root" });
10593
-
10594
11267
  /**
10595
11268
  * @fileoverview added by tsickle
10596
11269
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -10834,5 +11507,5 @@ const Utils = {
10834
11507
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
10835
11508
  */
10836
11509
 
10837
- export { ButtonSize, ButtonType, CascaderOption, CheckboxOption, ColWidth, ColorOption, ExplainOption, FantasyNgzorroModule, Filter, FilterListType, FormItem, FormLine, FormLineType, FormLinesCacheOption, FormListType, HD_CASCADER_MENU_CLASS, HdAccessoryFile, HdAccessoryGroup, HdAccessoryListComponent, HdButtonService, HdCurrentTableComponent, HdDetailFormFieldType, HdDetailFormService, HdFilterService, HdFormLinesService, HdFormService, HdLogComponent, HdLogService, HdOption, HdOverlayCleanupService, HdTableColumn, HdTableTotalOption, InputNumber, OperateBtn, Page, RadioOption, SelectOption, SelectOptionTableColumn, SelectOptionTableColumnIcon, StaticConst, TableCacheOption, TableColumn, TableTotalOption, TotalOption, TreeGrid, Utils, ValidatorKey, cascaderPinyinFilter, getCascaderMenuClassName, getCascaderMenuStyle, getCascaderShowSearch, HdComponentModule as ɵa, HdButtonModule as ɵb, HdTableComponent as ɵba, HdTableCellPipe as ɵbb, HdTipModule as ɵbc, HdTipComponent as ɵbd, HdAccessoryListModule as ɵbe, HdPopconfirmModule as ɵbf, HdPopconfirmComponent as ɵbg, HdLogModule as ɵbh, HdButtonComponent as ɵc, HdButtonGroupModule as ɵd, HdButtonGroupComponent as ɵe, HdDetailFormModule as ɵf, HdDetailFormComponent as ɵg, HdDetailLinesModule as ɵh, HdSpaceModule as ɵi, HdSpaceComponent as ɵj, HdDetailLinesComponent as ɵk, HdDetailLinesPageModule as ɵl, HdDetailLinesPageComponent as ɵm, HdDetailTipModule as ɵn, HdDetailTipComponent as ɵo, HdFilterModule as ɵp, HdFilterComponent as ɵq, HdFormModule as ɵr, HdFormComponent as ɵs, HdFormLinesModule as ɵt, HdFormLinesComponent as ɵu, CommonSessionService as ɵv, HdStatusModule as ɵw, HdStatusComponent as ɵx, HdCurrentTableModule as ɵy, HdTableModule as ɵz };
11510
+ export { ButtonSize, ButtonType, CascaderOption, CheckboxOption, ColWidth, ColorOption, ExplainOption, FantasyNgzorroModule, Filter, FilterListType, FormItem, FormLine, FormLineType, FormLinesCacheOption, FormListType, HD_CASCADER_MENU_CLASS, HD_FILTER_DEFAULT_SCHEME_NAME, HD_FILTER_SCHEME_STORE, HdAccessoryFile, HdAccessoryGroup, HdAccessoryListComponent, HdButtonService, HdCurrentTableComponent, HdDetailFormFieldType, HdDetailFormService, HdFilterScheme, HdFilterSchemeStore, HdFilterService, HdFormLinesService, HdFormService, HdLogComponent, HdLogService, HdOption, HdOverlayCleanupService, HdTableColumn, HdTableTotalOption, InputNumber, OperateBtn, Page, RadioOption, SelectOption, SelectOptionTableColumn, SelectOptionTableColumnIcon, StaticConst, TableCacheOption, TableColumn, TableTotalOption, TotalOption, TreeGrid, Utils, ValidatorKey, cascaderPinyinFilter, getCascaderMenuClassName, getCascaderMenuStyle, getCascaderShowSearch, HdComponentModule as ɵa, HdButtonModule as ɵb, HdTableComponent as ɵba, HdTableCellPipe as ɵbb, HdTipModule as ɵbc, HdTipComponent as ɵbd, HdAccessoryListModule as ɵbe, HdPopconfirmModule as ɵbf, HdPopconfirmComponent as ɵbg, HdLogModule as ɵbh, HdButtonComponent as ɵc, HdButtonGroupModule as ɵd, HdButtonGroupComponent as ɵe, HdDetailFormModule as ɵf, HdDetailFormComponent as ɵg, HdDetailLinesModule as ɵh, HdSpaceModule as ɵi, HdSpaceComponent as ɵj, HdDetailLinesComponent as ɵk, HdDetailLinesPageModule as ɵl, HdDetailLinesPageComponent as ɵm, HdDetailTipModule as ɵn, HdDetailTipComponent as ɵo, HdFilterModule as ɵp, HdFilterComponent as ɵq, HdFormModule as ɵr, HdFormComponent as ɵs, HdFormLinesModule as ɵt, HdFormLinesComponent as ɵu, CommonSessionService as ɵv, HdStatusModule as ɵw, HdStatusComponent as ɵx, HdCurrentTableModule as ɵy, HdTableModule as ɵz };
10838
11511
  //# sourceMappingURL=fantasy-ngzorro.js.map