修改测试问题
This commit is contained in:
@@ -1,24 +1,25 @@
|
||||
<template>
|
||||
<div
|
||||
class="default-main device-control"
|
||||
:style="{ height: pageHeight.height }"
|
||||
v-loading="loading"
|
||||
style="position: relative"
|
||||
>
|
||||
<div class="default-main device-control" :style="{ height: pageHeight.height }" v-loading="loading"
|
||||
style="position: relative">
|
||||
<!-- @init="nodeClick" -->
|
||||
<PointTree @node-click="nodeClick" @init="nodeClick" @checkChange="handleCheckedNodesChange"></PointTree>
|
||||
<div class="device-control-right" >
|
||||
<el-tabs type="border-card" class="mb10" @tab-click="handleClick" v-model="activeTab">
|
||||
<el-tab-pane label="稳态补召" name="deviceInfo1">
|
||||
<div style="height: calc(100vh - 205px)">
|
||||
<div class="device-control-right">
|
||||
<el-tabs type="border-card" class="mb10" @tab-click="handleClick" v-model="activeTab">
|
||||
<el-tab-pane label="稳态补召" name="1" v-if="showTab">
|
||||
<div style="height: calc(100vh - 205px)">
|
||||
<SteadyRecall ref="steadyRef" :checked-nodes="checkedNodes"></SteadyRecall>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="暂态补召" name="deviceInfo2">
|
||||
<div style="height: calc(100vh - 205px)">
|
||||
<el-tab-pane label="暂态补召" name="2" v-if="showTab">
|
||||
<div style="height: calc(100vh - 205px)">
|
||||
<Event ref="eventRef" :checked-nodes="checkedNodes"></Event>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="补招日志" name="3" v-if="!showTab">
|
||||
<div style="height: calc(100vh - 205px)">
|
||||
<Log ref="logRef"></Log>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</div>
|
||||
@@ -31,20 +32,23 @@ import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import Event from './eventRecall.vue'
|
||||
import Log from './log.vue'
|
||||
import SteadyRecall from './steadyRecall.vue'
|
||||
|
||||
const showTab = ref(true)
|
||||
const pageHeight = mainHeight(20)
|
||||
const steadyRef = ref()
|
||||
const eventRef = ref()
|
||||
const loading = ref(false)
|
||||
const activeTab = ref('deviceInfo1')
|
||||
const activeTab = ref('1')
|
||||
const checkedNodes = ref<any[]>([]) // 存储左侧树勾选的节点
|
||||
const currentNode = ref<any>(null) // 存储当前点击的树节点
|
||||
|
||||
defineOptions({
|
||||
name: '/cs-device-boot/monitorRecall'
|
||||
name: 'cs-device-boot/monitorRecall'
|
||||
})
|
||||
|
||||
const logRef = ref()
|
||||
|
||||
// 处理子组件传递的勾选节点变化
|
||||
const handleCheckedNodesChange = (nodes: any[]) => {
|
||||
checkedNodes.value = nodes
|
||||
@@ -53,29 +57,42 @@ const handleCheckedNodesChange = (nodes: any[]) => {
|
||||
// tab切换时的处理
|
||||
const handleClick = (tab: any) => {
|
||||
activeTab.value = tab.props.name
|
||||
|
||||
// tab切换时刷新对应组件的数据
|
||||
nextTick(() => {
|
||||
if (tab.props.name === 'deviceInfo1' && steadyRef.value) {
|
||||
|
||||
} else if (tab.props.name === 'deviceInfo2' && eventRef.value) {
|
||||
// tab切换后触发查询
|
||||
triggerEventRecallQuery()
|
||||
}
|
||||
// tab切换后触发查询
|
||||
triggerEventRecallQuery()
|
||||
})
|
||||
}
|
||||
|
||||
const nodeClick = (node: any) => {
|
||||
currentNode.value = node
|
||||
// 只有在暂态补召页面时才触发查询
|
||||
if (activeTab.value === 'deviceInfo2') {
|
||||
if(node==undefined){
|
||||
return
|
||||
}
|
||||
if (node?.pname.includes('便携')) {
|
||||
activeTab.value = '3'
|
||||
showTab.value = false
|
||||
nextTick(() => {
|
||||
logRef.value.open(node)
|
||||
})
|
||||
} else {
|
||||
activeTab.value = '1'
|
||||
showTab.value = true
|
||||
currentNode.value = node
|
||||
// 只有在暂态补召页面时才触发查询
|
||||
triggerEventRecallQuery()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 触发暂态补召查询
|
||||
const triggerEventRecallQuery = () => {
|
||||
nextTick(() => {
|
||||
if (activeTab.value === 'deviceInfo2' && eventRef.value) {
|
||||
if (activeTab.value === '1' && steadyRef.value) {
|
||||
if (steadyRef.value.handleTreeNodeClick) {
|
||||
steadyRef.value.handleTreeNodeClick(currentNode.value)
|
||||
}
|
||||
} else if (activeTab.value === '2' && eventRef.value) {
|
||||
// 将当前点击的节点传递给暂态补召组件
|
||||
if (eventRef.value.handleTreeNodeClick) {
|
||||
|
||||
@@ -168,7 +185,7 @@ const triggerEventRecallQuery = () => {
|
||||
}
|
||||
}
|
||||
|
||||
.device-control-right > div {
|
||||
.device-control-right>div {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user