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