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) {
return axios.delete(`/api/rest/device/attachment/${id}`);
export function deleteDeviceAttachment(productId: string, id: string) {
return axios({
method: 'delete',
url: `/api/rest/device/attachment/${productId}`,
params: {
attachmentId: id,
},
});
}

View File

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

View File

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

View File

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