点击节点数据问题修改
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
<!-- 设备管理 -->
|
||||
<template>
|
||||
<div class="default-main device-manage" :style="{ height: pageHeight.height }" v-loading="loading">
|
||||
<DeviceTree @node-click="nodeClick" @init="nodeClick"></DeviceTree>
|
||||
@@ -86,6 +87,7 @@ const tableData = ref([])
|
||||
const tableHeight = mainHeight(235).height
|
||||
const mangePopup = ref()
|
||||
const activeName = ref(0)
|
||||
// 树节点点击
|
||||
const nodeClick = (e: anyObj) => {
|
||||
if (!e) {
|
||||
loading.value = false
|
||||
@@ -95,16 +97,15 @@ const nodeClick = (e: anyObj) => {
|
||||
loading.value = true
|
||||
getDeviceData(e.id, 'rt').then((res: any) => {
|
||||
deviceData.value = res.data
|
||||
console.log(deviceData.value)
|
||||
loading.value = false
|
||||
if (res.data.dataSetList?.length === 0) {
|
||||
if (!res.data.dataSetList) {
|
||||
dataSet.value = ''
|
||||
tableData.value = []
|
||||
} else {
|
||||
if (res.data.dataSetList&&res.data.dataSetList[0]?.id) {
|
||||
if (res.data.dataSetList && res.data.dataSetList[0]?.id) {
|
||||
dataSet.value = res.data.dataSetList[0]?.id
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
dataSet.value = ''
|
||||
tableData.value = []
|
||||
}
|
||||
handleClick()
|
||||
@@ -112,6 +113,7 @@ const nodeClick = (e: anyObj) => {
|
||||
})
|
||||
}
|
||||
}
|
||||
//tab点击事件
|
||||
const handleClick = () => {
|
||||
tableLoading.value = true
|
||||
tableData.value = []
|
||||
|
||||
Reference in New Issue
Block a user