From 78564dda3d917be43714dc3389e477737d084b48 Mon Sep 17 00:00:00 2001 From: Kven <2955163637@qq.com> Date: Thu, 17 Apr 2025 22:14:11 +0800 Subject: [PATCH] =?UTF-8?q?refactor(iot):=20=E6=9B=B4=E6=96=B0=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=95=B0=E6=8D=AE=E5=B1=95=E7=A4=BA=E5=92=8C=E5=91=8A?= =?UTF-8?q?=E8=AD=A6=E4=BF=A1=E6=81=AF=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改内容发布来源组件,将告警类型更改为设备情况,调整数据展示内容 - 更新数据面板组件,使用设备信息替代告警信息 - 重构删除设备附件接口,增加产品 ID 参数 - 优化产品编辑界面的附件删除逻辑 --- src/api/product.ts | 10 ++++++++-- .../components/content-publishing-source.vue | 19 ++++++------------- .../workplace/components/data-panel.vue | 4 ++-- .../iot/product/components/product-edit.vue | 2 +- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/api/product.ts b/src/api/product.ts index 8261e21..83297da 100644 --- a/src/api/product.ts +++ b/src/api/product.ts @@ -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, + }, + }); } \ No newline at end of file diff --git a/src/views/dashboard/workplace/components/content-publishing-source.vue b/src/views/dashboard/workplace/components/content-publishing-source.vue index f1f7c1d..08c7b82 100644 --- a/src/views/dashboard/workplace/components/content-publishing-source.vue +++ b/src/views/dashboard/workplace/components/content-publishing-source.vue @@ -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', - }, - } ], }, ], diff --git a/src/views/dashboard/workplace/components/data-panel.vue b/src/views/dashboard/workplace/components/data-panel.vue index 6e21d73..36e9f74 100644 --- a/src/views/dashboard/workplace/components/data-panel.vue +++ b/src/views/dashboard/workplace/components/data-panel.vue @@ -77,7 +77,7 @@ @@ -156,7 +156,7 @@ }]; const alarmData = [{ label: '今日新增', - value: props.alarmInfo.todayWarningCount, + value: props.deviceInfo.todayWarningCount, }]; diff --git a/src/views/iot/product/components/product-edit.vue b/src/views/iot/product/components/product-edit.vue index 7c52037..36d944d 100644 --- a/src/views/iot/product/components/product-edit.vue +++ b/src/views/iot/product/components/product-edit.vue @@ -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('删除成功');