fix:Ap设备界面设备重启
This commit is contained in:
@@ -228,7 +228,7 @@ import { useTable } from '@/hooks/common/table';
|
||||
import { SimpleScrollbar } from '~/packages/materials/src';
|
||||
import { computed, shallowRef } from 'vue';
|
||||
import { useElementSize } from '@vueuse/core';
|
||||
import { fetchApDeviceList,forgetApDevice, addApDevice, adoptApDevice } from '@/service/api/auth';
|
||||
import { fetchApDeviceList,forgetApDevice, addApDevice, adoptApDevice, rebootApDevice } from '@/service/api/auth';
|
||||
import {Card as ACard, Table as ATable, Tag as ATag, Modal, message } from 'ant-design-vue';
|
||||
import DeviceSearch from './modules/device-search.vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
@@ -303,7 +303,6 @@ const {
|
||||
}
|
||||
};
|
||||
} catch (error) {
|
||||
console.error('API Error:', error);
|
||||
return {
|
||||
data: {
|
||||
rows: [],
|
||||
@@ -448,13 +447,20 @@ const handleForgetDevice = (record: Api.Device.ApDevice) => {
|
||||
};
|
||||
|
||||
const handleRestart = (record: Api.Device.ApDevice) => {
|
||||
// 处理重启设备
|
||||
Modal.confirm({
|
||||
title: t('common.confirm'),
|
||||
content: t('page.apdevice.restartConfirm'),
|
||||
title: t('page.apdevice.confirmReboot'),
|
||||
content: t('page.apdevice.rebootConfirmContent', { name: record.name || record.mac }),
|
||||
okText: t('common.confirm'),
|
||||
cancelText: t('common.cancel'),
|
||||
onOk: async () => {
|
||||
// 调用重启设备 API
|
||||
console.log('Restart device:', record);
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
const { error } = await rebootApDevice(selectedSiteId.value, record.mac);
|
||||
hide();
|
||||
|
||||
if (!error) {
|
||||
message.success(t('page.apdevice.rebootSuccess'));
|
||||
getData(); // 刷新列表
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user