feat(数据大屏): 调整接口

This commit is contained in:
hzj 2025-10-27 16:29:13 +08:00
parent 4afe02a878
commit b0a3669433
2 changed files with 41 additions and 32 deletions

View File

@ -50,7 +50,7 @@
<div id="online-info-tim-chat" class="col-info"> <div id="online-info-tim-chat" class="col-info">
<div class="title">Likei在线</div> <div class="title">Likei在线</div>
<div class="content"> <div class="content">
<online-user-count-origin origin="LOTFUN" /> <online-user-count-origin origin="LIKEI" />
</div> </div>
</div> </div>
</el-col> </el-col>

View File

@ -6,8 +6,10 @@
<div><countTo :start-val="0" :end-val="total" :duration="3000" /></div> <div><countTo :start-val="0" :end-val="total" :duration="3000" /></div>
</el-col> </el-col>
<el-col class="count" :span="6"> <el-col class="count" :span="6">
<div class="title">LotFun</div> <div class="title">LIKEI</div>
<div><countTo :start-val="0" :end-val="timchatTotal" :duration="3000" /></div> <div>
<countTo :start-val="0" :end-val="timchatTotal" :duration="3000" />
</div>
</el-col> </el-col>
<!-- <el-col class="count" :span="6"> <!-- <el-col class="count" :span="6">
<div class="title">Aswat</div> <div class="title">Aswat</div>
@ -22,10 +24,13 @@
</template> </template>
<script> <script>
import { purchaseTodayTotal, purchaseTodayTotalBySysOrigin } from '@/api/purchase' import {
import { mapGetters } from 'vuex' purchaseTodayTotal,
purchaseTodayTotalBySysOrigin
} from "@/api/purchase";
import { mapGetters } from "vuex";
export default { export default {
name: 'PurchaseCount', name: "PurchaseCount",
props: { props: {
timeOutSecond: { timeOutSecond: {
type: Number, type: Number,
@ -36,36 +41,40 @@ export default {
data() { data() {
return { return {
total: 0, total: 0,
timchatTotal: 0, timchatTotal: 0
} };
}, },
computed: { computed: {
...mapGetters(['permissionsSysOriginPlatforms']), ...mapGetters(["permissionsSysOriginPlatforms"]),
permissionsSysOriginCode() { permissionsSysOriginCode() {
if (!this.permissionsSysOriginPlatforms) { if (!this.permissionsSysOriginPlatforms) {
return [] return [];
} }
return this.permissionsSysOriginPlatforms.map(item => item.value) return this.permissionsSysOriginPlatforms.map(item => item.value);
} }
}, },
created() { created() {
const that = this const that = this;
that.loadData() that.loadData();
var intervalIndex = setInterval(() => { var intervalIndex = setInterval(() => {
that.loadData() that.loadData();
}, that.timeOutSecond * 1000) }, that.timeOutSecond * 1000);
that.$store.dispatch('app/pushRunTask', intervalIndex) that.$store.dispatch("app/pushRunTask", intervalIndex);
}, },
methods: { methods: {
loadData() { loadData() {
const that = this const that = this;
purchaseTodayTotal().then(res => { purchaseTodayTotal()
that.total = res.body || 0 .then(res => {
}).catch(er => {}) that.total = res.body || 0;
})
.catch(er => {});
purchaseTodayTotalBySysOrigin('LOTFUN').then(res => { purchaseTodayTotalBySysOrigin("LIKEI")
that.timchatTotal = res.body || 0 .then(res => {
}).catch(er => {}) that.timchatTotal = res.body || 0;
})
.catch(er => {});
// purchaseTodayTotalBySysOrigin('ASWAT').then(res => { // purchaseTodayTotalBySysOrigin('ASWAT').then(res => {
// that.aswatTotal = res.body || 0 // that.aswatTotal = res.body || 0
@ -76,15 +85,15 @@ export default {
// }).catch(er => {}) // }).catch(er => {})
} }
} }
} };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.online-user-counts { .online-user-counts {
.count { .count {
text-align: center; text-align: center;
line-height: .6rem; line-height: 0.6rem;
font-size: 0.4rem; font-size: 0.4rem;
padding-bottom: .2rem; padding-bottom: 0.2rem;
} }
} }
</style> </style>