<template>
|
<div class="app-container">
|
<el-row>
|
<el-col
|
:span="24"
|
style="height: 45px; text-align: left; margin-top: 20px"
|
>
|
<el-radio-group v-model="type" style="margin-right: 15px">
|
<el-radio-button label="时间段"></el-radio-button>
|
<el-radio-button label="单日"></el-radio-button>
|
<el-radio-button label="单月"></el-radio-button>
|
<el-radio-button label="年度"></el-radio-button>
|
</el-radio-group>
|
<span style="margin-right: 15px">
|
<el-date-picker
|
v-model="search.valueDay"
|
:type="
|
type == '时间段'
|
? 'date'
|
: type == '单月'
|
? 'month'
|
: type == '年度'
|
? 'year'
|
: 'date'
|
"
|
:placeholder="
|
type == '时间段'
|
? '选择日期'
|
: type == '单月'
|
? '选择月份'
|
: type == '年度'
|
? '选择年份'
|
: '选择日期'
|
"
|
clearable
|
style="width: 130px"
|
></el-date-picker>
|
</span>
|
<span v-show="type == '时间段'" style="margin-right: 15px">
|
<el-time-select
|
v-model="search.valueTime"
|
:picker-options="{
|
start: '00:00',
|
step: '00:30',
|
end: '23:30',
|
}"
|
placeholder="选择时间"
|
clearable
|
style="width: 130px"
|
></el-time-select>
|
</span>
|
<el-select
|
v-model="monitorpointName"
|
placeholder="查询站点名字"
|
@change="handleChange"
|
clearable
|
style="margin-right: 15px"
|
>
|
<el-option
|
v-for="item in selMonitorpointName"
|
:key="item"
|
:label="item"
|
:value="item"
|
></el-option>
|
</el-select>
|
</el-col>
|
|
<el-col :span="24" class="Device" style="margin-top: 30px">
|
<el-table
|
:data="tableData"
|
:height="tableH"
|
v-loading="loading"
|
stripe
|
size="small"
|
class="detailTable"
|
>
|
<el-table-column label="频率" prop="frequencyValue"></el-table-column>
|
<el-table-column
|
label="站点名字"
|
prop="monitorpointName"
|
></el-table-column>
|
<el-table-column
|
label="平均场强值"
|
prop="avg_level"
|
></el-table-column>
|
<el-table-column label="状态" prop="status"></el-table-column>
|
<el-table-column label="操作">
|
<template slot-scope="scope">
|
<div>
|
<el-button
|
type="success"
|
@click="lookEcharts(scope)"
|
size="mini"
|
>信号强度</el-button
|
>
|
</div>
|
</template>
|
</el-table-column>
|
</el-table>
|
</el-col>
|
<el-col :span="24" style="margin-top: 5px">
|
<el-pagination
|
@size-change="handleSizeChange"
|
@current-change="handleCurrentChange"
|
:current-page="pageNo"
|
:page-sizes="[10, 20, 30, 50]"
|
:page-size="pageSize"
|
layout="total, sizes, prev, pager, next, jumper"
|
:total="totalCount"
|
>
|
</el-pagination>
|
</el-col>
|
</el-row>
|
|
<el-dialog
|
title="信号强度变化趋势"
|
:visible.sync="echartVisible"
|
width="80%"
|
:close-on-click-modal="false"
|
>
|
<div ref="myChart" style="width: 100%; height: 400px"></div>
|
</el-dialog>
|
</div>
|
</template>
|
<script>
|
export default {
|
watch: {
|
search: {
|
handler(n, o) {
|
if (this.timer) {
|
clearTimeout(this.timer);
|
}
|
this.timer = setTimeout(() => {
|
this.handleSearch();
|
}, 300);
|
},
|
deep: true,
|
},
|
monitorpointName: {
|
handler(n, o) {
|
if (this.timer) {
|
clearTimeout(this.timer);
|
}
|
this.timer = setTimeout(() => {
|
this.handleSearch();
|
}, 500);
|
},
|
deep: true,
|
},
|
type: {
|
handler(n, o) {
|
if (this.timer) {
|
clearTimeout(this.timer);
|
}
|
this.timer = setTimeout(() => {
|
this.handleSearch();
|
}, 500);
|
},
|
deep: true,
|
},
|
},
|
data() {
|
return {
|
seriesData: [],
|
xAxisData: [],
|
echartVisible: false,
|
totalCount: 100,
|
pageNo: 1,
|
pageSize: 10,
|
tableData: [],
|
tableH: null,
|
otherAct: [{ item: "查看所有", id: "", type: "primary" }],
|
type: "时间段",
|
queryParams: {
|
page: 1,
|
size: 10,
|
VF: "",
|
table: "t_fm_scan_timestamp",
|
},
|
determine: "",
|
search: {
|
valueTime: "15:00",
|
valueDay: "",
|
},
|
loading: false,
|
selMonitorpointName: [],
|
monitorpointName: "",
|
};
|
},
|
mounted() {
|
this.tableH = window.innerHeight - 135 + "px";
|
let time = new Date();
|
var hour = time.getHours();
|
this.search.valueDay = time;
|
this.search.valueTime = this.add0(hour) + ":00";
|
this.initInfo();
|
},
|
methods: {
|
add0(val) {
|
return val < 10 ? "0" + val : val;
|
},
|
initInfo() {
|
this.getData(1);
|
},
|
getData(isinit) {
|
this.loading = true;
|
let param = {};
|
if (isinit == 1) {
|
param = {
|
bid: "getDetailSepctrum",
|
pageno: 1,
|
pagesize: 10,
|
querymode: "day",
|
monitorPointName: "",
|
frequency: this.$route.query.frequency,
|
timevalue2: "",
|
timevalue1: "",
|
};
|
} else {
|
let typeValue = this.formatType(this.type);
|
let dateValue =
|
this.search.valueDay == ""
|
? "2021"
|
: this.formatDate(this.search.valueDay);
|
let tmeValue =
|
this.type == "时间段" ? this.search.valueTime.split(":")[0] : "";
|
param = {
|
bid: "getDetailSepctrum",
|
querymode: typeValue,
|
timevalue1: dateValue,
|
timevalue2: tmeValue,
|
monitorPointName: this.monitorpointName,
|
frequency: this.$route.query.frequency,
|
pageno: this.pageNo,
|
pagesize: this.pageSize,
|
};
|
}
|
this.$getJSON(
|
window.backstageURL + "dataservice/getNoTokenData",
|
param
|
).then((res) => {
|
this.tableData = res.data.data[0];
|
|
let selName = [];
|
this.tableData.forEach((item) => {
|
selName.push(item.monitorpointName);
|
});
|
this.selMonitorpointName = selName;
|
this.totalCount = res.data.data[1][0].counter;
|
this.loading = false;
|
});
|
},
|
|
handleSizeChange(size) {
|
this.pageSize = size;
|
this.getData(0);
|
},
|
handleCurrentChange(page) {
|
this.pageNo = page;
|
this.getData(0);
|
},
|
handleSearch() {
|
this.getData(0);
|
},
|
|
handleChange(value) {},
|
|
formatType(type) {
|
if (type == "时间段") {
|
return "time";
|
} else if (type == "单日") {
|
return "day";
|
} else if (type == "单月") {
|
return "month";
|
} else if (type == "年度") {
|
return "year";
|
}
|
},
|
|
formatDate(date) {
|
if (date) {
|
let year = date.getFullYear();
|
let month = date.getMonth() + 1;
|
let day = date.getDate();
|
|
if (this.type == "年度") {
|
return year;
|
} else if (this.type == "单月") {
|
return year + "-" + this.add0(month);
|
} else if (this.type == "单日" || this.type == "时间段") {
|
return year + "-" + this.add0(month) + "-" + this.add0(day);
|
} else {
|
return "";
|
}
|
}
|
},
|
|
add0(val) {
|
return val < 10 ? "0" + val : val;
|
},
|
|
lookEcharts(scope) {
|
this.loading = true
|
let param = {
|
bid: "getHistorySepctrum",
|
frequency: scope.row.frequencyValue,
|
monitorPointId: scope.row.monitorpointId,
|
};
|
this.$getJSON(
|
window.backstageURL + "dataservice/getNoTokenData",
|
param
|
).then((res) => {
|
res.data.data[0].forEach((item) => {
|
this.seriesData.push(item.level);
|
this.xAxisData.push(this.formatDateTime(item.time));
|
this.echartVisible = true;
|
});
|
this.getEchartData();
|
});
|
},
|
|
getEchartData() {
|
this.$nextTick(function () {
|
const chart = this.$refs.myChart;
|
if (chart) {
|
const myChart = this.$echarts.init(chart);
|
const option = {
|
grid: {
|
top: "20px",
|
|
left: "45px",
|
|
right: "20px",
|
|
bottom: "40px",
|
|
backgroundColor: "#fff",
|
},
|
dataZoom: [
|
{
|
type: "slider", //滑动轴
|
start: 0, //距离左侧0刻度的距离,1%
|
end: 20, //距离左侧0刻度的距离,35%,相当于规定了滑动的范围
|
bottom: -5,
|
},
|
],
|
xAxis: {
|
type: "category",
|
data: this.xAxisData,
|
axisLabel: {
|
interval: 0,
|
rotate: 0,
|
color: "#FFFFFF",
|
fontSize: 10,
|
},
|
},
|
yAxis: {
|
type: "value",
|
min: 0,
|
max: 120,
|
splitLine: {
|
show: true,
|
lineStyle: {
|
color: "rgba(255,225,255,0.5)",
|
width: 1,
|
type: "solid",
|
},
|
},
|
},
|
series: [
|
{
|
data: this.seriesData,
|
type: "line",
|
color: "#5A82FC",
|
},
|
],
|
};
|
myChart.setOption(option);
|
window.addEventListener("resize", function () {
|
myChart.resize();
|
});
|
this.loading = false;
|
}
|
});
|
},
|
|
formatDateTime(date) {
|
if (date) {
|
let time = new Date(date);
|
var year = time.getFullYear();
|
var month = time.getMonth() + 1;
|
var date = time.getDate();
|
var hour = time.getHours();
|
var minute = time.getMinutes();
|
var second = time.getSeconds();
|
return (
|
this.add0(year) +
|
"-" +
|
this.add0(month) +
|
"-" +
|
this.add0(date) +
|
" " +
|
this.add0(hour) +
|
":" +
|
this.add0(minute) +
|
":" +
|
this.add0(second)
|
);
|
} else {
|
return "--";
|
}
|
},
|
},
|
};
|
</script>
|
<style lang="scss">
|
.app-container {
|
width: 96%;
|
margin-left: 2%;
|
}
|
</style>
|