You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

177 lines
4.7 KiB

2 years ago
//监管用户
<template>
2 years ago
<view>
<view :style="{background: 'url('+applet+'/jg/banner.png) no-repeat',height:'23vh',backgroundSize:'100%'}">
2 years ago
<image :src="applet+'/close.png'" style="width: 35px;height: 35px;margin-top: 40px;margin-left: 10px;"
@tap="close"></image>
</view>
2 years ago
<view style="height: calc(100vh - 24vh);padding: 10px;margin-top: -12px;"
2 years ago
:style="{background: 'url('+applet+'/jg/bg.png) no-repeat',backgroundSize:'100% 100%'}">
<view class="charts-box">
2 years ago
<qiun-data-charts type="arcbar" :opts="opts" :chartData="chartData" :canvas2d="true"/>
2 years ago
</view>
<view class="home-left-bottom">
<view class="home-left-bottom-item"
:style="{background: 'url('+applet+'/jg/unit1_bg.png) no-repeat',backgroundSize:'100% 100%'}"
2 years ago
@click="gourl('/pages/supervise/superviseList?type=')">
2 years ago
<view class="text">
2 years ago
<view class="ttt1" >{{val.unitCount}}</view>
2 years ago
<view class="ttt">联网单位</view>
</view>
</view>
<view class="home-left-bottom-item"
:style="{background: 'url('+applet+'/jg/unit2_bg.png) no-repeat',backgroundSize:'100% 100%'}"
2 years ago
@click="gourl('/pages/supervise/superviseList?type=0')">
2 years ago
<view class="text">
2 years ago
<view class="ttt1" >{{val.qualified}}</view>
2 years ago
<view class="ttt">已打卡单位</view>
</view>
</view>
<view class="home-left-bottom-item"
:style="{background: 'url('+applet+'/jg/unit3_bg.png) no-repeat',backgroundSize:'100% 100%'}"
2 years ago
@click="gourl('/pages/supervise/superviseList?type=1')">
2 years ago
<view class="text">
2 years ago
<view class="ttt1" >{{val.imperfect}}</view>
2 years ago
<view class="ttt">未完全打卡单位</view>
</view>
</view>
<view class="home-left-bottom-item"
:style="{background: 'url('+applet+'/jg/unit4_bg.png) no-repeat',backgroundSize:'100% 100%'}"
2 years ago
@click="gourl('/pages/supervise/superviseList?type=2')">
2 years ago
<view class="text">
2 years ago
<view class="ttt1" >{{val.unqualified}}</view>
2 years ago
<view class="ttt">未打卡单位</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
2 years ago
import {
formatterDateTime
} from "@/common/utils.js"
2 years ago
export default {
data() {
return {
applet: this.$url.data.applet,
chartData: {},
//您可以通过修改 config-ucharts.js 文件中下标为 ['arcbar'] 的节点来配置全局默认参数,如都是默认参数,此处可以不传 opts 。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式,达到页面简洁的需求。
opts: {
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
"#ea7ccc"
],
title: {
2 years ago
name: "0%",
fontSize: 25,
color: "#3971ff"
2 years ago
},
2 years ago
padding: undefined,
2 years ago
subtitle: {
2 years ago
name: "在岗率",
fontSize: 18,
color: "#333"
2 years ago
},
extra: {
arcbar: {
type: "circle",
width: 12,
2 years ago
backgroundColor: "#ffffff",
2 years ago
startAngle: 1.5,
endAngle: 0.25,
gap: 2,
linearType: "custom"
}
}
2 years ago
},
val:{},
date:formatterDateTime(new Date(), 'Y-M-D'),
dateTime:formatterDateTime(new Date(), 'Y-M-D h:min:s'),
regionId:uni.getStorageSync("regionId")
2 years ago
}
},
onLoad() {
2 years ago
this.loadData()
2 years ago
},
methods: {
2 years ago
loadData(){
this.$http.get("/fire-customer/sign/record/supervise",{
date:this.date,dateTime:this.dateTime,regionId:this.regionId
},{}).then(res =>{
this.val = res.data
this.opts.title.name = res.data.rate != 'NaN' ? res.data.rate.toFixed(2) *100 +"%" : '0%'
this.loadCharts(res.data.rate)
})
},
loadCharts(e) {
2 years ago
let res = {
2 years ago
title:{
name:e
},
2 years ago
series: [{
2 years ago
name: "在岗率",
color: "#3971ff",
data: e
2 years ago
}]
};
this.chartData = JSON.parse(JSON.stringify(res));
},
2 years ago
gourl(e){
uni.navigateTo({
url:e+ "&date="+this.date+ "&dateTime="+this.dateTime
})
2 years ago
},
close() {
uni.removeStorageSync("token")
uni.redirectTo({
url: '/pages/login/index'
})
}
2 years ago
},
onPullDownRefresh() {
this.loadData()
//下拉刷新
uni.stopPullDownRefresh();
},
2 years ago
}
</script>
<style scoped lang="scss">
.charts-box {
2 years ago
width: 200px;
2 years ago
height: 200px;
2 years ago
margin: 30px auto;
// background-color: #fff;
// border-radius: 50%;
2 years ago
}
.home-left-bottom {
width: 100%;
height: 22vh;
margin-top: 30px;
display: flex;
flex-wrap: wrap;
justify-content: space-between
}
.home-left-bottom-item {
height: 45%;
width: 48%;
.text{
width: 60%;
height: 100%;
margin-left: 40%;
.ttt{
text-align: center;
margin-top: 14%;
color: #fff;
font-size: 12px;
}
.ttt1{
text-align: center;
margin-top: 14%;
color: #fff;
}
}
}
</style>