Browse Source

设备在线率

develop
王兴琳 4 months ago
parent
commit
0391c4f749
  1. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/maintenanceOperations/smart/statisticalAnalysis/query/data.js
  2. 61
      ruoyi-ui/src/views/JiHeExpressway/pages/maintenanceOperations/smart/statisticalAnalysis/query/index.vue

2
ruoyi-ui/src/views/JiHeExpressway/pages/maintenanceOperations/smart/statisticalAnalysis/query/data.js

@ -143,7 +143,7 @@ export const searchFormList = [
required: true, required: true,
type: "datePicker", type: "datePicker",
default: [ default: [
moment().startOf("month").format("YYYY-MM-DD HH:mm:ss"), moment().subtract(1, 'days').endOf('day').format("YYYY-MM-DD HH:mm:ss"),
moment().format("YYYY-MM-DD HH:mm:ss"), moment().format("YYYY-MM-DD HH:mm:ss"),
], ],
options: { options: {

61
ruoyi-ui/src/views/JiHeExpressway/pages/maintenanceOperations/smart/statisticalAnalysis/query/index.vue

@ -7,9 +7,24 @@
<el-button v-hasPermi="['maintain:equipmentOnlineAnalysis:export']" size="mini" icon="el-icon-download" class="btnSearch" @click="SystemStatusExport('1')">导出丢包</el-button> <el-button v-hasPermi="['maintain:equipmentOnlineAnalysis:export']" size="mini" icon="el-icon-download" class="btnSearch" @click="SystemStatusExport('1')">导出丢包</el-button>
</div> </div>
<div class="right-div"> <div class="right-div">
<InputSearch <div class="dsort">
<el-button class="btnSearch" @click.native="onDate1" style="width: 80px">上一日</el-button>
<el-button class="btnSearch" @click.native="onDate2" style="width: 80px">下一日</el-button>
<el-date-picker
v-model="datetime"
@change="handleSearch"
:clearable=false
type="date"
value-format="yyyy-MM-dd"
placeholder="选择告警时间"
class="shezhi"
>
</el-date-picker>
</div>
<!-- <InputSearch
ref="searchComp" ref="searchComp"
:formList="searchFormList" @handleSearch="handleSearch" /> :formList="searchFormList" @handleSearch="handleSearch" />-->
</div> </div>
</div> </div>
<div class="anacontent" style="height: calc(100vh - 225px)"> <div class="anacontent" style="height: calc(100vh - 225px)">
@ -39,7 +54,7 @@
<span>{{ scope.row.direction == "1" ? "菏泽方向" : scope.row.direction == "2" ? "双向": "济南方向"}}</span> <span>{{ scope.row.direction == "1" ? "菏泽方向" : scope.row.direction == "2" ? "双向": "济南方向"}}</span>
</template> </template>
</ElTableColumn> </ElTableColumn>
<ElTableColumn prop="deviceIp" width="120" label="IP"> </ElTableColumn> <ElTableColumn prop="deviceIp" width="120" label="IP"></ElTableColumn>
<!-- <ElTableColumn prop="statisticalDate" width="200" label="监测时间"> </ElTableColumn> --> <!-- <ElTableColumn prop="statisticalDate" width="200" label="监测时间"> </ElTableColumn> -->
<ElTableColumn prop="deviceStatus" width="120" label="设备状态" > <ElTableColumn prop="deviceStatus" width="120" label="设备状态" >
<template slot-scope="scope" > <template slot-scope="scope" >
@ -125,6 +140,7 @@ export default {
sectionData: [], sectionData: [],
searchFormList, searchFormList,
searchFormList2, searchFormList2,
datetime: moment().format('YYYY-MM-DD'),
startTime: "", startTime: "",
time: "", time: "",
deviceName: null, deviceName: null,
@ -144,7 +160,12 @@ export default {
destroyed() { destroyed() {
}, },
methods: { methods: {
init(){
this.datetime = moment().format('YYYY-MM-DD');
this.handleSearch(datetime);
},
showRecord(item){ showRecord(item){
this.dialogData = item; this.dialogData = item;
this.dialogVisible = true; this.dialogVisible = true;
@ -253,7 +274,7 @@ export default {
formatter: function (value, index) { formatter: function (value, index) {
const date = moment(value); const date = moment(value);
const isSameDay = index > 0 && moment(x[index - 1]).isSame(date, 'day'); const isSameDay = index > 0 && moment(x[index - 1]).isSame(date, 'day');
return date.format('YYYY-MM-DD'); return date.format('MM-DD HH');
} }
} }
}; };
@ -310,6 +331,14 @@ export default {
} }
}); });
}, },
onDate1(){
this.datetime = moment(this.datetime).subtract(1, "days").format('YYYY-MM-DD');
this.handleSearch( this.datetime);
},
onDate2(){
this.datetime = moment(this.datetime).subtract(-1, "days").format('YYYY-MM-DD');
this.handleSearch( this.datetime);
},
onDeviceChange(){ onDeviceChange(){
// //
if(this.devices.indexOf('all') !== -1 && this.devicesSource.indexOf('all') === -1){ if(this.devices.indexOf('all') !== -1 && this.devicesSource.indexOf('all') === -1){
@ -334,8 +363,8 @@ export default {
this.initQueryTable(); this.initQueryTable();
}, },
handleSearch(data) { handleSearch(data) {
this.startTime = moment(data.time[0]).format("YYYY-MM-DD") + ' 00:00:00'; this.startTime = moment(data).format("YYYY-MM-DD") + ' 00:00:00';
this.time = moment(data.time[1]).format("YYYY-MM-DD") + ' 23:59:59'; this.time = moment(data).format("YYYY-MM-DD") + ' 23:59:59';
this.searchText = `${moment(this.startTime).format( this.searchText = `${moment(this.startTime).format(
@ -362,8 +391,8 @@ export default {
text: "文件正在下载...", text: "文件正在下载...",
}); });
const params = { const params = {
startTime: this.startTime, startTime: moment(this.datetime).format("YYYY-MM-DD") + ' 00:00:00',
time: this.time, time: moment(this.datetime).format("YYYY-MM-DD") + ' 23:59:59',
type: this.devices.join(','), type: this.devices.join(','),
pageNum: this.searchData.pageNum, pageNum: this.searchData.pageNum,
pageSize: this.searchData.pageSize, pageSize: this.searchData.pageSize,
@ -401,7 +430,7 @@ export default {
}, },
}, },
async mounted() { async mounted() {
this.startTime = moment().startOf("month").format("YYYY-MM-DD HH:mm:ss"); this.startTime = moment().subtract(1, 'days').endOf('day').format("YYYY-MM-DD HH:mm:ss");
this.time = moment().format("YYYY-MM-DD HH:mm:ss"); this.time = moment().format("YYYY-MM-DD HH:mm:ss");
@ -571,4 +600,18 @@ export default {
border: 0px !important; border: 0px !important;
background-color: transparent !important; background-color: transparent !important;
} }
.dsort {
font-size: 12px;
display: flex;
flex-direction: row;
justify-content: flex-end;
gap: 14px;
}
.shezhi{
width: 150px;
height: 34px;
::v-deep .el-input__inner{
height:32px;
}
}
</style> </style>

Loading…
Cancel
Save