update code

dev-login
haha 2023-08-13 12:31:50 +08:00
parent 1fe3b97466
commit 89f2e8bd4e
4 changed files with 165 additions and 104 deletions

View File

@ -27,7 +27,6 @@ const safetySummaryByProject=(deptId,roleType)=>{
})
}
//质量整改-安全分类汇总(按项目)
const qualitySummaryByProject=(deptId,roleType)=>{
return request({
@ -36,6 +35,17 @@ const qualitySummaryByProject=(deptId,roleType)=>{
})
}
export default{
safetySummary,qualitySummary,safetySummaryByProject,qualitySummaryByProject
//项目监测预警查询,用于大屏项目概况
const getMonitAndWarning=(deptId,projectId=0)=>{
return request({
url: `bgscreen/problemmodify/getMonitAndWarning?deptId=${deptId}&projectId=${projectId}`,
method: 'get'
})
}
export default{
safetySummary,qualitySummary,safetySummaryByProject,qualitySummaryByProject,getMonitAndWarning
}

View File

@ -0,0 +1,137 @@
<template>
<el-row :key="elKey">
<el-col :span="8">
<div class="time-study-value">
<p>今日预警数</p>
<div class="analyse-num"><span>{{ todayCnt }}</span> </div>
</div>
<div class="time-study-value">
<p>本周预警数</p>
<div class="analyse-num"><span>{{ weekCnt}}</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" style="height: unset;">
<div class="glr-login-number-max analyse-num-max" v-for="(item, idx) in warningType" style="height: unset;"
:key="idx">
<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.data }}/{{ item.total }}</span>
</div>
</div>
</div>
</div>
</el-col>
</el-row>
</template>
<script>
export default {
name: 'JhbigscreenMonitAndWarning',
props:{
type:{
type:String,
default:'index'
}
},
data() {
return {
elKey:0,
prjInfo:{},
deptInfo:{},
todayCnt:0,
weekCnt:0,
warningType: [
{
name: 'AI预警',
data: 0,
total: 0
}, {
name: '安全预警',
data: 0,
total: 0
}, {
name: '质量预警',
data: 0,
total: 0
}, {
name: '环境预警',
data: 0,
total: 0
},
],
};
},
mounted() {
this.$bus.$on("projectChange", res => {
this.prjInfo = res;
if(this.deptInfo.text){
this.getMonitAndWarning();
}
});
this.$bus.$on("deptChange",dept=>{
this.deptInfo=dept;
if(this.prjInfo.id){
this.getMonitAndWarning();
}
});
},
methods: {
getMonitAndWarning(){
let prjId=0;
if(this.type=='detail'){
prjId=this.prjInfo.id;
}
this.$api.problemmodify.getMonitAndWarning(this.deptInfo.id,prjId).then(d=>{
let tmps=d.data?.today||[];
let sum=0;
tmps.forEach(it=>{
sum+=it.id;
})
this.todayCnt=sum;
sum=0;
tmps=d.data?.week||[];
tmps.forEach(it=>{
sum+=it.id;
})
this.weekCnt=sum;
let data=0;
sum=0;
tmps=d.data?.group||[];
let objs=tmps.filter(it=>it.infoType==0);
objs.forEach(it=>{
sum+=it.id;
if(it.checkState==4){
data+=it.id;
}
});
this.warningType[1].data=data;
this.warningType[1].total=sum;
data=0;
sum=0;
tmps=d.data?.group||[];
objs=tmps.filter(it=>it.infoType==1);
objs.forEach(it=>{
sum+=it.id;
if(it.checkState!=4){
data+=it.id;
}
});
this.warningType[2].data=data;
this.warningType[2].total=sum;
this.elKey++;
});
},
},
};
</script>
<style lang="scss" scoped></style>

View File

@ -187,35 +187,7 @@
</div>
</module-one-1-1>
<module-one-1-1 label="项目监测预警">
<el-row>
<el-col :span="8">
<div class="time-study-value">
<p>今日预警数</p>
<div class="analyse-num"><span>6</span> </div>
</div>
<div class="time-study-value">
<p>本周预警数</p>
<div class="analyse-num"><span>23</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" style="height: unset;">
<div class="glr-login-number-max analyse-num-max" v-for="(item, idx) in warningType"
style="height: unset;" :key="idx">
<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.data }}/{{ item.total }}</span></div>
</div>
</div>
</div>
</el-col>
</el-row>
<MonitAndWarning></MonitAndWarning>
</module-one-1-1>
</el-col>
</el-row>
@ -239,13 +211,15 @@ import indexDlg1 from './index/indexDlg1'
import indexDlg2 from './index/indexDlg2'
import indexDlg3 from './index/indexDlg3'
import indexMap from './index/map.vue'
import MonitAndWarning from './components/MonitAndWarning.vue'
export default {
name: 'App',
components: {
indexDlg1,
indexDlg2,
indexDlg3,
indexMap
indexMap,
MonitAndWarning
},
data() {
return {
@ -445,30 +419,7 @@ export default {
//
warningInterval: undefined,
forIndex: 0,
//
warningType: [
{
name: 'AI预警',
data: 0,
total: 0
}, {
name: '安全预警',
data: 1,
total: 5
}, {
name: '质量预警',
data: 2,
total: 6
}, {
name: '环境预警',
data: 3,
total: 12
},
],
warningTypeInterval: undefined,
warningTypeIndex: 0,
forIndex: 0,
projectCategory:[],
projectCategoryWidth:200,
deptInfo:{},
@ -491,9 +442,10 @@ export default {
this.deptInfo=dept;
this.onClickoOverview(0)
this.qualityNavClick(0);
});
},
methods: {
methods: {
qualityNavClick(n){
this.qualityNav=n;
if(n==0){
@ -583,9 +535,7 @@ export default {
//
this.majorInterval = setInterval(this.timer, 5000);
//
this.warningInterval = setInterval(this.automaticRoll, 5000);
//
this.warningTypeInterval = setInterval(this.automaticRollType, 5000);
this.warningInterval = setInterval(this.automaticRoll, 5000);
},
doPrjProcess(n, text) {
this.prjProcessNav = n;
@ -836,21 +786,8 @@ export default {
}
},
automaticRollType() {
var height = window.$(".glr-login-number-max").innerHeight()
if (window.$("#afootOverflowType").scrollTop() == height * this.warningType.length - window.$("#afootOverflowType").innerHeight()) {
this.warningTypeIndex = 0
} else {
this.warningTypeIndex = this.warningTypeIndex + 1
}
window.$("#afootOverflowType").animate({ scrollTop: (height * this.warningTypeIndex) + 'px' })
},
listMinMouseoverType() {
clearInterval(this.warningTypeInterval);
},
listMinMouseoutType() {
this.warningTypeInterval = setInterval(this.automaticRollType, 5000);
},
automaticRoll() {
var height = window.$(".afoot-con-for").innerHeight()

View File

@ -356,33 +356,7 @@
</div>
</module-one-1-1>
<module-one-1-1 label="项目安全/质量隐患">
<el-row>
<el-col :span="8">
<div class="time-study-value">
<p>今日预警数</p>
<div class="analyse-num"><span>8</span> </div>
</div>
<div class="time-study-value">
<p>本周预警数</p>
<div class="analyse-num"><span>28</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" style="height: unset;">
<div class="glr-login-number-max analyse-num-max" v-for="item in warningType" style="height: unset;">
<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.data}}/{{item.total}}</span></div>
</div>
</div>
</div>
</el-col>
</el-row>
<MonitAndWarning type="detail"></MonitAndWarning>
</module-one-1-1>
</el-col>
</el-row>
@ -397,8 +371,11 @@ import '../components/module/module-one-1-2'
import '../components/background_video'
import '../components/header'
import '../components/staff-survey-chart'
import MonitAndWarning from './components/MonitAndWarning.vue'
export default {
components:{
MonitAndWarning
},
data() {
return {
dept:null,