日志导出csv、报告模板编辑框样式调整

This commit is contained in:
caozehui
2025-04-15 09:45:00 +08:00
parent 4a80a88e6e
commit c9e41e0c82
5 changed files with 258 additions and 240 deletions

View File

@@ -9,3 +9,8 @@ import http from '@/api'
export const getAuditLog = (params: AuditLog.ReqAuditLogParams) => {
return http.post(`/sysLog/list`, params)
}
export const exportCsv = (params: AuditLog.ReqAuditLogParams) => {
return http.download(`/sysLog/exportCSV`, params)
}

View File

@@ -445,7 +445,7 @@
.dialog-small {
.el-dialog__body {
max-height: 340px;
max-height: 350px;
}
}

View File

@@ -4,13 +4,11 @@
ref='proTable'
:columns='columns'
:request-api='getTableList'
@selection-change='handleSelectionChange'
type='selection'
>
<!-- 表格 header 按钮 -->
<template #tableHeader>
<el-button type='primary' :icon='DataAnalysis'>分析</el-button>
<el-button type='primary' :icon='Upload'>导出csv</el-button>
<el-button type='primary' :icon='Upload' @click='handleExport'>导出csv</el-button>
</template>
</ProTable>
@@ -23,12 +21,12 @@
import TimeControl from '@/components/TimeControl/index.vue'
import {type AuditLog} from '@/api/system/log/interface/log.ts'
import ProTable from '@/components/ProTable/index.vue'
import { Upload ,DataAnalysis} from '@element-plus/icons-vue'
import {DataAnalysis, Upload} from '@element-plus/icons-vue'
import type {ColumnProps, ProTableInstance} from '@/components/ProTable/interface'
import { reactive,ref,watch } from 'vue'
import {
getAuditLog,
} from '@/api/system/log/index.ts'
import {reactive, ref} from 'vue'
import {getAuditLog, exportCsv} from '@/api/system/log/index.ts'
import {useDownload} from "@/hooks/useDownload";
import {exportPqDev} from "@/api/device/device";
// defineOptions({
@@ -116,7 +114,16 @@ const handleDateChange = (startDateTemp: string, endDateTemp: string) => {
endDate.value = endDateTemp
}
const handleExport = () => {
// 获取当前的搜索参数
let searchParam = proTable.value?.searchParam || {}
// 将开始时间和结束时间添加到搜索参数中
searchParam.searchBeginTime = startDate.value
searchParam.searchEndTime = endDate.value
useDownload(exportCsv, '日志列表', searchParam, false, '.csv')
}
</script>

View File

@@ -1,6 +1,7 @@
<template>
<el-dialog :title="dialogTitle" v-model="dialogVisible" @close="close" v-bind="dialogSmall">
<el-form ref="dialogFormRef" :model="formContent" :rules="rules" style="height: 330px; overflow: hidden;" >
<div>
<el-form ref="dialogFormRef" :model="formContent" :rules="rules">
<el-form-item label="名称" prop="name">
<el-input v-model="formContent.name" placeholder="请输入报告名称"/>
</el-form-item>
@@ -45,6 +46,7 @@
<el-input v-model="formContent.description" type="textarea" placeholder="请输入描述信息"/>
</el-form-item>
</el-form>
</div>
<template #footer>
<div>
<el-button @click="close()"> </el-button>
@@ -58,7 +60,7 @@
import {dialogSmall} from '@/utils/elementBind'
import {type PqReport} from '@/api/device/interface/report'
import {ElMessage, UploadFile} from 'element-plus'
import { updatePqReport, addPqReport, getPqReportById } from '@/api/device/report'
import {addPqReport, getPqReportById, updatePqReport} from '@/api/device/report'
import {computed, reactive, ref} from 'vue'
// 定义弹出组件元信息
@@ -276,6 +278,7 @@ const DataHandleChange = async(param: UploadFile) => {
const fileSizeLimit = 5 * 1024 * 1024; // 5MB
const handleFileLimit = (file: File) => {
if (file) {
if (file.size > fileSizeLimit) {
ElMessage.error({message: `文件大小不能超过${fileSizeLimit / 1024 / 1024}MB`});
return false;
@@ -283,7 +286,8 @@ const handleFileLimit = (file: File) => {
return true;
}
}
return true;
}
// 对外映射
@@ -297,7 +301,4 @@ const props = defineProps<{
display: flex;
align-items: center;
}
</style>

View File

@@ -84,6 +84,11 @@
return scope.row.detailFileVO.url
}
},
{
prop:'description',
label: '描述',
minWidth: 150
},
{
prop: 'createTime',
label: '创建时间',