import { V as R, bk as I, d as H, e as M, f as P, r as g, ay as V, a as A, Z as W, gW as c, gX as u, aw as $, c as y, o as w, w as o, j as n, W as X, l as s, H as j, aI as z, p as Z, A as G, B as J, ca as K, X as Q, __tla as __tla_0 } from "./index-9PRMimni.js";
import { B as U } from "./BasicForm-dL_oCSPM.js";
import { b as Y, d as ee, __tla as __tla_1 } from "./requestRelief-CcHzVBoD.js";
import { a1 as te } from "./template-rpthWlT9.js";
import { B as ae } from "./Table-0PViRYCf.js";
import { _ as oe } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import "./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";
import { u as ne } from "./useForm-CKmgcynv.js";
import { __tla as __tla_2 } from "./index.vue_vue_type_style_index_0_scoped_b974e5ec_lang-_0QwzFKM.js";
import { H as se, __tla as __tla_3 } from "./index-8tHZJCCW.js";
import "./schemas-BmKi-UM9.js";
import "./props-CLtNejQT.js";
import "./Render.vue_vue_type_script_lang-DKUYY0Zw.js";
import "./SingleImageUpload-CNx4b9eC.js";
import "./ImageUpload.vue_vue_type_style_index_0_scoped_cb086928_lang-D-28kXvw.js";
import "./componentSetting-DVhNDBTO.js";
import "./ImageUpload-DUsnro3W.js";
import "./vuedraggable.umd-Co2xEC3p.js";
import "./BasicUpload.vue_vue_type_style_index_0_scoped_a4d0e930_lang-DxRbtP01.js";
import "./tabsView-BXskTdVh.js";
import "./BasicForm.vue_vue_type_style_index_0_scoped_b9e995ec_lang-CEvcLwxD.js";
import "./propTypes-CebMRUpe.js";
import "./BasicSelect-C_uwzMkE.js";
import "./BasicSelect.vue_vue_type_style_index_0_scoped_772d51cc_lang-Brp6PjEU.js";
import "./dictionary-BRse4lkf.js";
import "./index-DkvzUEqh.js";
import "./index-kKnqLkWM.js";
import "./AutoComplete-Dv1Bqed4.js";
import "./TreeSelect-BZh2DeCh.js";
import "./illnessInjury-CN3bQPcI.js";
import "./Table.vue_vue_type_style_index_0_scoped_7b9e6ece_lang-BoW2DV_e.js";
import "./componentMap-CElCaWis.js";
import "./format-DgF6KtHk.js";
import "./omit-B2_8Y6O_.js";
import "./_flatRest-DBrd2CHT.js";
import "./flatten-DeoUZLdb.js";
import "./print-CT_2hrjP.js";
import "./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";
import "./useModal-CO65vga3.js";
import "./useTimeout-BxFilWvD.js";
import "./usePageCache-DluHn7Yy.js";
import "./Flex-CTSf12gq.js";
import "./jobOrder-CGbsc7bp.js";
import "./has-CjqcrIOV.js";
import "./TimelineItem-Bkds7ZW8.js";
let Ye;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_2;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_3;
        } catch  {}
    })()
]).then(async ()=>{
    let r, p, ie, re;
    ({ t: r } = R());
    p = I();
    ie = await te("crew_request_relief_status");
    re = ()=>({
            tableColumns: [
                {
                    title: r("requestRelief.no"),
                    key: "no",
                    width: 60,
                    render (t, i) {
                        return i + 1;
                    }
                },
                {
                    title: r("requestRelief.crewName"),
                    key: p.getLocale === "en" ? "seafarerNameEn" : "seafarerName",
                    width: 120
                },
                {
                    title: r("requestRelief.rank"),
                    key: p.getLocale === "en" ? "rankShortNameEn" : "rankName",
                    width: 120
                },
                {
                    title: r("requestRelief.vessel"),
                    key: p.getLocale === "en" ? "shipNameEn" : "shipName",
                    width: 120
                },
                {
                    title: r("requestRelief.onLeavePeroid"),
                    key: "onLeavePeroid",
                    width: 200,
                    render: (t)=>(t.startOnLeaveDate || t.endOnLeaveDate) && `${t.startOnLeaveDate || ""} - ${t.endOnLeaveDate || ""}`
                },
                {
                    title: r("requestRelief.applicationDate"),
                    key: "applicationDate",
                    width: 120
                },
                {
                    title: r("requestRelief.status"),
                    key: "status",
                    width: 120,
                    render: (t)=>{
                        const i = ie.find((d)=>d.value === t.status);
                        return p.getLocale === "en" ? i?.labelEn : i?.label;
                    }
                }
            ]
        });
    Ye = H({
        __name: "index",
        setup (k) {
            const { t } = R(), i = M(), d = P(), b = g(), { tableColumns: C } = re(), { tableSchemas: D } = Y(), [L, { getFieldsValue: q }] = ne({
                gridProps: {
                    cols: 12
                },
                schemas: D,
                showAdvancedButton: !1
            }), f = g();
            V(()=>d.path, (e, a)=>{
                e.includes("/crew/requestRelief") && m();
            });
            const x = A({
                width: 130,
                title: t("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (e) {
                    return W(oe, {
                        style: "text",
                        actions: [
                            {
                                label: t("common.optionsViewText"),
                                labelShow: !1,
                                icon: c(u.view, "text-[#3F7AE9]"),
                                onClick: h.bind(null, e, "view")
                            },
                            {
                                ifShow: ()=>e.status === "1" || e.status === "6",
                                label: t("common.optionsEditText"),
                                labelShow: !1,
                                icon: c(u.edit, "text-[#3F7AE9]"),
                                onClick: h.bind(null, e, "edit")
                            },
                            {
                                label: t("common.reviewHistory"),
                                labelShow: !1,
                                icon: c(u.log, "text-[#xe628] text-[14px]"),
                                onClick: ()=>{
                                    b.value.handleOpenModal({
                                        busId: e?.id,
                                        moduleCode: e?.moduleCode,
                                        shipId: e?.vesselId,
                                        subModuleCode: ""
                                    });
                                }
                            }
                        ]
                    });
                }
            });
            function m() {
                console.log("basicTableRef.value", f.value), f.value.reload();
            }
            function T() {
                i.push({
                    name: "addRequestRelief",
                    query: {
                        type: "add"
                    }
                });
            }
            function h(e, a) {
                const l = {};
                e.id && (l.id = e.id, l.type = a), i.push({
                    name: "addRequestRelief",
                    query: l
                });
            }
            async function S(e) {
                const a = q();
                return await ee({
                    ...e,
                    ...a,
                    endOnLeaveDate: a?.startOnLeaveDate ? a?.startOnLeaveDate[1] : void 0,
                    startOnLeaveDate: a?.startOnLeaveDate ? a?.startOnLeaveDate[0] : void 0
                });
            }
            function O() {
                m();
            }
            return $(()=>{
                O();
            }), (e, a)=>{
                const l = U, v = X, B = J, N = z, F = j, E = Q;
                return w(), y(E, null, {
                    default: o(()=>[
                            n(v, {
                                bordered: !1,
                                class: "mb-3 proCard"
                            }, {
                                default: o(()=>[
                                        n(l, {
                                            onRegister: s(L),
                                            onSubmit: m,
                                            onReset: m
                                        }, null, 8, [
                                            "onRegister"
                                        ])
                                    ]),
                                _: 1
                            }),
                            n(v, {
                                bordered: !1,
                                class: "proCard"
                            }, {
                                default: o(()=>[
                                        n(s(ae), {
                                            ref_key: "basicTableRef",
                                            ref: f,
                                            columns: s(C),
                                            request: (_)=>S(_),
                                            "row-key": (_)=>_.id,
                                            autoScrollX: !0,
                                            actionColumn: s(x),
                                            immediate: !1,
                                            "virtual-scroll": ""
                                        }, {
                                            tableTitle: o(()=>[
                                                    n(F, null, {
                                                        default: o(()=>[
                                                                n(N, {
                                                                    trigger: "hover"
                                                                }, {
                                                                    trigger: o(()=>[
                                                                            n(B, {
                                                                                type: "primary",
                                                                                strong: "",
                                                                                bordered: "",
                                                                                secondary: "",
                                                                                class: "size-7",
                                                                                onClick: T
                                                                            }, {
                                                                                icon: o(()=>[
                                                                                        (w(), y(K(s(c)(s(u).add))))
                                                                                    ]),
                                                                                _: 1
                                                                            })
                                                                        ]),
                                                                    default: o(()=>[
                                                                            Z(" " + G(s(t)("common.addText")), 1)
                                                                        ]),
                                                                    _: 1
                                                                })
                                                            ]),
                                                        _: 1
                                                    })
                                                ]),
                                            _: 1
                                        }, 8, [
                                            "columns",
                                            "request",
                                            "row-key",
                                            "actionColumn"
                                        ])
                                    ]),
                                _: 1
                            }),
                            n(s(se), {
                                ref_key: "approvalHistoryModal",
                                ref: b
                            }, null, 512)
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { Ye as default, __tla };
