refactor(iot): 更新设备数据展示和告警信息统计

- 修改内容发布来源组件,将告警类型更改为设备情况,调整数据展示内容
- 更新数据面板组件,使用设备信息替代告警信息
- 重构删除设备附件接口,增加产品 ID 参数
- 优化产品编辑界面的附件删除逻辑
This commit is contained in:
Kven 2025-04-17 22:14:11 +08:00
parent 7c79c67c44
commit 78564dda3d
4 changed files with 17 additions and 18 deletions

View File

@ -81,6 +81,12 @@ export function addAttachments(data: any) {
// 删除设备预览图或图标 // 删除设备预览图或图标
export function deleteDeviceAttachment(id: string) { export function deleteDeviceAttachment(productId: string, id: string) {
return axios.delete(`/api/rest/device/attachment/${id}`); return axios({
method: 'delete',
url: `/api/rest/device/attachment/${productId}`,
params: {
attachmentId: id,
},
});
} }

View File

@ -329,7 +329,7 @@
return { return {
legend: { legend: {
left: 'center', left: 'center',
data: ['注意', '告警', '严重'], data: ['上报数', '下发数'],
bottom: 0, bottom: 0,
icon: 'circle', icon: 'circle',
itemWidth: 8, itemWidth: 8,
@ -351,7 +351,7 @@
left: 'center', left: 'center',
top: 'center', top: 'center',
style: { style: {
text: '告警类型', text: '设备情况',
...graphicElementStyle, ...graphicElementStyle,
}, },
} }
@ -372,26 +372,19 @@
}, },
data: [ data: [
{ {
value: props.alarmInfo.firstWarningCount, value: props.alarmInfo.recordCount,
name: '注意', name: '上报数',
itemStyle: { itemStyle: {
color: '#249EFF', color: '#249EFF',
}, },
}, },
{ {
value: props.alarmInfo.secondWarningCount, value: props.alarmInfo.dataCount,
name: '告警', name: '下发数',
itemStyle: { itemStyle: {
color: '#846BCE', color: '#846BCE',
}, },
}, },
{
value: props.alarmInfo.thirdWarningCount,
name: '严重',
itemStyle: {
color: '#ff2121',
},
}
], ],
}, },
], ],

View File

@ -77,7 +77,7 @@
<a-statistic <a-statistic
title="告警数" title="告警数"
value-style="font-size:36px" value-style="font-size:36px"
:value="props.alarmInfo.warningCount" :value="props.deviceInfo.warningCount"
:value-from="0" :value-from="0"
animation animation
> >
@ -156,7 +156,7 @@
}]; }];
const alarmData = [{ const alarmData = [{
label: '今日新增', label: '今日新增',
value: props.alarmInfo.todayWarningCount, value: props.deviceInfo.todayWarningCount,
}]; }];
</script> </script>

View File

@ -304,7 +304,7 @@
Message.error('无法获取图片 ID'); Message.error('无法获取图片 ID');
} }
// //
const res = await deleteDeviceAttachment(fileId); const res = await deleteDeviceAttachment(formData.value.id,fileId);
if (res.data === true) { if (res.data === true) {
// //
Message.success('删除成功'); Message.success('删除成功');