<script setup lang="ts">
import { computed } from 'vue';
import BasicDescriptions from '../BasicDescriptions';
import { goodColumns, goodHasChildColumns } from './columns';

 const props = defineProps<{ data?: any; num?: number, time?: string, name?: string }>()

 const columns = computed(() => {
     const baseColumns = props.data?.is_combind == '1' ? goodHasChildColumns : goodColumns
     return [
                ...(props.num 
            ? [{ label: '操作数量', render: () => props.num, span: 12 }, { label: '操作时间', render: () => props.time, span: 6 }, { label: '操作人', render: () => props.name, span: 6 }] 
            : []),
        ...baseColumns, 
        ]
 })
</script>


<template>
    <BasicDescriptions 
        :columns="columns" 
        :data="data" 
    />
</template>