edit
This commit is contained in:
		| @ -11,34 +11,17 @@ | ||||
|         <img [src]="userDetail?.avatar" /> | ||||
|         <div style="flex: 1"> | ||||
|           <div style="display: flex; width: 100%; justify-content: space-between"> | ||||
|             <p style="padding-right: 80px; width: 400px" | ||||
|               >{{ userDetail?.name }} | ||||
|             <p style="padding-right: 80px; width: 400px">{{ userDetail?.name }} | ||||
|               <nz-badge nzStatus="success" nzText="正常" *ngIf="!userDetail?.stateLocked" class="ml-xl"> </nz-badge> | ||||
|               <nz-badge nzStatus="warning" nzText="冻结" *ngIf="userDetail?.stateLocked" class="ml-xl"> </nz-badge> | ||||
|             </p> | ||||
|             <div style="margin-right: 24px"> | ||||
|               <button | ||||
|                 *ngIf="userDetail?.stateLocked" | ||||
|                 [nzLoading]="service.http.loading" | ||||
|                 nz-button | ||||
|                 nzType="primary" | ||||
|                 nzGhost | ||||
|                 (click)="userAction(1)" | ||||
|                 acl | ||||
|                 [acl-ability]="['USERCENTER-DRIVER-CAPTAIN-DETAIL-lock']" | ||||
|               > | ||||
|               <button *ngIf="userDetail?.stateLocked" [nzLoading]="service.http.loading" nz-button nzType="primary" | ||||
|                 nzGhost (click)="userAction(1)" acl [acl-ability]="['USERCENTER-DRIVER-CAPTAIN-DETAIL-lock']"> | ||||
|                 启用 | ||||
|               </button> | ||||
|               <button | ||||
|                 *ngIf="!userDetail?.stateLocked" | ||||
|                 [nzLoading]="service.http.loading" | ||||
|                 nz-button | ||||
|                 nzDanger | ||||
|                 nzGhost | ||||
|                 (click)="userAction(0)" | ||||
|                 acl | ||||
|                 [acl-ability]="['USERCENTER-DRIVER-CAPTAIN-DETAIL-lock']" | ||||
|               > | ||||
|               <button *ngIf="!userDetail?.stateLocked" [nzLoading]="service.http.loading" nz-button nzDanger nzGhost | ||||
|                 (click)="userAction(0)" acl [acl-ability]="['USERCENTER-DRIVER-CAPTAIN-DETAIL-lock']"> | ||||
|                 冻结 | ||||
|               </button> | ||||
|             </div> | ||||
| @ -56,13 +39,12 @@ | ||||
| <nz-card [nzLoading]="service.http.loading"> | ||||
|   <div [class]="isEditUser ? 'edit-box' : 'readOnly-box'"> | ||||
|     <sv-container col="2"> | ||||
|       <sv-title | ||||
|         >个人信息 | ||||
|         <label *ngIf="userIdentityDetail?.certificationStatus === 1" style="color: #52c41a" class="ml-md" | ||||
|           ><i nz-icon nzType="check-circle" nzTheme="fill" class="mr-xs"></i>审核通过 | ||||
|       <sv-title>个人信息 | ||||
|         <label *ngIf="userIdentityDetail?.certificationStatus === 1" style="color: #52c41a" class="ml-md"><i nz-icon | ||||
|             nzType="check-circle" nzTheme="fill" class="mr-xs"></i>审核通过 | ||||
|         </label> | ||||
|         <label *ngIf="userIdentityDetail?.certificationStatus === 2" style="color: #ff4d4f" class="ml-md" | ||||
|           ><i nz-icon nzType="close-circle" nzTheme="fill" class="mr-xs"></i>驳回 | ||||
|         <label *ngIf="userIdentityDetail?.certificationStatus === 2" style="color: #ff4d4f" class="ml-md"><i nz-icon | ||||
|             nzType="close-circle" nzTheme="fill" class="mr-xs"></i>驳回 | ||||
|         </label> | ||||
|         <div style="float: right"> | ||||
|           <ng-container *ngIf="isEditUser; else elseTemplate"> | ||||
| @ -70,40 +52,28 @@ | ||||
|             <button [nzLoading]="service.http.loading" nz-button nzDanger (click)="saveUser()"> 保存 </button> | ||||
|           </ng-container> | ||||
|           <ng-template #elseTemplate> | ||||
|             <button nz-button nzType="default" nzDanger (click)="approveUser()" *ngIf="userIdentityDetail?.certificationStatus === 0" | ||||
|             acl  [acl-ability]="['USERCENTER-DRIVER-CAPTAIN-DETAIL-audit']">审核通过</button | ||||
|             > | ||||
|             <button nz-button nzType="default" nzDanger (click)="rejectedUser()" *ngIf="userIdentityDetail?.certificationStatus === 0" | ||||
|             acl  [acl-ability]="['USERCENTER-DRIVER-CAPTAIN-DETAIL-audit']" >驳回审核</button | ||||
|             > | ||||
|             <button nz-button nzType="default" nzDanger (click)="ratify()" acl  [acl-ability]="['USERCENTER-DRIVER-CAPTAIN-DETAIL-edit']">修改</button> | ||||
|             <button nz-button nzType="default" nzDanger (click)="approveUser()" | ||||
|               *ngIf="userIdentityDetail?.certificationStatus === 0" acl | ||||
|               [acl-ability]="['USERCENTER-DRIVER-CAPTAIN-DETAIL-audit']">审核通过</button> | ||||
|             <button nz-button nzType="default" nzDanger (click)="rejectedUser()" | ||||
|               *ngIf="userIdentityDetail?.certificationStatus === 0" acl | ||||
|               [acl-ability]="['USERCENTER-DRIVER-CAPTAIN-DETAIL-audit']">驳回审核</button> | ||||
|             <button nz-button nzType="default" nzDanger (click)="ratify()" acl | ||||
|               [acl-ability]="['USERCENTER-DRIVER-CAPTAIN-DETAIL-edit']">修改</button> | ||||
|           </ng-template> | ||||
|         </div> | ||||
|       </sv-title> | ||||
|       <sv label="姓名"> | ||||
|         <input | ||||
|           nz-input | ||||
|           type="text" | ||||
|           [(ngModel)]="userIdentityDetail.name" | ||||
|           [readonly]="!isEditUser" | ||||
|           [nzBorderless]="!isEditUser" | ||||
|           [placeholder]="isEditUser ? '' : '-'" | ||||
|         /> | ||||
|         <input nz-input type="text" [(ngModel)]="userIdentityDetail.name" [readonly]="!isEditUser" | ||||
|           [nzBorderless]="!isEditUser" [placeholder]="isEditUser ? '' : '-'" /> | ||||
|       </sv> | ||||
|       <sv label="身份证号"> | ||||
|         <input | ||||
|           nz-input | ||||
|           type="text" | ||||
|           [(ngModel)]="userIdentityDetail.certificateNumber" | ||||
|           [readonly]="!isEditUser" | ||||
|           [nzBorderless]="!isEditUser" | ||||
|           [placeholder]="isEditUser ? '' : '-'" | ||||
|         /> | ||||
|         <input nz-input type="text" [(ngModel)]="userIdentityDetail.certificateNumber" [readonly]="!isEditUser" | ||||
|           [nzBorderless]="!isEditUser" [placeholder]="isEditUser ? '' : '-'" /> | ||||
|       </sv> | ||||
|       <sv label="身份证照" col="1"> | ||||
|         <div class="d-flex"> | ||||
|           <ng-container | ||||
|             *ngTemplateOutlet=" | ||||
|           <ng-container *ngTemplateOutlet=" | ||||
|               uploadTemplate; | ||||
|               context: { | ||||
|                 data: userIdentityDetail, | ||||
| @ -112,11 +82,9 @@ | ||||
|                 key2: 'certificatePhotoFront', | ||||
|                 hover: 'certificateBackFront' | ||||
|               } | ||||
|             " | ||||
|           > | ||||
|             "> | ||||
|           </ng-container> | ||||
|           <ng-container | ||||
|             *ngTemplateOutlet=" | ||||
|           <ng-container *ngTemplateOutlet=" | ||||
|               uploadTemplate; | ||||
|               context: { | ||||
|                 data: userIdentityDetail, | ||||
| @ -125,8 +93,7 @@ | ||||
|                 key2: 'certificatePhotoBack', | ||||
|                 hover: 'certificateBack' | ||||
|               } | ||||
|             " | ||||
|           > | ||||
|             "> | ||||
|           </ng-container> | ||||
|         </div> | ||||
|       </sv> | ||||
| @ -158,28 +125,16 @@ | ||||
| </ng-template> | ||||
|  | ||||
| <ng-template #uploadTemplate let-data="data" let-status="status" let-key="key" let-key2="key2" let-hover="hover"> | ||||
|   <nz-upload | ||||
|     class="avatar-uploader" | ||||
|     [nzAction]="uploadURl" | ||||
|     nzName="multipartFile" | ||||
|     nzListType="picture-card" | ||||
|     [nzShowUploadList]="false" | ||||
|     nzFileType="image/png,image/jpeg,image/jpg,image/gif" | ||||
|     [nzDisabled]="!status || disabledUpload" | ||||
|     (nzChange)="changeUpload($event, data, key, key2)" | ||||
|   > | ||||
|   <nz-upload class="avatar-uploader" [nzAction]="uploadURl" nzName="multipartFile" nzListType="picture-card" | ||||
|     [nzShowUploadList]="false" nzFileType="image/png,image/jpeg,image/jpg,image/gif" | ||||
|     [nzDisabled]="!status || disabledUpload" (nzChange)="changeUpload($event, data, key, key2)"> | ||||
|     <ng-container *ngIf="!data[key] && status"> | ||||
|       <i class="upload-icon" nz-icon [nzType]="service.http.loading ? 'loading' : 'plus'"></i> | ||||
|       <div class="ant-upload-text">上传</div> | ||||
|     </ng-container> | ||||
|     <div | ||||
|       *ngIf="data[key]" | ||||
|       (mouseover)="data[hover] = true" | ||||
|       (mouseleave)="data[hover] = false" | ||||
|       (click)="$event.cancelBubble = true" | ||||
|       class="image-hover" | ||||
|     > | ||||
|       <img [src]="data[key]" style="width: 200px; height: 160px" (click)="showImg(data[key])" /> | ||||
|     <div *ngIf="data[key]" (mouseover)="data[hover] = true" (mouseleave)="data[hover] = false" | ||||
|       (click)="$event.cancelBubble = true" class="image-hover"> | ||||
|       <img nz-image [nzSrc]="data[key]" style="width: 200px; height: 160px" /> | ||||
|       <div class="mask" *ngIf="data[hover] && status"></div> | ||||
|       <div class="mask-over" *ngIf="data[hover] && status"> | ||||
|         <i nz-icon nzType="close-circle" nzTheme="fill" class="delete-icon" (click)="deleteImg(data, key, key2)"></i> | ||||
| @ -189,4 +144,4 @@ | ||||
|       </div> | ||||
|     </div> | ||||
|   </nz-upload> | ||||
| </ng-template> | ||||
| </ng-template> | ||||
| @ -2,6 +2,7 @@ import { DatePipe } from '@angular/common'; | ||||
| import { Component, OnInit, ViewChild } from '@angular/core'; | ||||
| import { ActivatedRoute } from '@angular/router'; | ||||
| import { apiConf } from '@conf/api.conf'; | ||||
| import { NzImageService } from 'ng-zorro-antd/image'; | ||||
| import { NzModalService } from 'ng-zorro-antd/modal'; | ||||
| import { UsermanageService } from 'src/app/routes/usercenter/services/usercenter.service'; | ||||
| import { ImageViewComponent } from 'src/app/shared/components/imagelist'; | ||||
| @ -31,7 +32,8 @@ export class CaptainDetailComponent implements OnInit { | ||||
|     private nzModalService: NzModalService, | ||||
|     public service: UsermanageService, | ||||
|     private route: ActivatedRoute, | ||||
|     private datePipe: DatePipe | ||||
|     private datePipe: DatePipe, | ||||
|     private nzImageService: NzImageService | ||||
|   ) {} | ||||
|  | ||||
|   ngOnInit() { | ||||
| @ -192,7 +194,8 @@ export class CaptainDetailComponent implements OnInit { | ||||
|       imgList: [url], | ||||
|       index: 0 | ||||
|     }; | ||||
|     this.nzModalService.create({ nzContent: ImageViewComponent, nzComponentParams: { params } }); | ||||
|     this.nzImageService.preview([{ src: url }]); | ||||
|     // this.nzModalService.create({ nzContent: ImageViewComponent, nzComponentParams: { params } }); | ||||
|   } | ||||
|  | ||||
|   deleteImg(data: any, key: string, key2: string) { | ||||
|  | ||||
| @ -318,7 +318,7 @@ | ||||
|     </ng-container> | ||||
|     <div *ngIf="data[key]" (mouseover)="data[hover]=true" (mouseleave)="data[hover]=false" | ||||
|       (click)="$event.cancelBubble=true" class="image-hover"> | ||||
|       <img [src]="data[key]" style="width: 200px;height: 160px;" (click)="showImg(data[key])" /> | ||||
|       <img nz-image [nzSrc]="data[key]" style="width: 200px;height: 160px;"  /> | ||||
|       <div class="mask" *ngIf="data[hover] && status"></div> | ||||
|       <div class="mask-over" *ngIf="data[hover] && status"> | ||||
|         <i nz-icon nzType="close-circle" nzTheme="fill" class="delete-icon" (click)="deleteImg(data,key,key2)"></i> | ||||
|  | ||||
| @ -5,6 +5,7 @@ import { apiConf } from '@conf/api.conf'; | ||||
| import { STColumn, STComponent } from '@delon/abc/st'; | ||||
| import { SFComponent, SFDateWidgetSchema, SFSchema, SFTagWidgetSchema, SFTextWidgetSchema, SFUISchema } from '@delon/form'; | ||||
| import { ModalHelper, _HttpClient } from '@delon/theme'; | ||||
| import { NzImageService } from 'ng-zorro-antd/image'; | ||||
| import { NzMessageService } from 'ng-zorro-antd/message'; | ||||
| import { NzModalService } from 'ng-zorro-antd/modal'; | ||||
| import { ImageViewComponent } from 'src/app/shared/components/imagelist'; | ||||
| @ -65,7 +66,8 @@ export class UserCenterComponentsDriverDetailComponent implements OnInit { | ||||
|     private nzModalService: NzModalService, | ||||
|     public service: UsermanageService, | ||||
|     public route: ActivatedRoute, | ||||
|     private datePipe: DatePipe | ||||
|     private datePipe: DatePipe, | ||||
|     private nzImageService: NzImageService | ||||
|   ) {} | ||||
|  | ||||
|   ngOnInit() { | ||||
| @ -423,11 +425,7 @@ export class UserCenterComponentsDriverDetailComponent implements OnInit { | ||||
|   } | ||||
|  | ||||
|   showImg(url: any) { | ||||
|     const params = { | ||||
|       imgList: [url], | ||||
|       index: 0 | ||||
|     }; | ||||
|     this.nzModalService.create({ nzContent: ImageViewComponent, nzComponentParams: { params } }); | ||||
|     this.nzImageService.preview([{ src: url }]); | ||||
|   } | ||||
|  | ||||
|   deleteImg(data: any, key: string, key2: string) { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user