fix: bug#10743 修复远程升级选择设备多选取消问题

This commit is contained in:
jackhoo_98 2023-03-23 16:37:39 +08:00
parent a4b79f2b8f
commit a511dd5972
1 changed files with 7 additions and 5 deletions

View File

@ -38,8 +38,8 @@
selectedRowKeys: _selectedRowKeys, selectedRowKeys: _selectedRowKeys,
onSelect: onSelectChange, onSelect: onSelectChange,
onSelectAll: onSelectAllChange, onSelectAll: onSelectAllChange,
onChange: onChange,
}" }"
@cancelSelect="cancelSelect"
:params="params" :params="params"
> >
<template #headerTitle> <template #headerTitle>
@ -125,7 +125,7 @@ const defaultParams = {
}; };
const statusMap = new Map(); const statusMap = new Map();
statusMap.set('online', 'success'); statusMap.set('online', 'processing');
statusMap.set('offline', 'error'); statusMap.set('offline', 'error');
statusMap.set('notActive', 'warning'); statusMap.set('notActive', 'warning');
@ -223,8 +223,10 @@ const getSelectedRowsKey = (selectedRows: T[]) =>
const getSetRowKey = (selectedRows: T[]) => const getSetRowKey = (selectedRows: T[]) =>
new Set([..._selectedRowKeys.value, ...getSelectedRowsKey(selectedRows)]); new Set([..._selectedRowKeys.value, ...getSelectedRowsKey(selectedRows)]);
const cancelSelect = () => { const onChange = (selectedRowKeys: T[]) => {
_selectedRowKeys.value = []; if (selectedRowKeys.length === 0) {
_selectedRowKeys.value = [];
}
}; };
const handleOk = () => { const handleOk = () => {
@ -249,7 +251,7 @@ const onVisible = () => {
const handleCancel = () => { const handleCancel = () => {
visible.value = false; visible.value = false;
cancelSelect(); _selectedRowKeys.value = [];
}; };
onMounted(() => { onMounted(() => {