@@ -320,20 +320,72 @@ export class NoteComponent implements OnInit, AfterViewInit {
320
320
this . toast . info ( '请勾选一行' , 1500 ) ;
321
321
return false ;
322
322
}
323
- this . modal . alert ( '删除' , '确定要删除么' , [
324
- { text : '取消' , onPress : ( ) => { } } ,
325
- {
326
- text : '删除' ,
327
- onPress : ( ) =>
328
- new Promise ( resolve => {
323
+ // this.modal.alert('删除', '确定要删除么', [
324
+ // { text: '取消', onPress: () => { } },
325
+ // {
326
+ // text: '删除',
327
+ // onPress: () =>
328
+ // new Promise(resolve => {
329
+ // if (this.isHidden) {
330
+ // this.accountBook.cars[this.activeTabIndex].datas.forEach((data, i) => {
331
+ // if (this.setOfCheckedId.has(data.id)) {
332
+ // const data = cloneDeep(this.accountBook.cars[this.activeTabIndex].datas);
333
+ // data.splice(i, 1);
334
+ // this.accountBook.cars[this.activeTabIndex].datas = data;
335
+ // this.save(true);
336
+ // resolve(true);
337
+ // }
338
+ // })
339
+ // } else if (this.activeTabIndex === this.accountBook.cars.length) {
340
+
341
+ // this.accountBook.outCars.forEach((car, i) => {
342
+ // if (this.setOfCheckedId.has(car.id)) {
343
+ // const data = cloneDeep(this.accountBook.outCars);
344
+ // data.splice(i, 1);
345
+ // this.accountBook.outCars = data;
346
+ // this.save(true);
347
+ // resolve(true);
348
+ // }
349
+ // })
350
+ // } else {
351
+ // this.accountBook.guozhaCars.forEach((car, i) => {
352
+ // if (this.setOfCheckedId.has(car.id)) {
353
+ // const data = cloneDeep(this.accountBook.guozhaCars);
354
+ // data.splice(i, 1);
355
+ // this.accountBook.guozhaCars = data;
356
+ // this.save(true);
357
+ // resolve(true);
358
+ // }
359
+ // })
360
+ // }
361
+
362
+ // }),
363
+ // style: {
364
+ // color: '#ffffff',
365
+ // background: '#e94f4f'
366
+ // }
367
+ // }
368
+ // ]);
369
+
370
+ this . alertCtrl . create ( {
371
+ header : '删除' ,
372
+ message :'确定要删除么' ,
373
+ buttons : [
374
+ {
375
+ text :'取消' ,
376
+ role : 'cancel' ,
377
+ } ,
378
+ {
379
+ text :'删除' ,
380
+ cssClass : 'delete' ,
381
+ handler : ( ) => {
329
382
if ( this . isHidden ) {
330
383
this . accountBook . cars [ this . activeTabIndex ] . datas . forEach ( ( data , i ) => {
331
384
if ( this . setOfCheckedId . has ( data . id ) ) {
332
385
const data = cloneDeep ( this . accountBook . cars [ this . activeTabIndex ] . datas ) ;
333
386
data . splice ( i , 1 ) ;
334
387
this . accountBook . cars [ this . activeTabIndex ] . datas = data ;
335
388
this . save ( true ) ;
336
- resolve ( true ) ;
337
389
}
338
390
} )
339
391
} else if ( this . activeTabIndex === this . accountBook . cars . length ) {
@@ -344,7 +396,6 @@ export class NoteComponent implements OnInit, AfterViewInit {
344
396
data . splice ( i , 1 ) ;
345
397
this . accountBook . outCars = data ;
346
398
this . save ( true ) ;
347
- resolve ( true ) ;
348
399
}
349
400
} )
350
401
} else {
@@ -354,18 +405,13 @@ export class NoteComponent implements OnInit, AfterViewInit {
354
405
data . splice ( i , 1 ) ;
355
406
this . accountBook . guozhaCars = data ;
356
407
this . save ( true ) ;
357
- resolve ( true ) ;
358
408
}
359
409
} )
360
410
}
361
-
362
- } ) ,
363
- style : {
364
- color : '#ffffff' ,
365
- background : '#e94f4f'
411
+ }
366
412
}
367
- }
368
- ] ) ;
413
+ ]
414
+ } )
369
415
}
370
416
/**
371
417
* 添加车辆弹出框
0 commit comments