Commit f961222c by 周海峰

加密日志

parent 0b0f16b2
import request from '@/utils/request'
export function query(data) {
return request({
url: '/aop/encryptlog/query',
method: 'post',
data: data
})
}
export function allProject(data) {
return request({
url: '/core/tdataproject/allProject',
method: 'post',
data: data
})
}
\ No newline at end of file
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<el-option <el-option
v-for="item in userOptions" v-for="item in userOptions"
:key="item.id" :key="item.id"
:label="item.realname" :label="item.user"
:value="item.id" :value="item.id"
/> />
</el-select> </el-select>
...@@ -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"
...@@ -54,7 +53,7 @@ ...@@ -54,7 +53,7 @@
<el-form-item> <el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button type="primary" icon="Download" @click="handleExport">导出</el-button> <el-button type="primary" icon="Download" @click="handleExport">导出</el-button>
<el-button type="primary" @click="handleCheck">数据完整性校验</el-button> <!-- <el-button type="primary" @click="handleCheck">数据完整性校验</el-button> -->
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -65,18 +64,18 @@ ...@@ -65,18 +64,18 @@
border border
style="width: 100%" style="width: 100%"
> >
<el-table-column prop="user" label="用户" align="left" /> <el-table-column prop="operptionUser" label="用户" width="200" align="left" />
<el-table-column prop="time" label="时间" align="left" width="180" /> <el-table-column prop="createtime" label="时间" align="left" width="180" />
<el-table-column prop="moduleId" label="模块编号" align="left" width="120" /> <el-table-column prop="code" label="模块编号" align="left" width="120" />
<el-table-column prop="moduleName" label="操作模块" align="left" width="150" /> <el-table-column prop="operModule" label="操作模块" align="left" width="150" />
<el-table-column prop="operation" label="操作信息" align="left" show-overflow-tooltip /> <el-table-column prop="operptionMassage" 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>
...@@ -85,25 +84,28 @@ ...@@ -85,25 +84,28 @@
<script setup> <script setup>
import { ref, reactive, computed, onMounted } from 'vue' import { ref, reactive, computed, onMounted } from 'vue'
import { Lock } from '@element-plus/icons-vue' import { Lock } from '@element-plus/icons-vue'
import { queryMenuTreeAndUserlist } from '@/api/logSet/operationLog.js'
import { query , allProject} from '@/api/logSet/encryptedLog.js'
import { ElMessageBox, ElMessage } from 'element-plus'
import useAppStore from '@/store/modules/app'
const appStore = useAppStore()
console.log('当前用户信息',appStore.userInfo)
const loading = ref(true) const loading = ref(true)
const total = ref(0) const total = ref(0)
const logList = ref([]) const logList = ref([])
const queryParams = reactive({ const queryParams = reactive({
pageNum: 1, page: 1,
pageSize: 10, rows: 10,
user: undefined, user: undefined,
range: '0', range: '0',
startTime: '',
endTime: '',
module: undefined, module: undefined,
projectId: undefined projectId: undefined
}) })
const userOptions = ref([ const userOptions = ref([
{ id: 'admin', realname: 'admin' }, // { id: 'admin', user: 'admin' },
{ id: 'system', realname: 'system' }, // { id: 'system', user: 'system' },
{ id: 'test', realname: 'test' } // { id: 'test', user: 'test' }
]) ])
const timeRangeOptions = ref([ const timeRangeOptions = ref([
...@@ -117,43 +119,27 @@ const timeRangeOptions = ref([ ...@@ -117,43 +119,27 @@ const timeRangeOptions = ref([
]) ])
const projectLevelOptions = ref([ const projectLevelOptions = ref([
{ id: '1', project: '一级' }, // { id: '1', project: '一级' },
{ id: '2', project: '二级' }, // { id: '2', project: '二级' },
{ id: '3', project: '三级' } // { id: '3', project: '三级' }
]) ])
const pageCount = computed(() => {
const t = Number(total.value) || 0
const ps = Number(queryParams.pageSize) || 1
return Math.ceil(t / ps)
})
const getList = () => { const getList = async () => {
loading.value = true loading.value = true
setTimeout(() => { try {
logList.value = [ const response = await query(queryParams)
{ logList.value = response.data.list || []
user: 'admin', total.value = response.data.total || 0
time: '2025-08-19 19:36:25', } catch (error) {
moduleId: 'DDM_00000', console.error('Failed to fetch log list:', error)
moduleName: '系统模块', } finally {
operation: '用户登录'
},
{
user: 'admin',
time: '2025-08-19 19:01:36',
moduleId: 'DDM_00001',
moduleName: '用户管理-用户',
operation: '用户[admin]登录到系统平台。'
}
]
total.value = 53
loading.value = false loading.value = false
}, 200) }
} }
const handleQuery = () => { const handleQuery = () => {
queryParams.pageNum = 1 queryParams.page = 1
getList() getList()
} }
...@@ -168,43 +154,39 @@ const handleCheck = () => { ...@@ -168,43 +154,39 @@ const handleCheck = () => {
window.$modal.msgSuccess('数据完整性校验完成') window.$modal.msgSuccess('数据完整性校验完成')
} }
const handleTimeRangeChange = (value) => { onMounted(async () => {
const now = new Date() try {
let startTime = new Date() const response = await queryMenuTreeAndUserlist({ type: 'global' })
console.log('queryMenuTreeAndUserlist', response)
switch (value) {
case 'last3days': userOptions.value = response.data.userlist.map(user => ({
startTime.setDate(now.getDate() - 3) id: user.id,
break user: user.realname
case 'lastWeek': }))
startTime.setDate(now.getDate() - 7) } catch (error) {
break console.error('Failed to fetch user and module data:', error)
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
} }
if (startTime) { try {
queryParams.startTime = startTime.toISOString().split('T')[0] + ' 00:00:00' const params = {
queryParams.endTime = now.toISOString().split('T')[0] + ' 23:59:59' loginUser: {
} else { tsysUser: {
queryParams.startTime = '' id: appStore.userInfo.user.id,
queryParams.endTime = '' username: appStore.userInfo.user.username
}
},
proName: '',
note: ''
}
const projectResponse = await allProject(params)
projectLevelOptions.value = projectResponse.data.map(project => ({
id: project.id,
project: project.project
}))
} catch (error) {
console.error('Failed to fetch project level data:', error)
} }
handleQuery()
}
onMounted(() => {
getList() getList()
}) })
</script> </script>
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<el-form-item> <el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button type="primary" icon="Download" @click="handleExport">导出</el-button> <el-button type="primary" icon="Download" @click="handleExport">导出</el-button>
<el-button type="primary" @click="handleCheck">数据完整性校验</el-button> <!-- <el-button type="primary" @click="handleCheck">数据完整性校验</el-button> -->
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -131,7 +131,7 @@ const getList = async () => { ...@@ -131,7 +131,7 @@ const getList = async () => {
} }
const handleQuery = () => { const handleQuery = () => {
queryParams.pageNum = 1 queryParams.page = 1
getList() getList()
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论