Commit f79e9253 by 周海峰

日志

parent 3dc0b19a
# 页面标题 # 页面标题
VITE_APP_TITLE = 若依管理系统 VITE_APP_TITLE = 数据加密系统
# 开发环境配置 # 开发环境配置
VITE_APP_ENV = 'development' VITE_APP_ENV = 'development'
# 若依管理系统/开发环境 # 数据加密系统/开发环境
VITE_APP_BASE_API = '/dev-api' VITE_APP_BASE_API = '/dev-api'
VITE_APP_BASE_URL = '/' VITE_APP_BASE_URL = '/'
\ No newline at end of file
# 页面标题 # 页面标题
VITE_APP_TITLE = 若依管理系统 VITE_APP_TITLE = 数据加密系统
# 生产环境配置 # 生产环境配置
VITE_APP_ENV = 'production' VITE_APP_ENV = 'production'
# 若依管理系统/生产环境 # 数据加密系统/生产环境
VITE_APP_BASE_API = '/prod-api' VITE_APP_BASE_API = '/prod-api'
# 是否在打包时开启压缩,支持 gzip 和 brotli # 是否在打包时开启压缩,支持 gzip 和 brotli
......
# 页面标题 # 页面标题
VITE_APP_TITLE = 若依管理系统 VITE_APP_TITLE = 数据加密系统
# 生产环境配置 # 生产环境配置
VITE_APP_ENV = 'staging' VITE_APP_ENV = 'staging'
# 若依管理系统/生产环境 # 数据加密系统/生产环境
VITE_APP_BASE_API = '/stage-api' VITE_APP_BASE_API = '/stage-api'
# 是否在打包时开启压缩,支持 gzip 和 brotli # 是否在打包时开启压缩,支持 gzip 和 brotli
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<meta name="renderer" content="webkit"> <meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="/favicon.ico"> <link rel="icon" href="/favicon.ico">
<title>若依管理系统</title> <title>数据加密系统</title>
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]--> <!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
<style> <style>
html, html,
......
{ {
"name": "ruoyi", "name": "ruoyi",
"version": "3.9.0", "version": "3.9.0",
"description": "若依管理系统", "description": "数据加密系统",
"author": "若依", "author": "若依",
"license": "MIT", "license": "MIT",
"type": "module", "type": "module",
......
No preview for this file type
import request from '@/utils/request'
export function query(data) {
return request({
url: '/aop/query',
method: 'post',
data: data
})
}
export function checkEnc(data) {
return request({
url: '/aop/checkEnc',
method: 'post',
data: data
})
}
export function queryMenuTreeAndUserlist(data) {
return request({
url: '/aop/queryMenuTreeAndUserlist',
method: 'post',
data: data
})
}
export function getOpeExcel(data) {
return request({
url: '/aop/getOpeExcel',
method: 'post',
data: data
})
}
\ No newline at end of file
...@@ -82,41 +82,31 @@ ...@@ -82,41 +82,31 @@
</div> </div>
</template> </template>
<script> <script setup>
import { ref, reactive, computed, onMounted } from 'vue'
import { Coin } from '@element-plus/icons-vue' import { Coin } from '@element-plus/icons-vue'
export default { const loading = ref(true)
name: 'DesensitizationLog', const total = ref(0)
components: { const logList = ref([])
Coin const queryParams = reactive({
},
data() {
return {
// 遮罩层
loading: true,
// 总条数
total: 0,
// 日志列表
logList: [],
// 查询参数
queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
user: undefined, user: undefined,
range: '0', // 默认选择近三天 range: '0',
startTime: '', startTime: '',
endTime: '', endTime: '',
module: undefined, module: undefined,
projectId: undefined projectId: undefined
}, })
// 用户选项
userOptions: [ const userOptions = ref([
{ id: 'admin', realname: 'admin' }, { id: 'admin', realname: 'admin' },
{ id: 'system', realname: 'system' }, { id: 'system', realname: 'system' },
{ id: 'test', realname: 'test' } { id: 'test', realname: 'test' }
], ])
// 时间范围选项
timeRangeOptions: [ const timeRangeOptions = ref([
{ value: '0', label: '今天' }, { value: '0', label: '今天' },
{ value: '3', label: '近三天' }, { value: '3', label: '近三天' },
{ value: '7', label: '近一周' }, { value: '7', label: '近一周' },
...@@ -124,32 +114,24 @@ export default { ...@@ -124,32 +114,24 @@ export default {
{ value: '90', label: '近三个月' }, { value: '90', label: '近三个月' },
{ value: '180', label: '近半年' }, { value: '180', label: '近半年' },
{ value: '全部', label: '全部' } { value: '全部', label: '全部' }
], ])
// 项目级选项
projectLevelOptions: [ const projectLevelOptions = ref([
{ id: '1', project: '一级' }, { id: '1', project: '一级' },
{ id: '2', project: '二级' }, { id: '2', project: '二级' },
{ id: '3', project: '三级' } { id: '3', project: '三级' }
] ])
}
},
created() {
this.getList()
},
methods: {
/** 查询日志列表 */
getList() {
this.loading = true
// 这里替换为实际的API调用
// listOperlog(this.queryParams).then(response => {
// this.logList = response.rows
// this.total = response.total
// this.loading = false
// })
// 模拟数据 const pageCount = computed(() => {
const t = Number(total.value) || 0
const ps = Number(queryParams.pageSize) || 1
return Math.ceil(t / ps)
})
const getList = () => {
loading.value = true
setTimeout(() => { setTimeout(() => {
this.logList = [ logList.value = [
{ {
user: 'admin', user: 'admin',
time: '2025-08-19 19:36:25', time: '2025-08-19 19:36:25',
...@@ -165,35 +147,28 @@ export default { ...@@ -165,35 +147,28 @@ export default {
operation: '用户[admin]登录到系统平台。' operation: '用户[admin]登录到系统平台。'
} }
] ]
this.total = 53 total.value = 53
this.loading = false loading.value = false
}, 200) }, 200)
}, }
/** 搜索按钮操作 */
handleQuery() { const handleQuery = () => {
this.queryParams.pageNum = 1 queryParams.pageNum = 1
this.getList() getList()
}, }
/** 导出按钮操作 */
handleExport() { const handleExport = () => {
this.$modal.confirm('是否确认导出所有操作日志数据?').then(() => { window.$modal.confirm('是否确认导出所有操作日志数据?').then(() => {
this.downloading = true
// 实际导出逻辑 // 实际导出逻辑
// return exportOperlog(this.queryParams) window.$modal.msgSuccess('导出成功')
}).then(() => {
this.$modal.msgSuccess('导出成功')
this.downloading = false
}).catch(() => {}) }).catch(() => {})
}, }
/** 数据完整性校验操作 */ const handleCheck = () => {
handleCheck() { window.$modal.msgSuccess('数据完整性校验完成')
// 实际数据完整性校验逻辑 }
this.$modal.msgSuccess('数据完整性校验完成')
},
// 处理时间范围变化 const handleTimeRangeChange = (value) => {
handleTimeRangeChange(value) {
const now = new Date() const now = new Date()
let startTime = new Date() let startTime = new Date()
...@@ -219,17 +194,19 @@ export default { ...@@ -219,17 +194,19 @@ export default {
} }
if (startTime) { if (startTime) {
this.queryParams.startTime = startTime.toISOString().split('T')[0] + ' 00:00:00' queryParams.startTime = startTime.toISOString().split('T')[0] + ' 00:00:00'
this.queryParams.endTime = now.toISOString().split('T')[0] + ' 23:59:59' queryParams.endTime = now.toISOString().split('T')[0] + ' 23:59:59'
} else { } else {
this.queryParams.startTime = '' queryParams.startTime = ''
this.queryParams.endTime = '' queryParams.endTime = ''
} }
this.handleQuery() handleQuery()
}
}
} }
onMounted(() => {
getList()
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -82,41 +82,31 @@ ...@@ -82,41 +82,31 @@
</div> </div>
</template> </template>
<script> <script setup>
import { ref, reactive, computed, onMounted } from 'vue'
import { Lock } from '@element-plus/icons-vue' import { Lock } from '@element-plus/icons-vue'
export default { const loading = ref(true)
name: 'EncryptedLog', const total = ref(0)
components: { const logList = ref([])
Lock const queryParams = reactive({
},
data() {
return {
// 遮罩层
loading: true,
// 总条数
total: 0,
// 日志列表
logList: [],
// 查询参数
queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
user: undefined, user: undefined,
range: '0', // 默认选择近三天 range: '0',
startTime: '', startTime: '',
endTime: '', endTime: '',
module: undefined, module: undefined,
projectId: undefined projectId: undefined
}, })
// 用户选项
userOptions: [ const userOptions = ref([
{ id: 'admin', realname: 'admin' }, { id: 'admin', realname: 'admin' },
{ id: 'system', realname: 'system' }, { id: 'system', realname: 'system' },
{ id: 'test', realname: 'test' } { id: 'test', realname: 'test' }
], ])
// 时间范围选项
timeRangeOptions: [ const timeRangeOptions = ref([
{ value: '0', label: '今天' }, { value: '0', label: '今天' },
{ value: '3', label: '近三天' }, { value: '3', label: '近三天' },
{ value: '7', label: '近一周' }, { value: '7', label: '近一周' },
...@@ -124,32 +114,24 @@ export default { ...@@ -124,32 +114,24 @@ export default {
{ value: '90', label: '近三个月' }, { value: '90', label: '近三个月' },
{ value: '180', label: '近半年' }, { value: '180', label: '近半年' },
{ value: '全部', label: '全部' } { value: '全部', label: '全部' }
], ])
// 项目级选项
projectLevelOptions: [ const projectLevelOptions = ref([
{ id: '1', project: '一级' }, { id: '1', project: '一级' },
{ id: '2', project: '二级' }, { id: '2', project: '二级' },
{ id: '3', project: '三级' } { id: '3', project: '三级' }
] ])
}
},
created() {
this.getList()
},
methods: {
/** 查询日志列表 */
getList() {
this.loading = true
// 这里替换为实际的API调用
// listOperlog(this.queryParams).then(response => {
// this.logList = response.rows
// this.total = response.total
// this.loading = false
// })
// 模拟数据 const pageCount = computed(() => {
const t = Number(total.value) || 0
const ps = Number(queryParams.pageSize) || 1
return Math.ceil(t / ps)
})
const getList = () => {
loading.value = true
setTimeout(() => { setTimeout(() => {
this.logList = [ logList.value = [
{ {
user: 'admin', user: 'admin',
time: '2025-08-19 19:36:25', time: '2025-08-19 19:36:25',
...@@ -165,35 +147,28 @@ export default { ...@@ -165,35 +147,28 @@ export default {
operation: '用户[admin]登录到系统平台。' operation: '用户[admin]登录到系统平台。'
} }
] ]
this.total = 53 total.value = 53
this.loading = false loading.value = false
}, 200) }, 200)
}, }
/** 搜索按钮操作 */
handleQuery() { const handleQuery = () => {
this.queryParams.pageNum = 1 queryParams.pageNum = 1
this.getList() getList()
}, }
/** 导出按钮操作 */
handleExport() { const handleExport = () => {
this.$modal.confirm('是否确认导出所有操作日志数据?').then(() => { window.$modal.confirm('是否确认导出所有操作日志数据?').then(() => {
this.downloading = true
// 实际导出逻辑 // 实际导出逻辑
// return exportOperlog(this.queryParams) window.$modal.msgSuccess('导出成功')
}).then(() => {
this.$modal.msgSuccess('导出成功')
this.downloading = false
}).catch(() => {}) }).catch(() => {})
}, }
/** 数据完整性校验操作 */ const handleCheck = () => {
handleCheck() { window.$modal.msgSuccess('数据完整性校验完成')
// 实际数据完整性校验逻辑 }
this.$modal.msgSuccess('数据完整性校验完成')
},
// 处理时间范围变化 const handleTimeRangeChange = (value) => {
handleTimeRangeChange(value) {
const now = new Date() const now = new Date()
let startTime = new Date() let startTime = new Date()
...@@ -219,17 +194,19 @@ export default { ...@@ -219,17 +194,19 @@ export default {
} }
if (startTime) { if (startTime) {
this.queryParams.startTime = startTime.toISOString().split('T')[0] + ' 00:00:00' queryParams.startTime = startTime.toISOString().split('T')[0] + ' 00:00:00'
this.queryParams.endTime = now.toISOString().split('T')[0] + ' 23:59:59' queryParams.endTime = now.toISOString().split('T')[0] + ' 23:59:59'
} else { } else {
this.queryParams.startTime = '' queryParams.startTime = ''
this.queryParams.endTime = '' queryParams.endTime = ''
} }
this.handleQuery() handleQuery()
}
}
} }
onMounted(() => {
getList()
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
v-model="queryParams.range" v-model="queryParams.range"
placeholder="请选择时间" placeholder="请选择时间"
style="width: 200px" style="width: 200px"
@change="handleTimeRangeChange"
> >
<el-option <el-option
v-for="item in timeRangeOptions" v-for="item in timeRangeOptions"
...@@ -66,57 +65,47 @@ ...@@ -66,57 +65,47 @@
border border
style="width: 100%" style="width: 100%"
> >
<el-table-column prop="user" label="用户" align="left" /> <el-table-column prop="user" label="用户" width="200" align="left" />
<el-table-column prop="time" label="时间" align="left" width="180" /> <el-table-column prop="operationtime" label="时间" align="left" width="180" />
<el-table-column prop="moduleId" label="模块编号" align="left" width="120" /> <el-table-column prop="operationObject" label="模块编号" align="left" width="120" />
<el-table-column prop="moduleName" label="操作模块" align="left" width="150" /> <el-table-column prop="module" label="操作模块" align="left" width="150" />
<el-table-column prop="operation" label="操作信息" align="left" show-overflow-tooltip /> <el-table-column prop="logmessage" label="操作信息" align="left" show-overflow-tooltip />
</el-table> </el-table>
<pagination <pagination
v-show="total > 0" v-show="total > 0"
:total="total" :total="total"
v-model:page="queryParams.pageNum" v-model:page="queryParams.page"
v-model:limit="queryParams.pageSize" v-model:limit="queryParams.rows"
@pagination="getList" @pagination="getList"
/> />
</div> </div>
</template> </template>
<script> <script setup>
import { ref, reactive, computed, onMounted } from 'vue'
import { Document } from '@element-plus/icons-vue' import { Document } from '@element-plus/icons-vue'
import { query, checkEnc, queryMenuTreeAndUserlist, getOpeExcel} from '@/api/logSet/operationLog.js'
export default { import { ElMessageBox, ElMessage } from 'element-plus'
name: 'OperationLog',
components: { const loading = ref(true)
Document const total = ref(0)
}, const logList = ref([])
data() { const queryParams = reactive({
return { page: 1,
// 遮罩层 rows: 10,
loading: true,
// 总条数
total: 0,
// 日志列表
logList: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
user: undefined, user: undefined,
range: '0', // 默认选择近三天 range: '0',
startTime: '',
endTime: '',
module: undefined module: undefined
}, })
// 用户选项
userOptions: [ const userOptions = ref([
{ id: 'admin', realname: 'admin' }, // { id: 'admin', realname: 'admin' },
{ id: 'system', realname: 'system' }, // { id: 'system', realname: 'system' },
{ id: 'test', realname: 'test' } // { id: 'test', realname: 'test' }
], ])
// 时间范围选项
timeRangeOptions: [ const timeRangeOptions = ref([
{ value: '0', label: '今天' }, { value: '0', label: '今天' },
{ value: '3', label: '近三天' }, { value: '3', label: '近三天' },
{ value: '7', label: '近一周' }, { value: '7', label: '近一周' },
...@@ -124,136 +113,92 @@ export default { ...@@ -124,136 +113,92 @@ export default {
{ value: '90', label: '近三个月' }, { value: '90', label: '近三个月' },
{ value: '180', label: '近半年' }, { value: '180', label: '近半年' },
{ value: '全部', label: '全部' } { value: '全部', label: '全部' }
], ])
// 模块树选项
moduleTreeOptions: [ const moduleTreeOptions = ref([])
{
value: 'project', const getList = async () => {
label: '项目管理' loading.value = true
}, try {
{ const response = await query(queryParams)
value: 'asset', logList.value = response.data.list || []
label: '资产库' total.value = response.data.total || 0
}, } catch (error) {
{ console.error('Failed to fetch log list:', error)
value: 'system', } finally {
label: '系统设置', loading.value = false
children: [
{ value: 'system_param', label: '系统参数' },
{ value: 'system_backup', label: '系统备份' },
{ value: 'license', label: 'License管理' },
{ value: 'ip_setting', label: 'IP设置' },
{ value: 'control', label: '系统控制台' }
]
},
{
value: 'user',
label: '用户管理'
},
{
value: 'rule',
label: '规则管理'
}
]
} }
}, }
created() {
this.getList()
},
methods: {
/** 查询日志列表 */
getList() {
this.loading = true
// 这里替换为实际的API调用
// listOperlog(this.queryParams).then(response => {
// this.logList = response.rows
// this.total = response.total
// this.loading = false
// })
// 模拟数据
setTimeout(() => {
this.logList = [
{
user: 'admin',
time: '2025-08-19 19:36:25',
moduleId: 'DDM_00000',
moduleName: '系统模块',
operation: '用户登录'
},
{
user: 'admin',
time: '2025-08-19 19:01:36',
moduleId: 'DDM_00001',
moduleName: '用户管理-用户',
operation: '用户[admin]登录到系统平台。'
}
]
this.total = 53
this.loading = false
}, 200)
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 导出按钮操作 */
handleExport() {
this.$modal.confirm('是否确认导出所有操作日志数据?').then(() => {
this.downloading = true
// 实际导出逻辑
// return exportOperlog(this.queryParams)
}).then(() => {
this.$modal.msgSuccess('导出成功')
this.downloading = false
}).catch(() => {})
},
/** 数据完整性校验操作 */
handleCheck() {
// 实际数据完整性校验逻辑
this.$modal.msgSuccess('数据完整性校验完成')
},
// 处理时间范围变化 const handleQuery = () => {
handleTimeRangeChange(value) { queryParams.pageNum = 1
const now = new Date() getList()
let startTime = new Date() }
switch (value) { const handleExport = async () => {
case 'last3days': ElMessageBox.confirm('是否确认导出所有操作日志数据?', '提示', {
startTime.setDate(now.getDate() - 3) confirmButtonText: '确定',
break cancelButtonText: '取消',
case 'lastWeek': type: 'warning'
startTime.setDate(now.getDate() - 7) })
break .then(async () => {
case 'lastMonth': try {
startTime.setMonth(now.getMonth() - 1) const response = await getOpeExcel(queryParams)
break //const blob = new Blob([response], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })
case 'last3Months': const blob = new Blob([response], { type: 'application/vnd.ms-excel'})
startTime.setMonth(now.getMonth() - 3) const link = document.createElement('a')
break link.href = URL.createObjectURL(blob)
case 'lastHalfYear': link.download = '操作日志.xlsx'
startTime.setMonth(now.getMonth() - 6) link.click()
break URL.revokeObjectURL(link.href)
case 'all': ElMessage.success('导出成功')
startTime = null } catch (error) {
break console.error('Failed to export operation logs:', error)
ElMessage.error('导出出错')
} }
})
.catch(() => {
ElMessage.info('导出已取消')
})
}
if (startTime) { const handleCheck = async () => {
this.queryParams.startTime = startTime.toISOString().split('T')[0] + ' 00:00:00' try {
this.queryParams.endTime = now.toISOString().split('T')[0] + ' 23:59:59' const response = await checkEnc(queryParams)
if (response.success) {
window.$modal.msgSuccess('数据完整性校验完成')
} else { } else {
this.queryParams.startTime = '' window.$modal.msgError('数据完整性校验失败')
this.queryParams.endTime = ''
}
this.handleQuery()
} }
} catch (error) {
console.error('Failed to perform data integrity check:', error)
window.$modal.msgError('数据完整性校验出错')
} }
} }
onMounted(async () => {
try {
const response = await queryMenuTreeAndUserlist({type: "global"})
console.log('queryMenuTreeAndUserlist',response);
userOptions.value = response.data.userlist.map(user => ({
id: user.id,
realname: user.realname
}))
moduleTreeOptions.value = response.data.menulist.map(menu => ({
value: menu.id,
label: menu.text,
children: menu.children ? menu.children.map(child => ({
value: child.id,
label: child.text
})) : null
}))
} catch (error) {
console.error('Failed to fetch user and module data:', error)
}
getList()
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -311,14 +311,9 @@ onMounted(() => { ...@@ -311,14 +311,9 @@ onMounted(() => {
cursor: pointer; cursor: pointer;
.el-icon { .el-icon {
font-size: 24px;
margin-bottom: 8px; margin-bottom: 8px;
} }
span {
font-size: 14px;
}
&:hover { &:hover {
color: #409EFF; color: #409EFF;
transform: scale(1.1); transform: scale(1.1);
......
...@@ -340,13 +340,13 @@ onMounted(() => { ...@@ -340,13 +340,13 @@ onMounted(() => {
cursor: pointer; cursor: pointer;
.el-icon { .el-icon {
font-size: 24px; // font-size: 24px;
margin-bottom: 8px; margin-bottom: 8px;
} }
span { // span {
font-size: 14px; // font-size: 14px;
} // }
&:hover { &:hover {
color: #409EFF; color: #409EFF;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论