import { _ as j, __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 J } from "./useECharts-XZ1IwN24.js";
import { c as N } from "./columns-1dSLzo5A.js";
import { y as F, w as M } from "./workbench-DEgqNpqd.js";
import { d as W, dW as A, bk as O, e as $, r as i, ay as b, l as o, ac as C, c as w, o as u, w as z, D as y, h as G, __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 xt;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })()
]).then(async ()=>{
    xt = W({
        __name: "VesselJobStatus",
        props: {
            componentItem: {},
            isEditable: {
                type: Boolean
            },
            searchParams: {},
            refreshComponent: {
                type: Boolean
            },
            defaultCurrentComponent: {
                default: "chart"
            },
            defaultShowTransition: {
                type: Boolean,
                default: !0
            }
        },
        setup (P) {
            const n = P, S = A(), _ = O(), m = $(), h = i(), f = i(), { setOptions: T, getInstance: d, disposeInstance: I, resizeFn: R } = J(f), l = i(), a = i(n.defaultCurrentComponent), g = i(n.defaultShowTransition), { vesselJobStatusColumns: k } = N();
            b(()=>n.refreshComponent, (t)=>{
                t && p();
            }, {
                immediate: !0
            }), b(()=>n.isEditable, ()=>{
                a.value === "chart" && R();
            });
            function p() {
                a.value === "table" ? L(!0) : a.value === "chart" && v();
            }
            async function v() {
                const s = (await F({
                    ...n.searchParams || {},
                    ...l.value || {}
                }) || []).map((e)=>({
                        value: Number(e?.amount || 0),
                        status: e?.status,
                        name: _.getLocale === "en" ? e?.statusNameEn : e?.statusName
                    })), E = {
                    legend: {
                        bottom: 0,
                        left: "center"
                    },
                    series: [
                        {
                            type: "pie",
                            radius: "60%",
                            top: "-8%",
                            label: {
                                formatter: `{name|{b}： {c}}
{percent|{d}%}`,
                                minMargin: 5,
                                lineHeight: 25,
                                rich: {
                                    percent: {
                                        color: o(S)?.textColor3
                                    }
                                }
                            },
                            labelLayout: function(e) {
                                const c = e.labelRect.x < (d()?.getWidth() || 0) / 2, r = e.labelLinePoints;
                                return r && (r[2][0] = c ? e.labelRect.x : e.labelRect.x + e.labelRect.width), {
                                    labelLinePoints: r
                                };
                            },
                            data: s
                        }
                    ]
                };
                await C(), T(E), d()?.on("click", function(e) {
                    const c = n.searchParams?.shipIds?.toString()?.split(",");
                    let r = "";
                    c?.length === 1 && (r = c[0]), m.push({
                        name: "PMS_jobPlan",
                        query: {
                            jobStatus: e?.data?.status,
                            shipId: r
                        }
                    });
                });
            }
            function L(t) {
                C(()=>{
                    h.value?.handleGetData(t);
                });
            }
            function x(t) {
                l.value = t, p();
            }
            function B(t) {
                a.value = t, a.value === "chart" && I(), p();
            }
            function V(t) {
                return {
                    style: "cursor: pointer",
                    onClick: ()=>{
                        m.push({
                            name: "jobPlanDetails",
                            query: {
                                id: t.planId
                            }
                        });
                    }
                };
            }
            function q() {
                const t = n.searchParams?.shipIds?.toString()?.split(",");
                let s = "";
                t?.length === 1 && (s = t[0]), m.push({
                    name: "PMS_jobPlan",
                    query: {
                        shipId: s
                    }
                });
            }
            return (t, s)=>(u(), w(j, {
                    componentItem: t.componentItem,
                    currentComponent: o(a),
                    showTransition: o(g),
                    cardParams: o(l),
                    onFilter: x,
                    onShowAll: q,
                    onTransition: B
                }, {
                    default: z(()=>[
                            o(a) === "table" ? (u(), w(D, {
                                key: 0,
                                ref_key: "basicTableRef",
                                ref: h,
                                columns: o(k),
                                request: o(M),
                                params: {
                                    ...o(l) || {},
                                    ...t.searchParams || {}
                                },
                                "row-props": V
                            }, null, 8, [
                                "columns",
                                "request",
                                "params"
                            ])) : y("", !0),
                            o(a) === "chart" ? (u(), G("div", {
                                key: 1,
                                ref_key: "chartRef",
                                ref: f,
                                class: "w-full h-full"
                            }, null, 512)) : y("", !0)
                        ]),
                    _: 1
                }, 8, [
                    "componentItem",
                    "currentComponent",
                    "showTransition",
                    "cardParams"
                ]));
        }
    });
});
export { xt as default, __tla };
