import { reactive } from 'vue'

// 静态选项（可后续替换为接口下拉）
const stationOptions = [
    { label: '昆明运检站', value: 1 },
    { label: '大理运检站', value: 2 },
]

const majorOptions = [
    { label: '输电专业', value: 1 },
    { label: '变电专业', value: 2 },
]

const businessTypeOptions = [
    { label: '日常巡视', value: 1 },
    { label: '缺陷处理', value: 2 },
]

const riskLevelOptions = [
    { label: '低风险', value: 1 },
    { label: '中风险', value: 2 },
    { label: '高风险', value: 3 },
]

// 月计划列表搜索表单配置
export const buildFormColumns = () => [
    {
        type: 'month',
        prop: 'month',
        placeholder: '请选择月份',
    },
    {
        type: 'select',
        prop: 'stationId',
        placeholder: '请选择运检站',
        options: stationOptions,
    },
    {
        type: 'input',
        prop: 'keyword',
        placeholder: '请输入关键字',
    },
    {
        type: 'select',
        prop: 'majorId',
        placeholder: '请选择专业',
        options: majorOptions,
    },
    {
        type: 'select',
        prop: 'businessTypeId',
        placeholder: '请选择业务类型',
        options: businessTypeOptions,
    },
    {
        type: 'select',
        prop: 'riskLevel',
        placeholder: '请选择风险等级',
        options: riskLevelOptions,
    },
]

// 月计划列表表格列
export const tableColumns = [
    { prop: 'inspectionStationName', label: '运检站', fixed: true },
    { prop: 'planMajorId', label: '专业', fixed: true },
    { prop: 'businessTypeId', label: '业务类型', fixed: true },
    { prop: 'projectName', label: '项目名称', fixed: true },
    { prop: 'workContent', label: '工作任务' },
    { prop: 'riskLevelName', label: '风险等级' },
    { prop: 'planCategoryId', label: '类别' },
    { prop: 'workAmount', label: '工作量', width: '140' },
    { prop: 'towerBaseNumber', label: '基塔数' },
    { prop: 'plannedStartTime', label: '计划开始时间', width: '140' },
    { prop: 'plannedEndTime', label: '计划结束时间', width: '140' },
    { prop: 'planPersonnel', label: '计划投入管理人员数量' },
    { prop: 'planSkilledWorkerDay', label: '计划投入管理人员工日' },
    { prop: 'planCarNum', label: '计划投入管理人员车辆数' },
    { prop: 'planSkilledWorkerNum', label: '计划投入熟练工人员数量' },
    { prop: 'planAuxiliaryWorkerNum', label: '计划投入辅助工人员数量' },
    { prop: 'planAuxiliaryWorkerDay', label: '计划投入施工人员工日' },
    { prop: 'planSubCarNum', label: '计划投入分包车辆数' },
    { prop: 'actualWorkingDay', label: '实际工作天数' },
]

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

export default {
    tableColumns,
    dialogConfig,
    buildFormColumns,
}
