import { B as u } from "./BasicForm-dL_oCSPM.js";
import { f as d } from "./group-DxznlajQ.js";
import { r as s, V as g, d as f, c as h, o as F, l as T, __tla as __tla_0 } from "./index-9PRMimni.js";
import { u as P } from "./useForm-CKmgcynv.js";
let R;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })()
]).then(async ()=>{
    const { t: l } = g(), b = await d();
    function y() {
        const r = s(!1), o = s("");
        return {
            schemas: [
                {
                    label: l("Ship Position"),
                    field: "shipLocation",
                    component: "NInput",
                    componentProps: ()=>{},
                    rules: [
                        {
                            required: !0,
                            message: "Please enter ship position",
                            trigger: [
                                "blur"
                            ]
                        }
                    ]
                },
                {
                    label: "Drill Time From",
                    field: "drillTimeFrom",
                    component: "NDatePicker",
                    componentProps: ()=>({
                            type: "daterange",
                            valueFormat: "yyyy-MM-dd",
                            disabled: r.value
                        }),
                    rules: [
                        {
                            required: !0,
                            message: "Please enter Drill Time From",
                            trigger: [
                                "change"
                            ],
                            type: "array"
                        }
                    ]
                },
                {
                    label: "Drill Locaton",
                    field: "drillLocation",
                    component: "NInput",
                    componentProps: ()=>{},
                    rules: [
                        {
                            required: !0,
                            message: "Please enter Drill Locaton",
                            trigger: [
                                "blur"
                            ]
                        }
                    ]
                },
                {
                    label: "Weather & Sea conditio",
                    field: "weatherSeaCondition",
                    component: "NInput",
                    componentProps: ()=>{},
                    rules: [
                        {
                            required: !0,
                            message: "Please enter Weather & Sea conditio",
                            trigger: "blur"
                        }
                    ]
                },
                {
                    label: "Related Training Report",
                    field: "relatedTrainingReport",
                    component: "NSelect",
                    componentProps: ()=>({
                            options: b,
                            "label-field": "projectEnglish",
                            "value-field": "id",
                            disabled: r.value
                        }),
                    rules: [
                        {
                            required: !0,
                            message: "Please enter Related Training Report",
                            trigger: [
                                "change"
                            ],
                            type: "number"
                        }
                    ]
                },
                {
                    label: l("Cargo"),
                    field: "cargo",
                    component: "NInput",
                    componentProps: ()=>({
                            type: "textarea"
                        })
                },
                {
                    label: l("Details of exercises"),
                    field: "exerciseDetails",
                    component: "NInput",
                    componentProps: ()=>({
                            type: "textarea"
                        })
                }
            ],
            methods: {
                setReadOnly: (t)=>{
                    r.value = t;
                },
                setStatus: (t)=>{
                    o.value = t;
                }
            }
        };
    }
    R = f({
        __name: "index",
        setup (r, { expose: o }) {
            o({
                setFormData: m,
                getFormData: c
            });
            const { schemas: a } = y(), [i, { setFieldsValue: t, getFieldsValue: n }] = P({
                schemas: a,
                labelWidth: "auto",
                layout: "horizontal",
                collapsed: !1,
                gridProps: {
                    cols: 1,
                    xGap: 15
                },
                showActionButtonGroup: !1
            });
            function m(e) {
                e.drillTimeFrom = [
                    e.exerciseStartTime ?? "",
                    e.exerciseStopTime ?? ""
                ], t(e);
            }
            function c() {
                let e = n();
                return e.drillTimeFrom && e.drillTimeFrom.length > 0 && (e.exerciseStartTime = e.drillTimeFrom[0] || "", e.exerciseStopTime = e.drillTimeFrom[1] || ""), delete e.drillTimeFrom, e;
            }
            return (e, x)=>{
                const p = u;
                return F(), h(p, {
                    onRegister: T(i),
                    "label-placement": "top",
                    showTitleBorder: !0,
                    class: "tableStyle"
                }, null, 8, [
                    "onRegister"
                ]);
            };
        }
    });
});
export { R as _, __tla };
