Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import {Component} from '@angular/core';
import {AppGlobal, AppService} from "../../service/http.service";
import {NavController, NavParams, ViewController} from "ionic-angular";
@Component({
selector: 'person-mul',
templateUrl: 'person-mul.html'
})
export class PersonMulComponent {
picture: string = AppGlobal.picture;
perList;
name = '';
chooseList = [];
constructor(public navCtrl: NavController, public navParams: NavParams,
public appService: AppService, public viewCtrl: ViewController) {
}
ionViewDidLoad() {
this.getList();
}
getList() {
const data = {
name: this.name,
pageNumber: 1,
pageSize: 300,
};
this.appService.ObserverHttpNoForm('/wisdomgroup/app/getUserByName', data)
.subscribe((res) => {
this.perList = res.json().list;
this.perList.forEach(e => {
e.checkbox = false;
})
})
}
changeCheck(event,item) {
if(event == true){
this.chooseList.push(item);
}else{
let n;
this.chooseList.forEach((e,index)=>{
if(e.id == item.id){
n = index;
}
});
this.chooseList.splice(n,1);
}
console.log(this.chooseList);
}
dismiss() {
this.viewCtrl.dismiss(this.chooseList);
}
cancel(){
this.viewCtrl.dismiss();
}
}