新增重推设备信息
This commit is contained in:
parent
ee10c142a6
commit
789a16e958
@ -21,6 +21,7 @@ import {
|
||||
postAggregationDeviceBatchCreateAsync,
|
||||
postAggregationDeviceCreateAsync,
|
||||
postAggregationDeviceDeleteAsync,
|
||||
postAggregationDeviceRepushDeviceInfoToIoTplatform,
|
||||
postDeviceInfoCacheDeviceDataToRedis,
|
||||
postDeviceInfoPage,
|
||||
} from '#/api-client';
|
||||
@ -82,6 +83,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ formOptions, gridOptions });
|
||||
const editRow: Record<string, any> = ref({});
|
||||
const cacheRefreshLoading = ref(false);
|
||||
const pageLoading = ref(false);
|
||||
const loadingTip = ref('缓存刷新中...');
|
||||
const commandRow: Record<string, any> = ref({});
|
||||
const [UserModal, userModalApi] = useVbenModal({
|
||||
draggable: true,
|
||||
@ -337,6 +339,28 @@ const toTelemetryLog = (row: Record<string, any>) => {
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
// 重推设备信息到IoT平台
|
||||
const repushDeviceInfo = async (row: Record<string, any>) => {
|
||||
try {
|
||||
pageLoading.value = true;
|
||||
loadingTip.value = '重推设备信息中...';
|
||||
const result = await postAggregationDeviceRepushDeviceInfoToIoTplatform({
|
||||
body: { id: row.id },
|
||||
});
|
||||
if (result.data) {
|
||||
Message.success('重推设备信息成功');
|
||||
gridApi.reload();
|
||||
} else {
|
||||
Message.error('重推设备信息失败');
|
||||
}
|
||||
} catch (error) {
|
||||
Message.error('重推设备信息失败');
|
||||
} finally {
|
||||
pageLoading.value = false;
|
||||
loadingTip.value = '缓存刷新中...';
|
||||
}
|
||||
};
|
||||
const openAddModal = async () => {
|
||||
editRow.value = {};
|
||||
userModalApi.open();
|
||||
@ -494,6 +518,7 @@ const handleCacheRefresh = async () => {
|
||||
try {
|
||||
cacheRefreshLoading.value = true;
|
||||
pageLoading.value = true;
|
||||
loadingTip.value = '缓存刷新中...';
|
||||
const result = await postDeviceInfoCacheDeviceDataToRedis();
|
||||
if (result.data) {
|
||||
Message.success('缓存刷新成功');
|
||||
@ -507,6 +532,7 @@ const handleCacheRefresh = async () => {
|
||||
} finally {
|
||||
cacheRefreshLoading.value = false;
|
||||
pageLoading.value = false;
|
||||
loadingTip.value = '缓存刷新中...';
|
||||
}
|
||||
};
|
||||
|
||||
@ -546,7 +572,7 @@ const toolbarActions = computed(() => [
|
||||
|
||||
<template>
|
||||
<Page auto-content-height>
|
||||
<Loading :loading="pageLoading" tip="缓存刷新中..." />
|
||||
<Loading :loading="pageLoading" :tip="loadingTip" />
|
||||
<Grid>
|
||||
<template #toolbar-actions>
|
||||
<TableAction :actions="toolbarActions" />
|
||||
@ -618,6 +644,10 @@ const toolbarActions = computed(() => [
|
||||
style="padding: 4px 8px; text-align: left">
|
||||
{{ $t('abp.IoTDBBase.TelemetryLog') }}
|
||||
</Button>
|
||||
<Button type="text" size="small" @click="repushDeviceInfo.bind(null, row)()"
|
||||
style="padding: 4px 8px; text-align: left">
|
||||
重推设备信息
|
||||
</Button>
|
||||
<Button type="text" size="small" @click="onDel.bind(null, row)()"
|
||||
style="padding: 4px 8px; color: #ff4d4f; text-align: left">
|
||||
{{ $t('common.delete') }}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user