update:每个项目限报一个

This commit is contained in:
ltx 2026-04-15 13:23:23 +08:00
parent a3dd704d29
commit d2f7d8d507

View File

@ -467,12 +467,13 @@ Page({
}
}
// 同一项目只能选一个组别:点选时取消该项目下其他组别;再次点击已选项则取消
const nextProjectGroups = this.data.projectGroups.map((p) => {
if (p.projectId !== projectId) return p;
return {
...p,
groups: p.groups.map((g) => {
if (g.groupId !== groupId) return g;
if (g.groupId !== groupId) return { ...g, selected: false };
return { ...g, selected: !g.selected };
})
};