提交代码

prv
姜玉琦 2024-03-28 01:21:13 +08:00
parent be9d64e88f
commit 47720295c5
1 changed files with 163 additions and 134 deletions

View File

@ -3,25 +3,48 @@
<el-col :span="8"> <el-col :span="8">
<div class="time-study-value"> <div class="time-study-value">
<p>今日预警数</p> <p>今日预警数</p>
<div class="analyse-num"><span>{{ todayCnt }}</span> </div> <div class="analyse-num">
<span>{{ todayCnt }}</span>
</div>
</div> </div>
<div class="time-study-value"> <div class="time-study-value">
<p>本周预警数</p> <p>本周预警数</p>
<div class="analyse-num"><span>{{ weekCnt}}</span> </div> <div class="analyse-num">
<span>{{ weekCnt }}</span>
</div>
</div> </div>
</el-col> </el-col>
<el-col :span="16"> <el-col :span="16">
<div class="survey-oil-title"> <div class="survey-oil-title">
<div class="survey-oil-hr"></div> <div class="survey-oil-hr"></div>
<div class="survey-oil-text">预警类型</div> <div class="survey-oil-text">预警类型</div>
<div class="survey-oil-summary" style="position: absolute;right: 0px;top: 8px;font-size: 15px;padding: 0 15px; background: #000b25;"><span style="font-weight: 800;color:red">未完成</span>/<span style="color:#c0dafb">总数</span></div> <div
class="survey-oil-summary"
style="
position: absolute;
right: 0px;
top: 8px;
font-size: 15px;
padding: 0 15px;
background: #000b25;
"
>
<span style="font-weight: 800; color: red">未完成</span>/<span
style="color: #c0dafb"
>总数</span
>
</div> </div>
<div class="analyse-number-max" id="afootOverflowType" style="height: unset;"> </div>
<div class="glr-login-number-max analyse-num-max" v-for="(item, idx) in warningType" style="height: unset;" <div class="analyse-number-max" id="afootOverflowType" style="height: unset">
:key="idx"> <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-bgd glr-login-number-red-bgd"></div>
<div class="glr-login-number analyse-login-numbe"> <div class="glr-login-number analyse-login-numbe">
<div><img src="images/text_red_spot.png">{{ item.name }}</div> <div><img src="images/text_red_spot.png" />{{ item.name }}</div>
<div class="glr-rate-value glr-rate-red-value"> <div class="glr-rate-value glr-rate-red-value">
<span>{{ item.data }}/{{ item.total }}</span> <span>{{ item.data }}/{{ item.total }}</span>
</div> </div>
@ -34,108 +57,114 @@
<script> <script>
export default { export default {
name: 'JhbigscreenMonitAndWarning', name: "JhbigscreenMonitAndWarning",
props:{ props: {
type:{ type: {
type:String, type: String,
default:'index' default: "index",
} },
}, },
data() { data() {
return { return {
elKey:0, elKey: 0,
prjInfo:{}, prjInfo: {},
deptInfo:{}, deptInfo: {},
todayCnt:0, todayCnt: 0,
weekCnt:0, weekCnt: 0,
warningType: [ warningType: [
{ {
name: 'AI预警', name: "AI预警",
data: 0, data: 0,
total: 0 total: 0,
}, { },
name: '安全预警', {
name: "安全预警",
data: 0, data: 0,
total: 0 total: 0,
}, { },
name: '质量预警', {
name: "质量预警",
data: 0, data: 0,
total: 0 total: 0,
} },
], ],
}; };
}, },
mounted() { mounted() {
this.$bus.$on("projectChange", res => { this.$bus.$on("projectChange", (res) => {
this.prjInfo = res; this.prjInfo = res;
if(this.deptInfo.text){ if (this.deptInfo.text) {
this.getMonitAndWarning(); this.getMonitAndWarning();
} }
}); });
this.$bus.$on("deptChange",dept=>{ this.$bus.$on("deptChange", (dept) => {
this.deptInfo=dept; this.deptInfo = dept;
if(this.prjInfo.id){ if (this.prjInfo.id) {
this.getMonitAndWarning(); this.getMonitAndWarning();
} }
}); });
}, },
created() {
this.init();
},
methods: { methods: {
getMonitAndWarning(){ init() {
let prjId=0; this.getMonitAndWarning();
if(this.type=='detail'){ },
prjId=this.prjInfo.id; getMonitAndWarning() {
let prjId = 0;
if (this.type == "detail") {
prjId = this.prjInfo.id;
} }
this.$api.problemmodify.getMonitAndWarning(this.deptInfo.id,prjId).then(d=>{ this.$api.problemmodify.getMonitAndWarning(this.deptInfo.id||0, prjId).then((d) => {
let tmps=d.data?.today||[]; let tmps = d.data?.today || [];
let sum=0; let sum = 0;
tmps.forEach(it=>{ tmps.forEach((it) => {
sum+=it.total; sum += it.total;
}); });
this.todayCnt=sum; this.todayCnt = sum;
sum=0; sum = 0;
tmps=d.data?.week||[]; tmps = d.data?.week || [];
tmps.forEach(it=>{ tmps.forEach((it) => {
sum+=it.total; sum += it.total;
}); });
this.weekCnt=sum; this.weekCnt = sum;
let data=0; let data = 0;
sum=0; sum = 0;
tmps=d.data?.group||[]; tmps = d.data?.group || [];
let objs=tmps.filter(it=>it.infotype=="0"); let objs = tmps.filter((it) => it.infotype == "0");
objs.forEach(it=>{ objs.forEach((it) => {
sum+=it.total; sum += it.total;
if(it.checkState!="4"){ if (it.checkState != "4") {
data+=it.total; data += it.total;
} }
}); });
this.warningType[1].data=data; this.warningType[1].data = data;
this.warningType[1].total=sum; this.warningType[1].total = sum;
data=0; data = 0;
sum=0; sum = 0;
tmps=d.data?.group||[]; tmps = d.data?.group || [];
objs=tmps.filter(it=>it.infotype=="1"); objs = tmps.filter((it) => it.infotype == "1");
objs.forEach(it=>{ objs.forEach((it) => {
sum+=it.total; sum += it.total;
if(it.checkState!="4"){ if (it.checkState != "4") {
data+=it.total; data += it.total;
} }
}); });
this.warningType[2].data=data; this.warningType[2].data = data;
this.warningType[2].total=sum; this.warningType[2].total = sum;
data=0; data = 0;
sum=0; sum = 0;
tmps=d.data?.group||[]; tmps = d.data?.group || [];
objs=tmps.filter(it=>it.infotype=="96"); objs = tmps.filter((it) => it.infotype == "96");
objs.forEach(it=>{ objs.forEach((it) => {
sum+=it.total; sum += it.total;
if(it.checkState!="4"){ if (it.checkState != "4") {
data+=it.total; data += it.total;
} }
}); });
this.warningType[0].data=data; this.warningType[0].data = data;
this.warningType[0].total=sum; this.warningType[0].total = sum;
this.elKey++; this.elKey++;
}); });
}, },