<template>
|
<!-- 立库总览 -->
|
<div id="statelibrary" class="global-content">
|
<el-button statelibrary="absolute right zindex" type="primary" size="mini" @click="linkto">跳转</el-button>
|
<h3 class="text-center color636972" style="font-size: 40px">立库总览</h3>
|
<div class="width96 padding10 borderradius margintopbot flex flex-wrap justify-between align-center">
|
<div
|
class="didproject-title width45 flex justify-around align-center borderdashed borderradius overflow pointer"
|
v-for="(item, index) in titlelist"
|
:key="index"
|
:style="'margin-top:' + item.margin"
|
>
|
<div class="heigth padding10 overflow">
|
<p class="text-center fontsize2rem fontweight600 color409EFF margin-top15" style="font-size: 40px">
|
<countTo :startVal="startVal" :endVal="item.mun" :duration="3000"></countTo>
|
</p>
|
<p class="fontsiez1rem" style="font-size: 40px">{{ item.titel }}</p>
|
</div>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import countTo from 'vue-count-to';
|
import { GetStorageOverviewData } from '@/api/Didproject';
|
export default {
|
data() {
|
return {
|
startVal: 0,
|
titlelist: [
|
{
|
titel: '库位总数',
|
mun: 0,
|
color: '#40C9C6'
|
},
|
{
|
titel: '有货库位',
|
mun: 0,
|
color: '#F4516C'
|
},
|
{
|
titel: '带件器具',
|
mun: 0,
|
color: '#36A3F7',
|
margin: '1%'
|
},
|
{
|
titel: '空器具数',
|
mun: 0,
|
color: '#34BFA3',
|
margin: '1%'
|
}
|
// {
|
// titel: '制件总数',
|
// mun: 1,
|
// color: '#ffc637'
|
// }
|
],
|
cleartime: null
|
};
|
},
|
components: { countTo },
|
computed: {},
|
mounted() {
|
this.GetStorageOverviewData();
|
this.cleartime = setInterval(() => {
|
this.GetStorageOverviewData();
|
}, 60000);
|
},
|
methods: {
|
//跳转
|
linkto() {
|
const { href } = this.$router.resolve({
|
path: '/statelibrary'
|
});
|
window.open(href, '_blank');
|
},
|
//立库总览和制件总览
|
GetStorageOverviewData() {
|
// no 编号;title 标题;value 数量
|
GetStorageOverviewData().then(res => {
|
let data = res.data || [];
|
this.titlelist.forEach(item => {
|
data.forEach(element => {
|
if (item.titel == element.titel) {
|
item.mun = element.value;
|
}
|
});
|
});
|
});
|
}
|
},
|
beforeDestroy() {
|
if (this.cleartime) {
|
clearInterval(this.cleartime);
|
this.cleartime = null;
|
}
|
}
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
#statelibrary {
|
}
|
</style>
|