import { reactive } from 'vue'

// 搜索表单配置（计划管理列表筛选）
export const buildFormColumns = (inspectionStationOptions = [], riskLevelOptions = []) => [
    {
        type: 'month',
        prop: 'planManagementMonth',
        placeholder: '请选择月份',
    },
    {
        type: 'select',
        prop: 'inspectionStationId',
        placeholder: '请选择部门',
        options: inspectionStationOptions.map((item) => ({
            label: item.value,
            value: item.id,
        })),
    },
    {
        type: 'input',
        prop: 'keyWord',
        placeholder: '请输入关键字',
    },
    {
        type: 'select',
        prop: 'riskLevel',
        placeholder: '请选择风险等级',
        options: riskLevelOptions,
    },
]

export const tableColumns = [
    {
        prop: 'planManagementMonth',
        label: '月份',
    },
    {
        prop: 'projectName',
        label: '项目名称',
    },
    {
        prop: 'workContent',
        label: '作业内容',
    },
    {
        prop: 'inspectionStationName',
        label: '实施部门',
    },
    {
        prop: 'stareDate',
        label: '计划开始时间',
    },
    {
        prop: 'endDate',
        label: '计划结束时间',
    },
    {
        prop: 'riskLevel',
        label: '风险等级',
    },
    {
        prop: 'remark',
        label: '备注',
    },
]

export const dialogConfig = reactive({
    outerVisible: false,
    outerTitle: '新增计划',
    outerWidth: '640px', // 根据图片缩小宽度更美观
    minHeight: '400px',
    maxHeight: '90vh',
})

export default {
    tableColumns,
    dialogConfig,
    buildFormColumns,
}
