条件设置添加删除方法
This commit is contained in:
parent
c0cbdc831c
commit
36713c0edc
@ -391,7 +391,6 @@ function changeShowResult(isShow:boolean){ // 切换显示结果模型
|
|||||||
<img :src="apiUrl +'/models/'+ info.metricsImagePath" alt="" style="width: 100%; height: 100%;object-fit:contain;">
|
<img :src="apiUrl +'/models/'+ info.metricsImagePath" alt="" style="width: 100%; height: 100%;object-fit:contain;">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import Page from '@/components/Pagination/page.vue'
|
|||||||
import { getDictItemById } from '@/api/dict';
|
import { getDictItemById } from '@/api/dict';
|
||||||
import { topologyDevicesLsit } from '@/api/business/project';
|
import { topologyDevicesLsit } from '@/api/business/project';
|
||||||
import { getToken } from '@/utils/auth';
|
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";
|
import { sizeSchemaAll } from "@/api/business/database/device";
|
||||||
const url = import.meta.env.VITE_APP_BASE_API;
|
const url = import.meta.env.VITE_APP_BASE_API;
|
||||||
const conditionData:any = ref([{ // 套件数据
|
const conditionData:any = ref([{ // 套件数据
|
||||||
@ -146,9 +146,9 @@ function menuClick(index:any){ // 点击菜单切换
|
|||||||
getTimelineList()
|
getTimelineList()
|
||||||
}
|
}
|
||||||
function addMenu(){ //添加导菜单
|
function addMenu(){ //添加导菜单
|
||||||
|
let tempLabel = menuList.value[menuList.value.length - 1].label.split('条件')[1]
|
||||||
menuList.value.push({
|
menuList.value.push({
|
||||||
label: '条件' + (menuList.value.length + 1),
|
label: '条件' + (Number(tempLabel) + 1),
|
||||||
deviceType: '',
|
deviceType: '',
|
||||||
target:{
|
target:{
|
||||||
entityType: '',
|
entityType: '',
|
||||||
@ -166,9 +166,33 @@ function addMenu(){ //添加导菜单
|
|||||||
menuClick(menuList.value.length - 1)
|
menuClick(menuList.value.length - 1)
|
||||||
}
|
}
|
||||||
function delMenu(){ // 删除导菜单
|
function delMenu(){ // 删除导菜单
|
||||||
menuList.value.splice(menuIndex.value, 1);
|
ElMessageBox.confirm('确定删除当前条件吗?', '提示', {
|
||||||
menuIndex.value = 0
|
confirmButtonText: '确定',
|
||||||
menuClick(menuList.value.length - 1)
|
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)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询字典项
|
// 查询字典项
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user