selectedUserInfo: [],
changeUserName(val) {
if (val.length > this.selectedUserInfo.length) {
val.forEach((i) => {
const item = this.options.filter((j) => i === j.value)[0];
if (item) {
this.selectedUserInfo.push(item);
const hash = {};
this.selectedUserInfo = this.selectedUserInfo.reduce((preVal, curVal) => {
hash[curVal.id] ? ' ' : hash[curVal.id] = true && preVal.push(curVal);
return preVal;
}, []);
}
});
} else {
const arr = [];
val.forEach((i) => {
this.selectedUserInfo.forEach((j) => {
if (i === j.mis) {
arr.push(j);
}
});
});
this.selectedUserInfo = arr;
}
this.$emit('changeUser', this.selectedUserInfo);
},