import { _ as M, __tla as __tla_0 } from "./CustomCard.vue_vue_type_script_setup_true_lang-374ERk20.js";
import { _ as V } from "./CustomTable.vue_vue_type_script_setup_true_lang-CVzOsXR0.js";
import { u as j } from "./useECharts-XZ1IwN24.js";
import { c as z } from "./columns-1dSLzo5A.js";
import { b as L, c as $ } from "./workbench-DEgqNpqd.js";
import { d as x, dW as A, bk as O, e as W, V as G, r as c, ay as b, l as o, ac as y, c as C, o as p, w as H, D as I, h as U, __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 Fe;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })()
]).then(async ()=>{
    Fe = x({
        __name: "NoticeFeedbackStatus",
        props: {
            componentItem: {},
            isEditable: {
                type: Boolean
            },
            searchParams: {},
            refreshComponent: {
                type: Boolean
            },
            defaultCardParams: {},
            useSource: {}
        },
        setup (S) {
            const t = S, l = A(), k = O(), s = W(), { t: _ } = G(), u = c(), d = c(), { setOptions: v, getInstance: T, disposeInstance: N, resizeFn: P } = j(d), a = c("chart"), { noticeFeedbackStatusColumns: g } = z(), i = c(t.defaultCardParams || {});
            b(()=>t.refreshComponent, (e)=>{
                e && m();
            }, {
                immediate: !0
            }), b(()=>t.isEditable, ()=>{
                a.value === "chart" && P();
            });
            function m() {
                a.value === "table" ? R(!0) : a.value === "chart" && w();
            }
            async function w() {
                const n = (await L({
                    ...t.searchParams || {},
                    ...i.value || {},
                    noticeTypeCode: "notice"
                }) || []).map((r)=>({
                        value: Number(r.amount || 0),
                        name: k.getLocale === "en" ? r?.statusNameEn : r?.statusName,
                        status: r.status,
                        label: {
                            show: +r.status == 1
                        }
                    })), E = {
                    tooltip: {
                        trigger: "item"
                    },
                    legend: {
                        bottom: 0,
                        left: "center"
                    },
                    series: [
                        {
                            type: "pie",
                            radius: [
                                "45%",
                                "60%"
                            ],
                            top: "-8%",
                            label: {
                                formatter: `{percent|{d}%} 
 {title|${_("dashboard.workbench.readPercent")}}`,
                                position: "center",
                                rich: {
                                    percent: {
                                        color: o(l)?.textColor1,
                                        fontSize: 26
                                    },
                                    title: {
                                        color: o(l)?.textColor3,
                                        fontSize: 14,
                                        lineHeight: 30
                                    }
                                }
                            },
                            data: n
                        }
                    ]
                };
                await y(), v(E), T()?.on("click", function(r) {
                    const h = t.searchParams?.shipIds?.toString()?.split(",");
                    let f = "";
                    h?.length === 1 && (f = h[0]), t.componentItem?.componentName === "MyDispatchNotice" ? s.push({
                        name: "notice_received",
                        query: {
                            tab: "vessel",
                            isByMySelf: "1",
                            noticeTypeCode: "notice",
                            feedbackNoticeStatus: r?.data?.status,
                            shipId: f
                        }
                    }) : s.push({
                        name: "notice_dispatched",
                        query: {
                            noticeCompletionStatus: r?.data?.status,
                            noticeTypeCode: "notice"
                        }
                    });
                });
            }
            function R(e) {
                y(()=>{
                    u.value?.handleGetData(e);
                });
            }
            function q(e) {
                i.value = e, m();
            }
            function F(e) {
                a.value = e, a.value === "chart" && N(), m();
            }
            function B(e) {
                return {
                    style: "cursor: pointer",
                    onClick: ()=>{
                        t.componentItem?.componentName === "MyDispatchNotice" ? s.push({
                            name: "noticeCircular_feedback",
                            query: {
                                id: e.noticeInfoId,
                                noticeUserId: e.id,
                                type: e.isFeedback,
                                objectId: e.objectId,
                                isView: "1"
                            }
                        }) : s.push({
                            name: "noticeCircular_detail",
                            query: {
                                id: e.noticeInfoId,
                                type: "view"
                            }
                        });
                    }
                };
            }
            function D() {
                const e = t.searchParams?.shipIds?.toString()?.split(",");
                let n = "";
                e?.length === 1 && (n = e[0]), t.componentItem?.componentName === "MyDispatchNotice" ? s.push({
                    name: "notice_received",
                    query: {
                        tab: "vessel",
                        isByMySelf: "1",
                        noticeTypeCode: "notice",
                        shipId: n
                    }
                }) : s.push({
                    name: "notice_dispatched",
                    query: {
                        noticeTypeCode: "notice"
                    }
                });
            }
            return (e, n)=>(p(), C(M, {
                    componentItem: e.componentItem,
                    currentComponent: o(a),
                    cardParams: o(i),
                    useSource: e.useSource,
                    onFilter: q,
                    onShowAll: D,
                    onTransition: F
                }, {
                    default: H(()=>[
                            o(a) === "table" ? (p(), C(V, {
                                key: 0,
                                ref_key: "basicTableRef",
                                ref: u,
                                columns: o(g),
                                request: o($),
                                params: {
                                    ...e.searchParams || {},
                                    ...o(i) || {},
                                    objectId: e.searchParams?.shipIds,
                                    noticeTypeCode: "notice"
                                },
                                "row-props": B
                            }, null, 8, [
                                "columns",
                                "request",
                                "params"
                            ])) : I("", !0),
                            o(a) === "chart" ? (p(), U("div", {
                                key: 1,
                                ref_key: "chartRef",
                                ref: d,
                                class: "w-full h-full"
                            }, null, 512)) : I("", !0)
                        ]),
                    _: 1
                }, 8, [
                    "componentItem",
                    "currentComponent",
                    "cardParams",
                    "useSource"
                ]));
        }
    });
});
export { Fe as default, __tla };
