修改测试问题
This commit is contained in:
@@ -2,8 +2,17 @@
|
||||
<div class="default-main">
|
||||
<el-tabs v-model.trim="activeName" type="border-card" class="demo-tabs">
|
||||
<el-tab-pane label="暂态事件" name="4">
|
||||
<Transient v-if="activeName == '4'" :deviceTree="deviceTree" :key="key" />
|
||||
<Transient
|
||||
v-if="!showEventStatistics"
|
||||
:deviceTree="deviceTree"
|
||||
:key="key"
|
||||
@statistics="showEventStatistics = true"
|
||||
/>
|
||||
<eventStatistics v-else @back="showEventStatistics = false" />
|
||||
</el-tab-pane>
|
||||
<!-- <el-tab-pane label="事件统计" name="5">
|
||||
|
||||
</el-tab-pane> -->
|
||||
<el-tab-pane label="稳态越限告警" name="3">
|
||||
<Steady v-if="activeName == '3'" :deviceTree="deviceTree" :key="key" />
|
||||
</el-tab-pane>
|
||||
@@ -15,16 +24,17 @@
|
||||
</el-tab-pane>
|
||||
|
||||
|
||||
|
||||
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide } from 'vue'
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import Steady from './Steady.vue'
|
||||
import Transient from './Transient.vue'
|
||||
import Device from './Device.vue'
|
||||
import Front from './Front.vue'
|
||||
import eventStatistics from './eventStatistics.vue'
|
||||
import { getDeviceTree } from '@/api/cs-device-boot/csLedger'
|
||||
defineOptions({
|
||||
name: 'govern/alarm/index'
|
||||
@@ -32,25 +42,32 @@ defineOptions({
|
||||
|
||||
const deviceTree = ref([])
|
||||
const activeName = ref('4')
|
||||
const showEventStatistics = ref(false)
|
||||
const key = ref(0)
|
||||
getDeviceTree().then(res => {
|
||||
// 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
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
deviceTree.value = res.data
|
||||
key.value += 1
|
||||
activeName.value = '4'
|
||||
|
||||
watch(activeName, val => {
|
||||
if (val !== '4') {
|
||||
showEventStatistics.value = false
|
||||
}
|
||||
})
|
||||
// getDeviceTree().then(res => {
|
||||
// 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
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
// deviceTree.value = res.data
|
||||
// key.value += 1
|
||||
// activeName.value = '4'
|
||||
// })
|
||||
onMounted(() => { })
|
||||
|
||||
const addMenu = () => { }
|
||||
|
||||
Reference in New Issue
Block a user