2024-01-11 16:40:44 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="default-main">
|
2024-12-25 10:53:07 +08:00
|
|
|
<el-tabs v-model.trim="activeName" type="border-card" class="demo-tabs">
|
2024-01-11 16:40:44 +08:00
|
|
|
<el-tab-pane label="设备告警" name="1">
|
2024-12-30 10:07:26 +08:00
|
|
|
<Device v-if="activeName == '1'" :deviceTree="deviceTree" :key="key" />
|
2024-01-11 16:40:44 +08:00
|
|
|
</el-tab-pane>
|
2025-10-11 10:35:25 +08:00
|
|
|
<el-tab-pane label="前置告警" name="2">
|
|
|
|
|
<Front v-if="activeName == '2'" :deviceTree="deviceTree" :key="key" />
|
2024-01-11 16:40:44 +08:00
|
|
|
</el-tab-pane>
|
2026-05-28 20:36:49 +08:00
|
|
|
<el-tab-pane label="稳态越限告警" name="3">
|
2025-10-11 10:35:25 +08:00
|
|
|
<Steady v-if="activeName == '3'" :deviceTree="deviceTree" :key="key" />
|
2026-05-28 20:36:49 +08:00
|
|
|
</el-tab-pane>
|
2025-10-11 10:35:25 +08:00
|
|
|
<el-tab-pane label="暂态事件" name="4">
|
|
|
|
|
<Transient v-if="activeName == '4'" :deviceTree="deviceTree" :key="key" />
|
|
|
|
|
</el-tab-pane>
|
2026-05-28 20:36:49 +08:00
|
|
|
<el-tab-pane label="异常事件" name="5">
|
2025-10-11 10:35:25 +08:00
|
|
|
<Abnormal v-if="activeName == '5'" :deviceTree="deviceTree" :key="key" />
|
2026-05-28 20:36:49 +08:00
|
|
|
</el-tab-pane>
|
2024-01-11 16:40:44 +08:00
|
|
|
</el-tabs>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ref, onMounted, provide } from 'vue'
|
|
|
|
|
import Steady from './Steady.vue'
|
|
|
|
|
import Transient from './Transient.vue'
|
|
|
|
|
import Device from './Device.vue'
|
2024-09-18 16:39:19 +08:00
|
|
|
import Abnormal from './Abnormal.vue'
|
2025-10-11 10:35:25 +08:00
|
|
|
import Front from './Front.vue'
|
2024-01-11 16:40:44 +08:00
|
|
|
import { getDeviceTree } from '@/api/cs-device-boot/csLedger'
|
|
|
|
|
defineOptions({
|
|
|
|
|
name: 'govern/alarm/index'
|
|
|
|
|
})
|
2026-04-17 08:49:22 +08:00
|
|
|
|
2024-01-11 16:40:44 +08:00
|
|
|
const deviceTree = ref([])
|
2026-04-17 08:49:22 +08:00
|
|
|
const activeName = ref('1')
|
2024-12-30 10:07:26 +08:00
|
|
|
const key = ref(0)
|
2024-01-11 16:40:44 +08:00
|
|
|
getDeviceTree().then(res => {
|
2026-01-08 19:51:43 +08:00
|
|
|
// res.data.forEach((item: any) => {
|
|
|
|
|
// item.value = item.id
|
|
|
|
|
// item.label = item.name
|
|
|
|
|
// item.children.forEach((child: any) => {
|
|
|
|
|
// child.value = child.id
|
|
|
|
|
// child.label = child.name
|
|
|
|
|
// child.children.forEach((grand: any) => {
|
|
|
|
|
// grand.value = grand.id
|
|
|
|
|
// grand.label = grand.name
|
|
|
|
|
// delete grand.children
|
|
|
|
|
// })
|
|
|
|
|
// })
|
|
|
|
|
// })
|
2024-01-11 16:40:44 +08:00
|
|
|
deviceTree.value = res.data
|
2024-12-30 10:07:26 +08:00
|
|
|
key.value += 1
|
2026-01-15 15:59:13 +08:00
|
|
|
activeName.value = '1'
|
2024-01-11 16:40:44 +08:00
|
|
|
})
|
2024-12-25 10:53:07 +08:00
|
|
|
onMounted(() => { })
|
2024-01-11 16:40:44 +08:00
|
|
|
|
2024-12-25 10:53:07 +08:00
|
|
|
const addMenu = () => { }
|
2024-01-11 16:40:44 +08:00
|
|
|
</script>
|
|
|
|
|
<style></style>
|