mkl_power_box/index.html

1026 lines
50 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="https://cdn.makalu.cc/css/element-ui/index.css">
<link rel="stylesheet" href="/css/largeScreenLayout.css">
<link rel="stylesheet" href="/css/largeScreenStyle.css">
<link rel="stylesheet" href="/css/amplifyModuleStyle.css">
<title>数字化集成管控平台</title>
</head>
<body>
<div id="app">
<!--大屏背景-->
<background-video></background-video>
<!--大屏内容-->
<div class="screen-content-max">
<screen-header :nav="1" @itemdata="onItemData"></screen-header>
<div class="screen-content">
<el-row>
<el-col :span="6">
<module-one-1-1 label="项目概况" :amplify="true" name="Company-amplify-xmgk">
<div class="project-number">
<div>项目总数:<span v-cloak>{{proAll}}</span></div>
<div>在建项目数:<span v-cloak>{{buildingPro}}</span></div>
</div>
<project-overview-chart :typedata="typeDistributionData" text="项目总数" :height="230"></project-overview-chart>
</module-one-1-1>
<module-one-1-1 label="劳务人员概况" :amplify="true" name="Company-amplify-lwrygk">
<div class="warning-info">
<div class="warning-info-title">
<div :class="infoNav==1?'active':''" @click="onWarningInfoNav(1,'今日出勤')">今日出勤</div>
<div :class="infoNav==0?'active':''" @click="onWarningInfoNav(0,'在岗人数')">在岗人数</div>
</div>
<el-row>
<el-col :span="8">
<div class="survey_content">
<div class="survey_content_img">
<img :src="surveyUrl">
</div>
</div>
<div class="survey_content_number labour-survey_content_number">
<div class="survey_content_value"><span v-html="lwDataTotal"></span></div>
<p v-cloak>{{staffText}}</p>
</div>
</el-col>
<el-col :span="16">
<staff-survey-chart :height="220" :data="laborPersonnelData" :width="140"></staff-survey-chart>
</el-col>
</el-row>
</div>
</module-one-1-1>
<module-one-1-1 label="设备概况" :amplify="true" name="Company-amplify-sbgk">
<div class="survey_title">
<div class="survey_title_btn">
<div :class="overview==0?'survey_title_btn_min active':'survey_title_btn_min'" @click="onClickoOverview(0)">设备数量</div>
</div>
<div class="survey_title_btn">
<div :class="overview==1?'survey_title_btn_min active':'survey_title_btn_min'" @click="onClickoOverview(1)">绑定数量</div>
</div>
<div class="survey_title_btn">
<div :class="overview==2?'survey_title_btn_min active':'survey_title_btn_min'" @click="onClickoOverview(2)">监测数量</div>
</div>
</div>
<div class="survey_content">
<div class="survey_content_img">
<img :src="surveyUrlSb">
</div>
<div class="survey_content_number">
<p v-cloak>{{showOverViewLabel}}</p>
<div class="survey_content_value"><span v-cloak>{{showOverviewData.countNum}}</span></div>
</div>
</div>
<div class="survey_title">
<div class="survey_title_btn">
<div class="survey_text survey_text_zy"> </div>
<div class="survey_text_value">
<p>自有</p>
<span v-cloak>{{showOverviewData.zyNum}}</span>
</div>
</div>
<div class="survey_title_btn">
<div class="survey_text survey_text_zl"> </div>
<div class="survey_text_value">
<p>租赁</p>
<span v-cloak>{{showOverviewData.zlNum}}</span>
</div>
</div>
<div class="survey_title_btn">
<div class="survey_text survey_text_fb"> </div>
<div class="survey_text_value">
<p>分包</p>
<span v-cloak>{{showOverviewData.fbNum}}</span>
</div>
</div>
</div>
</module-one-1-1>
</el-col>
<el-col :span="12">
<china-map :data="newMapOutdata" :height="770" @projectid="projectClick"></china-map>
<!--<labour-china-map :data="mapOutdata" :tooltip="tooltipData" :height="770" @projectid="projectClick"></labour-china-map>-->
<div class="project-map-bottom">
<div class="analyse-title project-analyse-title">
<div class="analyse-text">重大节点逾期预警</div>
</div>
<div class="project-expect-max">
<div class="project-expect-left" @click="towardsLeft"></div>
<div class="project-expect-middle" >
<div :style="{'width': (majorWarningData.length*270)+'px','left':index*270+'px'}" ref="expect" class="project-expect-big">
<div class="project-expect-min" v-for="(item,i) in majorWarningData">
<div :class="item.state==0?'project-expect-list':'project-expect-list active'">
<div class="project-expect-con">
<div class="project-expect-title">
<div class="project-expect-title-No" v-cloak>{{i<10?('0'+(i+1)):i}}</div>
<div class="project-expect-title-text" v-cloak>{{item.projectName}}</div>
</div>
<div class="project-expect-info">
<el-row>
<el-col :span="7">重大节点:</el-col>
<el-col :span="17">
<div class="project-expect-details" v-cloak>{{item.majorNode}}</div>
</el-col>
</el-row>
<el-row style="padding-top: 5px;">
<el-col :span="7">时间节点:</el-col>
<el-col :span="17">
<div class="project-expect-time" v-cloak>{{item.timeNode}}</div>
</el-col>
</el-row>
</div>
<div class="project-expect-state" v-if="item.state==0">即将逾期</div>
<div class="project-expect-state" v-if="item.state==1" v-cloak>已逾期{{item.expectDays}}天</div>
</div>
</div>
</div>
</div>
</div>
<div class="project-expect-right" @click="towardsRight"></div>
</div>
</div>
</el-col>
<el-col :span="6">
<div class="analyse-max">
<div class="analyse-min">
<div class="analyse-title">
<div class="analyse-text">报警分析</div>
</div>
<el-row>
<el-col :span="8">
<div class="time-study-value">
<p>今日报警数</p>
<div class="analyse-num"><span v-cloak>{{showWarnDeviceNum}}</span></div>
</div>
<div class="time-study-value">
<p>本周报警数</p>
<div class="analyse-num"><span v-cloak>{{showWarnNum}}</span></div>
</div>
</el-col>
<el-col :span="16">
<div class="survey-oil-title">
<div class="survey-oil-hr"></div>
<div class="survey-oil-text">告警类型</div>
</div>
<div class="analyse-number-max" id="afootOverflowType" @mouseout="listMinMouseoutType" @mouseover="listMinMouseoverType">
<div class="glr-login-number-max analyse-num-max" v-for="item in warningType" >
<div class="glr-login-number-bgd glr-login-number-red-bgd"></div>
<div class="glr-login-number analyse-login-numbe">
<div><img src="/images//text_red_spot.png">{{item.name}}</div>
<div class="glr-rate-value glr-rate-red-value"><span>{{item.value}}</span></div>
</div>
</div>
<div class="glr-login-number-max analyse-num-max" v-for="(item,index) in warningList" @click="onOpenPopup(index,item.type)">
<div class="glr-login-number-bgd glr-login-number-red-bgd"></div>
<div class="glr-login-number analyse-login-numbe">
<div v-cloak><img src="/images//text_red_spot.png">{{item.type}}</div>
<div class="glr-rate-value glr-rate-red-value">
<span v-cloak>{{item.weekCount}}</span></div>
</div>
</div>
</div>
</el-col>
</el-row>
</div>
<div class="analyse-map">
<div class="analyse-title">
<div class="analyse-text">正在发生</div>
</div>
<div class="afoot-content">
<div class="afoot-overflow" id="afootOverflow" @mouseout="listMinMouseout" @mouseover="listMinMouseover">
<div class="afoot-con-for" v-for="(item,index) in warningData" v-if="index<200">
<div class="afoot-machinery-nam" v-cloak>{{item.equipment}}</div>
<div class="afoot-machinery-info">
<div class="afoot-machinery-img">
<img :src="item.warningImages" v-if="item.warningImages">
</div>
<div class="afoot-machinery-data">
<div class="afoot-machinery-state" v-cloak>{{item.warningContent}}</div>
<div class="afoot-machinery-time" v-cloak>{{item.warningTime}}</div>
</div>
</div>
<div class="afoot-machinery-project" v-cloak>项目:{{item.projectName}}</div>
<div class="afoot-machinery-project" v-if="item.warningAddress != ''" v-cloak>地址:{{item.warningAddress}}</div>
<!-- <machinery-baidu-map :data="item" v-if="item.latitude !=''"></machinery-baidu-map>-->
</div>
</div>
</div>
</div>
</div>
</el-col>
</el-row>
</div>
<!--报警分析-->
<transition name="el-zoom-in-top">
<div class="popup-project-introduction-max" v-show="warningShow" style="display: none"
@click="closeProjectIntroductionAll">
<div class="popup-project-introduction-min">
<div class="popup-project-introduction-con">
<div class="popup-project-introduction-title">
<div>告警列表</div>
<div class="popup-project-introduction-close" @click="closeProjectIntroduction">×</div>
</div>
<div class="popup-project-introduction-details">
<div class="sjk-chart-line-title sjk-chart-line-title-border" >
<div v-for="(item,i) in warningList" :class="warningNav==i?'active':''" @click="onWarningNavBtn(i,item.type)">{{item.type}}</div>
</div>
<div class="warning-popup-project-introduction-info" @scroll="scrollEventFn" ref="mianscroll">
<div class="warning-popup-project-for" v-for="item in warningListData">
<el-row>
<el-col :span="16">
<div class="warning-popup-project-data">
<div class="warning-popup-project-data-left">
<el-image
style="width: 60px; height: 60px"
:src="item.images"
:preview-src-list="[item.images]" v-if="item.images">
</el-image>
<img :src="item.warningImages" v-else="item.warningImages" width="60" height="60">
<div class="warning-popup-project-data-left-value">
<div class="warning-popup-color-blue" v-html="item.equipment"></div>
<div v-html="item.warning_time"></div>
</div>
</div>
<div class="warning-popup-project-data-right">
<div v-if="item.warningValue != ''">实际值:<span class="warning-popup-color-red" v-html="item.warningValue"></span></div>
<!--<div>预警值:<span class="warning-popup-color-blue" v-html="item.warningValue"></span></div>-->
</div>
</div>
<div class="warning-popup-project-data">
<div class="warning-popup-project-data-right">
<div>告警类型:<span class="warning-popup-color-silvery" v-cloak>{{item.warningName.replaceAll("预警","告警")}}</span></div>
<div>整改时间:<span class="warning-popup-color-blue"
v-html="item.processedTime==''?item.afootTime:item.processedTime"></span></div>
</div>
<div class="warning-popup-project-data-right">
<div style="width: 200%;">告警内容:<span class="warning-popup-color-silvery" v-cloak>{{item.warningContent.replaceAll("报警","告警")}}</span></div>
<div>整改人:<span class="warning-popup-color-blue"
v-html="item.processedUser==''?item.afootUser:item.processedUser"></span></div>
</div>
</div>
<div class="warning-popup-project-data">
<div class="warning-popup-project-data-right">
<div>告警时间:<span class="warning-popup-color-silvery" v-html="item.warningTime"></span></div>
</div><div class="warning-popup-project-data-right">
<div>整改方案:<span class="warning-popup-color-blue"
v-html="item.processedUser==''?item.afootUser:item.processedUser"></span></div>
</div>
</div>
<!-- <div class="warning-popup-color">整改方案:<span class="warning-popup-color-blue" v-html="item.processedRemarks==''?item.afootRemarks:item.processedRemarks"></span></div>-->
</el-col>
<el-col :span="8">
<machinery-baidu-map :data="item" :height="180" v-if="item.latitude !=''"></machinery-baidu-map>
</el-col>
</el-row>
</div>
</div>
</div>
</div>
</div>
</div>
</transition>
</div>
</div>
</body>
<script type="text/javascript" src="https://api.map.baidu.com/api?type=webgl&v=1.0&ak=5M76qMCiVjSG7bGOTcYmZdg0MQinsKve"></script>
<script src="https://cdn.makalu.cc/js/vue/vue.js"></script>
<script src="https://cdn.makalu.cc/js/element-ui/index.js"></script>
<script src="/js/jquery-3.0.0.min.js"></script>
<script src="/js/echarts.js"></script>
<script src="/js/china.js"></script>
<!--module-->
<script src="/components/module/module-one-1-1.js"></script>
<!--组件-->
<script src="/components/background_video.js"></script>
<script src="/components/header.js"></script>
<script src="/components/header-btn.js"></script>
<script src="/components/project-overview-chart.js"></script>
<script src="/components/staff-survey-chart.js"></script>
<script src="/components/labour-china-map.js"></script>
<script src="/components/china-map.js"></script>
<script src="/components/machinery-baidu-map.js"></script>
<!-- 请求依赖 -->
<script src="https://cdn.makalu.cc/js/axios/axios.min.js"></script>
<!--放大组件-->
<script src="/components/amplify/Company/xiangmugaikuang/amplify-xmgk.js"></script>
<script src="/components/amplify/Company/xiangmugaikuang/amplify-lwrygk.js"></script>
<script src="/components/amplify/Company/xiangmugaikuang/amplify-sbgk.js"></script>
<script>
let requestUrl = "https://jzgj.crfeb.com.cn/largeScreen/digitalConstruction/";
let deptId =103;
var vm = new Vue({
el: '#app',
data() {
return {
warningShow: false,
projectIdStr:"",
projectIdList:[],
projectList:JSON.parse(localStorage.getItem("projectList")),
//项目概况
typeDistributionData:[],
proAll:0,
buildingPro:0,
lwLoading:false,
lwDataTotal:0,
showOverViewLabel:'设备数量',
//劳务人员
infoNav:1,
staffText:'今日出勤',
surveyUrl:'/images/survey_icon_4.png',
laborPersonnelData:[],
//设备概况
overview:0,
overviewInterval:'',
surveyUrlSb:'/images/survey_icon_1.png',
showOverviewData:{},
//地图数据
mapOutdata : [],
//新 地图数据
newMapOutdata : [
{
'name': '陕西',
'count':'2',
'items':[
{
'projectName': '泾河新城荟锦坊二期',
'id':1,
},{
'projectName': '西安地铁2号线二期2标',
'id':2,
},
],
},{
'name': '江苏',
'count':'1',
'items':[
{
'projectName': '苏州桑田岛项目',
'id':3,
}
],
}
],
tooltipData:[],
//正在发生
warningData:[],
warning:{},
/*warningData[i].images 图标
* 机械 images/warning_jixie.png
* 测斜 images/warning_cexie.png
* 沉降 images/warning_chenjiang.png
* 吊重 images/warning_diaozhong.png
* 风速 images/warning_fengsu.png
* 幅度 images/warning_fudu.png
* 高度 images/warning_gaodu.png
* PM2.5 images/warning_PM2.5.png
* PM10 images/warning_PM10.png
* 倾角 images/warning_qingjiao.png
* 倾斜 images/warning_qingxie.png
* 人员 images/warning_renyuan.png
* 湿度 images/warning_shidu.png
* 水位 images/warning_shuiwei.png
* 位移 images/warning_weiyi.png
* 温度 images/warning_wendu.png
* 应力 images/warning_yingli.png
* 噪音 images/warning_zaoyin.png
* 转角 images/warning_zhuanjiao.png
* */
//重大节点预期预警 数据
index:0,
majorInterval:undefined,
majorWarningData:[],
//head 选择项目回显
localStorage:'',
//正在发生
warningInterval:undefined,
forIndex:0,
//预警类型
warningType:[],
warningTypeInterval:undefined,
warningTypeIndex:0,
showWarnDeviceNum:0,
showWarnNum:'',
warningList: [],
//项目级别数据
lwDataTotal1 :0,
lwDataTotal2 : 0,
lwDataTotal3 :0,
lwDataTotal4 :0,
//预警列表弹窗
warningShow:false,
warningNav:0,
warningListData:[],
pageNo:1,
pageFlag:true,
warningTypeId:'',
flag:true,
labourTableTitle:""
}
},
created() {
this.init()
},
mounted() {
//this.getWarnAnalysis();
},
methods: {
init(){
chooseMenu = {
mainMenu: 0,
itemMenu: 0,
}
localStorage.setItem("chooseMenu", JSON.stringify(chooseMenu));
var item = {
}
localStorage.setItem("data",JSON.stringify(item))
this.localStorage = JSON.parse(localStorage.getItem("data"))
//获取机智管家项目ID
this.getProjectIdList()
//地图数据
this.chartMap()
//设备概况点击事件定时器
this.overviewInterval = setInterval(this.overviewClick,5000);
//重大节点预期预警
this.majorInterval = setInterval(this.timer,5000);
//正在发生 定时器
this.warningInterval = setInterval(this.automaticRoll,5000);
//预警类型 定时器
this.warningTypeInterval = setInterval(this.automaticRollType,5000);
//查询项目概况数据
this.tableProject()
//设备概况
this.getOverviewData();
//请求重大节点数据
this.tableDangerList();
//劳务人员概况
this.getLWData(this.infoNav);
//报警分析
//this.getWarnAnalysis();
this.getProjectWarningTypeList();
// this.getProjectWarningList();
this.getProjectWarningListSize();
this.gainProjectMap()
},
//劳务人员概况
onWarningInfoNav(n,text){
this.infoNav = n
this.staffText = text
this.getLWData(this.infoNav);
if(n == 0){
this.surveyUrl = '/images/survey_icon_4.png'
}else{
this.surveyUrl = '/images/survey_icon_5.png'
}
},
closeProjectIntroduction() {
this.warningShow = false
},
closeProjectIntroductionAll(){
this.warningShow=false
},
//滚动分页
scrollEventFn(e){
if (e.srcElement.scrollTop + e.srcElement.clientHeight > e.srcElement.scrollHeight - 5 && this.flag ) {
console.log("倒低了");
this.flag = false;
this.pageNo = this.pageNo+1;
if(this.pageFlag){
this.getProjectWarningList(this.warningTypeId,this.pageNo);
}
}
},
//打开预警类型弹窗
onOpenPopup(index,warningTypeId){
this.warningShow = true
this.warningNav = index
this.warningTypeId = warningTypeId;
this.pageNo = 1;
this.warningListData = [];
this.getProjectWarningTypeList();
},
onWarningNavBtn(n,warningTypeId){
this.warningNav = n;
this.pageNo = 1;
this.warningTypeId = warningTypeId;
this.warningListData = [];
this.getProjectWarningTypeList();
},
gainProjectMap() {
this.newMapOutdata = []
let that = this
axios({
method: 'post',
url: "/api/building/listComProMap",
data: {
"dept_id":"131"
}
}).then(res => {
that.newMapOutdata = res.data.data
}).catch(err => {
})
},
//劳务人员概况
getLWData(infoNav){
this.lwLoading = true;
axios.post("https://smz.makalu.cc/mkl/screenApi/getAllUserData?token=00e650bb50854f54b146e83f73500ca8&deptId=131", {
}).then(res => {
this.lwLoadinglwLoading = false;
var laborPersonnelData = [];
if(infoNav == 0){
laborPersonnelData.push({text:"特种作业人员", value:res.data.userInfo.specialTotal})
laborPersonnelData.push({text:"劳务人员", value:res.data.userInfo.grrs})
laborPersonnelData.push({text:"管理人员", value:res.data.userInfo.glrs})
this.lwDataTotal = res.data.zgrs
}else{
laborPersonnelData.push({text:"特种作业人员", value:res.data.cqUserInfo.specialTotal})
laborPersonnelData.push({text:"劳务人员", value:res.data.cqUserInfo.grrs})
laborPersonnelData.push({text:"管理人员", value:res.data.cqUserInfo.glrs})
this.lwDataTotal = res.data.rcrs
}
this.ljaqjy = res.data.jspxrs;
var safetyEducationData = [];
var safetyEducationData2 = [];
safetyEducationData.push({text:"培训通过率",value:(res.data.jspxrs*res.data.pxtgl/100).toFixed(0)});
safetyEducationData2.push({text:"接受培训率",value:res.data.jspxrs});
this.safetyEducationData = safetyEducationData;
this.safetyEducationData2 = safetyEducationData2;
this.laborPersonnelData = laborPersonnelData;
this.pxTotal = res.data.jspxrs;
}).catch(err => {
})
},
//获取机制管家id
getProjectIdList(){
let projectList = this.projectList;
let projectIdList = [];
if(projectList != null && projectList.length > 0){
for (let i = 0; i < projectList.length ; i++) {
if(projectList[i].jzgj!="" && projectList[i].jzgj!=0){
projectIdList.push(projectList[i].jzgj);
}
}
}
this.projectIdList = projectIdList;
this.projectIdStr = projectIdList.toString();
},
//设备概况数据
getOverviewData(){
var that = this
axios.post(requestUrl+"getEquipmentOverview?deptId=131&projectId="+this.projectIdStr, {
}).then(res => {
that.overviewData = [res.data.data.count,res.data.data.bind,res.data.data.monitor];
that.showOverviewData = that.overviewData[0];
}).catch(err => {
})
},
//设备概况点击事件定时器方法
overviewClick(){
if(this.overview < 2){
this.overview = this.overview + 1
}else{
this.overview = 0
}
this.showOverviewData = this.overviewData[this.overview];
if(this.overview == 0){
this.surveyUrl = '/images/survey_icon_1.png'
this.showOverViewLabel= '设备数量'
}else if(this.overview == 1){
this.surveyUrl = '/images/survey_icon_2.png'
this.showOverViewLabel= '绑定数量'
}else{
this.surveyUrl = '/images/survey_icon_3.png'
this.showOverViewLabel= '监测数量'
}
},
//设备概况点击事件
onClickoOverview(n){
var that = this
that.overview = n
that.showOverviewData = this.overviewData[this.overview];
if(this.overview == 0){
this.surveyUrl = '/images/survey_icon_1.png'
this.showOverViewLabel= '设备数量'
}else if(this.overview == 1){
this.surveyUrl = '/images/survey_icon_2.png'
this.showOverViewLabel= '绑定数量'
}else{
this.surveyUrl = '/images/survey_icon_3.png'
this.showOverViewLabel= '监测数量'
}
},
//地图数据
chartMap(){
var num1 = 0;
var num2 = 0;
var num3 = 0;
var num4 = 0;
var that = this
axios.post(requestUrl+"getEquipmentOverview?deptId=131&projectId=1662", {
}).then(res => {
num1 = res.data.data.count.countNum
num2 = res.data.data.monitor.countNum
axios.post(requestUrl+"getEquipmentOverview?deptId=131&projectId=1713", {
}).then(res => {
num3 = res.data.data.count.countNum
num4 = res.data.data.monitor.countNum
var data = []
//1.获取项目人员概况
axios.post("https://smz.makalu.cc/mkl/screenApi/getPorjectUserData?token=00e650bb50854f54b146e83f73500ca8&deptId=131", {
}).then(res => {
data = res.data.porjectUserData
data.map(x => {
x.value = [x.longitude , x.latitude];
if(x.projectId == 159) {
x.count1 = num1;
x.count2 = num2;
} else if(x.projectId == 160) {
x.count1 = num3;
x.count2 = num4;
}
return x
})
this.mapOutdata = data
var tooltipInfo = []
for (let i = 0; i <data.length ; i++) {
var tipHtml = '<div style="width: 300px;background: url(\'/images/map_popup_bgd.png\') no-repeat center/100% 100%;font-size: 14px;">\n' +
' <div style="padding: 7px 3px 10px;">\n' +
' <div onclick="chartClick('+data[i].projectId+')" style="height: 33px;width:100%;background: url(\'/images/map_popup_title.png\') no-repeat center/100% 100%;padding-left: 5px;line-height: 33px;color: #ffffff;display: flex;justify-content: space-between;cursor: pointer">\n' +
' <div>'+data[i].project_shorthand+'</div>\n' +
' <div style="padding: 5px 10px"><img src="/images/check_icon.png" width="10" height="20"></div>\n' +
' </div>\n' +
' <div style="padding: 10px;color:#cbdaff;">\n' +
' <table style="width: 100%">\n' +
' <tr>\n' +
' <td style="width: 50%">\n' +
' <div style="height: 40px;line-height: 40px;"> 设备数量:<span style="color: #fff;font-size: 16px;">'+(data[i].count1==undefined?0:(data[i].count1))+'</span></div>\n' +
' </td>\n' +
' <td style="width: 50%">\n' +
' <div style="height: 40px;line-height: 40px;"> 监测数量:<span style="color: #fff;font-size: 16px;">'+(data[i].count2==undefined?0:(data[i].count2))+'</span></div>\n' +
' </td>\n' +
' </tr>\n' +
' <tr>\n' +
' <td style="width: 50%">\n' +
' <div style="height: 40px;line-height: 40px;"> 在岗人数:<span style="color: #fff;font-size: 16px;">'+data[i].zg+'</span></div>\n' +
' </td>\n' +
' <td style="width: 50%">\n' +
' <div style="height: 40px;line-height: 40px;"> 今日出勤:<span style="color: #fff;font-size: 16px;">'+data[i].cq+'</span></div>\n' +
' </td>\n' +
' </tr>\n' +
' </table>\n' +
' </div>\n' +
' <div style="padding: 0 12px;">\n' +
' <div style="color: #49b3ff;background: #132c55;padding: 10px;white-space:normal">'+data[i].project_addr+'</div>\n' +
' </div>\n' +
' </div>\n' +
'</div>'
tooltipInfo.push(tipHtml)
this.tooltipData = tooltipInfo
}
}).catch(err => {
})
}).catch(err => {
})
}).catch(err => {
})
},
//Echart 地图 点击返回值
projectClick(id){
var list = JSON.parse(localStorage.getItem("projectList"))
for (let i = 0; i < list.length ; i++) {
if(list[i].id == id){
localStorage.setItem("data",JSON.stringify(list[i]))
location.href = 'toIndexProject'
}
}
},
//head选择项目返回值
onItemData(e){
if(e.type != 1){
location.href = 'toIndexProject'
}
},
towardsLeft(){
if(this.index == 0){
this.$notify({
title: '提示',
message: '没有更多了!',
type: 'warning'
});
}else{
this.index = this.index+1
}
},
towardsRight(){
var length = this.majorWarningData.length
if(length>3){
if((length - Math.abs(this.index )) == 3){
this.$notify({
title: '提示',
message: '没有更多了!',
type: 'warning'
});
}else{
this.index = this.index-1
}
}
},
timer(){
var length = this.majorWarningData.length
if(length>3){
if((length - Math.abs(this.index )) == 3){
this.index = 0
}else{
this.index = this.index-1
}
}
},
//查询项目概况数据
tableProject() {
var that = this
axios({
method: 'post',
url: "/api/project/type",
data: {
"dept_id":"131"
}
}).then(res => {
that.proAll = res.data.data.proAll
that.buildingPro = res.data.data.buildingAll
that.typeDistributionData = res.data.data.typeProject
}).catch(err => {
})
},
//重大节点预期预警
tableDangerList() {
axios({
method: 'post',
url: "/api/danger/listProjectDanger",
data: {
"dept_id":"131"
}
}).then(res => {
this.majorWarningData = res.data.data
//var data = [];
res.data.data.map(x=>{
/*if(x.projectName == "南昌市轨道交通2号线" || x.name == "诺德智联中心项目") {
data.push(x)
}*/
})
}).catch(err => {
})
},
/* onValueHead(e) {
if(e.id == 0) {
window.location.href = "/weixin/screen/toIndex?projectName=" + e.text + "&projectId=" + e.id;
} else {
window.location.href = "/weixin/screen/toIndexProject?projectName=" + e.text;
}
},*/
automaticRollType(){
var height = $(".glr-login-number-max").innerHeight()
if($("#afootOverflowType").scrollTop() == height*this.warningType.length - $("#afootOverflowType").innerHeight()){
this.warningTypeIndex = 0
}else{
this.warningTypeIndex = this.warningTypeIndex + 1
}
$("#afootOverflowType").animate({scrollTop:(height*this.warningTypeIndex)+'px'})
},
listMinMouseoverType(){
clearInterval(this.warningTypeInterval);
},
listMinMouseoutType(){
this.warningTypeInterval=setInterval(this.automaticRollType,5000);
},
automaticRoll(){
var height = $(".afoot-con-for").innerHeight()
if(this.forIndex == this.warningData.length){
this.forIndex = 0
}else{
this.forIndex = this.forIndex + 1
}
$("#afootOverflow").animate({scrollTop:(height*this.forIndex)+'px'})
},
listMinMouseover(){
clearInterval(this.warningInterval);
},
listMinMouseout(){
this.warningInterval=setInterval(this.automaticRoll,10000);
},
//报警分析
getProjectWarningTypeList(){
axios.get("/api/warning/getProjectWarningTypeList",
{
params: {
"deptId": 131,
}
}
).then(res => {
this.warningList = res.data;
}).catch(err => {
})
},
// getProjectWarningList(){
// axios.get("/api/warning/getProjectWarningList",
// {
// params: {
// "deptId": 131,
// }
// }
// ).then(res => {
// this.warningData = res.data;
// }).catch(err => {
// })
// },
//本周时间
getWeekStartAndEnd(){
let data = new Date() //当前日期
let year = Number(data.getFullYear());//当前年
let month = Number(data.getMonth())+1;
let nowMonth =Number(data.getMonth()); //当前月
let day = Number(data.getDate()); //当天
//计算某日是本月第几周
let mydate=new Date(year,month-1,day);
let weekday=mydate.getDay(); //获取该日是星期几0代表星期日//今天本周的第几天
if(weekday == 0){
weekday = 7;
}
//本周的开始时间
let startDate = new Date(year, nowMonth, day + 1 - weekday);
let startyear = startDate.getFullYear();
let startmonth = (startDate.getMonth()+1) < 10 ? '0'+(startDate.getMonth()+1): startDate.getMonth()+1;
let startday = startDate.getDate() < 10 ? '0'+startDate.getDate() :startDate.getDate();
let startTime =startyear+'-'+startmonth+'-'+startday
//本周的结束时间
let endDate = new Date(year, nowMonth, day + 7 - weekday);
let sendyear = endDate.getFullYear();
let endmonth = (endDate.getMonth()+1) < 10 ? '0'+(endDate.getMonth()+1): endDate.getMonth()+1;
let endday = endDate.getDate() < 10 ? '0'+endDate.getDate() :endDate.getDate();
let endTime =sendyear+'-'+endmonth+'-'+endday
return {"startTime":startTime,"endTime":endTime};
},
//报警分析
getProjectWarningTypeList(){
let timeParam = this.getWeekStartAndEnd();
axios.get("/api/warning/getProjectWarningTypeList",
{
params: {
"deptId": 131,
"startDate": timeParam.startTime,
"endDate": timeParam.endTime
}
}
).then(res => {
this.warningList = res.data.list;
this.showWarnNum = res.data.weekNum;
})
},
getProjectWarningListSize(){
axios.get("/api/warning/getProjectWarningList",
{
params: {
"deptId": 131,
}
}
).then(res => {
this.showWarnDeviceNum = res.data.length;
})
},
getWarnAnalysis(){
axios.get(
"https://jzgj.crfeb.com.cn/largeScreen/digitalConstruction/getWarnAnalysis",
{params:{"deptId":131 }}
).then(res => {
let data = res.data.data;
this.warningType = data.type;
this.warning = data.count;
data.list.map(x=>{
x.images = "/images/warning_jixie.png"
})
this.warningData = data.list;
this.getDeviceWarnData();
}).catch(err => {
})
},
getDeviceWarnData(){
//安全预警
axios.get("https://aqzg.makalu.cc/api/statistics/getDeviceWarnData",{params:{"deptId":131}}
).then(res => {
let objArray = [];
for(let i = 0;i<res.data.length;i++){
let obj = {
"images":"/images/warning_jixie.png",
"address":"",
"latitude":"",
"equipment":res.data[i].towerName,
"time":res.data[i].warn_time,
"projectName":res.data[i].project_abbreviation,
"content":res.data[i].warn_context,
"longitude":""
}
objArray.push(obj);
}
for(let i = 0;i<this.warningData.length;i++){
objArray.push(this.warningData[i]);
}
this.warningData = objArray;
let array = this.arrCheck(res.data);
let count = array.length;
let warningType = this.warningType;
for(let i = 0;i<warningType.length;i++){
array.push(warningType[i]);
}
this.warningType = array;
this.warning = {
warnDeviceNum:parseInt(this.warning.warnDeviceNum)+count,
warnNum:parseInt(this.warning.warnNum)+parseInt(res.data.length)
};
}).catch(err => {
});
},
arrCheck(arr){
let map = {};
let dest = [];
for (let i = 0; i < arr.length; i++) {
let field = arr[i];
if (!map[field.warn_context]) {
dest.push({
name: field.warn_context,
value: 1
});
map[field.warn_context] = field ;
} else {
for (let j = 0; j < dest.length; j++) {
let fieldd= dest[j];
if (fieldd.name == field.warn_context) {
fieldd.value= fieldd.value+1;
break;
}
}
}
}
return dest;
},
},
})
</script>
</html>