YNUtdPlatform/pages/workPlan/index/components/day-risk-view.vue

95 lines
2.0 KiB
Vue
Raw Normal View History

2024-10-12 16:03:45 +08:00
<template>
<view class="day-risk">
<h2>日风险概况</h2>
<view class="data-container">
<view class="left-content">
<text>本月风险数</text>
<text>{{ monthNum }}</text>
2024-11-03 14:42:17 +08:00
<text>累计总数 {{ monthNum }}</text>
2024-10-12 16:03:45 +08:00
</view>
<view class="left-right">
<text>本周风险数</text>
<text>{{ weekNum }}</text>
2024-11-04 10:13:18 +08:00
<text>累计总数 {{ weekAmount }}</text>
2024-10-12 16:03:45 +08:00
</view>
</view>
</view>
</template>
<script>
2024-11-03 14:42:17 +08:00
import { getTitleRiskApi } from '../../../../api/workPlan/homePage'
2024-10-12 16:03:45 +08:00
export default {
data() {
return {
2024-11-03 14:42:17 +08:00
monthNum: 0,
2024-10-12 16:03:45 +08:00
monthAmount: 9520,
2024-11-03 14:42:17 +08:00
weekNum: 0,
2024-11-04 10:13:18 +08:00
weekAmount: 0
2024-10-12 16:03:45 +08:00
}
},
methods: {
2024-11-03 14:42:17 +08:00
async getRiskNumData() {
const res = await getTitleRiskApi()
console.log('风险数据---', res)
if (res.resMsg == '数据获取成功') {
res.obj.list.forEach(e => {
if (e.type == 'm') {
this.monthNum = e.num
}
if (e.type == 'w1') {
this.weekNum = e.num
}
2024-11-04 10:13:18 +08:00
if (e.type == 'w2') {
this.weekAmount = e.num
}
2024-11-03 14:42:17 +08:00
})
}
}
2024-10-12 16:03:45 +08:00
},
mounted() {
this.getRiskNumData()
}
}
</script>
<style lang="scss" scoped>
.day-risk {
2024-11-03 14:42:17 +08:00
h2 {
padding: 18rpx 0;
font-size: 34rpx;
}
2024-10-12 16:03:45 +08:00
.data-container {
display: flex;
justify-content: space-between;
color: #fff;
font-size: 26rpx;
view {
width: 49%;
height: 180rpx;
display: flex;
flex-direction: column;
justify-content: space-around;
text {
text-align: left;
padding-left: 20rpx;
}
text:nth-child(2) {
font-weight: bold;
font-size: 36rpx;
}
}
.left-content {
background: url('../../../../static/images/workPlan/month_img.png') no-repeat;
background-size: 100% 100%;
}
.left-right {
background: url('../../../../static/images/workPlan/week_img.png') no-repeat;
background-size: 100% 100%;
}
}
}
</style>