提交代码

prv
姜玉琦 2023-10-15 15:43:00 +08:00
parent 4bd9fd33a8
commit c3c065d4a3
1 changed files with 345 additions and 328 deletions

View File

@ -189,19 +189,19 @@ export default {
],
overviewTextDay: '今日预警',
overviewTotalDay: 0,
overviewDay: 999,
overviewDay: 0,
legendOpt2: {
icon: "rect",
textStyle: {
fontSize: 14,
color: "#c3dbfd",
rich: {
name: {
color: "#c3dbfd",
padding: [10, 5, 20, 5],
padding: [0, 20, 0, 0],
},
percent: {
color: "#f73647",
padding: [10, 5, 20, 5],
},
},
},
@ -211,19 +211,26 @@ export default {
{ name: '未穿工服', value: '0' },
{ name: '反光衣/带检测', value: '0' }
],
initfunc:null
}
},
mounted() {
this.$bus.$on("projectChange", debounce(res => {
this.projectInfo=res;
console.log("项目改变");
console.log(this.projectInfo);
this.init();
}));
this.$bus.$on("loadProjects", debounce(prjs => {
this.projectInfos = prjs;
console.log("项目加载");
console.log(this.projectInfos);
this.init();
}))
this.$bus.$on("deptChange", debounce(dept => {
this.dept = dept;
console.log("部门改变");
console.log(this.dept);
this.init();
}));
if(this.$root.hasInitHeader){
@ -234,7 +241,7 @@ export default {
});
},
created() {
this.init()
//this.init()
},
computed: {
playDivCss() {
@ -351,7 +358,7 @@ export default {
el.scrollTop=0;
}
}
this.listTimer=setTimeout(func,100);
this.listTimer=setTimeout(func,120);
}
func();
},
@ -359,14 +366,20 @@ export default {
this.projectInfo=this.$root.project;
this.dept=this.$root.dept;
this.projectInfos=this.$root.projects;
console.log("initMe");
this.init();
},
init(){
clearTimeout(this.initfunc);
let initfunc=()=>{
this.getAlertorTypeList();
this.getAiVideoInfoList("","");
this.getMajorAiVideoInfoList();
this.getAnalysisDetailList();
this.getAiVideoAlertorTypeCount();
this.initAiVideoAlertorTypeDistribution();
}
this.initfunc = setTimeout(initfunc, 50); //
},
//head
onItemData(e){
@ -432,7 +445,7 @@ export default {
// this.videoList = data;
// }).catch(err => {
// })
this.$api.aiBoxVideo.getVideoPassage(this.dept?.id||0,this.projectInfo?.projectId||0,passageType,importance).then((response) => {
this.$api.aiBoxVideo.getVideoPassage(this.dept?.id||0,this.projectInfo?.id||0,passageType,importance).then((response) => {
let list = [];
if(response.data){
response.data.forEach((it) =>{
@ -471,7 +484,7 @@ export default {
// this.majorVideoList = data;
// }).catch(err => {
// })
this.$api.aiBoxVideo.getVideoPassage(this.dept?.id||0,this.projectInfo?.projectId||0,"","Y").then((response) => {
this.$api.aiBoxVideo.getVideoPassage(this.dept?.id||0,this.projectInfo?.id||0,"","Y").then((response) => {
let list = [];
if(response.data){
response.data.forEach((it) =>{
@ -496,7 +509,7 @@ export default {
});
},
getAnalysisDetailList(){
this.$api.aiBoxVideo.listView(this.dept?.id||0,this.projectInfo?.projectId).then((response) => {
this.$api.aiBoxVideo.listView(this.dept?.id||0,this.projectInfo?.id).then((response) => {
this.warningList = response.data||[];
});
@ -518,7 +531,7 @@ export default {
// })
//
this.$api.aiBoxVideo.groupCountByAlarmType(this.dept?.id||0,this.projectInfo?.projectId,"Y").then((response) => {
this.$api.aiBoxVideo.groupCountByAlarmType(this.dept?.id||0,this.projectInfo?.id,"Y").then((response) => {
if(response.data){
let sum = 0;
response.data.forEach(datum => {
@ -531,7 +544,7 @@ export default {
});
//
this.$api.aiBoxVideo.groupCountByAlarmType(this.dept?.id||0,this.projectInfo?.projectId,"N").then((response) => {
this.$api.aiBoxVideo.groupCountByAlarmType(this.dept?.id||0,this.projectInfo?.id,"N").then((response) => {
if(response.data){
let sum = 0;
response.data.forEach(datum => {
@ -544,7 +557,7 @@ export default {
});
},
initAiVideoAlertorTypeDistribution(){
this.$api.aiBoxVideo.selectGroupCountVideoConfig(this.dept?.id||0,this.projectInfo?.projectId).then((response) => {
this.$api.aiBoxVideo.selectGroupCountVideoConfig(this.dept?.id||0,this.projectInfo?.id).then((response) => {
let list=[];
if(response.data){
let sum = 0;
@ -553,7 +566,11 @@ export default {
})
response.data.forEach(datum => {
datum.text = datum.name;
datum.prop = (datum.value/sum*100).toFixed(2)
if(sum==0){
datum.prop = 0.0;
}else{
datum.prop = (datum.value/sum*100).toFixed(1);
}
list.push(datum);
})
this.availabilityData = list;