wujianwei
2026-02-02 48032a9bf0b5e560fd438ae7ba12ad6f4c8183ed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<template>
    <el-dialog v-model="visible" title="操作日志" width="1000px" destroy-on-close>
        <div class="log-container">
            <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>
        </template>
    </el-dialog>
</template>
 
<script setup lang="ts">
import { ref } from 'vue';
// 如果需要调用接口获取数据,保留此引入
// import { listReceivableFeeManagementLog } from "@/api/cwgl/receivableFeeManagementLog";
 
const visible = ref(false);
const loading = ref(false);
const tableData = ref([]);
const logModalRef = ref();
// 暴露给外部调用的打开方法
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;
    }, 300);
};
 
defineExpose({ open });
</script>
 
<style scoped>
.log-container {
    padding: 10px 0;
}
 
/* 调整表格内边距,使其更美观 */
:deep(.el-table) {
    margin-top: 10px;
}
</style>