import { V as f, bk as b, r as i, ad as r, __tla as __tla_0 } from "./index-9PRMimni.js";
import { _ as h, a0 as R, a1 as g } from "./template-rpthWlT9.js";
import { a as q } from "./illnessInjury-CN3bQPcI.js";
let O, y, F, k, S, W, D;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })()
]).then(async ()=>{
    const c = await h(), { t: e } = f(), l = b(), P = await g("crew_request_relief_status"), d = await R();
    y = function() {
        return {
            tableSchemas: [
                {
                    field: "crewName",
                    component: "NInput",
                    label: e("requestRelief.crewName"),
                    labelWidth: 100,
                    giProps: {
                        span: 3
                    },
                    componentProps: {
                        placeholder: e("requestRelief.crewName")
                    }
                },
                {
                    field: "rankId",
                    component: "NSelect",
                    label: e("requestRelief.rank"),
                    labelWidth: 120,
                    giProps: {
                        span: 2
                    },
                    componentProps: {
                        placeholder: e("requestRelief.rank"),
                        options: c,
                        labelField: l.getLocale === "en" ? "shortNameEn" : "name",
                        valueField: "id"
                    }
                },
                {
                    field: "vesselId",
                    component: "NSelect",
                    label: e("requestRelief.vessel"),
                    labelWidth: 100,
                    giProps: {
                        span: 2
                    },
                    componentProps: {
                        placeholder: e("requestRelief.vessel"),
                        options: d,
                        labelField: l.getLocale === "en" ? "shipNameEn" : "shipName",
                        valueField: "id",
                        filterable: !0,
                        clearable: !0
                    }
                },
                {
                    field: "startOnLeaveDate",
                    component: "NDatePicker",
                    label: e("requestRelief.onLeavePeroid"),
                    labelWidth: 20,
                    giProps: {
                        span: 2
                    },
                    componentProps: {
                        type: "daterange",
                        valueFormat: "yyyy-MM-dd"
                    }
                },
                {
                    field: "endOnLeaveDate",
                    hidden: !0
                },
                {
                    field: "status",
                    component: "BasicSelect",
                    label: e("requestRelief.status"),
                    labelWidth: 20,
                    giProps: {
                        span: 2
                    },
                    componentProps: {
                        class: "w-full",
                        placeholder: e("requestRelief.status"),
                        options: P
                    }
                }
            ]
        };
    };
    S = function(t) {
        const s = i(!1), o = i(), p = [
            {
                field: "vesselId",
                component: "NSelect",
                label: e("requestRelief.vesselName"),
                labelWidth: 120,
                giProps: {
                    span: 4
                },
                componentProps: {
                    disabled: !0,
                    options: d,
                    labelField: l.getLocale === "en" ? "shipNameEn" : "shipName",
                    valueField: "id"
                },
                rules: [
                    {
                        required: !0,
                        type: "number",
                        message: e("drill.addPlan.addSelectPlaceholder") + e("requestRelief.vesselName"),
                        trigger: [
                            "blur"
                        ]
                    }
                ]
            },
            {
                field: "crewId",
                component: "NSelect",
                label: e("requestRelief.crewName"),
                labelWidth: 120,
                giProps: {
                    span: 4
                },
                componentProps: {
                    disabled: s,
                    options: o,
                    valueField: "crewId",
                    labelField: l.getLocale === "en" ? "crewNameEn" : "crewName",
                    onUpdateValue: (a)=>{
                        const u = JSON.parse(JSON.stringify(o.value)).find((m)=>m.crewId === a);
                        t(u);
                    }
                },
                rules: [
                    {
                        required: !0,
                        type: "number",
                        message: e("drill.addPlan.addSelectPlaceholder") + e("requestRelief.crewName"),
                        trigger: [
                            "blur"
                        ]
                    }
                ]
            },
            {
                field: "rankId",
                component: "NSelect",
                label: e("requestRelief.rank"),
                labelWidth: 120,
                giProps: {
                    span: 4
                },
                componentProps: {
                    disabled: !0,
                    options: c,
                    labelField: l.getLocale === "en" ? "shortNameEn" : "name",
                    valueField: "id"
                }
            },
            {
                field: "startOnLeaveDate",
                component: "NDatePicker",
                label: e("requestRelief.onLeavePeroid"),
                labelWidth: 20,
                giProps: {
                    span: 3
                },
                componentProps: {
                    disabled: s,
                    type: "date",
                    valueFormat: "yyyy-MM-dd",
                    placeholder: e("requestRelief.onLeavePeroid")
                },
                rules: [
                    {
                        required: !0,
                        message: e("common.RequireTips")
                    }
                ]
            },
            {
                label: e("requestRelief.to"),
                labelWidth: 20,
                field: "endOnLeaveDate",
                component: "NDatePicker",
                giProps: {
                    span: 3
                },
                componentProps: {
                    disabled: s,
                    type: "date",
                    valueFormat: "yyyy-MM-dd",
                    placeholder: e("requestRelief.onLeavePeroid")
                },
                rules: [
                    {
                        required: !0,
                        message: e("common.RequireTips")
                    }
                ]
            }
        ];
        return {
            methods: {
                updateReadOnly: (a)=>{
                    s.value = a;
                },
                getCrewList: (a)=>{
                    q({
                        vesselId: a
                    }).then((n)=>{
                        o.value = n;
                    });
                }
            },
            formSchema: p
        };
    };
    F = function() {
        return {
            schemasUpload: [
                {
                    field: "fileDtoList",
                    label: e("noticeCircular.general.Attachment"),
                    slot: "attachment"
                }
            ]
        };
    };
    k = function(t) {
        return r.Post("/crewRequestRelief/pageList", t);
    };
    O = function(t) {
        return r.Post("/crewRequestRelief/saveOrUpdate", t);
    };
    W = function(t) {
        return r.Get(`/crewRequestRelief/${t}`);
    };
    D = function(t) {
        return r.Get(`/common/template/?fileCode=${t}`);
    };
});
export { O as a, y as b, F as c, k as d, S as f, W as g, D as r, __tla };
