<div class="regional_body">
<div class="regional_left">
<div class="jurisdiction_list">
<div class="jurisdiction_name">单位管辖列表(29)</div>
<div class="list_add add" (click)='newDuty()'>
<img src="assets/highway/imgs/sq-btnIcon-add.png" alt="">
<span>新增</span>
</div>
</div>
<div class="grid">
<nz-table class="zt-main-table" [nzData]="tableData.datas" [nzLoading]="false" [nzFrontPagination]="false"
[nzShowPagination]="false">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th style="width: 210px;"></th>
</tr>
</thead>
<tbody>
<!-- 新增 -->
<tr *ngIf="editDutyItem && !editDutyItem.pkid">
<td>
<ng-container>
<input type="text" nz-input [(ngModel)]="editDutyItem.deptName" />
</ng-container>
</td>
<td>
<nz-select [(ngModel)]="editDutyItem.deptType" [nzShowSearch]="true" [nzAllowClear]="false"
nzPlaceHolder="请选择">
<nz-option [nzValue]="''" [nzLabel]="'全部'"></nz-option>
<nz-option [nzValue]="item.pkid" [nzLabel]="item.licensePlateNum" *ngFor="let item of policeCars">
</nz-option>
</nz-select>
</td>
<td class="action">
<ng-container>
<button nz-button nzType="default" [nzSize]="'small'" (click)="cancelEdit()">取消</button>
<button nz-button nzType="primary" [nzSize]="'small'" (click)="saveRecord()">保存</button>
</ng-container>
</td>
</tr>
<tr *ngFor="let data of tableData.datas" (click)="selectedRecord = data">
<!-- 展示 -->
<ng-container *ngIf="!(editDutyItem && editDutyItem.pkid == data.pkid)">
<td>{{data.deptName}}</td>
<td>{{data.deptTypeName}}</td>
<td>
<div class="action">
<img src="assets/highway/imgs/sq-btnTable-edit.png" (click)="startEdit(data, $event)"/>
<img src="assets/highway/imgs/sq-btnTable-delete.png" (click)="deleteDuty(data.pkid, $event)"/>
</div>
</td>
</ng-container>
<!-- 修改 -->
<ng-container *ngIf="editDutyItem && editDutyItem.pkid == data.pkid">
<td>
<ng-container>
<input type="text" nz-input [(ngModel)]="editDutyItem.deptName" />
</ng-container>
</td>
<td>
<nz-select [(ngModel)]="editDutyItem.deptType" [nzShowSearch]="true" [nzAllowClear]="false"
nzPlaceHolder="请选择">
<nz-option [nzValue]="''" [nzLabel]="'全部'"></nz-option>
<nz-option [nzValue]="item.pkid" [nzLabel]="item.licensePlateNum" *ngFor="let item of policeCars">
</nz-option>
</nz-select>
</td>
<td class="action" >
<ng-container>
<button nz-button nzType="primary" [nzSize]="'small'" (click)="sureEditData()">保存</button>
<button nz-button nzType="default" [nzSize]="'small'" (click)="cancelEdit()">取消</button>
</ng-container>
</td>
</ng-container>
</tr>
</tbody>
</nz-table>
</div>
</div>
<div class="regional_right">
<div class="map" id="map"></div>
</div>
</div>
angular中修改表格单条信息
最新推荐文章于 2024-01-22 15:14:57 发布