sen
2026-02-03 2e217b787931233134f5a656b3bc2503ed034eb7
ui/admin-ui3/src/components/OperationLogModal/index.vue
@@ -1,13 +1,17 @@
<template>
    <el-dialog v-model="visible" title="操作日志" width="1100px" destroy-on-close>
    <el-dialog v-model="visible" title="操作日志" width="1000px" destroy-on-close>
        <div class="log-container">
            <avue-crud ref="crudRef" :data="tableData" :option="tableOption" :table-loading="loading">
                <!-- <template #type="{ row }">
                    <el-tag :type="getTypeTag(row.type)">
                        {{ row.typeDesc || row.type }}
                    </el-tag>
                </template> -->
            </avue-crud>
            <el-table v-if="logModalRef == 'receivable'" v-loading="loading" :data="tableData" border stripe style="width: 100%" max-height="500px">
                <el-table-column prop="operator" label="操作人" width="120" />
                <el-table-column prop="createTime" label="操作时间" width="180" />
                <el-table-column prop="operationDesc" label="操作描述" show-overflow-tooltip />
            </el-table>
             <el-table v-if="logModalRef == 'payable'" v-loading="loading" :data="tableData" border stripe style="width: 100%" max-height="500px">
                <el-table-column prop="createBy" label="操作人" width="120" />
                <el-table-column prop="createTime" label="操作时间" width="180" />
                <el-table-column prop="operation" label="操作描述" show-overflow-tooltip />
            </el-table>
        </div>
        <template #footer>
            <el-button @click="visible = false">关 闭</el-button>
@@ -17,70 +21,21 @@
<script setup lang="ts">
import { ref } from 'vue';
  import { listReceivableFeeManagementLog} from "@/api/cwgl/receivableFeeManagementLog";
// 如果需要调用接口获取数据,保留此引入
// import { listReceivableFeeManagementLog } from "@/api/cwgl/receivableFeeManagementLog";
const visible = ref(false);
const loading = ref(false);
const tableData = ref([]);
const tableOption = {
    header: false,
    tip: false,           // 隐藏“当前已选择”提示
    addBtn: false,
    editBtn: false,
    delBtn: false,
    menu: false,          // 隐藏操作列
    border: true,
    stripe: true,
    column: [
        {
            label: '操作人',
            prop: 'operator',
            width: 120
        },
        {
            label: '操作时间',
            prop: 'operationTime',
            width: 180
        },
        // {
        //     label: '操作类型',
        //     prop: 'type',
        //     slot: true,       // 开启自定义插槽用于展示 Tag
        //     width: 120
        // },
        {
            label: '操作描述',
            prop: 'operationDesc',
            overHidden: true  // 内容过长时显示省略号
        },
          {
            label: '记录创建时间',
            prop: 'createTime',
            overHidden: true  // 内容过长时显示省略号
        }
    ]
};
// 根据类型返回不同的 Tag 颜色
const getTypeTag = (type: string) => {
    const map: Record<string, string> = {
        'add': 'success',
        'edit': 'warning',
        'del': 'danger',
        'import': 'info',
        'export': 'primary'
    };
    return map[type] || '';
};
const logModalRef = ref();
// 暴露给外部调用的打开方法
const open = (logs: any[]) => {
const open = (logs: any[],apiString: string) => {
    visible.value = true;
    loading.value = true;
    // 模拟异步加载
    console.log(apiString);
    logModalRef.value = apiString;
    // 模拟加载动画
    setTimeout(() => {
        tableData.value = logs || [];
        loading.value = false;
@@ -94,4 +49,9 @@
.log-container {
    padding: 10px 0;
}
/* 调整表格内边距,使其更美观 */
:deep(.el-table) {
    margin-top: 10px;
}
</style>