Commit db33f6e9 by ningjihai

日志管理

parent 1303b3e5
...@@ -121,7 +121,11 @@ ...@@ -121,7 +121,11 @@
.el-table--striped .el-table__body tr.el-table__row--striped td { .el-table--striped .el-table__body tr.el-table__row--striped td {
background-color: rgba(238, 243, 252, 1) !important; /* 偶数行颜色 */ background-color: rgba(238, 243, 252, 1) !important; /* 偶数行颜色 */
} }
.title-icon {
width: 16px;
height: 15.59px;
object-fit: cover;
}
.custom-dialog { .custom-dialog {
border-radius: 8px; border-radius: 8px;
.custom-dialog-header { .custom-dialog-header {
......
...@@ -57,17 +57,23 @@ import QueryForm from '../operationLog/QueryForm.vue' ...@@ -57,17 +57,23 @@ import QueryForm from '../operationLog/QueryForm.vue'
const appStore = useAppStore() const appStore = useAppStore()
console.log('当前用户信息',appStore.userInfo) console.log('当前用户信息',appStore.userInfo)
const loading = ref(true) const loading = ref(true)
const total = ref(0)
const logList = ref([]) const logList = ref([])
const queryParams = reactive({
const data = reactive({
queryParams: {
page: 1, page: 1,
rows: 10, rows: 10,
user: undefined, user: undefined,
range: '0', range: '0',
module: undefined, module: undefined,
projectId: undefined projectId: undefined
}
}) })
const total = ref(0)
// 表格数据
const { queryParams } = toRefs(data)
const userOptions = ref([ const userOptions = ref([
// { id: 'admin', realname: 'admin' }, // { id: 'admin', realname: 'admin' },
// { id: 'system', realname: 'system' }, // { id: 'system', realname: 'system' },
...@@ -84,7 +90,7 @@ const projectLevelOptions = ref([ ...@@ -84,7 +90,7 @@ const projectLevelOptions = ref([
const getList = async () => { const getList = async () => {
loading.value = true loading.value = true
try { try {
const response = await queryDesensitizationStrategyLog(queryParams) const response = await queryDesensitizationStrategyLog(queryParams.value)
logList.value = response.data.list || [] logList.value = response.data.list || []
total.value = response.data.total || 0 total.value = response.data.total || 0
} catch (error) { } catch (error) {
...@@ -95,7 +101,7 @@ const getList = async () => { ...@@ -95,7 +101,7 @@ const getList = async () => {
} }
const handleQuery = () => { const handleQuery = () => {
queryParams.page = 1 queryParams.value.page = 1
getList() getList()
} }
const onReset = (formQuery) =>{ const onReset = (formQuery) =>{
...@@ -111,7 +117,7 @@ const handleExport = async () => { ...@@ -111,7 +117,7 @@ const handleExport = async () => {
}) })
.then(async () => { .then(async () => {
try { try {
const response = await getDesensitizationLogExcel(queryParams) const response = await getDesensitizationLogExcel(queryParams.value)
const blob = new Blob([response], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }); const blob = new Blob([response], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
const link = document.createElement('a') const link = document.createElement('a')
link.href = URL.createObjectURL(blob) link.href = URL.createObjectURL(blob)
...@@ -134,37 +140,7 @@ const handleCheck = () => { ...@@ -134,37 +140,7 @@ const handleCheck = () => {
} }
onMounted(async () => { onMounted(async () => {
try { //
const response = await queryMenuTreeAndUserlist({ type: 'global' })
console.log('queryMenuTreeAndUserlist', response)
userOptions.value = response.data.userlist.map(user => ({
id: user.id,
user: user.realname
}))
} catch (error) {
console.error('Failed to fetch user and module data:', error)
}
try {
const params = {
loginUser: {
tsysUser: {
id: appStore.userInfo.user.id,
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)
}
getList() getList()
}) })
......
...@@ -144,37 +144,6 @@ const handleCheck = () => { ...@@ -144,37 +144,6 @@ const handleCheck = () => {
} }
onMounted(async () => { onMounted(async () => {
try {
const response = await queryMenuTreeAndUserlist({ type: 'global' })
console.log('queryMenuTreeAndUserlist', response)
userOptions.value = response.data.userlist.map(user => ({
id: user.id,
user: user.realname
}))
} catch (error) {
console.error('Failed to fetch user and module data:', error)
}
try {
const params = {
loginUser: {
tsysUser: {
id: appStore.userInfo.user.id,
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)
}
getList() getList()
}) })
......
...@@ -151,25 +151,7 @@ const handleCheck = async () => { ...@@ -151,25 +151,7 @@ const handleCheck = async () => {
} }
onMounted(async () => { 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() getList()
}) })
......
...@@ -16,7 +16,7 @@ import { ...@@ -16,7 +16,7 @@ import {
updateDataProject, updateDataProject,
showProxyInfo showProxyInfo
} from '@/api/project' } from '@/api/project'
import projectLogo from '@/assets/images/projectLogo.png'
import useAppStore from '@/store/modules/app' import useAppStore from '@/store/modules/app'
const appStore = useAppStore() const appStore = useAppStore()
...@@ -413,19 +413,24 @@ onMounted(()=>{ ...@@ -413,19 +413,24 @@ onMounted(()=>{
<div class="app-container scroller"> <div class="app-container scroller">
<PageTitle @back="$emit('page', 'list')"> <PageTitle @back="$emit('page', 'list')">
<template #title> <template #title>
项目管理 <div style="display: flex;align-items: center;">
<img class="title-icon" :src="projectLogo" alt="">
<span style="margin-left: 8px;">项目管理</span>
</div>
</template> </template>
</PageTitle> </PageTitle>
<div class="app-container__body"> <div class="app-container__body">
<!-- <div> -->
<query-form <query-form
ref="QueryFormRef" ref="QueryFormRef"
v-model="queryParams" v-model="queryParams"
@query="onQuery" @query="onQuery"
@reset="onReset" @reset="onReset"
@showAddDialog="showAddDialog"/> @showAddDialog="showAddDialog"
/>
<div style="flex: 1;"> <div style="flex: 1;">
<el-table <el-table
height="100%" height="100%"
...@@ -527,14 +532,13 @@ onMounted(()=>{ ...@@ -527,14 +532,13 @@ onMounted(()=>{
</div> </div>
<pagination <pagination
style="margin-top: 47px;"
v-show="total > 0" v-show="total > 0"
:total="total" :total="total"
v-model:page="queryParams.page" v-model:page="queryParams.page"
v-model:limit="queryParams.everypage" v-model:limit="queryParams.everypage"
@pagination="getList" @pagination="getList"
/> />
<!-- </div> -->
</div> </div>
<ProjectEditDialog <ProjectEditDialog
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论