| | |
| | | <span>{{ scope.row.nickName }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="id" label="操作" min-width="120" align="center"> |
| | | <el-table-column prop="userId" label="操作" min-width="120" align="center"> |
| | | <template slot-scope="scope"> |
| | | <!-- <el-radio v-model="selectedPersonnelId" :label="scope.row.nickName"></el-radio> --> |
| | | <el-checkbox :value="selectedPersonnelId ==scope.row.id"></el-checkbox> |
| | | <el-checkbox :value="selectedPersonnelId ==scope.row.userId"></el-checkbox> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column prop="id" label="人员ID" min-width="120" align="center"> |
| | |
| | | type: Array, |
| | | default: () => [], |
| | | validator: (value) => { |
| | | return value.every(item => item.id && item.nickName) |
| | | return value.every(item => item.userId && item.nickName) |
| | | } |
| | | }, |
| | | }, |
| | |
| | | // 当点击表格行时,设置为选中状态 |
| | | this.$refs.personnelTable.clearSelection(); |
| | | this.$refs.personnelTable.toggleRowSelection(row); |
| | | this.selectedPersonnelId = row.id; |
| | | console.log('111111111111111',row) |
| | | this.selectedPersonnelId = row.userId; |
| | | }, |
| | | getPersonnelRowClassName({ row }) { |
| | | // 根据是否选中来设置行样式 |
| | | return row.id === this.selectedPersonnelId ? 'selected-personnel' : ''; |
| | | return row.userId === this.selectedPersonnelId ? 'selected-personnel' : ''; |
| | | }, |
| | | handleSelectionChange(selection) { |
| | | // 当radio选择改变时,更新选中的人员 |
| | | if (selection && selection.id) { |
| | | this.selectedPersonnelId = selection.id; |
| | | if (selection && selection.userId) { |
| | | this.selectedPersonnelId = selection.userId; |
| | | } else { |
| | | this.selectedPersonnelId = null; |
| | | } |
| | |
| | | |
| | | this.$emit("confirm", { |
| | | personnelId: this.selectedPersonnelId, |
| | | personnelName: this.personnelList.find(p => p.id === this.selectedPersonnelId)?.name || '', |
| | | personnelName: this.personnelList.find(p => p.userId === this.selectedPersonnelId)?.name || '', |
| | | imgSrc: this.imgSrc |
| | | }); |
| | | this.handleClose(); |