| | |
| | | setSelection(selected) { |
| | | this.selectData = selected |
| | | this.$nextTick(() => { |
| | | // 设置新选中 |
| | | this.tableData.forEach(row => { |
| | | if (selected.some(i => i.userId === row.userId)) { |
| | | this.$refs.memberTable.toggleRowSelection(row, true) |
| | | } |
| | | }) |
| | | // 确保 tableData 和 memberTable 都存在 |
| | | if (this.tableData && this.$refs.memberTable) { |
| | | this.tableData.forEach(row => { |
| | | if (selected.some(i => i.userId === row.userId)) { |
| | | this.$refs.memberTable.toggleRowSelection(row, true) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | openDialog() { |
| | |
| | | async searchUserList(roleId) { |
| | | this.roleId = roleId |
| | | // 根据是否有项目组ID来决定调用不同的接口 |
| | | const params = { |
| | | let params = { |
| | | roleIds: roleId ? [roleId] : [], |
| | | nickNameOrPhone: this.searchName, |
| | | pageSize: 9999, |
| | |
| | | }; |
| | | |
| | | if (this.projectId) { |
| | | params.projectId = this.projectId; |
| | | params={ |
| | | ...params, |
| | | roleId: roleId?roleId:'', |
| | | projectId: this.projectId |
| | | } |
| | | delete params.roleIds; |
| | | // TODO: 这里需要替换为新的接口调用 |
| | | const res = await listByRole(params); |
| | | this.tableData = res.records; |
| | | this.tableData = res; |
| | | } else { |
| | | const res = await getUserList(params); |
| | | this.tableData = res.records; |