|
|
@@ -1,13 +1,233 @@
|
|
|
<template>
|
|
|
+ <div class="content">
|
|
|
+ <div class="tabs">
|
|
|
+ <ul>
|
|
|
+ <li v-for="(tab,i) in tabs" @click="goTab(tab.url)" :class="{'active':tabIndex == i}">
|
|
|
+ {{tab.name}}
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ <div class="panel">
|
|
|
+ <div class="panel-body">
|
|
|
+ <div class=" panel_control">
|
|
|
+ <div class="pline">
|
|
|
+ <em>统计时间</em>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="panel.time1"
|
|
|
+ type="daterange"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </div>
|
|
|
+ <div class="pline">
|
|
|
+ <em>安全等级:</em>
|
|
|
+ <el-select v-model="panel.level">
|
|
|
+ <el-option
|
|
|
+ v-for="item in panel.levelOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="pline">
|
|
|
+ <el-button size="medium" type="primary" @click="query">查询</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
+ <div class="histogram">
|
|
|
+ <ve-Line :data="chartData" width="100%" height="700px" :loading="loading" :legend-visible="false"
|
|
|
+ :extend="chartExtend"></ve-Line>
|
|
|
+ <div class="null_state" v-if="chartData.rows == ''">
|
|
|
+ 暂无
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import Global from '../Global.js'
|
|
|
+ import {
|
|
|
+ DetectorList,
|
|
|
+ } from '../api/getApiRes.js'
|
|
|
+
|
|
|
+ let qs = require('qs');
|
|
|
export default {
|
|
|
- name: "statistics"
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ tabIndex: 0,
|
|
|
+ tabs: [
|
|
|
+ {name: '监测记录统计', url: 'statistics'},
|
|
|
+ {name: '无线信号统计', url: 'wirelessStatistics'},
|
|
|
+ ],
|
|
|
+ // panel 配置项目
|
|
|
+ panel: {
|
|
|
+ usercode: '',
|
|
|
+ username: '',
|
|
|
+ compname: '',
|
|
|
+ keyword: '',
|
|
|
+ USERCODE: '',
|
|
|
+ taskstatus: 99,
|
|
|
+ level: 0,
|
|
|
+ regionid: 0,
|
|
|
+ regionid2: '',
|
|
|
+ regionidOptions: [],
|
|
|
+ regionidOptions2: [],
|
|
|
+ levelOptions: [
|
|
|
+ {value: 0, label: '全部'},
|
|
|
+ {value: 1, label: '安全'},
|
|
|
+ {value: 2, label: '可疑'},
|
|
|
+ {value: 3, label: '危险'},
|
|
|
+ ],
|
|
|
+ time1: globalBt3(2),
|
|
|
+ },
|
|
|
+ days: 13,
|
|
|
+ loading: false,
|
|
|
+ chartData: {
|
|
|
+ columns: ['X', 'Y'],
|
|
|
+ rows: []
|
|
|
+ },
|
|
|
+ chartExtend: {
|
|
|
+ color: ['#72FF99'],
|
|
|
+ series: {
|
|
|
+ barMaxWidth: 10,
|
|
|
+ // 区域填充样式
|
|
|
+ areaStyle: {
|
|
|
+ color: {
|
|
|
+ type: 'linear',
|
|
|
+ x: 0,
|
|
|
+ y: 0,
|
|
|
+ x2: 0,
|
|
|
+ y2: 1,
|
|
|
+ colorStops: [
|
|
|
+ {
|
|
|
+ offset: 0,
|
|
|
+ color: 'rgba(0,255,212,0.15)', // 0% 处的颜色
|
|
|
+ },
|
|
|
+ {
|
|
|
+ offset: 1,
|
|
|
+ color: 'rgba(0,255,212,0.15)' // 100% 处的颜色
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ global: false // 缺省为 false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ axisLine: {
|
|
|
+ color: "#04E3FD",
|
|
|
+ // onZero: false
|
|
|
+ },
|
|
|
+ yAxis: {
|
|
|
+ // name : '单位: dB',
|
|
|
+ splitLine: {
|
|
|
+ lineStyle: {
|
|
|
+ // 使用深浅的间隔色
|
|
|
+ color: ['#08255B']
|
|
|
+ }
|
|
|
+ },
|
|
|
+ axisLine: {
|
|
|
+ lineStyle: {
|
|
|
+ color: '#04E3FD',
|
|
|
+ width: 1,//这里是为了突出显示加上的
|
|
|
+ }
|
|
|
+ },
|
|
|
+ axisLabel: {
|
|
|
+ show: true,
|
|
|
+ interval: 'auto',
|
|
|
+ formatter: function (val) {
|
|
|
+ return val
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ xAxis: {
|
|
|
+ // offset:-120,
|
|
|
+ splitLine: {
|
|
|
+ lineStyle: {
|
|
|
+ // 使用深浅的间隔色
|
|
|
+ color: ['#04E3FD']
|
|
|
+ }
|
|
|
+ },
|
|
|
+ axisLine: {
|
|
|
+ lineStyle: {
|
|
|
+ color: '#04E3FD',
|
|
|
+ width: 1,//这里是为了突出显示加上的
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ tooltip:{
|
|
|
+ formatter: function (val) {
|
|
|
+ return val[0].data
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getTableQuery();
|
|
|
+ // test
|
|
|
+ this.chartData.rows = [
|
|
|
+ {X:"01-01",Y:200},
|
|
|
+ {X:"01-02",Y:300},
|
|
|
+ {X:"01-03",Y:400},
|
|
|
+ {X:"01-04",Y:200},
|
|
|
+ {X:"01-05",Y:500},
|
|
|
+ {X:"01-06",Y:210},
|
|
|
+ {X:"01-07",Y:600},
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ // 查询按钮
|
|
|
+ query() {
|
|
|
+ this.getTableQuery();
|
|
|
+ this.$message.success('查询完毕');
|
|
|
+ },
|
|
|
+ // 页面数据查询
|
|
|
+ getTableQuery() {
|
|
|
+ let that = this;
|
|
|
+ that.loading = true;
|
|
|
+ let param = {
|
|
|
+ token: localStorage.token,
|
|
|
+ mac: this.panel.mac,//
|
|
|
+ regionId: that.panel.regionId,//
|
|
|
+ name: that.panel.tagname,//标签名
|
|
|
+ comid: 1,//
|
|
|
+ start: 1,//
|
|
|
+ tableMax: 9999,//
|
|
|
+ };
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
+ DetectorList(postdata).then(res => {
|
|
|
+ let json = res;
|
|
|
+ if (json.Code == 0) {
|
|
|
+ that.loading = false;
|
|
|
+
|
|
|
+ } else {
|
|
|
+ that.$message.error(json.Memo + ',错误代码:' + json.Code);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 跳转tab页面
|
|
|
+ goTab(url) {
|
|
|
+ this.$router.push({path: url});
|
|
|
+ },
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
+ @import "../assets/css/panel.css";
|
|
|
+ .tabs ul {
|
|
|
+ width: 368px;
|
|
|
+ float: left;
|
|
|
+ }
|
|
|
+ .tabs li {
|
|
|
+ width: 168px;
|
|
|
+ float: left;
|
|
|
+ }
|
|
|
+ table span {
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
|
|
|
</style>
|