|
|
|
<!--
|
|
|
|
* @Author: xw
|
|
|
|
* @Date: 2021-10-09 14:25:05
|
|
|
|
* @LastEditTime: 2021-10-26 12:19:13
|
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
|
* @Description: 大数据统计gif
|
|
|
|
* @FilePath: /data-show/src/views/Index/dynamicNumber/index.vue
|
|
|
|
-->
|
|
|
|
<template>
|
|
|
|
<div class="dy-outter" v-loading="load">
|
|
|
|
<div class="d1">
|
|
|
|
<span class="s1">APP</span>
|
|
|
|
<span class="s2">
|
|
|
|
<countTo :startVal='form.app-100 >= 0 ? form.app-100 : 0' :endVal='form.app' :duration='3000'></countTo>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div class="d1" :style="{top: '340px', left: '0px'}">
|
|
|
|
<span class="s1">其他</span>
|
|
|
|
<span class="s2">
|
|
|
|
<countTo :startVal='form.other-100 >= 0 ? form.other-100 : 0' :endVal='form.other' :duration='3000'></countTo>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div class="d1" :style="{top: '60px', left: '426px'}">
|
|
|
|
<span class="s1">微信</span>
|
|
|
|
<span class="s2">
|
|
|
|
<countTo :startVal='form.wecat-100 >= 0 ? form.wecat-100 : 0' :endVal='form.wecat' :duration='3000'></countTo>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div class="d2" :style="{top: '220px', left: '582px'}">
|
|
|
|
<span class="s1">
|
|
|
|
<countTo :startVal='form.forum-100 >= 0 ? form.forum-100 : 0' :endVal='form.forum' :duration='3000'></countTo>
|
|
|
|
</span>
|
|
|
|
<span class="s2">论坛</span>
|
|
|
|
</div>
|
|
|
|
<div class="d2" :style="{top: '340px', left: '582px'}">
|
|
|
|
<span class="s1">
|
|
|
|
<countTo :startVal='form.weipo-100 >= 0 ? form.weipo-100 : 0' :endVal='form.weipo' :duration='3000'></countTo>
|
|
|
|
</span>
|
|
|
|
<span class="s2">微博</span>
|
|
|
|
</div>
|
|
|
|
<div class="d2" :style="{top: '420px', left: '246px'}">
|
|
|
|
<span class="s1">
|
|
|
|
<countTo :startVal='form.news-100 >= 0 ? form.news-100 : 0' :endVal='form.news' :duration='3000'></countTo>
|
|
|
|
</span>
|
|
|
|
<span class="s2">新闻</span>
|
|
|
|
</div>
|
|
|
|
<div class="d3" @click="handlerAllData">
|
|
|
|
<span class="s1">系统入库 数据总量</span>
|
|
|
|
<span class="s2">
|
|
|
|
<countTo :startVal='form.total-100 >= 0 ? form.total-100 : 0' :endVal='form.total' :duration='3000'></countTo>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import countTo from "vue-count-to";
|
|
|
|
import { getHomeCount0528 } from "@/api/home";
|
|
|
|
export default {
|
|
|
|
name: "dynamic-number",
|
|
|
|
components: {
|
|
|
|
countTo,
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
load: false,
|
|
|
|
form: {
|
|
|
|
total: 0,
|
|
|
|
app: 0,
|
|
|
|
news: 0,
|
|
|
|
weipo: 0,
|
|
|
|
other: 0,
|
|
|
|
short: 0,
|
|
|
|
forum: 0,
|
|
|
|
wecat: 0,
|
|
|
|
},
|
|
|
|
begin: true,
|
|
|
|
intval: null,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
this.load = true;
|
|
|
|
this.getData(1).then(() => {
|
|
|
|
this.load = false;
|
|
|
|
this.startDyfun(6000);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
destroyed() {
|
|
|
|
if(this.intval) {
|
|
|
|
clearTimeout(this.intval)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
// 获取后台数据
|
|
|
|
getData(n) {
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
let obj = Object.assign({}, this.getCommTime, { iStatus: n });
|
|
|
|
getHomeCount0528(obj).then((res) => {
|
|
|
|
let data = res.data;
|
|
|
|
this.form.total = data.count;
|
|
|
|
let sourcetypeCount = data.sourcetypeCount;
|
|
|
|
if (Array.isArray(sourcetypeCount)) {
|
|
|
|
sourcetypeCount.forEach((ele) => {
|
|
|
|
if (ele.key == "新闻") {
|
|
|
|
this.form.news = ele.value;
|
|
|
|
} else if (ele.key == "APP") {
|
|
|
|
this.form.app = ele.value;
|
|
|
|
} else if (ele.key == "论坛") {
|
|
|
|
this.form.forum = ele.value;
|
|
|
|
} else if (ele.key == "微信") {
|
|
|
|
this.form.wecat = ele.value;
|
|
|
|
} else if (ele.key == "微博") {
|
|
|
|
this.form.weipo = ele.value;
|
|
|
|
} else {
|
|
|
|
this.form.other = ele.value;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
resolve(res)
|
|
|
|
}).catch(() => {
|
|
|
|
reject(false)
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
// 点击中间的全网数据显示
|
|
|
|
handlerAllData() {
|
|
|
|
this.$emit("allData");
|
|
|
|
},
|
|
|
|
// 定时器调后台数据
|
|
|
|
startDyfun(time) {
|
|
|
|
this.intval = self.setTimeout(() => {
|
|
|
|
if (this.begin) {
|
|
|
|
this.begin = false;
|
|
|
|
this.getData(2)
|
|
|
|
.then(() => {
|
|
|
|
this.begin = true;
|
|
|
|
this.startDyfun(time);
|
|
|
|
})
|
|
|
|
.catch(() => {
|
|
|
|
this.begin = false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}, time);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
.dy-outter {
|
|
|
|
position: relative;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
background-image: url("../../../assets/images/Index/d3.gif");
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
background-size: cover;
|
|
|
|
.d1 {
|
|
|
|
position: absolute;
|
|
|
|
display: flex;
|
|
|
|
width: 280px;
|
|
|
|
height: 60px;
|
|
|
|
background-image: url("../../../assets/images/Index/img_jbtter.png");
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
background-size: cover;
|
|
|
|
justify-content: flex-start;
|
|
|
|
align-items: center;
|
|
|
|
top: 240px;
|
|
|
|
left: 0px;
|
|
|
|
.s1 {
|
|
|
|
display: block;
|
|
|
|
font-size: 18px;
|
|
|
|
margin-left: 32px;
|
|
|
|
color: #d2dadf;
|
|
|
|
}
|
|
|
|
.s2 {
|
|
|
|
display: block;
|
|
|
|
font-size: 28px;
|
|
|
|
font-family: Bebas;
|
|
|
|
color: #ffffff;
|
|
|
|
margin-left: 24px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.d2 {
|
|
|
|
position: absolute;
|
|
|
|
display: flex;
|
|
|
|
width: 280px;
|
|
|
|
height: 60px;
|
|
|
|
background-image: url("../../../assets/images/Index/img_jbtter.png");
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
background-size: cover;
|
|
|
|
justify-content: flex-end;
|
|
|
|
align-items: center;
|
|
|
|
top: 240px;
|
|
|
|
left: 0px;
|
|
|
|
.s2 {
|
|
|
|
display: block;
|
|
|
|
font-size: 18px;
|
|
|
|
margin-left: 32px;
|
|
|
|
color: #d2dadf;
|
|
|
|
margin-right: 32px;
|
|
|
|
}
|
|
|
|
.s1 {
|
|
|
|
display: block;
|
|
|
|
font-size: 28px;
|
|
|
|
font-family: Bebas;
|
|
|
|
color: #ffffff;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.d3 {
|
|
|
|
position: absolute;
|
|
|
|
width: 320px;
|
|
|
|
height: 82px;
|
|
|
|
background-image: url("../../../assets/images/Index/img_jbtt.png");
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
background-size: cover;
|
|
|
|
left: 308px;
|
|
|
|
top: 323px;
|
|
|
|
display: flex;
|
|
|
|
justify-content: flex-start;
|
|
|
|
align-items: center;
|
|
|
|
cursor: pointer;
|
|
|
|
.s1 {
|
|
|
|
display: block;
|
|
|
|
font-size: 18px;
|
|
|
|
color: #d2dadf;
|
|
|
|
width: 72px;
|
|
|
|
margin-left: 38px;
|
|
|
|
}
|
|
|
|
.s2 {
|
|
|
|
display: block;
|
|
|
|
font-size: 32px;
|
|
|
|
font-family: Bebas;
|
|
|
|
color: #ffffff;
|
|
|
|
margin-left: 23px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|