import { i as f, e as b, j as y } from "./template-rpthWlT9.js";
import { V as I, bk as g, l as t, r as v, cO as l, cq as r, fm as p, __tla as __tla_0 } from "./index-9PRMimni.js";
import { a as R, d as u, e as q, b as P } from "./helper-Czt-QYps.js";
let U;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })()
]).then(async ()=>{
    const d = g(), { t: e } = I(), w = await b({
        roleType: 2,
        roleCategory: 1
    }), V = await y(), T = await f(), c = v(!1);
    U = function(o = {}) {
        return {
            schemas: [
                {
                    field: "shipId",
                    hidden: !0
                },
                {
                    field: "reportNo",
                    component: "NInput",
                    label: e("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.basicInfo.relatedReportNo"),
                    componentProps: {
                        disabled: !0
                    }
                },
                {
                    field: "severity",
                    component: "NSelect",
                    label: e("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.basicInfo.severity"),
                    componentProps: ()=>({
                            disabled: t(o?.modelType) === "view",
                            options: T,
                            "label-field": d.getLocale === "en" ? "labelEn" : "label"
                        }),
                    rules: [
                        {
                            required: !0,
                            message: `${e("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.basicInfo.severity")} ${e("common.required")}`,
                            trigger: [
                                "blur",
                                "change"
                            ]
                        }
                    ]
                },
                {
                    field: "equipmentId",
                    component: "NSelect",
                    label: e("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.basicInfo.equipment"),
                    componentProps: ({ model: s, formAction: n })=>{
                        const { shipId: i } = s, { setFieldsValue: m } = n;
                        return {
                            disabled: t(o?.modelType) === "view",
                            show: c,
                            remote: !0,
                            clearable: !0,
                            filterable: !0,
                            loading: t(P),
                            options: t(q),
                            placeholder: e("common.inputTextToSearch"),
                            onClear: ()=>{
                                u({
                                    shipId: i
                                });
                            },
                            onBlur: ()=>{
                                c.value = !1;
                            },
                            onSearch: async (a)=>{
                                c.value = a.length > 0, u({
                                    shipId: i,
                                    productName: a
                                });
                            },
                            onUpdateValue: async (a)=>{
                                const h = await R(a);
                                m({
                                    equipmentValue: h
                                }), c.value = !1;
                            }
                        };
                    }
                },
                {
                    field: "equipmentValue",
                    component: "NSelect",
                    label: e("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.basicInfo.criticalEquipment"),
                    componentProps: {
                        disabled: !0,
                        options: [
                            {
                                label: e("common.yes"),
                                value: "1"
                            },
                            {
                                label: e("common.no"),
                                value: "0"
                            }
                        ]
                    }
                },
                {
                    field: "expirationTime",
                    component: "NDatePicker",
                    label: e("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.basicInfo.expiryDate"),
                    componentProps: ()=>({
                            disabled: t(o?.modelType) === "view",
                            type: "date",
                            valueFormat: o.source === "deficiencyReport" ? "yyyy-MM-dd" : "yyyy-MM-dd hh:mm:ss",
                            isDateDisabled: (s)=>{
                                const n = new Date;
                                n.setHours(0, 0, 0, 0);
                                const i = new Date(s);
                                return i.setHours(0, 0, 0, 0), i < n;
                            }
                        }),
                    rules: [
                        {
                            required: !0,
                            message: `${e("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.basicInfo.expiryDate")} ${e("common.required")}`,
                            trigger: [
                                "blur",
                                "change"
                            ]
                        }
                    ]
                },
                {
                    field: "vesselPositionCode",
                    component: "NSelect",
                    label: e("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.basicInfo.vesselResponsible"),
                    componentProps: ()=>({
                            disabled: t(o?.modelType) === "view",
                            options: w,
                            "label-field": d.getLocale === "en" ? "nameEn" : "name",
                            "value-field": "code"
                        }),
                    rules: [
                        {
                            required: !0,
                            message: `${e("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.basicInfo.vesselResponsible")} ${e("common.required")}`,
                            trigger: [
                                "blur",
                                "change"
                            ]
                        }
                    ]
                },
                {
                    field: "officePositionCode",
                    component: "NSelect",
                    label: e("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.basicInfo.officeResponsible"),
                    componentProps: ()=>({
                            disabled: t(o?.modelType) === "view",
                            options: V,
                            "label-field": d.getLocale === "en" ? "nameEn" : "name",
                            "value-field": "code"
                        }),
                    rules: [
                        {
                            required: !0,
                            message: `${e("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.basicInfo.officeResponsible")} ${e("common.required")}`,
                            trigger: [
                                "blur",
                                "change"
                            ]
                        }
                    ]
                },
                {
                    field: "basicDescription",
                    component: "NInput",
                    giProps: {
                        span: 24
                    },
                    label: e("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.basicInfo.description"),
                    componentProps: ()=>({
                            disabled: t(o?.modelType) === "view",
                            type: "textarea",
                            maxlength: 300,
                            showCount: !0
                        }),
                    rules: [
                        {
                            required: !0,
                            message: `${e("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.basicInfo.description")} ${e("common.required")}`,
                            trigger: [
                                "blur"
                            ]
                        }
                    ]
                },
                {
                    field: "deficiencyPhotoUrlPhoto",
                    label: `${e("hsqe.auditInspection.vesselInspection.shipVisitReport.attachment")}1`,
                    component: "SingleImageUpload",
                    componentProps: ({ model: s })=>({
                            disabled: t(o?.modelType) === "view",
                            action: `${r().urlPrefix}/system/files`,
                            headers: {
                                timestamp: new Date().getTime(),
                                authorization: `${l.get(p)}`
                            },
                            onUploadChange: (n, i)=>{
                                s.deficiencyPhotoUrl = i;
                            }
                        })
                },
                {
                    field: "deficiencyPhotoUrlTwoPhoto",
                    label: `${e("hsqe.auditInspection.vesselInspection.shipVisitReport.attachment")}2`,
                    component: "SingleImageUpload",
                    componentProps: ({ model: s })=>({
                            disabled: t(o?.modelType) === "view",
                            action: `${r().urlPrefix}/system/files`,
                            headers: {
                                timestamp: new Date().getTime(),
                                authorization: `${l.get(p)}`
                            },
                            onUploadChange: (n, i)=>{
                                s.deficiencyPhotoUrlTwo = i;
                            }
                        })
                },
                {
                    field: "deficiencyPhotoUrlThreePhoto",
                    label: `${e("hsqe.auditInspection.vesselInspection.shipVisitReport.attachment")}3`,
                    component: "SingleImageUpload",
                    componentProps: ({ model: s })=>({
                            disabled: t(o?.modelType) === "view",
                            action: `${r().urlPrefix}/system/files`,
                            headers: {
                                timestamp: new Date().getTime(),
                                authorization: `${l.get(p)}`
                            },
                            onUploadChange: (n, i)=>{
                                s.deficiencyPhotoUrlThree = i;
                            }
                        })
                }
            ]
        };
    };
});
export { U as c, __tla };
