温度管理报错
This commit is contained in:
parent
ba4de4f187
commit
a64a188bdf
@ -97,22 +97,23 @@ const deviceData = ref(
|
|||||||
}]
|
}]
|
||||||
)
|
)
|
||||||
const defaultExpandedKeys = ref([0]);
|
const defaultExpandedKeys = ref([0]);
|
||||||
const deviceId=ref()
|
const SelectdeviceId=ref()
|
||||||
const equipTreeRef = ref()
|
const equipTreeRef = ref()
|
||||||
const deviceQuery = (data: any) => {
|
const deviceQuery = (data: any) => {
|
||||||
equipList(data).then((res) => {
|
equipList(data).then((res) => {
|
||||||
deviceData.value[0].children = res.data
|
deviceData.value[0].children = res.data
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
deviceId.value=res.data[0]?.id
|
SelectdeviceId.value=res.data[0]?.id
|
||||||
equipTreeRef.value?.setCurrentKey(deviceData.value[0].children[0].id!, true)
|
equipTreeRef.value?.setCurrentKey(deviceData.value[0].children[0].id!, true)
|
||||||
getChartData({deviceId:deviceId.value,attributes:[]})
|
getChartData({deviceId:SelectdeviceId.value,attributes:[]})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const handleNodeClick = (data: any) => {
|
const handleNodeClick = (data: any) => {
|
||||||
deviceId.value=data.id
|
debugger
|
||||||
|
SelectdeviceId.value=data.id
|
||||||
state.charts.temperatureChart.clear()
|
state.charts.temperatureChart.clear()
|
||||||
getChartData({id:deviceId.value,attributes:[]})
|
getChartData({id:SelectdeviceId.value,attributes:[]})
|
||||||
}
|
}
|
||||||
|
|
||||||
const state: {
|
const state: {
|
||||||
@ -297,7 +298,7 @@ const openMeasure=() =>{
|
|||||||
const subSystemDataList=ref([])
|
const subSystemDataList=ref([])
|
||||||
const variableList = () =>{
|
const variableList = () =>{
|
||||||
const data={
|
const data={
|
||||||
deviceId:deviceId.value,
|
deviceId:SelectdeviceId.value,
|
||||||
attributes:[]
|
attributes:[]
|
||||||
}
|
}
|
||||||
getTemperatureLimitByDeviceId(data).then((res) => {
|
getTemperatureLimitByDeviceId(data).then((res) => {
|
||||||
@ -353,7 +354,7 @@ const handleClose = (done: () => void) => {
|
|||||||
const sureBtn = () => {
|
const sureBtn = () => {
|
||||||
visible.value = false
|
visible.value = false
|
||||||
selectcheck.value=checkList.value
|
selectcheck.value=checkList.value
|
||||||
getChartData({deviceId:deviceId.value,attributes:selectcheck.value})
|
getChartData({deviceId:SelectdeviceId.value,attributes:selectcheck.value})
|
||||||
}
|
}
|
||||||
|
|
||||||
let attributesCode:any[]=[]
|
let attributesCode:any[]=[]
|
||||||
@ -380,11 +381,11 @@ const getChartData = (data: any) => {
|
|||||||
temperatureData.limit2Low.push(item.limit2Low)
|
temperatureData.limit2Low.push(item.limit2Low)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
//console.log(JSON.stringify({deviceId:data.id,attributes:attributesCode}))
|
console.log(JSON.stringify([{deviceId:SelectdeviceId.value,attributes:attributesCode}]))
|
||||||
if(!data.attributes.length){
|
if(!data.attributes.length){
|
||||||
getTemperaData([{deviceId:data.deviceId,attributes:attributesCode}])
|
getTemperaData([{deviceId:SelectdeviceId.value,attributes:attributesCode}])
|
||||||
}else{
|
}else{
|
||||||
getTemperaData([{deviceId:data.deviceId,attributes:data.attributes}])
|
getTemperaData([{deviceId:SelectdeviceId.value,attributes:data.attributes}])
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -393,7 +394,7 @@ const getChartData = (data: any) => {
|
|||||||
const getTemperaData = (data:any) => {
|
const getTemperaData = (data:any) => {
|
||||||
getsnapshotData(data).then((res) => {
|
getsnapshotData(data).then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
const data = res.data[deviceId.value]
|
const data = res.data[SelectdeviceId.value]
|
||||||
const rangeKeys = Object.keys(data)
|
const rangeKeys = Object.keys(data)
|
||||||
temperatureData.values=[]
|
temperatureData.values=[]
|
||||||
attributesCode.forEach((attribute, index) => {
|
attributesCode.forEach((attribute, index) => {
|
||||||
@ -442,9 +443,9 @@ const autoUpdate = () => {
|
|||||||
if (!autoUpdateTimer) {
|
if (!autoUpdateTimer) {
|
||||||
autoUpdateTimer = setInterval(() => {
|
autoUpdateTimer = setInterval(() => {
|
||||||
if(!selectcheck.value.length){
|
if(!selectcheck.value.length){
|
||||||
getChartData({deviceId:deviceId.value,attributes:[]})
|
getChartData({deviceId:SelectdeviceId.value,attributes:[]})
|
||||||
}else{
|
}else{
|
||||||
getChartData({deviceId:deviceId.value,attributes:selectcheck.value})
|
getChartData({deviceId:SelectdeviceId.value,attributes:selectcheck.value})
|
||||||
}
|
}
|
||||||
|
|
||||||
}, 2000)
|
}, 2000)
|
||||||
|
Loading…
Reference in New Issue
Block a user