This commit is contained in:
Taric Xin
2022-02-24 20:22:42 +08:00
11 changed files with 251 additions and 76 deletions

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-01-25 20:18:52
* @LastEditors : Shiming
* @LastEditTime : 2022-02-14 10:14:19
* @LastEditTime : 2022-02-24 19:31:19
* @FilePath : \\tms-obc-web\\src\\app\\shared\\components\\insurance-table\\insurance-table.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
@ -28,7 +28,7 @@
</div>
<nz-table #groupingTable [nzData]="data" nzBordered nzSize="small" [nzFrontPagination]="false"
[nzScroll]="{ x: '1200px' }" [nzShowPagination]="false" class="ml-xl" style="max-width: 1100px;">
[nzScroll]="{ x: '900px' }" [nzShowPagination]="false" class="ml-xl" style="max-width: 1200px;">
<thead>
<tr>
<th rowspan="2" nzWidth="250px" nzAlign="center" nzLeft>险种</th>
@ -50,7 +50,7 @@
<label>-</label>
<nz-input-number [ngModel]="item.endKm" (ngModelChange)="changeEndKm($event,i)" [nzMin]="0"
[nzFormatter]="formatterDollar" nzSize="small">
</nz-input-number>
</nz-input-number>(含)
</div>
</div>
@ -70,7 +70,7 @@
</div>
</td>
<td nzWidth="60px" nzAlign="center" nzRight>
<a *ngIf="i === groupingTable.data.length-1 && groupingTable.data.length>2"
<a *ngIf="i === groupingTable.data.length-1 && groupingTable.data.length>1"
nz-popconfirm
nzPopconfirmTitle="是否确认删除?" (nzOnConfirm)="deleteRow(i)"
>删除</a>

View File

@ -18,7 +18,7 @@ export class InsuranceTableComponent implements OnInit {
schema: SFSchema = {};
ui!: SFUISchema;
formatterDollar = (value: number): string => `${value} (含)`;
formatterDollar = (value: number): string => `${value}`;
minInsurancePrice: number = 0;
changeSub = new Subject<string>();
constructor(public service: BaseService, private cdr: ChangeDetectorRef) {}
@ -64,7 +64,7 @@ export class InsuranceTableComponent implements OnInit {
};
this.ui = {
'*': {
spanLabelFixed: 140,
spanLabelFixed: 160,
grid: { span: 24 }
},
$freightPrice: {
@ -141,12 +141,11 @@ export class InsuranceTableComponent implements OnInit {
deleteRow(index: number) {
console.log(index);
this.data = this.data.filter((d, i) => {
console.log(d);
console.log(i);
index !== i;
});
console.log(this.data);
var newArr = this.data.concat();
newArr.splice(this.data.length-1,1)
// this.data = this.data.pop()
console.log(newArr);
this.data = [...newArr];
}
save() {