diff --git a/novalon-manage-web/src/views/audit/OperationLog.vue b/novalon-manage-web/src/views/audit/OperationLog.vue index 9ea0c43..deebd43 100644 --- a/novalon-manage-web/src/views/audit/OperationLog.vue +++ b/novalon-manage-web/src/views/audit/OperationLog.vue @@ -45,7 +45,16 @@ prop="operation" label="操作模块" sortable="custom" - /> + > + + + + + + {{ row.operation }} + + + + > + + + + + {{ formatParams(row.params) }} + + {{ formatParams(row.params) }} + + + - + + import { ref, reactive, onMounted } from 'vue' -import { Search } from '@element-plus/icons-vue' +import { Search, User, Document, Setting, Lock, View, Edit, Delete, Plus, Download } from '@element-plus/icons-vue' import { operationLogApi, OperationLog } from '@/api/operationLog' const loading = ref(false) @@ -148,6 +173,30 @@ const handleSortChange = ({ prop, order }: any) => { fetchData() } +const formatParams = (params: string) => { + if (!params) return '' + try { + const parsed = JSON.parse(params) + return JSON.stringify(parsed, null, 2) + } catch { + return params + } +} + +const getOperationIcon = (operation: string) => { + if (!operation) return Document + const op = operation.toLowerCase() + if (op.includes('登录') || op.includes('login')) return User + if (op.includes('删除') || op.includes('delete')) return Delete + if (op.includes('编辑') || op.includes('修改') || op.includes('update') || op.includes('edit')) return Edit + if (op.includes('查看') || op.includes('查询') || op.includes('view') || op.includes('get')) return View + if (op.includes('新增') || op.includes('创建') || op.includes('add') || op.includes('create')) return Plus + if (op.includes('下载') || op.includes('download')) return Download + if (op.includes('设置') || op.includes('配置') || op.includes('setting') || op.includes('config')) return Setting + if (op.includes('密码') || op.includes('password')) return Lock + return Document +} + onMounted(() => fetchData()) @@ -165,5 +214,46 @@ onMounted(() => fetchData()) align-items: center; } } + + .operation-cell { + display: flex; + align-items: center; + gap: 8px; + + .operation-icon { + font-size: 16px; + color: #409eff; + } + } + + .params-content { + .params-preview { + max-width: 200px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + color: #606266; + font-size: 13px; + cursor: pointer; + transition: color 0.2s; + + &:hover { + color: #409eff; + } + } + + .params-detail { + max-height: 300px; + overflow-y: auto; + background: #f5f7fa; + padding: 12px; + border-radius: 4px; + font-size: 12px; + color: #303133; + margin: 0; + line-height: 1.5; + font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace; + } + } } diff --git a/novalon-manage-web/src/views/system/Dashboard.vue b/novalon-manage-web/src/views/system/Dashboard.vue index e78e229..40879b3 100644 --- a/novalon-manage-web/src/views/system/Dashboard.vue +++ b/novalon-manage-web/src/views/system/Dashboard.vue @@ -2,49 +2,49 @@ - + - + - + - + - + - + - + - + @@ -58,15 +58,35 @@ + + + 最近登录 + + + - {{ item.username }} - {{ item.ip }} - {{ item.loginTime }} + + + + {{ item.username }} + + + + {{ item.ip }} + + + + + 暂无登录记录 @@ -75,22 +95,41 @@ + + + 系统信息 + + + - {{ systemInfo.version }} + + + {{ systemInfo.version }} + - {{ systemInfo.javaVersion }} + + + {{ systemInfo.javaVersion }} + - {{ systemInfo.frontendFramework }} + + + {{ systemInfo.frontendFramework }} + - {{ systemInfo.database }} + + + {{ systemInfo.database }} + @@ -101,7 +140,7 @@
{{ formatParams(row.params) }}
{{ item.username }} - {{ item.ip }}
{{ item.loginTime }}