This commit is contained in:
duanliang
2025-04-23 02:00:16 +08:00
parent 5ce6f4c899
commit cc43098ca7
12 changed files with 114 additions and 33 deletions

View File

@@ -1,6 +1,13 @@
<!-- 交通负载 -->
<template>
<div class="traffic-flow" :id="id" />
<div style="position: relative;">
<div class="traffic-flow" :style="{
opacity:list.length?1:0,
}" :id="id" />
<div v-if="condShow==0" class="nYong-du">加载中...</div>
<div v-if="condShow==1" class="nYong-du">{{text}}</div>
</div>
</template>
<script setup>
@@ -13,14 +20,24 @@
list: {
type: Array,
default: () => []
}
},
text:{
type: String,
default: '暂无数据'
}
})
let condShow = ref(0)
let aIndex = 1
watch(
() => props.list,
(val) => {
aIndex+=1
if(aIndex>=3&&!val.length){
condShow.value = 1
}
if (val.length) {
setTimeout(() => {
condShow.value = 2
init()
}, 1000)
}
@@ -126,6 +143,19 @@
</script>
<style scoped lang="scss">
.nYong-du{
position:absolute;
left:0;
top:0;
width: 100%;
height: 100%;
font-size:vw(18);
// color:#999;
color:#02f9fa;
display: flex;
align-items: center;
justify-content: center;
}
.traffic-flow {
width: vw(260);
height: vh(300);