<template>
    <ele-modal v-model="visible" title="操作日志" width="800px">
        <el-table :data="tableData" border stripe>
            <el-table-column prop="operator" label="操作员" width="120" />
            <el-table-column
                prop="operationTime"
                label="操作时间"
                width="180"
            />
            <el-table-column prop="description" label="描述" />
        </el-table>
        <template #footer>
            <el-button type="primary" @click="visible = false">确定</el-button>
            <el-button @click="visible = false">取消</el-button>
        </template>
    </ele-modal>
</template>

<script setup>
    import { ref } from 'vue';

    const visible = ref(false);
    const tableData = ref([]);

    const handleOpen = (row) => {
        // Mock data
        tableData.value = [
            {
                operator: 'zzz',
                operationTime: '2025-06-15 15:00:00',
                description: '生成任务'
            },
            {
                operator: 'aaa',
                operationTime: '2025-06-15 15:00:00',
                description: '分配任务给aaa、bbb、ccc，计划完成时间2026-01-10'
            },
            {
                operator: 'ddd',
                operationTime: '2025-06-15 15:00:00',
                description: '完成子任务'
            },
            {
                operator: 'aaa',
                operationTime: '2025-06-15 15:00:00',
                description: '完成子任务'
            },
            {
                operator: 'eee',
                operationTime: '2025-06-15 15:00:00',
                description: '完成子任务'
            }
        ];
        visible.value = true;
    };

    defineExpose({ handleOpen });
</script>
