import { _ as A, __tla as __tla_0 } from "./CustomCard.vue_vue_type_script_setup_true_lang-374ERk20.js";
import { _ as D } from "./CustomTable.vue_vue_type_script_setup_true_lang-CVzOsXR0.js";
import { u as O } from "./useECharts-XZ1IwN24.js";
import { c as F } from "./columns-1dSLzo5A.js";
import { e as N, f as z } from "./workbench-DEgqNpqd.js";
import { d as L, e as W, bk as $, r as s, ay as d, l as t, ac as h, c as f, o as p, w as G, D as C, h as H, __tla as __tla_1 } from "./index-9PRMimni.js";
import "./BasicForm-dL_oCSPM.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 "./useForm-CKmgcynv.js";
import "./usePageCache-DluHn7Yy.js";
import "./Flex-CTSf12gq.js";
import "./useTimeout-BxFilWvD.js";
import "./tslib.es6-CSJU3tT9.js";
import "./index-DatBjkM3.js";
import "./dateUtil-BtafrT1f.js";
import "./format-DgF6KtHk.js";
import "./helper-D9DF1oLX.js";
import "./find-D_h_aJYR.js";
import "./findIndex-BgUIH3i1.js";
import "./toInteger-DQeH-nF-.js";
import "./includes-DdMWPj0t.js";
let xe;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })()
]).then(async ()=>{
    xe = L({
        __name: "CrewChangeStatus",
        props: {
            componentItem: {},
            isEditable: {
                type: Boolean
            },
            searchParams: {},
            refreshComponent: {
                type: Boolean
            },
            defaultCurrentComponent: {
                default: "chart"
            },
            defaultShowTransition: {
                type: Boolean,
                default: !0
            }
        },
        setup (w) {
            const o = w, m = W(), y = $(), c = s(), u = s(), { setOptions: g, disposeInstance: v, resizeFn: b, getInstance: _ } = O(u), i = s({
                day: 60
            }), a = s(o.defaultCurrentComponent), I = s(o.defaultShowTransition), { crewChangeStatusColumns: T } = F();
            d(()=>o.refreshComponent, (e)=>{
                e && l();
            }, {
                immediate: !0
            }), d(()=>o.isEditable, ()=>{
                a.value === "chart" && b();
            });
            function l() {
                a.value === "table" ? S(!0) : a.value === "chart" && k();
            }
            async function k() {
                const e = await N({
                    ...o.searchParams || {},
                    ...t(i) || {}
                }), n = (e || []).map((r)=>r?.[y.getLocale === "en" ? "vesselNameEn" : "vesselName"]), q = (e || []).map((r)=>r?.crewCount), E = {
                    tooltip: {
                        trigger: "axis",
                        axisPointer: {
                            type: "shadow"
                        }
                    },
                    xAxis: {
                        type: "category",
                        data: n
                    },
                    yAxis: {
                        type: "value",
                        minInterval: 1
                    },
                    grid: {
                        top: 30,
                        right: "6%"
                    },
                    dataZoom: [
                        {
                            type: "slider",
                            start: 10,
                            end: 90,
                            moveHandleSize: 10,
                            height: 20
                        }
                    ],
                    series: [
                        {
                            data: q,
                            type: "bar",
                            showBackground: !0,
                            barMaxWidth: 30
                        }
                    ]
                };
                h(()=>{
                    g(E), _()?.on("click", function(r) {
                        r.componentType === "series" && m.push({
                            name: "Onboard_list",
                            query: {
                                vesselId: (e || [])[r.dataIndex]?.vesselId
                            }
                        });
                    });
                });
            }
            function S(e) {
                h(()=>{
                    c.value?.handleGetData(e);
                });
            }
            function x(e) {
                return {
                    style: "cursor: pointer",
                    onClick: ()=>{
                        m.push({
                            name: "Crew_Detail",
                            query: {
                                id: e.seafarerId,
                                type: "view"
                            }
                        });
                    }
                };
            }
            function P() {
                const e = o.searchParams?.shipIds?.toString()?.split(",");
                let n = "";
                e?.length === 1 && (n = e[0]), m.push({
                    name: "Onboard_list",
                    query: {
                        vesselId: n
                    }
                });
            }
            function R(e) {
                i.value = e, l();
            }
            function B(e) {
                a.value = e, a.value === "chart" && v(), l();
            }
            return (e, n)=>(p(), f(A, {
                    componentItem: e.componentItem,
                    currentComponent: t(a),
                    cardParams: t(i),
                    showTransition: t(I),
                    onFilter: R,
                    onShowAll: P,
                    onTransition: B
                }, {
                    default: G(()=>[
                            t(a) === "table" ? (p(), f(D, {
                                key: 0,
                                ref_key: "basicTableRef",
                                ref: c,
                                columns: t(T),
                                request: t(z),
                                params: {
                                    ...e.searchParams || {},
                                    ...t(i) || {}
                                },
                                "row-props": x
                            }, null, 8, [
                                "columns",
                                "request",
                                "params"
                            ])) : C("", !0),
                            t(a) === "chart" ? (p(), H("div", {
                                key: 1,
                                ref_key: "chartRef",
                                ref: u,
                                class: "w-full h-full"
                            }, null, 512)) : C("", !0)
                        ]),
                    _: 1
                }, 8, [
                    "componentItem",
                    "currentComponent",
                    "cardParams",
                    "showTransition"
                ]));
        }
    });
});
export { xe as default, __tla };
