electricControl/pages/main/history.stml

194 lines
5.7 KiB
Plaintext
Raw Normal View History

2023-08-04 09:20:01 +08:00
<template>
<view class="history_wrap">
2023-08-04 10:55:53 +08:00
<text class="history_back_text" @click="handleBackIndex">返回</text>
2023-08-04 09:20:01 +08:00
<text class="history_title">历史操作记录</text>
2023-08-04 10:55:53 +08:00
<view class="table_wrap">
<view class="table_title">
<text class="table_title_item_one">动作</text>
<text class="table_title_item_two">实时参数</text>
2023-08-09 10:03:01 +08:00
<text class="table_title_item_three">时间</text>
2023-08-04 10:55:53 +08:00
</view>
<scroll-view
class="history_list"
scroll-x ="false"
scroll-y
onscrolltoupper="handleRefresh"
onscrolltolower="handleLoadMore"
>
<view
class="history_list_inline"
v-for="item in listData"
>
2023-08-09 10:03:01 +08:00
<text class="history_list_inline_item_one">{{item.action}}</text>
<text class="history_list_inline_item_two">{{item.param}}</text>
<text class="history_list_inline_item_three">{{item.time}}</text>
2023-08-04 10:55:53 +08:00
</view>
</scroll-view>
</view>
2023-08-04 09:20:01 +08:00
</view>
</template>
<script>
2023-08-09 10:03:01 +08:00
import {dbUtils} from '../../script/dbUtils.js'
2023-08-04 09:20:01 +08:00
export default {
name: 'history',
data() {
return{
2023-08-04 10:55:53 +08:00
listData:[
2023-08-09 10:03:01 +08:00
// {name:'高压风冷开启',cmd:'A路电流(5.2A) B路电流(0.2A) C路电流(2.4A) D路电流(1.5A)',time:'11.15 13:28:55'},
// {name:'高压风冷关闭',cmd:'A路电流(5.2A) B路电流(0.2A) C路电流(2.4A) D路电流(1.5A)',time:'12.15 13:25:55'},
// {name:'低压风冷开启',cmd:'A路电流(5.2A) B路电流(0.2A) C路电流(2.4A) D路电流(1.5A)',time:'12.15 13.25:55'},
// {name:'中压风冷开启',cmd:'A路电流(5.2A) B路电流(0.2A) C路电流(2.4A) D路电流(1.5A)',time:'12.15 13.23:55'},
// {name:'高压风冷开启',cmd:'A路电流(5.2A) B路电流(0.2A) C路电流(2.4A) D路电流(1.5A)',time:'12.15 13.21:55'},
// {name:'高压风冷开启',cmd:'A路电流(5.2A) B路电流(0.2A) C路电流(2.4A) D路电流(1.5A)',time:'12.15 13.20:55'},
// {name:'高压风冷开启',cmd:'A路电流(5.2A) B路电流(0.2A) C路电流(2.4A) D路电流(1.5A)',time:'11.15 13:28:55'},
// {name:'高压风冷关闭',cmd:'A路电流(5.2A) B路电流(0.2A) C路电流(2.4A) D路电流(1.5A)',time:'12.15 13:25:55'},
// {name:'低压风冷开启',cmd:'A路电流(5.2A) B路电流(0.2A) C路电流(2.4A) D路电流(1.5A)',time:'12.15 13.25:55'},
// {name:'中压风冷开启',cmd:'A路电流(5.2A) B路电流(0.2A) C路电流(2.4A) D路电流(1.5A)',time:'12.15 13.23:55'},
// {name:'高压风冷开启',cmd:'A路电流(5.2A) B路电流(0.2A) C路电流(2.4A) D路电流(1.5A)',time:'12.15 13.21:55'},
// {name:'高压风冷开启',cmd:'A路电流(5.2A) B路电流(0.2A) C路电流(2.4A) D路电流(1.5A)',time:'12.15 13.20:55'},
// {name:'高压风冷开启',cmd:'A路电流(5.2A) B路电流(0.2A) C路电流(2.4A) D路电流(1.5A)',time:'11.15 13:28:55'},
// {name:'高压风冷关闭',cmd:'A路电流(5.2A) B路电流(0.2A) C路电流(2.4A) D路电流(1.5A)',time:'12.15 13:25:55'},
// {name:'低压风冷开启',cmd:'A路电流(5.2A) B路电流(0.2A) C路电流(2.4A) D路电流(1.5A)',time:'12.15 13.25:55'},
// {name:'中压风冷开启',cmd:'A路电流(5.2A) B路电流(0.2A) C路电流(2.4A) D路电流(1.5A)',time:'12.15 13.23:55'},
// {name:'高压风冷开启',cmd:'A路电流(5.2A) B路电流(0.2A) C路电流(2.4A) D路电流(1.5A)',time:'12.15 13.21:55'},
// {name:'高压风冷开启',cmd:'A路电流(5.2A) B路电流(0.2A) C路电流(2.4A) D路电流(1.5A)',time:'12.15 13.20:55'},
2023-08-04 10:55:53 +08:00
]
2023-08-04 09:20:01 +08:00
}
},
apiready(){
2023-08-09 10:03:01 +08:00
const vm = this;
var db = api.require('db');
db.openDatabase({
name: 'test',
path: 'fs://Database/cqjiouzai.db'
}, function(ret, err) {
if (ret.status) {
dbUtils.select(db, 'SELECT * FROM Log', function(ret, err) {
var data = ret.data;
if(undefined != data && data.length > 0){
vm.data.listData = data;
}
});
}
});
2023-08-04 09:20:01 +08:00
},
methods: {
2023-08-04 10:55:53 +08:00
//返回首页
handleBackIndex(){
2023-08-09 10:03:01 +08:00
api.closeWin();
api.sendEvent({
name: 'myEvent',
extra: {
close: 'close',
}
2023-08-04 10:55:53 +08:00
});
},
//下拉刷新
handleRefresh(){
console.log("顶部触发");
},
//加载更多
handleLoadMore(){
console.log("加载更多");
},
2023-08-04 09:20:01 +08:00
}
}
</script>
<style>
.history_wrap{
width: 100%;
2023-08-09 10:03:01 +08:00
height: 100%;
2023-08-04 09:20:01 +08:00
box-sizing: border-box;
padding: 20px;
2023-08-04 10:55:53 +08:00
background-image: url("../../image/login.png");
background-size: 120%;
background-repeat: no-repeat;
background-position: center;
position: absolute;
}
.history_back_text{
font-size: 40px;
color: #ffffff;
font-weight: bold;
position: absolute;
top: 20px;
left: 20px;
2023-08-04 09:20:01 +08:00
}
.history_title{
width: 100%;
text-align: center;
font-size: 40px;
font-weight: bold;
2023-08-04 10:55:53 +08:00
color: #ffffff;
}
.table_wrap{
width: 100%;
margin-top: 20px;
}
.table_title{
display: flex;
flex-direction: row;
align-items: center;
}
.table_title_item_one{
2023-08-09 10:03:01 +08:00
font-size: 30px;
2023-08-04 10:55:53 +08:00
color: #ffffff;
border: 1px solid #ffffff;
2023-08-09 10:03:01 +08:00
width: 17%;
2023-08-04 10:55:53 +08:00
box-sizing: border-box;
padding: 10px;
text-align: center;
}
.table_title_item_two{
2023-08-09 10:03:01 +08:00
font-size: 30px;
color: #ffffff;
border: 1px solid #ffffff;
width: 64%;
box-sizing: border-box;
padding: 10px;
text-align: center;
}
.table_title_item_three{
font-size: 30px;
2023-08-04 10:55:53 +08:00
color: #ffffff;
border: 1px solid #ffffff;
2023-08-09 10:03:01 +08:00
width: 19%;
2023-08-04 10:55:53 +08:00
box-sizing: border-box;
padding: 10px;
text-align: center;
2023-08-04 09:20:01 +08:00
}
.history_list{
border: 1px solid silver;
width: 100%;
2023-08-04 10:55:53 +08:00
height: 70vh;
}
.history_list_inline{
display: flex;
flex-direction: row;
align-items: center;
}
.history_list_inline_item_one{
2023-08-09 10:03:01 +08:00
font-size: 22px;
2023-08-04 10:55:53 +08:00
color: #ffffff;
border: 1px solid #ffffff;
2023-08-09 10:03:01 +08:00
width: 17%;
2023-08-04 10:55:53 +08:00
box-sizing: border-box;
padding: 10px;
}
.history_list_inline_item_two{
2023-08-09 10:03:01 +08:00
font-size: 22px;
color: #ffffff;
border: 1px solid #ffffff;
width: 64%;
box-sizing: border-box;
padding: 10px;
}
.history_list_inline_item_three{
font-size: 22px;
2023-08-04 10:55:53 +08:00
color: #ffffff;
border: 1px solid #ffffff;
2023-08-09 10:03:01 +08:00
width: 19%;
2023-08-04 10:55:53 +08:00
box-sizing: border-box;
padding: 10px;
2023-08-04 09:20:01 +08:00
}
</style>