From 6c08ed1e18b0965a1135fb6439d0f1f1c23e4ca7 Mon Sep 17 00:00:00 2001 From: hwj Date: Thu, 22 Jan 2026 15:31:40 +0800 Subject: [PATCH] =?UTF-8?q?style=EF=BC=9A=E9=87=87=E9=9B=86=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=A8=A1=E5=9E=8B-ALARM=E6=A0=87=E8=AF=86=E7=AC=A6?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=B7=BB=E5=8A=A0=E5=88=A0=E9=99=A4=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/iot/devicemodel/index.vue | 30 +++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/views/iot/devicemodel/index.vue b/src/views/iot/devicemodel/index.vue index 802f898f..68ded9fe 100644 --- a/src/views/iot/devicemodel/index.vue +++ b/src/views/iot/devicemodel/index.vue @@ -167,11 +167,19 @@ link type="primary" @click="openForm('update', scope.row.id)" - + @@ -645,7 +653,15 @@ const openCreateRuleForm = () => { createRuleDialogVisible.value = true } -const openRuleForm = (row: DeviceModelRuleVO & { pointRulesVOList?: any[] }) => { +const openRuleForm = async (row: DeviceModelRuleVO & { pointRulesVOList?: any[] }) => { + const modelId = row.modelId || attributeModelId.value + if (!modelId) { + message.error('模型信息缺失,无法加载点位规则') + return + } + + await loadRuleAttributeOptions(modelId) + ruleForm.id = row.id ruleForm.identifier = row.identifier ruleForm.fieldName = row.fieldName @@ -726,6 +742,16 @@ const handleRuleSubmit = async () => { } } +const handleRuleDelete = async (id: number) => { + if (!id) return + try { + await message.delConfirm() + await request.delete({ url: '/iot/device-model-rules/delete?id=' + id }) + message.success(t('common.delSuccess')) + await getRuleList() + } catch { } +} + const handleAddPointRule = () => { if (!isRunningIdentifier.value) return const allOptions = currentRuleOptions.value || []