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