修改标题

dev
夜笙歌 1 year ago
parent ec355bf39a
commit 4c049995a1

@ -7,8 +7,8 @@
</div> </div>
</div> </div>
<div ref="right" class="right"> <div ref="right" class="right">
<div ref="search" class="search"> <div ref="search" class="search" style="min-height: 60px">
<el-form :inline="true" :model="form" class="demo-form-inline"> <el-form :inline="true" :model="form" class="demo-form-inline" v-show="tableShow">
<el-form-item label="传感器编号"> <el-form-item label="传感器编号">
<el-input v-model="form.data1" placeholder="传感器编号"></el-input> <el-input v-model="form.data1" placeholder="传感器编号"></el-input>
</el-form-item> </el-form-item>
@ -18,13 +18,15 @@
<el-form-item label="采集时间"> <el-form-item label="采集时间">
<el-date-picker <el-date-picker
v-model="form.data3" v-model="form.data3"
placeholder="选择日期时间" type="datetimerange"
type="datetime"> range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="()=>{}"></el-button> <el-button type="primary" @click="query"></el-button>
<el-button @click="()=>{}"></el-button> <el-button @click="reset"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
@ -71,14 +73,14 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="primary" type="primary"
@click="toHistory" @click="toHistory(scope.row.deviceid,scope.row.devicemodeid)"
>查看历史</el-button> >查看历史</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div ref="pagination" style="margin-top: 12px;height: 36px;"> <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="10" @current-change="currentChange"> <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> </el-pagination>
</div> </div>
</div> </div>
@ -103,6 +105,7 @@ export default {
data2: '', data2: '',
data3: null data3: null
}, },
deviceModeId:'',
maxHeight: 0, maxHeight: 0,
tableData: [], tableData: [],
deviceList:[], deviceList:[],
@ -111,6 +114,7 @@ export default {
limit:10, limit:10,
total:0, total:0,
deviceDataColumns:[], deviceDataColumns:[],
tableDataRow:[]
} }
}, },
async mounted() { async mounted() {
@ -118,17 +122,32 @@ export default {
await this.getData() await this.getData()
}, },
methods: { methods: {
async currentChange(){ query(){
await this.getRightData() this.getRightData({deviceModeId:this.deviceModeId})
},
reset(){
this.form = {
data1: '',
data2: '',
data3: null
}
this.getRightData({deviceModeId:this.deviceModeId})
},
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 this.loading = true
await this.setSelectLatestDataByDeviceMode({ await this.setSelectLatestDataByDeviceMode({
"sceneId": this.$store.getters.sceneId, "sceneId": this.$store.getters.sceneId,
"deviceModeId": e.deviceModeId, "deviceModeId": e.deviceModeId,
"startTime": 0, deviceCode:this.form.data1,
"offset": this.offset-1, deviceName:this.form.data2,
"limit": 10 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
}) })
this.loading = false this.loading = false
this.tableShow = false this.tableShow = false
@ -147,8 +166,10 @@ export default {
async setSelectLatestDataByDeviceMode(e){ async setSelectLatestDataByDeviceMode(e){
const {data} = await selectLatestDataByDeviceMode(e) const {data} = await selectLatestDataByDeviceMode(e)
this.deviceDataColumns = data.deviceDataColumns this.deviceDataColumns = data.deviceDataColumns
this.tableData = data.latestData || [] this.tableDataRow =data.latestData || []
this.total=data.total this.tableData =( data.latestData || []).slice(0,this.limit)
this.total=data.latestData.length || 0
this.offset = 1
}, },
async setDeviceModesBySceneId(){ async setDeviceModesBySceneId(){
const {data} = await getDeviceModesBySceneId( { const {data} = await getDeviceModesBySceneId( {
@ -156,8 +177,10 @@ export default {
}) })
this.deviceList = data this.deviceList = data
}, },
toHistory(){ toHistory(e,i){
this.$router.push({path: "/board/senso"}); console.log(e)
console.log(i)
this.$router.push({path: "/board/senso",query:{id:e,deviceModeId:i}});
} }
} }
}; };
@ -230,6 +253,9 @@ export default {
color: #25bffc; color: #25bffc;
border-color: #25bffc; border-color: #25bffc;
} }
/deep/.el-range-input{
background-color: #0000;
}
} }
.table { .table {

@ -72,30 +72,30 @@
</el-collapse> </el-collapse>
</div> </div>
<el-collapse accordion> <!-- <el-collapse accordion>-->
<el-collapse-item v-for="i in bottomData"> <div v-for="i in bottomData" >
<template slot="title"> <!-- <template slot="title">-->
<div class="itemBg"> <div class="itemBg">
<div class="icon"></div> <div class="icon"></div>
<div class="icon1"></div> <div class="icon1"></div>
<div class="icon2"></div> <div :style="'background-image: url('+(i&&i.devicePic)+')'" class="icon2"></div>
<div class="title"> {{ i.deviceName }}</div> <div class="title"> {{ i.deviceName }}</div>
<div class="info"> <div class="info">
<div class="info1">所属区域</div> <div class="info1">设备编号:</div>
<div class="info2">大厅</div> <div class="info2"> {{ i.deviceCode }}</div>
</div> </div>
<div class="info" style="left: 70vh;"> <div class="info" style="left: 70vh;">
<div class="info1">位置:</div> <div class="info1">设备名称:</div>
<div class="info2">深圳</div> <div class="info2">{{ i.deviceName }}</div>
</div> </div>
<div class="info" style="left: 80vh;"> <div class="info" style="left: 80vh;">
<div class="info1">日期:</div> <div class="info1">设备位置:</div>
<div class="info2">2023-01-01 00:00:00</div> <div class="info2">{{ i.deviceLocation }}</div>
</div> </div>
</div> </div>
</template> <!-- </template>-->
</el-collapse-item> </div>
</el-collapse> <!-- </el-collapse>-->
</div> </div>
</div> </div>
</template> </template>
@ -166,6 +166,7 @@ export default {
}) })
this.tableData = data.historyData.dataList this.tableData = data.historyData.dataList
this.total = data.historyData.count this.total = data.historyData.count
this.currentPage = 1
this.deviceDataColumns = data.deviceDataColumns this.deviceDataColumns = data.deviceDataColumns
this.$nextTick(()=>{ this.$nextTick(()=>{
this.show = true this.show = true

Loading…
Cancel
Save