提交代码

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