import { V as y, bk as L, Z as m, B as I, aI as C, d as E, f as T, r as b, aw as B, c as F, o as R, w as d, j as p, W, l as w, X as x, __tla as __tla_0 } from "./index-9PRMimni.js";
import { d as V, e as $ } from "./index-CKrxNOjs.js";
import { B as A } from "./BasicForm-dL_oCSPM.js";
import { u as M } from "./useForm-CKmgcynv.js";
import { B as q } from "./Table-0PViRYCf.js";
import { v as X, __tla as __tla_1 } from "./schemas-DzvLPsci.js";
import { _ as j } from "./template-rpthWlT9.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 z } from "./index.vue_vue_type_script_setup_true_lang-1Pz8a6-H.js";
import "./props-CLtNejQT.js";
import "./Render.vue_vue_type_script_lang-DKUYY0Zw.js";
import "./SingleImageUpload-CNx4b9eC.js";
import "./ImageUpload-DUsnro3W.js";
import "./componentSetting-DVhNDBTO.js";
import "./tabsView-BXskTdVh.js";
import "./BasicSelect-C_uwzMkE.js";
import "./dictionary-BRse4lkf.js";
import "./AutoComplete-Dv1Bqed4.js";
import "./TreeSelect-BZh2DeCh.js";
import "./usePageCache-DluHn7Yy.js";
import "./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";
import "./useModal-CO65vga3.js";
import "./useTimeout-BxFilWvD.js";
import "./Flex-CTSf12gq.js";
import "./isEmpty-BUg1OsQj.js";
import "./index-kKnqLkWM.js";
import "./propTypes-CebMRUpe.js";
import "./jobOrder-CGbsc7bp.js";
import "./has-CjqcrIOV.js";
import "./componentMap-CElCaWis.js";
import "./format-DgF6KtHk.js";
import "./omit-B2_8Y6O_.js";
import "./_flatRest-DBrd2CHT.js";
import "./flatten-DeoUZLdb.js";
let $e;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_2;
        } catch  {}
    })()
]).then(async ()=>{
    await j();
    let Z, o, G, f, r, H;
    Z = L();
    ({ t: o } = y());
    G = ()=>({
            onboardSchemas: [
                {
                    field: "vesselId",
                    component: "NSelect",
                    label: o("crew.crewList.vesselName"),
                    labelWidth: 100,
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        placeholder: o("crew.crewList.vesselName"),
                        options: X,
                        labelField: Z.getLocale === "en" ? "shipNameEn" : "shipName",
                        valueField: "id",
                        filterable: !0,
                        clearable: !0
                    }
                },
                {
                    field: "crewName",
                    component: "NInput",
                    label: o("crew.crewList.crewName"),
                    labelWidth: 100,
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        placeholder: o("crew.crewList.crewName")
                    }
                },
                {
                    field: "empNo",
                    component: "NInput",
                    label: o("crew.crewList.empNo"),
                    labelWidth: 80,
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        placeholder: o("crew.crewList.empNo")
                    }
                },
                {
                    field: "signOnDate",
                    component: "NDatePicker",
                    label: o("crew.crewList.signOn"),
                    labelWidth: 30,
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        valueFormat: "yyyy-MM-dd",
                        type: "daterange",
                        placeholder: o("crew.crewList.signOn")
                    }
                },
                {
                    field: "plannedSignOffDate",
                    component: "NDatePicker",
                    label: o("crew.crewList.signOffPlanned"),
                    labelWidth: 30,
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        valueFormat: "yyyy-MM-dd",
                        type: "daterange",
                        placeholder: o("crew.crewList.signOffPlanned")
                    }
                }
            ]
        });
    f = L();
    ({ t: r } = y());
    H = ()=>({
            onboardColumns: [
                {
                    type: "selection",
                    width: 60,
                    key: "selection",
                    fixed: "left"
                },
                {
                    title: r("crew.crewList.no"),
                    key: "",
                    width: 60,
                    render (e, n) {
                        return n + 1;
                    }
                },
                {
                    title: r("crew.crewList.vesselName"),
                    key: "vesselId",
                    width: 160,
                    render: (e)=>f.getLocale === "en" ? e.vesselNameEn : e.vesselName
                },
                {
                    title: r("crew.crewList.rank"),
                    key: "rankId",
                    width: 160,
                    render: (e)=>m(z, {
                            value: String(e.rankId)
                        })
                },
                {
                    title: r("crew.crewList.chineseName"),
                    key: "crewName",
                    width: 160
                },
                {
                    title: r("crew.crewList.englishName"),
                    key: "crewNameEn",
                    width: 160
                },
                {
                    title: r("crew.crewList.empNo"),
                    key: "empNo",
                    width: 160
                },
                {
                    title: r("crew.crewList.nationality"),
                    key: "nationalId",
                    width: 160,
                    render: (e)=>f.getLocale === "en" ? e.nationalNameEn : e.nationalName
                },
                {
                    title: r("crew.crewList.tel"),
                    key: "personalTel",
                    width: 160
                },
                {
                    title: r("crew.crewList.signOn"),
                    key: "signOnDate",
                    width: 160
                },
                {
                    title: r("crew.crewList.onboardTime"),
                    key: "onboardTime",
                    width: 160
                },
                {
                    title: r("crew.crewList.signOffPlanned"),
                    key: "plannedSignOffDate",
                    width: 200
                },
                {
                    title: r("crew.crewList.manningAgent"),
                    key: "manningAgentId",
                    width: 160,
                    render: (e)=>f.getLocale === "en" ? e.manningAgentNameEn : e.manningAgentName
                },
                {
                    title: r("crew.crewList.contractSignOffDate"),
                    key: "contractSignOffDate",
                    width: 180
                },
                {
                    title: r("crew.crewList.warn"),
                    key: "crewSeafarerCertificateInfoVoList",
                    width: 130,
                    render: function(e) {
                        return e.crewSeafarerCertificateInfoVoList?.length ? m(C, {
                            trigger: "hover"
                        }, {
                            trigger: ()=>m(I, {
                                    size: "small",
                                    style: "text",
                                    bordered: !1,
                                    secondary: !0,
                                    class: "bg-transparent",
                                    tag: "a",
                                    type: "primary"
                                }, e.crewSeafarerCertificateInfoVoList?.length),
                            default: ()=>{
                                let n = "";
                                return e.crewSeafarerCertificateInfoVoList?.forEach((s)=>{
                                    f.getLocale === "en" ? n += `${s.englishName};
` : n += `${s.chineseName};
`;
                                }), m("pre", n);
                            }
                        }) : 0;
                    }
                }
            ]
        });
    $e = E({
        __name: "index",
        setup (g) {
            let e = 1;
            const n = T(), { onboardSchemas: s } = G(), { onboardColumns: _ } = H(), [S, { getFieldsValue: N }] = M({
                gridProps: {
                    cols: 6
                },
                schemas: s,
                showAdvancedButton: !1
            }), h = b(), k = b(0);
            async function v(t) {
                const a = D(N());
                return await V({
                    tab: k.value,
                    ...t,
                    ...a
                });
            }
            function D(t) {
                return {
                    ...t,
                    onStartDate: t.onStartDate ? t.onStartDate[0] : void 0,
                    onEndDate: t.onStartDate ? t.onStartDate[1] : void 0,
                    offStartDate: t.onStartDate ? t.offStartDate[0] : void 0,
                    offEndDate: t.onStartDate ? t.offStartDate[1] : void 0,
                    alertStatus: n.query?.alertStatus && e++ === 1 ? +n.query?.alertStatus : void 0
                };
            }
            function l() {
                h.value.reload();
            }
            async function P({ record: t, index: a, key: i, value: c }) {
                console.log("edit-record", t), console.log("edit-index", a), console.log("edit-key", i), console.log("edit-value", c), await $({
                    id: t.id,
                    remark: c
                }), l();
            }
            function O() {
                l();
            }
            return B(()=>{
                O();
            }), (t, a)=>{
                const i = W, c = x;
                return R(), F(c, null, {
                    default: d(()=>[
                            p(i, {
                                bordered: !1,
                                class: "mb-3 proCard"
                            }, {
                                default: d(()=>[
                                        p(w(A), {
                                            onRegister: w(S),
                                            onSubmit: l,
                                            onReset: l
                                        }, null, 8, [
                                            "onRegister"
                                        ])
                                    ]),
                                _: 1
                            }),
                            p(i, {
                                bordered: !1,
                                class: "proCard"
                            }, {
                                default: d(()=>[
                                        p(w(q), {
                                            ref_key: "basicTableRef",
                                            ref: h,
                                            columns: w(_),
                                            request: (u)=>v(u),
                                            "row-key": (u)=>u.id,
                                            autoScrollX: !0,
                                            immediate: !1,
                                            "virtual-scroll": "",
                                            onEditEnd: P
                                        }, {
                                            tableTitle: d(()=>a[0] || (a[0] = [])),
                                            _: 1
                                        }, 8, [
                                            "columns",
                                            "request",
                                            "row-key"
                                        ])
                                    ]),
                                _: 1
                            })
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { $e as default, __tla };
