import { e as g } from "./template-rpthWlT9.js";
import { r as h, V as P, c$ as q, gD as f, bk as y, l as t, __tla as __tla_0 } from "./index-9PRMimni.js";
import { e as r, d as p, b as T } from "./helper-Czt-QYps.js";
import { f as N } from "./find-D_h_aJYR.js";
let v, D;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })()
]).then(async ()=>{
    const { t: e } = P(), m = y(), S = q(), R = await g({
        roleType: 2,
        roleCategory: 1
    });
    v = function(l) {
        const { isView: o, isDefect: c } = l, n = h(!1);
        return {
            formSchemas: [
                {
                    field: "model",
                    hidden: !0
                },
                {
                    field: "shipId",
                    component: "NSelect",
                    label: e("unPlannedJob.basicDetailTab.vessel"),
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        disabled: !0,
                        class: "w-full",
                        options: S.shipList,
                        labelField: m.getLocale === "en" ? "shipNameEn" : "shipName",
                        valueField: "id"
                    },
                    rules: [
                        {
                            required: !0,
                            message: e("common.RequireTips"),
                            trigger: [
                                "submit"
                            ],
                            type: "any"
                        }
                    ]
                },
                {
                    field: "jobCategory",
                    component: "BasicSelect",
                    label: e("unPlannedJob.jobCategory"),
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        className: "w-full",
                        placeholder: e("common.chooseText"),
                        cacheKey: "unplanned_category",
                        disabled: o || l.isDefect
                    },
                    rules: [
                        {
                            required: !0,
                            message: e("common.RequireTips"),
                            trigger: [
                                "submit"
                            ]
                        }
                    ]
                },
                {
                    field: "equipmentCode",
                    component: "NInput",
                    label: e("unPlannedJob.equipmentCode"),
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        placeholder: e("common.chooseText"),
                        disabled: !0
                    },
                    rules: [
                        {
                            required: !0,
                            message: e("common.RequireTips"),
                            trigger: [
                                "submit"
                            ]
                        }
                    ]
                },
                {
                    field: "equipmentName",
                    component: "NSelect",
                    label: e("unPlannedJob.equipmentName"),
                    componentProps: ({ model: u, formAction: d })=>{
                        const { shipId: i } = u, { setFieldsValue: b } = d;
                        return {
                            show: n,
                            remote: !0,
                            clearable: !0,
                            filterable: !0,
                            loading: t(T),
                            options: t(r),
                            disabled: o,
                            valueField: "label",
                            placeholder: e("common.inputTextToSearch"),
                            onClear: ()=>{
                                p({
                                    shipId: i
                                });
                            },
                            onBlur: ()=>{
                                n.value = !1;
                            },
                            onSearch: async (s)=>{
                                s.length > 0 ? n.value = !0 : n.value = !1, p({
                                    shipId: i,
                                    productName: s
                                });
                            },
                            onUpdateValue: async (s)=>{
                                const a = N(t(r), {
                                    label: s
                                });
                                b({
                                    equipmentCode: a?.raw?.productCode ?? null,
                                    model: a?.raw?.model ?? null
                                }), n.value = !1;
                            }
                        };
                    },
                    rules: [
                        {
                            required: !0,
                            message: e("common.RequireTips"),
                            trigger: [
                                "submit"
                            ]
                        }
                    ]
                },
                {
                    field: "jobTitle",
                    component: "NInput",
                    label: e("unPlannedJob.jobTitle"),
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        placeholder: e("common.inputText"),
                        disabled: o
                    }
                },
                {
                    field: "jobPriority",
                    component: "BasicSelect",
                    label: e("unPlannedJob.jobPriority"),
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        placeholder: e("common.chooseText"),
                        cacheKey: "pms_job_priority",
                        block: !0,
                        disabled: o
                    },
                    rules: [
                        {
                            required: !0,
                            message: e("common.RequireTips"),
                            trigger: [
                                "submit"
                            ]
                        }
                    ]
                },
                {
                    field: "department",
                    component: "BasicSelect",
                    label: e("unPlannedJob.department"),
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        className: "w-full",
                        placeholder: e("common.chooseText"),
                        cacheKey: "vessel_department",
                        disabled: o
                    },
                    rules: [
                        {
                            required: !0,
                            message: e("common.RequireTips"),
                            trigger: [
                                "submit"
                            ]
                        }
                    ]
                },
                {
                    field: "discipline",
                    component: "NSelect",
                    label: e("unPlannedJob.discipline"),
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        labelField: "shortNameEn",
                        valueField: "id",
                        placeholder: e("common.chooseText"),
                        options: R,
                        disabled: o
                    },
                    rules: [
                        {
                            required: !0,
                            message: e("common.RequireTips"),
                            trigger: [
                                "submit"
                            ],
                            type: "any"
                        }
                    ]
                },
                {
                    field: "maintenanceCause",
                    component: "BasicSelect",
                    label: e("unPlannedJob.maintenanceCause"),
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        className: "w-full",
                        placeholder: e("common.chooseText"),
                        cacheKey: "unplanned_maintenance_cause",
                        disabled: o
                    },
                    rules: [
                        {
                            required: !0,
                            message: e("common.RequireTips"),
                            trigger: [
                                "submit"
                            ]
                        }
                    ]
                },
                {
                    field: "dueDate",
                    component: "NDatePicker",
                    label: e("unPlannedJob.dueDate"),
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        className: "w-full",
                        placeholder: e("common.chooseText"),
                        valueFormat: "yyyy-MM-dd",
                        disabled: o
                    },
                    rules: [
                        {
                            required: !0,
                            message: e("common.RequireTips"),
                            trigger: [
                                "submit"
                            ]
                        }
                    ]
                },
                {
                    field: "jobReportedDate",
                    component: "NDatePicker",
                    label: e("unPlannedJob.jobReportedDate"),
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        className: "w-full",
                        placeholder: e("common.chooseText"),
                        valueFormat: "yyyy-MM-dd",
                        defaultValue: f().format("YYYY-MM-DD"),
                        disabled: o
                    },
                    rules: [
                        {
                            required: !0,
                            message: e("common.RequireTips"),
                            trigger: [
                                "submit"
                            ]
                        }
                    ]
                },
                {
                    field: "jobReportedBy",
                    component: "NSelect",
                    label: e("unPlannedJob.jobReportedBy"),
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        placeholder: e("common.chooseText"),
                        className: "w-full",
                        labelField: m.getLocale === "en" ? "nameEn" : "name",
                        valueField: "id",
                        options: l.jobReportedByOptions,
                        disabled: o
                    },
                    rules: [
                        {
                            required: !0,
                            message: e("common.RequireTips"),
                            trigger: [
                                "submit"
                            ],
                            type: "any"
                        }
                    ]
                },
                {
                    field: "incidentNumber",
                    label: e("unPlannedJob.incidentNumber"),
                    giProps: {
                        span: 1
                    },
                    slot: "incidentNumberSlotName",
                    componentProps: {
                        disabled: o || c,
                        labelField: "defectNo",
                        valueField: "id",
                        class: "w-full"
                    }
                },
                {
                    field: "safety",
                    component: "BasicSelect",
                    label: e("unPlannedJob.criticalToSafety"),
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        className: "w-full",
                        placeholder: e("common.chooseText"),
                        cacheKey: "common_yes_no",
                        disabled: o
                    }
                },
                {
                    field: "riskAssessmentRequired",
                    component: "BasicSelect",
                    label: e("unPlannedJob.riskAssessmentRequired"),
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        className: "w-full",
                        placeholder: e("common.chooseText"),
                        cacheKey: "common_yes_no",
                        disabled: o
                    },
                    rules: [
                        {
                            required: !0,
                            message: e("common.RequireTips"),
                            trigger: [
                                "submit"
                            ]
                        }
                    ]
                },
                {
                    field: "workPermitRequired",
                    component: "BasicSelect",
                    label: e("unPlannedJob.workPermitRequired"),
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        className: "w-full",
                        placeholder: e("common.chooseText"),
                        cacheKey: "common_yes_no",
                        disabled: o
                    },
                    rules: [
                        {
                            required: !0,
                            message: e("common.RequireTips"),
                            trigger: [
                                "submit"
                            ]
                        }
                    ]
                },
                {
                    field: "cocRequired",
                    component: "BasicSelect",
                    label: e("unPlannedJob.cocRequired"),
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        className: "w-full",
                        placeholder: e("common.chooseText"),
                        cacheKey: "common_yes_no",
                        disabled: o
                    }
                },
                {
                    field: "memorandaRequired",
                    component: "BasicSelect",
                    label: e("unPlannedJob.memorandaRequired"),
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        className: "w-full",
                        placeholder: e("common.chooseText"),
                        cacheKey: "common_yes_no",
                        disabled: o
                    }
                },
                {
                    field: "jobDescription",
                    component: "NInput",
                    label: e("unPlannedJob.jobDescription"),
                    giProps: {
                        span: 5
                    },
                    componentProps: {
                        placeholder: e("common.inputText"),
                        type: "textarea",
                        disabled: o
                    },
                    rules: [
                        {
                            required: !0,
                            message: e("common.RequireTips"),
                            trigger: [
                                "submit"
                            ]
                        }
                    ]
                }
            ]
        };
    };
    D = function() {
        return {
            searchSchemas: [
                {
                    field: "equipmentType",
                    component: "NSelect",
                    label: e("equipmentCodeList.equipmentType"),
                    labelWidth: 120,
                    giProps: {
                        span: 2
                    },
                    componentProps: {
                        placeholder: e("equipmentCodeList.equipmentType"),
                        options: [
                            {
                                label: "1",
                                value: "1",
                                labelEn: "1"
                            }
                        ]
                    }
                },
                {
                    field: "equipmentSubType1",
                    component: "NSelect",
                    label: e("equipmentCodeList.equipmentSubType1"),
                    labelWidth: 120,
                    giProps: {
                        span: 2
                    },
                    componentProps: {
                        placeholder: e("equipmentCodeList.equipmentSubType1"),
                        options: [
                            {
                                label: "1",
                                value: "1",
                                labelEn: "1"
                            }
                        ]
                    }
                },
                {
                    field: "equipmentSubType2",
                    component: "NSelect",
                    label: e("equipmentCodeList.equipmentSubType2"),
                    labelWidth: 120,
                    giProps: {
                        span: 2
                    },
                    componentProps: {
                        placeholder: e("equipmentCodeList.equipmentSubType2"),
                        options: [
                            {
                                label: "1",
                                value: "1",
                                labelEn: "1"
                            }
                        ]
                    }
                },
                {
                    field: "equipmentCode",
                    component: "NInput",
                    label: e("equipmentCodeList.equipmentCode"),
                    labelWidth: 120,
                    giProps: {
                        span: 2
                    },
                    componentProps: {
                        placeholder: e("equipmentCodeList.equipmentCode")
                    }
                },
                {
                    field: "equipmentName",
                    component: "NInput",
                    label: e("equipmentCodeList.equipmentName"),
                    labelWidth: 120,
                    giProps: {
                        span: 2
                    },
                    componentProps: {
                        placeholder: e("equipmentCodeList.equipmentName")
                    }
                },
                {
                    field: "itemDescription",
                    component: "NSelect",
                    label: e("equipmentCodeList.itemDescription"),
                    labelWidth: 120,
                    giProps: {
                        span: 2
                    },
                    componentProps: {
                        placeholder: e("equipmentCodeList.itemDescription"),
                        options: [
                            {
                                label: "1",
                                value: "1",
                                labelEn: "1"
                            }
                        ]
                    }
                }
            ]
        };
    };
});
export { v as a, D as c, __tla };
