import { d as ee, e as te, f as ae, V as se, r, a4 as $, aw as oe, d9 as ne, c, o as n, w as t, i as l, j as s, W as ie, eW as re, l as e, h as ce, F as le, a9 as ue, eX as pe, T as me, aE as y, aF as T, H as de, aI as fe, p as k, A as g, B as _e, ca as I, gW as R, gX as x, D as z, X as ve, cZ as ye, __tla as __tla_0 } from "./index-9PRMimni.js";
import { _ as ge } from "./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";
import "./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";
import { E as be, N as he } from "./template-rpthWlT9.js";
import { g as ke, s as Ie } from "./nearMiss-mcPBHzBN.js";
import { B as Re } from "./Table-0PViRYCf.js";
import { _ as xe, __tla as __tla_1 } from "./historyModal.vue_vue_type_script_setup_true_lang-guV8BhDh.js";
import { _ as Ce, __tla as __tla_2 } from "./index.vue_vue_type_script_setup_true_lang-BXffd77H.js";
import we from "./index-C3HK1HYq.js";
import { _ as De } from "./index.vue_vue_type_script_setup_true_lang-q9psMoJt.js";
import { u as qe } from "./useModal-CO65vga3.js";
import "./index-kKnqLkWM.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 "./componentSetting-DVhNDBTO.js";
import "./useTimeout-BxFilWvD.js";
import "./usePageCache-DluHn7Yy.js";
import "./tabsView-BXskTdVh.js";
import "./Flex-CTSf12gq.js";
import "./ImageUpload.vue_vue_type_style_index_0_scoped_cb086928_lang-D-28kXvw.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.vue_vue_type_style_index_0_scoped_772d51cc_lang-Brp6PjEU.js";
import "./index-DkvzUEqh.js";
import { __tla as __tla_3 } from "./index.vue_vue_type_style_index_0_scoped_b974e5ec_lang-_0QwzFKM.js";
import "./jobOrder-CGbsc7bp.js";
import "./has-CjqcrIOV.js";
import { __tla as __tla_4 } from "./index-8tHZJCCW.js";
import "./TimelineItem-Bkds7ZW8.js";
import "./schemas-BmKi-UM9.js";
import "./props-CLtNejQT.js";
import "./BasicForm-dL_oCSPM.js";
import "./SingleImageUpload-CNx4b9eC.js";
import "./ImageUpload-DUsnro3W.js";
import "./BasicSelect-C_uwzMkE.js";
import "./dictionary-BRse4lkf.js";
import "./AutoComplete-Dv1Bqed4.js";
import "./TreeSelect-BZh2DeCh.js";
import "./hook-C9rOLWu_.js";
import "./planner-BebmniHR.js";
import "./account-C850CBTF.js";
import "./TableSelect.vue_vue_type_script_setup_true_lang-BAU5mgvB.js";
import "./useForm-CKmgcynv.js";
import "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import "./dateUtil-BtafrT1f.js";
let Nt;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_2;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_3;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_4;
        } catch  {}
    })()
]).then(async ()=>{
    let Te, Ae, Be;
    Te = {
        style: {
            height: "84vh"
        }
    };
    Ae = {
        class: "ml-3"
    };
    Be = {
        class: "max-h-[calc(100vh-200px)] overflow-y-auto p-2.5 hidden-scrollbar"
    };
    Nt = ee({
        __name: "index",
        setup (Me) {
            const A = te(), B = ae(), { t: o } = se(), M = ye(), b = r(!1), C = r(), w = r(), D = r(), i = r(B.query.id || null), [j] = qe({
                title: o("hsqe.deficiency.historicalRecords"),
                closable: !1,
                maskClosable: !0,
                width: 680,
                subBtuText: o("common.okText"),
                cancelText: o("common.cancelText")
            }), q = $(()=>[
                    {
                        label: o("hsqe.nc.general"),
                        value: "basicInfo",
                        compPage: "basicInfo"
                    },
                    {
                        label: o("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.tabCauseAnalysis"),
                        value: "causeAnalysis",
                        compPage: "causeAnalysis"
                    },
                    {
                        label: o("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.tabAction"),
                        value: "action",
                        compPage: "action"
                    }
                ]), L = r("process"), W = $(()=>q.value.findIndex((a)=>a.value === _.value) + 1), E = [
                {
                    title: "Reviewed By",
                    key: "username"
                },
                {
                    title: "Reviewed Date",
                    key: "operateTime"
                },
                {
                    title: "Status",
                    key: "displayStatus"
                },
                {
                    title: "Review Comments",
                    key: "comment"
                }
            ], F = r("basicInfo"), _ = r("basicInfo"), N = r(), V = r();
            async function H() {
                if (B.query.type === "view" ? b.value = !0 : b.value = !1, i.value) {
                    let a = await ke(i.value);
                    a && (C.value.initData(a.basic), w.value.initData(a.causeDtoList, a.basic.causeDetails), D.value.initData(a.basic), V.value = a);
                }
            }
            function X() {
                A.back();
            }
            function O(a) {
                const m = q.value[a];
                m && (_.value = m.value, F.value = m.compPage || "basicInfo");
            }
            const Z = async ()=>{
                const a = await be({
                    busId: i.value,
                    moduleCode: "approveDeficiency"
                });
                return {
                    list: a,
                    total: a.length
                };
            };
            function G() {
                N.value?.showModal(V.value);
            }
            function J() {
                M.success(o("hsqe.deficiency.operationSuccessful")), A.go(-1);
            }
            async function P(a) {
                let m = await C.value.getData(a), u = await w.value.getData(a), p = await D.value.getData(a);
                if (a && (!m || !u || !p)) return !1;
                let d = null;
                console.error("currentId.value", i.value), Array.isArray(i.value) && i.value.length > 0 ? d = i.value[0] : d = i.value;
                let v = {
                    doSubmit: a,
                    id: d
                };
                v.basic = {
                    ...u.formParams,
                    ...m.params,
                    ...p.params
                }, v.causeDtoList = u.params;
                const f = await Ie(v);
                i.value || (i.value = f.id), a ? (await he({
                    shipId: f.shipId,
                    busId: f.id,
                    moduleCode: f.moduleCode,
                    subModuleCode: f.subModuleCode
                }), J()) : M.success(o("common.saveSuccessText"));
            }
            return oe(()=>{
                H();
            }), (a, m)=>{
                const u = _e, p = fe, d = de, v = pe, f = re, K = ie, Q = ge, U = ve, S = ne("debounce");
                return n(), c(U, null, {
                    default: t(()=>[
                            l("div", Te, [
                                s(K, {
                                    bordered: !1,
                                    class: "py-3 proCard",
                                    size: "small",
                                    segmented: {
                                        content: !0
                                    },
                                    "content-style": "padding: 20px 15px 0 15px;"
                                }, {
                                    header: t(()=>[
                                            l("div", null, [
                                                s(d, {
                                                    justify: "space-between",
                                                    align: "center"
                                                }, {
                                                    default: t(()=>[
                                                            s(d, {
                                                                justify: "start",
                                                                align: "center"
                                                            }, {
                                                                default: t(()=>[
                                                                        s(p, {
                                                                            trigger: "hover"
                                                                        }, {
                                                                            trigger: t(()=>[
                                                                                    s(u, {
                                                                                        border: !1,
                                                                                        type: "text",
                                                                                        class: "size-8",
                                                                                        onClick: X
                                                                                    }, {
                                                                                        icon: t(()=>[
                                                                                                (n(), c(I(e(R)(e(x).back, "text-[16px]"))))
                                                                                            ]),
                                                                                        _: 1
                                                                                    })
                                                                                ]),
                                                                            default: t(()=>[
                                                                                    k(" " + g(e(o)("hsqe.noticeCircular.back")), 1)
                                                                                ]),
                                                                            _: 1
                                                                        }),
                                                                        s(p, {
                                                                            trigger: "click"
                                                                        }, {
                                                                            trigger: t(()=>[
                                                                                    l("span", null, g(e(o)("hsqe.nearMiss.NearMissReport")), 1)
                                                                                ]),
                                                                            _: 1
                                                                        })
                                                                    ]),
                                                                _: 1
                                                            }),
                                                            s(d, {
                                                                justify: "end"
                                                            }, {
                                                                default: t(()=>[
                                                                        e(b) ? z("", !0) : (n(), c(p, {
                                                                            key: 0,
                                                                            trigger: "hover"
                                                                        }, {
                                                                            trigger: t(()=>[
                                                                                    y((n(), c(u, {
                                                                                        type: "primary",
                                                                                        strong: "",
                                                                                        secondary: "",
                                                                                        bordered: "",
                                                                                        class: "size-8"
                                                                                    }, {
                                                                                        icon: t(()=>[
                                                                                                (n(), c(I(e(R)(e(x).save, "text-[16px]"))))
                                                                                            ]),
                                                                                        _: 1
                                                                                    })), [
                                                                                        [
                                                                                            S,
                                                                                            ()=>P(!1),
                                                                                            "1000"
                                                                                        ]
                                                                                    ])
                                                                                ]),
                                                                            default: t(()=>[
                                                                                    k(" " + g(e(o)("hsqe.deficiency.deficiencySave")), 1)
                                                                                ]),
                                                                            _: 1
                                                                        })),
                                                                        e(b) ? z("", !0) : (n(), c(p, {
                                                                            key: 1,
                                                                            trigger: "hover"
                                                                        }, {
                                                                            trigger: t(()=>[
                                                                                    y((n(), c(u, {
                                                                                        type: "primary",
                                                                                        strong: "",
                                                                                        secondary: "",
                                                                                        bordered: "",
                                                                                        class: "size-8"
                                                                                    }, {
                                                                                        icon: t(()=>[
                                                                                                (n(), c(I(e(R)(e(x).submit, "text-[16px]"))))
                                                                                            ]),
                                                                                        _: 1
                                                                                    })), [
                                                                                        [
                                                                                            S,
                                                                                            ()=>P(!0),
                                                                                            "1000"
                                                                                        ]
                                                                                    ])
                                                                                ]),
                                                                            default: t(()=>[
                                                                                    k(" " + g(e(o)("hsqe.deficiency.deficiencyCommit")), 1)
                                                                                ]),
                                                                            _: 1
                                                                        })),
                                                                        s(p, {
                                                                            trigger: "hover"
                                                                        }, {
                                                                            trigger: t(()=>[
                                                                                    s(u, {
                                                                                        type: "primary",
                                                                                        strong: "",
                                                                                        secondary: "",
                                                                                        bordered: "",
                                                                                        class: "size-8",
                                                                                        onClick: G
                                                                                    }, {
                                                                                        icon: t(()=>[
                                                                                                (n(), c(I(e(R)(e(x).log, "text-[16px]"))))
                                                                                            ]),
                                                                                        _: 1
                                                                                    })
                                                                                ]),
                                                                            default: t(()=>[
                                                                                    k(" " + g(e(o)("hsqe.deficiency.historicalRecords")), 1)
                                                                                ]),
                                                                            _: 1
                                                                        })
                                                                    ]),
                                                                _: 1
                                                            })
                                                        ]),
                                                    _: 1
                                                })
                                            ])
                                        ]),
                                    default: t(()=>[
                                            l("div", Ae, [
                                                s(f, {
                                                    current: e(W),
                                                    status: e(L),
                                                    class: "mb-4"
                                                }, {
                                                    default: t(()=>[
                                                            (n(!0), ce(le, null, ue(e(q), (h, Y)=>(n(), c(v, {
                                                                    key: h.value,
                                                                    title: h.label,
                                                                    onClick: (Ne)=>O(Y),
                                                                    class: "cursor-pointer"
                                                                }, null, 8, [
                                                                    "title",
                                                                    "onClick"
                                                                ]))), 128))
                                                        ]),
                                                    _: 1
                                                }, 8, [
                                                    "current",
                                                    "status"
                                                ])
                                            ]),
                                            l("div", Be, [
                                                s(me, {
                                                    name: "slide-fade",
                                                    mode: "out-in"
                                                }, {
                                                    default: t(()=>[
                                                            l("div", null, [
                                                                y(l("div", null, [
                                                                    s(Ce, {
                                                                        ref_key: "basicInfoRef",
                                                                        ref: C
                                                                    }, null, 512)
                                                                ], 512), [
                                                                    [
                                                                        T,
                                                                        e(_) === "basicInfo"
                                                                    ]
                                                                ]),
                                                                y(l("div", null, [
                                                                    s(we, {
                                                                        ref_key: "causeAnalysisRef",
                                                                        ref: w
                                                                    }, null, 512)
                                                                ], 512), [
                                                                    [
                                                                        T,
                                                                        e(_) === "causeAnalysis"
                                                                    ]
                                                                ]),
                                                                y(l("div", null, [
                                                                    s(De, {
                                                                        ref_key: "actionRef",
                                                                        ref: D
                                                                    }, null, 512)
                                                                ], 512), [
                                                                    [
                                                                        T,
                                                                        e(_) === "action"
                                                                    ]
                                                                ])
                                                            ])
                                                        ]),
                                                    _: 1
                                                })
                                            ])
                                        ]),
                                    _: 1
                                })
                            ]),
                            s(Q, {
                                onRegister: e(j),
                                ref: "modalRef"
                            }, {
                                default: t(()=>[
                                        s(e(Re), {
                                            columns: E,
                                            request: ()=>Z(),
                                            "row-key": (h)=>h.id,
                                            ref: "basicTableRef"
                                        }, null, 8, [
                                            "request",
                                            "row-key"
                                        ])
                                    ]),
                                _: 1
                            }, 8, [
                                "onRegister"
                            ]),
                            s(xe, {
                                ref_key: "historyModalRef",
                                ref: N
                            }, null, 512)
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { Nt as default, __tla };
