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

edit

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