Merge pull request 'fix : 修复数据loading加载' (#310) from dengjie into dev
Reviewed-on: http://git.feashow.cn/clay/tunnel-cloud-web/pulls/310
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="used-ele" :style="{ backgroundColor: bgImage }" @click="handleOpenChart">
|
<div id="used-ele" :style="{ backgroundColor: bgImage }" @click="handleOpenChart">
|
||||||
<div v-if="electricityConsumptionMonthly===0&&monthlySavings===0" class="showNull ">
|
<!-- <div v-if="electricityConsumptionMonthly===0&&monthlySavings===0" class="showNull ">-->
|
||||||
<div class="loading" v-if="loading===0"></div>
|
<!-- <div class="loading" v-if="loading===0"></div>-->
|
||||||
{{ loading === 0 ? '加载中...' : '暂无数据~' }}
|
<!-- {{ loading === 0 ? '加载中...' : '暂无数据~' }}-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
<div v-else class="content">
|
<div class="content">
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<div class="container" ref="length">
|
<div class="container" ref="length">
|
||||||
<div class="value" ref="valueA"></div>
|
<div class="value" ref="valueA"></div>
|
||||||
@@ -120,9 +120,9 @@ const bgImage = computed(() =>
|
|||||||
? "#2E5589"
|
? "#2E5589"
|
||||||
: "rgba(6,34,71,0.78)"
|
: "rgba(6,34,71,0.78)"
|
||||||
);
|
);
|
||||||
watch(() => props.loading, (now) => {
|
// watch(() => props.loading, (now) => {
|
||||||
props.loading = now
|
// props.loading = now
|
||||||
}, {deep: true});
|
// }, {deep: true});
|
||||||
watch(() => props.eleData, (now) => {
|
watch(() => props.eleData, (now) => {
|
||||||
if (now) {
|
if (now) {
|
||||||
let fanObj = {}
|
let fanObj = {}
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ const routeList = ref([]);
|
|||||||
let socket = reactive("");
|
let socket = reactive("");
|
||||||
let pattern = reactive(new RegExp("[A-Za-z]+"));
|
let pattern = reactive(new RegExp("[A-Za-z]+"));
|
||||||
let isTunnel = reactive(false)
|
let isTunnel = reactive(false)
|
||||||
const equipmentOption = ref([])
|
// const equipmentOption = ref([])
|
||||||
const btnList = ref([
|
const btnList = ref([
|
||||||
{
|
{
|
||||||
route: '/site',
|
route: '/site',
|
||||||
@@ -370,9 +370,7 @@ const getOtherInfo = () => {
|
|||||||
routeList.value = routeArr
|
routeList.value = routeArr
|
||||||
showMenu.value = true
|
showMenu.value = true
|
||||||
siteList.value = res.data.siteOption
|
siteList.value = res.data.siteOption
|
||||||
if (!siteId) {
|
|
||||||
tunnelList.value = res.data.tunnelOption
|
tunnelList.value = res.data.tunnelOption
|
||||||
}
|
|
||||||
|
|
||||||
if (siteId) {
|
if (siteId) {
|
||||||
currentSiteId.value = siteId
|
currentSiteId.value = siteId
|
||||||
@@ -395,50 +393,30 @@ const getOtherInfo = () => {
|
|||||||
const getScreenInfo = (id) => {
|
const getScreenInfo = (id) => {
|
||||||
if (id) {
|
if (id) {
|
||||||
tunnelId.value = id
|
tunnelId.value = id
|
||||||
equipmentOption.value = []
|
// equipmentOption.value = []
|
||||||
getLargeScreen(id).then((res) => {
|
getLargeScreen(id).then((res) => {
|
||||||
if (res?.code === 1000) {
|
if (res?.code === 1000) {
|
||||||
let option = {}
|
|
||||||
if (res.data.frequencyChangerList.length !== 0) {
|
if (res.data.frequencyChangerList.length !== 0) {
|
||||||
res.data.frequencyChangerList.forEach((item) => {
|
|
||||||
option = {
|
|
||||||
value: item.equipmentId,
|
|
||||||
label: item.equipmentName,
|
|
||||||
}
|
|
||||||
equipmentOption.value.push(option)
|
|
||||||
})
|
|
||||||
showFanLoading.value = 0
|
showFanLoading.value = 0
|
||||||
} else {
|
} else {
|
||||||
showFanLoading.value = 1
|
showFanLoading.value = 1
|
||||||
}
|
}
|
||||||
const useEleData=res.data.largeScreenElectricity
|
|
||||||
if(useEleData.electricityConsumptionCount==null||useEleData.monthlySavings==null){
|
|
||||||
showUsedLoading.value = 0
|
|
||||||
}else {
|
|
||||||
showUsedLoading.value = 1
|
|
||||||
}
|
|
||||||
if (res.data.windPressureSensorList.length !== 0) {
|
if (res.data.windPressureSensorList.length !== 0) {
|
||||||
res.data.windPressureSensorList.forEach((item) => {
|
|
||||||
option = {
|
|
||||||
value: item.equipmentId,
|
|
||||||
label: item.equipmentName,
|
|
||||||
}
|
|
||||||
equipmentOption.value.push(option)
|
|
||||||
})
|
|
||||||
showWindLoading.value = 0
|
showWindLoading.value = 0
|
||||||
} else {
|
} else {
|
||||||
showWindLoading.value = 1
|
showWindLoading.value = 1
|
||||||
}
|
}
|
||||||
if (res.data.sensorList.length !== 0) {
|
if (res.data.sensorList.length !== 0) {
|
||||||
res.data.sensorList.forEach((item) => {
|
// res.data.sensorList.forEach((item) => {
|
||||||
option = {
|
// option = {
|
||||||
value: item.equipmentId,
|
// value: item.equipmentId,
|
||||||
label: item.equipmentName,
|
// label: item.equipmentName,
|
||||||
}
|
// }
|
||||||
equipmentOption.value.push(option)
|
// equipmentOption.value.push(option)
|
||||||
})
|
// })
|
||||||
res.data.sensorList.forEach((item) => {
|
res.data.sensorList.forEach((item) => {
|
||||||
if (
|
if (
|
||||||
|
item.equipmentType === "dust" ||
|
||||||
item.equipmentType === "carbonDioxide" ||
|
item.equipmentType === "carbonDioxide" ||
|
||||||
item.equipmentType === "carbonMonoxide" ||
|
item.equipmentType === "carbonMonoxide" ||
|
||||||
item.equipmentType === "hydrogenSulfide" ||
|
item.equipmentType === "hydrogenSulfide" ||
|
||||||
@@ -455,7 +433,6 @@ const getScreenInfo = (id) => {
|
|||||||
showBadLoading.value = 1
|
showBadLoading.value = 1
|
||||||
}
|
}
|
||||||
largeScreenData.value = res.data;
|
largeScreenData.value = res.data;
|
||||||
// console.log(largeScreenData.value);
|
|
||||||
} else {
|
} else {
|
||||||
ElMessage.warning(res.msg)
|
ElMessage.warning(res.msg)
|
||||||
}
|
}
|
||||||
@@ -494,19 +471,18 @@ const getTunnel = (id) => {
|
|||||||
} else {
|
} else {
|
||||||
ElMessage.warning('该站点下没有隧道, 请新增隧道后再试!')
|
ElMessage.warning('该站点下没有隧道, 请新增隧道后再试!')
|
||||||
}
|
}
|
||||||
tunnelList.value = []
|
|
||||||
} else {
|
} else {
|
||||||
if (!pattern.test(previewId)) {
|
if (!pattern.test(previewId)) {
|
||||||
getScreenInfo(previewId)
|
getScreenInfo(previewId)
|
||||||
|
tunnelList.value.forEach((item, index) => {
|
||||||
|
if (item.value == previewId) {
|
||||||
|
initialIndex.value = index
|
||||||
|
tunnelBtn.value.setActiveItem(index)
|
||||||
|
}
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
getScreenInfo(res.data[0]?.value)
|
getScreenInfo(res.data[0]?.value)
|
||||||
}
|
}
|
||||||
tunnelList.value = res.data
|
|
||||||
tunnelList.value.forEach((item, index) => {
|
|
||||||
if (item.value == previewId) {
|
|
||||||
initialIndex.value = index
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -518,19 +494,18 @@ const changeTunnel = (e) => {
|
|||||||
newObj = item
|
newObj = item
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
showFan.value = false
|
||||||
showBadLoading.value = 0
|
showBadLoading.value = 0
|
||||||
showWindLoading.value = 0
|
showWindLoading.value = 0
|
||||||
showFanLoading.value = 0
|
showFanLoading.value = 0
|
||||||
showUsedLoading.value = 0
|
// showUsedLoading.value = 0
|
||||||
pageInfo.pageNum = 1
|
pageInfo.pageNum = 1
|
||||||
getScreenInfo(newObj.value)
|
getScreenInfo(newObj.value)
|
||||||
showFan.value = false
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
showFan.value = true;
|
showFan.value = true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const manageSelect = (index) => {
|
const manageSelect = (index) => {
|
||||||
console.log("首页点击-", index);
|
|
||||||
if (index === '站点管理') {
|
if (index === '站点管理') {
|
||||||
if (currentUserId.value) {
|
if (currentUserId.value) {
|
||||||
router.push("/site/" + currentUserId.value + '/' + currentSiteId.value);
|
router.push("/site/" + currentUserId.value + '/' + currentSiteId.value);
|
||||||
|
|||||||
Reference in New Issue
Block a user