import { reactive } from 'vue'

// 搜索表单配置
export const buildFormColumns = () => [
    {
        type: 'input',
        prop: 'groupName',
        placeholder: '请输入分组名称',
    },
    {
        type: 'input',
        prop: 'createUser',
        placeholder: '请输入创建人',
    },
]

// 表格列配置
export const tableColumns = [
    {
        prop: 'groupName',
        label: '分组名称',
    },

    {
        prop: 'personCount',
        label: '人员数量',
        formatter: (row) => {
            return row.workerList?.length || 0
        },
    },
    {
        prop: 'createUser',
        label: '创建人',
    },
    {
        prop: 'remark',
        label: '备注',
    },
]

// 弹窗配置
export const dialogConfig = reactive({
    outerVisible: false,
    outerTitle: '新增分组',
    outerWidth: '70%',
    minHeight: '80vh',
    maxHeight: '95vh',
})

export default {
    tableColumns,
    dialogConfig,
    buildFormColumns,
}

