const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DDYV1iAp.js","assets/index-9PRMimni.js","assets/index-CZ_CrH4_.css","assets/BasicForm-dL_oCSPM.js","assets/Render.vue_vue_type_script_lang-DKUYY0Zw.js","assets/SingleImageUpload-CNx4b9eC.js","assets/ImageUpload.vue_vue_type_style_index_0_scoped_cb086928_lang-D-28kXvw.js","assets/componentSetting-DVhNDBTO.js","assets/ImageUpload-2O79x_Q-.css","assets/ImageUpload-DUsnro3W.js","assets/vuedraggable.umd-Co2xEC3p.js","assets/BasicUpload.vue_vue_type_style_index_0_scoped_a4d0e930_lang-DxRbtP01.js","assets/BasicUpload-q2aOClOy.css","assets/tabsView-BXskTdVh.js","assets/BasicForm.vue_vue_type_style_index_0_scoped_b9e995ec_lang-CEvcLwxD.js","assets/propTypes-CebMRUpe.js","assets/BasicForm-foIylFd_.css","assets/BasicSelect-C_uwzMkE.js","assets/BasicSelect.vue_vue_type_style_index_0_scoped_772d51cc_lang-Brp6PjEU.js","assets/BasicSelect-DteQK1Vf.css","assets/dictionary-BRse4lkf.js","assets/index-DkvzUEqh.js","assets/index-kKnqLkWM.js","assets/AutoComplete-Dv1Bqed4.js","assets/TreeSelect-BZh2DeCh.js","assets/template-rpthWlT9.js","assets/useForm-CKmgcynv.js","assets/usePageCache-DluHn7Yy.js","assets/index-B6zl16ib.js","assets/Table-0PViRYCf.js","assets/Table.vue_vue_type_style_index_0_scoped_7b9e6ece_lang-BoW2DV_e.js","assets/componentMap-CElCaWis.js","assets/format-DgF6KtHk.js","assets/omit-B2_8Y6O_.js","assets/_flatRest-DBrd2CHT.js","assets/flatten-DeoUZLdb.js","assets/Table-Dcnz4X4a.css","assets/print-CT_2hrjP.js","assets/basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js","assets/basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js","assets/basicModal-DbyYhys_.css","assets/useModal-CO65vga3.js","assets/useTimeout-BxFilWvD.js","assets/Flex-CTSf12gq.js","assets/index-B9noisWz.js","assets/index-Ds_vZQnY.js","assets/index-CqZpnyYS.js"])))=>i.map(i=>d[i]);
import { d as X, e as $, f as F, V as J, a4 as Q, a as Z, r as m, ay as ee, ec as _, aw as te, d9 as ae, c as r, o as l, w as t, j as o, W as oe, H as ne, D as y, l as e, B as ie, p, A as d, ds as se, T as ce, ca as re, aE as le, X as ue, br as b, __tla as __tla_0 } from "./index-9PRMimni.js";
import { _ as me } from "./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";
import "./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";
import { T as pe } from "./tabsView-BuQA2jOW.js";
import { B as de, C as v, E as fe } from "./template-rpthWlT9.js";
import { B as _e } from "./Table-0PViRYCf.js";
import { u as ye } from "./useModal-CO65vga3.js";
import "./vuedraggable.umd-Co2xEC3p.js";
import "./element-resize-detector-D6t9qRKJ.js";
import "./Render.vue_vue_type_script_lang-DKUYY0Zw.js";
import "./index-kKnqLkWM.js";
import "./Table.vue_vue_type_style_index_0_scoped_7b9e6ece_lang-BoW2DV_e.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 "./componentSetting-DVhNDBTO.js";
import "./useTimeout-BxFilWvD.js";
import "./usePageCache-DluHn7Yy.js";
import "./tabsView-BXskTdVh.js";
import "./Flex-CTSf12gq.js";
let Ue;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })()
]).then(async ()=>{
    Ue = X({
        __name: "index",
        setup (be) {
            const T = {
                basicInfo: _(()=>b(()=>import("./index-DDYV1iAp.js").then(async (m)=>{
                            await m.__tla;
                            return m;
                        }), __vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27]))),
                causeAnalysis: _(()=>b(()=>import("./index-B6zl16ib.js").then(async (m)=>{
                            await m.__tla;
                            return m;
                        }), __vite__mapDeps([28,29,1,2,30,10,4,31,15,32,33,34,35,36,37,38,39,40,41,7,42,27,13,43,25,22]))),
                action: _(()=>b(()=>import("./index-B9noisWz.js").then(async (m)=>{
                            await m.__tla;
                            return m;
                        }), __vite__mapDeps([44,29,1,2,30,10,4,31,15,32,33,34,35,36,37,38,39,40,41,7,42,27,13,43,25,22]))),
                references: _(()=>b(()=>import("./index-Ds_vZQnY.js"), __vite__mapDeps([45,1,2]))),
                attachments: _(()=>b(()=>import("./index-CqZpnyYS.js"), __vite__mapDeps([46,3,4,1,2,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27])))
            }, A = $(), s = F(), { t: a } = J(), [P, { openModal: V }] = ye({
                title: a("hsqe.deficiency.historicalRecords"),
                closable: !1,
                maskClosable: !0,
                width: 680,
                subBtuText: a("common.okText"),
                cancelText: a("common.cancelText")
            }), E = [
                {
                    title: "Reviewed By",
                    key: "username"
                },
                {
                    title: "Reviewed Date",
                    key: "operateTime"
                },
                {
                    title: "Status",
                    key: "displayStatus"
                },
                {
                    title: "Review Comments",
                    key: "comment"
                }
            ], x = Q(()=>[
                    {
                        label: "General",
                        value: "basicInfo",
                        compPage: "basicInfo"
                    },
                    {
                        label: a("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.tabCauseAnalysis"),
                        value: "causeAnalysis",
                        compPage: "causeAnalysis"
                    },
                    {
                        label: a("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.tabAction"),
                        value: "action",
                        compPage: "action"
                    },
                    {
                        label: a("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.tabReferences"),
                        value: "references",
                        compPage: "references"
                    },
                    {
                        label: a("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.rabAttachments"),
                        value: "attachments",
                        compPage: "attachments"
                    }
                ]), h = Z({
                tabsList: x.value,
                collapsed: !1,
                activeKey: "basicInfo"
            }), I = m(), f = m(), w = m(), R = m("basicInfo"), c = m("basicInfo"), q = m(), C = m();
            ee(()=>c.value, (n)=>{
                console.log("watch currentTab", n), T[R.value] && (q.value = T[R.value]);
            }, {
                immediate: !0
            });
            async function B() {
                console.log(s.query.id), f.value = await de({
                    deficiencyId: s.query.id
                }), w.value = s.query.isEdit;
            }
            function N(n) {
                c.value = n.value, R.value = n.compPage || "basicInfo";
            }
            function j() {
                A.back();
            }
            async function L() {
                await v({
                    id: s.query.id,
                    operation: "commit"
                });
            }
            async function M() {
                if (c.value == "action") {
                    const i = C.value.getData()[0];
                    (i.correctActionReview == "YES" || i.correctActionReview == "NO") && await v({
                        id: s.query.id,
                        operation: i.correctActionReview == "YES" ? "superintendent_close" : "superintendent_reject",
                        operationMemo: i.comments
                    });
                }
            }
            async function O() {
                await v({
                    id: s.query.id,
                    operation: "captain_pass"
                });
            }
            async function S() {
                await v({
                    id: s.query.id,
                    operation: "captain_reject"
                });
            }
            function H() {
                I.value.reload();
            }
            const U = async ()=>{
                const n = await fe({
                    busId: s.query.id,
                    moduleCode: "approveDeficiency"
                });
                return {
                    list: n,
                    total: n.length
                };
            };
            function W() {
                V(), H();
            }
            function Y() {
                (c.value == "basicInfo" || c.value == "causeAnalysis" || c.value == "action" || c.value == "attachments") && C.value.submit();
            }
            return te(()=>{
                B();
            }), (n, i)=>{
                const u = ie, D = ne, k = oe, z = me, G = ue, K = ae("debounce");
                return l(), r(G, null, {
                    default: t(()=>[
                            o(k, null, {
                                default: t(()=>[
                                        o(D, {
                                            justify: "end"
                                        }, {
                                            default: t(()=>[
                                                    Number(e(f)?.hasDeficiencyCommit) === 1 ? (l(), r(u, {
                                                        key: 0,
                                                        onClick: L
                                                    }, {
                                                        default: t(()=>[
                                                                p(d(e(a)("hsqe.deficiency.deficiencyCommit")), 1)
                                                            ]),
                                                        _: 1
                                                    })) : y("", !0),
                                                    Number(e(f)?.hasOfficerCommit) === 1 ? (l(), r(u, {
                                                        key: 1,
                                                        onClick: M
                                                    }, {
                                                        default: t(()=>[
                                                                p(d(e(a)("hsqe.deficiency.officerCommit")), 1)
                                                            ]),
                                                        _: 1
                                                    })) : y("", !0),
                                                    Number(e(f)?.hasCaptainPass) === 1 ? (l(), r(u, {
                                                        key: 2,
                                                        onClick: O
                                                    }, {
                                                        default: t(()=>[
                                                                p(d(e(a)("hsqe.deficiency.captainPass")), 1)
                                                            ]),
                                                        _: 1
                                                    })) : y("", !0),
                                                    Number(e(f)?.hasCaptainReject) === 1 ? (l(), r(u, {
                                                        key: 3,
                                                        onClick: S
                                                    }, {
                                                        default: t(()=>[
                                                                p(d(e(a)("hsqe.deficiency.captainReject")), 1)
                                                            ]),
                                                        _: 1
                                                    })) : y("", !0),
                                                    o(u, {
                                                        onClick: W
                                                    }, {
                                                        default: t(()=>[
                                                                p(d(e(a)("hsqe.deficiency.historicalRecords")), 1)
                                                            ]),
                                                        _: 1
                                                    }),
                                                    o(u, {
                                                        type: "primary",
                                                        "icon-placement": "left",
                                                        onClick: j
                                                    }, {
                                                        default: t(()=>i[1] || (i[1] = [
                                                                p("Back")
                                                            ])),
                                                        _: 1
                                                    })
                                                ]),
                                            _: 1
                                        })
                                    ]),
                                _: 1
                            }),
                            o(k, {
                                bordered: !1,
                                class: "mt-3 py-3 proCard",
                                size: "small",
                                segmented: {
                                    content: !0
                                },
                                "content-style": "padding: 20px 15px 0 15px;"
                            }, {
                                default: t(()=>[
                                        o(pe, {
                                            modelValue: e(h),
                                            "onUpdate:modelValue": i[0] || (i[0] = (g)=>se(h) ? h.value = g : null),
                                            onChangeTab: N
                                        }, null, 8, [
                                            "modelValue"
                                        ]),
                                        o(ce, {
                                            name: "slide-fade",
                                            mode: "out-in"
                                        }, {
                                            default: t(()=>[
                                                    (l(), r(re(e(q)), {
                                                        key: e(c),
                                                        ref_key: "currentComponentRef",
                                                        ref: C
                                                    }))
                                                ]),
                                            _: 1
                                        })
                                    ]),
                                _: 1
                            }),
                            o(k, {
                                bordered: !1,
                                class: "mt-3 proCard"
                            }, {
                                default: t(()=>[
                                        e(w) ? (l(), r(D, {
                                            key: 0,
                                            justify: "end"
                                        }, {
                                            default: t(()=>[
                                                    le((l(), r(u, {
                                                        type: "primary"
                                                    }, {
                                                        default: t(()=>[
                                                                p(d(e(a)("common.submitText")), 1)
                                                            ]),
                                                        _: 1
                                                    })), [
                                                        [
                                                            K,
                                                            ()=>Y(),
                                                            "1000"
                                                        ]
                                                    ])
                                                ]),
                                            _: 1
                                        })) : y("", !0)
                                    ]),
                                _: 1
                            }),
                            o(z, {
                                onRegister: e(P),
                                ref: "modalRef"
                            }, {
                                default: t(()=>[
                                        o(e(_e), {
                                            columns: E,
                                            request: ()=>U(),
                                            "row-key": (g)=>g.id,
                                            ref_key: "basicTableRef",
                                            ref: I
                                        }, null, 8, [
                                            "request",
                                            "row-key"
                                        ])
                                    ]),
                                _: 1
                            }, 8, [
                                "onRegister"
                            ])
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { Ue as default, __tla };
