湖里大屏(首页):年龄结构接口对接

This commit is contained in:
骆乐 2022-08-09 11:56:36 +08:00
parent e60f40410b
commit 79a4f6a138
5 changed files with 211 additions and 128 deletions

View File

@ -129,62 +129,62 @@ export default {
pageNo: 1, pageNo: 1,
pageSize: 20, pageSize: 20,
tableData: [], tableData: [],
options:[{
label: "防疫人员通知",
value: "17"
},{
label: "访客通知",
value: "18"
}],
// options:[{ // options:[{
// label: "",
// value: "8"
// },{
// label: "",
// value: "1"
// },{
// label: "", // label: "",
// value: "2" // value: "2"
// },{ // },{
// label: "",
// value: "3"
// },{
// label: "访", // label: "访",
// value: "16" // 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() { created() {

View File

@ -192,6 +192,7 @@ export default {
} }
} }
}, },
showSymbol:false,
data: this.data, data: this.data,
type: "line", type: "line",
smooth: true, smooth: true,

View File

@ -1,36 +1,41 @@
<template> <template>
<div class="dataBoardPage"> <div class="dataBoardPage">
<div class="headerBox"> <div class="headerBox">
<div class="topTit"> <div class="topTit">
<div class="time"> <div class="time">
<span>{{currentDate}}</span> <span>{{currentDate}}</span>
<span>{{currentWeek}}</span> <span>{{currentWeek}}</span>
<span>{{currentTime}}</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>
<div class="title"><h1 class="title">{{'金林湾项目监管平台'}}</h1></div> <div style="height: 40px" class="menuBox">
<div> <ul class="left">
<img class="backImg" src="../../../assets/images/projectImg/sun.png" alt="" /> <li
<span>多云 32</span> v-for="(item, index) in menuList"
<img class="backImg" @click="toBack()" src="../../../assets/images/projectImg/back.png" alt=""> :key="index"
</div> :class="{
</div>
<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, right: index > (menuList.length - 1) / 2,
active: $route.path == item.modulePath, active: $route.path == item.modulePath,
}" }"
@click="menuClick(item, index)" @click="menuClick(item, index)"
> >{{ item.moduleName }}</li>
{{ item.moduleName }} </ul>
</li> </div>
</ul>
</div> </div>
</div> <div class="dataBoardContent">
<div class="dataBoardContent">
<router-view></router-view> <router-view></router-view>
</div> </div>
</div> </div>
@ -39,27 +44,26 @@
<script> <script>
import moment from "moment"; import moment from "moment";
export default { export default {
data(){ data() {
return{ return {
menuList: [], menuList: [],
currentDate:'', currentDate: "",
currentTime:'', currentTime: "",
currentWeek:'', currentWeek: ""
} };
}, },
mounted(){ mounted() {
this.getAllModule(); this.getAllModule();
this.getCurrentTime(); this.getCurrentTime();
this.getTime(); this.getTime();
this.getWeek(); this.getWeek();
},
}, methods: {
methods:{ getTime() {
getTime() {
this.currentDate = moment().format("yyyy-MM-DD"); this.currentDate = moment().format("yyyy-MM-DD");
this.currentTime = moment().format("HH:mm:ss"); this.currentTime = moment().format("HH:mm:ss");
}, },
getCurrentTime() { getCurrentTime() {
const timer = setInterval(() => { const timer = setInterval(() => {
this.getTime(); this.getTime();
}, 500); }, 500);
@ -68,42 +72,53 @@ export default {
clearInterval(timer); clearInterval(timer);
}); });
}, },
getWeek(){ getWeek() {
var dt=new Date(); var dt = new Date();
let weekDay = ["星期天", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"]; let weekDay = [
this.currentWeek = weekDay[dt.getDay()] "星期天",
}, "星期一",
getAllModule() { "星期二",
var half = this.$store.state.userInfo.menuAuthority.moduleList "星期三",
console.log(half) "星期四",
"星期五",
"星期六"
];
this.currentWeek = weekDay[dt.getDay()];
},
getAllModule() {
var half = this.$store.state.userInfo.menuAuthority.moduleList;
console.log(half);
half.forEach(element => { half.forEach(element => {
console.log(element.moduleName) console.log(element.moduleName);
if (element.moduleType == 4) { if (element.moduleType == 4) {
console.log(element) console.log(element);
this.menuList.push(element) this.menuList.push(element);
} }
}); });
}, },
toBack() { toBack() {
this.$router.push({ path:'/projectIndex' }) this.$router.push({ path: "/projectIndex" });
}, },
menuClick(item, index) { menuClick(item, index) {
console.log('item', item) console.log("item", item);
this.menuIndex = index; this.menuIndex = index;
if (item.modulePath.includes('http://') || item.modulePath.includes('https://')) { if (
return window.open(item.modulePath) item.modulePath.includes("http://") ||
}else{ item.modulePath.includes("https://")
this.$router.push(item.modulePath) ) {
return window.open(item.modulePath);
} else {
this.$router.push(item.modulePath);
} }
if (item.moduleName == '智能安全帽') { if (item.moduleName == "智能安全帽") {
let NodeRSA = require("node-rsa"); let NodeRSA = require("node-rsa");
// //
let params = JSON.stringify({ let params = JSON.stringify({
// account: '', // account: '',
account: this.$store.state.userInfo.account, account: this.$store.state.userInfo.account,
page_flag: 3, page_flag: 3
}); });
// //
const pubKey = ` const pubKey = `
@ -112,20 +127,21 @@ export default {
-----END PUBLIC KEY-----`; -----END PUBLIC KEY-----`;
var publicKey = new NodeRSA(pubKey); var publicKey = new NodeRSA(pubKey);
var async_key = publicKey.encrypt(params, 'base64') var async_key = publicKey.encrypt(params, "base64");
window.open("http://58.210.96.206:91/async_danzhou.html?async_key=" + async_key) 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; // window.location.href = "http://58.210.96.206:91/async_danzhou.html?async_key="+async_key;
} else { } else {
this.$router.push(item.modulePath) this.$router.push(item.modulePath);
} }
} }
} }
} };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@import url('./style.less'); @import url("./style.less");
</style> </style>

View File

@ -6,8 +6,14 @@
<div class="purple"></div> <div class="purple"></div>
<span>在职</span> <span>在职</span>
<div class="topright"> <div class="topright">
<p>在职平均年龄 <a>42</a></p> <p>
<p>在场平均年龄 <a>42</a></p> 在职平均年龄
<a>{{ statisticsCount.workercount.avgage.toFixed(0) }}</a>
</p>
<p>
在场平均年龄
<a>{{ statisticsCount.presencecount.avgage.toFixed(0) }}</a>
</p>
</div> </div>
</div> </div>
<div class="mychart"> <div class="mychart">
@ -17,26 +23,85 @@
</template> </template>
<script> <script>
import Card from '../components/Card.vue' import Card from "../components/Card.vue";
import JBarChart from '../jChart/bar/JBarChart.vue' import JBarChart from "../jChart/bar/JBarChart.vue";
import { selectProjectWorkerStatisticsApi } from "@/assets/js/api/dataBoard.js";
export default { export default {
components: { Card, JBarChart }, components: { Card, JBarChart },
props: { props: {
title: { title: {
type: String, type: String,
default: 'default title' default: "default title"
} }
}, },
data() { data() {
return { 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] }], series: [{ data: [22, 33, 22, 56] }, { data: [32, 22, 32, 15] }],
color: ['#5be2f6', '#5281f7'], color: ["#5be2f6", "#5281f7"],
grid: ['10%', '5%', '15%', '5%'] 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> </script>
<style lang="less" scoped> <style lang="less" scoped>

View File

@ -29,11 +29,12 @@
margin-top: 8px; margin-top: 8px;
margin-right: 50px; margin-right: 50px;
} }
.backImg{ .wetherImg,.backImg{
margin:10px 20px 0px 20px ; margin:10px 20px 0px 20px ;
width: 20px; width: 20px;
height: 20px; height: 20px;
} }
} }
.title{ .title{
color: #fcfcfc; color: #fcfcfc;