Merge branch 'main' of http://129.211.33.98:3210/hjq/mart-admin
This commit is contained in:
commit
ad4346372f
24
src/api/log/index.ts
Normal file
24
src/api/log/index.ts
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import request from '/@/utils/request';
|
||||||
|
import { baseUrlHost } from '../baseUrlHost';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (不建议写成 request.post(xxx),因为这样 post 时,无法 params 与 data 同时传参)
|
||||||
|
* 注意在写get请求时,参数是params,而不是data,要标注好
|
||||||
|
*
|
||||||
|
* 登录api接口集合
|
||||||
|
* @method getlogList 获取日志列表
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function logApi() {
|
||||||
|
return {
|
||||||
|
getlogList: (params: object) => {
|
||||||
|
// console.log(1111111111111111);
|
||||||
|
|
||||||
|
return request({
|
||||||
|
url: baseUrlHost + '/acLog',
|
||||||
|
method: 'get',
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
@ -13,6 +13,7 @@ export default {
|
|||||||
articleDetail: 'articleDetail',
|
articleDetail: 'articleDetail',
|
||||||
addArticle: 'addArticle',
|
addArticle: 'addArticle',
|
||||||
editArticle: 'editArticle',
|
editArticle: 'editArticle',
|
||||||
|
log:'log',
|
||||||
limits: 'limits',
|
limits: 'limits',
|
||||||
limitsFrontEnd: 'FrontEnd',
|
limitsFrontEnd: 'FrontEnd',
|
||||||
limitsFrontEndPage: 'FrontEndPage',
|
limitsFrontEndPage: 'FrontEndPage',
|
||||||
|
@ -13,6 +13,7 @@ export default {
|
|||||||
articleDetail: '文章详情',
|
articleDetail: '文章详情',
|
||||||
addArticle: '新增文章',
|
addArticle: '新增文章',
|
||||||
editArticle: '编辑文章',
|
editArticle: '编辑文章',
|
||||||
|
log:'系统日志',
|
||||||
limits: '权限管理',
|
limits: '权限管理',
|
||||||
limitsFrontEnd: '前端控制',
|
limitsFrontEnd: '前端控制',
|
||||||
limitsFrontEndPage: '页面权限',
|
limitsFrontEndPage: '页面权限',
|
||||||
|
@ -13,6 +13,7 @@ export default {
|
|||||||
articleDetail: '文章詳情',
|
articleDetail: '文章詳情',
|
||||||
addArticle: '文章新增',
|
addArticle: '文章新增',
|
||||||
editArticle: '文章編輯',
|
editArticle: '文章編輯',
|
||||||
|
log:'系統日誌',
|
||||||
limits: '許可權管理',
|
limits: '許可權管理',
|
||||||
limitsFrontEnd: '前端控制',
|
limitsFrontEnd: '前端控制',
|
||||||
limitsFrontEndPage: '頁面許可權',
|
limitsFrontEndPage: '頁面許可權',
|
||||||
|
@ -232,6 +232,21 @@ export const dynamicRoutes: Array<RouteRecordRaw> = [
|
|||||||
icon: 'iconfont icon-fuwenbenkuang',
|
icon: 'iconfont icon-fuwenbenkuang',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/log',
|
||||||
|
name: 'log',
|
||||||
|
component: () => import('/@/views/log/index.vue'),
|
||||||
|
meta: {
|
||||||
|
title: 'message.router.log',
|
||||||
|
isLink: '',
|
||||||
|
isHide: false,
|
||||||
|
isKeepAlive: true,
|
||||||
|
isAffix: false,
|
||||||
|
isIframe: false,
|
||||||
|
roles: ['admin', 'common'],
|
||||||
|
icon: 'fa fa-wpforms',
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/limits',
|
path: '/limits',
|
||||||
name: 'limits',
|
name: 'limits',
|
||||||
|
189
src/views/log/index.vue
Normal file
189
src/views/log/index.vue
Normal file
@ -0,0 +1,189 @@
|
|||||||
|
<template>
|
||||||
|
<div class="system-dept-container layout-padding">
|
||||||
|
<el-card shadow="hover" class="layout-padding-auto">
|
||||||
|
<el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%" :header-cell-style="{ backgroundColor: '#fafafa', height: '40px' }">
|
||||||
|
<el-table-column prop="username" label="账号" width="100"/>
|
||||||
|
<el-table-column prop="usergroupName" label="操作人角色" show-overflow-tooltip></el-table-column>
|
||||||
|
<el-table-column prop="action" label="操作对应方法" show-overflow-tooltip></el-table-column>
|
||||||
|
<el-table-column prop="description" label="操作描述" show-overflow-tooltip></el-table-column>
|
||||||
|
<el-table-column prop="acresult" label="操作结果" :formatter="typeFormatter" show-overflow-tooltip></el-table-column>
|
||||||
|
<el-table-column prop="createtime" label="创建时间" :formatter="dateFormatter" show-overflow-tooltip></el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-pagination
|
||||||
|
@size-change="onHandleSizeChange"
|
||||||
|
@current-change="onHandleCurrentChange"
|
||||||
|
class="mt15"
|
||||||
|
:pager-count="5"
|
||||||
|
:page-sizes="[10, 20, 30]"
|
||||||
|
v-model:current-page="state.tableData.param.current"
|
||||||
|
background
|
||||||
|
v-model:page-size="state.tableData.param.size"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="state.tableData.total"
|
||||||
|
>
|
||||||
|
</el-pagination>
|
||||||
|
</el-card>
|
||||||
|
<!-- <DeptDialog ref="deptDialogRef" @refresh="getTableData()" /> -->
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts" name="logIndex">
|
||||||
|
import { onMounted, reactive, ref } from 'vue';
|
||||||
|
import { logApi } from '/@/api/log';
|
||||||
|
import { ElMessage, ElMessageBox, TableColumnCtx } from 'element-plus';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
// 表格数据
|
||||||
|
const state = reactive({
|
||||||
|
tableData: {
|
||||||
|
data: [],
|
||||||
|
total: 0,
|
||||||
|
loading: false,
|
||||||
|
param: {
|
||||||
|
current: 1,
|
||||||
|
size: 10,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// // 模块列表
|
||||||
|
// const moduleList = ref([]);
|
||||||
|
|
||||||
|
// // 标签列表
|
||||||
|
// const labelList = ref([]);
|
||||||
|
|
||||||
|
// 引入 api 请求接口
|
||||||
|
const syslogApi = logApi();
|
||||||
|
|
||||||
|
// 获取表格数据
|
||||||
|
const getTableData = async() => {
|
||||||
|
try {
|
||||||
|
state.tableData.loading = true;
|
||||||
|
console.log(111111111111111);
|
||||||
|
let res = await syslogApi.getlogList(state.tableData.param);
|
||||||
|
if(res?.success){
|
||||||
|
state.tableData.data = res.data.records;
|
||||||
|
state.tableData.total = res.data.total;
|
||||||
|
}else{
|
||||||
|
ElMessage.error('文章列表获取失败!');
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
} finally {
|
||||||
|
state.tableData.loading = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// // 模块选择
|
||||||
|
// const handleChangeModule = async(val: any) => {
|
||||||
|
// try {
|
||||||
|
// state.tableData.param.labelName = '';
|
||||||
|
// if(!val){labelList.value=[]; return;}
|
||||||
|
// const op:any = event?.currentTarget;
|
||||||
|
// let res = await artApi.getLabelList(op.dataset.op);
|
||||||
|
// if(res?.success){
|
||||||
|
// labelList.value = res.data;
|
||||||
|
// }else{
|
||||||
|
// ElMessage.error('标签列表获取失败!');
|
||||||
|
// }
|
||||||
|
// } catch (error) {
|
||||||
|
// ElMessage.error('标签列表获取失败!');
|
||||||
|
// } finally {
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // 重置
|
||||||
|
// const reset = () =>{
|
||||||
|
// state.tableData.param = {
|
||||||
|
// labelName: '',
|
||||||
|
// moduleName: '',
|
||||||
|
// title: '',
|
||||||
|
// current: 1,
|
||||||
|
// size: 10,
|
||||||
|
// }
|
||||||
|
// getTableData();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // 添加文章
|
||||||
|
// const toAddArticle = () => {
|
||||||
|
// router.push({ path: '/article/add' });
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // 添加文章
|
||||||
|
// const toEditArticle = (row: any) => {
|
||||||
|
// router.push({ path: '/article/edit', query: { id:row.id, moduleName: row.moduleName, labelName: row.labelName } });
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // 文章详情
|
||||||
|
// const toShowDetail = (row: any) => {
|
||||||
|
// router.push({ path: '/article/detail' , query: { id:row.id, moduleName: row.moduleName, labelName: row.labelName } });
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // 文章删除
|
||||||
|
// const deleteArticle = (id: number) => {
|
||||||
|
// ElMessageBox.confirm('确定要删除该文章吗?', '提示', {
|
||||||
|
// confirmButtonText: '确定',
|
||||||
|
// cancelButtonText: '取消',
|
||||||
|
// type: 'warning',
|
||||||
|
// })
|
||||||
|
// .then(async() => {
|
||||||
|
// try {
|
||||||
|
// state.tableData.loading = true;
|
||||||
|
// let res = await artApi.deleteArticle(id);
|
||||||
|
// if(res?.success){
|
||||||
|
// await getTableData();
|
||||||
|
// ElMessage.success('文章删除成功!');
|
||||||
|
// } else ElMessage.error('文章删除失败!');
|
||||||
|
// } catch(e) {
|
||||||
|
// ElMessage.error('处理失败!');
|
||||||
|
// } finally {
|
||||||
|
// state.tableData.loading = false;
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 日期格式化
|
||||||
|
const dateFormatter = (row: any, column: TableColumnCtx<String>) => {
|
||||||
|
let date = new Date(row.createtime);
|
||||||
|
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
// // 文章类型格式化
|
||||||
|
// const typeFormatter = (row: any, column: TableColumnCtx<String>) => {
|
||||||
|
// return row.articletype === 1 ? '外链' : '图文';
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 分页改变
|
||||||
|
const onHandleSizeChange = (val: number) => {
|
||||||
|
state.tableData.param.size = val;
|
||||||
|
getTableData();
|
||||||
|
};
|
||||||
|
|
||||||
|
// 分页改变
|
||||||
|
const onHandleCurrentChange = (val: number) => {
|
||||||
|
state.tableData.param.current = val;
|
||||||
|
getTableData();
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getTableData();
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.system-dept-container {
|
||||||
|
:deep(.el-card__body) {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
flex: 1;
|
||||||
|
overflow: auto;
|
||||||
|
.el-table {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in New Issue
Block a user