From 36713c0edc1f42e715107c2c7eecd8cc6e7685c4 Mon Sep 17 00:00:00 2001 From: limengnan <420004014@qq.com> Date: Tue, 2 Jun 2026 15:07:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E8=AE=BE=E7=BD=AE=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=88=A0=E9=99=A4=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../algorithmModel/index.vue | 1 - .../views/component/scenario/condition.vue | 36 +++++++++++++++---- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/business-css/frontend/src/views/business/algorithmManagement/algorithmModel/index.vue b/business-css/frontend/src/views/business/algorithmManagement/algorithmModel/index.vue index d25c126..1027c07 100644 --- a/business-css/frontend/src/views/business/algorithmManagement/algorithmModel/index.vue +++ b/business-css/frontend/src/views/business/algorithmManagement/algorithmModel/index.vue @@ -391,7 +391,6 @@ function changeShowResult(isShow:boolean){ // 切换显示结果模型 - diff --git a/business-css/frontend/src/views/component/scenario/condition.vue b/business-css/frontend/src/views/component/scenario/condition.vue index 8caffa8..36a9059 100644 --- a/business-css/frontend/src/views/component/scenario/condition.vue +++ b/business-css/frontend/src/views/component/scenario/condition.vue @@ -11,7 +11,7 @@ import Page from '@/components/Pagination/page.vue' import { getDictItemById } from '@/api/dict'; import { topologyDevicesLsit } from '@/api/business/project'; import { getToken } from '@/utils/auth'; -import { searchEventsByScenarioId } from '@/api/business/event'; +import { searchEventsByScenarioId, deleteEvents } from '@/api/business/event'; import { sizeSchemaAll } from "@/api/business/database/device"; const url = import.meta.env.VITE_APP_BASE_API; const conditionData:any = ref([{ // 套件数据 @@ -146,9 +146,9 @@ function menuClick(index:any){ // 点击菜单切换 getTimelineList() } function addMenu(){ //添加导菜单 - + let tempLabel = menuList.value[menuList.value.length - 1].label.split('条件')[1] menuList.value.push({ - label: '条件' + (menuList.value.length + 1), + label: '条件' + (Number(tempLabel) + 1), deviceType: '', target:{ entityType: '', @@ -166,9 +166,33 @@ function addMenu(){ //添加导菜单 menuClick(menuList.value.length - 1) } function delMenu(){ // 删除导菜单 - menuList.value.splice(menuIndex.value, 1); - menuIndex.value = 0 - menuClick(menuList.value.length - 1) + ElMessageBox.confirm('确定删除当前条件吗?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + if(menuList.value[menuIndex.value].eventId != null){ + deleteEvents(menuList.value[menuIndex.value].eventId).then((res:any) => { + if(res.code == 0){ + menuList.value.splice(menuIndex.value, 1); + menuIndex.value = 0 + menuClick(menuList.value.length - 1) + ElMessage({ + message: '删除成功', + type: 'success' + }); + } + }) + }else{ + menuList.value.splice(menuIndex.value, 1); + menuIndex.value = 0 + menuClick(menuList.value.length - 1) + } + + + + }); + } // 查询字典项