湖里大屏(首页):年龄结构接口对接
This commit is contained in:
parent
e60f40410b
commit
79a4f6a138
@ -129,62 +129,62 @@ export default {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
tableData: [],
|
||||
options:[{
|
||||
label: "防疫人员通知",
|
||||
value: "17"
|
||||
},{
|
||||
label: "访客通知",
|
||||
value: "18"
|
||||
}],
|
||||
// options:[{
|
||||
// label: "高空火警",
|
||||
// value: "8"
|
||||
// },{
|
||||
// label: "考勤提醒",
|
||||
// value: "1"
|
||||
// },{
|
||||
// label: "防疫人员通知",
|
||||
// value: "2"
|
||||
// },{
|
||||
// label: "防疫车辆通知",
|
||||
// value: "3"
|
||||
// },{
|
||||
// label: "访客通知",
|
||||
// value: "16"
|
||||
// },{
|
||||
// label: "混凝土监测",
|
||||
// value: "4"
|
||||
// },{
|
||||
// label: "卸料平台",
|
||||
// value: "5"
|
||||
// },{
|
||||
// label: "配电箱",
|
||||
// value: "6"
|
||||
// },{
|
||||
// label: "扬尘",
|
||||
// value: "7"
|
||||
// },{
|
||||
// label: "标养室",
|
||||
// value: "9"
|
||||
// },{
|
||||
// label: "安全检查",
|
||||
// value: "10"
|
||||
// },{
|
||||
// label: "质量检查",
|
||||
// value: "11"
|
||||
// },{
|
||||
// label: "塔吊",
|
||||
// value: "12"
|
||||
// },{
|
||||
// label: "升降机",
|
||||
// value: "13"
|
||||
// },{
|
||||
// label: "电表",
|
||||
// value: "14"
|
||||
// },{
|
||||
// label: "水表",
|
||||
// value: "15"
|
||||
// }],
|
||||
options:[{
|
||||
label: "高空火警",
|
||||
value: "8"
|
||||
},{
|
||||
label: "考勤提醒",
|
||||
value: "1"
|
||||
},{
|
||||
label: "防疫人员通知",
|
||||
value: "2"
|
||||
},{
|
||||
label: "防疫车辆通知",
|
||||
value: "3"
|
||||
},{
|
||||
label: "访客通知",
|
||||
value: "16"
|
||||
},{
|
||||
label: "混凝土监测",
|
||||
value: "4"
|
||||
},{
|
||||
label: "卸料平台",
|
||||
value: "5"
|
||||
},{
|
||||
label: "配电箱",
|
||||
value: "6"
|
||||
},{
|
||||
label: "扬尘",
|
||||
value: "7"
|
||||
},{
|
||||
label: "标养室",
|
||||
value: "9"
|
||||
},{
|
||||
label: "安全检查",
|
||||
value: "10"
|
||||
},{
|
||||
label: "质量检查",
|
||||
value: "11"
|
||||
},{
|
||||
label: "塔吊",
|
||||
value: "12"
|
||||
},{
|
||||
label: "升降机",
|
||||
value: "13"
|
||||
},{
|
||||
label: "电表",
|
||||
value: "14"
|
||||
},{
|
||||
label: "水表",
|
||||
value: "15"
|
||||
}],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
||||
@ -192,6 +192,7 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
showSymbol:false,
|
||||
data: this.data,
|
||||
type: "line",
|
||||
smooth: true,
|
||||
|
||||
@ -1,36 +1,41 @@
|
||||
<template>
|
||||
<div class="dataBoardPage">
|
||||
<div class="dataBoardPage">
|
||||
<div class="headerBox">
|
||||
<div class="topTit">
|
||||
<div class="time">
|
||||
<span>{{currentDate}}</span>
|
||||
<span>{{currentWeek}}</span>
|
||||
<span>{{currentTime}}</span>
|
||||
<span>{{currentDate}}</span>
|
||||
<span>{{currentWeek}}</span>
|
||||
<span>{{currentTime}}</span>
|
||||
</div>
|
||||
<div class="title">
|
||||
<h1 class="title">{{'金林湾项目监管平台'}}</h1>
|
||||
</div>
|
||||
<div>
|
||||
<img class="wetherImg" src="../../../assets/images/projectImg/sun.png" alt />
|
||||
<span>多云 32℃</span>
|
||||
<img
|
||||
class="backImg"
|
||||
@click="toBack()"
|
||||
src="../../../assets/images/projectImg/back.png"
|
||||
alt
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="title"><h1 class="title">{{'金林湾项目监管平台'}}</h1></div>
|
||||
<div>
|
||||
<img class="backImg" src="../../../assets/images/projectImg/sun.png" alt="" />
|
||||
<span>多云 32℃</span>
|
||||
<img class="backImg" @click="toBack()" src="../../../assets/images/projectImg/back.png" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 40px" class="menuBox">
|
||||
<ul class="left">
|
||||
<li
|
||||
v-for="(item, index) in menuList"
|
||||
:key="index"
|
||||
:class="{
|
||||
<div style="height: 40px" class="menuBox">
|
||||
<ul class="left">
|
||||
<li
|
||||
v-for="(item, index) in menuList"
|
||||
:key="index"
|
||||
:class="{
|
||||
right: index > (menuList.length - 1) / 2,
|
||||
active: $route.path == item.modulePath,
|
||||
}"
|
||||
@click="menuClick(item, index)"
|
||||
>
|
||||
{{ item.moduleName }}
|
||||
</li>
|
||||
</ul>
|
||||
@click="menuClick(item, index)"
|
||||
>{{ item.moduleName }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dataBoardContent">
|
||||
<div class="dataBoardContent">
|
||||
<router-view></router-view>
|
||||
</div>
|
||||
</div>
|
||||
@ -39,27 +44,26 @@
|
||||
<script>
|
||||
import moment from "moment";
|
||||
export default {
|
||||
data(){
|
||||
return{
|
||||
menuList: [],
|
||||
currentDate:'',
|
||||
currentTime:'',
|
||||
currentWeek:'',
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.getAllModule();
|
||||
this.getCurrentTime();
|
||||
this.getTime();
|
||||
this.getWeek();
|
||||
|
||||
},
|
||||
methods:{
|
||||
getTime() {
|
||||
data() {
|
||||
return {
|
||||
menuList: [],
|
||||
currentDate: "",
|
||||
currentTime: "",
|
||||
currentWeek: ""
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getAllModule();
|
||||
this.getCurrentTime();
|
||||
this.getTime();
|
||||
this.getWeek();
|
||||
},
|
||||
methods: {
|
||||
getTime() {
|
||||
this.currentDate = moment().format("yyyy-MM-DD");
|
||||
this.currentTime = moment().format("HH:mm:ss");
|
||||
},
|
||||
getCurrentTime() {
|
||||
},
|
||||
getCurrentTime() {
|
||||
const timer = setInterval(() => {
|
||||
this.getTime();
|
||||
}, 500);
|
||||
@ -68,42 +72,53 @@ export default {
|
||||
clearInterval(timer);
|
||||
});
|
||||
},
|
||||
getWeek(){
|
||||
var dt=new Date();
|
||||
let weekDay = ["星期天", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
|
||||
this.currentWeek = weekDay[dt.getDay()]
|
||||
},
|
||||
getAllModule() {
|
||||
var half = this.$store.state.userInfo.menuAuthority.moduleList
|
||||
console.log(half)
|
||||
getWeek() {
|
||||
var dt = new Date();
|
||||
let weekDay = [
|
||||
"星期天",
|
||||
"星期一",
|
||||
"星期二",
|
||||
"星期三",
|
||||
"星期四",
|
||||
"星期五",
|
||||
"星期六"
|
||||
];
|
||||
this.currentWeek = weekDay[dt.getDay()];
|
||||
},
|
||||
getAllModule() {
|
||||
var half = this.$store.state.userInfo.menuAuthority.moduleList;
|
||||
console.log(half);
|
||||
half.forEach(element => {
|
||||
console.log(element.moduleName)
|
||||
console.log(element.moduleName);
|
||||
if (element.moduleType == 4) {
|
||||
console.log(element)
|
||||
this.menuList.push(element)
|
||||
console.log(element);
|
||||
this.menuList.push(element);
|
||||
}
|
||||
});
|
||||
},
|
||||
toBack() {
|
||||
this.$router.push({ path:'/projectIndex' })
|
||||
this.$router.push({ path: "/projectIndex" });
|
||||
},
|
||||
menuClick(item, index) {
|
||||
console.log('item', item)
|
||||
console.log("item", item);
|
||||
this.menuIndex = index;
|
||||
|
||||
if (item.modulePath.includes('http://') || item.modulePath.includes('https://')) {
|
||||
return window.open(item.modulePath)
|
||||
}else{
|
||||
this.$router.push(item.modulePath)
|
||||
if (
|
||||
item.modulePath.includes("http://") ||
|
||||
item.modulePath.includes("https://")
|
||||
) {
|
||||
return window.open(item.modulePath);
|
||||
} else {
|
||||
this.$router.push(item.modulePath);
|
||||
}
|
||||
|
||||
if (item.moduleName == '智能安全帽') {
|
||||
if (item.moduleName == "智能安全帽") {
|
||||
let NodeRSA = require("node-rsa");
|
||||
//请求参数
|
||||
let params = JSON.stringify({
|
||||
// account: '妇幼保健院',
|
||||
account: this.$store.state.userInfo.account,
|
||||
page_flag: 3,
|
||||
page_flag: 3
|
||||
});
|
||||
//公钥
|
||||
const pubKey = `
|
||||
@ -112,20 +127,21 @@ export default {
|
||||
-----END PUBLIC KEY-----`;
|
||||
|
||||
var publicKey = new NodeRSA(pubKey);
|
||||
var async_key = publicKey.encrypt(params, 'base64')
|
||||
window.open("http://58.210.96.206:91/async_danzhou.html?async_key=" + async_key)
|
||||
var async_key = publicKey.encrypt(params, "base64");
|
||||
window.open(
|
||||
"http://58.210.96.206:91/async_danzhou.html?async_key=" + async_key
|
||||
);
|
||||
// window.location.href = "http://58.210.96.206:91/async_danzhou.html?async_key="+async_key;
|
||||
} else {
|
||||
this.$router.push(item.modulePath)
|
||||
this.$router.push(item.modulePath);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="less" scoped>
|
||||
@import url('./style.less');
|
||||
@import url("./style.less");
|
||||
|
||||
</style>
|
||||
@ -6,8 +6,14 @@
|
||||
<div class="purple"></div>
|
||||
<span>在职</span>
|
||||
<div class="topright">
|
||||
<p>在职平均年龄: <a>42</a></p>
|
||||
<p>在场平均年龄: <a>42</a></p>
|
||||
<p>
|
||||
在职平均年龄:
|
||||
<a>{{ statisticsCount.workercount.avgage.toFixed(0) }}</a>
|
||||
</p>
|
||||
<p>
|
||||
在场平均年龄:
|
||||
<a>{{ statisticsCount.presencecount.avgage.toFixed(0) }}</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mychart">
|
||||
@ -17,26 +23,85 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Card from '../components/Card.vue'
|
||||
import JBarChart from '../jChart/bar/JBarChart.vue'
|
||||
import Card from "../components/Card.vue";
|
||||
import JBarChart from "../jChart/bar/JBarChart.vue";
|
||||
import { selectProjectWorkerStatisticsApi } from "@/assets/js/api/dataBoard.js";
|
||||
export default {
|
||||
components: { Card, JBarChart },
|
||||
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default: 'default title'
|
||||
default: "default title"
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
xData: ['18岁及下', '18-45岁', '45-59岁', '60岁以上'],
|
||||
xData: ["18岁及下", "18-45岁", "45-59岁", "60岁以上"],
|
||||
series: [{ data: [22, 33, 22, 56] }, { data: [32, 22, 32, 15] }],
|
||||
color: ['#5be2f6', '#5281f7'],
|
||||
grid: ['10%', '5%', '15%', '5%']
|
||||
color: ["#5be2f6", "#5281f7"],
|
||||
grid: ["10%", "5%", "15%", "5%"],
|
||||
statisticsCount: {
|
||||
attendancePersonNum: 0,
|
||||
educationPersonNum: 0,
|
||||
workercount: {
|
||||
lwPersonYesterdayAdd: 0,
|
||||
eduPersonTotal: 0,
|
||||
jfGlPersonTotal: 0,
|
||||
age18: 0,
|
||||
age18to25: 0,
|
||||
womanPersonTotal: 0,
|
||||
lsPersonTotal: 0,
|
||||
jlGlPersonTotal: 0,
|
||||
age45to60: 0,
|
||||
lwPersonTotal: 0,
|
||||
manPersonTotal: 0,
|
||||
totalPerson: 0,
|
||||
age25to35: 0,
|
||||
glPersonTotal: 0,
|
||||
yfGlPersonTotal: 0,
|
||||
avgage: 0,
|
||||
age35to45: 0,
|
||||
glPersonYesterdayAdd: 0,
|
||||
age60: 0
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
selectProjectWorkerStatisticsApi({
|
||||
sn: this.$store.state.projectSn
|
||||
}).then(res => {
|
||||
console.log("-----", res);
|
||||
this.statisticsCount = res.result;
|
||||
var json1 = this.statisticsCount.presencecount;
|
||||
var json2 = this.statisticsCount.workercount;
|
||||
this.series = [
|
||||
{
|
||||
data: [
|
||||
json1.age18,
|
||||
json1.age18to25 + json1.age25to35 + json1.age18to25,
|
||||
json1.age45to60,
|
||||
json1.age60
|
||||
]
|
||||
},
|
||||
{
|
||||
data: [
|
||||
json2.age18,
|
||||
json2.age18to25 + json2.age25to35 + json2.age18to25,
|
||||
json2.age45to60,
|
||||
json2.age60
|
||||
]
|
||||
}
|
||||
];
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
||||
@ -29,11 +29,12 @@
|
||||
margin-top: 8px;
|
||||
margin-right: 50px;
|
||||
}
|
||||
.backImg{
|
||||
.wetherImg,.backImg{
|
||||
margin:10px 20px 0px 20px ;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
}
|
||||
.title{
|
||||
color: #fcfcfc;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user