180 lines
4.8 KiB
Vue
180 lines
4.8 KiB
Vue
<template>
|
||
<z-paging ref="paging" @query="queryList" v-model="dataList" :default-page-size="queryParams.pageSize"
|
||
:auto-show-system-loading="true" empty-view-text="抱歉,暂时还没有相关数据!">
|
||
<template #top>
|
||
<custom-nav-bar :left="true" title="操作日志"></custom-nav-bar>
|
||
<view style="background: #e7fdeb;padding: 5px;">
|
||
<u-search v-model="queryParams.searchValue" @search="queryList" />
|
||
</view>
|
||
</template>
|
||
<view class="index-container">
|
||
<view class="item-container" v-for="item in dataList">
|
||
<view style="display: flex; align-items: center; justify-content: space-between;">
|
||
<view class="flex-text" style="margin: 15px;">
|
||
<view class="flex-text-one" style="color: black;">出水口:</view>
|
||
<view>{{ item.woName}}</view>
|
||
</view>
|
||
<view style="margin-right: 5px;" v-hasPermi="['system:land:edit']">
|
||
<u-button type="primary" plain plainFill>
|
||
{{ item.operResult}}
|
||
</u-button>
|
||
</view>
|
||
</view>
|
||
<u-gap height="1" bgColor="#D2D2D2"></u-gap>
|
||
<view style="display: flex;justify-content: space-between;align-items: center;"
|
||
@click="openStepPop(item)">
|
||
<view class="data">
|
||
<view class="flex-text global-font-size-1">
|
||
<view class="flex-text-one">设备名称:</view>
|
||
<view>{{ item.operSubject}}</view>
|
||
</view>
|
||
<view class="flex-text global-font-size-1">
|
||
<view class="flex-text-one">执行内容:</view>
|
||
<view>{{ item.operContent}}</view>
|
||
</view>
|
||
<view class="flex-text global-font-size-1" style="margin-top: 5px;">
|
||
<view class="flex-text-one">操作人员:</view>
|
||
<view>{{ item.operUser}}</view>
|
||
</view>
|
||
<view class="flex-text global-font-size-1" style="margin-top: 5px;">
|
||
<view class="flex-text-one">操作时间:</view>
|
||
<view>{{ item.occurTime}}</view>
|
||
</view>
|
||
</view>
|
||
<view>
|
||
<view v-hasPermi="['land:land:query']" style="margin-right: 10px;">
|
||
<u-icon name="arrow-right"></u-icon>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</z-paging>
|
||
|
||
<!-- 图层弹出 -->
|
||
<u-popup mode="center" :show="openPop" @close="openPop = false">
|
||
<view class="popup-content" style="width: 70vw;height: 280px;">
|
||
<u-steps direction="column" :current="stepCurrent">
|
||
<u-steps-item v-for="item in this.stepList" :title="item.title" :desc="item.description"></u-steps-item>
|
||
</u-steps>
|
||
</view>
|
||
</u-popup>
|
||
</template>
|
||
<script>
|
||
import * as userlog from "@/api/iotlog/userlog.js"
|
||
import * as datavalve from "@/api/iotlog/datavalve.js"
|
||
|
||
export default {
|
||
data() {
|
||
return {
|
||
dataList: [],
|
||
queryParams: {
|
||
pageNum: 1,
|
||
pageSize: 20,
|
||
logType: 1, //1:设备,2:系统
|
||
landId: -1, //地块id
|
||
operType: "control", //控制
|
||
operSource: 1, //用户
|
||
searchValue: "", //出水口,设备code
|
||
},
|
||
openPop: false,
|
||
stepCurrent: 0,
|
||
stepList: [],
|
||
}
|
||
},
|
||
onLoad(par) {
|
||
if (par.queryParams) {
|
||
let queryParams = JSON.parse(par.queryParams);
|
||
this.queryParams = Object.assign(this.queryParams, queryParams)
|
||
} else {
|
||
const cacheData = uni.getStorageSync("cacheData");
|
||
if (cacheData) {
|
||
this.queryParams.landId = cacheData.land.id;
|
||
}
|
||
}
|
||
},
|
||
onShow() {},
|
||
mounted() {},
|
||
methods: {
|
||
queryList(pageNo, pageSize) {
|
||
this.queryParams.pageNum = pageNo;
|
||
userlog.getlist(this.queryParams).then(res => {
|
||
this.$refs.paging.completeByTotal(res.rows, res.total);
|
||
});
|
||
},
|
||
async openStepPop(item) {
|
||
let stepList = userlog.getSeqlistTemp();
|
||
let stepCurrent = 0;
|
||
this.stepList = [];
|
||
userlog.getSeqlist({
|
||
traceId: item.traceId
|
||
}).then(response => {
|
||
if (response.rows.length) {
|
||
response.rows.forEach(item => {
|
||
stepList[item.eventType - 1].description = item.occurTime;
|
||
stepList[item.eventType - 1].status = 'success';
|
||
if (item.eventType > stepCurrent) {
|
||
stepCurrent = item.eventType;
|
||
}
|
||
});
|
||
}
|
||
this.stepList = stepList;
|
||
this.stepCurrent = stepCurrent;
|
||
this.openPop = true;
|
||
});
|
||
},
|
||
// 数据排序
|
||
compareDataNew(file1) {
|
||
return function(b, a) {
|
||
if (b[file1] < a[file1]) {
|
||
return -1;
|
||
} else if (b[file1] > a[file1]) {
|
||
return 1;
|
||
}
|
||
}
|
||
},
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style lang="scss">
|
||
.index-container {
|
||
.list {
|
||
margin: 0px 10px;
|
||
}
|
||
|
||
.list-size {
|
||
display: flex;
|
||
padding: 5px 5px;
|
||
background: white;
|
||
justify-content: center;
|
||
}
|
||
|
||
.search {
|
||
background-color: white;
|
||
padding: 10px;
|
||
}
|
||
|
||
.item-container {
|
||
margin: 10px 10px;
|
||
background-color: white;
|
||
padding-bottom: 10px;
|
||
border-radius: 10px;
|
||
box-shadow: 1px 1px 2px 2px rgba(0, 0, 0, 0.05);
|
||
}
|
||
|
||
.flex-text {
|
||
display: flex;
|
||
align-items: center;
|
||
|
||
.flex-text-one {
|
||
color: #939393;
|
||
font-weight: bold;
|
||
}
|
||
}
|
||
|
||
.data {
|
||
margin: 10px 20px;
|
||
}
|
||
}
|
||
</style> |