You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
191 lines
3.9 KiB
191 lines
3.9 KiB
<template>
|
|
<view class="main">
|
|
<view class="searchBox">
|
|
<searchRow placeholder="搜索机器名称/用户名" />
|
|
</view>
|
|
<view class="tabs">
|
|
<myTab :tabList="tabList" @tabClick="tabClick" :current="current"></myTab>
|
|
</view>
|
|
<view class="ul">
|
|
<view class="total"><text v-if="total">共{{total}}条</text> </view>
|
|
<view class="card" v-for="(item,index) in list" :key="index">
|
|
<view class="row">
|
|
<view class="lab">机器名称</view>
|
|
<view class="val">{{item.machineName}}</view>
|
|
</view>
|
|
<view class="row">
|
|
<view class="lab">用户名称</view>
|
|
<view class="val">{{item.userName}}</view>
|
|
</view>
|
|
<view class="row">
|
|
<view class="lab">用户昵称</view>
|
|
<view class="val">{{item.userNickname}}</view>
|
|
</view>
|
|
<view class="row">
|
|
<view class="lab">操作类型</view>
|
|
<view class="val">{{item.type}}</view>
|
|
</view>
|
|
<view class="row">
|
|
<view class="lab">操作详情</view>
|
|
<view class="val">{{item.operationInfo}}</view>
|
|
</view>
|
|
<view class="row">
|
|
<view class="lab">操作ip</view>
|
|
<view class="val">{{item.eventIp}}</view>
|
|
</view>
|
|
<view class="row">
|
|
<view class="lab">创建时间</view>
|
|
<view class="val">{{item.crateTime}}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view style="padding-bottom: 20rpx;" v-if="list.length">
|
|
<u-loadmore :status="status" />
|
|
</view>
|
|
<nodata v-if="!list.length&&status=='nomore'"></nodata>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import { machineOperationDOList } from '@/config/api.js'
|
|
export default {
|
|
data() {
|
|
return {
|
|
tabList: [{
|
|
name: '全部',
|
|
id: 0
|
|
}, {
|
|
name: '新增',
|
|
}, {
|
|
name: '删除'
|
|
}, {
|
|
name: '下载'
|
|
}, {
|
|
name: '移动'
|
|
}, {
|
|
name: '提权'
|
|
}, ],
|
|
params: {
|
|
pageNum: 1,
|
|
pageSize: 8,
|
|
machineName: '',
|
|
type: '',
|
|
userName: ''
|
|
},
|
|
current: 0,
|
|
total: 0,
|
|
list: [],
|
|
name: '',
|
|
status: ''
|
|
}
|
|
},
|
|
|
|
onLoad() {
|
|
this.initList()
|
|
},
|
|
onPullDownRefresh() {
|
|
this.initList()
|
|
},
|
|
onReachBottom() {
|
|
if(this.total>this.list.length) {
|
|
this.machineOperationDOListFn()
|
|
}
|
|
},
|
|
methods: {
|
|
initList() {
|
|
this.list = []
|
|
this.params.pageNum = 1
|
|
this.status = 'loadmore'
|
|
this.machineOperationDOListFn()
|
|
},
|
|
async machineOperationDOListFn() {
|
|
let obj = Object.assign({},this.params)
|
|
if(this.current) {
|
|
obj.type = this.tabList[this.current].name
|
|
}else {
|
|
delete obj.type
|
|
}
|
|
const res = await machineOperationDOList(obj)
|
|
this.params.pageNum ++
|
|
console.log(res)
|
|
this.list.push(...res.rows)
|
|
this.total = res.total
|
|
if(this.list.length>=this.total) {
|
|
this.status = 'nomore'
|
|
}else {
|
|
this.status = 'loadmore'
|
|
}
|
|
uni.stopPullDownRefresh()
|
|
},
|
|
tabClick(item) {
|
|
this.current = item.index
|
|
this.initList()
|
|
},
|
|
searchFn(val) {
|
|
this.name = val
|
|
this.machineOperationDOListFn()
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.searchBox {
|
|
padding: 16rpx 30rpx;
|
|
background-color: #fff;
|
|
}
|
|
|
|
.tabs {
|
|
background-color: #fff;
|
|
margin-top: 8rpx;
|
|
padding: 16rpx 0;
|
|
}
|
|
|
|
.ul {
|
|
width: 100%;
|
|
padding: 0 30rpx 4rpx 30rpx;
|
|
.total {
|
|
height: 66rpx;
|
|
line-height: 66rpx;
|
|
font-size: 24rpx;
|
|
color: #999;
|
|
text-align: right;
|
|
}
|
|
|
|
.card {
|
|
padding: 10rpx 28rpx;
|
|
margin-bottom: 24rpx;
|
|
.row {
|
|
// align-items: center;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
padding: 16rpx 0;
|
|
font-size: 26rpx;
|
|
color: #333;
|
|
.lab {
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.val {
|
|
padding: 0 0 0 30rpx;
|
|
&.blue {
|
|
color: $themC;
|
|
}
|
|
&.hui {
|
|
color: #999;
|
|
}
|
|
|
|
}
|
|
.flex {
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
.icon {
|
|
width: 28rpx;
|
|
height: 30rpx;
|
|
margin-right: 20rpx;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|