Commit f79e9253 by 周海峰

日志

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