|
@@ -40,6 +40,7 @@ export class BuildingFloorComponent implements OnInit {
|
40
|
40
|
delFloorModal: boolean = false; //删除楼层,模态框是否显示
|
41
|
41
|
isDelSingle: boolean = false; //是否单个删除楼层
|
42
|
42
|
generateModal: boolean = false; //生成楼层的模态框
|
|
43
|
+ isAllDisplayDataChecked = false; //当前页是否全选
|
43
|
44
|
|
44
|
45
|
constructor(
|
45
|
46
|
private fb: FormBuilder,
|
|
@@ -125,6 +126,14 @@ export class BuildingFloorComponent implements OnInit {
|
125
|
126
|
// 选中列表中楼层
|
126
|
127
|
refreshStatus(): void {
|
127
|
128
|
let arr = [];
|
|
129
|
+ if (this.allFloorList.length) {
|
|
130
|
+ this.isAllDisplayDataChecked = this.allFloorList.every(
|
|
131
|
+ (item) => this.mapOfCheckedId[item.id]
|
|
132
|
+ );
|
|
133
|
+ } else {
|
|
134
|
+ this.isAllDisplayDataChecked = false;
|
|
135
|
+ }
|
|
136
|
+
|
128
|
137
|
for (var m in this.mapOfCheckedId) {
|
129
|
138
|
if (this.mapOfCheckedId[m]) {
|
130
|
139
|
arr.push({ id: m });
|
|
@@ -344,9 +353,8 @@ export class BuildingFloorComponent implements OnInit {
|
344
|
353
|
// 确认删除
|
345
|
354
|
confirmFloorDel() {
|
346
|
355
|
this.btnLoading = true;
|
347
|
|
- let postData = this.isDelSingle
|
348
|
|
- ? [this.floorDataEdit.id]
|
349
|
|
- : this.selectedFloor;
|
|
356
|
+ let selectedFloor = this.selectedFloor.map((item) => item.id);
|
|
357
|
+ let postData = this.isDelSingle ? [this.floorDataEdit.id] : selectedFloor;
|
350
|
358
|
this.mainService.delFloorList(postData).subscribe((result) => {
|
351
|
359
|
this.hideDelFloorModal();
|
352
|
360
|
this.btnLoading = false;
|
|
@@ -357,6 +365,14 @@ export class BuildingFloorComponent implements OnInit {
|
357
|
365
|
}
|
358
|
366
|
});
|
359
|
367
|
}
|
|
368
|
+ // 全选
|
|
369
|
+ checkAll(value: boolean): void {
|
|
370
|
+ console.log(this.allFloorList);
|
|
371
|
+ this.allFloorList.forEach((item) => {
|
|
372
|
+ this.mapOfCheckedId[item.id] = value;
|
|
373
|
+ });
|
|
374
|
+ this.refreshStatus();
|
|
375
|
+ }
|
360
|
376
|
|
361
|
377
|
// 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
|
362
|
378
|
showPromptModal(con, success, promptInfo) {
|