| | |
| | | <div class="trend-data-show"> |
| | | <!-- 点位切换 --> |
| | | <div class="trend-data-header"> |
| | | <el-button type="text">高发点位</el-button> |
| | | <el-button type="text">首次违规点位</el-button> |
| | | <el-button type="text" @click="highFlag = true">高发点位</el-button> |
| | | <el-button type="text" @click="highFlag = false">首次违规点位</el-button> |
| | | </div> |
| | | <!-- 对应数据 --> |
| | | <div class="trend-data-main"> |
| | | <div class="high-point"> |
| | | <!-- --> |
| | | <div class="high-point" v-if="highFlag"> |
| | | <div class="point-item" v-for="item in highList" :key="item.id"> |
| | | <span>{{ item.pointName }}</span> |
| | | <span>{{ item.count }}</span> |
| | | </div> |
| | | </div> |
| | | <!-- 首次违规 --> |
| | | <div class="first-point" v-else> |
| | | <div class="point-item" v-for="item in fisrtList" :key="item.id"> |
| | | <span>{{ item.pointName }}</span> |
| | | <span>{{ item.count }}</span> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="trend-main"></div> |
| | | <div class="trend-main"> |
| | | <div class="trend-main-echarts" id="myRef"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="trend-footer" v-if="timeRangeFlag"> |
| | | <!-- 选择时间范围 --> |
| | | <div class="time-area"> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import * as echarts from 'echarts' |
| | | import { transform } from 'echarts-stat'; |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | pointName: '后庆路200号-球', |
| | | count: '100次', |
| | | }, |
| | | ] |
| | | ], |
| | | fisrtList: [ |
| | | { |
| | | id: 1, |
| | | pointName: '后庆路205号-球', |
| | | count: '1次', |
| | | }, |
| | | { |
| | | id: 2, |
| | | pointName: '后庆路204号-球', |
| | | count: '1次', |
| | | }, |
| | | { |
| | | id: 3, |
| | | pointName: '后庆路203号-球', |
| | | count: '1次', |
| | | }, |
| | | { |
| | | id: 4, |
| | | pointName: '后庆路202号-球', |
| | | count: '1次', |
| | | }, |
| | | { |
| | | id: 5, |
| | | pointName: '后庆路201号-球', |
| | | count: '1次', |
| | | }, |
| | | ], |
| | | highFlag: true, |
| | | } |
| | | }, |
| | | methods: { |
| | | renderEchart() { |
| | | // echarts.registerTransform(transform.regression); |
| | | const myChart = echarts.init(document.getElementById('myRef')); |
| | | // 绘制图表 |
| | | myChart.setOption({ |
| | | xAxis: { |
| | | name: '日/周', |
| | | }, |
| | | yAxis: { |
| | | name: '报警量(次)', |
| | | }, |
| | | series: [ |
| | | { |
| | | data: [10, 22, 28, 23, 19], |
| | | type: 'line', |
| | | smooth: true |
| | | } |
| | | ] |
| | | }); |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.renderEchart() |
| | | } |
| | | } |
| | | </script> |
| | |
| | | padding: 10vh 10vw; |
| | | color: #4b9bb7; |
| | | display: flex; |
| | | |
| | | .trend-side { |
| | | width: 20vw; |
| | | text-align: left; |
| | | height: 100%; |
| | | border: 1px solid #09152f; |
| | | |
| | | .trend-input-area { |
| | | display: flex; |
| | | flex-direction: column; |
| | | padding: 0 2vw; |
| | | |
| | | &>span { |
| | | line-height: 40px; |
| | | } |
| | |
| | | .trend-data-show { |
| | | width: 100%; |
| | | line-height: 40px; |
| | | .trend-data-header{ |
| | | |
| | | .trend-data-header { |
| | | display: flex; |
| | | .el-button{ |
| | | |
| | | .el-button { |
| | | flex: 1; |
| | | border: 2px solid #09152f; |
| | | } |
| | | .el-button+.el-button{ |
| | | |
| | | .el-button+.el-button { |
| | | margin: 0; |
| | | } |
| | | } |
| | | |
| | | .trend-data-main { |
| | | .high-point { |
| | | |
| | | .high-point, |
| | | .first-point { |
| | | .point-item { |
| | | display: flex; |
| | | padding: 0 2vw; |
| | |
| | | } |
| | | } |
| | | } |
| | | .trend-main{ |
| | | |
| | | .trend-main { |
| | | flex: 1; |
| | | border: 1px solid #09152f; |
| | | |
| | | .trend-main-echarts { |
| | | width: 500px; |
| | | height: 400px; |
| | | } |
| | | } |
| | | |
| | | .trend-footer { |
| | | ::v-deep .el-range-input { |
| | | background-color: #09152f; |