Bug:参演角色重复问题修复

This commit is contained in:
fan 2023-02-17 10:36:22 +08:00
parent f38fb8891a
commit 73514ebc1f

View File

@ -468,6 +468,7 @@ export default {
this.addPlayerIdList(val); this.addPlayerIdList(val);
}, },
addPlayerIdList(playId) { addPlayerIdList(playId) {
console.log(this.playerIdList.includes(playId), this.playerIdList, playId);
if (!this.playerIdList.includes(playId)) { if (!this.playerIdList.includes(playId)) {
this.playerIdList.push(playId); this.playerIdList.push(playId);
} }
@ -476,7 +477,7 @@ export default {
checkPlayerIdHas() { checkPlayerIdHas() {
const list = []; const list = [];
this.tableData.forEach(elem => { this.tableData.forEach(elem => {
if (this.playerIdList.includes(elem.memberId)) { if (this.playerIdList.includes(elem.memberId) && !list.includes(elem.memberId)) {
list.push(elem.memberId); list.push(elem.memberId);
} }
}); });