// 存放人员信息的实体
export class UserItem {
userId: string;
userName: string;
}
ngOnInit() {
this.activatedRoute.queryParams.subscribe(queryParams => {
this.selectPerson = queryParams.selectPerson;
});
console.log('加分----------', this.selectPerson);
for (let i = 0; i < this.selectPerson.length; i++) {
// 提取汉字姓名
const name = /[\u4e00-\u9fa5]/g;
const result = this.selectPerson[i].match(name).join('');
// 去掉汉字,留有id
const id = this.selectPerson[i].replace(name, '');
const ts = new UserItem();
ts.userName = result;
ts.userId = id;
this.users.push(ts);
}
}