|
|
|
@ -2,13 +2,13 @@
|
|
|
|
|
<div class="container">
|
|
|
|
|
<div class="centerImg"></div>
|
|
|
|
|
<div class="leftMenu">
|
|
|
|
|
<div v-for="(i,k) in deviceList" class="item" @click="getRightData(i)" :key="k">
|
|
|
|
|
<div v-for="(i,k) in deviceList" :key="k" class="item" @click="getRightData(i)">
|
|
|
|
|
<span>{{ i.deviceModeName }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div ref="right" class="right">
|
|
|
|
|
<div ref="search" class="search" style="min-height: 60px">
|
|
|
|
|
<el-form :inline="true" :model="form" class="demo-form-inline" v-show="tableShow">
|
|
|
|
|
<el-form v-show="tableShow" :inline="true" :model="form" class="demo-form-inline">
|
|
|
|
|
<el-form-item label="传感器编号">
|
|
|
|
|
<el-input v-model="form.data1" placeholder="传感器编号"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
@ -18,10 +18,10 @@
|
|
|
|
|
<el-form-item label="采集时间">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="form.data3"
|
|
|
|
|
type="datetimerange"
|
|
|
|
|
end-placeholder="结束日期"
|
|
|
|
|
range-separator="至"
|
|
|
|
|
start-placeholder="开始日期"
|
|
|
|
|
end-placeholder="结束日期">
|
|
|
|
|
type="datetimerange">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
@ -32,55 +32,64 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div :style="{height:maxHeight+'px'}" class="table">
|
|
|
|
|
<el-table
|
|
|
|
|
v-loading="loading"
|
|
|
|
|
v-if='tableShow'
|
|
|
|
|
v-loading="loading"
|
|
|
|
|
:cell-style="setStyle"
|
|
|
|
|
:data="tableData"
|
|
|
|
|
:header-cell-style="{ textAlign: 'center',backgroundColor:'#0a457d' }"
|
|
|
|
|
:max-height="maxHeight">
|
|
|
|
|
style="width: 100%">
|
|
|
|
|
<el-table-column v-for="i in deviceDataColumns" :label="i.columnName" :prop="i.columnKey">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<img v-if="tableData[scope.$index][i.columnKey].toString().includes('http')"
|
|
|
|
|
:src="tableData[scope.$index][i.columnKey]" alt="" height="100px"
|
|
|
|
|
width="100px">
|
|
|
|
|
<span v-else> {{ tableData[scope.$index][i.columnKey].toString() }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<!-- <el-table-column-->
|
|
|
|
|
<!-- label="rssi"-->
|
|
|
|
|
<!-- prop="rssi">-->
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
<!-- <el-table-column-->
|
|
|
|
|
<!-- label="value1"-->
|
|
|
|
|
<!-- prop="value1">-->
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
<!-- <el-table-column-->
|
|
|
|
|
<!-- label="编号"-->
|
|
|
|
|
<!-- prop="devicecode">-->
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
<!-- <el-table-column-->
|
|
|
|
|
<!-- label="alias"-->
|
|
|
|
|
<!-- prop="alias">-->
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
<!-- <el-table-column-->
|
|
|
|
|
<!-- label="设备名称"-->
|
|
|
|
|
<!-- prop="devicename">-->
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
<!-- <el-table-column-->
|
|
|
|
|
<!-- label="ts"-->
|
|
|
|
|
<!-- prop="ts">-->
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
<!-- <el-table-column-->
|
|
|
|
|
<!-- label="voltage"-->
|
|
|
|
|
<!-- prop="voltage">-->
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
|
<!-- <el-table-column-->
|
|
|
|
|
<!-- label="rssi"-->
|
|
|
|
|
<!-- prop="rssi">-->
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
<!-- <el-table-column-->
|
|
|
|
|
<!-- label="value1"-->
|
|
|
|
|
<!-- prop="value1">-->
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
<!-- <el-table-column-->
|
|
|
|
|
<!-- label="编号"-->
|
|
|
|
|
<!-- prop="devicecode">-->
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
<!-- <el-table-column-->
|
|
|
|
|
<!-- label="alias"-->
|
|
|
|
|
<!-- prop="alias">-->
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
<!-- <el-table-column-->
|
|
|
|
|
<!-- label="设备名称"-->
|
|
|
|
|
<!-- prop="devicename">-->
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
<!-- <el-table-column-->
|
|
|
|
|
<!-- label="ts"-->
|
|
|
|
|
<!-- prop="ts">-->
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
<!-- <el-table-column-->
|
|
|
|
|
<!-- label="voltage"-->
|
|
|
|
|
<!-- prop="voltage">-->
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="toHistory(scope.row.deviceid,scope.row.devicemodeid)"
|
|
|
|
|
>查看历史</el-button>
|
|
|
|
|
>查看历史
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</div>
|
|
|
|
|
<div ref="pagination" style="margin-top: 12px;height: 36px;">
|
|
|
|
|
<el-pagination :current-page="offset" :total="total" background layout="prev, pager, next" style="display: inline-block;float:right;" :pageSize="limit" @current-change="currentChange">
|
|
|
|
|
<el-pagination :current-page="offset" :pageSize="limit" :total="total" background
|
|
|
|
|
layout="prev, pager, next" style="display: inline-block;float:right;"
|
|
|
|
|
@current-change="currentChange">
|
|
|
|
|
</el-pagination>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -94,27 +103,26 @@ import {
|
|
|
|
|
} from '@/api/board/equipmentMonitoring'
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
},
|
|
|
|
|
components: {},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
loading:false,
|
|
|
|
|
loading: false,
|
|
|
|
|
tableShow: false,
|
|
|
|
|
form: {
|
|
|
|
|
data1: '',
|
|
|
|
|
data2: '',
|
|
|
|
|
data3: null
|
|
|
|
|
},
|
|
|
|
|
deviceModeId:'',
|
|
|
|
|
deviceModeId: '',
|
|
|
|
|
maxHeight: 0,
|
|
|
|
|
tableData: [],
|
|
|
|
|
deviceList:[],
|
|
|
|
|
deviceList: [],
|
|
|
|
|
sceneId: 0,
|
|
|
|
|
offset:1,
|
|
|
|
|
limit:10,
|
|
|
|
|
total:0,
|
|
|
|
|
deviceDataColumns:[],
|
|
|
|
|
tableDataRow:[]
|
|
|
|
|
offset: 1,
|
|
|
|
|
limit: 10,
|
|
|
|
|
total: 0,
|
|
|
|
|
deviceDataColumns: [],
|
|
|
|
|
tableDataRow: []
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async mounted() {
|
|
|
|
@ -122,30 +130,33 @@ export default {
|
|
|
|
|
await this.getData()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
query(){
|
|
|
|
|
this.getRightData({deviceModeId:this.deviceModeId})
|
|
|
|
|
log(e) {
|
|
|
|
|
console.log(e)
|
|
|
|
|
},
|
|
|
|
|
reset(){
|
|
|
|
|
query() {
|
|
|
|
|
this.getRightData({deviceModeId: this.deviceModeId})
|
|
|
|
|
},
|
|
|
|
|
reset() {
|
|
|
|
|
this.form = {
|
|
|
|
|
data1: '',
|
|
|
|
|
data2: '',
|
|
|
|
|
data3: null
|
|
|
|
|
}
|
|
|
|
|
this.getRightData({deviceModeId:this.deviceModeId})
|
|
|
|
|
this.getRightData({deviceModeId: this.deviceModeId})
|
|
|
|
|
},
|
|
|
|
|
async currentChange(e){
|
|
|
|
|
this.tableData =this.tableDataRow.slice(this.limit*(e-1),this.limit*e)
|
|
|
|
|
async currentChange(e) {
|
|
|
|
|
this.tableData = this.tableDataRow.slice(this.limit * (e - 1), this.limit * e)
|
|
|
|
|
},
|
|
|
|
|
async getRightData(e){
|
|
|
|
|
async getRightData(e) {
|
|
|
|
|
this.deviceModeId = e.deviceModeId
|
|
|
|
|
this.loading = true
|
|
|
|
|
await this.setSelectLatestDataByDeviceMode({
|
|
|
|
|
"sceneId": this.$store.getters.sceneId,
|
|
|
|
|
"deviceModeId": e.deviceModeId,
|
|
|
|
|
deviceCode:this.form.data1,
|
|
|
|
|
deviceName:this.form.data2,
|
|
|
|
|
startTime:this.form?.data3?.length>1? new Date(this.form.data3[0]).getTime():'',
|
|
|
|
|
endTime:this.form?.data3?.length>1? new Date(this.form.data3[1]).getTime():'',
|
|
|
|
|
deviceCode: this.form.data1,
|
|
|
|
|
deviceName: this.form.data2,
|
|
|
|
|
startTime: this.form?.data3?.length > 1 ? new Date(this.form.data3[0]).getTime() : '',
|
|
|
|
|
endTime: this.form?.data3?.length > 1 ? new Date(this.form.data3[1]).getTime() : '',
|
|
|
|
|
// "offset": this.offset-1,
|
|
|
|
|
// "limit": 10
|
|
|
|
|
})
|
|
|
|
@ -163,24 +174,24 @@ export default {
|
|
|
|
|
return {textAlign: 'center', backgroundColor: '#063468', color: '#05aaba'}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async setSelectLatestDataByDeviceMode(e){
|
|
|
|
|
async setSelectLatestDataByDeviceMode(e) {
|
|
|
|
|
const {data} = await selectLatestDataByDeviceMode(e)
|
|
|
|
|
this.deviceDataColumns = data.deviceDataColumns
|
|
|
|
|
this.tableDataRow =data.latestData || []
|
|
|
|
|
this.tableData =( data.latestData || []).slice(0,this.limit)
|
|
|
|
|
this.total=data.latestData.length || 0
|
|
|
|
|
this.tableDataRow = data.latestData || []
|
|
|
|
|
this.tableData = (data.latestData || []).slice(0, this.limit)
|
|
|
|
|
this.total = data.latestData.length || 0
|
|
|
|
|
this.offset = 1
|
|
|
|
|
},
|
|
|
|
|
async setDeviceModesBySceneId(){
|
|
|
|
|
const {data} = await getDeviceModesBySceneId( {
|
|
|
|
|
async setDeviceModesBySceneId() {
|
|
|
|
|
const {data} = await getDeviceModesBySceneId({
|
|
|
|
|
"sceneId": this.$store.getters.sceneId,
|
|
|
|
|
})
|
|
|
|
|
this.deviceList = data
|
|
|
|
|
},
|
|
|
|
|
toHistory(e,i){
|
|
|
|
|
toHistory(e, i) {
|
|
|
|
|
console.log(e)
|
|
|
|
|
console.log(i)
|
|
|
|
|
this.$router.push({path: "/board/senso",query:{id:e,deviceModeId:i}});
|
|
|
|
|
this.$router.push({path: "/board/senso", query: {id: e, deviceModeId: i}});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
@ -253,7 +264,8 @@ export default {
|
|
|
|
|
color: #25bffc;
|
|
|
|
|
border-color: #25bffc;
|
|
|
|
|
}
|
|
|
|
|
/deep/.el-range-input{
|
|
|
|
|
|
|
|
|
|
/deep/ .el-range-input {
|
|
|
|
|
background-color: #0000;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|