摄像头最多选10个
This commit is contained in:
parent
0f6b37e52e
commit
120f753db2
|
@ -402,8 +402,12 @@
|
|||
const onSelectChange = (record, selected, selectedRows, nativeEvent) => {
|
||||
console.log('hahhahah', record, selected, selectedRows, nativeEvent)
|
||||
if (selected) {
|
||||
selectedList.value.push(record)
|
||||
selectedRowKeys.value.push(record.channelCode)
|
||||
if (selectedRowKeys.value.length == 10) {
|
||||
message.warning('最多只能添加10个摄像头!')
|
||||
} else {
|
||||
selectedList.value.push(record)
|
||||
selectedRowKeys.value.push(record.channelCode)
|
||||
}
|
||||
} else {
|
||||
selectedList.value = selectedList.value.filter(
|
||||
(item) => item.idtCameraChannel !== record.idtCameraChannel
|
||||
|
@ -423,6 +427,18 @@
|
|||
selectedList.value.push(val)
|
||||
selectedRowKeys.value.push(val.channelCode)
|
||||
})
|
||||
if (selectedRowKeys.value.length > 10) {
|
||||
message.warning('最多只能添加10个摄像头!')
|
||||
changeRows.map((val) => {
|
||||
selectedList.value = selectedList.value.filter(
|
||||
(item) => item.idtCameraChannel !== val.idtCameraChannel
|
||||
)
|
||||
selectedRowKeys.value.splice(
|
||||
selectedRowKeys.value.indexOf(val.channelCode),
|
||||
1
|
||||
)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
changeRows.map((val) => {
|
||||
selectedList.value = selectedList.value.filter(
|
||||
|
|
Loading…
Reference in New Issue