|
@@ -227,14 +227,32 @@ export default defineComponent({
|
|
|
}
|
|
|
const initLeftCount = () => {
|
|
|
const handle = () => {
|
|
|
- Object.entries(state.leftValue).forEach(([k, v], i) => {
|
|
|
- v.endVal = that.$util.randomNum(0, 99999999)
|
|
|
+ axios.get('/api-wazx/populationTrend/getUserCount?token=5224E73006490F8D878ABD2CA5A39E78').then(res => {
|
|
|
+ try {
|
|
|
+ if (res.status === 200 && res.data?.status === 200) {
|
|
|
+ res.data?.data?.forEach((v: any) => {
|
|
|
+ if (v.userType === 1) {
|
|
|
+ state.leftValue.ssyhs.endVal = v.count
|
|
|
+ } else if (v.userType === 3) {
|
|
|
+ state.leftValue.ldyhs.endVal = v.count
|
|
|
+ } else if (v.userType === 4) {
|
|
|
+ state.leftValue.lyyhs.endVal = v.count
|
|
|
+ } else if (v.userType === 9) {
|
|
|
+ state.leftValue.gjyhs.endVal = v.count
|
|
|
+ } else if (v.userType === 5) {
|
|
|
+ state.leftValue.jwyhs.endVal = v.count
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e)
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
handle()
|
|
|
setInterval(() => {
|
|
|
handle()
|
|
|
- }, 5000)
|
|
|
+ }, 10000)
|
|
|
}
|
|
|
onMounted(() => {
|
|
|
initLeftCount()
|
|
@@ -254,10 +272,6 @@ export default defineComponent({
|
|
|
ref_screenBg.value?.children[Math.abs(state.bgImgIndex - 1 - len)].classList.remove('animate__fadeIn')
|
|
|
}
|
|
|
}, 5000)
|
|
|
-
|
|
|
- axios.get('http://172.17.0.42:18000/populationTrend/getUserCount?token=5224E73006490F8D878ABD2CA5A39E78').then(res => {
|
|
|
- console.log(res)
|
|
|
- })
|
|
|
})
|
|
|
return {
|
|
|
...toRefs(state),
|