| | |
| | | try { |
| | | const groupId = row.id || row.groupId |
| | | if (row.enabled) { |
| | | await deviceGroupApi.enable({ groupId }) |
| | | await deviceGroupApi.enable(groupId) |
| | | ElMessage.success('设备组启用成功') |
| | | } else { |
| | | await deviceGroupApi.disable({ groupId }) |
| | | await deviceGroupApi.disable(groupId) |
| | | ElMessage.success('设备组禁用成功') |
| | | } |
| | | emit('refresh-statistics') |
| | |
| | | const batchEnable = async () => { |
| | | try { |
| | | const groupIds = selectedGroups.value.map(item => item.id || item.groupId) |
| | | await deviceGroupApi.batchEnable({ groupIds }) |
| | | await deviceGroupApi.batchEnable(groupIds) |
| | | ElMessage.success(`成功启用 ${groupIds.length} 个设备组`) |
| | | clearSelection() |
| | | loadGroupList() |
| | |
| | | const batchDisable = async () => { |
| | | try { |
| | | const groupIds = selectedGroups.value.map(item => item.id || item.groupId) |
| | | await deviceGroupApi.batchDisable({ groupIds }) |
| | | await deviceGroupApi.batchDisable(groupIds) |
| | | ElMessage.success(`成功禁用 ${groupIds.length} 个设备组`) |
| | | clearSelection() |
| | | loadGroupList() |