import { V as d, bk as h, hc as F, d as B, e as R, b as L, r as $, a as A, Z as p, c as I, o as M, w as t, j as a, W as q, l as i, H as E, aI as W, p as J, A as X, B as j, i as z, X as H, __tla as __tla_0 } from "./index-9PRMimni.js";
import { B as U } from "./Table-0PViRYCf.js";
import { _ as Z } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import { B as G } from "./BasicForm-dL_oCSPM.js";
import { u as K } from "./useForm-CKmgcynv.js";
import { g as Q } from "./VoyagePlanOffice-CE0uFEw0.js";
import "./Table.vue_vue_type_style_index_0_scoped_7b9e6ece_lang-BoW2DV_e.js";
import "./vuedraggable.umd-Co2xEC3p.js";
import "./Render.vue_vue_type_script_lang-DKUYY0Zw.js";
import "./componentMap-CElCaWis.js";
import "./propTypes-CebMRUpe.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 "./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";
import "./useModal-CO65vga3.js";
import "./componentSetting-DVhNDBTO.js";
import "./useTimeout-BxFilWvD.js";
import "./usePageCache-DluHn7Yy.js";
import "./tabsView-BXskTdVh.js";
import "./Flex-CTSf12gq.js";
import "./SingleImageUpload-CNx4b9eC.js";
import "./ImageUpload.vue_vue_type_style_index_0_scoped_cb086928_lang-D-28kXvw.js";
import "./ImageUpload-DUsnro3W.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-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";
let qe;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })()
]).then(async ()=>{
    let Y, n, ee, te, u, c, oe, ae;
    Y = h();
    ({ t: n } = d());
    ee = ()=>({
            columns: [
                {
                    title: n("pms.VoyagePlanOffice.vessel"),
                    key: "vesselName",
                    width: 140,
                    render: (s)=>Y.getLocale === "en" ? s?.vesselNameEn : s?.vesselName || ""
                },
                {
                    title: n("pms.VoyagePlanOffice.voyageNo"),
                    key: "voyageNo",
                    width: 140
                },
                {
                    title: n("pms.VoyagePlanOffice.departurePort"),
                    key: "departurePort",
                    width: 140
                },
                {
                    title: n("pms.VoyagePlanOffice.departureDateTime"),
                    key: "departureDateTime",
                    width: 160
                },
                {
                    title: n("pms.VoyagePlanOffice.arrivalPort"),
                    key: "arrivalPort",
                    width: 140
                },
                {
                    title: n("pms.VoyagePlanOffice.arrivalDateTime"),
                    key: "arrivalDateTime",
                    width: 160
                },
                {
                    title: n("pms.VoyagePlanOffice.distanceTravelled"),
                    key: "distanceTravelled",
                    width: 120
                }
            ]
        });
    te = h();
    ({ t: u } = d());
    c = await F();
    oe = c && c.length > 0 ? c[0].id : "";
    ae = ()=>({
            schemas: [
                {
                    field: "vessel",
                    component: "NSelect",
                    label: u("pms.unplannedJobList.vessel"),
                    componentProps: {
                        options: c,
                        defaultValue: oe,
                        clearable: !1,
                        filterable: !0,
                        "label-field": te.getLocale === "en" ? "shipNameEn" : "shipName",
                        "value-field": "id"
                    }
                },
                {
                    field: "OriginDateTimeFrom",
                    component: "NDatePicker",
                    label: u("pms.VoyagePlanOffice.OriginDateTimeFrom"),
                    componentProps: {
                        type: "daterange",
                        valueFormat: "yyyy-MM-dd"
                    }
                },
                {
                    field: "ArrivalDateTimeFrom",
                    component: "NDatePicker",
                    label: u("pms.VoyagePlanOffice.ArrivalDateTimeFrom"),
                    componentProps: {
                        type: "daterange",
                        valueFormat: "yyyy-MM-dd"
                    }
                }
            ]
        });
    qe = B({
        __name: "index",
        setup (f) {
            const s = R(), { t: r } = d(), { shipList: _ } = L();
            async function v() {
                g();
            }
            function P() {
                g();
            }
            function g() {
                y.value.restReload();
            }
            const y = $(), T = A({
                width: 150,
                title: r("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (o) {
                    return p(Z, {
                        style: "text",
                        actions: [
                            {
                                label: r("common.optionsEditText"),
                                labelShow: !1,
                                icon: p("i", {
                                    class: "iconfont icon-a-Frame28"
                                }),
                                onClick: ()=>m("edit", o)
                            },
                            {
                                label: r("common.optionsViewText"),
                                labelShow: !1,
                                icon: p("i", {
                                    class: "iconfont icon-View blue"
                                }),
                                onClick: ()=>m("view", o)
                            }
                        ]
                    });
                }
            });
            function m(o, e) {
                s.push({
                    name: "VoyagePlanOfficeDetail",
                    query: {
                        status: o,
                        id: e?.id,
                        shipId: e?.shipId || _[0]?.id
                    }
                });
            }
            async function V(o, e) {
                return Q({
                    vessel: e.vessel || _[0]?.id,
                    ...o,
                    ...e
                });
            }
            const { columns: k } = ee(), { schemas: w } = ae(), [D, { getFieldsValue: O }] = K({
                gridProps: {
                    cols: 6
                },
                schemas: w
            });
            return (o, e)=>{
                const b = q, S = j, N = W, x = E, C = H;
                return M(), I(C, null, {
                    default: t(()=>[
                            a(b, {
                                bordered: !1,
                                class: "proCard mb-3"
                            }, {
                                default: t(()=>[
                                        a(i(G), {
                                            onRegister: i(D),
                                            onSubmit: v,
                                            onReset: P
                                        }, null, 8, [
                                            "onRegister"
                                        ])
                                    ]),
                                _: 1
                            }),
                            a(b, {
                                bordered: !1,
                                class: "proCard mt-2"
                            }, {
                                default: t(()=>[
                                        a(i(U), {
                                            columns: i(k),
                                            request: (l)=>V(l, i(O)()),
                                            "row-key": (l)=>l.id,
                                            ref_key: "basicTableRef",
                                            ref: y,
                                            autoScrollX: !0,
                                            "virtual-scroll": "",
                                            actionColumn: i(T)
                                        }, {
                                            tableTitle: t(()=>[
                                                    a(x, null, {
                                                        default: t(()=>[
                                                                a(N, {
                                                                    trigger: "hover"
                                                                }, {
                                                                    trigger: t(()=>[
                                                                            a(S, {
                                                                                type: "primary",
                                                                                strong: "",
                                                                                bordered: "",
                                                                                secondary: "",
                                                                                class: "size-7",
                                                                                onClick: e[0] || (e[0] = (l)=>m("add"))
                                                                            }, {
                                                                                icon: t(()=>e[1] || (e[1] = [
                                                                                        z("i", {
                                                                                            class: "iconfont icon-ADD"
                                                                                        }, null, -1)
                                                                                    ])),
                                                                                _: 1
                                                                            })
                                                                        ]),
                                                                    default: t(()=>[
                                                                            J(" " + X(i(r)("common.addText")), 1)
                                                                        ]),
                                                                    _: 1
                                                                })
                                                            ]),
                                                        _: 1
                                                    })
                                                ]),
                                            _: 1
                                        }, 8, [
                                            "columns",
                                            "request",
                                            "row-key",
                                            "actionColumn"
                                        ])
                                    ]),
                                _: 1
                            })
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { qe as default, __tla };
