| | |
| | | <img class="jzxz2" src="/images/data-v/jzxz2.png" /> |
| | | </div> |
| | | </div> |
| | | <div class="head_top"><span>æºæ
§å·¥åå¯è§å驾驶è±</span></div> |
| | | <div class="head_top"> |
| | | <div class="time">{{ timeStr }}</div> |
| | | <span>æºæ
§å·¥åå¯è§å驾驶è±</span> |
| | | </div> |
| | | <div class="visual"> |
| | | <div class="left-top10"> |
| | | <div class="title"> |
| | | <span>é¨é¨åè¦æ°é TOP10</span> |
| | | </div> |
| | | |
| | | <div class="top10-list" v-for="(v, idx) in top10" :key="idx"> |
| | | <div class="list-0">{{ idx + 1 }}</div> |
| | | <div class="list-1">{{ v.name }}</div> |
| | | <div class="list-2">{{ v.totalWarn }}</div> |
| | | <img class="list-img" src="/images/data-v/line.png" alt="" /> |
| | | </div> |
| | | </div> |
| | | <div class="center"> |
| | | <div class="center-left"> |
| | | <div class="center-count"> |
| | | <b>219</b> |
| | | <p style="margin-top:2px">å½åçæµç¹æ»é</p> |
| | | <p style="margin-top:35px">åºæ¯æ»é: 800</p> |
| | | <p style="margin-top:5px">ç®æ³æ»é: 11</p> |
| | | <b style="font-size: 40px;">{{ warnTotal }}</b> |
| | | <p style="margin-top:2px">7æ¥å
é¢è¦æ»é</p> |
| | | <p style="margin-top:35px">è®¾å¤æ»é: 974</p> |
| | | <p style="margin-top:5px">çæµç¹æ»é: {{ cameraTotal }}</p> |
| | | </div> |
| | | </div> |
| | | <div class="center-right"> |
| | | <div class="chart"> |
| | | <el-progress :stroke-width="15" type="circle" :percentage="checkRate"></el-progress> |
| | | </div> |
| | | <span>å¨</span><span>ææ¥ç</span> |
| | | <div class="chart"> |
| | | <el-progress :stroke-width="15" type="circle" :percentage="solveRate"></el-progress> |
| | | </div> |
| | | <span>å¨</span><span>æ´æ¹ç</span> |
| | | <div class="chart"> |
| | | <el-progress :stroke-width="15" type="circle" :percentage="manageRate"></el-progress> |
| | | </div> |
| | | <span>å¨</span><span>å¤çç</span> |
| | | </div> |
| | | </div> |
| | | <div class="right-week"> |
| | | <div class="title"> |
| | | <span>è¿7æ¥æ´æ¹æ°éç»è®¡</span> |
| | | <span>è¿7æ¥ææ¥æ°éç»è®¡</span> |
| | | </div> |
| | | <div id="barChart" style="width: 100%;height:100%"></div> |
| | | </div> |
| | |
| | | |
| | | <script> |
| | | import * as echarts from "echarts" |
| | | import * as Base64 from "js-base64" |
| | | import { analysisReport } from "@/api/es" |
| | | import { getLocalCameraTree } from "@/api/area" |
| | | import { getClusterDevList } from "@/api/clusterManage" |
| | | |
| | | export default { |
| | | components: {}, |
| | | computed: { |
| | | solvedPre() { |
| | | if (this.solvedTotal == 0 || this.tableDataList.length == 0) { |
| | | return 0 |
| | | } |
| | | return parseInt(this.solvedTotal / this.tableDataList.length) |
| | | }, |
| | | warningManage() { |
| | | if (this.warningChecked == 0 || this.warningTotal == 0) { |
| | | return 0 |
| | | } |
| | | return parseInt(this.warningChecked / this.warningTotal) * 100 |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | timeStr: "", |
| | | cameraTree: [], |
| | | warnTotal: 0, |
| | | cameraTotal: 0, |
| | | cameras: {}, // è®°å½æåæºå±äºçé¨é¨ |
| | | orgs: {}, // è®°å½ææåæºçé¨é¨ |
| | | checkRate: 0, |
| | | solveRate: 0, |
| | | manageRate: 0, |
| | | searchTime: [ |
| | | this.$moment() |
| | | .subtract(6, "days") |
| | | .format("YYYY-MM-DD 00:00:00"), |
| | | this.$moment().format("YYYY-MM-DD HH:mm:ss") |
| | | ], |
| | | loading: false, |
| | | lineChart: {}, |
| | | pieChart: {}, |
| | | barChart: {}, |
| | | top10: [ |
| | | { |
| | | name: "人äº", |
| | | value: 230 |
| | | }, |
| | | { |
| | | name: "人äº", |
| | | value: 230 |
| | | }, |
| | | { |
| | | name: "人äº", |
| | | value: 230 |
| | | }, |
| | | { |
| | | name: "人äº", |
| | | value: 230 |
| | | }, |
| | | { |
| | | name: "人äº", |
| | | value: 230 |
| | | }, |
| | | { |
| | | name: "人äº", |
| | | value: 230 |
| | | }, |
| | | { |
| | | name: "人äº", |
| | | value: 230 |
| | | } |
| | | ], |
| | | top10: [], |
| | | lineChartOption: { |
| | | grid: { |
| | | left: "3%", |
| | |
| | | show: false |
| | | }, |
| | | axisLabel: { |
| | | color: "#666" |
| | | color: "#e3f0fd" |
| | | }, |
| | | data: ["1", "2", "3", "4", "5", "6", "7"] |
| | | }, |
| | |
| | | show: false |
| | | }, |
| | | axisLabel: { |
| | | color: "#666" |
| | | color: "#e3f0fd" |
| | | }, |
| | | splitLine: { |
| | | //ç½æ ¼çº¿ |
| | |
| | | }, |
| | | barChartOption: { |
| | | grid: { |
| | | top: "10%", |
| | | left: "10%", |
| | | right: "20%", |
| | | bottom: "20%", |
| | | right: "10%", |
| | | // bottom: "0%" |
| | | containLabel: true |
| | | }, |
| | | legend: { |
| | |
| | | show: false |
| | | }, |
| | | axisLabel: { |
| | | color: "#666" |
| | | color: "#e3f0fd" |
| | | }, |
| | | data: ["çé¾", "æç«", "离å²", "èé"] |
| | | data: [] |
| | | }, |
| | | yAxis: { |
| | | axisTick: { |
| | |
| | | show: false |
| | | }, |
| | | axisLabel: { |
| | | color: "#666" |
| | | color: "#e3f0fd", |
| | | show: false |
| | | }, |
| | | splitLine: { |
| | | //ç½æ ¼çº¿ |
| | |
| | | series: [ |
| | | { |
| | | type: "bar", |
| | | data: [55, 33, 22, 33], |
| | | data: [], |
| | | areaStyle: { |
| | | color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ |
| | | { |
| | |
| | | }, |
| | | legend: { |
| | | top: "70%", |
| | | bottom: "center" |
| | | bottom: "center", |
| | | textStyle: { |
| | | color: "#e3f0fd" |
| | | } |
| | | }, |
| | | color: [ |
| | | "rgb(54, 60, 231)", |
| | |
| | | ], |
| | | series: [ |
| | | { |
| | | name: "Nightingale Chart", |
| | | name: "", |
| | | type: "pie", |
| | | radius: [60, 80], |
| | | center: ["50%", "40%"], |
| | |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.timer() |
| | | setTimeout(() => { |
| | | this.loading = false |
| | | }, 3000) |
| | |
| | | this.initPieChart() |
| | | this.initBarChart() |
| | | }) |
| | | |
| | | this.searchHandler() |
| | | this.getCameras() |
| | | }, |
| | | methods: { |
| | | timer() { |
| | | let now = new Date() |
| | | let year = now.getFullYear() |
| | | let month = now.getMonth() + 1 |
| | | let date = now.getDate() |
| | | var hour = now.getHours() |
| | | let min = now.getMinutes() |
| | | |
| | | this.timeStr = hour + ":" + min + " " + year + "-" + month + "-" + date |
| | | setTimeout(() => { |
| | | this.timer() |
| | | }, 1000 * 3) |
| | | }, |
| | | |
| | | initLineChart() { |
| | | console.log("lineChart") |
| | | let chartDom = document.getElementById("lineChart") |
| | | this.lineChart = echarts.init(chartDom) |
| | | this.lineChart.setOption(this.lineChartOption) |
| | | this.lineChart.resize() |
| | | console.log(this.lineChart) |
| | | }, |
| | | |
| | | initPieChart() { |
| | | console.log("pieChart") |
| | | let chartDom = document.getElementById("pieChart") |
| | | this.pieChart = echarts.init(chartDom) |
| | | this.pieChart.setOption(this.pieChartOption) |
| | | this.pieChart.resize() |
| | | console.log(this.pieChart) |
| | | }, |
| | | |
| | | initBarChart() { |
| | | console.log("barChart") |
| | | let chartDom = document.getElementById("barChart") |
| | | this.barChart = echarts.init(chartDom) |
| | | this.barChart.setOption(this.barChartOption) |
| | | this.barChart.resize() |
| | | console.log(this.barChart) |
| | | }, |
| | | |
| | | async getCameras() { |
| | | let clusterId = "" |
| | | let clusterReq = await getClusterDevList() |
| | | if (clusterReq && clusterReq.success) { |
| | | if (clusterReq.data.clusterList.length > 0) { |
| | | clusterId = clusterReq.data.clusterList[0].cluster_id |
| | | } |
| | | } |
| | | |
| | | let camereReq = await getLocalCameraTree({ clusterId: clusterId }) |
| | | if (camereReq && camereReq.success) { |
| | | this.cameraTree = camereReq.data.treeMenu |
| | | let tmpTree = JSON.parse(JSON.stringify(camereReq.data.treeMenu)) |
| | | this.cameraTotal = 0 |
| | | this.orgs = {} |
| | | this.cameras = {} |
| | | for (let i = 0; i < tmpTree.length; i++) { |
| | | this.countNodes(tmpTree[i], null) |
| | | } |
| | | // this.menuTree = tmpTree |
| | | |
| | | // æ ¹æ®é¨é¨æ°æ®ç»è®¡æ¥è¦æ°é |
| | | await this.orgsWarnCount() |
| | | |
| | | // ç»è®¡7æ¥ææ¥é |
| | | this.checkWarnCount() |
| | | } |
| | | }, |
| | | // ç»è®¡çæµç¹æ»é |
| | | countNodes(tree, parent) { |
| | | if (tree.children && tree.children.length > 0) { |
| | | for (let i = 0; i < tree.children.length; i++) this.countNodes(tree.children[i], tree) |
| | | } else { |
| | | if (tree.type == "4") { |
| | | this.cameraTotal += 1 |
| | | // è®°å½æåæºç¶idä¿¡æ¯,å¹¶ä¸ç»è®¡å级æåæºID,æé¨é¨æ¥è¯¢ |
| | | if (!(parent.id in this.orgs)) { |
| | | this.orgs[parent.id] = { |
| | | name: parent.name, |
| | | cameras: [tree.id], |
| | | totalWarn: 0 |
| | | } |
| | | } else { |
| | | this.orgs[parent.id].cameras.push(tree.id) |
| | | } |
| | | |
| | | // è®°å½æåæºç¶ID |
| | | this.cameras[tree.id] = parent.id |
| | | } |
| | | } |
| | | }, |
| | | // æ£ç´¢æ°æ® |
| | | searchHandler() { |
| | | let query = { |
| | | // treeNodes: this.collSelectedNodes(), |
| | | searchTime: this.format(this.searchTime) |
| | | // alarmLevel: this.alarmValues |
| | | } |
| | | |
| | | analysisReport(query).then((rsp) => { |
| | | if (rsp && rsp.success) { |
| | | this.decodeWarningRate(rsp.data.warningRate) |
| | | this.decodeWarningChartRate(rsp.data.warningChartRate) |
| | | this.decodeWarningStatics(rsp.data.warningTable) |
| | | // this.decodeWarningTable(rsp.data.warningStatics) |
| | | } |
| | | }) |
| | | }, |
| | | decodeWarningTable(b64data) { |
| | | this.solvedTotal = 0 |
| | | this.tableDataList = [] |
| | | if (b64data) { |
| | | let decodeString = Base64.decode(b64data) |
| | | if (decodeString != "") { |
| | | let decodeResult = JSON.parse(decodeString) |
| | | decodeResult = [] |
| | | if (decodeResult) { |
| | | decodeResult.forEach((element) => { |
| | | this.solvedTotal = this.solvedTotal + element.doc_count |
| | | this.tableDataList.push({ date: element.key_as_string, count: element.doc_count }) |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | // æçº¿å¾ |
| | | decodeWarningStatics(b64data) { |
| | | this.lineChart.clear() |
| | | this.lineChartOption.xAxis.data = [] |
| | | this.lineChartOption.series[0].data = [] |
| | | if (b64data) { |
| | | let decodeString = Base64.decode(b64data) |
| | | if (decodeString != "") { |
| | | let decodeResult = JSON.parse(decodeString) |
| | | if (decodeResult) { |
| | | decodeResult.forEach((element) => { |
| | | this.lineChartOption.xAxis.data.push(element.key_as_string) |
| | | this.lineChartOption.series[0].data.push(element.doc_count) |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | |
| | | this.lineChart.setOption(this.lineChartOption) |
| | | }, |
| | | // é¥¼å¾ |
| | | decodeWarningChartRate(b64data) { |
| | | this.pieChart.clear() |
| | | this.pieChartOption.series[0].data = [] |
| | | if (b64data) { |
| | | let decodeString = Base64.decode(b64data) |
| | | if (decodeString != "") { |
| | | let decodeResult = JSON.parse(decodeString) |
| | | if (decodeResult) { |
| | | decodeResult.forEach((element) => { |
| | | this.pieChartOption.series[0].data.push({ value: element.doc_count, name: element.key }) |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | this.pieChart.setOption(this.pieChartOption) |
| | | }, |
| | | // "warningRate": {"buckets":[{"doc_count":4,"key":3},{"doc_count":3,"key":2},{"doc_count":1,"key":1}],"total":3257} |
| | | //key 1=è¯¯æ¥æ°æ®,2=å·²æ´æ¹,3=æªæ´æ¹,4=å·²ææ¥ doc_count=æ°é total=æ»é |
| | | decodeWarningRate(b64data) { |
| | | if (b64data) { |
| | | let warningTotal = 0 |
| | | let warningFalse = 0 |
| | | let warningSolved = 0 |
| | | let warningNoCheck = 0 |
| | | let warningChecked = 0 |
| | | |
| | | let decodeString = Base64.decode(b64data) |
| | | if (decodeString != "") { |
| | | let decodeResult = JSON.parse(decodeString) |
| | | if (decodeResult && decodeResult.total > 0) { |
| | | warningTotal = decodeResult.total |
| | | decodeResult.buckets.forEach((element) => { |
| | | switch (element.key) { |
| | | case 1: |
| | | warningFalse += element.doc_count |
| | | break |
| | | case 2: |
| | | warningSolved += element.doc_count |
| | | break |
| | | case 3: |
| | | warningNoCheck += element.doc_count |
| | | break |
| | | case 4: |
| | | warningChecked += element.doc_count |
| | | break |
| | | default: |
| | | break |
| | | } |
| | | }) |
| | | } |
| | | // console.log("WarningRate:", decodeResult) |
| | | // console.log("WarningRate:", warningTotal, warningFalse, warningSolved, warningNoCheck, warningChecked) |
| | | // å¤çç |
| | | this.manageRate = parseInt(((warningChecked + warningFalse) / warningTotal) * 100) |
| | | // ææ¥ç |
| | | this.checkRate = parseInt((warningChecked / warningTotal) * 100) |
| | | // æ´æ¹ç |
| | | this.solveRate = parseInt(((warningFalse + warningSolved) / warningTotal) * 100) |
| | | } |
| | | } |
| | | }, |
| | | async orgsWarnCount() { |
| | | let orgArry = [] |
| | | this.warnTotal = 0 |
| | | for (let key in this.orgs) { |
| | | if (!this.searchTime) { |
| | | this.searchTime = [] |
| | | } |
| | | this.VideoPhotoData.page = 0 |
| | | this.VideoPhotoData.size = 0 |
| | | // æ¶é´èå´ |
| | | this.VideoPhotoData.searchTime = this.format(this.searchTime) |
| | | // ææ¥ç»è®° |
| | | this.VideoPhotoData.warningFlag = 0 |
| | | this.VideoPhotoData.treeNodes = this.orgs[key].cameras |
| | | // this.VideoPhotoData.showType = this.showType |
| | | await this.VideoPhotoData.querySearchList() |
| | | this.orgs[key].totalWarn = this.VideoPhotoData.total |
| | | this.warnTotal += this.VideoPhotoData.total |
| | | orgArry.push(this.orgs[key]) |
| | | } |
| | | |
| | | orgArry = orgArry.sort((a, b) => { |
| | | return b.totalWarn - a.totalWarn |
| | | }) |
| | | this.top10 = orgArry.slice(0, 10) |
| | | }, |
| | | // ç»è®¡7æ¥ææ¥é |
| | | async checkWarnCount() { |
| | | this.barChart.clear() |
| | | this.barChartOption.xAxis.data = [] |
| | | this.barChartOption.series[0].data = [] |
| | | for (let i = 6; i >= 0; i--) { |
| | | this.VideoPhotoData.page = 0 |
| | | this.VideoPhotoData.size = 0 |
| | | // æ¶é´èå´ |
| | | this.VideoPhotoData.searchTime = [ |
| | | this.$moment() |
| | | .subtract(i, "days") |
| | | .format("YYYY-MM-DD 00:00:00"), |
| | | this.$moment() |
| | | .subtract(i, "days") |
| | | .format("YYYY-MM-DD 23:59:59") |
| | | ] |
| | | // ææ¥ç»è®° |
| | | this.VideoPhotoData.warningFlag = 4 |
| | | this.VideoPhotoData.treeNodes = [] |
| | | // this.VideoPhotoData.showType = this.showType |
| | | await this.VideoPhotoData.querySearchList() |
| | | this.barChartOption.xAxis.data.push( |
| | | this.$moment() |
| | | .subtract(i, "days") |
| | | .format("MM-DD") |
| | | ) |
| | | this.barChartOption.series[0].data.push(this.VideoPhotoData.total) |
| | | this.barChart.setOption(this.barChartOption) |
| | | } |
| | | }, |
| | | format(array) { |
| | | if (!array || array.length === 0) { |
| | | return [] |
| | | } |
| | | return [ |
| | | this.$moment(array[0]).format("YYYY-MM-DD HH:mm:ss"), |
| | | this.$moment(array[1]).format("YYYY-MM-DD HH:mm:ss") |
| | | ] |
| | | } |
| | | } |
| | | } |
| | |
| | | font-family: yjsz; |
| | | src: url("./fonts/yjsz.TTF"); /* IE9+,å¯ä»¥æ¯å
·ä½çå®é
龿¥ */ |
| | | } |
| | | |
| | | ul { |
| | | padding: 0; |
| | | margin: 0; |
| | |
| | | |
| | | .title { |
| | | margin-top: 27px; |
| | | margin-left: 25px; |
| | | margin-left: 20px; |
| | | font-size: 15px; |
| | | font-weight: 700; |
| | | color: #fff; |
| | | color: #e3f0fd; |
| | | } |
| | | |
| | | .time { |
| | | position: absolute; |
| | | color: #cbe3e2; |
| | | font-size: 26px; |
| | | font-weight: 600; |
| | | opacity: 0.5; |
| | | top: -25px; |
| | | left: 2%; |
| | | font-style: normal; |
| | | font-family: "yjsz"; |
| | | /* font-stretch: expanded; */ |
| | | letter-spacing: 5px; |
| | | } |
| | | .data-view { |
| | | width: 100%; |
| | | height: 100%; |
| | |
| | | background-size: cover; |
| | | overflow: hidden; |
| | | position: absolute; |
| | | z-index: -2; |
| | | color: #e3f0fd; |
| | | z-index: 0; |
| | | } |
| | | |
| | | /* å è½½æè½¬å¨ç» */ |
| | |
| | | align-items: center; |
| | | font-size: 55px; |
| | | font-weight: 700; |
| | | background: linear-gradient(0deg, #fff, #fff); |
| | | background: linear-gradient(0deg, #e3f0fd, #e3f0fd); |
| | | background-size: cover; |
| | | -webkit-background-clip: text; |
| | | background-clip: text; |
| | |
| | | position: absolute; |
| | | top: 12%; |
| | | left: 2%; |
| | | font-family: yjsz; |
| | | } |
| | | |
| | | .center { |
| | |
| | | .center .center-count { |
| | | position: relative; |
| | | top: 60%; |
| | | color: #fff; |
| | | color: #e3f0fd; |
| | | } |
| | | |
| | | .center .center-right { |
| | | position: absolute; |
| | | top: 0; |
| | | left: 73%; |
| | | width: 25%; |
| | | height: 100%; |
| | | text-align: center; |
| | | } |
| | | |
| | | .center .center-right span { |
| | | color: #e3f0fd; |
| | | } |
| | | |
| | | .center .center-right .chart { |
| | | height: 28%; |
| | | margin-top: 10px; |
| | | /* background: #e3f0fd; */ |
| | | } |
| | | .center .center-right .chart >>> svg path:first-child { |
| | | stroke: #101d50; |
| | | } |
| | | |
| | | .right-week { |
| | |
| | | background: url(/images/data-v/lineup.png); |
| | | background-repeat: no-repeat; |
| | | background-size: 100% 100%; |
| | | /* height: 31%; |
| | | width: 66%; */ |
| | | height: 309px; |
| | | width: 1268px; |
| | | height: 31%; |
| | | width: 66%; |
| | | /* height: 309px; |
| | | width: 1268px; */ |
| | | position: absolute; |
| | | bottom: 2%; |
| | | left: 2%; |
| | |
| | | right: 4%; |
| | | color: rgb(217, 214, 214); |
| | | } |
| | | |
| | | .top10-list { |
| | | width: 100%; |
| | | height: 9%; |
| | | /* background: #e3f0fd; */ |
| | | /* border-bottom: solid 1px; */ |
| | | position: relative; |
| | | line-height: 60px; |
| | | color: #e3f0fd; |
| | | font-size: 14px; |
| | | font-weight: 600; |
| | | } |
| | | |
| | | .top10-list .list-0 { |
| | | position: absolute; |
| | | top: 0; |
| | | left: 5%; |
| | | } |
| | | .top10-list .list-1 { |
| | | position: absolute; |
| | | top: 0; |
| | | margin: 0px 70px; |
| | | } |
| | | .top10-list .list-2 { |
| | | position: absolute; |
| | | top: 0; |
| | | left: 80%; |
| | | } |
| | | .top10-list .list-img { |
| | | position: absolute; |
| | | bottom: -18%; |
| | | left: 18%; |
| | | width: 250px; |
| | | } |
| | | |
| | | ::v-deep .el-progress__text { |
| | | font-size: 30px !important; |
| | | /* font-weight: 600; */ |
| | | color: #e3f0fd; |
| | | } |
| | | </style> |