import { V as f, bk as h, Z as s, r as p, N as v, hk as b, ae as g, __tla as __tla_0 } from "./index-9PRMimni.js";
import { a1 as y, a4 as L } from "./template-rpthWlT9.js";
import { v as C, __tla as __tla_1 } from "./schemas-DzvLPsci.js";
import "./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";
import "./ImageUpload.vue_vue_type_style_index_0_scoped_cb086928_lang-D-28kXvw.js";
import "./vuedraggable.umd-Co2xEC3p.js";
import "./BasicUpload.vue_vue_type_style_index_0_scoped_a4d0e930_lang-DxRbtP01.js";
import "./BasicForm.vue_vue_type_style_index_0_scoped_b9e995ec_lang-CEvcLwxD.js";
import "./BasicSelect.vue_vue_type_style_index_0_scoped_772d51cc_lang-Brp6PjEU.js";
import "./index-DkvzUEqh.js";
import { __tla as __tla_2 } from "./index.vue_vue_type_style_index_0_scoped_b974e5ec_lang-_0QwzFKM.js";
import "./Table.vue_vue_type_style_index_0_scoped_7b9e6ece_lang-BoW2DV_e.js";
import "./print-CT_2hrjP.js";
import "./schemas-BmKi-UM9.js";
import { _ as m, a as I } from "./index.vue_vue_type_script_setup_true_lang-1Pz8a6-H.js";
import "./props-CLtNejQT.js";
let F, q;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_2;
        } catch  {}
    })()
]).then(async ()=>{
    const i = h(), { t: e } = f(), N = await y("crew_handover_status"), O = [
        {
            label: e("crew.contractStatus.toBeImproved"),
            value: 1,
            color: {
                color: "rgba(51, 153, 255, 0.1)",
                textColor: "#3993E2",
                borderColor: "#3993E2"
            }
        },
        {
            label: e("crew.contractStatus.alreadyImproved"),
            value: 0,
            color: {
                color: "rgba(66, 196, 178, 0.1)",
                textColor: "#42C4B2",
                borderColor: "#AAE1DB"
            }
        }
    ], E = await L();
    q = function(w) {
        const r = p(!1), a = {
            updateIsEdit: (t)=>{
                console.log("isEdit", t), r.value = t;
            }
        }, c = [
            {
                title: e("crew.crewList.no"),
                key: "",
                width: 60,
                render (t, o) {
                    return o + 1;
                }
            },
            {
                title: e("crew.crewList.rank"),
                key: "dutyIdOn",
                width: 120,
                render (t) {
                    return s(m, {
                        value: String(t.dutyId)
                    });
                }
            },
            {
                title: e("crew.crewList.disembarkingCrew"),
                key: i.locale === "en" ? "crewNameEnOff" : "crewNameOff",
                width: 200
            },
            {
                title: e("crew.crewList.disembarkingReason"),
                key: "downReasonId",
                width: 180,
                render (t) {
                    const o = i.getLocale, n = E.find((l)=>Number(l.value) === +t.downReasonId);
                    return o === "en" ? n?.labelEn : n?.label;
                }
            },
            {
                title: e("crew.crewList.disembarkingDate"),
                key: "disembarkationDate",
                width: 180
            },
            {
                title: e("crew.crewList.disembarkingPort"),
                key: "disembarkationPlace",
                width: 180
            },
            {
                title: e("crew.crewList.embarkingCrew"),
                key: i.locale === "en" ? "crewNameEnOn" : "crewNameOn",
                width: 180
            },
            {
                title: e("crew.crewList.embarkingDate"),
                key: "embarkationDate",
                width: 180
            },
            {
                title: e("crew.crewList.embarkingPort"),
                key: "embarkationPlace",
                width: 180
            },
            {
                title: e("crew.crewList.contractChange"),
                key: "crewPlanContractInfoVo",
                width: 160,
                render (t, o) {
                    const { contractPeriod: n } = t.crewPlanContractInfoVo || [], l = n ? 0 : 1, d = t.crewPlanContractInfoVo && O.find((k)=>+k.value === l), u = {
                        class: "cursor-pointer",
                        bordered: !1,
                        type: "info",
                        color: d?.color,
                        disabled: !t.seafarerIdOn,
                        onClick: ()=>{
                            t.seafarerIdOn && w(t, o);
                        }
                    };
                    return s(g, u, {
                        default: ()=>[
                                d?.label,
                                s(v, {
                                    component: b,
                                    size: 20,
                                    color: d?.color.textColor,
                                    class: "cursor-pointer ml-1"
                                })
                            ]
                    });
                }
            },
            {
                title: e("crew.crewList.remarks"),
                key: "remarks",
                width: 180
            }
        ];
        return {
            methods: a,
            addColumns: c
        };
    };
    F = ()=>({
            handoverColumns: [
                {
                    title: e("crew.crewList.no"),
                    key: "",
                    width: 60,
                    render (r, a) {
                        return a + 1;
                    }
                },
                {
                    title: e("crew.crewList.vesselName"),
                    key: "vesselId",
                    width: 200,
                    render (r) {
                        const a = C.find((c)=>c.id === r.vesselId);
                        return i.getLocale === "en" ? a?.shipNameEn : a?.shipName;
                    }
                },
                {
                    title: e("crew.crewList.rank"),
                    key: "dutyId",
                    width: 200,
                    render (r) {
                        return s(m, {
                            value: String(r.dutyId)
                        });
                    }
                },
                {
                    title: e("crew.crewList.handover"),
                    key: "seafarerNameDown",
                    width: 160,
                    render (r) {
                        return i.getLocale === "en" ? r?.seafarerNameEnOff : r?.seafarerNameOff;
                    }
                },
                {
                    title: e("crew.crewList.takeover"),
                    key: "seafarerNameOn",
                    width: 160
                },
                {
                    title: e("crew.crewList.supervisor"),
                    key: "supervisor",
                    width: 200
                },
                {
                    title: e("crew.crewList.handoverDate"),
                    key: "handoverDate",
                    width: 160
                },
                {
                    title: e("crew.crewList.status"),
                    key: "status",
                    width: 220,
                    fixed: "right",
                    render (r) {
                        return s(I, {
                            value: r.status,
                            dictItems: N
                        });
                    }
                }
            ]
        });
});
export { F as c, q as g, __tla };
