|
@@ -1,17 +1,51 @@
|
|
|
<template>
|
|
|
<div class="page-box">
|
|
|
<moduleView :propConfig="config" ref="view" v-loading="load" @pagination="pagination" @onRefresh="getList" @resert="queryList" @search="queryList" @clickHandle="clickHandle" @modalHandle="modalHandle" @detail="detail" />
|
|
|
+ <el-drawer
|
|
|
+ size="50%"
|
|
|
+ v-model="drawer"
|
|
|
+ close-on-click-modal
|
|
|
+ title="操作日志"
|
|
|
+ direction="rtl"
|
|
|
+ >
|
|
|
+ <el-table ref="operlogRef" :data="logData">
|
|
|
+ <el-table-column label="日志编号" align="center" prop="operId" width="130" />
|
|
|
+ <el-table-column label="操作类型" align="center" prop="businessType">
|
|
|
+ <template #default="scope">
|
|
|
+ <dict-tag :options="sys_oper_type" :value="scope.row.businessType" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作人员" align="center" width="110" prop="operName" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']" />
|
|
|
+ <el-table-column label="主机" align="center" prop="operIp" width="130" :show-overflow-tooltip="true" />
|
|
|
+ <el-table-column label="操作状态" align="center" prop="status">
|
|
|
+ <template #default="scope">
|
|
|
+ <dict-tag :options="sys_common_status" :value="scope.row.status" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作日期" align="center" prop="operTime" width="180" sortable="custom" :sort-orders="['descending', 'ascending']">
|
|
|
+ <template #default="scope">
|
|
|
+ <span>{{ parseTime(scope.row.operTime) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="page-log">
|
|
|
+ <el-pagination layout="prev, pager, next" :total="logPage.total" @current-change="handleCurrentChange"
|
|
|
+ :current-page="logPage.pageNo" />
|
|
|
+ </div>
|
|
|
+ </el-drawer>
|
|
|
</div>
|
|
|
-</template>
|
|
|
+</template>
|
|
|
|
|
|
<script setup>
|
|
|
import { computed,getCurrentInstance,ref, shallowRef } from "vue";
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
import {appList,addApp,updateApp,deleApp,disableApp,enableApp} from '@/api/base/shopManage'
|
|
|
+ const { sys_oper_type, sys_common_status } = proxy.useDict("sys_oper_type","sys_common_status");
|
|
|
+ import { list} from "@/api/monitor/operlog";
|
|
|
import txt from "./txt.vue";
|
|
|
// import merchant from "./merchant.vue";
|
|
|
import stateRadio from "@/components/stateRadio/stateRadio.vue";
|
|
|
-
|
|
|
+ const drawer = ref(false)
|
|
|
const config = ref({
|
|
|
attr:{
|
|
|
calculateH:true
|
|
@@ -42,7 +76,16 @@
|
|
|
add:true,
|
|
|
search:true,
|
|
|
refresh:true
|
|
|
- }
|
|
|
+ },
|
|
|
+ customTools:[{
|
|
|
+ name: '操作日志',
|
|
|
+ icon: 'Notebook',
|
|
|
+ event:{
|
|
|
+ click:() =>{
|
|
|
+ drawer.value = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }]
|
|
|
},
|
|
|
table:{
|
|
|
attr:{
|
|
@@ -227,10 +270,33 @@
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
+ const logData = ref([])
|
|
|
+ const logPage = ref({
|
|
|
+ pageNo: 1, //当前页
|
|
|
+ pageSize: 20, //每页条数
|
|
|
+ total: 0 //总条数
|
|
|
+ })
|
|
|
+
|
|
|
const load = ref(false)
|
|
|
const isSearch = ref(false)
|
|
|
const timeNum = ref(0);
|
|
|
+ const initLog= () => {
|
|
|
+ list({
|
|
|
+ pageNum:logPage.value.pageNo,
|
|
|
+ pageSize:logPage.value.pageSize,
|
|
|
+ title:'小程序'
|
|
|
+ }).then(res => {
|
|
|
+ logData.value = res.rows;
|
|
|
+ logPage.value.total = res.total;
|
|
|
+
|
|
|
+ }).catch(()=> {
|
|
|
|
|
|
+ })
|
|
|
+ }
|
|
|
+ const handleCurrentChange = v => {
|
|
|
+ logPage.value.pageNo = v;
|
|
|
+ initLog()
|
|
|
+ }
|
|
|
// 禁用
|
|
|
const disableHandle = item => {
|
|
|
disableApp(item.appkey).then(() => {
|
|
@@ -239,6 +305,7 @@
|
|
|
type: 'success'
|
|
|
})
|
|
|
getList()
|
|
|
+ initLog()
|
|
|
}).catch(() => {})
|
|
|
}
|
|
|
//启用
|
|
@@ -249,6 +316,7 @@
|
|
|
type: 'success'
|
|
|
})
|
|
|
getList()
|
|
|
+ initLog()
|
|
|
}).catch(() => {})
|
|
|
}
|
|
|
|
|
@@ -396,4 +464,14 @@
|
|
|
defineExpose({
|
|
|
calculateTable
|
|
|
})
|
|
|
+
|
|
|
+ initLog()
|
|
|
</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.page-log{
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
+}
|
|
|
+</style>
|