import { g as y } from "./schemas-Cam1kIsU.js";
import { V as d, l as i, bk as q, __tla as __tla_0 } from "./index-9PRMimni.js";
import { e as L } from "./template-rpthWlT9.js";
let f, h;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })()
]).then(async ()=>{
    const { t: e } = d(), { yesOrNoOptions: u } = y(), o = q(), g = await L({
        roleType: 2,
        roleCategory: 1
    }), l = (r, b)=>(r || []).map((a)=>(a.disabled = +b.cyclingPattern == 2 && +a.value != 5 || +b.cyclingPattern != 2 && [
                5,
                6
            ].includes(+a.value), a));
    f = function(r = {}) {
        const b = [
            {
                field: "jobTitle",
                component: "NInput",
                label: e("equipmentLibrary.equipmentMainLibrary.job.jobTitle")
            },
            {
                field: "jobCode",
                component: "NInput",
                label: e("equipmentLibrary.equipmentMainLibrary.job.JobCode")
            },
            {
                field: "showSub",
                component: "NSwitch",
                label: e("equipmentLibrary.equipmentMainLibrary.job.showSubJobs"),
                isFull: !1
            }
        ], a = [
            {
                field: "jobTitle",
                component: "NInput",
                label: e("equipmentLibrary.equipmentMainLibrary.job.jobTitle"),
                giProps: {
                    span: 3
                },
                componentProps: ()=>({
                        disabled: i(r.readonly)
                    }),
                rules: [
                    {
                        required: !0,
                        message: `${e("equipmentLibrary.equipmentMainLibrary.job.jobTitle")} ${e("common.required")}`,
                        trigger: [
                            "blur"
                        ]
                    }
                ]
            },
            {
                field: "jobCode",
                component: "NInput",
                label: e("equipmentLibrary.equipmentMainLibrary.job.JobCode"),
                giProps: {
                    span: 3
                },
                componentProps: ()=>({
                        disabled: !0,
                        placeholder: e("common.autoPlaceholderText")
                    })
            },
            {
                field: "equipmentCode",
                component: "NInput",
                label: e("equipmentLibrary.equipmentMainLibrary.equipmentCode"),
                giProps: {
                    span: 3
                },
                componentProps: ()=>({
                        disabled: !0
                    })
            },
            {
                field: "equipmentName",
                component: "NInput",
                label: e("equipmentLibrary.equipmentMainLibrary.equipmentName"),
                giProps: {
                    span: 3
                },
                componentProps: ()=>({
                        disabled: !0
                    })
            },
            {
                field: "jobType",
                component: "BasicSelect",
                label: e("equipmentLibrary.equipmentMainLibrary.job.jobType"),
                giProps: {
                    span: 3
                },
                componentProps: ()=>({
                        disabled: !0,
                        optionType: "number",
                        cacheKey: "pms_job_type",
                        block: !0,
                        labelField: o.getLocale === "en" ? "labelEn" : "label"
                    }),
                rules: [
                    {
                        required: !0,
                        type: "number",
                        message: `${e("equipmentLibrary.equipmentMainLibrary.job.jobType")} ${e("common.required")}`,
                        trigger: [
                            "change"
                        ]
                    }
                ]
            },
            {
                field: "department",
                component: "BasicSelect",
                label: e("equipmentLibrary.equipmentMainLibrary.job.department"),
                giProps: {
                    span: 3
                },
                componentProps: ()=>({
                        disabled: i(r.readonly),
                        optionType: "number",
                        cacheKey: "vessel_department",
                        block: !0
                    }),
                rules: [
                    {
                        required: !0,
                        type: "number",
                        message: `${e("equipmentLibrary.equipmentMainLibrary.job.department")} ${e("common.required")}`,
                        trigger: [
                            "change"
                        ]
                    }
                ]
            },
            {
                field: "pic",
                component: "NSelect",
                label: e("equipmentLibrary.equipmentMainLibrary.job.PICDiscipline"),
                giProps: {
                    span: 3
                },
                componentProps: ()=>({
                        disabled: i(r.readonly),
                        options: g,
                        labelField: o.getLocale === "en" ? "shortNameEn" : "name",
                        valueField: "id"
                    }),
                rules: [
                    {
                        required: !0,
                        type: "number",
                        message: `${e("equipmentLibrary.equipmentMainLibrary.job.PICDiscipline")} ${e("common.required")}`,
                        trigger: [
                            "change"
                        ]
                    }
                ]
            },
            {
                field: "jobPriority",
                component: "BasicSelect",
                label: e("equipmentLibrary.equipmentMainLibrary.job.jobPriority"),
                giProps: {
                    span: 3
                },
                componentProps: ()=>({
                        disabled: i(r.readonly),
                        optionType: "number",
                        cacheKey: "pms_job_priority",
                        block: !0,
                        labelField: o.getLocale === "en" ? "labelEn" : "label"
                    }),
                rules: [
                    {
                        required: !0,
                        type: "number",
                        message: `${e("equipmentLibrary.equipmentMainLibrary.job.jobPriority")} ${e("common.required")}`,
                        trigger: [
                            "change"
                        ]
                    }
                ]
            },
            {
                field: "maintenanceType",
                component: "BasicSelect",
                label: e("equipmentLibrary.equipmentMainLibrary.job.maintenanceType"),
                giProps: {
                    span: 3
                },
                componentProps: ()=>({
                        disabled: !0,
                        optionType: "number",
                        cacheKey: "pms_maintenance_type",
                        block: !0,
                        labelField: o.getLocale === "en" ? "labelEn" : "label"
                    }),
                rules: [
                    {
                        required: !0,
                        type: "number",
                        message: `${e("equipmentLibrary.equipmentMainLibrary.job.maintenanceType")} ${e("common.required")}`,
                        trigger: [
                            "change"
                        ]
                    }
                ]
            },
            {
                field: "jobAssignedTo",
                component: "BasicSelect",
                label: e("equipmentLibrary.equipmentMainLibrary.job.jobAssignedTo"),
                giProps: {
                    span: 3
                },
                componentProps: ()=>({
                        disabled: !0,
                        optionType: "number",
                        cacheKey: "pms_assigned_to",
                        block: !0,
                        labelField: o.getLocale === "en" ? "labelEn" : "label"
                    }),
                rules: [
                    {
                        required: !0,
                        type: "number",
                        message: `${e("equipmentLibrary.equipmentMainLibrary.job.jobAssignedTo")} ${e("common.required")}`,
                        trigger: [
                            "change"
                        ]
                    }
                ]
            },
            {
                field: "criticalToSafety",
                component: "NSelect",
                label: e("equipmentLibrary.equipmentMainLibrary.job.criticalToSafety"),
                giProps: {
                    span: 3
                },
                componentProps: ()=>({
                        disabled: i(r.readonly),
                        options: u
                    }),
                rules: [
                    {
                        required: !0,
                        type: "boolean",
                        message: `${e("equipmentLibrary.equipmentMainLibrary.job.criticalToSafety")} ${e("common.required")}`,
                        trigger: [
                            "change"
                        ]
                    }
                ]
            },
            {
                field: "rARequired",
                component: "NSelect",
                label: e("equipmentLibrary.equipmentMainLibrary.job.RARequired"),
                giProps: {
                    span: 3
                },
                componentProps: ()=>({
                        disabled: i(r.readonly),
                        options: u
                    }),
                rules: [
                    {
                        required: !0,
                        type: "boolean",
                        message: `${e("equipmentLibrary.equipmentMainLibrary.job.RARequired")} ${e("common.required")}`,
                        trigger: [
                            "change"
                        ]
                    }
                ]
            },
            {
                field: "workPermit",
                component: "NSelect",
                label: e("equipmentLibrary.equipmentMainLibrary.job.workPermit"),
                giProps: {
                    span: 3
                },
                componentProps: ()=>({
                        disabled: i(r.readonly),
                        options: u
                    }),
                rules: [
                    {
                        required: !0,
                        type: "boolean",
                        message: `${e("equipmentLibrary.equipmentMainLibrary.job.workPermit")} ${e("common.required")}`,
                        trigger: [
                            "change"
                        ]
                    }
                ]
            },
            {
                field: "scheduleType",
                component: "BasicSelect",
                label: e("equipmentLibrary.equipmentMainLibrary.job.scheduledType"),
                giProps: {
                    span: 3
                },
                componentProps: ()=>({
                        disabled: i(r.readonly),
                        optionType: "number",
                        cacheKey: "pms_schedule_type",
                        block: !0,
                        labelField: o.getLocale === "en" ? "labelEn" : "label"
                    }),
                rules: [
                    {
                        required: !0,
                        type: "number",
                        message: `${e("equipmentLibrary.equipmentMainLibrary.job.scheduledType")} ${e("common.required")}`,
                        trigger: [
                            "change"
                        ]
                    }
                ]
            },
            {
                field: "cyclingPattern",
                component: "BasicSelect",
                label: e("equipmentLibrary.equipmentMainLibrary.job.cyclingPattern"),
                giProps: {
                    span: 3
                },
                componentProps: ({ formAction: n })=>({
                        disabled: i(r.readonly) || i(r.formType) !== "add",
                        optionType: "number",
                        cacheKey: "job_cycling_pattern",
                        block: !0,
                        onUpdateValue: (t)=>{
                            +t == 2 ? n.setFieldsValue({
                                frequency: 5,
                                alertFrequency: 5,
                                toleranceUnit: 5
                            }) : n.setFieldsValue({
                                frequency: null,
                                alertFrequency: null,
                                toleranceUnit: null
                            });
                        }
                    }),
                rules: [
                    {
                        required: !0,
                        type: "number",
                        message: `${e("equipmentLibrary.equipmentMainLibrary.job.cyclingPattern")} ${e("common.required")}`,
                        trigger: [
                            "change"
                        ]
                    }
                ]
            },
            {
                field: "jobInterval",
                component: "NInputNumber",
                label: e("equipmentLibrary.equipmentMainLibrary.job.interval"),
                giProps: {
                    span: 3
                },
                componentProps: ()=>({
                        disabled: i(r.readonly)
                    }),
                rules: [
                    {
                        required: !0,
                        type: "number",
                        message: `${e("equipmentLibrary.equipmentMainLibrary.job.interval")} ${e("common.required")}`,
                        trigger: [
                            "blur"
                        ]
                    }
                ]
            },
            {
                field: "frequency",
                component: "BasicSelect",
                label: e("equipmentLibrary.equipmentMainLibrary.job.frequency"),
                giProps: {
                    span: 3
                },
                componentProps: ({ model: n })=>({
                        disabled: i(r.readonly),
                        optionType: "number",
                        cacheKey: "pms_frequency",
                        block: !0,
                        handleOptionItem: (t)=>l(t, n)
                    }),
                rules: [
                    {
                        required: !0,
                        type: "number",
                        message: `${e("equipmentLibrary.equipmentMainLibrary.job.frequency")} ${e("common.required")}`,
                        trigger: [
                            "change"
                        ]
                    }
                ]
            },
            {
                field: "alertPeriod",
                component: "NInputNumber",
                label: e("equipmentLibrary.equipmentMainLibrary.job.alertPeriod"),
                giProps: {
                    span: 3
                },
                componentProps: ()=>({
                        disabled: i(r.readonly)
                    }),
                rules: [
                    {
                        required: !0,
                        type: "number",
                        message: `${e("equipmentLibrary.equipmentMainLibrary.job.alertPeriod")} ${e("common.required")}`,
                        trigger: [
                            "blur"
                        ]
                    }
                ]
            },
            {
                field: "alertFrequency",
                component: "BasicSelect",
                label: e("equipmentLibrary.equipmentMainLibrary.job.frequencyAlert"),
                giProps: {
                    span: 3
                },
                componentProps: ({ model: n })=>({
                        disabled: i(r.readonly),
                        optionType: "number",
                        cacheKey: "pms_frequency",
                        block: !0,
                        handleOptionItem: (t)=>l(t, n)
                    }),
                rules: [
                    {
                        required: !0,
                        type: "number",
                        message: `${e("equipmentLibrary.equipmentMainLibrary.job.frequencyAlert")} ${e("common.required")}`,
                        trigger: [
                            "change"
                        ]
                    }
                ]
            },
            {
                field: "estimateTime",
                component: "NInputNumber",
                label: e("equipmentLibrary.equipmentMainLibrary.job.estimatedTime"),
                giProps: {
                    span: 3
                },
                componentProps: ()=>({
                        disabled: i(r.readonly)
                    }),
                rules: [
                    {
                        required: !0,
                        type: "number",
                        message: `${e("equipmentLibrary.equipmentMainLibrary.job.estimatedTime")} ${e("common.required")}`,
                        trigger: [
                            "blur"
                        ]
                    }
                ]
            },
            {
                field: "estimateTimeUnit",
                component: "BasicSelect",
                label: e("equipmentLibrary.equipmentMainLibrary.job.estimatedTimeUnit"),
                giProps: {
                    span: 3
                },
                componentProps: ()=>({
                        disabled: i(r.readonly),
                        optionType: "number",
                        cacheKey: "pms_frequency",
                        block: !0
                    }),
                rules: [
                    {
                        required: !0,
                        type: "number",
                        message: `${e("equipmentLibrary.equipmentMainLibrary.job.estimatedTimeUnit")} ${e("common.required")}`,
                        trigger: [
                            "change"
                        ]
                    }
                ]
            },
            {
                field: "estimateWorkforce",
                component: "NInputNumber",
                label: e("equipmentLibrary.equipmentMainLibrary.job.estimatedWorkforce"),
                giProps: {
                    span: 3
                },
                componentProps: ()=>({
                        disabled: i(r.readonly)
                    }),
                rules: [
                    {
                        required: !0,
                        type: "number",
                        message: `${e("equipmentLibrary.equipmentMainLibrary.job.estimatedWorkforce")} ${e("common.required")}`,
                        trigger: [
                            "blur"
                        ]
                    }
                ]
            },
            {
                field: "tolerance",
                component: "NInputNumber",
                label: e("equipmentLibrary.equipmentMainLibrary.job.tolerance"),
                giProps: {
                    span: 3
                },
                componentProps: ()=>({
                        disabled: i(r.readonly)
                    })
            },
            {
                field: "toleranceUnit",
                component: "BasicSelect",
                label: e("equipmentLibrary.equipmentMainLibrary.job.frequencyTolerance"),
                giProps: {
                    span: 3
                },
                componentProps: ({ model: n })=>({
                        disabled: i(r.readonly),
                        optionType: "number",
                        cacheKey: "pms_frequency",
                        block: !0,
                        handleOptionItem: (t)=>l(t, n)
                    })
            },
            {
                field: "jobDescription",
                component: "NInput",
                label: e("equipmentLibrary.equipmentMainLibrary.job.jobDescription"),
                giProps: {
                    span: 6
                },
                componentProps: ()=>({
                        disabled: i(r.readonly),
                        type: "textarea"
                    }),
                rules: [
                    {
                        required: !0,
                        message: `${e("equipmentLibrary.equipmentMainLibrary.job.jobDescription")} ${e("common.required")}`,
                        trigger: [
                            "blur"
                        ]
                    }
                ]
            },
            {
                field: "specialNote",
                component: "NInput",
                label: e("equipmentLibrary.equipmentMainLibrary.job.specialNote"),
                giProps: {
                    span: 6
                },
                componentProps: ()=>({
                        disabled: i(r.readonly),
                        type: "textarea"
                    })
            }
        ], p = [
            {
                field: "fileCode",
                slot: "fileCode",
                label: e("equipmentLibrary.equipmentMainLibrary.job.attachment"),
                rules: [
                    {
                        key: "fileCode",
                        required: !0,
                        message: `${e("equipmentLibrary.equipmentMainLibrary.job.attachment")} ${e("common.required")}`,
                        trigger: [
                            "change"
                        ]
                    }
                ]
            }
        ], m = [
            {
                field: "jobType",
                component: "BasicSelect",
                label: e("equipmentLibrary.equipmentMainLibrary.job.jobType"),
                componentProps: ()=>({
                        optionType: "number",
                        cacheKey: "pms_job_type",
                        block: !0
                    })
            },
            {
                field: "jobTitle",
                component: "NInput",
                label: e("equipmentLibrary.equipmentMainLibrary.job.jobTitle")
            },
            {
                field: "jobDoneDates",
                component: "NDatePicker",
                label: e("equipmentLibrary.equipmentMainLibrary.job.jobDoneDate"),
                componentProps: {
                    type: "daterange",
                    valueFormat: "yyyy-MM-dd"
                }
            }
        ], s = [
            {
                field: "partNumber",
                component: "NInput",
                label: e("equipmentLibrary.equipmentMainLibrary.spareParts.partNumber")
            },
            {
                field: "itemDescription",
                component: "NInput",
                label: e("equipmentLibrary.equipmentMainLibrary.spareParts.itemDescription")
            }
        ], c = [
            {
                field: "code",
                component: "NInput",
                label: e("equipmentLibrary.equipmentMainLibrary.job.code")
            },
            {
                field: "name",
                component: "NInput",
                label: e("equipmentLibrary.equipmentMainLibrary.job.formName")
            },
            {
                field: "section",
                component: "BasicSelect",
                label: e("equipmentLibrary.equipmentMainLibrary.job.smsSection"),
                componentProps: ()=>({
                        cacheKey: "sms_section",
                        block: !0
                    })
            }
        ];
        return {
            jobDetailSchemas: a,
            jobSearchSchemas: b,
            attachmentFormSchemas: p,
            jobHistorySearchSchemas: m,
            sparePartsModalSearchSchemas: s,
            smsFormsModalSearchSchemas: c
        };
    };
    h = function() {
        return {
            tabList: [
                {
                    value: "JobDetails",
                    label: e("equipmentLibrary.equipmentMainLibrary.job.tabJobDetails")
                },
                {
                    value: "Procedures",
                    label: e("equipmentLibrary.equipmentMainLibrary.job.tabProcedures")
                },
                {
                    value: "SpareParts",
                    label: e("equipmentLibrary.equipmentMainLibrary.job.tabSpareParts")
                },
                {
                    value: "SMSForms",
                    label: e("equipmentLibrary.equipmentMainLibrary.job.tabSMSForms")
                },
                {
                    value: "JobHistory",
                    label: e("equipmentLibrary.equipmentMainLibrary.job.tabJobHistory")
                },
                {
                    value: "Attachment",
                    label: e("equipmentLibrary.equipmentMainLibrary.job.tabAttachment")
                },
                {
                    value: "UserManual",
                    label: e("equipmentLibrary.equipmentMainLibrary.job.tabUserManual")
                }
            ]
        };
    };
});
export { f as c, h as g, __tla };
