jsy-app/pages/work/operation-log/index.vue

209 lines
5.4 KiB
Vue
Raw Normal View History

2024-12-02 16:49:48 +08:00
<template>
2024-12-20 17:25:13 +08:00
<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>
2025-01-13 18:30:46 +08:00
<view class="search">
2025-02-14 10:34:15 +08:00
<uni-forms ref="form" :model="queryParams" labelWidth="0px">
<uni-forms-item label="" name="">
<custom-land-tree :defaultLand="land" @change="handleTreeChange"
style="width: 100%;float: left;margin-right: 2px;"></custom-land-tree>
</uni-forms-item>
</uni-forms>
<uni-search-bar v-model="queryParams.searchValue" placeholder="请输入出水口/设备编码" cancelButton="none"
2025-02-14 10:57:26 +08:00
@confirm="$refs.paging.reload()" @clear="$refs.paging.reload()" />
2024-12-20 17:25:13 +08:00
</view>
</template>
2025-01-13 18:30:46 +08:00
<view class="card" v-for="item in dataList">
<uni-collapse>
<uni-collapse-item title-border="none" :border="false" :show-arrow="false" :open="true">
<template v-slot:title>
<view class="cards-title">
<view>
<view class="text">
<view>出水口{{ item.woName}}</view>
</view>
</view>
<view class="title-r">
2025-02-14 10:34:15 +08:00
<uni-tag v-hasPermi="['system:land:edit']" class="bg-green" :circle="true"
text="发送成功" />
2025-01-13 18:30:46 +08:00
</view>
</view>
</template>
<view class="content">
<view class="cards-content">
<view class="txt-list" @click="openStepPop(item)">
2025-01-16 17:22:27 +08:00
<view class="list1">
<view><text>设备名称</text>{{ item.operSubject}}</view>
<view><text>执行内容</text>{{ item.operContent}}</view>
<view><text>操作人员</text>{{ item.operUser}}</view>
<view><text>操作时间</text>{{ item.occurTime}}></view>
2025-01-13 18:30:46 +08:00
</view>
<view class="right">
<view class="iconfont icon-you">
</view>
</view>
</view>
</view>
2024-12-20 17:25:13 +08:00
</view>
2025-01-13 18:30:46 +08:00
</uni-collapse-item>
</uni-collapse>
</view>
2024-12-20 17:25:13 +08:00
</z-paging>
2024-12-02 16:49:48 +08:00
2024-12-20 17:25:13 +08:00
<!-- 图层弹出 -->
2024-12-24 11:48:02 +08:00
<u-popup mode="center" :show="openPop" @close="openPop = false">
2025-01-06 17:44:48 +08:00
<view class="popup-content" style="width: 70vw;" :style="`height:${this.stepList.length * 45}px`">
2024-12-24 11:51:23 +08:00
<u-steps direction="column" :current="stepCurrent">
2024-12-24 11:48:02 +08:00
<u-steps-item v-for="item in this.stepList" :title="item.title" :desc="item.description"></u-steps-item>
2024-12-20 17:25:13 +08:00
</u-steps>
</view>
</u-popup>
</template>
2024-12-02 16:49:48 +08:00
<script>
2024-12-20 19:13:48 +08:00
import * as userlog from "@/api/iotlog/userlog.js"
2024-12-20 17:25:13 +08:00
export default {
data() {
return {
2025-02-14 10:34:15 +08:00
land: null,
2024-12-20 17:25:13 +08:00
dataList: [],
queryParams: {
pageNum: 1,
pageSize: 20,
logType: 1, //1:设备,2:系统
landId: -1, //地块id
operType: "control", //控制
operSource: 1, //用户
searchValue: "", //出水口设备code
},
2024-12-24 11:48:02 +08:00
openPop: false,
2024-12-24 11:51:23 +08:00
stepCurrent: 0,
2024-12-24 11:48:02 +08:00
stepList: [],
2024-12-20 17:25:13 +08:00
}
},
2024-12-20 18:30:41 +08:00
onLoad(par) {
if (par.queryParams) {
let queryParams = JSON.parse(par.queryParams);
this.queryParams = Object.assign(this.queryParams, queryParams)
} else {
2025-02-14 10:34:15 +08:00
this.setQueryParams(getApp().ijs.land);
2024-12-20 17:25:13 +08:00
}
},
onShow() {},
mounted() {},
methods: {
2025-02-14 10:34:15 +08:00
// 设置地块
setQueryParams(e) {
if (e) {
this.land = e;
this.queryParams.landId = this.land?.id;
} else {
this.land = null;
this.queryParams.landId = -1;
}
},
// 地块选择
handleTreeChange(e) {
this.setQueryParams(e);
2025-02-14 10:57:26 +08:00
this.$refs.paging.reload();
2025-02-14 10:34:15 +08:00
},
// 查询数据
2024-12-20 17:25:13 +08:00
queryList(pageNo, pageSize) {
this.queryParams.pageNum = pageNo;
2024-12-20 19:13:48 +08:00
userlog.getlist(this.queryParams).then(res => {
2024-12-20 17:25:13 +08:00
this.$refs.paging.completeByTotal(res.rows, res.total);
});
},
2025-02-14 10:34:15 +08:00
// 查看时序
2024-12-24 11:48:02 +08:00
async openStepPop(item) {
let stepList = userlog.getSeqlistTemp();
2024-12-24 11:51:23 +08:00
let stepCurrent = 0;
2024-12-24 11:48:02 +08:00
this.stepList = [];
userlog.getSeqlist({
2024-12-20 19:13:48 +08:00
traceId: item.traceId
2024-12-24 11:48:02 +08:00
}).then(response => {
if (response.rows.length) {
response.rows.forEach(item => {
2025-01-06 18:03:14 +08:00
if (item.eventType > stepCurrent) {
if (item.eventType == 9) {
stepList.splice(stepCurrent, 0, {
title: '中断',
description: item.occurTime,
status: 'success'
});
} else {
2025-01-06 17:44:48 +08:00
stepCurrent = item.eventType;
stepList[stepCurrent - 1].description = item.occurTime;
stepList[stepCurrent - 1].status = 'success';
2025-01-06 18:03:14 +08:00
if (item.eventType == 5 && stepList[3].status == "") {
stepList[3].description = item.occurTime;
stepList[3].status = 'success';
}
2025-01-06 17:44:48 +08:00
}
2024-12-24 11:51:23 +08:00
}
2024-12-24 11:48:02 +08:00
});
}
this.stepList = stepList;
2024-12-24 11:51:23 +08:00
this.stepCurrent = stepCurrent;
2024-12-24 11:48:02 +08:00
this.openPop = true;
2024-12-20 19:13:48 +08:00
});
2024-12-20 17:25:13 +08:00
},
// 数据排序
compareDataNew(file1) {
return function(b, a) {
if (b[file1] < a[file1]) {
return -1;
} else if (b[file1] > a[file1]) {
return 1;
}
}
},
}
}
2024-12-02 16:49:48 +08:00
</script>
2025-01-13 18:30:46 +08:00
<style lang="scss" scoped>
2025-02-14 10:34:15 +08:00
body {
background-color: #f3f3f3;
}
.search {
background: #fff;
::v-deep.uni-searchbar {
padding: 0px 10px 10px 10px;
}
2025-02-14 10:57:26 +08:00
// 表单
::v-deep.uni-forms-item__label {
display: none !important;
}
.u-checkbox {
margin: 0 !important;
height: 35px;
}
.uni-forms-item.is-direction-left {
margin: 0 !important;
}
2025-02-14 10:34:15 +08:00
}
.list1>view {
display: flex;
}
::v-deep .u-image__error {
border-radius: 50px !important;
}
::v-deep .u-text__value {
font-size: 13px !important;
}
.popup-content {
padding: 10px;
}
2024-12-02 16:49:48 +08:00
</style>