From 24f18931577290f03f14fe6f7d24e0e99b55c28e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E7=8E=89=E7=90=A6?= <7507756+jiang_yuqi@user.noreply.gitee.com> Date: Sat, 14 Oct 2023 18:28:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/video/aiBoxVideo.js | 16 ++- src/pages/index.vue | 1 + src/pages/toAIVideoProject.vue | 240 ++++++++++++++++++++------------- 3 files changed, 163 insertions(+), 94 deletions(-) diff --git a/src/api/video/aiBoxVideo.js b/src/api/video/aiBoxVideo.js index 6d3be2b..ce640e3 100644 --- a/src/api/video/aiBoxVideo.js +++ b/src/api/video/aiBoxVideo.js @@ -14,9 +14,17 @@ const getVideoPassage=(deptId,projectId,passageType,importance)=> { }) } -const groupCountByAlarmType=(deptId,projectId)=> { +const groupCountByAlarmType=(deptId,projectId,now)=> { return request({ - url: `/bgscreen/aiBoxVideo/groupCountByAlarmType?deptId=${deptId||0}&projectId=${projectId||0}`, + url: `/bgscreen/aiBoxVideo/groupCountByAlarmType?deptId=${deptId||0}&projectId=${projectId||0}&now=${now}`, + method: 'get' + }) +} + +// 查询视频分布汇总 +const selectGroupCountVideoConfig=(deptId,projectId)=> { + return request({ + url: `/bgscreen/aiBoxVideo/selectGroupCountVideoConfig?deptId=${deptId||0}&projectId=${projectId||0}`, method: 'get' }) } @@ -24,5 +32,7 @@ const groupCountByAlarmType=(deptId,projectId)=> { export default{ listView, - getVideoPassage + getVideoPassage, + groupCountByAlarmType, + selectGroupCountVideoConfig } \ No newline at end of file diff --git a/src/pages/index.vue b/src/pages/index.vue index e40bfc9..4e8f47b 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -801,6 +801,7 @@ export default { sum += it.value; }) this.overviewTotal = sum; + console.log(tmps); this.typeDistributionData = tmps; this.elKey++; }) diff --git a/src/pages/toAIVideoProject.vue b/src/pages/toAIVideoProject.vue index bc47d3e..40d0dd7 100644 --- a/src/pages/toAIVideoProject.vue +++ b/src/pages/toAIVideoProject.vue @@ -3,66 +3,36 @@
- -
- - -
-
- -
-
-

项目监控

-
{{ 0 }}
-
-
-
- -
-
- -
-
-

吊钩监控

-
{{ 0 }}
-
-
-
- -
-
- -
-
-

AI识别监控

-
{{ 0 }}
-
-
-
- -
-
- -
-
-

离线视频

-
{{ 0 }}
-
-
-
-
-
-
- -
- + +
+
+
+ +
+
+
+

今日预警

+
+ {{overviewTotalDay}} 次 +
+
+
+

累计预警

+
+ {{overviewTotal}} 次 +
+
+ - -
+
+ + +
@@ -191,7 +161,7 @@ export default { //预警概况 overview: 0, overviewInterval: '', - overviewTotal: 100, + overviewTotal: 0, legendOpt1: { icon: "rect", textStyle: { @@ -208,15 +178,39 @@ export default { }, }, }, - overviewText: '预警数量', + overviewText: '累计预警', //原因类型分析 availabilityData: [], projectCategoryWidth: 200, //预警概况 typeDistributionData: [ - { name: '在建项目', value: '15' }, - { name: '项目总投资', value: '515.97' }, - { name: '项目年投资', value: '134.86' } + { name: '未戴安全帽', value: '0' }, + { name: '未穿工服', value: '0' }, + { name: '反光衣/带检测', value: '0' } + ], + overviewTextDay: '今日预警', + overviewTotalDay: 0, + overviewDay: 999, + legendOpt2: { + icon: "rect", + textStyle: { + fontSize: 14, + rich: { + name: { + color: "#c3dbfd", + padding: [10, 5, 20, 5], + }, + percent: { + color: "#f73647", + padding: [10, 5, 20, 5], + }, + }, + }, + }, + typeDistributionDataDay: [ + { name: '未戴安全帽', value: '0' }, + { name: '未穿工服', value: '0' }, + { name: '反光衣/带检测', value: '0' } ], } }, @@ -349,11 +343,8 @@ export default { this.getAiVideoInfoList("",""); this.getMajorAiVideoInfoList(); this.getAnalysisDetailList(); - // - // this.getAiVideoAlertorTypeCount(); - // this.getAiVideoAlertorTypeWarningCount(); - - + this.getAiVideoAlertorTypeCount(); + this.initAiVideoAlertorTypeDistribution(); }, //head选择项目返回值 onItemData(e){ @@ -486,32 +477,66 @@ export default { this.$api.aiBoxVideo.listView(this.dept?.id||0,this.projectInfo?.projectId).then((response) => { this.warningList = response.data||[]; }); - - this.$api.aiBoxVideo.groupCountByAlarmType(this.dept?.id||0,this.projectInfo?.projectId).then((response) => { - this.typeDistributionData=[]; - if(response.data){ - response.data.forEach(datum => { - this.typeDistributionData.push({name:datum.alarmTypeName,value:sumValue}) - }) - } - }); }, getAiVideoAlertorTypeCount(){ - axios.post(Host + "/api/video/getAiVideoAlertorTypeCount", { - projectId: JSON.parse(localStorage.getItem("data")).aqzg - }).then(res => { - var data = res.data; - var num = 0; - data.forEach(item =>{ - num += item.value; - }) - data.forEach(item =>{ - item.percent = (item.value/num*100).toFixed(2) - }) - this.scaleData = data; - }).catch(err => { - }) + // axios.post(Host + "/api/video/getAiVideoAlertorTypeCount", { + // projectId: JSON.parse(localStorage.getItem("data")).aqzg + // }).then(res => { + // var data = res.data; + // var num = 0; + // data.forEach(item =>{ + // num += item.value; + // }) + // data.forEach(item =>{ + // item.percent = (item.value/num*100) + // }) + // this.scaleData = data; + // }).catch(err => { + // }) + + //今日视图 + this.$api.aiBoxVideo.groupCountByAlarmType(this.dept?.id||0,this.projectInfo?.projectId,"Y").then((response) => { + if(response.data){ + let sum = 0; + response.data.forEach(datum => { + sum+=datum.value; + }) + this.overviewTotalDay = sum; + this.typeDistributionDataDay = response.data; + this.overviewDay++; + } + }); + + //累计视图 + this.$api.aiBoxVideo.groupCountByAlarmType(this.dept?.id||0,this.projectInfo?.projectId,"N").then((response) => { + if(response.data){ + let sum = 0; + response.data.forEach(datum => { + sum+=datum.value; + }) + this.overviewTotal = sum; + this.typeDistributionData = response.data; + this.overview++; + } + }); + }, + initAiVideoAlertorTypeDistribution(){ + this.$api.aiBoxVideo.selectGroupCountVideoConfig(this.dept?.id||0,this.projectInfo?.projectId).then((response) => { + let list=[]; + if(response.data){ + let sum = 0; + response.data.forEach(datum => { + sum += datum.value; + }) + response.data.forEach(datum => { + datum.text = datum.name; + datum.prop = (datum.value/sum*100).toFixed(2) + list.push(datum); + }) + this.availabilityData = list; + } + }); }, getAiVideoAlertorTypeWarningCount(){ axios.post(Host + "/api/video/getAiVideoAlertorTypeWarningCount", { @@ -699,4 +724,37 @@ export default { text-align: center; line-height: 420px; } +.my-svg-icon { + width: 40px; + height: 40px; + margin-bottom: 20px; +} + +.my-svg-icon * { + fill: #389DE3; + +} + +.people-number-con div.is-split { + background: none; +} + +.labour-education .number-unit { + position: relative; + bottom: -8px; +} + +.number-unit { + word-break: keep-all; +} + +.cost-out { + .labour-education { + height: 70px; + + .people-number-con { + padding: 0px; + } + } +} \ No newline at end of file