@ebuilding/form 2.4.0 → 2.4.2

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.
@@ -64,6 +64,12 @@ import { NzTabsModule } from 'ng-zorro-antd/tabs';
64
64
  import * as i6$1 from 'ngx-quill';
65
65
  import { QuillModule } from 'ngx-quill';
66
66
  import * as i1$7 from '@delon/theme';
67
+ import * as i4$5 from 'ng-zorro-antd/upload';
68
+ import { NzUploadModule } from 'ng-zorro-antd/upload';
69
+ import * as i6$2 from 'ng-zorro-antd/image';
70
+ import { NzImageModule } from 'ng-zorro-antd/image';
71
+ import * as i6$3 from '@ebuilding/abc/empty';
72
+ import { GramDeonEmptyModule as GramDeonEmptyModule$1 } from '@ebuilding/abc/empty';
67
73
 
68
74
  class DeonNzFieldCheckbox extends FieldType {
69
75
  defaultOptions = {
@@ -3325,9 +3331,795 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
3325
3331
  }]
3326
3332
  }] });
3327
3333
 
3334
+ class DeonNzFieldImg extends FieldType {
3335
+ http;
3336
+ msg;
3337
+ fileList = [];
3338
+ previewImage;
3339
+ previewVisible = false;
3340
+ constructor(http, msg) {
3341
+ super();
3342
+ this.http = http;
3343
+ this.msg = msg;
3344
+ }
3345
+ /** 是否多图 */
3346
+ get isMultiple() {
3347
+ return this.to?.selectType === 'multiple';
3348
+ }
3349
+ /** 最大数量 */
3350
+ get maxCount() {
3351
+ if (!this.isMultiple)
3352
+ return 1;
3353
+ return this.to?.max || 8;
3354
+ }
3355
+ ngOnInit() {
3356
+ this.initValue();
3357
+ /** 解决页面渲染后赋值 */
3358
+ this.formControl.valueChanges.subscribe(() => {
3359
+ if (this.fileList.length === 0) {
3360
+ this.initValue();
3361
+ }
3362
+ });
3363
+ }
3364
+ /**
3365
+ * 初始化回显
3366
+ */
3367
+ initValue() {
3368
+ const value = this.formControl.value;
3369
+ if (!value)
3370
+ return;
3371
+ const arr = Array.isArray(value) ? value : [value];
3372
+ this.fileList = arr.map((item, index) => ({
3373
+ uid: item.id || String(index),
3374
+ name: item.fileName,
3375
+ status: 'done',
3376
+ url: item.fileUrl,
3377
+ thumbUrl: item.fileUrl
3378
+ }));
3379
+ }
3380
+ /**
3381
+ * 上传前
3382
+ */
3383
+ beforeUpload = (file) => {
3384
+ const realFile = file;
3385
+ if (!realFile)
3386
+ return false;
3387
+ /** 限制 5MB */
3388
+ const isLt5M = realFile.size / 1024 / 1024 < 5;
3389
+ if (!isLt5M) {
3390
+ this.msg.warning('图片不能超过5MB');
3391
+ return false;
3392
+ }
3393
+ const reader = new FileReader();
3394
+ reader.onload = () => {
3395
+ const target = this.fileList.find(f => f.uid === file.uid);
3396
+ if (target) {
3397
+ target.thumbUrl = reader.result;
3398
+ this.fileList = [...this.fileList];
3399
+ }
3400
+ };
3401
+ reader.readAsDataURL(realFile);
3402
+ return true;
3403
+ };
3404
+ /**
3405
+ * 上传
3406
+ */
3407
+ uploadRequest = (item) => {
3408
+ const file = item.file;
3409
+ const realFile = file.originFileObj ||
3410
+ item.file;
3411
+ const formData = new FormData();
3412
+ formData.append('type', 'IMG');
3413
+ formData.append('multipartFile', realFile);
3414
+ return this.http
3415
+ .post(`${ModuleAPI.system}/user/comm/uploadFile`, formData)
3416
+ .subscribe({
3417
+ next: (res) => {
3418
+ if (res && res?.result) {
3419
+ const data = res.result;
3420
+ file.status = 'done';
3421
+ file.url = data.fileUrl;
3422
+ file.thumbUrl = data.fileUrl;
3423
+ /** 保存 id */
3424
+ file.id = data.id;
3425
+ if (!this.isMultiple) {
3426
+ this.fileList = [file];
3427
+ }
3428
+ else {
3429
+ this.fileList = [...this.fileList];
3430
+ }
3431
+ this.updateModel();
3432
+ item.onSuccess?.(res, file, null);
3433
+ }
3434
+ else {
3435
+ file.status = 'error';
3436
+ item.onError?.(res, file);
3437
+ }
3438
+ },
3439
+ error: err => {
3440
+ file.status = 'error';
3441
+ item.onError?.(err, file);
3442
+ }
3443
+ });
3444
+ };
3445
+ /**
3446
+ * 删除
3447
+ */
3448
+ remove = (file) => {
3449
+ const index = this.fileList.indexOf(file);
3450
+ if (index > -1) {
3451
+ this.fileList.splice(index, 1);
3452
+ }
3453
+ this.updateModel();
3454
+ return true;
3455
+ };
3456
+ /**
3457
+ * 预览
3458
+ */
3459
+ handlePreview = async (file) => {
3460
+ if (!file.url && !file.preview) {
3461
+ const realFile = file.originFileObj;
3462
+ if (realFile) {
3463
+ file.preview = await this.getBase64(realFile);
3464
+ }
3465
+ }
3466
+ this.previewImage = file.url || file.preview;
3467
+ this.previewVisible = true;
3468
+ };
3469
+ getBase64(file) {
3470
+ return new Promise((resolve, reject) => {
3471
+ const reader = new FileReader();
3472
+ reader.readAsDataURL(file);
3473
+ reader.onload = () => resolve(reader.result);
3474
+ reader.onerror = reject;
3475
+ });
3476
+ }
3477
+ /**
3478
+ * 写回 model
3479
+ */
3480
+ updateModel() {
3481
+ let arr = [];
3482
+ if (this.fileList && this.fileList.length > 0) {
3483
+ this.fileList.forEach((item) => {
3484
+ if (item?.originFileObj && item?.originFileObj["status"] === 'done' && item?.originFileObj["url"]) {
3485
+ let obj = item?.originFileObj;
3486
+ arr.push({
3487
+ id: obj.id,
3488
+ fileName: obj.name,
3489
+ fileUrl: obj.url
3490
+ });
3491
+ }
3492
+ });
3493
+ }
3494
+ if (this.isMultiple) {
3495
+ this.formControl.setValue(arr);
3496
+ }
3497
+ else {
3498
+ this.formControl.setValue(arr[0] || null);
3499
+ }
3500
+ }
3501
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzFieldImg, deps: [{ token: i1$7._HttpClient }, { token: i2$1.NzMessageService }], target: i0.ɵɵFactoryTarget.Component });
3502
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: DeonNzFieldImg, isStandalone: true, selector: "deon-nz-field-img", usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"editor == false; else tmpField\">\r\n <nz-upload nzListType=\"picture-card\" [(nzFileList)]=\"fileList\" [nzShowButton]=\"false\" [nzDisabled]=\"true\"\r\n class=\"upload-view\" *ngIf=\"fileList && fileList.length>0;else tmpEmpty\">\r\n </nz-upload>\r\n\r\n <ng-template #tmpEmpty>\r\n <img nz-image width=\"80px\" height=\"80px\" nzSrc=\"error\"\r\n nzFallback=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBE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021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==\" />\r\n </ng-template>\r\n</ng-container>\r\n<ng-template #tmpField>\r\n <nz-upload nzListType=\"picture-card\" [(nzFileList)]=\"fileList\" [nzShowButton]=\"fileList.length < maxCount\"\r\n [nzPreview]=\"handlePreview\" [nzBeforeUpload]=\"beforeUpload\" [nzCustomRequest]=\"uploadRequest\"\r\n [nzRemove]=\"remove\" nzAccept=\"image/*\" [nzMultiple]=\"isMultiple\">\r\n <div class=\"upload-empty-box\">\r\n <span nz-icon nzType=\"plus\"></span>\r\n <div style=\"margin-top: 8px\">\u70B9\u51FB\u4E0A\u4F20</div>\r\n </div>\r\n </nz-upload>\r\n</ng-template>", styles: [":host ::ng-deep .upload-empty-box{font-size:12px}:host ::ng-deep .ant-upload-list{display:inline-block}:host ::ng-deep .ant-upload-list-picture-card-container{width:80px;height:80px;margin:0 8px 8px 0}:host ::ng-deep .ant-upload.ant-upload-select-picture-card{width:80px;height:80px}:host ::ng-deep .ant-upload-list-picture-card .ant-upload-list-item{width:80px;height:80px;padding:0}:host ::ng-deep .ant-upload-list-picture-card .ant-upload-list-item-thumbnail{width:100%;height:100%}:host ::ng-deep .ant-upload-list-picture-card .ant-upload-list-item-thumbnail img{width:100%;height:100%;object-fit:cover}:host ::ng-deep .ant-upload-list-item-name{font-size:12px}:host ::ng-deep .ant-upload-list-item-uploading{font-size:12px}:host ::ng-deep .ant-upload-list-item-progress{font-size:12px}:host ::ng-deep .upload-view .ant-upload-list-item-actions a{display:none!important}:host ::ng-deep .upload-view .ant-upload-list-item-actions button:nth-last-child(1){display:none!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: FormlyModule }, { kind: "ngmodule", type: NzUploadModule }, { kind: "component", type: i4$5.NzUploadComponent, selector: "nz-upload", inputs: ["nzType", "nzLimit", "nzSize", "nzFileType", "nzAccept", "nzAction", "nzDirectory", "nzOpenFileDialogOnClick", "nzBeforeUpload", "nzCustomRequest", "nzData", "nzFilter", "nzFileList", "nzDisabled", "nzHeaders", "nzListType", "nzMultiple", "nzName", "nzShowUploadList", "nzShowButton", "nzWithCredentials", "nzRemove", "nzPreview", "nzPreviewFile", "nzPreviewIsImage", "nzTransformFile", "nzDownload", "nzIconRender", "nzFileListRender"], outputs: ["nzChange", "nzFileListChange"], exportAs: ["nzUpload"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i5$1.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzModalModule }, { kind: "ngmodule", type: NzImageModule }, { kind: "directive", type: i6$2.NzImageDirective, selector: "img[nz-image]", inputs: ["nzSrc", "nzSrcset", "nzDisablePreview", "nzFallback", "nzPlaceholder", "nzScaleStep"], exportAs: ["nzImage"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3503
+ }
3504
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzFieldImg, decorators: [{
3505
+ type: Component,
3506
+ args: [{ selector: 'deon-nz-field-img', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
3507
+ CommonModule,
3508
+ ReactiveFormsModule,
3509
+ FormlyModule,
3510
+ NzUploadModule,
3511
+ NzIconModule,
3512
+ NzModalModule,
3513
+ NzImageModule
3514
+ ], template: "<ng-container *ngIf=\"editor == false; else tmpField\">\r\n <nz-upload nzListType=\"picture-card\" [(nzFileList)]=\"fileList\" [nzShowButton]=\"false\" [nzDisabled]=\"true\"\r\n class=\"upload-view\" *ngIf=\"fileList && fileList.length>0;else tmpEmpty\">\r\n </nz-upload>\r\n\r\n <ng-template #tmpEmpty>\r\n <img nz-image width=\"80px\" height=\"80px\" nzSrc=\"error\"\r\n nzFallback=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBA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/wGgKKC4YMA4TAAAAABJRU5ErkJggg==\" />\r\n </ng-template>\r\n</ng-container>\r\n<ng-template #tmpField>\r\n <nz-upload nzListType=\"picture-card\" [(nzFileList)]=\"fileList\" [nzShowButton]=\"fileList.length < maxCount\"\r\n [nzPreview]=\"handlePreview\" [nzBeforeUpload]=\"beforeUpload\" [nzCustomRequest]=\"uploadRequest\"\r\n [nzRemove]=\"remove\" nzAccept=\"image/*\" [nzMultiple]=\"isMultiple\">\r\n <div class=\"upload-empty-box\">\r\n <span nz-icon nzType=\"plus\"></span>\r\n <div style=\"margin-top: 8px\">\u70B9\u51FB\u4E0A\u4F20</div>\r\n </div>\r\n </nz-upload>\r\n</ng-template>", styles: [":host ::ng-deep .upload-empty-box{font-size:12px}:host ::ng-deep .ant-upload-list{display:inline-block}:host ::ng-deep .ant-upload-list-picture-card-container{width:80px;height:80px;margin:0 8px 8px 0}:host ::ng-deep .ant-upload.ant-upload-select-picture-card{width:80px;height:80px}:host ::ng-deep .ant-upload-list-picture-card .ant-upload-list-item{width:80px;height:80px;padding:0}:host ::ng-deep .ant-upload-list-picture-card .ant-upload-list-item-thumbnail{width:100%;height:100%}:host ::ng-deep .ant-upload-list-picture-card .ant-upload-list-item-thumbnail img{width:100%;height:100%;object-fit:cover}:host ::ng-deep .ant-upload-list-item-name{font-size:12px}:host ::ng-deep .ant-upload-list-item-uploading{font-size:12px}:host ::ng-deep .ant-upload-list-item-progress{font-size:12px}:host ::ng-deep .upload-view .ant-upload-list-item-actions a{display:none!important}:host ::ng-deep .upload-view .ant-upload-list-item-actions button:nth-last-child(1){display:none!important}\n"] }]
3515
+ }], ctorParameters: () => [{ type: i1$7._HttpClient }, { type: i2$1.NzMessageService }] });
3516
+
3517
+ function withFormlyFieldImg() {
3518
+ return {
3519
+ types: [
3520
+ {
3521
+ name: 'img',
3522
+ component: DeonNzFieldImg,
3523
+ wrappers: ['formly-form-field'],
3524
+ }
3525
+ ],
3526
+ };
3527
+ }
3528
+
3529
+ class DeonNzImgModule {
3530
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzImgModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3531
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: DeonNzImgModule, imports: [CommonModule,
3532
+ DeonNzFormFieldModule, i1$1.FormlyModule] });
3533
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzImgModule, imports: [CommonModule,
3534
+ DeonNzFormFieldModule,
3535
+ FormlyModule.forChild(withFormlyFieldImg())] });
3536
+ }
3537
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzImgModule, decorators: [{
3538
+ type: NgModule,
3539
+ args: [{
3540
+ imports: [
3541
+ CommonModule,
3542
+ DeonNzFormFieldModule,
3543
+ FormlyModule.forChild(withFormlyFieldImg()),
3544
+ ],
3545
+ }]
3546
+ }] });
3547
+
3548
+ class DeonNzFieldAttachment extends FieldType {
3549
+ http;
3550
+ msg;
3551
+ fileList = [];
3552
+ previewImage;
3553
+ previewVisible = false;
3554
+ constructor(http, msg) {
3555
+ super();
3556
+ this.http = http;
3557
+ this.msg = msg;
3558
+ }
3559
+ /** 是否多图 */
3560
+ get isMultiple() {
3561
+ return this.to?.selectType === 'multiple';
3562
+ }
3563
+ /** 最大数量 */
3564
+ get maxCount() {
3565
+ if (!this.isMultiple)
3566
+ return 1;
3567
+ return this.to?.max || 8;
3568
+ }
3569
+ ngOnInit() {
3570
+ this.initValue();
3571
+ /** 解决页面渲染后赋值 */
3572
+ this.formControl.valueChanges.subscribe(() => {
3573
+ if (this.fileList.length === 0) {
3574
+ this.initValue();
3575
+ }
3576
+ });
3577
+ }
3578
+ /**
3579
+ * 初始化回显
3580
+ */
3581
+ initValue() {
3582
+ const value = this.formControl.value;
3583
+ if (!value)
3584
+ return;
3585
+ const arr = Array.isArray(value) ? value : [value];
3586
+ this.fileList = arr.map((item, index) => ({
3587
+ uid: item.id || String(index),
3588
+ name: item.fileName,
3589
+ status: 'done',
3590
+ url: item.fileUrl,
3591
+ thumbUrl: item.fileUrl
3592
+ }));
3593
+ }
3594
+ /**
3595
+ * 上传前
3596
+ */
3597
+ beforeUpload = (file) => {
3598
+ const realFile = file;
3599
+ if (!realFile)
3600
+ return false;
3601
+ /** 限制 50MB */
3602
+ const isLt5M = realFile.size / 1024 / 1024 < 50;
3603
+ if (!isLt5M) {
3604
+ this.msg.warning('附件不能超过50MB');
3605
+ return false;
3606
+ }
3607
+ const reader = new FileReader();
3608
+ reader.onload = () => {
3609
+ const target = this.fileList.find(f => f.uid === file.uid);
3610
+ if (target) {
3611
+ target.thumbUrl = reader.result;
3612
+ this.fileList = [...this.fileList];
3613
+ }
3614
+ };
3615
+ reader.readAsDataURL(realFile);
3616
+ return true;
3617
+ };
3618
+ /**
3619
+ * 上传
3620
+ */
3621
+ uploadRequest = (item) => {
3622
+ const file = item.file;
3623
+ const realFile = file.originFileObj ||
3624
+ item.file;
3625
+ const formData = new FormData();
3626
+ formData.append('type', 'OTHER');
3627
+ formData.append('multipartFile', realFile);
3628
+ return this.http
3629
+ .post(`${ModuleAPI.system}/user/comm/uploadFile`, formData)
3630
+ .subscribe({
3631
+ next: (res) => {
3632
+ if (res && res?.result) {
3633
+ const data = res.result;
3634
+ file.status = 'done';
3635
+ file.url = data.fileUrl;
3636
+ file.thumbUrl = data.fileUrl;
3637
+ /** 保存 id */
3638
+ file.id = data.id;
3639
+ if (!this.isMultiple) {
3640
+ this.fileList = [file];
3641
+ }
3642
+ else {
3643
+ this.fileList = [...this.fileList];
3644
+ }
3645
+ this.updateModel();
3646
+ item.onSuccess?.(res, file, null);
3647
+ }
3648
+ else {
3649
+ file.status = 'error';
3650
+ item.onError?.(res, file);
3651
+ }
3652
+ },
3653
+ error: err => {
3654
+ file.status = 'error';
3655
+ item.onError?.(err, file);
3656
+ }
3657
+ });
3658
+ };
3659
+ /**
3660
+ * 删除
3661
+ */
3662
+ remove = (file) => {
3663
+ const index = this.fileList.indexOf(file);
3664
+ if (index > -1) {
3665
+ this.fileList.splice(index, 1);
3666
+ }
3667
+ this.updateModel();
3668
+ return true;
3669
+ };
3670
+ fileChange(e) { }
3671
+ /**
3672
+ * 写回 model
3673
+ */
3674
+ updateModel() {
3675
+ let arr = [];
3676
+ if (this.fileList && this.fileList.length > 0) {
3677
+ this.fileList.forEach((item) => {
3678
+ if (item && item["status"] === 'done' && item["url"]) {
3679
+ arr.push({
3680
+ id: item.id,
3681
+ fileName: item.name,
3682
+ fileUrl: item.url
3683
+ });
3684
+ }
3685
+ });
3686
+ }
3687
+ if (this.isMultiple) {
3688
+ this.formControl.setValue(arr);
3689
+ }
3690
+ else {
3691
+ this.formControl.setValue(arr[0] || null);
3692
+ }
3693
+ }
3694
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzFieldAttachment, deps: [{ token: i1$7._HttpClient }, { token: i2$1.NzMessageService }], target: i0.ɵɵFactoryTarget.Component });
3695
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: DeonNzFieldAttachment, isStandalone: true, selector: "deon-nz-field-attachment", usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"editor == false; else tmpField\">\r\n <nz-upload [nzShowButton]=\"false\" [nzDisabled]=\"true\" [(nzFileList)]=\"fileList\" [(nzFileList)]=\"fileList\"\r\n class=\"upload-view\" *ngIf=\"fileList && fileList.length>0;else tmpEmpty\">\r\n </nz-upload>\r\n\r\n <ng-template #tmpEmpty>\r\n\r\n <div class=\"upload-empty\">\r\n <gram-empty></gram-empty>\r\n </div>\r\n </ng-template>\r\n\r\n</ng-container>\r\n<ng-template #tmpField>\r\n <nz-upload nzType=\"drag\" [nzLimit]=\"1\" [nzShowButton]=\"fileList.length < maxCount\" [nzMultiple]=\"isMultiple\"\r\n [nzDisabled]=\"fileList && fileList.length>=maxCount\" [(nzFileList)]=\"fileList\" [nzBeforeUpload]=\"beforeUpload\"\r\n [nzRemove]=\"remove\" [nzCustomRequest]=\"uploadRequest\" [(nzFileList)]=\"fileList\">\r\n <p class=\"ant-upload-drag-icon\">\r\n <i nz-icon nzType=\"inbox\"></i>\r\n </p>\r\n <p class=\"ant-upload-text\">\u5355\u51FB\u6216\u62D6\u52A8\u6587\u4EF6\u5230\u6B64\u533A\u57DF\u4EE5\u4E0A\u4F20</p>\r\n <p class=\"ant-upload-hint\">\u5355\u4E2A\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC750MB\uFF08\u6700\u591A\u53EF\u4EE5\u4E0A\u4F20{{maxCount}}\u4E2A\u6587\u4EF6\uFF09</p>\r\n </nz-upload>\r\n</ng-template>", styles: [":host ::ng-deep .upload-empty-box{font-size:12px}:host ::ng-deep .ant-upload-list{display:inline-block}:host ::ng-deep .ant-upload-list-picture-card-container{width:80px;height:80px;margin:0 8px 8px 0}:host ::ng-deep .ant-upload.ant-upload-select-picture-card{width:80px;height:80px}:host ::ng-deep .ant-upload-list-picture-card .ant-upload-list-item{width:80px;height:80px;padding:0}:host ::ng-deep .ant-upload-list-picture-card .ant-upload-list-item-thumbnail{width:100%;height:100%}:host ::ng-deep .ant-upload-list-picture-card .ant-upload-list-item-thumbnail img{width:100%;height:100%;object-fit:cover}:host ::ng-deep .ant-upload-list-item-name{font-size:12px}:host ::ng-deep .ant-upload-list-item-uploading{font-size:12px}:host ::ng-deep .ant-upload-list-item-progress{font-size:12px}:host ::ng-deep .upload-view .ant-upload-list-item-card-actions button:nth-last-child(1){display:none!important}:host ::ng-deep .upload-empty{padding:15px;text-align:center;background:#f5f5f5}:host ::ng-deep .upload-empty .image{width:100px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: FormlyModule }, { kind: "ngmodule", type: NzUploadModule }, { kind: "component", type: i4$5.NzUploadComponent, selector: "nz-upload", inputs: ["nzType", "nzLimit", "nzSize", "nzFileType", "nzAccept", "nzAction", "nzDirectory", "nzOpenFileDialogOnClick", "nzBeforeUpload", "nzCustomRequest", "nzData", "nzFilter", "nzFileList", "nzDisabled", "nzHeaders", "nzListType", "nzMultiple", "nzName", "nzShowUploadList", "nzShowButton", "nzWithCredentials", "nzRemove", "nzPreview", "nzPreviewFile", "nzPreviewIsImage", "nzTransformFile", "nzDownload", "nzIconRender", "nzFileListRender"], outputs: ["nzChange", "nzFileListChange"], exportAs: ["nzUpload"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i5$1.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzModalModule }, { kind: "ngmodule", type: GramDeonEmptyModule$1 }, { kind: "component", type: i6$3.GramDeonEmptyComponent, selector: "gram-empty", inputs: ["desc", "state"], outputs: ["emptyClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3696
+ }
3697
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzFieldAttachment, decorators: [{
3698
+ type: Component,
3699
+ args: [{ selector: 'deon-nz-field-attachment', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
3700
+ CommonModule,
3701
+ ReactiveFormsModule,
3702
+ FormlyModule,
3703
+ NzUploadModule,
3704
+ NzIconModule,
3705
+ NzModalModule, GramDeonEmptyModule$1
3706
+ ], template: "<ng-container *ngIf=\"editor == false; else tmpField\">\r\n <nz-upload [nzShowButton]=\"false\" [nzDisabled]=\"true\" [(nzFileList)]=\"fileList\" [(nzFileList)]=\"fileList\"\r\n class=\"upload-view\" *ngIf=\"fileList && fileList.length>0;else tmpEmpty\">\r\n </nz-upload>\r\n\r\n <ng-template #tmpEmpty>\r\n\r\n <div class=\"upload-empty\">\r\n <gram-empty></gram-empty>\r\n </div>\r\n </ng-template>\r\n\r\n</ng-container>\r\n<ng-template #tmpField>\r\n <nz-upload nzType=\"drag\" [nzLimit]=\"1\" [nzShowButton]=\"fileList.length < maxCount\" [nzMultiple]=\"isMultiple\"\r\n [nzDisabled]=\"fileList && fileList.length>=maxCount\" [(nzFileList)]=\"fileList\" [nzBeforeUpload]=\"beforeUpload\"\r\n [nzRemove]=\"remove\" [nzCustomRequest]=\"uploadRequest\" [(nzFileList)]=\"fileList\">\r\n <p class=\"ant-upload-drag-icon\">\r\n <i nz-icon nzType=\"inbox\"></i>\r\n </p>\r\n <p class=\"ant-upload-text\">\u5355\u51FB\u6216\u62D6\u52A8\u6587\u4EF6\u5230\u6B64\u533A\u57DF\u4EE5\u4E0A\u4F20</p>\r\n <p class=\"ant-upload-hint\">\u5355\u4E2A\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC750MB\uFF08\u6700\u591A\u53EF\u4EE5\u4E0A\u4F20{{maxCount}}\u4E2A\u6587\u4EF6\uFF09</p>\r\n </nz-upload>\r\n</ng-template>", styles: [":host ::ng-deep .upload-empty-box{font-size:12px}:host ::ng-deep .ant-upload-list{display:inline-block}:host ::ng-deep .ant-upload-list-picture-card-container{width:80px;height:80px;margin:0 8px 8px 0}:host ::ng-deep .ant-upload.ant-upload-select-picture-card{width:80px;height:80px}:host ::ng-deep .ant-upload-list-picture-card .ant-upload-list-item{width:80px;height:80px;padding:0}:host ::ng-deep .ant-upload-list-picture-card .ant-upload-list-item-thumbnail{width:100%;height:100%}:host ::ng-deep .ant-upload-list-picture-card .ant-upload-list-item-thumbnail img{width:100%;height:100%;object-fit:cover}:host ::ng-deep .ant-upload-list-item-name{font-size:12px}:host ::ng-deep .ant-upload-list-item-uploading{font-size:12px}:host ::ng-deep .ant-upload-list-item-progress{font-size:12px}:host ::ng-deep .upload-view .ant-upload-list-item-card-actions button:nth-last-child(1){display:none!important}:host ::ng-deep .upload-empty{padding:15px;text-align:center;background:#f5f5f5}:host ::ng-deep .upload-empty .image{width:100px}\n"] }]
3707
+ }], ctorParameters: () => [{ type: i1$7._HttpClient }, { type: i2$1.NzMessageService }] });
3708
+
3709
+ function withFormlyFieldAttachment() {
3710
+ return {
3711
+ types: [
3712
+ {
3713
+ name: 'attachment',
3714
+ component: DeonNzFieldAttachment,
3715
+ wrappers: ['formly-form-field'],
3716
+ }
3717
+ ],
3718
+ };
3719
+ }
3720
+
3721
+ class DeonNzAttachmentModule {
3722
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzAttachmentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3723
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: DeonNzAttachmentModule, imports: [CommonModule,
3724
+ DeonNzFormFieldModule, i1$1.FormlyModule] });
3725
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzAttachmentModule, imports: [CommonModule,
3726
+ DeonNzFormFieldModule,
3727
+ FormlyModule.forChild(withFormlyFieldAttachment())] });
3728
+ }
3729
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzAttachmentModule, decorators: [{
3730
+ type: NgModule,
3731
+ args: [{
3732
+ imports: [
3733
+ CommonModule,
3734
+ DeonNzFormFieldModule,
3735
+ FormlyModule.forChild(withFormlyFieldAttachment()),
3736
+ ],
3737
+ }]
3738
+ }] });
3739
+
3740
+ class DeonNzFieldCardFront extends FieldType {
3741
+ http;
3742
+ msg;
3743
+ fileList = [];
3744
+ maxCount = 1;
3745
+ previewImage;
3746
+ previewVisible = false;
3747
+ isMultiple = false;
3748
+ constructor(http, msg) {
3749
+ super();
3750
+ this.http = http;
3751
+ this.msg = msg;
3752
+ }
3753
+ ngOnInit() {
3754
+ this.initValue();
3755
+ /** 解决页面渲染后赋值 */
3756
+ this.formControl.valueChanges.subscribe(() => {
3757
+ if (this.fileList.length === 0) {
3758
+ this.initValue();
3759
+ }
3760
+ });
3761
+ }
3762
+ /**
3763
+ * 初始化回显
3764
+ */
3765
+ initValue() {
3766
+ const value = this.formControl.value;
3767
+ if (!value)
3768
+ return;
3769
+ const arr = Array.isArray(value) ? value : [value];
3770
+ this.fileList = arr.map((item, index) => ({
3771
+ uid: item.id || String(index),
3772
+ name: item.fileName,
3773
+ status: 'done',
3774
+ url: item.fileUrl,
3775
+ thumbUrl: item.fileUrl
3776
+ }));
3777
+ }
3778
+ /**
3779
+ * 上传前
3780
+ */
3781
+ beforeUpload = (file) => {
3782
+ const realFile = file;
3783
+ if (!realFile)
3784
+ return false;
3785
+ /** 限制 5MB */
3786
+ const isLt5M = realFile.size / 1024 / 1024 < 5;
3787
+ if (!isLt5M) {
3788
+ this.msg.warning('图片不能超过5MB');
3789
+ return false;
3790
+ }
3791
+ const reader = new FileReader();
3792
+ reader.onload = () => {
3793
+ const target = this.fileList.find(f => f.uid === file.uid);
3794
+ if (target) {
3795
+ target.thumbUrl = reader.result;
3796
+ this.fileList = [...this.fileList];
3797
+ }
3798
+ };
3799
+ reader.readAsDataURL(realFile);
3800
+ return true;
3801
+ };
3802
+ /**
3803
+ * 上传
3804
+ */
3805
+ uploadRequest = (item) => {
3806
+ const file = item.file;
3807
+ const realFile = file.originFileObj ||
3808
+ item.file;
3809
+ const formData = new FormData();
3810
+ formData.append('type', 'CARD_FRONT');
3811
+ formData.append('multipartFile', realFile);
3812
+ let url = `${ModuleAPI.system}/user/comm/uploadFile`;
3813
+ if (this.to && this.to["ocr"] == true) {
3814
+ url = `${ModuleAPI.system}/user/comm/uploadFileOCR`;
3815
+ }
3816
+ return this.http.post(url, formData)
3817
+ .subscribe({
3818
+ next: (res) => {
3819
+ if (res && res?.result) {
3820
+ const data = res.result;
3821
+ file.status = 'done';
3822
+ file.url = data.fileUrl;
3823
+ file.thumbUrl = data.fileUrl;
3824
+ /** 保存 id */
3825
+ file.id = data.id;
3826
+ if (!this.isMultiple) {
3827
+ this.fileList = [file];
3828
+ }
3829
+ else {
3830
+ this.fileList = [...this.fileList];
3831
+ }
3832
+ this.updateModel(data);
3833
+ item.onSuccess?.(res, file, null);
3834
+ }
3835
+ else {
3836
+ file.status = 'error';
3837
+ item.onError?.(res, file);
3838
+ }
3839
+ },
3840
+ error: err => {
3841
+ file.status = 'error';
3842
+ item.onError?.(err, file);
3843
+ }
3844
+ });
3845
+ };
3846
+ /**
3847
+ * 删除
3848
+ */
3849
+ remove = (file) => {
3850
+ const index = this.fileList.indexOf(file);
3851
+ if (index > -1) {
3852
+ this.fileList.splice(index, 1);
3853
+ }
3854
+ this.updateModel(null);
3855
+ return true;
3856
+ };
3857
+ /**
3858
+ * 预览
3859
+ */
3860
+ handlePreview = async (file) => {
3861
+ if (!file.url && !file.preview) {
3862
+ const realFile = file.originFileObj;
3863
+ if (realFile) {
3864
+ file.preview = await this.getBase64(realFile);
3865
+ }
3866
+ }
3867
+ this.previewImage = file.url || file.preview;
3868
+ this.previewVisible = true;
3869
+ };
3870
+ getBase64(file) {
3871
+ return new Promise((resolve, reject) => {
3872
+ const reader = new FileReader();
3873
+ reader.readAsDataURL(file);
3874
+ reader.onload = () => resolve(reader.result);
3875
+ reader.onerror = reject;
3876
+ });
3877
+ }
3878
+ /**
3879
+ * 写回 model
3880
+ */
3881
+ updateModel(e) {
3882
+ let arr = [];
3883
+ if (this.fileList && this.fileList.length > 0) {
3884
+ this.fileList.forEach((item) => {
3885
+ if (item?.originFileObj && item?.originFileObj["status"] === 'done' && item?.originFileObj["url"]) {
3886
+ let obj = item?.originFileObj;
3887
+ arr.push({
3888
+ id: obj.id,
3889
+ fileName: obj.name,
3890
+ fileUrl: obj.url
3891
+ });
3892
+ }
3893
+ });
3894
+ }
3895
+ this.formControl.setValue(arr[0] || null);
3896
+ }
3897
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzFieldCardFront, deps: [{ token: i1$7._HttpClient }, { token: i2$1.NzMessageService }], target: i0.ɵɵFactoryTarget.Component });
3898
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: DeonNzFieldCardFront, isStandalone: true, selector: "deon-nz-field-card-front", usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"editor == false; else tmpField\">\r\n <nz-upload nzListType=\"picture-card\" [(nzFileList)]=\"fileList\" [nzShowButton]=\"false\" [nzDisabled]=\"true\"\r\n class=\"upload-view\" *ngIf=\"fileList && fileList.length>0;else tmpEmpty\">\r\n </nz-upload>\r\n\r\n <ng-template #tmpEmpty>\r\n <img nz-image width=\"80px\" height=\"80px\" nzSrc=\"error\"\r\n nzFallback=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAA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NSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==\" />\r\n </ng-template>\r\n</ng-container>\r\n<ng-template #tmpField>\r\n <nz-upload nzListType=\"picture-card\" [(nzFileList)]=\"fileList\" [nzShowButton]=\"fileList.length < maxCount\"\r\n [nzPreview]=\"handlePreview\" [nzBeforeUpload]=\"beforeUpload\" [nzCustomRequest]=\"uploadRequest\"\r\n [nzRemove]=\"remove\" nzAccept=\"image/*\" [nzMultiple]=\"isMultiple\">\r\n <div class=\"upload-empty-box\">\r\n <span nz-icon nzType=\"plus\"></span>\r\n <div style=\"margin-top: 8px\">\u70B9\u51FB\u4E0A\u4F20</div>\r\n </div>\r\n </nz-upload>\r\n</ng-template>", styles: [":host ::ng-deep .upload-empty-box{font-size:12px}:host ::ng-deep .ant-upload-list{display:inline-block}:host ::ng-deep .ant-upload-list-picture-card-container{width:80px;height:80px;margin:0 8px 8px 0}:host ::ng-deep .ant-upload.ant-upload-select-picture-card{width:80px;height:80px}:host ::ng-deep .ant-upload-list-picture-card .ant-upload-list-item{width:80px;height:80px;padding:0}:host ::ng-deep .ant-upload-list-picture-card .ant-upload-list-item-thumbnail{width:100%;height:100%}:host ::ng-deep .ant-upload-list-picture-card .ant-upload-list-item-thumbnail img{width:100%;height:100%;object-fit:cover}:host ::ng-deep .ant-upload-list-item-name{font-size:12px}:host ::ng-deep .ant-upload-list-item-uploading{font-size:12px}:host ::ng-deep .ant-upload-list-item-progress{font-size:12px}:host ::ng-deep .upload-view .ant-upload-list-item-actions a{display:none!important}:host ::ng-deep .upload-view .ant-upload-list-item-actions button:nth-last-child(1){display:none!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: FormlyModule }, { kind: "ngmodule", type: NzUploadModule }, { kind: "component", type: i4$5.NzUploadComponent, selector: "nz-upload", inputs: ["nzType", "nzLimit", "nzSize", "nzFileType", "nzAccept", "nzAction", "nzDirectory", "nzOpenFileDialogOnClick", "nzBeforeUpload", "nzCustomRequest", "nzData", "nzFilter", "nzFileList", "nzDisabled", "nzHeaders", "nzListType", "nzMultiple", "nzName", "nzShowUploadList", "nzShowButton", "nzWithCredentials", "nzRemove", "nzPreview", "nzPreviewFile", "nzPreviewIsImage", "nzTransformFile", "nzDownload", "nzIconRender", "nzFileListRender"], outputs: ["nzChange", "nzFileListChange"], exportAs: ["nzUpload"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i5$1.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzModalModule }, { kind: "ngmodule", type: NzImageModule }, { kind: "directive", type: i6$2.NzImageDirective, selector: "img[nz-image]", inputs: ["nzSrc", "nzSrcset", "nzDisablePreview", "nzFallback", "nzPlaceholder", "nzScaleStep"], exportAs: ["nzImage"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3899
+ }
3900
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzFieldCardFront, decorators: [{
3901
+ type: Component,
3902
+ args: [{ selector: 'deon-nz-field-card-front', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
3903
+ CommonModule,
3904
+ ReactiveFormsModule,
3905
+ FormlyModule,
3906
+ NzUploadModule,
3907
+ NzIconModule,
3908
+ NzModalModule, NzImageModule
3909
+ ], template: "<ng-container *ngIf=\"editor == false; else tmpField\">\r\n <nz-upload nzListType=\"picture-card\" [(nzFileList)]=\"fileList\" [nzShowButton]=\"false\" [nzDisabled]=\"true\"\r\n class=\"upload-view\" *ngIf=\"fileList && fileList.length>0;else tmpEmpty\">\r\n </nz-upload>\r\n\r\n <ng-template #tmpEmpty>\r\n <img nz-image width=\"80px\" height=\"80px\" nzSrc=\"error\"\r\n nzFallback=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0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AkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==\" />\r\n </ng-template>\r\n</ng-container>\r\n<ng-template #tmpField>\r\n <nz-upload nzListType=\"picture-card\" [(nzFileList)]=\"fileList\" [nzShowButton]=\"fileList.length < maxCount\"\r\n [nzPreview]=\"handlePreview\" [nzBeforeUpload]=\"beforeUpload\" [nzCustomRequest]=\"uploadRequest\"\r\n [nzRemove]=\"remove\" nzAccept=\"image/*\" [nzMultiple]=\"isMultiple\">\r\n <div class=\"upload-empty-box\">\r\n <span nz-icon nzType=\"plus\"></span>\r\n <div style=\"margin-top: 8px\">\u70B9\u51FB\u4E0A\u4F20</div>\r\n </div>\r\n </nz-upload>\r\n</ng-template>", styles: [":host ::ng-deep .upload-empty-box{font-size:12px}:host ::ng-deep .ant-upload-list{display:inline-block}:host ::ng-deep .ant-upload-list-picture-card-container{width:80px;height:80px;margin:0 8px 8px 0}:host ::ng-deep .ant-upload.ant-upload-select-picture-card{width:80px;height:80px}:host ::ng-deep .ant-upload-list-picture-card .ant-upload-list-item{width:80px;height:80px;padding:0}:host ::ng-deep .ant-upload-list-picture-card .ant-upload-list-item-thumbnail{width:100%;height:100%}:host ::ng-deep .ant-upload-list-picture-card .ant-upload-list-item-thumbnail img{width:100%;height:100%;object-fit:cover}:host ::ng-deep .ant-upload-list-item-name{font-size:12px}:host ::ng-deep .ant-upload-list-item-uploading{font-size:12px}:host ::ng-deep .ant-upload-list-item-progress{font-size:12px}:host ::ng-deep .upload-view .ant-upload-list-item-actions a{display:none!important}:host ::ng-deep .upload-view .ant-upload-list-item-actions button:nth-last-child(1){display:none!important}\n"] }]
3910
+ }], ctorParameters: () => [{ type: i1$7._HttpClient }, { type: i2$1.NzMessageService }] });
3911
+
3912
+ class DeonNzFieldCardBack extends FieldType {
3913
+ http;
3914
+ msg;
3915
+ fileList = [];
3916
+ maxCount = 1;
3917
+ previewImage;
3918
+ previewVisible = false;
3919
+ isMultiple = false;
3920
+ constructor(http, msg) {
3921
+ super();
3922
+ this.http = http;
3923
+ this.msg = msg;
3924
+ }
3925
+ ngOnInit() {
3926
+ this.initValue();
3927
+ /** 解决页面渲染后赋值 */
3928
+ this.formControl.valueChanges.subscribe(() => {
3929
+ if (this.fileList.length === 0) {
3930
+ this.initValue();
3931
+ }
3932
+ });
3933
+ }
3934
+ /**
3935
+ * 初始化回显
3936
+ */
3937
+ initValue() {
3938
+ const value = this.formControl.value;
3939
+ if (!value)
3940
+ return;
3941
+ const arr = Array.isArray(value) ? value : [value];
3942
+ this.fileList = arr.map((item, index) => ({
3943
+ uid: item.id || String(index),
3944
+ name: item.fileName,
3945
+ status: 'done',
3946
+ url: item.fileUrl,
3947
+ thumbUrl: item.fileUrl
3948
+ }));
3949
+ }
3950
+ /**
3951
+ * 上传前
3952
+ */
3953
+ beforeUpload = (file) => {
3954
+ const realFile = file;
3955
+ if (!realFile)
3956
+ return false;
3957
+ /** 限制 5MB */
3958
+ const isLt5M = realFile.size / 1024 / 1024 < 5;
3959
+ if (!isLt5M) {
3960
+ this.msg.warning('图片不能超过5MB');
3961
+ return false;
3962
+ }
3963
+ const reader = new FileReader();
3964
+ reader.onload = () => {
3965
+ const target = this.fileList.find(f => f.uid === file.uid);
3966
+ if (target) {
3967
+ target.thumbUrl = reader.result;
3968
+ this.fileList = [...this.fileList];
3969
+ }
3970
+ };
3971
+ reader.readAsDataURL(realFile);
3972
+ return true;
3973
+ };
3974
+ /**
3975
+ * 上传
3976
+ */
3977
+ uploadRequest = (item) => {
3978
+ const file = item.file;
3979
+ const realFile = file.originFileObj ||
3980
+ item.file;
3981
+ const formData = new FormData();
3982
+ formData.append('type', 'CARD_BACK');
3983
+ formData.append('multipartFile', realFile);
3984
+ let url = `${ModuleAPI.system}/user/comm/uploadFile`;
3985
+ if (this.to && this.to["ocr"] == true) {
3986
+ url = `${ModuleAPI.system}/user/comm/uploadFileOCR`;
3987
+ }
3988
+ return this.http.post(url, formData)
3989
+ .subscribe({
3990
+ next: (res) => {
3991
+ if (res && res?.result) {
3992
+ const data = res.result;
3993
+ file.status = 'done';
3994
+ file.url = data.fileUrl;
3995
+ file.thumbUrl = data.fileUrl;
3996
+ /** 保存 id */
3997
+ file.id = data.id;
3998
+ if (!this.isMultiple) {
3999
+ this.fileList = [file];
4000
+ }
4001
+ else {
4002
+ this.fileList = [...this.fileList];
4003
+ }
4004
+ this.updateModel(data);
4005
+ item.onSuccess?.(res, file, null);
4006
+ }
4007
+ else {
4008
+ file.status = 'error';
4009
+ item.onError?.(res, file);
4010
+ }
4011
+ },
4012
+ error: err => {
4013
+ file.status = 'error';
4014
+ item.onError?.(err, file);
4015
+ }
4016
+ });
4017
+ };
4018
+ /**
4019
+ * 删除
4020
+ */
4021
+ remove = (file) => {
4022
+ const index = this.fileList.indexOf(file);
4023
+ if (index > -1) {
4024
+ this.fileList.splice(index, 1);
4025
+ }
4026
+ this.updateModel(null);
4027
+ return true;
4028
+ };
4029
+ /**
4030
+ * 预览
4031
+ */
4032
+ handlePreview = async (file) => {
4033
+ if (!file.url && !file.preview) {
4034
+ const realFile = file.originFileObj;
4035
+ if (realFile) {
4036
+ file.preview = await this.getBase64(realFile);
4037
+ }
4038
+ }
4039
+ this.previewImage = file.url || file.preview;
4040
+ this.previewVisible = true;
4041
+ };
4042
+ getBase64(file) {
4043
+ return new Promise((resolve, reject) => {
4044
+ const reader = new FileReader();
4045
+ reader.readAsDataURL(file);
4046
+ reader.onload = () => resolve(reader.result);
4047
+ reader.onerror = reject;
4048
+ });
4049
+ }
4050
+ /**
4051
+ * 写回 model
4052
+ */
4053
+ updateModel(e) {
4054
+ let arr = [];
4055
+ if (this.fileList && this.fileList.length > 0) {
4056
+ this.fileList.forEach((item) => {
4057
+ if (item?.originFileObj && item?.originFileObj["status"] === 'done' && item?.originFileObj["url"]) {
4058
+ let obj = item?.originFileObj;
4059
+ arr.push({
4060
+ id: obj.id,
4061
+ fileName: obj.name,
4062
+ fileUrl: obj.url
4063
+ });
4064
+ }
4065
+ });
4066
+ }
4067
+ this.formControl.setValue(arr[0] || null);
4068
+ }
4069
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzFieldCardBack, deps: [{ token: i1$7._HttpClient }, { token: i2$1.NzMessageService }], target: i0.ɵɵFactoryTarget.Component });
4070
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: DeonNzFieldCardBack, isStandalone: true, selector: "deon-nz-field-card-back", usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"editor == false; else tmpField\">\r\n <nz-upload nzListType=\"picture-card\" [(nzFileList)]=\"fileList\" [nzShowButton]=\"false\" [nzDisabled]=\"true\"\r\n class=\"upload-view\" *ngIf=\"fileList && fileList.length>0;else tmpEmpty\">\r\n </nz-upload>\r\n\r\n <ng-template #tmpEmpty>\r\n <img nz-image width=\"80px\" height=\"80px\" nzSrc=\"error\"\r\n nzFallback=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379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p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==\" />\r\n </ng-template>\r\n</ng-container>\r\n<ng-template #tmpField>\r\n <nz-upload nzListType=\"picture-card\" [(nzFileList)]=\"fileList\" [nzShowButton]=\"fileList.length < maxCount\"\r\n [nzPreview]=\"handlePreview\" [nzBeforeUpload]=\"beforeUpload\" [nzCustomRequest]=\"uploadRequest\"\r\n [nzRemove]=\"remove\" nzAccept=\"image/*\" [nzMultiple]=\"isMultiple\">\r\n <div class=\"upload-empty-box\">\r\n <span nz-icon nzType=\"plus\"></span>\r\n <div style=\"margin-top: 8px\">\u70B9\u51FB\u4E0A\u4F20</div>\r\n </div>\r\n </nz-upload>\r\n</ng-template>", styles: [":host ::ng-deep .upload-empty-box{font-size:12px}:host ::ng-deep .ant-upload-list{display:inline-block}:host ::ng-deep .ant-upload-list-picture-card-container{width:80px;height:80px;margin:0 8px 8px 0}:host ::ng-deep .ant-upload.ant-upload-select-picture-card{width:80px;height:80px}:host ::ng-deep .ant-upload-list-picture-card .ant-upload-list-item{width:80px;height:80px;padding:0}:host ::ng-deep .ant-upload-list-picture-card .ant-upload-list-item-thumbnail{width:100%;height:100%}:host ::ng-deep .ant-upload-list-picture-card .ant-upload-list-item-thumbnail img{width:100%;height:100%;object-fit:cover}:host ::ng-deep .ant-upload-list-item-name{font-size:12px}:host ::ng-deep .ant-upload-list-item-uploading{font-size:12px}:host ::ng-deep .ant-upload-list-item-progress{font-size:12px}:host ::ng-deep .upload-view .ant-upload-list-item-actions a{display:none!important}:host ::ng-deep .upload-view .ant-upload-list-item-actions button:nth-last-child(1){display:none!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: FormlyModule }, { kind: "ngmodule", type: NzUploadModule }, { kind: "component", type: i4$5.NzUploadComponent, selector: "nz-upload", inputs: ["nzType", "nzLimit", "nzSize", "nzFileType", "nzAccept", "nzAction", "nzDirectory", "nzOpenFileDialogOnClick", "nzBeforeUpload", "nzCustomRequest", "nzData", "nzFilter", "nzFileList", "nzDisabled", "nzHeaders", "nzListType", "nzMultiple", "nzName", "nzShowUploadList", "nzShowButton", "nzWithCredentials", "nzRemove", "nzPreview", "nzPreviewFile", "nzPreviewIsImage", "nzTransformFile", "nzDownload", "nzIconRender", "nzFileListRender"], outputs: ["nzChange", "nzFileListChange"], exportAs: ["nzUpload"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i5$1.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzModalModule }, { kind: "ngmodule", type: NzImageModule }, { kind: "directive", type: i6$2.NzImageDirective, selector: "img[nz-image]", inputs: ["nzSrc", "nzSrcset", "nzDisablePreview", "nzFallback", "nzPlaceholder", "nzScaleStep"], exportAs: ["nzImage"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4071
+ }
4072
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzFieldCardBack, decorators: [{
4073
+ type: Component,
4074
+ args: [{ selector: 'deon-nz-field-card-back', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
4075
+ CommonModule,
4076
+ ReactiveFormsModule,
4077
+ FormlyModule,
4078
+ NzUploadModule,
4079
+ NzIconModule,
4080
+ NzModalModule, NzImageModule
4081
+ ], template: "<ng-container *ngIf=\"editor == false; else tmpField\">\r\n <nz-upload nzListType=\"picture-card\" [(nzFileList)]=\"fileList\" [nzShowButton]=\"false\" [nzDisabled]=\"true\"\r\n class=\"upload-view\" *ngIf=\"fileList && fileList.length>0;else tmpEmpty\">\r\n </nz-upload>\r\n\r\n <ng-template #tmpEmpty>\r\n <img nz-image width=\"80px\" height=\"80px\" nzSrc=\"error\"\r\n nzFallback=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+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CRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==\" />\r\n </ng-template>\r\n</ng-container>\r\n<ng-template #tmpField>\r\n <nz-upload nzListType=\"picture-card\" [(nzFileList)]=\"fileList\" [nzShowButton]=\"fileList.length < maxCount\"\r\n [nzPreview]=\"handlePreview\" [nzBeforeUpload]=\"beforeUpload\" [nzCustomRequest]=\"uploadRequest\"\r\n [nzRemove]=\"remove\" nzAccept=\"image/*\" [nzMultiple]=\"isMultiple\">\r\n <div class=\"upload-empty-box\">\r\n <span nz-icon nzType=\"plus\"></span>\r\n <div style=\"margin-top: 8px\">\u70B9\u51FB\u4E0A\u4F20</div>\r\n </div>\r\n </nz-upload>\r\n</ng-template>", styles: [":host ::ng-deep .upload-empty-box{font-size:12px}:host ::ng-deep .ant-upload-list{display:inline-block}:host ::ng-deep .ant-upload-list-picture-card-container{width:80px;height:80px;margin:0 8px 8px 0}:host ::ng-deep .ant-upload.ant-upload-select-picture-card{width:80px;height:80px}:host ::ng-deep .ant-upload-list-picture-card .ant-upload-list-item{width:80px;height:80px;padding:0}:host ::ng-deep .ant-upload-list-picture-card .ant-upload-list-item-thumbnail{width:100%;height:100%}:host ::ng-deep .ant-upload-list-picture-card .ant-upload-list-item-thumbnail img{width:100%;height:100%;object-fit:cover}:host ::ng-deep .ant-upload-list-item-name{font-size:12px}:host ::ng-deep .ant-upload-list-item-uploading{font-size:12px}:host ::ng-deep .ant-upload-list-item-progress{font-size:12px}:host ::ng-deep .upload-view .ant-upload-list-item-actions a{display:none!important}:host ::ng-deep .upload-view .ant-upload-list-item-actions button:nth-last-child(1){display:none!important}\n"] }]
4082
+ }], ctorParameters: () => [{ type: i1$7._HttpClient }, { type: i2$1.NzMessageService }] });
4083
+
4084
+ function withFormlyFieldIdCard() {
4085
+ return {
4086
+ types: [
4087
+ {
4088
+ name: 'card_front',
4089
+ component: DeonNzFieldCardFront,
4090
+ wrappers: ['formly-form-field'],
4091
+ },
4092
+ {
4093
+ name: 'card_back',
4094
+ component: DeonNzFieldCardBack,
4095
+ wrappers: ['formly-form-field'],
4096
+ }
4097
+ ],
4098
+ };
4099
+ }
4100
+
4101
+ class DeonNzIdCardModule {
4102
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzIdCardModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4103
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: DeonNzIdCardModule, imports: [CommonModule,
4104
+ DeonNzFormFieldModule, i1$1.FormlyModule] });
4105
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzIdCardModule, imports: [CommonModule,
4106
+ DeonNzFormFieldModule,
4107
+ FormlyModule.forChild(withFormlyFieldIdCard())] });
4108
+ }
4109
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonNzIdCardModule, decorators: [{
4110
+ type: NgModule,
4111
+ args: [{
4112
+ imports: [
4113
+ CommonModule,
4114
+ DeonNzFormFieldModule,
4115
+ FormlyModule.forChild(withFormlyFieldIdCard()),
4116
+ ],
4117
+ }]
4118
+ }] });
4119
+
3328
4120
  /**
3329
4121
  * Generated bundle index. Do not edit.
3330
4122
  */
3331
4123
 
3332
- export { DeonNzCheckboxGroupModule, DeonNzCheckboxModule, DeonNzColorModule, DeonNzDateTimeModule, DeonNzDescModule, DeonNzDimIndicatorModule, DeonNzDimModule, DeonNzGridModule, DeonNzGroupModule, DeonNzHtmlModule, DeonNzIconModule, DeonNzLabelModule, DeonNzLineModule, DeonNzListModule, DeonNzNumberModule, DeonNzOverTimeModule, DeonNzPanelModule, DeonNzRadioGroupModule, DeonNzRadioModule, DeonNzReformModule, DeonNzRepeatCardModule, DeonNzRepeatModule, DeonNzSelectModule, DeonNzSwitchModule, DeonNzTabsModule, DeonNzTextAreaModule, DeonNzTextCodeModule, DeonNzTextModule, withFormlyFieldCheckbox, withFormlyFieldCheckboxGroup, withFormlyFieldColor, withFormlyFieldDateTime, withFormlyFieldDesc, withFormlyFieldDim, withFormlyFieldGrid, withFormlyFieldGroup, withFormlyFieldHtml, withFormlyFieldIcon, withFormlyFieldIndicator, withFormlyFieldLabel, withFormlyFieldLine, withFormlyFieldList, withFormlyFieldNumber, withFormlyFieldOverTime, withFormlyFieldPanel, withFormlyFieldRadio, withFormlyFieldRadioGroup, withFormlyFieldReform, withFormlyFieldRepeat, withFormlyFieldRepeatCard, withFormlyFieldSelect, withFormlyFieldSwitch, withFormlyFieldTab, withFormlyFieldText, withFormlyFieldTextArea, withFormlyFieldTextCode };
4124
+ export { DeonNzAttachmentModule, DeonNzCheckboxGroupModule, DeonNzCheckboxModule, DeonNzColorModule, DeonNzDateTimeModule, DeonNzDescModule, DeonNzDimIndicatorModule, DeonNzDimModule, DeonNzGridModule, DeonNzGroupModule, DeonNzHtmlModule, DeonNzIconModule, DeonNzIdCardModule, DeonNzImgModule, DeonNzLabelModule, DeonNzLineModule, DeonNzListModule, DeonNzNumberModule, DeonNzOverTimeModule, DeonNzPanelModule, DeonNzRadioGroupModule, DeonNzRadioModule, DeonNzReformModule, DeonNzRepeatCardModule, DeonNzRepeatModule, DeonNzSelectModule, DeonNzSwitchModule, DeonNzTabsModule, DeonNzTextAreaModule, DeonNzTextCodeModule, DeonNzTextModule, withFormlyFieldAttachment, withFormlyFieldCheckbox, withFormlyFieldCheckboxGroup, withFormlyFieldColor, withFormlyFieldDateTime, withFormlyFieldDesc, withFormlyFieldDim, withFormlyFieldGrid, withFormlyFieldGroup, withFormlyFieldHtml, withFormlyFieldIcon, withFormlyFieldIdCard, withFormlyFieldImg, withFormlyFieldIndicator, withFormlyFieldLabel, withFormlyFieldLine, withFormlyFieldList, withFormlyFieldNumber, withFormlyFieldOverTime, withFormlyFieldPanel, withFormlyFieldRadio, withFormlyFieldRadioGroup, withFormlyFieldReform, withFormlyFieldRepeat, withFormlyFieldRepeatCard, withFormlyFieldSelect, withFormlyFieldSwitch, withFormlyFieldTab, withFormlyFieldText, withFormlyFieldTextArea, withFormlyFieldTextCode };
3333
4125
  //# sourceMappingURL=ebuilding-form.mjs.map