提交 80022c88 authored 作者: zs's avatar zs

edit

上级 0b91117e
......@@ -19,6 +19,25 @@ export default {
}
},
async pageSelect(data){
let sqllitedb = await SqlliteDbUtil.initSqlliteDB()
let pre = (data.page -1) * data.size
let nxt = data.size
try {
let count = await sqllitedb.selectSQL(`select count(*) as total from ${table.logListName} limit 1 `)
let sql = `select * from ${table.logListName} ORDER BY time desc limit ${nxt} offset ${pre} `
let rs = await sqllitedb.selectSQL(sql)
console.log('sql',sql)
return {
data:rs || [],
total:count[0].total || 0
}
} catch (e) {
console.log(e.message)
} finally {
await sqllitedb.closeDB();
}
},
async addlog(data) {
let sqllitedb = await SqlliteDbUtil.initSqlliteDB()
try {
......
<template>
<view class="operLog">
<uni-nav-bar
:fixed="true"
background-color="rgba(214, 240, 255, 0.0)"
status-bar
rightWidth="300"
>
<uni-nav-bar :fixed="true" background-color="rgba(214, 240, 255, 0.0)" status-bar rightWidth="300">
<block slot="left">
<view class="uni-nav-bar-text" @click="back">
<text class="iconfont icon-fanhui"></text
></view>
<text class="iconfont icon-fanhui"></text>
</view>
</block>
</uni-nav-bar>
......@@ -21,23 +16,12 @@
<!-- 搜索区域 -->
<view class="search-com">
<view class="search-com-left">
<uni-data-select
class="uni-search-item"
v-model="searchFrom.type"
:localdata="typeList"
@change="change"
placeholder="操作类型:全部"
:key="new Date().getTime()"
></uni-data-select>
<uni-data-select class="uni-search-item" v-model="searchFrom.type" :localdata="typeList"
@change="change" placeholder="操作类型:全部" :key="new Date().getTime()"></uni-data-select>
<view class="search-com-right">
<uni-datetime-picker
class="uni-datetime-picker"
type="daterange"
v-model="searchFrom.inspectionTime"
:border="false"
@change="timeChange"
/>
<uni-datetime-picker class="uni-datetime-picker" type="daterange"
v-model="searchFrom.inspectionTime" :border="false" @change="timeChange" />
</view>
</view>
</view>
......@@ -48,11 +32,7 @@
</view>
<!-- 展示区域 -->
<view class="table-main box-shaow-box">
<view
class="log-item"
v-for="(item, index) in tableData"
:key="index"
>
<view class="log-item" v-for="(item, index) in tableData" :key="index">
<text class="time bold">{{ item.time }}</text>
<view class="desc">
......@@ -60,24 +40,33 @@
<text class="xuxian">......</text>
<text class="bold"> {{ item.roleName }} {{ item.user }} </text>
<text class="text">操作</text>
<text class="bold">{{ item.module }}{{ item.type }}</text>
<text v-if="item.detail" class="text">内容</text>
<text class="text">操作模块</text>
<text class="bold">{{ item.module }}</text>
<text v-if="item.detail" class="text">操作详情</text>
<text v-if="item.detail" class="bold">{{ item.detail }}</text>
<text v-if="item.type" class="text">操作类型</text>
<text v-if="item.type" class="bold">{{ item.type }}</text>
</view>
</view>
</view>
<uni-pagination class="pagination" :total="total" :show-icon="true" :current="pageCurrent"
@change="pageChange"></uni-pagination>
</view>
</view>
</view>
</template>
<script>
import { getLogList } from "@/request/index.js";
import { LOG_TYPE_ENUM } from "@/utils/IoReadingAndWriting.js";
export default {
components: {
},
import {
getLogList
} from "@/request/index.js";
import {
LOG_TYPE_ENUM
} from "@/utils/IoReadingAndWriting.js";
export default {
components: {},
data() {
return {
searchFrom: {
......@@ -93,11 +82,19 @@ export default {
// 数据总量
total: 0,
loading: false,
typeList: [
{ value: "all", text: "全部" },
typeList: [{
value: "all",
text: "全部"
},
{ value: "1", text: "巡检" },
{ value: "2", text: "同步" },
{
value: "1",
text: "巡检"
},
{
value: "2",
text: "同步"
},
{
text: "其他",
......@@ -137,6 +134,14 @@ export default {
});
},
methods: {
pageChange(e) {
const {
type,
current
} = e
this.pageCurrent = e.current
this.getData()
},
change(e) {
this.searchForm.type = e;
this.getData();
......@@ -159,10 +164,27 @@ export default {
},
// 获取数据
getData() {
async getData() {
this.loading = true;
const { type, startTime, endTime } = this.searchForm;
const {
type,
startTime,
endTime
} = this.searchForm;
let data = {
page: 2,
size: 10
}
let res = await this.$logApi.pageSelect({
page: this.pageCurrent,
size: this.pageSize
})
if (res) {
this.total = res.total
this.tableData = res.data
}
this.loading = false;
return
this.tableData = this.recordData.filter((item) => {
let matchType = true; // 类型筛选
let matchTime = true; // 时间筛选
......@@ -190,21 +212,19 @@ export default {
return matchType && matchTime;
});
this.loading = false;
},
},
};
};
</script>
<style scoped lang="less" scoped>
.operLog {
background-image: linear-gradient(
90deg,
.operLog {
background-image: linear-gradient(90deg,
#e9f7fe 0%,
#dceffe 40%,
#d5ebfd 66%,
#c9e8fe 100%
);
#c9e8fe 100%);
.main {
margin-top: -44px;
}
......@@ -212,14 +232,16 @@ export default {
.container {
height: 100%;
padding: 16px 24px;
height: calc(100vh - 50px - 24px - 8px);
height: calc(100vh - 44px );
.search-com {
display: flex;
align-items: center;
.search-com-left {
display: flex;
align-items: center;
.uni-search-item {
margin-right: 12px;
width: 200px;
......@@ -228,8 +250,10 @@ export default {
border: none !important;
}
}
.search-com-right {
width: 300px;
.uni-datetime-picker {
background: #fff;
}
......@@ -241,6 +265,7 @@ export default {
font-size: 14px;
color: #4a4a4a;
font-weight: 400;
.num {
font-size: 18px;
color: #3774f6;
......@@ -249,20 +274,24 @@ export default {
margin-right: 5px;
}
}
.table-main {
padding: 28px 24px;
background: #fff;
overflow: auto;
height: calc(100vh - 26px - 16px - 8px - 36px - 62px - 18px - 50px);
.log-item {
display: flex;
align-items: flex-start;
padding-bottom: 20px;
&:last-of-type {
.xuxian {
display: none;
}
}
.time {
font-size: 16px;
color: #000000;
......@@ -271,6 +300,7 @@ export default {
font-weight: 500;
position: relative;
margin-right: 40px;
&::after {
position: absolute;
content: " ";
......@@ -283,12 +313,15 @@ export default {
background: #3774f6;
}
}
.bold {
font-weight: bold !important;
color: #000000 !important;
}
.desc {
position: relative;
.xuxian {
position: absolute;
transform: rotate(90deg);
......@@ -297,12 +330,14 @@ export default {
left: -29px;
top: 24px;
}
text {
font-size: 14px;
color: #4a4a4a;
line-height: 22px;
font-weight: 400;
}
.text {
margin: 0 8px;
}
......@@ -310,18 +345,22 @@ export default {
}
}
}
.pagination{
margin-top: 10px;
::v-deep .page--active{
padding: 0 10px;
}
}
.seize-seat {
height: 50px;
width: 100%;
background-image: linear-gradient(
90deg,
background-image: linear-gradient(90deg,
#e9f7fe 0%,
#dceffe 40%,
#d5ebfd 66%,
#c9e8fe 100%
);
#c9e8fe 100%);
}
// 导航栏样式
.uni-nav-bar-text {
height: 36px;
......@@ -332,10 +371,12 @@ export default {
border-radius: 50%;
color: #333;
text-align: center;
.iconfont {
font-size: 20px;
line-height: 36px;
}
}
}
}
</style>
\ No newline at end of file
......@@ -77,7 +77,11 @@
mode="aspectFill"
class="photo"
></image>
<view class="photo-mask">拍摄时间:{{photo.time}}</view>
<view class="photo-mask">
<view>照片编号:{{photo.id}}</view>
<view>拍摄时间:{{photo.time}}</view>
<view>数据同步:{{ photo.synchronization ? "已同步" : "待同步"}}</view>
</view>
<view
class="check-icon"
:class="{ active: photo.selected }"
......@@ -96,7 +100,7 @@
photo.synchronization ? "已同步" : "待同步"
}}</view>
<view class="photo-info">
<text class="no">照片编号:{{ photo.id }}</text>
照片编号:{{ photo.id }}
</view>
</view>
</view>
......@@ -485,9 +489,7 @@ export default {
height: 168px;
}
.photo-mask{
position: absolute;
}
.check-icon {
position: absolute;
top: 6.4px;
......@@ -540,7 +542,6 @@ export default {
.photo-mask{
background: rgba(0, 0, 0, 0.5);
color: #ffffff;
text-align: center;
position: absolute;
bottom: 26.4px;
width: 148px;
......@@ -548,18 +549,14 @@ export default {
right: 0;
border-radius: 4.8px;
margin:0 auto;
padding: 3.6px;
padding:4.8px;
font-size: 9.6px;
color: #ffffff;
line-height: 16px;
font-weight: 400;
text-shadow: 0 0 2px rgba(0,0,0,0.30);
font-weight: 400;
}
.photo-info {
text-align: center;
text {
font-family: PingFangSC-Regular;
font-size: 11.2px;
color: #000000;
......@@ -570,7 +567,6 @@ export default {
}
}
}
}
}
.inspection-button {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论