<template>
|
<div class="mapPopUpBox">
|
<div class="header">
|
<div class="headerLeft">
|
<img class="header-image" src="../../assets/images/home/mapPopUpBox/titleImg.png" alt="" />
|
<div class="header-title">{{ dataObj.region_name }}</div>
|
</div>
|
<el-icon class="header-close" @click="props.removeLabel">
|
<Close />
|
</el-icon>
|
</div>
|
<div class="loading" v-if="loading">加载中...</div>
|
<div class="content" v-else>
|
<div class="info">
|
<div class="info-item">
|
机巢数:
|
<div class="num">{{ dataObj.device_num }}</div>
|
</div>
|
<div class="info-item">
|
任务次数:
|
<div class="num">{{ dataObj.jobNum }}</div>
|
</div>
|
</div>
|
<div class="status-title">机巢状态</div>
|
<div class="status-list">
|
<div v-for="item in list" :key="item.name" class="status-item">
|
<div class="status-value" :style="{ color: item.color }">{{ item.value }}</div>
|
<div class="status-name">{{ item.name }}</div>
|
</div>
|
</div>
|
</div>
|
|
</div>
|
</template>
|
<script setup>
|
import { Close } from '@element-plus/icons-vue';
|
import { getDeviceInfoNum } from '@/api/home/machineNest';
|
import { getTotalJobNum } from '@/api/home';
|
|
const props = defineProps(['data', 'removeLabel']);
|
const list = ref([
|
{ name: '空闲中', value: 0, color: '#8EFFAC' },
|
{ name: '作业', value: 0, color: '#FFA768' },
|
{ name: '离线中', value: 0, color: '#FFFFFF' },
|
]);
|
const loading = ref(true);
|
|
const dataObj = ref({
|
device_num: 0,
|
jobNum: 0,
|
region_name: '',
|
});
|
onMounted(async () => {
|
loading.value = true;
|
const areaCode = props.data.region_code;
|
dataObj.value.region_name = props.data.region_name;
|
const res = await getDeviceInfoNum({ areaCode });
|
|
|
const resJob = await getTotalJobNum({ areaCode });
|
dataObj.value.jobNum = resJob.data.data;
|
dataObj.value.device_num = res.data.data.device_num;
|
list.value[0].value = res.data.data.leisure_num;
|
list.value[1].value = res.data.data.ex_num;
|
list.value[2].value = res.data.data.offline_num;
|
loading.value = false;
|
});
|
</script>
|
<style scoped lang="scss">
|
.mapPopUpBox {
|
width: 418px;
|
height: 240px;
|
background: url('@/assets/images/home/mapPopUpBox/mapPopUpBg.png') no-repeat center / 100% 100%;
|
padding-left: 98px;
|
|
.loading{
|
display: flex;
|
height: calc(100% - 51px);
|
justify-content: center;
|
align-items: center;
|
font-size: 20px;
|
color: #ffffff;
|
background: rgb(24,50,101,.5);
|
}
|
|
.header {
|
padding: 0 12px;
|
width: 320px;
|
height: 51px;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
|
.headerLeft {
|
display: flex;
|
}
|
|
img {
|
width: 26px;
|
height: 26px;
|
}
|
|
&-title {
|
font-family: YouSheBiaoTiHei, YouSheBiaoTiHei, serif;
|
font-weight: 400;
|
font-size: 26px;
|
line-height: 30px;
|
letter-spacing: 2px;
|
text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.25);
|
background: linear-gradient(180deg, #ffffff 41%, #35d0ff 86%);
|
-webkit-background-clip: text;
|
-webkit-text-fill-color: transparent;
|
-moz-background-clip: text;
|
-moz-text-fill-color: transparent;
|
background-clip: text;
|
text-fill-color: transparent;
|
margin-left: 4px;
|
}
|
|
&-close {
|
width: 25px;
|
height: 100%;
|
line-height: 100%;
|
display: flex;
|
align-items: center;
|
color: #9cd5ff;
|
pointer-events: all;
|
cursor: pointer;
|
}
|
}
|
.content {
|
padding: 0px 23px 25px 15px;
|
}
|
.info {
|
height: 34px;
|
font-family: Source Han Sans CN, Source Han Sans CN, serif;
|
font-weight: 400;
|
font-size: 16px;
|
color: #ffffff;
|
line-height: 19px;
|
display: flex;
|
align-items: center;
|
margin: 18px 0;
|
justify-content: space-between;
|
|
.info-item {
|
display: flex;
|
align-items: center;
|
|
.num {
|
font-family: YouSheBiaoTiHei, YouSheBiaoTiHei, serif;
|
font-weight: 400;
|
font-size: 26px;
|
color: #ffffff;
|
line-height: 30px;
|
}
|
}
|
}
|
|
.status-title {
|
font-family: YouSheBiaoTiHei, YouSheBiaoTiHei, serif;
|
font-weight: 400;
|
font-size: 20px;
|
color: #ffffff;
|
line-height: 23px;
|
text-shadow: 0px 0px 12px rgba(68, 105, 255, 0.67);
|
|
margin-bottom: 14px;
|
}
|
|
.status-list {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
|
.status-item {
|
width: 66px;
|
height: 54px;
|
background: url('@/assets/images/home/mapPopUpBox/itembg.png') no-repeat center / 100% 100%;
|
text-align: center;
|
|
.status-value {
|
font-family: YouSheBiaoTiHei, YouSheBiaoTiHei, serif;
|
font-weight: 400;
|
font-size: 26px;
|
color: #ffa768;
|
line-height: 17px;
|
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
|
position: relative;
|
top: -3px;
|
}
|
|
.status-name {
|
font-family: Source Han Sans CN, Source Han Sans CN, serif;
|
font-weight: 400;
|
font-size: 14px;
|
color: #ffffff;
|
line-height: 16px;
|
position: relative;
|
top: -3px;
|
}
|
}
|
}
|
}
|
</style>
|